Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/Example3.C

    r21f3c04 rfc4e460  
    11/*
    2 root -l examples/Example3.C'("delphes_output.root")'
     2
     3This macro shows how to access the particle-level reference for reconstructed objects.
     4It is also shown how to loop over the jet constituents.
     5
     6root -l examples/Example3.C\(\"delphes_output.root\"\)
    37*/
    48
     
    3640
    3741  plots->fElectronDeltaPT = result->AddHist1D(
    38     "electron delta pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}",
     42    "electron_delta_pt", "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}",
    3943    "(p_{T}^{particle} - p_{T}^{electron})/p_{T}^{particle}", "number of electrons",
    4044    100, -0.1, 0.1);
    4145
    4246  plots->fElectronDeltaEta = result->AddHist1D(
    43     "electron delta eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}",
     47    "electron_delta_eta", "(#eta^{particle} - #eta^{electron})/#eta^{particle}",
    4448    "(#eta^{particle} - #eta^{electron})/#eta^{particle}", "number of electrons",
    4549    100, -0.1, 0.1);
    4650
    4751  plots->fPhotonDeltaPT = result->AddHist1D(
    48     "photon delta pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}",
     52    "photon_delta_pt", "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}",
    4953    "(p_{T}^{particle} - p_{T}^{photon})/p_{T}^{particle}", "number of photons",
    5054    100, -0.1, 0.1);
    5155
    5256  plots->fPhotonDeltaEta = result->AddHist1D(
    53     "photon delta eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}",
     57    "photon_delta_eta", "(#eta^{particle} - #eta^{photon})/#eta^{particle}",
    5458    "(#eta^{particle} - #eta^{photon})/#eta^{particle}", "number of photons",
    5559    100, -0.1, 0.1);
    5660
    5761  plots->fPhotonDeltaE = result->AddHist1D(
    58     "photon delta energy", "(E^{particle} - E^{photon})/E^{particle}",
     62    "photon_delta_energy", "(E^{particle} - E^{photon})/E^{particle}",
    5963    "(E^{particle} - E^{photon})/E^{particle}", "number of photons",
    6064    100, -0.1, 0.1);
    6165
    6266  plots->fMuonDeltaPT = result->AddHist1D(
    63     "muon delta pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}",
     67    "muon_delta_pt", "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}",
    6468    "(p_{T}^{particle} - p_{T}^{muon})/p_{T}^{particle}", "number of muons",
    6569    100, -0.1, 0.1);
    6670
    6771  plots->fMuonDeltaEta = result->AddHist1D(
    68     "muon delta eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}",
     72    "muon_delta_eta", "(#eta^{particle} - #eta^{muon})/#eta^{particle}",
    6973    "(#eta^{particle} - #eta^{muon})/#eta^{particle}", "number of muons",
    7074    100, -0.1, 0.1);
    7175
    7276  plots->fTrackDeltaPT = result->AddHist1D(
    73     "track delta pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}",
     77    "track_delta_pt", "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}",
    7478    "(p_{T}^{particle} - p_{T}^{track})/p_{T}^{particle}", "number of tracks",
    7579    100, -0.1, 0.1);
    7680
    7781  plots->fTrackDeltaEta = result->AddHist1D(
    78     "track delta eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}",
     82    "track_delta_eta", "(#eta^{particle} - #eta^{track})/#eta^{particle}",
    7983    "(#eta^{particle} - #eta^{track})/#eta^{particle}", "number of tracks",
    8084    100, -0.1, 0.1);
    8185
    8286  plots->fJetDeltaPT = result->AddHist1D(
    83     "jet delta pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}",
     87    "jet_delta_pt", "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}",
    8488    "(p_{T}^{jet} - p_{T}^{constituents})/p_{T}^{jet}", "number of jets",
    8589    100, -1.0e-1, 1.0e-1);
     
    179183    }
    180184
    181     cout<<"--  New event -- "<<endl;
     185  //  cout<<"--  New event -- "<<endl;
    182186
    183187    // Loop over all jets in event
     
    188192      momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
    189193
    190       cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;     
     194      //cout<<"Looping over jet constituents. Jet pt: "<<jet->PT<<", eta: "<<jet->Eta<<", phi: "<<jet->Phi<<endl;     
    191195
    192196      // Loop over all jet's constituents
     
    201205        {
    202206          particle = (GenParticle*) object;
    203           cout << "    GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl;
     207          //cout << "    GenPart pt: " << particle->PT << ", eta: " << particle->Eta << ", phi: " << particle->Phi << endl;
    204208          momentum += particle->P4();
    205209        }
     
    207211        {
    208212          track = (Track*) object;
    209           cout << "    Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;
     213          //cout << "    Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;
    210214          momentum += track->P4();
    211215        }
     
    213217        {
    214218          tower = (Tower*) object;
    215           cout << "    Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl;
     219          //cout << "    Tower pt: " << tower->ET << ", eta: " << tower->Eta << ", phi: " << tower->Phi << endl;
    216220          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();
    223221        }
    224222      }
Note: See TracChangeset for help on using the changeset viewer.