Changes in modules/PileUpMerger.cc [2d494a6:cab38f6] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/PileUpMerger.cc
r2d494a6 rcab38f6 80 80 fTVertexSpread = GetDouble("TVertexSpread", 1.5E-09); 81 81 82 fInputBeamSpotX = GetDouble("InputBeamSpotX", 0.0);83 fInputBeamSpotY = GetDouble("InputBeamSpotY", 0.0);84 fOutputBeamSpotX = GetDouble("OutputBeamSpotX", 0.0);85 fOutputBeamSpotY = GetDouble("OutputBeamSpotY", 0.0);86 87 82 // read vertex smearing formula 88 83 … … 116 111 TParticlePDG *pdgParticle; 117 112 Int_t pid; 118 Float_t x, y, z, t , vx, vy;113 Float_t x, y, z, t; 119 114 Float_t px, py, pz, e; 120 115 Double_t dz, dphi, dt; 121 Int_t numberOfEvents, event , numberOfParticles;116 Int_t numberOfEvents, event; 122 117 Long64_t allEntries, entry; 123 Candidate *candidate, *vertex ;118 Candidate *candidate, *vertexcandidate; 124 119 DelphesFactory *factory; 125 120 … … 128 123 fItInputArray->Reset(); 129 124 130 // --- Deal with primary vertex first ------125 // --- Deal with Primary vertex first ------ 131 126 132 127 fFunction->GetRandom2(dz, dt); … … 134 129 dt *= c_light*1.0E3; // necessary in order to make t in mm/c 135 130 dz *= 1.0E3; // necessary in order to make z in mm 136 vx = 0.0; 137 vy = 0.0; 138 numberOfParticles = fInputArray->GetEntriesFast(); 131 139 132 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 140 133 { 141 vx += candidate->Position.X();142 vy += candidate->Position.Y();143 134 z = candidate->Position.Z(); 144 135 t = candidate->Position.T(); … … 148 139 } 149 140 150 if(numberOfParticles > 0)151 {152 vx /= numberOfParticles;153 vy /= numberOfParticles;154 }155 156 141 factory = GetFactory(); 157 142 158 vertex = factory->NewCandidate();159 vertex ->Position.SetXYZT(vx, vy, dz, dt);160 fVertexOutputArray->Add(vertex );143 vertexcandidate = factory->NewCandidate(); 144 vertexcandidate->Position.SetXYZT(0.0, 0.0, dz, dt); 145 fVertexOutputArray->Add(vertexcandidate); 161 146 162 147 // --- Then with pile-up vertices ------ … … 196 181 dphi = gRandom->Uniform(-TMath::Pi(), TMath::Pi()); 197 182 198 vx = 0.0; 199 vy = 0.0; 200 numberOfParticles = 0; 183 vertexcandidate = factory->NewCandidate(); 184 vertexcandidate->Position.SetXYZT(0.0, 0.0, dz, dt); 185 vertexcandidate->IsPU = 1; 186 187 fVertexOutputArray->Add(vertexcandidate); 188 201 189 while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e)) 202 190 { … … 216 204 candidate->Momentum.RotateZ(dphi); 217 205 218 x -= fInputBeamSpotX;219 y -= fInputBeamSpotY;220 206 candidate->Position.SetXYZT(x, y, z + dz, t + dt); 221 207 candidate->Position.RotateZ(dphi); 222 candidate->Position += TLorentzVector(fOutputBeamSpotX, fOutputBeamSpotY, 0.0, 0.0);223 224 vx += candidate->Position.X();225 vy += candidate->Position.Y();226 ++numberOfParticles;227 208 228 209 fParticleOutputArray->Add(candidate); 229 210 } 230 231 if(numberOfParticles > 0)232 {233 vx /= numberOfParticles;234 vy /= numberOfParticles;235 }236 237 vertex = factory->NewCandidate();238 vertex->Position.SetXYZT(vx, vy, dz, dt);239 vertex->IsPU = 1;240 241 fVertexOutputArray->Add(vertex);242 211 } 243 212 } 244 213 245 214 //------------------------------------------------------------------------------ 215
Note:
See TracChangeset
for help on using the changeset viewer.