Changes in readers/DelphesPythia8.cpp [78d1846:341014c] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
readers/DelphesPythia8.cpp
r78d1846 r341014c 17 17 */ 18 18 19 #include <stdexcept>20 19 #include <iostream> 21 20 #include <sstream> 21 #include <stdexcept> 22 22 #include <string> 23 23 … … 27 27 #include "Pythia8Plugins/CombineMatchingInput.h" 28 28 29 #include "TApplication.h" 29 30 #include "TROOT.h" 30 #include "TApplication.h" 31 31 32 #include "TDatabasePDG.h" 32 33 #include "TFile.h" 34 #include "TLorentzVector.h" 33 35 #include "TObjArray.h" 36 #include "TParticlePDG.h" 34 37 #include "TStopwatch.h" 35 #include "TDatabasePDG.h" 36 #include "TParticlePDG.h" 37 #include "TLorentzVector.h" 38 39 #include "modules/Delphes.h" 38 40 39 #include "classes/DelphesClasses.h" 41 40 #include "classes/DelphesFactory.h" 42 41 #include "classes/DelphesLHEFReader.h" 43 42 #include "modules/Delphes.h" 43 44 #include "ExRootAnalysis/ExRootProgressBar.h" 45 #include "ExRootAnalysis/ExRootTreeBranch.h" 44 46 #include "ExRootAnalysis/ExRootTreeWriter.h" 45 #include "ExRootAnalysis/ExRootTreeBranch.h"46 #include "ExRootAnalysis/ExRootProgressBar.h"47 47 48 48 using namespace std; … … 98 98 pid = particle.id(); 99 99 status = particle.statusHepMC(); 100 px = particle.px(); py = particle.py(); pz = particle.pz(); e = particle.e(); mass = particle.m(); 101 x = particle.xProd(); y = particle.yProd(); z = particle.zProd(); t = particle.tProd(); 100 px = particle.px(); 101 py = particle.py(); 102 pz = particle.pz(); 103 e = particle.e(); 104 mass = particle.m(); 105 x = particle.xProd(); 106 y = particle.yProd(); 107 z = particle.zProd(); 108 t = particle.tProd(); 102 109 103 110 candidate = factory->NewCandidate(); … … 115 122 116 123 pdgParticle = pdg->GetParticle(pid); 117 candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge() /3.0) : -999;124 candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge() / 3.0) : -999; 118 125 candidate->Mass = mass; 119 126 … … 166 173 167 174 // pMin = 0.1 GeV for single particles 168 pp = pow(10, - 175 pp = pow(10, -1.0 + (log10(pMax) + 1.0) * rndm.flat()); 169 176 eta = (2.0 * rndm.flat() - 1.0) * etaMax; 170 177 phi = 2.0 * M_PI * rndm.flat(); 171 178 mm = pdt.mSel(id); 172 ee = Pythia8::sqrtpos(pp *pp + mm*mm);179 ee = Pythia8::sqrtpos(pp * pp + mm * mm); 173 180 pt = pp / cosh(eta); 174 181 … … 193 200 phi = 2.0 * M_PI * rndm.flat(); 194 201 mm = pdt.mSel(id); 195 ee = Pythia8::sqrtpos(pp *pp + mm*mm);202 ee = Pythia8::sqrtpos(pp * pp + mm * mm); 196 203 pt = pp / cosh(eta); 197 204 198 if( 205 if((id == 4 || id == 5) && pt < 10.0) return; 199 206 200 207 if(id == 21) … … 238 245 // for matching 239 246 Pythia8::CombineMatchingInput *combined = 0; 240 Pythia8::UserHooks *matching = 0;247 Pythia8::UserHooks *matching = 0; 241 248 242 249 if(argc != 4) 243 250 { 244 cout << " Usage: " << appName << " config_file" << " pythia_card" << " output_file" << endl; 251 cout << " Usage: " << appName << " config_file" 252 << " pythia_card" 253 << " output_file" << endl; 245 254 cout << " config_file - configuration file in Tcl format," << endl; 246 255 cout << " pythia_card - Pythia8 configuration file," << endl; … … 293 302 } 294 303 pythia->setUserHooksPtr(matching); 295 296 304 297 305 if(pythia == NULL) … … 348 356 for(eventCounter = 0; eventCounter < numberOfEvents && !interrupted; ++eventCounter) 349 357 { 350 while(reader && reader->ReadBlock(factory, allParticleOutputArrayLHEF, 351 stableParticleOutputArrayLHEF, partonOutputArrayLHEF) && !reader->EventReady());358 while(reader && reader->ReadBlock(factory, allParticleOutputArrayLHEF, stableParticleOutputArrayLHEF, partonOutputArrayLHEF) && !reader->EventReady()) 359 ; 352 360 353 361 if(spareFlag1)
Note:
See TracChangeset
for help on using the changeset viewer.