Changeset 267 in svn
- Timestamp:
- Feb 13, 2009, 8:38:04 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Delphes.cpp
r264 r267 77 77 int main(int argc, char *argv[]) 78 78 { 79 unsigned int nnnn=0, mmmm=0;80 79 81 80 int appargc = 2; … … 292 291 //Output file : contents of the analysis object data 293 292 ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputfilename, "Analysis"); 293 ExRootTreeBranch *branchTauJet = treeWriter->NewBranch("TauJet", TRootTauJet::Class()); 294 294 ExRootTreeBranch *branchJet = treeWriter->NewBranch("Jet", TRootJet::Class()); 295 ExRootTreeBranch *branchTauJet = treeWriter->NewBranch("TauJet", TRootTauJet::Class());296 295 ExRootTreeBranch *branchElectron = treeWriter->NewBranch("Electron", TRootElectron::Class()); 297 296 ExRootTreeBranch *branchMuon = treeWriter->NewBranch("Muon", TRootMuon::Class()); … … 380 379 input_particles.clear(); 381 380 382 383 /* 384 if(0) { // OLD SMEARING ALGORITHM without energy flow 385 // 2.1 Loop over all particles in event 386 itGen.Reset(); 387 while( (particle = (TRootGenParticle*) itGen.Next()) ) { 388 int pid = abs(particle->PID); 389 float iPhi=0,iEta=0; 390 391 392 // 2.1.1********************* preparation for the b-tagging 393 //// This subarray is needed for the B-jet algorithm 394 // optimization for speed : put first PID condition, then ETA condition, then either pt or status 395 if( (pid <= pB || pid == pGLUON) &&// is it a light quark or a gluon, i.e. is it one of these : u,d,c,s,b,g ? 396 fabs(particle->Eta) < DET->CEN_max_tracker && 397 particle->Status != 1 && 398 particle->PT > DET->PT_QUARKS_MIN ) { 399 NFCentralQ.Add(particle); 400 } 401 402 // 2.1.2 ********************* central detector: keep only visible particles 403 // keeps only final particles, visible by the central detector, including the fiducial volume 404 // the ordering of conditions have been optimised for speed : put first the STATUS condition 405 if( (particle->Status == 1) && 406 (pid != pNU1) && (pid != pNU2) && (pid != pNU3) && 407 (fabs(particle->Eta) < DET->CEN_max_calo_fwd) 408 ) 409 { 410 genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E); 411 genMomentumBfield = genMomentum; 412 413 // 2.1.2.1 ********************* central detector: magnetic field 414 // genMomentumBfield is then changed with respect to the magnetic field 415 if(DET->FLAG_bfield==1) TRACP->Propagation(particle,genMomentumBfield); 416 float eta=fabs(genMomentumBfield.Eta()); 417 418 419 // 2.1.2.2 ********************* central detector: smearing (calorimeters, muon chambers) 420 switch(pid) { 421 422 case pE: // all electrons with eta < DET->MAX_CALO_FWD 423 DET->SmearElectron(genMomentumBfield); 424 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_elec){ 425 electron.push_back(ParticleUtil(genMomentumBfield,particle->PID)); 426 } 427 break; // case pE 428 case pGAMMA: // all photons with eta < DET->MAX_CALO_FWD 429 DET->SmearElectron(genMomentumBfield); 430 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_gamma) { 431 gamma.push_back(ParticleUtil(genMomentumBfield,particle->PID)); 432 } 433 break; // case pGAMMA 434 case pMU: // all muons with eta < DET->MAX_MU 435 DET->SmearMu(genMomentumBfield); 436 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_mu && genMomentumBfield.Pt() > DET->PTCUT_muon){ 437 muon.push_back(ParticleUtil(genMomentumBfield,particle->PID)); 438 } 439 break; // case pMU 440 case pLAMBDA: // all lambdas with eta < DET->MAX_CALO_FWD 441 case pK0S: // all K0s with eta < DET->MAX_CALO_FWD 442 DET->SmearHadron(genMomentumBfield, 0.7); 443 break; // case hadron 444 default: // all other final particles with eta < DET->MAX_CALO_FWD 445 DET->SmearHadron(genMomentumBfield, 1.0); 446 break; 447 } // 2.1.2.2 switch (pid) 448 449 450 // 2.1.2.3 ********************* central detector: calotowers 451 // all final particles but muons and neutrinos 452 // for calorimetric towers and missing PT 453 int charge=Charge(pid); 454 if(genMomentumBfield.E() !=0 && pid != pMU) { 455 // in case the Bfield is not simulated, checks that charged particles have enough pt to reach the calos 456 if ( !DET->FLAG_bfield && charge!=0 && genMomentumBfield.Pt() <= DET->TRACK_ptmin ) {}// particules do not reach calos 457 else { // particles reach calos 458 // applies the calo segmentation and returns iEta & iPhi 459 DET->BinEtaPhi(genMomentumBfield.Phi(), genMomentumBfield.Eta(), iPhi, iEta); 460 if(iEta != UNDEFINED && iPhi != UNDEFINED) { 461 momentumCaloSegmentation.SetPtEtaPhiE(genMomentumBfield.Pt(),iEta,iPhi,genMomentumBfield.E()); 462 elementCalo = (TRootCalo*) branchCalo->NewEntry(); 463 elementCalo->Set(momentumCaloSegmentation); 464 PhysicsTower Tower(LorentzVector(momentumCaloSegmentation.Px(),momentumCaloSegmentation.Py(),momentumCaloSegmentation.Pz(),momentumCaloSegmentation.E())); 465 towers.push_back(Tower); 466 } // if iEta != UNDEFINED 467 } // else : when particles reach the calos 468 } // 2.1.2.3 calotowers 469 470 471 // 2.1.2.4 ********************* central detector: tracks 472 // all final charged particles 473 if( 474 (genMomentumBfield.E()!=0) && 475 (fabs(genMomentumBfield.Eta()) < DET->CEN_max_tracker) && 476 (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentum.Pt() > DET->TRACK_ptmin )) && 477 // if bfield not simulated, pt should be high enough to be taken into account 478 ((rand()%100) < DET->TRACK_eff) && 479 (charge!=0) 480 ) 481 { 482 elementTracks = (TRootTracks*) branchTracks->NewEntry(); 483 elementTracks->Set(genMomentum); // fills px,py,pz,pt,e,eta,phi at vertex 484 elementTracks->Etaout = genMomentumBfield.Eta(); 485 elementTracks->Phiout = genMomentumBfield.Phi(); 486 // TODO!!! apply a smearing on the position of the origin of the track 487 // elementTracks->SetPosition(particle->X,particle->Y,particle->Z); 488 // uses the output of the bfield computation : Xout=... Yout=... Zout... 489 // TODO!!! elementTrakcs->SetPositionOut(Xout,Yout,Zout); 490 TrackCentral.push_back(genMomentum); // tracks at vertex! 491 } // 2.1.2.4 tracks 492 493 } // 2.1.2 central detector 494 495 // 2.1.3 ********************* forward detectors: zdc 496 if(DET->FLAG_vfd==1) { 497 VFD->ZDC(treeWriter,branchZDC,particle); 498 VFD->RomanPots(treeWriter,branchRP220,branchFP420,particle); 499 } 500 } // IF OLD ALGORITHM (= no energy flow ) 501 502 503 504 505 else // IF NEW ALGORITHM with energy flow 506 */ 507 { 381 { 508 382 D_CaloTowerList list_of_active_towers; 509 383 D_CaloTowerList list_of_towers_with_photon; // to speed up the code: will only look in interesting towers for gamma candidates … … 533 407 // 2.1a.2.1 Central solenoidal magnetic field 534 408 TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo 535 particle->SetEtaPhi(particle->EtaCalo,particle->PhiCalo); // ???? check this line536 409 537 410 // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ? -
trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h
r264 r267 13 13 * present in the data members of the Block TRoot class. 14 14 * 15 * $Date: 2009-02-1 1 09:19:14$16 * $Revision: 1.1 2$15 * $Date: 2009-02-13 19:38:03 $ 16 * $Revision: 1.13 $ 17 17 * 18 18 * … … 312 312 */ 313 313 314 //class TRootCalo: public TSortableObject { 315 class TRootCalo: public TRootParticle { 314 class TRootCalo: public TSortableObject 315 { 316 //class TRootCalo: public TRootParticle { 316 317 public: 318 float Eta; 319 float Phi; 320 float E; 317 321 TRootCalo() ; 318 322 TRootCalo(const TRootCalo& cal); … … 320 324 void set(const D_CaloTower& cal); 321 325 static TCompare *fgCompare; //! 322 //const TCompare *GetCompare() const { return fgCompare; }326 const TCompare *GetCompare() const { return fgCompare; } 323 327 const float getET() const {return ET;} 324 328 … … 345 349 //--------------------------------------------------------------------------- 346 350 347 class TRootJet: public TRootParticle 351 class TRootTauJet: public TSortableObject 352 { 353 public: 354 TRootTauJet() {}; 355 356 float E; // particle energy in GeV 357 float Px; // particle momentum vector (x component) in GeV 358 float Py; // particle momentum vector (y component) in GeV 359 float Pz; // particle momentum vector (z component) in GeV 360 361 float Eta; // particle pseudorapidity 362 float Phi; // particle azimuthal angle in rad 363 364 void Set(const TLorentzVector& momentum);// { return TRootParticle::Set(momentum); } 365 366 static TCompare *fgCompare; //! 367 const TCompare *GetCompare() const { return fgCompare; } 368 369 float PT; // particle transverse momentum in GeV 370 371 ClassDef(TRootTauJet, 1) 372 }; 373 374 //--------------------------------------------------------------------------- 375 376 class TRootJet: public TRootTauJet 348 377 { 349 378 public: 350 379 TRootJet() {}; 380 381 static TCompare *fgCompare; //! 382 351 383 bool Btag; 352 384 353 static TCompare *fgCompare; //!354 355 385 ClassDef(TRootJet, 1) 356 386 }; 357 387 358 //--------------------------------------------------------------------------- 359 360 class TRootTauJet: public TRootParticle 361 { 362 public: 363 TRootTauJet() {}; 364 static TCompare *fgCompare; //! 365 366 ClassDef(TRootTauJet, 1) 367 }; 388 //------------------------------------------------------------------------------ 368 389 369 390 class TRootTrigger: public TSortableObject -
trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc
r264 r267 11 11 * to preserve mother-dautherlinks between particles. 12 12 * 13 * $Date: 2009-02-1 1 09:19:14$14 * $Revision: 1. 8$13 * $Date: 2009-02-13 19:38:03 $ 14 * $Revision: 1.9 $ 15 15 * 16 16 * … … 25 25 26 26 TCompare *TRootGenParticle::fgCompare = 0; 27 TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();28 27 TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance(); 29 28 TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance(); 30 29 TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance(); 31 30 TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance(); 31 TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance(); 32 32 TCompare *TRootTracks::fgCompare = TComparePT<TRootTracks>::Instance(); 33 33 TCompare *TRootETmis::fgCompare = 0; … … 50 50 Eta = momentum.Eta(); 51 51 Phi = momentum.Phi(); 52 } 53 54 void TRootTauJet::Set(const TLorentzVector& momentum) { 55 56 E = momentum.E(); 57 Px = momentum.Px(); 58 Py = momentum.Py(); 59 Pz = momentum.Pz(); 60 PT = momentum.Pt(); 61 Eta = momentum.Eta(); 62 Phi = momentum.Phi(); 63 52 64 } 53 65 … … 150 162 E_em=cal.getEem(); E_had=cal.getEhad(); 151 163 E =cal.getE(); ET =cal.getET(); 152 EtaCalo = cal.getEta();153 PhiCalo = cal.getPhi();164 //EtaCalo = cal.getEta(); 165 //PhiCalo = cal.getPhi(); 154 166 } 155 167 -
trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h
r264 r267 4 4 * Lists classes to be included in cint dicitonary 5 5 * 6 * $Date: 2009-02-1 1 09:19:14$7 * $Revision: 1. 3$6 * $Date: 2009-02-13 19:38:03 $ 7 * $Revision: 1.4 $ 8 8 * 9 9 * … … 24 24 #pragma link C++ class TRootSelectorInfo; 25 25 #pragma link C++ class TRootGenParticle; 26 #pragma link C++ class TRootJet;27 26 #pragma link C++ class TRootElectron; 28 27 #pragma link C++ class TRootMuon; 29 28 #pragma link C++ class TRootPhoton; 30 29 #pragma link C++ class TRootTauJet; 30 #pragma link C++ class TRootJet; 31 31 #pragma link C++ class TRootTracks; 32 32 #pragma link C++ class TRootETmis;
Note:
See TracChangeset
for help on using the changeset viewer.