Changes in / [98ce52a:91acc76] in git
- Files:
-
- 15 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r98ce52a r91acc76 319 319 modules/EnergySmearing.h \ 320 320 modules/MomentumSmearing.h \ 321 modules/TrackSmearing.h \ 321 322 modules/ImpactParameterSmearing.h \ 322 323 modules/TimeSmearing.h \ … … 342 343 modules/StatusPidFilter.h \ 343 344 modules/PdgCodeFilter.h \ 345 modules/BeamSpotFilter.h \ 344 346 modules/Cloner.h \ 345 347 modules/Weighter.h \ … … 347 349 modules/JetFlavorAssociation.h \ 348 350 modules/JetFakeParticle.h \ 351 modules/VertexSorter.h \ 352 modules/VertexFinder.h \ 349 353 modules/ExampleModule.h 350 354 tmp/modules/ModulesDict$(PcmSuf): \ … … 553 557 classes/DelphesFactory.h \ 554 558 classes/DelphesFormula.h 559 tmp/modules/BeamSpotFilter.$(ObjSuf): \ 560 modules/BeamSpotFilter.$(SrcSuf) \ 561 modules/BeamSpotFilter.h \ 562 classes/DelphesClasses.h \ 563 classes/DelphesFactory.h \ 564 classes/DelphesFormula.h \ 565 external/ExRootAnalysis/ExRootResult.h \ 566 external/ExRootAnalysis/ExRootFilter.h \ 567 external/ExRootAnalysis/ExRootClassifier.h 555 568 tmp/modules/Calorimeter.$(ObjSuf): \ 556 569 modules/Calorimeter.$(SrcSuf) \ … … 852 865 external/ExRootAnalysis/ExRootFilter.h \ 853 866 external/ExRootAnalysis/ExRootClassifier.h 867 tmp/modules/TrackSmearing.$(ObjSuf): \ 868 modules/TrackSmearing.$(SrcSuf) \ 869 modules/TrackSmearing.h \ 870 classes/DelphesClasses.h \ 871 classes/DelphesFactory.h \ 872 classes/DelphesFormula.h \ 873 external/ExRootAnalysis/ExRootResult.h \ 874 external/ExRootAnalysis/ExRootFilter.h \ 875 external/ExRootAnalysis/ExRootClassifier.h 854 876 tmp/modules/TreeWriter.$(ObjSuf): \ 855 877 modules/TreeWriter.$(SrcSuf) \ … … 868 890 classes/DelphesFactory.h \ 869 891 classes/DelphesFormula.h \ 892 external/ExRootAnalysis/ExRootResult.h \ 893 external/ExRootAnalysis/ExRootFilter.h \ 894 external/ExRootAnalysis/ExRootClassifier.h 895 tmp/modules/VertexFinder.$(ObjSuf): \ 896 modules/VertexFinder.$(SrcSuf) \ 897 modules/VertexFinder.h \ 898 classes/DelphesClasses.h \ 899 classes/DelphesFactory.h \ 900 classes/DelphesFormula.h \ 901 classes/DelphesPileUpReader.h \ 902 external/ExRootAnalysis/ExRootResult.h \ 903 external/ExRootAnalysis/ExRootFilter.h \ 904 external/ExRootAnalysis/ExRootClassifier.h 905 tmp/modules/VertexSorter.$(ObjSuf): \ 906 modules/VertexSorter.$(SrcSuf) \ 907 modules/VertexSorter.h \ 908 classes/DelphesClasses.h \ 909 classes/DelphesFactory.h \ 910 classes/DelphesFormula.h \ 911 classes/DelphesPileUpReader.h \ 870 912 external/ExRootAnalysis/ExRootResult.h \ 871 913 external/ExRootAnalysis/ExRootFilter.h \ … … 931 973 tmp/modules/AngularSmearing.$(ObjSuf) \ 932 974 tmp/modules/BTagging.$(ObjSuf) \ 975 tmp/modules/BeamSpotFilter.$(ObjSuf) \ 933 976 tmp/modules/Calorimeter.$(ObjSuf) \ 934 977 tmp/modules/Cloner.$(ObjSuf) \ … … 963 1006 tmp/modules/TrackCountingTauTagging.$(ObjSuf) \ 964 1007 tmp/modules/TrackPileUpSubtractor.$(ObjSuf) \ 1008 tmp/modules/TrackSmearing.$(ObjSuf) \ 965 1009 tmp/modules/TreeWriter.$(ObjSuf) \ 966 1010 tmp/modules/UniqueObjectFinder.$(ObjSuf) \ 1011 tmp/modules/VertexFinder.$(ObjSuf) \ 1012 tmp/modules/VertexSorter.$(ObjSuf) \ 967 1013 tmp/modules/Weighter.$(ObjSuf) 968 1014 … … 1569 1615 tmp/external/tcl/tclVar.$(ObjSuf) 1570 1616 1617 modules/TrackSmearing.h: \ 1618 classes/DelphesModule.h 1619 @touch $@ 1620 1571 1621 external/fastjet/ClusterSequence.hh: \ 1572 1622 external/fastjet/PseudoJet.hh \ … … 1829 1879 @touch $@ 1830 1880 1881 modules/VertexSorter.h: \ 1882 classes/DelphesModule.h \ 1883 classes/DelphesClasses.h 1884 @touch $@ 1885 1831 1886 modules/Delphes.h: \ 1832 1887 classes/DelphesModule.h 1888 @touch $@ 1889 1890 modules/VertexFinder.h: \ 1891 classes/DelphesModule.h \ 1892 classes/DelphesClasses.h 1833 1893 @touch $@ 1834 1894 … … 2001 2061 2002 2062 modules/FastJetFinder.h: \ 2063 classes/DelphesModule.h 2064 @touch $@ 2065 2066 modules/BeamSpotFilter.h: \ 2003 2067 classes/DelphesModule.h 2004 2068 @touch $@ -
cards/converter_card.tcl
r98ce52a r91acc76 13 13 module TreeWriter TreeWriter { 14 14 # add Branch InputArray BranchName BranchClass 15 add Branch Delphes/ allParticles Particle GenParticle15 add Branch Delphes/stableParticles Particle GenParticle 16 16 } 17 17 -
cards/delphes_card_CMS.tcl
r98ce52a r91acc76 35 35 36 36 FastJetFinder 37 FastCaloJetFinder 37 38 38 39 JetEnergyScale … … 210 211 set HCalEnergyMin 1.0 211 212 212 set ECalEnergySignificanceMin 1.0213 set HCalEnergySignificanceMin 1.0213 set ECalEnergySignificanceMin 2.0 214 set HCalEnergySignificanceMin 2.0 214 215 215 216 set SmearTowerCenter true … … 497 498 } 498 499 500 ################ 501 # caloJet finder 502 ################ 503 504 module FastJetFinder FastCaloJetFinder { 505 set InputArray Calorimeter/towers 506 507 set OutputArray jets 508 509 # algorithm: 1 CDFJetClu, 2 MidPoint, 3 SIScone, 4 kt, 5 Cambridge/Aachen, 6 antikt 510 set JetAlgorithm 6 511 set ParameterR 0.5 512 513 set JetPTMin 20.0 514 } 515 499 516 ################## 500 517 # Jet Energy Scale … … 610 627 611 628 add Branch UniqueObjectFinder/jets Jet Jet 629 add Branch FastCaloJetFinder/jets CaloJet Jet 612 630 add Branch UniqueObjectFinder/electrons Electron Electron 613 631 add Branch UniqueObjectFinder/photons Photon Photon -
classes/DelphesClasses.cc
r98ce52a r91acc76 41 41 CompBase *Tower::fgCompare = CompE<Tower>::Instance(); 42 42 CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance(); 43 CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance(); 43 44 CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance(); 44 45 … … 121 122 Charge(0), Mass(0.0), 122 123 IsPU(0), IsRecoPU(0), IsConstituent(0), IsFromConversion(0), 124 ClusterIndex(-1), ClusterNDF(0), ClusterSigma(0), SumPT2(0), BTVSumPT2(0), GenDeltaZ(0), GenSumPT2(0), 123 125 Flavor(0), FlavorAlgo(0), FlavorPhys(0), 124 126 BTag(0), BTagAlgo(0), BTagPhys(0), … … 127 129 Momentum(0.0, 0.0, 0.0, 0.0), 128 130 Position(0.0, 0.0, 0.0, 0.0), 131 PositionError(0.0, 0.0, 0.0, 0.0), 132 InitialPosition(0.0, 0.0, 0.0, 0.0), 129 133 Area(0.0, 0.0, 0.0, 0.0), 130 Dxy(0), SDxy(0), Xd(0), Yd(0), Zd(0), 134 L(0), 135 D0(0), ErrorD0(0), 136 DZ(0), ErrorDZ(0), 137 P(0), ErrorP(0), 138 PT(0), ErrorPT(0), 139 CtgTheta(0), ErrorCtgTheta(0), 140 Phi(0), ErrorPhi(0), 141 Xd(0), Yd(0), Zd(0), 131 142 TrackResolution(0), 132 143 NCharged(0), … … 245 256 object.IsConstituent = IsConstituent; 246 257 object.IsFromConversion = IsFromConversion; 258 object.ClusterIndex = ClusterIndex; 259 object.ClusterNDF = ClusterNDF; 260 object.ClusterSigma = ClusterSigma; 261 object.SumPT2 = SumPT2; 262 object.BTVSumPT2 = BTVSumPT2; 263 object.GenDeltaZ = GenDeltaZ; 264 object.GenSumPT2 = GenSumPT2; 247 265 object.Flavor = Flavor; 248 266 object.FlavorAlgo = FlavorAlgo; … … 262 280 object.Momentum = Momentum; 263 281 object.Position = Position; 282 object.InitialPosition = InitialPosition; 283 object.PositionError = PositionError; 264 284 object.Area = Area; 265 object.Dxy = Dxy; 266 object.SDxy = SDxy; 285 object.L = L; 286 object.ErrorT = ErrorT; 287 object.D0 = D0; 288 object.ErrorD0 = ErrorD0; 289 object.DZ = DZ; 290 object.ErrorDZ = ErrorDZ; 291 object.P = P; 292 object.ErrorP = ErrorP; 293 object.PT = PT; 294 object.ErrorPT = ErrorPT; 295 object.CtgTheta = CtgTheta ; 296 object.ErrorCtgTheta = ErrorCtgTheta; 297 object.Phi = Phi; 298 object.ErrorPhi = ErrorPhi; 267 299 object.Xd = Xd; 268 300 object.Yd = Yd; … … 282 314 object.SumPtChargedPU = SumPtChargedPU; 283 315 object.SumPt = SumPt; 284 316 object.ClusterIndex = ClusterIndex; 317 object.ClusterNDF = ClusterNDF; 318 object.ClusterSigma = ClusterSigma; 319 object.SumPT2 = SumPT2; 320 285 321 object.FracPt[0] = FracPt[0]; 286 322 object.FracPt[1] = FracPt[1]; … … 363 399 Momentum.SetXYZT(0.0, 0.0, 0.0, 0.0); 364 400 Position.SetXYZT(0.0, 0.0, 0.0, 0.0); 401 InitialPosition.SetXYZT(0.0, 0.0, 0.0, 0.0); 365 402 Area.SetXYZT(0.0, 0.0, 0.0, 0.0); 366 Dxy = 0.0; 367 SDxy = 0.0; 403 L = 0.0; 404 ErrorT = 0.0; 405 D0 = 0.0; 406 ErrorD0 = 0.0; 407 DZ = 0.0; 408 ErrorDZ = 0.0; 409 P =0.0; 410 ErrorP =0.0; 411 PT = 0.0; 412 ErrorPT = 0.0; 413 CtgTheta = 0.0; 414 ErrorCtgTheta = 0.0; 415 Phi = 0.0; 416 ErrorPhi = 0.0; 368 417 Xd = 0.0; 369 418 Yd = 0.0; … … 387 436 SumPt = -999; 388 437 438 ClusterIndex = -1; 439 ClusterNDF = -99; 440 ClusterSigma = 0.0; 441 SumPT2 = 0.0; 442 BTVSumPT2 = 0.0; 443 GenDeltaZ = 0.0; 444 GenSumPT2 = 0.0; 445 389 446 FracPt[0] = 0.0; 390 447 FracPt[1] = 0.0; -
classes/DelphesClasses.h
r98ce52a r91acc76 147 147 Float_t Pz; // particle momentum vector (z component) | hepevt.phep[number][2] 148 148 149 Float_t PT; // particle transverse momentum 149 Float_t D0; 150 Float_t DZ; 151 Float_t P; 152 Float_t PT; 153 Float_t CtgTheta; 154 Float_t Phi; 150 155 Float_t Eta; // particle pseudorapidity 151 Float_t Phi; // particle azimuthal angle152 153 156 Float_t Rapidity; // particle rapidity 154 157 … … 168 171 //--------------------------------------------------------------------------- 169 172 170 class Vertex: public TObject173 class Vertex: public SortableObject 171 174 { 172 175 public: … … 176 179 Float_t Z; // vertex position (z component) 177 180 178 ClassDef(Vertex, 1) 181 Double_t ErrorX; 182 Double_t ErrorY; 183 Double_t ErrorZ; 184 Double_t ErrorT; 185 186 Int_t Index; 187 Int_t NDF; 188 Double_t Sigma; 189 Double_t SumPT2; 190 Double_t BTVSumPT2; 191 Double_t GenDeltaZ; 192 Double_t GenSumPT2; 193 194 TRefArray Constituents; // references to constituents 195 196 static CompBase *fgCompare; //! 197 const CompBase *GetCompare() const { return fgCompare; } 198 199 ClassDef(Vertex, 3) 179 200 }; 180 201 … … 397 418 Int_t Charge; // track charge 398 419 399 Float_t PT; // track transverse momentum400 401 420 Float_t Eta; // track pseudorapidity 402 Float_t Phi; // track azimuthal angle403 421 404 422 Float_t EtaOuter; // track pseudorapidity at the tracker edge … … 415 433 Float_t TOuter; // track position (z component) at the tracker edge 416 434 417 Float_t Dxy; // track signed transverse impact parameter 418 Float_t SDxy; // signed error on the track signed transverse impact parameter 435 Float_t L; // track path length 436 Float_t ErrorT; // error on the time measurement 437 438 Float_t D0; // track signed transverse impact parameter 439 Float_t ErrorD0; // signed error on the track signed transverse impact parameter 440 441 Float_t DZ; // track transverse momentum 442 Float_t ErrorDZ; // track transverse momentum error 443 444 Float_t P; // track transverse momentum 445 Float_t ErrorP; // track transverse momentum error 446 447 Float_t PT; // track transverse momentum 448 Float_t ErrorPT; // track transverse momentum error 449 450 Float_t CtgTheta; // track transverse momentum 451 Float_t ErrorCtgTheta; // track transverse momentum error 452 453 Float_t Phi; // track azimuthal angle 454 Float_t ErrorPhi; // track azimuthal angle 455 419 456 Float_t Xd; // X coordinate of point of closest approach to vertex 420 457 Float_t Yd; // Y coordinate of point of closest approach to vertex … … 423 460 TRef Particle; // reference to generated particle 424 461 462 Int_t VertexIndex; // reference to vertex 463 425 464 static CompBase *fgCompare; //! 426 465 const CompBase *GetCompare() const { return fgCompare; } … … 526 565 Float_t DeltaPhi; 527 566 528 TLorentzVector Momentum, Position, Area; 529 530 Float_t Dxy; 531 Float_t SDxy; 567 TLorentzVector Momentum, Position, InitialPosition, PositionError, Area; 568 569 Float_t L; // path length 570 Float_t ErrorT; // path length 571 Float_t D0; 572 Float_t ErrorD0; 573 Float_t DZ; 574 Float_t ErrorDZ; 575 Float_t P; 576 Float_t ErrorP; 577 Float_t PT; 578 Float_t ErrorPT; 579 Float_t CtgTheta; 580 Float_t ErrorCtgTheta; 581 Float_t Phi; 582 Float_t ErrorPhi; 583 532 584 Float_t Xd; 533 585 Float_t Yd; … … 535 587 536 588 // tracking resolution 537 589 538 590 Float_t TrackResolution; 539 591 … … 562 614 Float_t SumPt; 563 615 616 // vertex variables 617 618 Int_t ClusterIndex; 619 Int_t ClusterNDF; 620 Double_t ClusterSigma; 621 Double_t SumPT2; 622 Double_t BTVSumPT2; 623 Double_t GenDeltaZ; 624 Double_t GenSumPT2; 625 564 626 // N-subjettiness variables 565 627 … … 595 657 void SetFactory(DelphesFactory *factory) { fFactory = factory; } 596 658 597 ClassDef(Candidate, 4)659 ClassDef(Candidate, 5) 598 660 }; 599 661 -
classes/SortableObject.h
r98ce52a r91acc76 156 156 return -1; 157 157 else if(t1->ET < t2->ET) 158 return 1; 159 else 160 return 0; 161 } 162 }; 163 164 //--------------------------------------------------------------------------- 165 166 template <typename T> 167 class CompSumPT2: public CompBase 168 { 169 CompSumPT2() {} 170 public: 171 static CompSumPT2 *Instance() 172 { 173 static CompSumPT2 single; 174 return &single; 175 } 176 177 Int_t Compare(const TObject *obj1, const TObject *obj2) const 178 { 179 const T *t1 = static_cast<const T*>(obj1); 180 const T *t2 = static_cast<const T*>(obj2); 181 if(t1->SumPT2 > t2->SumPT2) 182 return -1; 183 else if(t1->SumPT2 < t2->SumPT2) 158 184 return 1; 159 185 else -
doc/genMakefile.tcl
r98ce52a r91acc76 263 263 executableDeps {converters/*.cpp} {examples/*.cpp} 264 264 265 executableDeps {readers/DelphesHepMC.cpp} {readers/DelphesLHEF.cpp} {readers/DelphesSTDHEP.cpp} 265 executableDeps {readers/DelphesHepMC.cpp} {readers/DelphesLHEF.cpp} {readers/DelphesSTDHEP.cpp} {readers/DelphesROOT.cpp} 266 266 267 267 puts {ifeq ($(HAS_CMSSW),true)} -
examples/Pythia8/configParticleGun.cmnd
r98ce52a r91acc76 3 3 ! 1) Settings used in the main program. 4 4 5 Main:numberOfEvents = 10000 ! number of events to generate5 Main:numberOfEvents = 100000 ! number of events to generate 6 6 Main:timesAllowErrors = 3 ! how many aborts before run stops 7 7 Main:spareFlag1 = on ! true means particle gun 8 Main:spareMode1 = 11! 1-5 - di-quark, 21 - di-gluon, 11 - single electron, 13 - single muon, 22 - single photon8 Main:spareMode1 = ID ! 1-5 - di-quark, 21 - di-gluon, 11 - single electron, 13 - single muon, 22 - single photon 9 9 Main:spareParm1 = 10000 ! max pt 10 10 -
modules/Calorimeter.cc
r98ce52a r91acc76 58 58 fItParticleInputArray(0), fItTrackInputArray(0) 59 59 { 60 Int_t i; 61 60 62 61 fECalResolutionFormula = new DelphesFormula; 63 62 fHCalResolutionFormula = new DelphesFormula; 64 63 65 for(i = 0; i < 2; ++i) 66 { 67 fECalTowerTrackArray[i] = new TObjArray; 68 fItECalTowerTrackArray[i] = fECalTowerTrackArray[i]->MakeIterator(); 69 70 fHCalTowerTrackArray[i] = new TObjArray; 71 fItHCalTowerTrackArray[i] = fHCalTowerTrackArray[i]->MakeIterator(); 72 } 64 fECalTowerTrackArray = new TObjArray; 65 fItECalTowerTrackArray = fECalTowerTrackArray->MakeIterator(); 66 67 fHCalTowerTrackArray = new TObjArray; 68 fItHCalTowerTrackArray = fHCalTowerTrackArray->MakeIterator(); 69 73 70 } 74 71 … … 77 74 Calorimeter::~Calorimeter() 78 75 { 79 Int_t i; 80 76 81 77 if(fECalResolutionFormula) delete fECalResolutionFormula; 82 78 if(fHCalResolutionFormula) delete fHCalResolutionFormula; 83 79 84 for(i = 0; i < 2; ++i) 85 { 86 if(fECalTowerTrackArray[i]) delete fECalTowerTrackArray[i]; 87 if(fItECalTowerTrackArray[i]) delete fItECalTowerTrackArray[i]; 88 89 if(fHCalTowerTrackArray[i]) delete fHCalTowerTrackArray[i]; 90 if(fItHCalTowerTrackArray[i]) delete fItHCalTowerTrackArray[i]; 91 } 80 if(fECalTowerTrackArray) delete fECalTowerTrackArray; 81 if(fItECalTowerTrackArray) delete fItECalTowerTrackArray; 82 83 if(fHCalTowerTrackArray) delete fHCalTowerTrackArray; 84 if(fItHCalTowerTrackArray) delete fItHCalTowerTrackArray; 85 92 86 } 93 87 … … 218 212 Double_t ecalFraction, hcalFraction; 219 213 Double_t ecalEnergy, hcalEnergy; 220 Double_t ecalSigma, hcalSigma;221 214 Int_t pdgCode; 222 215 … … 368 361 fHCalTowerEnergy = 0.0; 369 362 370 fECalTrackEnergy [0]= 0.0;371 f ECalTrackEnergy[1]= 0.0;372 373 f HCalTrackEnergy[0]= 0.0;374 fHCalTrack Energy[1]= 0.0;375 363 fECalTrackEnergy = 0.0; 364 fHCalTrackEnergy = 0.0; 365 366 fECalTrackSigma = 0.0; 367 fHCalTrackSigma = 0.0; 368 376 369 fTowerTrackHits = 0; 377 370 fTowerPhotonHits = 0; 378 371 379 fECalTowerTrackArray[0]->Clear(); 380 fECalTowerTrackArray[1]->Clear(); 381 382 fHCalTowerTrackArray[0]->Clear(); 383 fHCalTowerTrackArray[1]->Clear(); 372 fECalTowerTrackArray->Clear(); 373 fHCalTowerTrackArray->Clear(); 374 384 375 } 385 376 … … 406 397 if(fECalTrackFractions[number] > 1.0E-9 && fHCalTrackFractions[number] < 1.0E-9) 407 398 { 408 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E()); 409 if(ecalSigma/momentum.E() < track->TrackResolution) 410 { 411 fECalTrackEnergy[0] += ecalEnergy; 412 fECalTowerTrackArray[0]->Add(track); 413 } 414 else 415 { 416 fECalTrackEnergy[1] += ecalEnergy; 417 fECalTowerTrackArray[1]->Add(track); 418 } 399 fECalTrackEnergy += ecalEnergy; 400 fECalTrackSigma += (track->TrackResolution)*momentum.E()*(track->TrackResolution)*momentum.E(); 401 fECalTowerTrackArray->Add(track); 419 402 } 403 420 404 else if(fECalTrackFractions[number] < 1.0E-9 && fHCalTrackFractions[number] > 1.0E-9) 421 405 { 422 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E()); 423 if(hcalSigma/momentum.E() < track->TrackResolution) 424 { 425 fHCalTrackEnergy[0] += hcalEnergy; 426 fHCalTowerTrackArray[0]->Add(track); 427 } 428 else 429 { 430 fHCalTrackEnergy[1] += hcalEnergy; 431 fHCalTowerTrackArray[1]->Add(track); 432 } 406 fHCalTrackEnergy += hcalEnergy; 407 fHCalTrackSigma += (track->TrackResolution)*momentum.E()*(track->TrackResolution)*momentum.E(); 408 fHCalTowerTrackArray->Add(track); 433 409 } 410 434 411 else if(fECalTrackFractions[number] < 1.0E-9 && fHCalTrackFractions[number] < 1.0E-9) 435 412 { … … 476 453 Double_t energy, pt, eta, phi; 477 454 Double_t ecalEnergy, hcalEnergy; 455 Double_t ecalNeutralEnergy, hcalNeutralEnergy; 456 478 457 Double_t ecalSigma, hcalSigma; 479 458 Double_t ecalNeutralSigma, hcalNeutralSigma; 459 460 Double_t weightTrack, weightCalo, bestEnergyEstimate, rescaleFactor; 461 480 462 TLorentzVector momentum; 481 463 TFractionMap::iterator itFractionMap; … … 484 466 485 467 if(!fTower) return; 486 487 468 488 469 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, fECalTowerEnergy); … … 554 535 fTowerOutputArray->Add(fTower); 555 536 } 556 537 557 538 // fill energy flow candidates 558 559 ecalEnergy -= fECalTrackEnergy[1]; 560 hcalEnergy -= fHCalTrackEnergy[1]; 561 562 fItECalTowerTrackArray[0]->Reset(); 563 while((track = static_cast<Candidate*>(fItECalTowerTrackArray[0]->Next()))) 564 { 565 mother = track; 566 track = static_cast<Candidate*>(track->Clone()); 567 track->AddCandidate(mother); 568 569 track->Momentum *= ecalEnergy/fECalTrackEnergy[0]; 570 571 fEFlowTrackOutputArray->Add(track); 572 } 573 574 fItECalTowerTrackArray[1]->Reset(); 575 while((track = static_cast<Candidate*>(fItECalTowerTrackArray[1]->Next()))) 576 { 577 mother = track; 578 track = static_cast<Candidate*>(track->Clone()); 579 track->AddCandidate(mother); 580 581 fEFlowTrackOutputArray->Add(track); 582 } 583 584 fItHCalTowerTrackArray[0]->Reset(); 585 while((track = static_cast<Candidate*>(fItHCalTowerTrackArray[0]->Next()))) 586 { 587 mother = track; 588 track = static_cast<Candidate*>(track->Clone()); 589 track->AddCandidate(mother); 590 591 track->Momentum *= hcalEnergy/fHCalTrackEnergy[0]; 592 593 fEFlowTrackOutputArray->Add(track); 594 } 595 596 fItHCalTowerTrackArray[1]->Reset(); 597 while((track = static_cast<Candidate*>(fItHCalTowerTrackArray[1]->Next()))) 598 { 599 mother = track; 600 track = static_cast<Candidate*>(track->Clone()); 601 track->AddCandidate(mother); 602 603 fEFlowTrackOutputArray->Add(track); 604 } 605 606 if(fECalTowerTrackArray[0]->GetEntriesFast() > 0) ecalEnergy = 0.0; 607 if(fHCalTowerTrackArray[0]->GetEntriesFast() > 0) hcalEnergy = 0.0; 608 609 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy); 610 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy); 611 612 if(ecalEnergy < fECalEnergyMin || ecalEnergy < fECalEnergySignificanceMin*ecalSigma) ecalEnergy = 0.0; 613 if(hcalEnergy < fHCalEnergyMin || hcalEnergy < fHCalEnergySignificanceMin*hcalSigma) hcalEnergy = 0.0; 614 615 energy = ecalEnergy + hcalEnergy; 616 617 if(ecalEnergy > 0.0) 539 fECalTrackSigma = TMath::Sqrt(fECalTrackSigma); 540 fHCalTrackSigma = TMath::Sqrt(fHCalTrackSigma); 541 542 //compute neutral excesses 543 ecalNeutralEnergy = max( (ecalEnergy - fECalTrackEnergy) , 0.0); 544 hcalNeutralEnergy = max( (hcalEnergy - fHCalTrackEnergy) , 0.0); 545 546 ecalNeutralSigma = ecalNeutralEnergy / TMath::Sqrt(fECalTrackSigma*fECalTrackSigma + ecalSigma*ecalSigma); 547 hcalNeutralSigma = hcalNeutralEnergy / TMath::Sqrt(fHCalTrackSigma*fHCalTrackSigma + hcalSigma*hcalSigma); 548 549 // if ecal neutral excess is significant, simply create neutral EflowPhoton tower and clone each track into eflowtrack 550 if(ecalNeutralEnergy > fECalEnergyMin && ecalNeutralSigma > fECalEnergySignificanceMin) 618 551 { 619 552 // create new photon tower 620 553 tower = static_cast<Candidate*>(fTower->Clone()); 621 622 pt = ecalEnergy / TMath::CosH(eta); 623 624 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalEnergy); 625 tower->Eem = ecalEnergy; 554 pt = ecalNeutralEnergy / TMath::CosH(eta); 555 556 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, ecalNeutralEnergy); 557 tower->Eem = ecalNeutralEnergy; 626 558 tower->Ehad = 0.0; 627 559 tower->PID = 22; 628 560 629 561 fEFlowPhotonOutputArray->Add(tower); 630 } 631 if(hcalEnergy > 0.0) 632 { 633 // create new neutral hadron tower 562 563 //clone tracks 564 fItECalTowerTrackArray->Reset(); 565 while((track = static_cast<Candidate*>(fItECalTowerTrackArray->Next()))) 566 { 567 mother = track; 568 track = static_cast<Candidate*>(track->Clone()); 569 track->AddCandidate(mother); 570 571 fEFlowTrackOutputArray->Add(track); 572 } 573 574 } 575 576 // if neutral excess is not significant, rescale eflow tracks, such that the total charged equals the best measurement given by the calorimeter and tracking 577 else if(fECalTrackEnergy > 0.0) 578 { 579 weightTrack = (fECalTrackSigma > 0.0) ? 1 / (fECalTrackSigma*fECalTrackSigma) : 0.0; 580 weightCalo = (ecalSigma > 0.0) ? 1 / (ecalSigma*ecalSigma) : 0.0; 581 582 bestEnergyEstimate = (weightTrack*fECalTrackEnergy + weightCalo*ecalEnergy) / (weightTrack + weightCalo); 583 rescaleFactor = bestEnergyEstimate/fECalTrackEnergy; 584 585 //rescale tracks 586 fItECalTowerTrackArray->Reset(); 587 while((track = static_cast<Candidate*>(fItECalTowerTrackArray->Next()))) 588 { 589 mother = track; 590 track = static_cast<Candidate*>(track->Clone()); 591 track->AddCandidate(mother); 592 593 track->Momentum *= rescaleFactor; 594 595 fEFlowTrackOutputArray->Add(track); 596 } 597 } 598 599 600 // if hcal neutral excess is significant, simply create neutral EflowNeutralHadron tower and clone each track into eflowtrack 601 if(hcalNeutralEnergy > fHCalEnergyMin && hcalNeutralSigma > fHCalEnergySignificanceMin) 602 { 603 // create new photon tower 634 604 tower = static_cast<Candidate*>(fTower->Clone()); 635 636 pt = hcalEnergy / TMath::CosH(eta);637 638 tower-> Momentum.SetPtEtaPhiE(pt, eta, phi, hcalEnergy);605 pt = hcalNeutralEnergy / TMath::CosH(eta); 606 607 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, hcalNeutralEnergy); 608 tower->Ehad = hcalNeutralEnergy; 639 609 tower->Eem = 0.0; 640 tower->Ehad = hcalEnergy; 641 610 642 611 fEFlowNeutralHadronOutputArray->Add(tower); 643 } 612 613 //clone tracks 614 fItHCalTowerTrackArray->Reset(); 615 while((track = static_cast<Candidate*>(fItHCalTowerTrackArray->Next()))) 616 { 617 mother = track; 618 track = static_cast<Candidate*>(track->Clone()); 619 track->AddCandidate(mother); 620 621 fEFlowTrackOutputArray->Add(track); 622 } 623 624 } 625 626 // if neutral excess is not significant, rescale eflow tracks, such that the total charged equals the best measurement given by the calorimeter and tracking 627 else if(fHCalTrackEnergy > 0.0) 628 { 629 weightTrack = (fHCalTrackSigma > 0.0) ? 1 / (fHCalTrackSigma*fHCalTrackSigma) : 0.0; 630 weightCalo = (hcalSigma > 0.0) ? 1 / (hcalSigma*hcalSigma) : 0.0; 631 632 bestEnergyEstimate = (weightTrack*fHCalTrackEnergy + weightCalo*hcalEnergy) / (weightTrack + weightCalo); 633 rescaleFactor = bestEnergyEstimate / fHCalTrackEnergy; 634 635 //rescale tracks 636 fItHCalTowerTrackArray->Reset(); 637 while((track = static_cast<Candidate*>(fItHCalTowerTrackArray->Next()))) 638 { 639 mother = track; 640 track = static_cast<Candidate*>(track->Clone()); 641 track->AddCandidate(mother); 642 643 track->Momentum *= rescaleFactor; 644 645 fEFlowTrackOutputArray->Add(track); 646 } 647 } 648 649 644 650 } 645 651 -
modules/Calorimeter.h
r98ce52a r91acc76 58 58 Double_t fTowerEta, fTowerPhi, fTowerEdges[4]; 59 59 Double_t fECalTowerEnergy, fHCalTowerEnergy; 60 Double_t fECalTrackEnergy [2], fHCalTrackEnergy[2];60 Double_t fECalTrackEnergy, fHCalTrackEnergy; 61 61 62 62 Double_t fTimingEnergyMin; … … 70 70 Double_t fECalEnergySignificanceMin; 71 71 Double_t fHCalEnergySignificanceMin; 72 73 Double_t fECalTrackSigma; 74 Double_t fHCalTrackSigma; 72 75 73 76 Bool_t fSmearTowerCenter; … … 103 106 TObjArray *fEFlowNeutralHadronOutputArray; //! 104 107 105 TObjArray *fECalTowerTrackArray [2]; //!106 TIterator *fItECalTowerTrackArray [2]; //!108 TObjArray *fECalTowerTrackArray; //! 109 TIterator *fItECalTowerTrackArray; //! 107 110 108 TObjArray *fHCalTowerTrackArray [2]; //!109 TIterator *fItHCalTowerTrackArray [2]; //!111 TObjArray *fHCalTowerTrackArray; //! 112 TIterator *fItHCalTowerTrackArray; //! 110 113 111 114 void FinalizeTower(); -
modules/ImpactParameterSmearing.cc
r98ce52a r91acc76 96 96 { 97 97 Candidate *candidate, *particle, *mother; 98 Double_t xd, yd, zd, d xy, sx, sy, sz, ddxy;98 Double_t xd, yd, zd, d0, sx, sy, sz, dd0; 99 99 Double_t pt, eta, px, py, phi, e; 100 100 … … 103 103 { 104 104 105 // take momentum before smearing (otherwise apply double smearing on d xy)105 // take momentum before smearing (otherwise apply double smearing on d0) 106 106 particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0)); 107 107 … … 131 131 132 132 // calculate impact parameter (after-smearing) 133 d xy= (xd*py - yd*px)/pt;133 d0 = (xd*py - yd*px)/pt; 134 134 135 dd xy= gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e));135 dd0 = gRandom->Gaus(0.0, fFormula->Eval(pt, eta, phi, e)); 136 136 137 137 // fill smeared values in candidate … … 143 143 candidate->Zd = zd; 144 144 145 candidate->D xy = dxy;146 candidate-> SDxy = ddxy;145 candidate->D0 = d0; 146 candidate->ErrorD0 = dd0; 147 147 148 148 candidate->AddCandidate(mother); -
modules/ModulesLinkDef.h
r98ce52a r91acc76 35 35 #include "modules/EnergySmearing.h" 36 36 #include "modules/MomentumSmearing.h" 37 #include "modules/TrackSmearing.h" 37 38 #include "modules/ImpactParameterSmearing.h" 38 39 #include "modules/TimeSmearing.h" … … 58 59 #include "modules/StatusPidFilter.h" 59 60 #include "modules/PdgCodeFilter.h" 61 #include "modules/BeamSpotFilter.h" 60 62 #include "modules/RecoPuFilter.h" 61 63 #include "modules/Cloner.h" … … 64 66 #include "modules/JetFlavorAssociation.h" 65 67 #include "modules/JetFakeParticle.h" 68 #include "modules/VertexSorter.h" 69 #include "modules/VertexFinder.h" 70 #include "modules/VertexFinderDA4D.h" 66 71 #include "modules/ExampleModule.h" 67 72 … … 81 86 #pragma link C++ class EnergySmearing+; 82 87 #pragma link C++ class MomentumSmearing+; 88 #pragma link C++ class TrackSmearing+; 83 89 #pragma link C++ class ImpactParameterSmearing+; 84 90 #pragma link C++ class TimeSmearing+; … … 104 110 #pragma link C++ class StatusPidFilter+; 105 111 #pragma link C++ class PdgCodeFilter+; 112 #pragma link C++ class BeamSpotFilter+; 106 113 #pragma link C++ class RecoPuFilter+; 107 114 #pragma link C++ class Cloner+; … … 110 117 #pragma link C++ class JetFlavorAssociation+; 111 118 #pragma link C++ class JetFakeParticle+; 119 #pragma link C++ class VertexSorter+; 120 #pragma link C++ class VertexFinder+; 121 #pragma link C++ class VertexFinderDA4D+; 112 122 #pragma link C++ class ExampleModule+; 113 123 -
modules/ParticlePropagator.cc
r98ce52a r91acc76 67 67 } 68 68 69 69 70 //------------------------------------------------------------------------------ 70 71 … … 91 92 fItInputArray = fInputArray->MakeIterator(); 92 93 94 // import beamspot 95 try 96 { 97 fBeamSpotInputArray = ImportArray(GetString("BeamSpotInputArray", "BeamSpotFilter/beamSpotParticle")); 98 } 99 catch(runtime_error &e) 100 { 101 fBeamSpotInputArray = 0; 102 } 93 103 // create output arrays 94 104 … … 111 121 { 112 122 Candidate *candidate, *mother; 113 TLorentzVector candidatePosition, candidateMomentum ;123 TLorentzVector candidatePosition, candidateMomentum, beamSpotPosition; 114 124 Double_t px, py, pz, pt, pt2, e, q; 115 125 Double_t x, y, z, t, r, phi; … … 120 130 Double_t tmp, discr, discr2; 121 131 Double_t delta, gammam, omega, asinrho; 122 Double_t rcu, rc2, dxy, xd, yd, zd; 132 Double_t rcu, rc2, xd, yd, zd; 133 Double_t l, d0, dz, p, ctgTheta, phip, etap, alpha; 134 Double_t bsx, bsy, bsz; 123 135 124 136 const Double_t c_light = 2.99792458E8; 137 138 if (!fBeamSpotInputArray || fBeamSpotInputArray->GetSize () == 0) 139 beamSpotPosition.SetXYZT(0.0, 0.0, 0.0, 0.0); 140 else 141 { 142 Candidate &beamSpotCandidate = *((Candidate *) fBeamSpotInputArray->At(0)); 143 beamSpotPosition = beamSpotCandidate.Position; 144 } 125 145 126 146 fItInputArray->Reset(); … … 132 152 y = candidatePosition.Y()*1.0E-3; 133 153 z = candidatePosition.Z()*1.0E-3; 154 155 bsx = beamSpotPosition.X()*1.0E-3; 156 bsy = beamSpotPosition.Y()*1.0E-3; 157 bsz = beamSpotPosition.Z()*1.0E-3; 158 134 159 q = candidate->Charge; 135 160 … … 182 207 z_t = z + pz*t; 183 208 209 l = TMath::Sqrt( (x_t - x)*(x_t - x) + (y_t - y)*(y_t - y) + (z_t - z)*(z_t - z)); 210 184 211 mother = candidate; 185 212 candidate = static_cast<Candidate*>(candidate->Clone()); 186 213 214 candidate->InitialPosition = candidatePosition; 187 215 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*e*1.0E3); 216 candidate->L = l*1.0E3; 188 217 189 218 candidate->Momentum = candidateMomentum; … … 239 268 zd = z + (TMath::Sqrt(xd*xd + yd*yd) - TMath::Sqrt(x*x + y*y))*pz/pt; 240 269 241 // calculate impact paramater 242 dxy = (xd*py - yd*px)/pt; 270 // use perigee momentum rather than original particle 271 // momentum, since the orignal particle momentum isn't known 272 273 px = TMath::Sign(1.0,r) * pt * (-y_c / r_c); 274 py = TMath::Sign(1.0,r) * pt * (x_c / r_c); 275 etap = candidateMomentum.Eta(); 276 phip = TMath::ATan2(py, px); 277 278 candidateMomentum.SetPtEtaPhiE(pt, etap, phip, candidateMomentum.E()); 279 280 // calculate additional track parameters (correct for beamspot position) 281 282 d0 = ( (x - bsx) * py - (y - bsy) * px) / pt; 283 dz = z - ((x - bsx) * px + (y - bsy) * py) / pt * (pz / pt); 284 p = candidateMomentum.P(); 285 ctgTheta = 1.0 / TMath::Tan (candidateMomentum.Theta ()); 286 243 287 244 288 // 3. time evaluation t = TMath::Min(t_r, t_z) … … 287 331 r_t = TMath::Hypot(x_t, y_t); 288 332 333 334 // compute path length for an helix 335 336 alpha = pz*1.0E9 / c_light / gammam; 337 l = t * TMath::Sqrt(alpha*alpha + r*r*omega*omega); 338 289 339 if(r_t > 0.0) 290 340 { 341 342 // store these variables before cloning 343 candidate->D0 = d0*1.0E3; 344 candidate->DZ = dz*1.0E3; 345 candidate->P = p; 346 candidate->PT = pt; 347 candidate->CtgTheta = ctgTheta; 348 candidate->Phi = phip; 349 291 350 mother = candidate; 292 351 candidate = static_cast<Candidate*>(candidate->Clone()); 293 352 353 candidate->InitialPosition = candidatePosition; 294 354 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3); 295 355 296 356 candidate->Momentum = candidateMomentum; 297 candidate->Dxy = dxy*1.0E3; 298 candidate->Xd = xd*1.0E3; 357 358 candidate->L = l*1.0E3; 359 360 candidate->Xd = xd*1.0E3; 299 361 candidate->Yd = yd*1.0E3; 300 362 candidate->Zd = zd*1.0E3; -
modules/ParticlePropagator.h
r98ce52a r91acc76 35 35 class TClonesArray; 36 36 class TIterator; 37 class TLorentzVector; 37 38 38 39 class ParticlePropagator: public DelphesModule … … 55 56 56 57 const TObjArray *fInputArray; //! 58 const TObjArray *fBeamSpotInputArray; //! 57 59 58 60 TObjArray *fOutputArray; //! -
modules/PileUpMerger.cc
r98ce52a r91acc76 115 115 TDatabasePDG *pdg = TDatabasePDG::Instance(); 116 116 TParticlePDG *pdgParticle; 117 Int_t pid ;117 Int_t pid, nch, nvtx = -1; 118 118 Float_t x, y, z, t, vx, vy; 119 Float_t px, py, pz, e ;120 Double_t dz, dphi, dt ;119 Float_t px, py, pz, e, pt; 120 Double_t dz, dphi, dt, sumpt2, dz0, dt0; 121 121 Int_t numberOfEvents, event, numberOfParticles; 122 122 Long64_t allEntries, entry; … … 132 132 fFunction->GetRandom2(dz, dt); 133 133 134 dz0 = -1.0e6; 135 dt0 = -1.0e6; 136 134 137 dt *= c_light*1.0E3; // necessary in order to make t in mm/c 135 138 dz *= 1.0E3; // necessary in order to make z in mm 139 140 //cout<<dz<<","<<dt<<endl; 141 136 142 vx = 0.0; 137 143 vy = 0.0; 144 138 145 numberOfParticles = fInputArray->GetEntriesFast(); 146 nch = 0; 147 sumpt2 = 0.0; 148 149 factory = GetFactory(); 150 vertex = factory->NewCandidate(); 151 139 152 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 140 153 { … … 143 156 z = candidate->Position.Z(); 144 157 t = candidate->Position.T(); 145 candidate->Position.SetZ(z + dz); 146 candidate->Position.SetT(t + dt); 158 pt = candidate->Momentum.Pt(); 159 160 // take postion and time from first stable particle 161 if (dz0 < -999999.0) 162 dz0 = z; 163 if (dt0 < -999999.0) 164 dt0 = t; 165 166 // cancel any possible offset in position and time the input file 167 candidate->Position.SetZ(z - dz0 + dz); 168 candidate->Position.SetT(t - dt0 + dt); 169 170 candidate->IsPU = 0; 171 147 172 fParticleOutputArray->Add(candidate); 173 174 if(TMath::Abs(candidate->Charge) > 1.0E-9) 175 { 176 nch++; 177 sumpt2 += pt*pt; 178 vertex->AddCandidate(candidate); 179 } 148 180 } 149 181 150 182 if(numberOfParticles > 0) 151 183 { 152 vx /= numberOfParticles;153 vy /= numberOfParticles;184 vx /= sumpt2; 185 vy /= sumpt2; 154 186 } 155 187 156 factory = GetFactory(); 157 158 vertex = factory->NewCandidate(); 188 nvtx++; 159 189 vertex->Position.SetXYZT(vx, vy, dz, dt); 190 vertex->ClusterIndex = nvtx; 191 vertex->ClusterNDF = nch; 192 vertex->SumPT2 = sumpt2; 193 vertex->GenSumPT2 = sumpt2; 160 194 fVertexOutputArray->Add(vertex); 161 195 … … 170 204 numberOfEvents = gRandom->Integer(2*fMeanPileUp + 1); 171 205 break; 206 case 2: 207 numberOfEvents = fMeanPileUp; 208 break; 172 209 default: 173 210 numberOfEvents = gRandom->Poisson(fMeanPileUp); … … 176 213 177 214 allEntries = fReader->GetEntries(); 215 178 216 179 217 for(event = 0; event < numberOfEvents; ++event) … … 198 236 vx = 0.0; 199 237 vy = 0.0; 238 200 239 numberOfParticles = 0; 240 sumpt2 = 0.0; 241 242 //factory = GetFactory(); 243 vertex = factory->NewCandidate(); 244 201 245 while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e)) 202 246 { … … 215 259 candidate->Momentum.SetPxPyPzE(px, py, pz, e); 216 260 candidate->Momentum.RotateZ(dphi); 261 pt = candidate->Momentum.Pt(); 217 262 218 263 x -= fInputBeamSpotX; … … 224 269 vx += candidate->Position.X(); 225 270 vy += candidate->Position.Y(); 271 226 272 ++numberOfParticles; 273 if(TMath::Abs(candidate->Charge) > 1.0E-9) 274 { 275 nch++; 276 sumpt2 += pt*pt; 277 vertex->AddCandidate(candidate); 278 } 227 279 228 280 fParticleOutputArray->Add(candidate); … … 235 287 } 236 288 237 vertex = factory->NewCandidate(); 289 nvtx++; 290 238 291 vertex->Position.SetXYZT(vx, vy, dz, dt); 292 293 vertex->ClusterIndex = nvtx; 294 vertex->ClusterNDF = nch; 295 vertex->SumPT2 = sumpt2; 296 vertex->GenSumPT2 = sumpt2; 297 239 298 vertex->IsPU = 1; 240 299 241 300 fVertexOutputArray->Add(vertex); 301 242 302 } 243 303 } -
modules/SimpleCalorimeter.cc
r98ce52a r91acc76 58 58 fItParticleInputArray(0), fItTrackInputArray(0) 59 59 { 60 Int_t i; 61 60 62 61 fResolutionFormula = new DelphesFormula; 63 64 for(i = 0; i < 2; ++i) 65 { 66 fTowerTrackArray[i] = new TObjArray; 67 fItTowerTrackArray[i] = fTowerTrackArray[i]->MakeIterator(); 68 } 62 fTowerTrackArray = new TObjArray; 63 fItTowerTrackArray = fTowerTrackArray->MakeIterator(); 64 69 65 } 70 66 … … 73 69 SimpleCalorimeter::~SimpleCalorimeter() 74 70 { 75 Int_t i; 76 71 77 72 if(fResolutionFormula) delete fResolutionFormula; 78 79 for(i = 0; i < 2; ++i) 80 { 81 if(fTowerTrackArray[i]) delete fTowerTrackArray[i]; 82 if(fItTowerTrackArray[i]) delete fItTowerTrackArray[i]; 83 } 73 if(fTowerTrackArray) delete fTowerTrackArray; 74 if(fItTowerTrackArray) delete fItTowerTrackArray; 75 84 76 } 85 77 … … 198 190 Double_t fraction; 199 191 Double_t energy; 200 Double_t sigma;201 192 Int_t pdgCode; 202 193 … … 340 331 fTowerEnergy = 0.0; 341 332 342 fTrackEnergy [0]= 0.0;343 fTrack Energy[1]= 0.0;333 fTrackEnergy = 0.0; 334 fTrackSigma = 0.0; 344 335 345 336 fTowerTime = 0.0; … … 351 342 fTowerPhotonHits = 0; 352 343 353 fTowerTrackArray[0]->Clear(); 354 fTowerTrackArray[1]->Clear(); 355 } 344 fTowerTrackArray->Clear(); 345 } 356 346 357 347 // check for track hits … … 371 361 if(fTrackFractions[number] > 1.0E-9) 372 362 { 373 sigma = fResolutionFormula->Eval(0.0, fTowerEta, 0.0, momentum.E()); 374 if(sigma/momentum.E() < track->TrackResolution) 375 { 376 fTrackEnergy[0] += energy; 377 fTowerTrackArray[0]->Add(track); 378 } 379 else 380 { 381 fTrackEnergy[1] += energy; 382 fTowerTrackArray[1]->Add(track); 383 } 363 364 // compute total charged energy 365 fTrackEnergy += energy; 366 fTrackSigma += ((track->TrackResolution)*momentum.E())*((track->TrackResolution)*momentum.E()); 367 368 fTowerTrackArray->Add(track); 369 384 370 } 371 385 372 else 386 373 { … … 403 390 fTowerEnergy += energy; 404 391 405 fTowerTime += TMath::Sqrt(energy)*position.T();406 fTowerTimeWeight += TMath::Sqrt(energy);392 fTowerTime += energy*position.T(); 393 fTowerTimeWeight += energy; 407 394 408 395 fTower->AddCandidate(particle); … … 418 405 { 419 406 Candidate *tower, *track, *mother; 420 Double_t energy, pt, eta, phi;421 Double_t sigma ;407 Double_t energy,neutralEnergy, pt, eta, phi; 408 Double_t sigma, neutralSigma; 422 409 Double_t time; 410 411 Double_t weightTrack, weightCalo, bestEnergyEstimate, rescaleFactor; 423 412 424 413 TLorentzVector momentum; … … 436 425 437 426 if(energy < fEnergyMin || energy < fEnergySignificanceMin*sigma) energy = 0.0; 427 438 428 439 429 if(fSmearTowerCenter) … … 464 454 if(energy > 0.0) fTowerOutputArray->Add(fTower); 465 455 466 // fill e-flow candidates 467 468 energy -= fTrackEnergy[1]; 469 470 fItTowerTrackArray[0]->Reset(); 471 while((track = static_cast<Candidate*>(fItTowerTrackArray[0]->Next()))) 472 { 473 mother = track; 474 track = static_cast<Candidate*>(track->Clone()); 475 track->AddCandidate(mother); 476 477 track->Momentum *= energy/fTrackEnergy[0]; 478 479 fEFlowTrackOutputArray->Add(track); 480 } 481 482 fItTowerTrackArray[1]->Reset(); 483 while((track = static_cast<Candidate*>(fItTowerTrackArray[1]->Next()))) 484 { 485 mother = track; 486 track = static_cast<Candidate*>(track->Clone()); 487 track->AddCandidate(mother); 488 489 fEFlowTrackOutputArray->Add(track); 490 } 491 492 if(fTowerTrackArray[0]->GetEntriesFast() > 0) energy = 0.0; 493 494 sigma = fResolutionFormula->Eval(0.0, fTowerEta, 0.0, energy); 495 if(energy < fEnergyMin || energy < fEnergySignificanceMin*sigma) energy = 0.0; 496 497 // save energy excess as an energy flow tower 498 if(energy > 0.0) 456 457 // e-flow candidates 458 459 //compute neutral excess 460 461 fTrackSigma = TMath::Sqrt(fTrackSigma); 462 neutralEnergy = max( (energy - fTrackEnergy) , 0.0); 463 464 //compute sigma_trk total 465 neutralSigma = neutralEnergy / TMath::Sqrt(fTrackSigma*fTrackSigma+ sigma*sigma); 466 467 // if neutral excess is significant, simply create neutral Eflow tower and clone each track into eflowtrack 468 if(neutralEnergy > fEnergyMin && neutralSigma > fEnergySignificanceMin) 499 469 { 500 470 // create new photon tower 501 471 tower = static_cast<Candidate*>(fTower->Clone()); 502 pt = energy / TMath::CosH(eta); 503 504 tower->Eem = (!fIsEcal) ? 0 : energy; 505 tower->Ehad = (fIsEcal) ? 0 : energy; 472 pt = neutralEnergy / TMath::CosH(eta); 473 474 tower->Eem = (!fIsEcal) ? 0 : neutralEnergy; 475 tower->Ehad = (fIsEcal) ? 0 : neutralEnergy; 476 tower->PID = (fIsEcal) ? 22 : 0; 477 478 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, neutralEnergy); 479 fEFlowTowerOutputArray->Add(tower); 506 480 507 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 481 fItTowerTrackArray->Reset(); 482 while((track = static_cast<Candidate*>(fItTowerTrackArray->Next()))) 483 { 484 mother = track; 485 track = static_cast<Candidate*>(track->Clone()); 486 track->AddCandidate(mother); 487 488 fEFlowTrackOutputArray->Add(track); 489 } 490 } 508 491 509 tower->PID = (fIsEcal) ? 22 : 0; 510 511 fEFlowTowerOutputArray->Add(tower); 512 } 513 } 492 // if neutral excess is not significant, rescale eflow tracks, such that the total charged equals the best measurement given by the calorimeter and tracking 493 else if (fTrackEnergy > 0.0) 494 { 495 weightTrack = (fTrackSigma > 0.0) ? 1 / (fTrackSigma*fTrackSigma) : 0.0; 496 weightCalo = (sigma > 0.0) ? 1 / (sigma*sigma) : 0.0; 497 498 bestEnergyEstimate = (weightTrack*fTrackEnergy + weightCalo*energy) / (weightTrack + weightCalo); 499 rescaleFactor = bestEnergyEstimate/fTrackEnergy; 500 501 fItTowerTrackArray->Reset(); 502 while((track = static_cast<Candidate*>(fItTowerTrackArray->Next()))) 503 { 504 mother = track; 505 track = static_cast<Candidate*>(track->Clone()); 506 track->AddCandidate(mother); 507 508 track->Momentum *= rescaleFactor; 509 510 fEFlowTrackOutputArray->Add(track); 511 } 512 } 513 514 } 514 515 515 516 //------------------------------------------------------------------------------ -
modules/SimpleCalorimeter.h
r98ce52a r91acc76 59 59 Double_t fTowerEta, fTowerPhi, fTowerEdges[4]; 60 60 Double_t fTowerEnergy; 61 Double_t fTrackEnergy [2];61 Double_t fTrackEnergy; 62 62 63 63 Double_t fTowerTime; … … 72 72 73 73 Double_t fEnergySignificanceMin; 74 75 Double_t fTrackSigma; 74 76 75 77 Bool_t fSmearTowerCenter; … … 102 104 TObjArray *fEFlowTowerOutputArray; //! 103 105 104 TObjArray *fTowerTrackArray [2]; //!105 TIterator *fItTowerTrackArray [2]; //!106 TObjArray *fTowerTrackArray; //! 107 TIterator *fItTowerTrackArray; //! 106 108 107 109 void FinalizeTower(); -
modules/TimeSmearing.cc
r98ce52a r91acc76 93 93 { 94 94 Candidate *candidate, *mother; 95 Double_t t ;95 Double_t ti, tf_smeared, tf; 96 96 const Double_t c_light = 2.99792458E8; 97 97 … … 99 99 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 100 100 { 101 const TLorentzVector &candidatePosition = candidate->Position; 102 t = candidatePosition.T()*1.0E-3/c_light; 101 const TLorentzVector &candidateInitialPosition = candidate->InitialPosition; 102 const TLorentzVector &candidateFinalPosition = candidate->Position; 103 104 ti = candidateInitialPosition.T()*1.0E-3/c_light; 105 tf = candidateFinalPosition.T()*1.0E-3/c_light; 103 106 104 107 // apply smearing formula 105 t = gRandom->Gaus(t, fTimeResolution); 108 tf_smeared = gRandom->Gaus(tf, fTimeResolution); 109 ti = ti + tf_smeared - tf; 106 110 107 111 mother = candidate; 108 112 candidate = static_cast<Candidate*>(candidate->Clone()); 109 candidate->Position.SetT(t*1.0E3*c_light); 113 candidate->InitialPosition.SetT(ti*1.0E3*c_light); 114 candidate->Position.SetT(tf*1.0E3*c_light); 115 116 candidate->ErrorT = fTimeResolution*1.0E3*c_light; 110 117 111 118 candidate->AddCandidate(mother); -
modules/TrackCountingBTagging.cc
r98ce52a r91acc76 96 96 97 97 Double_t jpx, jpy; 98 Double_t dr, tp x, tpy, tpt;99 Double_t xd, yd, d xy, ddxy, ip, sip;98 Double_t dr, tpt; 99 Double_t xd, yd, d0, dd0, ip, sip; 100 100 101 101 Int_t sign; … … 117 117 { 118 118 const TLorentzVector &trkMomentum = track->Momentum; 119 119 120 120 dr = jetMomentum.DeltaR(trkMomentum); 121 122 121 tpt = trkMomentum.Pt(); 123 tpx = trkMomentum.Px();124 tpy = trkMomentum.Py();125 126 122 xd = track->Xd; 127 123 yd = track->Yd; 128 d xy= TMath::Hypot(xd, yd);129 dd xy = track->SDxy;124 d0 = TMath::Hypot(xd, yd); 125 dd0 = track->ErrorD0; 130 126 131 127 if(tpt < fPtMin) continue; 132 128 if(dr > fDeltaR) continue; 133 if(d xy> fIPmax) continue;129 if(d0 > fIPmax) continue; 134 130 135 131 sign = (jpx*xd + jpy*yd > 0.0) ? 1 : -1; 136 132 137 ip = sign*d xy;138 sip = ip / TMath::Abs(dd xy);133 ip = sign*d0; 134 sip = ip / TMath::Abs(dd0); 139 135 140 136 if(sip > fSigMin) count++; -
modules/TreeWriter.cc
r98ce52a r91acc76 215 215 entry->Pz = momentum.Pz(); 216 216 217 entry->D0 = candidate->D0; 218 entry->DZ = candidate->DZ; 219 entry->P = candidate->P; 220 entry->PT = candidate->PT; 221 entry->CtgTheta = candidate->CtgTheta; 222 entry->Phi = candidate->Phi; 223 217 224 entry->Eta = eta; 218 225 entry->Phi = momentum.Phi(); … … 233 240 { 234 241 TIter iterator(array); 235 Candidate *candidate = 0 ;242 Candidate *candidate = 0, *constituent = 0; 236 243 Vertex *entry = 0; 237 244 238 245 const Double_t c_light = 2.99792458E8; 239 246 247 Double_t x, y, z, t, xError, yError, zError, tError, sigma, sumPT2, btvSumPT2, genDeltaZ, genSumPT2; 248 UInt_t index, ndf; 249 250 CompBase *compare = Candidate::fgCompare; 251 Candidate::fgCompare = CompSumPT2<Candidate>::Instance(); 252 array->Sort(); 253 Candidate::fgCompare = compare; 254 240 255 // loop over all vertices 241 256 iterator.Reset(); 242 257 while((candidate = static_cast<Candidate*>(iterator.Next()))) 243 258 { 244 const TLorentzVector &position = candidate->Position; 259 260 index = candidate->ClusterIndex; 261 ndf = candidate->ClusterNDF; 262 sigma = candidate->ClusterSigma; 263 sumPT2 = candidate->SumPT2; 264 btvSumPT2 = candidate->BTVSumPT2; 265 genDeltaZ = candidate->GenDeltaZ; 266 genSumPT2 = candidate->GenSumPT2; 267 268 x = candidate->Position.X(); 269 y = candidate->Position.Y(); 270 z = candidate->Position.Z(); 271 t = candidate->Position.T()*1.0E-3/c_light; 272 273 xError = candidate->PositionError.X (); 274 yError = candidate->PositionError.Y (); 275 zError = candidate->PositionError.Z (); 276 tError = candidate->PositionError.T ()*1.0E-3/c_light; 245 277 246 278 entry = static_cast<Vertex*>(branch->NewEntry()); 247 279 248 entry->X = position.X(); 249 entry->Y = position.Y(); 250 entry->Z = position.Z(); 251 entry->T = position.T()*1.0E-3/c_light; 252 } 253 } 280 entry->Index = index; 281 entry->NDF = ndf; 282 entry->Sigma = sigma; 283 entry->SumPT2 = sumPT2; 284 entry->BTVSumPT2 = btvSumPT2; 285 entry->GenDeltaZ = genDeltaZ; 286 entry->GenSumPT2 = genSumPT2; 287 288 entry->X = x; 289 entry->Y = y; 290 entry->Z = z; 291 entry->T = t; 292 293 entry->ErrorX = xError; 294 entry->ErrorY = yError; 295 entry->ErrorZ = zError; 296 entry->ErrorT = tError; 297 298 299 TIter itConstituents(candidate->GetCandidates()); 300 itConstituents.Reset(); 301 entry->Constituents.Clear(); 302 while((constituent = static_cast<Candidate*>(itConstituents.Next()))) 303 { 304 entry->Constituents.Add(constituent); 305 } 306 307 } 308 } 309 254 310 255 311 //------------------------------------------------------------------------------ … … 261 317 Candidate *particle = 0; 262 318 Track *entry = 0; 263 Double_t pt, signz, cosTheta, eta, rapidity ;319 Double_t pt, signz, cosTheta, eta, rapidity, p, ctgTheta, phi; 264 320 const Double_t c_light = 2.99792458E8; 265 321 … … 292 348 entry->TOuter = position.T()*1.0E-3/c_light; 293 349 294 entry->Dxy = candidate->Dxy; 295 entry->SDxy = candidate->SDxy ; 350 entry->L = candidate->L; 351 352 entry->D0 = candidate->D0; 353 entry->ErrorD0 = candidate->ErrorD0; 354 entry->DZ = candidate->DZ; 355 entry->ErrorDZ = candidate->ErrorDZ; 356 357 entry->ErrorP = candidate->ErrorP; 358 entry->ErrorPT = candidate->ErrorPT; 359 entry->ErrorCtgTheta = candidate->ErrorCtgTheta; 360 entry->ErrorPhi = candidate->ErrorPhi; 361 296 362 entry->Xd = candidate->Xd; 297 363 entry->Yd = candidate->Yd; … … 301 367 302 368 pt = momentum.Pt(); 369 p = momentum.P(); 370 phi = momentum.Phi(); 371 ctgTheta = (TMath::Tan(momentum.Theta()) != 0) ? 1/TMath::Tan(momentum.Theta()) : 1e10; 372 303 373 cosTheta = TMath::Abs(momentum.CosTheta()); 304 374 signz = (momentum.Pz() >= 0.0) ? 1.0 : -1.0; … … 306 376 rapidity = (cosTheta == 1.0 ? signz*999.9 : momentum.Rapidity()); 307 377 378 entry->PT = pt; 308 379 entry->Eta = eta; 309 entry->Phi = momentum.Phi();310 entry-> PT = pt;380 entry->Phi = phi; 381 entry->CtgTheta = ctgTheta; 311 382 312 383 particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0)); … … 319 390 320 391 entry->Particle = particle; 392 393 entry->VertexIndex = candidate->ClusterIndex; 394 321 395 } 322 396 } -
readers/DelphesCMSFWLite.cpp
r98ce52a r91acc76 272 272 273 273 branchEvent = treeWriter->NewBranch("Event", HepMCEvent::Class()); 274 branchRwgt = treeWriter->NewBranch(" Rwgt", Weight::Class());274 branchRwgt = treeWriter->NewBranch("Weight", Weight::Class()); 275 275 276 276 confReader = new ExRootConfReader;
Note:
See TracChangeset
for help on using the changeset viewer.