Fork me on GitHub

Changeset 49234af in git for examples/Example3.C


Ignore:
Timestamp:
Dec 9, 2014, 1:27:13 PM (10 years ago)
Author:
Michele <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
37deb3b, 9e991f8
Parents:
f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'TestFastJet310b1'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/Example3.C

    rf6b6ee7 r49234af  
    11/*
     2This macro shows how to access the particle-level reference for reconstructed objects.
     3It is also shown how to loop over the jet constituents.
     4
    25root -l examples/Example3.C'("delphes_output.root")'
    36*/
     
    3639
    3740  plots->fElectronDeltaPT = result->AddHist1D(
    38     "electron delta pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}",
     41    "electron_delta_pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}",
    3942    "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}", "number of electrons",
    4043    100, -0.1, 0.1);
    4144
    4245  plots->fElectronDeltaEta = result->AddHist1D(
    43     "electron delta eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}",
     46    "electron_delta_eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}",
    4447    "(#eta^{particle} - #eta^{electron})/#eta^{particle}", "number of electrons",
    4548    100, -0.1, 0.1);
    4649
    4750  plots->fPhotonDeltaPT = result->AddHist1D(
    48     "photon delta pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}",
     51    "photon_delta_pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}",
    4952    "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}", "number of photons",
    5053    100, -0.1, 0.1);
    5154
    5255  plots->fPhotonDeltaEta = result->AddHist1D(
    53     "photon delta eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}",
     56    "photon_delta_eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}",
    5457    "(#eta^{particle} - #eta^{photon})/#eta^{particle}", "number of photons",
    5558    100, -0.1, 0.1);
    5659
    5760  plots->fPhotonDeltaE = result->AddHist1D(
    58     "photon delta energy", "(E^{particle} - E^{photon})/E^{particle}",
     61    "photon_delta_energy", "(E^{particle} - E^{photon})/E^{particle}",
    5962    "(E^{particle} - E^{photon})/E^{particle}", "number of photons",
    6063    100, -0.1, 0.1);
    6164
    6265  plots->fMuonDeltaPT = result->AddHist1D(
    63     "muon delta pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}",
     66    "muon_delta_pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}",
    6467    "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}", "number of muons",
    6568    100, -0.1, 0.1);
    6669
    6770  plots->fMuonDeltaEta = result->AddHist1D(
    68     "muon delta eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}",
     71    "muon_delta_eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}",
    6972    "(#eta^{particle} - #eta^{muon})/#eta^{particle}", "number of muons",
    7073    100, -0.1, 0.1);
    7174
    7275  plots->fTrackDeltaPT = result->AddHist1D(
    73     "track delta pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}",
     76    "track_delta_pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}",
    7477    "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}", "number of tracks",
    7578    100, -0.1, 0.1);
    7679
    7780  plots->fTrackDeltaEta = result->AddHist1D(
    78     "track delta eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}",
     81    "track_delta_eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}",
    7982    "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks",
    8083    100, -0.1, 0.1);
    8184
    8285  plots->fJetDeltaPT = result->AddHist1D(
    83     "jet delta pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}",
     86    "jet_delta_pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}",
    8487    "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}", "number of jets",
    8588    100, -1.0e-1, 1.0e-1);
     
    179182    }
    180183
    181     cout<<"--  New event -- "<<endl;
     184  //  cout<<"--  New event -- "<<endl;
    182185
    183186    // Loop over all jets in event
     
    188191      momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
    189192
    190       cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;     
     193      //cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;     
    191194
    192195      // Loop over all jet's constituents
     
    201204        {
    202205          particle = (GenParticle*) object;
    203           cout << "    GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl;
     206          //cout << "    GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl;
    204207          momentum += particle->P4();
    205208        }
     
    207210        {
    208211          track = (Track*) object;
    209           cout << "    Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;
     212          //cout << "    Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;
    210213          momentum += track->P4();
    211214        }
     
    213216        {
    214217          tower = (Tower*) object;
    215           cout << "    Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl;
     218          //cout << "    Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl;
    216219          momentum += tower->P4();
    217         }
    218         else if(object->IsA() == Muon::Class())
    219         {
    220           muon = (Muon*) object;
    221           cout << "    Muon pt: " << muon->PT << ", eta: " << muon->Eta << ", phi: " << muon->Phi << endl;
    222           momentum += muon->P4();
    223220        }
    224221      }
Note: See TracChangeset for help on using the changeset viewer.