- Timestamp:
- Jan 14, 2009, 1:28:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r178 r184 172 172 TRootCalo *elementCalo; 173 173 174 TLorentzVector genMomentum(0,0,0,0); 175 TLorentzVector genMomentumCalo(0,0,0,0); 174 TLorentzVector genMomentum(0,0,0,0); // four-momentum at the vertex 175 TLorentzVector genMomentumBfield(0,0,0,0); // four-momentum at the exit of the tracks 176 TLorentzVector momentumCaloSegmentation(0,0,0,0); // four-momentum in the calo, after applying the calo segmentation 176 177 LorentzVector jetMomentum; 177 178 … … 235 236 { 236 237 genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E); 238 genMomentumBfield = genMomentum; 237 239 238 240 // 2.1.2.1 ********************* central detector: magnetic field 239 // genMomentum is then changed with respect to the magnetic field 240 //if(DET->FLAG_bfield==1) genMomentum = TRACP->Propagation(particle); 241 if(DET->FLAG_bfield==1) TRACP->Propagation(particle,genMomentum); 242 float eta=fabs(genMomentum.Eta()); 241 // genMomentumBfield is then changed with respect to the magnetic field 242 if(DET->FLAG_bfield==1) TRACP->Propagation(particle,genMomentumBfield); 243 float eta=fabs(genMomentumBfield.Eta()); 243 244 244 245 … … 247 248 248 249 case pE: // all electrons with eta < DET->MAX_CALO_FWD 249 DET->SmearElectron(genMomentum );250 if(genMomentum .E()!=0 && eta < DET->CEN_max_tracker && genMomentum.Pt() > DET->PTCUT_elec){251 electron.push_back(ParticleUtil(genMomentum ,particle->PID));250 DET->SmearElectron(genMomentumBfield); 251 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_elec){ 252 electron.push_back(ParticleUtil(genMomentumBfield,particle->PID)); 252 253 } 253 254 break; // case pE 254 255 case pGAMMA: // all photons with eta < DET->MAX_CALO_FWD 255 DET->SmearElectron(genMomentum );256 if(genMomentum .E()!=0 && eta < DET->CEN_max_tracker && genMomentum.Pt() > DET->PTCUT_gamma) {257 gamma.push_back(ParticleUtil(genMomentum ,particle->PID));256 DET->SmearElectron(genMomentumBfield); 257 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_gamma) { 258 gamma.push_back(ParticleUtil(genMomentumBfield,particle->PID)); 258 259 } 259 260 break; // case pGAMMA 260 261 case pMU: // all muons with eta < DET->MAX_MU 261 DET->SmearMu(genMomentum );262 if(genMomentum .E()!=0 && eta < DET->CEN_max_mu && genMomentum.Pt() > DET->PTCUT_muon){263 muon.push_back(ParticleUtil(genMomentum ,particle->PID));262 DET->SmearMu(genMomentumBfield); 263 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_mu && genMomentumBfield.Pt() > DET->PTCUT_muon){ 264 muon.push_back(ParticleUtil(genMomentumBfield,particle->PID)); 264 265 } 265 266 break; // case pMU 266 267 case pLAMBDA: // all lambdas with eta < DET->MAX_CALO_FWD 267 268 case pK0S: // all K0s with eta < DET->MAX_CALO_FWD 268 DET->SmearHadron(genMomentum , 0.7);269 DET->SmearHadron(genMomentumBfield, 0.7); 269 270 break; // case hadron 270 271 default: // all other final particles with eta < DET->MAX_CALO_FWD 271 DET->SmearHadron(genMomentum , 1.0);272 DET->SmearHadron(genMomentumBfield, 1.0); 272 273 break; 273 274 } // 2.1.2.2 switch (pid) … … 278 279 // for calorimetric towers and missing PT 279 280 int charge=Charge(pid); 280 if(genMomentum .E() !=0 && pid != pMU) {281 if(genMomentumBfield.E() !=0 && pid != pMU) { 281 282 // in case the Bfield is not simulated, checks that charged particles have enough pt to reach the calos 282 if ( !DET->FLAG_bfield && charge!=0 && genMomentum .Pt() <= DET->TRACK_ptmin ) { /* particules do not reach calos */ }283 if ( !DET->FLAG_bfield && charge!=0 && genMomentumBfield.Pt() <= DET->TRACK_ptmin ) { /* particules do not reach calos */ } 283 284 else { // particles reach calos 284 285 // applies the calo segmentation and returns iEta & iPhi 285 DET->BinEtaPhi(genMomentum .Phi(), genMomentum.Eta(), iPhi, iEta);286 DET->BinEtaPhi(genMomentumBfield.Phi(), genMomentumBfield.Eta(), iPhi, iEta); 286 287 if(iEta != -100 && iPhi != -100) { 287 genMomentumCalo.SetPtEtaPhiE(genMomentum.Pt(),iEta,iPhi,genMomentum.E());288 momentumCaloSegmentation.SetPtEtaPhiE(genMomentumBfield.Pt(),iEta,iPhi,genMomentumBfield.E()); 288 289 elementCalo = (TRootCalo*) branchCalo->NewEntry(); 289 elementCalo->Set( genMomentumCalo);290 PhysicsTower Tower(LorentzVector( genMomentumCalo.Px(),genMomentumCalo.Py(),genMomentumCalo.Pz(),genMomentumCalo.E()));290 elementCalo->Set(momentumCaloSegmentation); 291 PhysicsTower Tower(LorentzVector(momentumCaloSegmentation.Px(),momentumCaloSegmentation.Py(),momentumCaloSegmentation.Pz(),momentumCaloSegmentation.E())); 291 292 towers.push_back(Tower); 292 293 } // if iEta != -100 … … 298 299 // all final charged particles 299 300 if( 300 (genMomentum .E()!=0) &&301 (fabs(genMomentum .Eta()) < DET->CEN_max_tracker) &&302 (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentum .Pt() > DET->TRACK_ptmin )) &&301 (genMomentumBfield.E()!=0) && 302 (fabs(genMomentumBfield.Eta()) < DET->CEN_max_tracker) && 303 (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentumBfield.Pt() > DET->TRACK_ptmin )) && 303 304 // if bfield not simulated, pt should be high enough to be taken into account 304 305 ((rand()%100) < DET->TRACK_eff) && … … 307 308 { 308 309 elementTracks = (TRootTracks*) branchTracks->NewEntry(); 309 elementTracks->Set(genMomentum); 310 TrackCentral.push_back(genMomentum); 310 elementTracks->Set(genMomentum); // fills px,py,pz,pt,e,eta,phi at vertex 311 elementTracks->Etaout = genMomentumBfield.Eta(); 312 elementTracks->Phiout = genMomentumBfield.Phi(); 313 // TODO!!! apply a smearing on the position of the origin of the track 314 // elementTracks->SetPosition(particle->X,particle->Y,particle->Z); 315 // uses the output of the bfield computation : Xout=... Yout=... Zout... 316 // TODO!!! elementTrakcs->SetPositionOut(Xout,Yout,Zout); 317 TrackCentral.push_back(genMomentum); // tracks at vertex! 311 318 } // 2.1.2.4 tracks 312 319 … … 331 338 elementElec->Set(electron[i].Px(),electron[i].Py(),electron[i].Pz(),electron[i].E()); 332 339 elementElec->Charge = sign(electron[i].PID()); 333 elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,2.0); 340 elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,2.0);//isolation based on tracks 334 341 } 335 342 DET->SortedVector(muon);
Note:
See TracChangeset
for help on using the changeset viewer.