Fork me on GitHub

Changeset 1357 in svn for trunk/examples/Example3.C


Ignore:
Timestamp:
Mar 9, 2014, 12:10:05 PM (11 years ago)
Author:
Michele Selvaggi
Message:

separated Photon and Neutral Hadron components in particle algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/Example3.C

    r1339 r1357  
    2020  TH1 *fTrackDeltaEta;
    2121
    22   TH1 *fTowerDeltaEem;
    23   TH1 *fTowerDeltaEhad;
    24 
    2522  TH1 *fJetDeltaPT;
    2623};
     
    8279    "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks",
    8380    100, -0.1, 0.1);
    84 
    85   plots->fTowerDeltaEem = result->AddHist1D(
    86     "tower delta Eem", "(Eem^{particles} - Eem^{tower})/Eem^{particles}",
    87     "(Eem^{particles} - Eem^{tower})/Eem^{particles}", "number of tower",
    88     100, -0.5, 0.5);
    89 
    90   plots->fTowerDeltaEhad = result->AddHist1D(
    91     "tower delta Ehad", "(Ehad^{particles} - Ehad^{tower})/Ehad^{particles}",
    92     "(Ehad^{particles} - Ehad^{tower})/Ehad^{particles}", "number of tower",
    93     100, -5.0, 5.0);
    9481
    9582  plots->fJetDeltaPT = result->AddHist1D(
     
    11097
    11198  TClonesArray *branchEFlowTrack = treeReader->UseBranch("EFlowTrack");
    112   TClonesArray *branchEFlowTower = treeReader->UseBranch("EFlowTower");
     99  TClonesArray *branchEFlowPhoton = treeReader->UseBranch("EFlowPhoton");
     100  TClonesArray *branchEFlowNeutralHadron = treeReader->UseBranch("EFlowNeutralHadron");
    113101  TClonesArray *branchJet = treeReader->UseBranch("Jet");
    114102
     
    188176    }
    189177
    190     // Loop over all towers in event
    191     for(i = 0; i < branchEFlowTower->GetEntriesFast(); ++i)
    192     {
    193       tower = (Tower*) branchEFlowTower->At(i);
    194 
    195       Eem = 0.0;
    196       Ehad = 0.0;
    197       skip = kFALSE;
    198       for(j = 0; j < tower->Particles.GetEntriesFast(); ++j)
    199       {
    200         particle = (GenParticle*) tower->Particles.At(j);
    201         pdgCode = TMath::Abs(particle->PID);
    202 
    203         // skip muons and neutrinos
    204         if(pdgCode == 12 || pdgCode == 13 || pdgCode == 14 || pdgCode == 16)
    205         {
    206           continue;
    207         }
    208 
    209         // skip K0short and Lambda
    210         if(pdgCode == 310 || pdgCode == 3122)
    211         {
    212           skip = kTRUE;
    213         }
    214 
    215         if(pdgCode == 11 || pdgCode == 22)
    216         {
    217           Eem += particle->E;
    218         }
    219         else
    220         {
    221           Ehad += particle->E;
    222         }
    223       }
    224       if(skip) continue;
    225       if(Eem > 0.0 && tower->Eem > 0.0) plots->fTowerDeltaEem->Fill((Eem - tower->Eem)/Eem);
    226       if(Ehad > 0.0 && tower->Ehad > 0.0) plots->fTowerDeltaEhad->Fill((Ehad - tower->Ehad)/Ehad);
    227     }
     178    cout<<"--  New event -- "<<endl;
    228179
    229180    // Loop over all jets in event
     
    233184
    234185      momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
     186
     187      cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;     
    235188
    236189      // Loop over all jet's constituents
     
    244197        if(object->IsA() == GenParticle::Class())
    245198        {
     199          cout<<"    GenPart pt: "<<((GenParticle*) object)->PT<<", eta: "<<((GenParticle*) object)->Eta<<", phi: "<<((GenParticle*) object)->Phi<<endl;
    246200          momentum += ((GenParticle*) object)->P4();
    247201        }
    248202        else if(object->IsA() == Track::Class())
    249203        {
     204          cout<<"    Track pt: "<<((Track*) object)->PT<<", eta: "<<((Track*) object)->Eta<<", phi: "<<((Track*) object)->Phi<<endl;
    250205          momentum += ((Track*) object)->P4();
    251206        }
    252207        else if(object->IsA() == Tower::Class())
    253208        {
     209          cout<<"    Tower pt: "<<((Tower*) object)->ET<<", eta: "<<((Tower*) object)->Eta<<", phi: "<<((Tower*) object)->Phi<<endl;
    254210          momentum += ((Tower*) object)->P4();
    255211        }
    256212        else if(object->IsA() == Muon::Class())
    257213        {
     214          cout<<"    Muon pt: "<<((Muon*) object)->PT<<", eta: "<<((Muon*) object)->Eta<<", phi: "<<((Muon*) object)->Phi<<endl;
    258215          momentum += ((Muon*) object)->P4();
    259216        }
Note: See TracChangeset for help on using the changeset viewer.