Fork me on GitHub

Changeset b4cd1e7 in git for examples


Ignore:
Timestamp:
Oct 12, 2014, 11:12:55 PM (10 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
a844c07
Parents:
c4d879d
Message:

Added MET to the display

First version. The MET vector appears properly on the 3D view but not on
the projections... Why?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/geometry.C

    rc4d879d rb4cd1e7  
    7474TClonesArray *gBranchTrack = 0;
    7575TClonesArray *gBranchJet = 0;
     76TClonesArray *gBranchMet = 0;
    7677
    7778DelphesCaloData *gCaloData = 0;
    7879TEveElementList *gJetList = 0;
     80TEveArrow *gMet = 0;
    7981TEveTrackList *gTrackList = 0;
    8082
     
    529531   gBranchTrack = gTreeReader->UseBranch("Track");
    530532   gBranchJet   = gTreeReader->UseBranch("Jet");
     533   gBranchMet   = gTreeReader->UseBranch("MissingET");
    531534
    532535//TODO make it configurable, for more objects (or can we guess from the config?)
     
    563566   gJetList = new TEveElementList("Jets");
    564567   gEve->AddElement(gJetList);
     568
     569   gMet = new TEveArrow(1., 0., 0., 0., 0., 0.);
     570   gMet->SetMainColor(kViolet);
     571   gMet->SetTubeR(0.02);
     572   gMet->SetPickable(kTRUE);
     573   gMet->SetName("Missing Et");
     574   gEve->GetCurrentEvent()->AddElement(gMet);
    565575
    566576   gTrackList = new TEveTrackList("Tracks");
     
    634644  TIter itTrack(gBranchTrack);
    635645  TIter itJet(gBranchJet);
     646  TIter itMet(gBranchMet);
    636647
    637648  Tower *tower;
    638649  Track *track;
    639650  Jet *jet;
     651  MissingET *MET;
    640652
    641653  TEveJetCone *eveJetCone;
     
    643655
    644656  Int_t counter;
     657  Float_t maxPt = 0.;
    645658
    646659  TEveTrackPropagator *trkProp = gTrackList->GetPropagator();
     
    686699    gTrackList->AddElement(eveTrack);
    687700    eveTrack->MakeTrack();
     701    maxPt = maxPt > track->PT ? maxPt : track->PT;
    688702  }
    689703  // Loop over all jets
     
    700714    eveJetCone->AddEllipticCone(jet->Eta, jet->Phi, jet->DeltaEta, jet->DeltaPhi);
    701715    gJetList->AddElement(eveJetCone);
     716    maxPt = maxPt > jet->PT ? maxPt : jet->PT;
     717  }
     718
     719  // Missing Et
     720  // recipe: gRadius * MET/maxpt(tracks, jets)
     721  itMet.Reset();
     722  while((MET = (MissingET*) itMet.Next())) {
     723    delete gMet;
     724    gMet = new TEveArrow((gRadius * MET->MET/maxPt)*cos(MET->Phi), (gRadius * MET->MET/maxPt)*sin(MET->Phi), 0., 0., 0., 0.);
     725    gMet->SetMainColor(kViolet);
     726//    gMet->SetTubeR(0.04);
     727    gMet->SetPickable(kTRUE);
     728    gMet->SetName("Missing Et");
     729    gMet->SetTitle(Form("Missing Et (%.1f GeV)",MET->MET));
     730    gMet->ProjectAllChildren();
     731    gEve->GetCurrentEvent()->AddElement(gMet);
    702732  }
    703733}
Note: See TracChangeset for help on using the changeset viewer.