Changeset 341014c in git for converters/pileup2root.cpp
- Timestamp:
- Feb 12, 2019, 9:29:17 PM (6 years ago)
- Branches:
- ImprovedOutputFile, Timing, llp, master
- Children:
- 6455202
- Parents:
- 45e58be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
converters/pileup2root.cpp
r45e58be r341014c 17 17 */ 18 18 19 20 #include <stdexcept>21 19 #include <iostream> 22 20 #include <sstream> 23 24 #include <stdlib.h> 21 #include <stdexcept> 22 25 23 #include <signal.h> 26 24 #include <stdio.h> 27 25 #include <stdlib.h> 26 27 #include "TApplication.h" 28 28 #include "TROOT.h" 29 #include "TApplication.h" 30 29 30 #include "TDatabasePDG.h" 31 31 #include "TFile.h" 32 #include "TLorentzVector.h" 32 33 #include "TObjArray.h" 34 #include "TParticlePDG.h" 33 35 #include "TStopwatch.h" 34 #include "TDatabasePDG.h" 35 #include "TParticlePDG.h" 36 #include "TLorentzVector.h" 37 38 #include "classes/DelphesStream.h" 36 39 37 #include "classes/DelphesClasses.h" 40 38 #include "classes/DelphesFactory.h" 41 39 #include "classes/DelphesPileUpReader.h" 42 40 #include "classes/DelphesStream.h" 41 42 #include "ExRootAnalysis/ExRootProgressBar.h" 43 #include "ExRootAnalysis/ExRootTreeBranch.h" 43 44 #include "ExRootAnalysis/ExRootTreeWriter.h" 44 #include "ExRootAnalysis/ExRootTreeBranch.h"45 #include "ExRootAnalysis/ExRootProgressBar.h"46 45 47 46 using namespace std; … … 62 61 while(reader->ReadParticle(pid, x, y, z, t, px, py, pz, e)) 63 62 { 64 particle = static_cast<GenParticle *>(branch->NewEntry());63 particle = static_cast<GenParticle *>(branch->NewEntry()); 65 64 66 65 particle->PID = pid; … … 84 83 85 84 pdgParticle = pdg->GetParticle(pid); 86 particle->Charge = pdgParticle ? Int_t(pdgParticle->Charge() /3.0) : -999;85 particle->Charge = pdgParticle ? Int_t(pdgParticle->Charge() / 3.0) : -999; 87 86 88 87 particle->Mass = pdgParticle ? pdgParticle->Mass() : -999.9; … … 92 91 cosTheta = TMath::Abs(momentum.CosTheta()); 93 92 signPz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0; 94 eta = (cosTheta == 1.0 ? signPz *999.9 : momentum.Eta());95 rapidity = (cosTheta == 1.0 ? signPz *999.9 : momentum.Rapidity());93 eta = (cosTheta == 1.0 ? signPz * 999.9 : momentum.Eta()); 94 rapidity = (cosTheta == 1.0 ? signPz * 999.9 : momentum.Rapidity()); 96 95 97 96 particle->Eta = eta; … … 126 125 if(argc != 3) 127 126 { 128 cout << " Usage: " << appName << " output_file" << " input_file" << endl; 127 cout << " Usage: " << appName << " output_file" 128 << " input_file" << endl; 129 129 cout << " output_file - output file in ROOT format," << endl; 130 130 cout << " input_file - input binary pile-up file." << endl; … … 199 199 } 200 200 } 201 202
Note:
See TracChangeset
for help on using the changeset viewer.