Fork me on GitHub

Changeset fc4e460 in git


Ignore:
Timestamp:
Sep 9, 2014, 1:26:52 PM (10 years ago)
Author:
Michele <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
fcc959c
Parents:
492aef9
Message:

removed muon check in jet constituent loop. Added comments to example macros

Location:
examples
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • examples/Example1.C

    r492aef9 rfc4e460  
    11/*
     2
     3Simple macro showing how to access branches from the delphes output root file,
     4loop over events, and plot simple quantities such as the jet pt and the di-electron invariant
     5mass.
     6
    27root -l examples/Example1.C\(\"delphes_output.root\"\)
    38*/
     
    4146     
    4247      // Print jet transverse momentum
    43       cout << jet->PT << endl;
     48      cout << "Jet pt: "<<jet->PT << endl;
    4449    }
    4550
  • examples/Example2.C

    r492aef9 rfc4e460  
    11/*
     2
     3Simple macro showing how to access branches from the delphes output root file,
     4loop over events, store histograms in a root file and print them as image files. 
     5
    26root -l examples/Example2.C\(\"delphes_output.root\"\)
    37*/
  • examples/Example3.C

    r492aef9 rfc4e460  
    11/*
     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
    26root -l examples/Example3.C\(\"delphes_output.root\"\)
    37*/
     
    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.