Changeset 341014c in git for modules/PileUpMergerPythia8.cc
- 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
-
modules/PileUpMergerPythia8.cc
r45e58be r341014c 29 29 #include "classes/DelphesClasses.h" 30 30 #include "classes/DelphesFactory.h" 31 #include "classes/DelphesPileUpReader.h" 31 32 #include "classes/DelphesTF2.h" 32 #include "classes/DelphesPileUpReader.h" 33 33 34 #include "ExRootAnalysis/ExRootClassifier.h" 35 #include "ExRootAnalysis/ExRootFilter.h" 34 36 #include "ExRootAnalysis/ExRootResult.h" 35 #include "ExRootAnalysis/ExRootFilter.h"36 #include "ExRootAnalysis/ExRootClassifier.h"37 37 38 38 #include "Pythia.h" 39 39 40 #include "TDatabasePDG.h" 41 #include "TFormula.h" 42 #include "TLorentzVector.h" 40 43 #include "TMath.h" 44 #include "TObjArray.h" 45 #include "TRandom3.h" 41 46 #include "TString.h" 42 #include "TFormula.h"43 #include "TRandom3.h"44 #include "TObjArray.h"45 #include "TDatabasePDG.h"46 #include "TLorentzVector.h"47 47 48 48 #include <algorithm> 49 #include <stdexcept>50 49 #include <iostream> 51 50 #include <sstream> 51 #include <stdexcept> 52 52 53 53 using namespace std; … … 76 76 fPileUpDistribution = GetInt("PileUpDistribution", 0); 77 77 78 fMeanPileUp 78 fMeanPileUp = GetDouble("MeanPileUp", 10); 79 79 80 80 fZVertexSpread = GetDouble("ZVertexSpread", 0.15); … … 133 133 fFunction->GetRandom2(dz, dt); 134 134 135 dt *= c_light *1.0E3; // necessary in order to make t in mm/c135 dt *= c_light * 1.0E3; // necessary in order to make t in mm/c 136 136 dz *= 1.0E3; // necessary in order to make z in mm 137 137 vx = 0.0; 138 138 vy = 0.0; 139 139 numberOfParticles = fInputArray->GetEntriesFast(); 140 while((candidate = static_cast<Candidate *>(fItInputArray->Next())))140 while((candidate = static_cast<Candidate *>(fItInputArray->Next()))) 141 141 { 142 142 vx += candidate->Position.X(); … … 165 165 switch(fPileUpDistribution) 166 166 { 167 168 169 170 171 numberOfEvents = gRandom->Integer(2*fMeanPileUp + 1);172 173 174 175 167 case 0: 168 numberOfEvents = gRandom->Poisson(fMeanPileUp); 169 break; 170 case 1: 171 numberOfEvents = gRandom->Integer(2 * fMeanPileUp + 1); 172 break; 173 default: 174 numberOfEvents = gRandom->Poisson(fMeanPileUp); 175 break; 176 176 } 177 177 178 178 for(event = 0; event < numberOfEvents; ++event) 179 179 { 180 while(!fPythia->next()); 181 182 // --- Pile-up vertex smearing 180 while(!fPythia->next()) 181 ; 182 183 // --- Pile-up vertex smearing 183 184 184 185 fFunction->GetRandom2(dz, dt); 185 186 186 dt *= c_light *1.0E3; // necessary in order to make t in mm/c187 dt *= c_light * 1.0E3; // necessary in order to make t in mm/c 187 188 dz *= 1.0E3; // necessary in order to make z in mm 188 189 … … 201 202 202 203 pid = particle.id(); 203 px = particle.px(); py = particle.py(); pz = particle.pz(); e = particle.e(); 204 x = particle.xProd(); y = particle.yProd(); z = particle.zProd(); t = particle.tProd(); 204 px = particle.px(); 205 py = particle.py(); 206 pz = particle.pz(); 207 e = particle.e(); 208 x = particle.xProd(); 209 y = particle.yProd(); 210 z = particle.zProd(); 211 t = particle.tProd(); 205 212 206 213 candidate = factory->NewCandidate(); … … 211 218 212 219 pdgParticle = pdg->GetParticle(pid); 213 candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge() /3.0) : -999;220 candidate->Charge = pdgParticle ? Int_t(pdgParticle->Charge() / 3.0) : -999; 214 221 candidate->Mass = pdgParticle ? pdgParticle->Mass() : -999.9; 215 222
Note:
See TracChangeset
for help on using the changeset viewer.