Changes in / [9343566:e33e6db] in git
- Files:
-
- 27 deleted
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r9343566 re33e6db 257 257 classes/DelphesClasses.h \ 258 258 classes/DelphesFactory.h \ 259 classes/DelphesLHEFReader.h \260 259 external/ExRootAnalysis/ExRootTreeWriter.h \ 261 260 external/ExRootAnalysis/ExRootTreeBranch.h \ … … 338 337 modules/Weighter.h \ 339 338 modules/Hector.h \ 340 modules/RunPUPPI.h \341 modules/JetFlavorAssociation.h \342 339 modules/ExampleModule.h 343 340 ModulesDict$(PcmSuf): \ … … 524 521 tmp/external/Hector/H_VerticalQuadrupole.$(ObjSuf): \ 525 522 external/Hector/H_VerticalQuadrupole.$(SrcSuf) 526 tmp/external/PUPPI/puppiCleanContainer.$(ObjSuf): \527 external/PUPPI/puppiCleanContainer.$(SrcSuf) \528 external/fastjet/Selector.hh529 523 tmp/modules/AngularSmearing.$(ObjSuf): \ 530 524 modules/AngularSmearing.$(SrcSuf) \ … … 658 652 external/ExRootAnalysis/ExRootFilter.h \ 659 653 external/ExRootAnalysis/ExRootClassifier.h 660 tmp/modules/JetFlavorAssociation.$(ObjSuf): \661 modules/JetFlavorAssociation.$(SrcSuf) \662 modules/JetFlavorAssociation.h \663 classes/DelphesClasses.h \664 classes/DelphesFactory.h \665 classes/DelphesFormula.h \666 external/ExRootAnalysis/ExRootResult.h \667 external/ExRootAnalysis/ExRootFilter.h \668 external/ExRootAnalysis/ExRootClassifier.h669 654 tmp/modules/JetPileUpSubtractor.$(ObjSuf): \ 670 655 modules/JetPileUpSubtractor.$(SrcSuf) \ … … 745 730 classes/DelphesClasses.h \ 746 731 classes/DelphesFactory.h \ 747 classes/Delphes TF2.h \732 classes/DelphesFormula.h \ 748 733 classes/DelphesPileUpReader.h \ 749 734 external/ExRootAnalysis/ExRootResult.h \ 750 735 external/ExRootAnalysis/ExRootFilter.h \ 751 736 external/ExRootAnalysis/ExRootClassifier.h 752 tmp/modules/RunPUPPI.$(ObjSuf): \753 modules/RunPUPPI.$(SrcSuf) \754 modules/RunPUPPI.h \755 external/PUPPI/puppiCleanContainer.hh \756 external/PUPPI/RecoObj.hh \757 external/PUPPI/puppiParticle.hh \758 external/PUPPI/puppiAlgoBin.hh \759 classes/DelphesClasses.h \760 classes/DelphesFactory.h \761 classes/DelphesFormula.h762 737 tmp/modules/SimpleCalorimeter.$(ObjSuf): \ 763 738 modules/SimpleCalorimeter.$(SrcSuf) \ … … 894 869 tmp/external/Hector/H_VerticalKicker.$(ObjSuf) \ 895 870 tmp/external/Hector/H_VerticalQuadrupole.$(ObjSuf) \ 896 tmp/external/PUPPI/puppiCleanContainer.$(ObjSuf) \897 871 tmp/modules/AngularSmearing.$(ObjSuf) \ 898 872 tmp/modules/BTagging.$(ObjSuf) \ … … 909 883 tmp/modules/ImpactParameterSmearing.$(ObjSuf) \ 910 884 tmp/modules/Isolation.$(ObjSuf) \ 911 tmp/modules/JetFlavorAssociation.$(ObjSuf) \912 885 tmp/modules/JetPileUpSubtractor.$(ObjSuf) \ 913 886 tmp/modules/LeptonDressing.$(ObjSuf) \ … … 918 891 tmp/modules/PileUpJetID.$(ObjSuf) \ 919 892 tmp/modules/PileUpMerger.$(ObjSuf) \ 920 tmp/modules/RunPUPPI.$(ObjSuf) \921 893 tmp/modules/SimpleCalorimeter.$(ObjSuf) \ 922 894 tmp/modules/StatusPidFilter.$(ObjSuf) \ … … 1108 1080 tmp/external/fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.$(ObjSuf): \ 1109 1081 external/fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.$(SrcSuf) 1110 tmp/external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.$(ObjSuf): \1111 external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.$(SrcSuf) \1112 external/fastjet/JetDefinition.hh \1113 external/fastjet/ClusterSequenceAreaBase.hh1114 tmp/external/fastjet/contribs/RecursiveTools/Recluster.$(ObjSuf): \1115 external/fastjet/contribs/RecursiveTools/Recluster.$(SrcSuf)1116 tmp/external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.$(ObjSuf): \1117 external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.$(SrcSuf) \1118 external/fastjet/JetDefinition.hh \1119 external/fastjet/ClusterSequenceAreaBase.hh1120 tmp/external/fastjet/contribs/RecursiveTools/SoftDrop.$(ObjSuf): \1121 external/fastjet/contribs/RecursiveTools/SoftDrop.$(SrcSuf)1122 1082 tmp/external/fastjet/contribs/SoftKiller/SoftKiller.$(ObjSuf): \ 1123 1083 external/fastjet/contribs/SoftKiller/SoftKiller.$(SrcSuf) … … 1253 1213 external/fastjet/contribs/Nsubjettiness/Njettiness.hh \ 1254 1214 external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh \ 1255 external/fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.hh \ 1256 external/fastjet/tools/Filter.hh \ 1257 external/fastjet/tools/Pruner.hh \ 1258 external/fastjet/contribs/RecursiveTools/SoftDrop.hh 1215 external/fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.hh 1259 1216 tmp/modules/FastJetGridMedianEstimator.$(ObjSuf): \ 1260 1217 modules/FastJetGridMedianEstimator.$(SrcSuf) \ … … 1328 1285 tmp/external/fastjet/contribs/Nsubjettiness/Nsubjettiness.$(ObjSuf) \ 1329 1286 tmp/external/fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.$(ObjSuf) \ 1330 tmp/external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.$(ObjSuf) \1331 tmp/external/fastjet/contribs/RecursiveTools/Recluster.$(ObjSuf) \1332 tmp/external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.$(ObjSuf) \1333 tmp/external/fastjet/contribs/RecursiveTools/SoftDrop.$(ObjSuf) \1334 1287 tmp/external/fastjet/contribs/SoftKiller/SoftKiller.$(ObjSuf) \ 1335 1288 tmp/external/fastjet/plugins/ATLASCone/ATLASConePlugin.$(ObjSuf) \ … … 1385 1338 display/Delphes3DGeometry.$(SrcSuf) \ 1386 1339 display/Delphes3DGeometry.h \ 1387 classes/DelphesClasses.h \1388 external/ExRootAnalysis/ExRootConfReader.h1340 external/ExRootAnalysis/ExRootConfReader.h \ 1341 classes/DelphesClasses.h 1389 1342 tmp/display/DelphesBranchElement.$(ObjSuf): \ 1390 1343 display/DelphesBranchElement.$(SrcSuf) \ … … 1399 1352 tmp/display/DelphesEventDisplay.$(ObjSuf): \ 1400 1353 display/DelphesEventDisplay.$(SrcSuf) \ 1354 external/ExRootAnalysis/ExRootConfReader.h \ 1355 external/ExRootAnalysis/ExRootTreeReader.h \ 1401 1356 display/DelphesCaloData.h \ 1402 1357 display/DelphesBranchElement.h \ 1403 1358 display/Delphes3DGeometry.h \ 1404 1359 display/DelphesEventDisplay.h \ 1405 display/DelphesDisplay.h \ 1406 display/Delphes3DGeometry.h \ 1407 display/DelphesHtmlSummary.h \ 1408 display/DelphesPlotSummary.h \ 1409 classes/DelphesClasses.h \ 1410 external/ExRootAnalysis/ExRootConfReader.h \ 1411 external/ExRootAnalysis/ExRootTreeReader.h 1360 classes/DelphesClasses.h 1412 1361 tmp/display/DelphesHtmlSummary.$(ObjSuf): \ 1413 1362 display/DelphesHtmlSummary.$(SrcSuf) \ … … 1592 1541 @touch $@ 1593 1542 1543 external/fastjet/Selector.hh: \ 1544 external/fastjet/PseudoJet.hh \ 1545 external/fastjet/RangeDefinition.hh 1546 @touch $@ 1547 1594 1548 external/fastjet/internal/Dnn2piCylinder.hh: \ 1595 1549 external/fastjet/internal/DynamicNearestNeighbours.hh \ 1596 1550 external/fastjet/internal/DnnPlane.hh \ 1597 1551 external/fastjet/internal/numconsts.hh 1598 @touch $@1599 1600 external/fastjet/Selector.hh: \1601 external/fastjet/PseudoJet.hh \1602 external/fastjet/RangeDefinition.hh1603 1552 @touch $@ 1604 1553 … … 1690 1639 @touch $@ 1691 1640 1692 modules/RunPUPPI.h: \1693 classes/DelphesModule.h1694 @touch $@1695 1696 1641 modules/Cloner.h: \ 1697 1642 classes/DelphesModule.h … … 1730 1675 @touch $@ 1731 1676 1677 display/DelphesEventDisplay.h: \ 1678 external/ExRootAnalysis/ExRootTreeReader.h \ 1679 display/DelphesDisplay.h \ 1680 display/Delphes3DGeometry.h \ 1681 display/DelphesHtmlSummary.h \ 1682 display/DelphesPlotSummary.h 1683 @touch $@ 1684 1732 1685 modules/TauTagging.h: \ 1733 1686 classes/DelphesModule.h \ … … 1772 1725 @touch $@ 1773 1726 1774 modules/JetFlavorAssociation.h: \1775 classes/DelphesModule.h \1776 classes/DelphesClasses.h1777 @touch $@1778 1779 1727 modules/ParticlePropagator.h: \ 1780 1728 classes/DelphesModule.h … … 1809 1757 external/fastjet/AreaDefinition.hh \ 1810 1758 external/fastjet/ClusterSequenceAreaBase.hh 1811 @touch $@1812 1813 external/PUPPI/puppiCleanContainer.hh: \1814 external/PUPPI/RecoObj.hh \1815 external/PUPPI/puppiParticle.hh \1816 external/PUPPI/puppiAlgoBin.hh \1817 external/fastjet/internal/base.hh \1818 external/fastjet/PseudoJet.hh1819 1759 @touch $@ 1820 1760 -
cards/delphes_card_ATLAS.tcl
r9343566 re33e6db 295 295 296 296 module Efficiency PhotonEfficiency { 297 set InputArray Calorimeter/ eflowPhotons297 set InputArray Calorimeter/photons 298 298 set OutputArray photons 299 299 -
cards/delphes_card_ATLAS_PileUp.tcl
r9343566 re33e6db 478 478 479 479 module Efficiency PhotonEfficiency { 480 set InputArray Calorimeter/ eflowPhotons480 set InputArray Calorimeter/photons 481 481 set OutputArray photons 482 482 -
cards/delphes_card_FCC_basic.tcl
r9343566 re33e6db 226 226 set EFlowTowerOutputArray eflowPhotons 227 227 228 set IsEcal true229 230 228 set EnergyMin 0.5 231 229 set EnergySignificanceMin 1.0 … … 292 290 set EFlowTowerOutputArray eflowNeutralHadrons 293 291 294 set IsEcal false295 296 292 set EnergyMin 1.0 297 293 set EnergySignificanceMin 1.0 … … 435 431 436 432 module FastJetFinder FastJetFinder { 437 # set InputArray TowerMerger/towers433 # set InputArray Calorimeter/towers 438 434 set InputArray EFlowMerger/eflow 439 435 -
cards/delphes_card_LHCb.tcl
r9343566 re33e6db 223 223 set TowerOutputArray ecalTowers 224 224 set EFlowTowerOutputArray eflowPhotons 225 226 set IsEcal true227 225 228 226 set EnergyMin 0.0 … … 305 303 set TowerOutputArray hcalTowers 306 304 set EFlowTowerOutputArray eflowNeutralHadrons 307 308 set IsEcal false309 305 310 306 set EnergyMin 0.0 -
classes/ClassesLinkDef.h
r9343566 re33e6db 46 46 #pragma link C++ class LHCOEvent+; 47 47 #pragma link C++ class LHEFEvent+; 48 #pragma link C++ class LHEFWeight+;49 48 #pragma link C++ class HepMCEvent+; 50 49 #pragma link C++ class GenParticle+; -
classes/DelphesClasses.cc
r9343566 re33e6db 120 120 PID(0), Status(0), M1(-1), M2(-1), D1(-1), D2(-1), 121 121 Charge(0), Mass(0.0), 122 IsPU(0), IsRecoPU(0), IsConstituent(0), 123 Flavor(0), FlavorAlgo(0), FlavorPhys(0), 124 BTag(0), BTagAlgo(0), BTagPhys(0), 125 TauTag(0), Eem(0.0), Ehad(0.0), 122 IsPU(0), IsConstituent(0), 123 BTag(0), TauTag(0), Eem(0.0), Ehad(0.0), 126 124 DeltaEta(0.0), DeltaPhi(0.0), 127 125 Momentum(0.0, 0.0, 0.0, 0.0), … … 131 129 NCharged(0), 132 130 NNeutrals(0), 133 NSubJetsTrimmed(0),134 NSubJetsPruned(0),135 NSubJetsSoftDropped(0),136 131 Beta(0), 137 132 BetaStar(0), 138 133 MeanSqDeltaR(0), 139 134 PTD(0), 140 Ntimes(-1),141 IsolationVar(-999),142 IsolationVarRhoCorr(-999),143 SumPtCharged(-999),144 SumPtNeutral(-999),145 SumPtChargedPU(-999),146 SumPt(-999),147 135 fFactory(0), 148 136 fArray(0) 149 137 { 150 int i;151 138 Edges[0] = 0.0; 152 139 Edges[1] = 0.0; … … 163 150 Tau[3] = 0.0; 164 151 Tau[4] = 0.0; 165 for(i = 0; i < 5; ++i)166 {167 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);168 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);169 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);170 }171 152 } 172 153 … … 243 224 object.IsPU = IsPU; 244 225 object.IsConstituent = IsConstituent; 245 object.Flavor = Flavor;246 object.FlavorAlgo = FlavorAlgo;247 object.FlavorPhys = FlavorPhys;248 226 object.BTag = BTag; 249 object.BTagAlgo = BTagAlgo;250 object.BTagPhys = BTagPhys;251 227 object.TauTag = TauTag; 252 228 object.Eem = Eem; … … 273 249 object.MeanSqDeltaR = MeanSqDeltaR; 274 250 object.PTD = PTD; 275 object.Ntimes = Ntimes;276 object.IsolationVar = IsolationVar;277 object.IsolationVarRhoCorr = IsolationVarRhoCorr;278 object.SumPtCharged = SumPtCharged;279 object.SumPtNeutral = SumPtNeutral;280 object.SumPtChargedPU = SumPtChargedPU;281 object.SumPt = SumPt;282 283 251 object.FracPt[0] = FracPt[0]; 284 252 object.FracPt[1] = FracPt[1]; … … 291 259 object.Tau[3] = Tau[3]; 292 260 object.Tau[4] = Tau[4]; 293 294 object.TrimmedP4[0] = TrimmedP4[0];295 object.TrimmedP4[1] = TrimmedP4[1];296 object.TrimmedP4[2] = TrimmedP4[2];297 object.TrimmedP4[3] = TrimmedP4[3];298 object.TrimmedP4[4] = TrimmedP4[4];299 object.PrunedP4[0] = PrunedP4[0];300 object.PrunedP4[1] = PrunedP4[1];301 object.PrunedP4[2] = PrunedP4[2];302 object.PrunedP4[3] = PrunedP4[3];303 object.PrunedP4[4] = PrunedP4[4];304 object.SoftDroppedP4[0] = SoftDroppedP4[0];305 object.SoftDroppedP4[1] = SoftDroppedP4[1];306 object.SoftDroppedP4[2] = SoftDroppedP4[2];307 object.SoftDroppedP4[3] = SoftDroppedP4[3];308 object.SoftDroppedP4[4] = SoftDroppedP4[4];309 310 object.NSubJetsTrimmed = NSubJetsTrimmed;311 object.NSubJetsPruned = NSubJetsPruned;312 object.NSubJetsSoftDropped = NSubJetsSoftDropped;313 261 314 262 object.fFactory = fFactory; 315 263 object.fArray = 0; 316 317 // Copy cluster timing info318 copy(Ecal_E_t.begin(),Ecal_E_t.end(),back_inserter(object.Ecal_E_t));319 264 320 265 if(fArray && fArray->GetEntriesFast() > 0) … … 333 278 void Candidate::Clear(Option_t* option) 334 279 { 335 int i;336 280 SetUniqueID(0); 337 281 ResetBit(kIsReferenced); … … 343 287 IsPU = 0; 344 288 IsConstituent = 0; 345 Flavor = 0;346 FlavorAlgo = 0;347 FlavorPhys = 0;348 289 BTag = 0; 349 BTagAlgo = 0;350 BTagPhys = 0;351 290 TauTag = 0; 352 291 Eem = 0.0; … … 372 311 MeanSqDeltaR = 0.0; 373 312 PTD = 0.0; 374 375 Ntimes = 0;376 Ecal_E_t.clear();377 378 IsolationVar = -999;379 IsolationVarRhoCorr = -999;380 SumPtCharged = -999;381 SumPtNeutral = -999;382 SumPtChargedPU = -999;383 SumPt = -999;384 385 313 FracPt[0] = 0.0; 386 314 FracPt[1] = 0.0; … … 393 321 Tau[3] = 0.0; 394 322 Tau[4] = 0.0; 395 396 for(i = 0; i < 5; ++i) 397 { 398 TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 399 PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 400 SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0); 401 } 402 403 NSubJetsTrimmed = 0; 404 NSubJetsPruned = 0; 405 NSubJetsSoftDropped = 0; 406 323 407 324 fArray = 0; 408 325 } -
classes/DelphesClasses.h
r9343566 re33e6db 84 84 //--------------------------------------------------------------------------- 85 85 86 class LHEFWeight: public TObject87 {88 public:89 Int_t ID; // weight ID90 Float_t Weight; // weight value91 92 ClassDef(LHEFWeight, 1)93 };94 95 //---------------------------------------------------------------------------96 97 86 class HepMCEvent: public Event 98 87 { … … 242 231 TRefArray Particles; // references to generated particles 243 232 244 // Isolation variables245 246 Float_t IsolationVar;247 Float_t IsolationVarRhoCorr;248 Float_t SumPtCharged;249 Float_t SumPtNeutral;250 Float_t SumPtChargedPU;251 Float_t SumPt;252 253 233 static CompBase *fgCompare; //! 254 234 const CompBase *GetCompare() const { return fgCompare; } … … 277 257 TRef Particle; // reference to generated particle 278 258 279 // Isolation variables280 281 Float_t IsolationVar;282 Float_t IsolationVarRhoCorr;283 Float_t SumPtCharged;284 Float_t SumPtNeutral;285 Float_t SumPtChargedPU;286 Float_t SumPt;287 288 259 static CompBase *fgCompare; //! 289 260 const CompBase *GetCompare() const { return fgCompare; } … … 310 281 TRef Particle; // reference to generated particle 311 282 312 // Isolation variables313 314 Float_t IsolationVar;315 Float_t IsolationVarRhoCorr;316 Float_t SumPtCharged;317 Float_t SumPtNeutral;318 Float_t SumPtChargedPU;319 Float_t SumPt;320 321 283 static CompBase *fgCompare; //! 322 284 const CompBase *GetCompare() const { return fgCompare; } … … 344 306 Float_t DeltaPhi; // jet radius in azimuthal angle 345 307 346 UInt_t Flavor;347 UInt_t FlavorAlgo;348 UInt_t FlavorPhys;349 350 308 UInt_t BTag; // 0 or 1 for a jet that has been tagged as containing a heavy quark 351 UInt_t BTagAlgo;352 UInt_t BTagPhys;353 354 309 UInt_t TauTag; // 0 or 1 for a jet that has been tagged as a tau 355 310 … … 358 313 Float_t EhadOverEem; // ratio of the hadronic versus electromagnetic energy deposited in the calorimeter 359 314 360 Int_t NCharged; // number of charged constituents 361 Int_t NNeutrals; // number of neutral constituents 362 Float_t Beta; // (sum pt of charged pile-up constituents)/(sum pt of charged constituents) 363 Float_t BetaStar; // (sum pt of charged constituents coming from hard interaction)/(sum pt of charged constituents) 364 Float_t MeanSqDeltaR; // average distance (squared) between constituent and jet weighted by pt (squared) of constituent 365 Float_t PTD; // average pt between constituent and jet weighted by pt of constituent 366 Float_t FracPt[5]; // (sum pt of constituents within a ring 0.1*i < DeltaR < 0.1*(i+1))/(sum pt of constituents) 367 368 Float_t Tau[5]; // N-subjettiness 369 370 TLorentzVector TrimmedP4[5]; // first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta 371 TLorentzVector PrunedP4[5]; // first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta 372 TLorentzVector SoftDroppedP4[5]; // first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta 373 374 Int_t NSubJetsTrimmed; // number of subjets trimmed 375 Int_t NSubJetsPruned; // number of subjets pruned 376 Int_t NSubJetsSoftDropped; // number of subjets soft-dropped 315 Int_t NCharged; // number of charged constituents 316 Int_t NNeutrals; // number of neutral constituents 317 Float_t Beta; // (sum pt of charged pile-up constituents)/(sum pt of charged constituents) 318 Float_t BetaStar; // (sum pt of charged constituents coming from hard interaction)/(sum pt of charged constituents) 319 Float_t MeanSqDeltaR; // average distance (squared) between constituent and jet weighted by pt (squared) of constituent 320 Float_t PTD; // average pt between constituent and jet weighted by pt of constituent 321 Float_t FracPt[5]; // (sum pt of constituents within a ring 0.1*i < DeltaR < 0.1*(i+1))/(sum pt of constituents) 322 323 Float_t Tau1; // 1-subjettiness 324 Float_t Tau2; // 2-subjettiness 325 Float_t Tau3; // 3-subjettiness 326 Float_t Tau4; // 4-subjettiness 327 Float_t Tau5; // 5-subjettiness 377 328 378 329 TRefArray Constituents; // references to constituents … … 383 334 384 335 TLorentzVector P4() const; 385 TLorentzVector Area; 386 387 ClassDef(Jet, 3) 336 337 ClassDef(Jet, 2) 388 338 }; 389 339 … … 442 392 Float_t E; // calorimeter tower energy 443 393 444 Float_t T; // ecal deposit time, averaged by sqrt(EM energy) over all particles, not smeared 445 Int_t Ntimes; // number of hits contributing to time measurement 394 Float_t T; //particle arrival time of flight 446 395 447 396 Float_t Eem; // calorimeter tower electromagnetic energy … … 503 452 504 453 Int_t IsPU; 505 Int_t IsRecoPU;506 507 454 Int_t IsConstituent; 508 455 509 UInt_t Flavor;510 UInt_t FlavorAlgo;511 UInt_t FlavorPhys;512 513 456 UInt_t BTag; 514 UInt_t BTagAlgo;515 UInt_t BTagPhys;516 517 457 UInt_t TauTag; 518 458 … … 542 482 Float_t FracPt[5]; 543 483 544 //Timing information545 546 Int_t Ntimes;547 std::vector<std::pair<Float_t,Float_t> > Ecal_E_t;548 549 // Isolation variables550 551 Float_t IsolationVar;552 Float_t IsolationVarRhoCorr;553 Float_t SumPtCharged;554 Float_t SumPtNeutral;555 Float_t SumPtChargedPU;556 Float_t SumPt;557 558 484 // N-subjettiness variables 559 485 560 486 Float_t Tau[5]; 561 562 // Other Substructure variables563 564 TLorentzVector TrimmedP4[5]; // first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta565 TLorentzVector PrunedP4[5]; // first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta566 TLorentzVector SoftDroppedP4[5]; // first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta567 568 Int_t NSubJetsTrimmed; // number of subjets trimmed569 Int_t NSubJetsPruned; // number of subjets pruned570 Int_t NSubJetsSoftDropped; // number of subjets soft-dropped571 572 487 573 488 static CompBase *fgCompare; //! … … 589 504 void SetFactory(DelphesFactory *factory) { fFactory = factory; } 590 505 591 ClassDef(Candidate, 3)506 ClassDef(Candidate, 2) 592 507 }; 593 508 -
classes/DelphesFormula.cc
r9343566 re33e6db 23 23 24 24 #include <stdexcept> 25 #include <string> 25 26 26 27 using namespace std; … … 50 51 Int_t DelphesFormula::Compile(const char *expression) 51 52 { 52 TString buffer;53 string buffer; 53 54 const char *it; 54 55 for(it = expression; *it; ++it) 55 56 { 56 57 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue; 57 buffer. Append(*it);58 buffer.push_back(*it); 58 59 } 59 buffer.ReplaceAll("pt", "x"); 60 buffer.ReplaceAll("eta", "y"); 61 buffer.ReplaceAll("phi", "z"); 62 buffer.ReplaceAll("energy", "t"); 63 if(TFormula::Compile(buffer) != 0) 60 if(TFormula::Compile(buffer.c_str()) != 0) 64 61 { 65 62 throw runtime_error("Invalid formula."); … … 77 74 78 75 //------------------------------------------------------------------------------ 76 77 Int_t DelphesFormula::DefinedVariable(TString &chaine, Int_t &action) 78 { 79 action = kVariable; 80 if(chaine == "pt") 81 { 82 if(fNdim < 1) fNdim = 1; 83 return 0; 84 } 85 else if(chaine == "eta") 86 { 87 if(fNdim < 2) fNdim = 2; 88 return 1; 89 } 90 else if(chaine == "phi") 91 { 92 if(fNdim < 3) fNdim = 3; 93 return 2; 94 } 95 else if(chaine == "energy") 96 { 97 if(fNdim < 4) fNdim = 4; 98 return 3; 99 } 100 return -1; 101 } 102 103 //------------------------------------------------------------------------------ -
classes/DelphesFormula.h
r9343566 re33e6db 35 35 36 36 Double_t Eval(Double_t pt, Double_t eta = 0, Double_t phi = 0, Double_t energy = 0); 37 38 Int_t DefinedVariable(TString &variable, Int_t &action); 37 39 }; 38 40 -
classes/DelphesLHEFReader.cc
r9343566 re33e6db 82 82 fEventCounter = -1; 83 83 fParticleCounter = -1; 84 f WeightList.clear();84 fRwgtList.clear(); 85 85 } 86 86 … … 99 99 TObjArray *partonOutputArray) 100 100 { 101 int rc , id;101 int rc; 102 102 char *pch; 103 103 double weight; … … 158 158 else if(strstr(fBuffer, "<wgt")) 159 159 { 160 pch = str pbrk(fBuffer, "\"'");160 pch = strstr(fBuffer, ">"); 161 161 if(!pch) 162 162 { … … 165 165 } 166 166 167 DelphesStream idStream(pch + 1); 168 rc = idStream.ReadInt(id); 169 170 pch = strchr(fBuffer, '>'); 171 if(!pch) 167 DelphesStream bufferStream(pch + 1); 168 rc = bufferStream.ReadDbl(weight); 169 170 if(!rc) 172 171 { 173 172 cerr << "** ERROR: " << "invalid weight format" << endl; … … 175 174 } 176 175 177 DelphesStream weightStream(pch + 1); 178 rc = weightStream.ReadDbl(weight); 179 180 if(!rc) 181 { 182 cerr << "** ERROR: " << "invalid weight format" << endl; 183 return kFALSE; 184 } 185 186 fWeightList.push_back(make_pair(id, weight)); 176 fRwgtList.push_back(weight); 187 177 } 188 178 else if(strstr(fBuffer, "</event>")) … … 216 206 //--------------------------------------------------------------------------- 217 207 218 void DelphesLHEFReader::AnalyzeWeight(ExRootTreeBranch *branch) 219 { 220 LHEFWeight *element; 221 vector< pair< int, double > >::const_iterator itWeightList; 222 223 for(itWeightList = fWeightList.begin(); itWeightList != fWeightList.end(); ++itWeightList) 224 { 225 element = static_cast<LHEFWeight *>(branch->NewEntry()); 226 227 element->ID = itWeightList->first; 228 element->Weight = itWeightList->second; 208 void DelphesLHEFReader::AnalyzeRwgt(ExRootTreeBranch *branch) 209 { 210 Weight *element; 211 vector<double>::const_iterator itRwgtList; 212 213 for(itRwgtList = fRwgtList.begin(); itRwgtList != fRwgtList.end(); ++itRwgtList) 214 { 215 element = static_cast<Weight *>(branch->NewEntry()); 216 217 element->Weight = *itRwgtList; 229 218 } 230 219 } -
classes/DelphesLHEFReader.h
r9343566 re33e6db 31 31 32 32 #include <vector> 33 #include <utility>34 33 35 34 class TObjArray; … … 59 58 TStopwatch *readStopWatch, TStopwatch *procStopWatch); 60 59 61 void Analyze Weight(ExRootTreeBranch *branch);60 void AnalyzeRwgt(ExRootTreeBranch *branch); 62 61 63 62 private: … … 84 83 double fPx, fPy, fPz, fE, fMass; 85 84 86 std::vector< std::pair< int, double > > fWeightList;85 std::vector<double> fRwgtList; 87 86 }; 88 87 -
classes/DelphesTF2.cc
r9343566 re33e6db 18 18 19 19 #include "classes/DelphesTF2.h" 20 21 #include "RVersion.h"22 20 #include "TString.h" 23 24 21 #include <stdexcept> 22 #include <string> 25 23 26 24 using namespace std; … … 36 34 37 35 DelphesTF2::DelphesTF2(const char *name, const char *expression) : 38 TF2(name, 36 TF2(name,expression) 39 37 { 40 38 } … … 48 46 //------------------------------------------------------------------------------ 49 47 50 Int_t DelphesTF2:: Compile(const char *expression)48 Int_t DelphesTF2::DefinedVariable(TString &chaine, Int_t &action) 51 49 { 52 TString buffer; 53 const char *it; 54 for(it = expression; *it; ++it) 50 action = kVariable; 51 if(chaine == "z") 55 52 { 56 if( *it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;57 buffer.Append(*it);53 if(fNdim < 1) fNdim = 1; 54 return 0; 58 55 } 59 buffer.ReplaceAll("z", "x"); 60 buffer.ReplaceAll("t", "y"); 61 #if ROOT_VERSION_CODE < ROOT_VERSION(6,04,00) 62 if(TF2::Compile(buffer) != 0) 63 #else 64 if(TF2::GetFormula()->Compile(buffer) != 0) 65 #endif 56 else if(chaine == "t") 66 57 { 67 throw runtime_error("Invalid formula."); 58 if(fNdim < 2) fNdim = 2; 59 return 1; 68 60 } 69 return 0;61 return -1; 70 62 } 71 63 -
classes/DelphesTF2.h
r9343566 re33e6db 21 21 22 22 #include "TF2.h" 23 #include "TFormula.h" 24 25 #include <string> 23 26 24 27 class DelphesTF2: public TF2 … … 32 35 ~DelphesTF2(); 33 36 34 Int_t Compile(const char *expression); 37 Int_t DefinedVariable(TString &variable, Int_t &action); 38 35 39 }; 36 40 37 41 #endif /* DelphesTF2_h */ 42 -
display/Delphes3DGeometry.cc
r9343566 re33e6db 17 17 */ 18 18 19 #include "display/Delphes3DGeometry.h" 19 20 #include <set> 20 21 #include <map> 22 #include <string> 21 23 #include <utility> 22 24 #include <vector> … … 24 26 #include <sstream> 25 27 #include <cassert> 26 27 #include "TAxis.h"28 28 #include "TGeoManager.h" 29 29 #include "TGeoVolume.h" … … 35 35 #include "TGeoCone.h" 36 36 #include "TGeoArb8.h" 37 #include "external/ExRootAnalysis/ExRootConfReader.h" 38 #include "classes/DelphesClasses.h" 37 39 #include "TF2.h" 38 40 #include "TFormula.h" 39 41 #include "TH1F.h" 40 42 #include "TMath.h" 41 #include "TString.h"42 43 #include "display/Delphes3DGeometry.h"44 45 #include "classes/DelphesClasses.h"46 #include "external/ExRootAnalysis/ExRootConfReader.h"47 43 48 44 using namespace std; … … 97 93 tk_Bz_ = confReader->GetDouble("ParticlePropagator::Bz", 0.0); // tk_Bz 98 94 99 TString buffer;95 string buffer; 100 96 const char *it; 101 97 … … 107 103 tkEffFormula.ReplaceAll("phi","0."); 108 104 109 buffer.Clear();110 105 for(it = tkEffFormula.Data(); *it; ++it) 111 106 { 112 107 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue; 113 buffer. Append(*it);114 } 115 116 TF2* tkEffFunction = new TF2("tkEff",buffer ,0,1000,-10,10);108 buffer.push_back(*it); 109 } 110 111 TF2* tkEffFunction = new TF2("tkEff",buffer.c_str(),0,1000,-10,10); 117 112 TH1F etaHisto("eta","eta",100,5.,-5.); 118 113 Double_t pt,eta; … … 137 132 muonEffFormula.ReplaceAll("phi","0."); 138 133 139 buffer. Clear();134 buffer.clear(); 140 135 for(it = muonEffFormula.Data(); *it; ++it) 141 136 { 142 137 if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue; 143 buffer. Append(*it);144 } 145 146 TF2* muEffFunction = new TF2("muEff",buffer ,0,1000,-10,10);138 buffer.push_back(*it); 139 } 140 141 TF2* muEffFunction = new TF2("muEff",buffer.c_str(),0,1000,-10,10); 147 142 TH1F etaHisto("eta2","eta2",100,5.,-5.); 148 143 Double_t pt,eta; -
display/Delphes3DGeometry.h
r9343566 re33e6db 1 1 /* 2 *Delphes: a framework for fast simulation of a generic collider experiment3 *Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium2 * Delphes: a framework for fast simulation of a generic collider experiment 3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium 4 4 * 5 *This program is free software: you can redistribute it and/or modify6 *it under the terms of the GNU General Public License as published by7 *the Free Software Foundation, either version 3 of the License, or8 *(at your option) any later version.5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 9 * 10 *This program is distributed in the hope that it will be useful,11 *but WITHOUT ANY WARRANTY; without even the implied warranty of12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 *GNU General Public License for more details.10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 14 * 15 *You should have received a copy of the GNU General Public License16 *along with this program. If not, see <http://www.gnu.org/licenses/>.15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 18 … … 22 22 #include <set> 23 23 #include <map> 24 #include <utility> 24 25 #include <vector> 25 26 #include "Rtypes.h" 27 28 class TAxis; 29 class TGeoManager; 30 class TGeoVolume; 31 class TGeoMedium; 26 #include <algorithm> 27 #include <sstream> 28 #include "TAxis.h" 29 #include "TGeoManager.h" 30 #include "TGeoVolume.h" 31 #include "TGeoMedium.h" 32 32 33 33 // TODO: asymmetric detector … … 38 38 ~Delphes3DGeometry() {} 39 39 40 void readFile(const char *filename, const char *ParticlePropagator="ParticlePropagator",41 const char *TrackingEfficiency="ChargedHadronTrackingEfficiency",42 const char *MuonEfficiency="MuonEfficiency",43 const char *Calorimeters="Calorimeter");40 void readFile(const char* filename, const char* ParticlePropagator="ParticlePropagator", 41 const char* TrackingEfficiency="ChargedHadronTrackingEfficiency", 42 const char* MuonEfficiency="MuonEfficiency", 43 const char* Calorimeters="Calorimeter"); 44 44 45 45 void setContingency(Double_t contingency) { contingency_ = contingency; } … … 48 48 void setMuonSystemThickness(Double_t thickness) { muonSystem_thickn_ = thickness; } 49 49 50 TGeoVolume *getDetector(bool withTowers = true);50 TGeoVolume* getDetector(bool withTowers = true); 51 51 52 52 Double_t getTrackerRadius() const { return tk_radius_; } … … 59 59 private: 60 60 std::pair<Double_t, Double_t> addTracker(TGeoVolume *top); 61 std::pair<Double_t, Double_t> addCalorimeter(TGeoVolume *top, const char *name, Double_t innerBarrelRadius, Double_t innerBarrelLength, std::set< std::pair<Double_t, Int_t> >& caloBinning);62 std::pair<Double_t, Double_t> addMuonDets(TGeoVolume *top, const char *name, Double_t innerBarrelRadius, Double_t innerBarrelLength);63 void addCaloTowers(TGeoVolume *top, const char *name, Double_t innerBarrelRadius, Double_t innerBarrelLength, std::set< std::pair<Double_t, Int_t> >& caloBinning);61 std::pair<Double_t, Double_t> addCalorimeter(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, std::set< std::pair<Double_t, Int_t> >& caloBinning); 62 std::pair<Double_t, Double_t> addMuonDets(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength); 63 void addCaloTowers(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, std::set< std::pair<Double_t, Int_t> >& caloBinning); 64 64 65 65 private: … … 72 72 TGeoMedium *mudetmed_; 73 73 74 TAxis *etaAxis_;75 TAxis *phiAxis_;74 TAxis* etaAxis_; 75 TAxis* phiAxis_; 76 76 77 77 Double_t contingency_; … … 91 91 std::map<std::string, Double_t> muonSystem_etamax_; 92 92 std::map<std::string, std::set< std::pair<Double_t, Int_t> > > caloBinning_; 93 93 94 94 }; 95 95 -
display/DelphesEventDisplay.cc
r9343566 re33e6db 1 1 /* 2 *Delphes: a framework for fast simulation of a generic collider experiment3 *Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium2 * Delphes: a framework for fast simulation of a generic collider experiment 3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium 4 4 * 5 *This program is free software: you can redistribute it and/or modify6 *it under the terms of the GNU General Public License as published by7 *the Free Software Foundation, either version 3 of the License, or8 *(at your option) any later version.5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 9 * 10 *This program is distributed in the hope that it will be useful,11 *but WITHOUT ANY WARRANTY; without even the implied warranty of12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 *GNU General Public License for more details.10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 14 * 15 *You should have received a copy of the GNU General Public License16 *along with this program. If not, see <http://www.gnu.org/licenses/>.15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 18 … … 21 21 #include <utility> 22 22 #include <algorithm> 23 24 23 #include "TGeoManager.h" 25 24 #include "TGeoVolume.h" 25 #include "external/ExRootAnalysis/ExRootConfReader.h" 26 #include "external/ExRootAnalysis/ExRootTreeReader.h" 27 #include "display/DelphesCaloData.h" 28 #include "display/DelphesBranchElement.h" 29 #include "display/Delphes3DGeometry.h" 30 #include "display/DelphesEventDisplay.h" 31 #include "classes/DelphesClasses.h" 26 32 #include "TEveElement.h" 27 33 #include "TEveJetCone.h" … … 47 53 #include "TCanvas.h" 48 54 #include "TH1F.h" 49 #include "TAxis.h"50 #include "TChain.h"51 #include "TGHtml.h"52 #include "TGStatusBar.h"53 54 #include "display/DelphesCaloData.h"55 #include "display/DelphesBranchElement.h"56 #include "display/Delphes3DGeometry.h"57 #include "display/DelphesEventDisplay.h"58 #include "display/DelphesDisplay.h"59 #include "display/Delphes3DGeometry.h"60 #include "display/DelphesHtmlSummary.h"61 #include "display/DelphesPlotSummary.h"62 63 #include "classes/DelphesClasses.h"64 #include "external/ExRootAnalysis/ExRootConfReader.h"65 #include "external/ExRootAnalysis/ExRootTreeReader.h"66 55 67 56 DelphesEventDisplay::DelphesEventDisplay() … … 109 98 TEveManager::Create(kTRUE, "IV"); 110 99 fStatusBar_ = gEve->GetBrowser()->GetStatusBar(); 111 TGeoManager *geom = gGeoManager;100 TGeoManager* geom = gGeoManager; 112 101 113 102 // build the detector … … 119 108 etaAxis_ = det3D.getCaloAxes().first; 120 109 phiAxis_ = det3D.getCaloAxes().second; 121 TGeoVolume *top = det3D.getDetector(false);110 TGeoVolume* top = det3D.getDetector(false); 122 111 geom->SetTopVolume(top); 123 112 TEveElementList *geometry = new TEveElementList("Geometry"); 124 TObjArray *nodes = top->GetNodes();113 TObjArray* nodes = top->GetNodes(); 125 114 TIter itNodes(nodes); 126 TGeoNode *nodeobj;127 TEveGeoTopNode *node;115 TGeoNode* nodeobj; 116 TEveGeoTopNode* node; 128 117 while((nodeobj = (TGeoNode*)itNodes.Next())) { 129 118 node = new TEveGeoTopNode(gGeoManager,nodeobj); … … 142 131 // prepare data collections 143 132 readConfig(configFile, elements_); 144 for(std::vector<DelphesBranchBase 145 DelphesBranchElement<TEveTrackList> *item_v1 = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(*element);146 DelphesBranchElement<TEveElementList> *item_v2 = dynamic_cast<DelphesBranchElement<TEveElementList>*>(*element);133 for(std::vector<DelphesBranchBase*>::iterator element = elements_.begin(); element<elements_.end(); ++element) { 134 DelphesBranchElement<TEveTrackList>* item_v1 = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(*element); 135 DelphesBranchElement<TEveElementList>* item_v2 = dynamic_cast<DelphesBranchElement<TEveElementList>*>(*element); 147 136 if(item_v1) gEve->AddElement(item_v1->GetContainer()); 148 137 if(item_v2) gEve->AddElement(item_v2->GetContainer()); … … 155 144 delphesDisplay_->ImportGeomRhoZ(geometry); 156 145 // find the first calo data and use that to initialize the calo display 157 for(std::vector<DelphesBranchBase 146 for(std::vector<DelphesBranchBase*>::iterator data=elements_.begin();data<elements_.end();++data) { 158 147 if(TString((*data)->GetType())=="Tower") { // we could also use GetClassName()=="DelphesCaloData" 159 DelphesCaloData *container = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>((*data))->GetContainer();148 DelphesCaloData* container = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>((*data))->GetContainer(); 160 149 assert(container); 161 150 TEveCalo3D *calo3d = new TEveCalo3D(container); … … 193 182 ExRootConfParam branches = confReader->GetParam("TreeWriter::Branch"); 194 183 Int_t nBranches = branches.GetSize()/3; 195 DelphesBranchElement<TEveTrackList> *tlist;196 DelphesBranchElement<DelphesCaloData> *clist;197 DelphesBranchElement<TEveElementList> *elist;184 DelphesBranchElement<TEveTrackList>* tlist; 185 DelphesBranchElement<DelphesCaloData>* clist; 186 DelphesBranchElement<TEveElementList>* elist; 198 187 // first loop with all but tracks 199 188 for(Int_t b = 0; b<nBranches; ++b) { … … 284 273 285 274 // update display 286 TEveElement *top = (TEveElement*)gEve->GetCurrentEvent();275 TEveElement* top = (TEveElement*)gEve->GetCurrentEvent(); 287 276 delphesDisplay_->DestroyEventRPhi(); 288 277 delphesDisplay_->ImportEventRPhi(top); … … 367 356 368 357 // add a tab on the left 369 TEveBrowser *browser = gEve->GetBrowser();358 TEveBrowser* browser = gEve->GetBrowser(); 370 359 browser->SetWindowName("Delphes Event Display"); 371 360 browser->StartEmbedding(TRootBrowser::kLeft); 372 361 373 362 // set the main title 374 TGMainFrame *frmMain = new TGMainFrame(gClient->GetRoot(), 1000, 600);363 TGMainFrame* frmMain = new TGMainFrame(gClient->GetRoot(), 1000, 600); 375 364 frmMain->SetWindowName("Delphes Event Display"); 376 365 frmMain->SetCleanup(kDeepCleanup); … … 382 371 if(!gSystem->OpenDirectory(icondir)) 383 372 icondir = Form("%s/icons/", (const char*)gSystem->GetFromPipe("root-config --etcdir") ); 384 TGGroupFrame *vf = new TGGroupFrame(frmMain,"Event navigation",kVerticalFrame | kFitWidth );373 TGGroupFrame* vf = new TGGroupFrame(frmMain,"Event navigation",kVerticalFrame | kFitWidth ); 385 374 { 386 TGHorizontalFrame *hf = new TGHorizontalFrame(frmMain);375 TGHorizontalFrame* hf = new TGHorizontalFrame(frmMain); 387 376 { 388 TGPictureButton *b = 0;377 TGPictureButton* b = 0; 389 378 390 379 b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoBack.gif")); … … 392 381 b->Connect("Clicked()", "DelphesEventDisplay", this, "Bck()"); 393 382 394 TGNumberEntry *numberEntry = new TGNumberEntry(hf,0,9,-1,TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, treeReader_->GetEntries());383 TGNumberEntry* numberEntry = new TGNumberEntry(hf,0,9,-1,TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, treeReader_->GetEntries()); 395 384 hf->AddFrame(numberEntry, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY , 2, 0, 10, 10)); 396 385 this->Connect("EventChanged(Int_t)","TGNumberEntry",numberEntry,"SetIntNumber(Long_t)"); … … 405 394 vf->AddFrame(hf, new TGLayoutHints(kLHintsExpandX , 2, 2, 2, 2)); 406 395 407 TGHProgressBar *progress = new TGHProgressBar(frmMain, TGProgressBar::kFancy, 100);396 TGHProgressBar* progress = new TGHProgressBar(frmMain, TGProgressBar::kFancy, 100); 408 397 progress->SetMax( treeReader_->GetEntries()); 409 398 progress->ShowPosition(kTRUE, kFALSE, "Event %.0f"); … … 429 418 // the summary tab 430 419 htmlSummary_ = new DelphesHtmlSummary("Delphes Event Display Summary Table"); 431 TEveWindowSlot *slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());420 TEveWindowSlot* slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight()); 432 421 gHtml_ = new TGHtml(0, 100, 100); 433 422 TEveWindowFrame *wf = slot->MakeFrame(gHtml_); … … 437 426 // plot tab 438 427 slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight()); 439 TEveWindowTab *tab = slot->MakeTab();428 TEveWindowTab* tab = slot->MakeTab(); 440 429 tab->SetElementName("Summary plots"); 441 430 tab->SetShowTitleBar(kFALSE); … … 446 435 } 447 436 448 void DelphesEventDisplay::Fwd() { 449 if (event_id_ < treeReader_->GetEntries() - 2) { 450 EventChanged(event_id_+1); 451 } else { 452 printf("Already at last event.\n"); 453 } 454 } 455 456 void DelphesEventDisplay::Bck() { 457 if (event_id_ > 0) { 458 EventChanged(event_id_-1); 459 } else { 460 printf("Already at first event.\n"); 461 } 462 } 463 464 void DelphesEventDisplay::PreSetEv(char *ev) { 465 event_id_tmp_ = Int_t(atoi(ev)); 466 } 467 468 void DelphesEventDisplay::GoTo() { 469 if (event_id_tmp_>=0 && event_id_tmp_ < treeReader_->GetEntries()-1) { 470 EventChanged(event_id_tmp_); 471 } else { 472 printf("Error: no such event.\n"); 473 } 474 } 475 476 void DelphesEventDisplay::InitSummaryPlots() { 477 plotSummary_->FillSample(treeReader_, event_id_); 478 plotSummary_->FillEvent(); 479 plotSummary_->Draw(); 480 } 481 482 void DelphesEventDisplay::DisplayProgress(Int_t p) { 483 fStatusBar_->SetText(Form("Processing... %d %%",p), 1); 484 gSystem->ProcessEvents(); 485 } 437 -
display/DelphesEventDisplay.h
r9343566 re33e6db 1 1 /* 2 *Delphes: a framework for fast simulation of a generic collider experiment3 *Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium2 * Delphes: a framework for fast simulation of a generic collider experiment 3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium 4 4 * 5 *This program is free software: you can redistribute it and/or modify6 *it under the terms of the GNU General Public License as published by7 *the Free Software Foundation, either version 3 of the License, or8 *(at your option) any later version.5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 9 * 10 *This program is distributed in the hope that it will be useful,11 *but WITHOUT ANY WARRANTY; without even the implied warranty of12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 *GNU General Public License for more details.10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 14 * 15 *You should have received a copy of the GNU General Public License16 *along with this program. If not, see <http://www.gnu.org/licenses/>.15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 18 … … 21 21 22 22 #include <vector> 23 #include <iostream> 24 #include "external/ExRootAnalysis/ExRootTreeReader.h" 25 #include "display/DelphesDisplay.h" 26 #include "display/Delphes3DGeometry.h" 27 #include "display/DelphesHtmlSummary.h" 28 #include "display/DelphesPlotSummary.h" 29 #include "TSystem.h" 30 #include "TChain.h" 31 #include "TAxis.h" 32 #include "TGHtml.h" 33 #include "TClonesArray.h" 34 #include "TGStatusBar.h" 35 #include "TGNumberEntry.h" 36 #include "TGProgressBar.h" 37 #include <RQ_OBJECT.h> 23 38 24 #include "Rtypes.h"25 #include "RQ_OBJECT.h"26 39 27 class TAxis;28 class TChain;29 class TGHtml;30 class TGStatusBar;31 class DelphesDisplay;32 class Delphes3DGeometry;33 class DelphesBranchBase;34 class DelphesHtmlSummary;35 class DelphesPlotSummary;36 class ExRootTreeReader;37 40 38 41 /* 39 *assembly.C: sauvegarde as shape-extract -> implement in the geometry class (read/write)40 *histobrowser.C: intégration d'histogrammes dans le display (on pourrait avoir Pt, eta, phi pour les principales collections)41 *also from alice_esd: summary html table42 *42 * assembly.C: sauvegarde as shape-extract -> implement in the geometry class (read/write) 43 * histobrowser.C: intégration d'histogrammes dans le display (on pourrait avoir Pt, eta, phi pour les principales collections) 44 * also from alice_esd: summary html table 45 * 43 46 */ 44 47 … … 56 59 void make_gui(); 57 60 void load_event(); 58 void readConfig(const char *configFile, std::vector<DelphesBranchBase 61 void readConfig(const char *configFile, std::vector<DelphesBranchBase*>& elements); 59 62 60 63 // Configuration and global variables. … … 64 67 Double_t tkRadius_, totRadius_, tkHalfLength_, muHalfLength_, bz_; 65 68 TAxis *etaAxis_, *phiAxis_; 66 TChain *chain_;67 std::vector<DelphesBranchBase 69 TChain* chain_; 70 std::vector<DelphesBranchBase*> elements_; 68 71 DelphesDisplay *delphesDisplay_; 69 72 DelphesHtmlSummary *htmlSummary_; 70 73 TGHtml *gHtml_; 71 74 DelphesPlotSummary *plotSummary_; 72 TGStatusBar *fStatusBar_;75 TGStatusBar* fStatusBar_; 73 76 74 77 // gui controls 75 78 public: 76 void Fwd(); 79 void Fwd() { 80 if (event_id_ < treeReader_->GetEntries() - 2) { 81 EventChanged(event_id_+1); 82 } else { 83 printf("Already at last event.\n"); 84 } 85 } 77 86 78 void Bck(); 87 void Bck() { 88 if (event_id_ > 0) { 89 EventChanged(event_id_-1); 90 } else { 91 printf("Already at first event.\n"); 92 } 93 } 79 94 80 void PreSetEv(char *ev); 95 void PreSetEv(char* ev) { 96 event_id_tmp_ = Int_t(atoi(ev)); 97 } 81 98 82 void GoTo(); 99 void GoTo() { 100 if (event_id_tmp_>=0 && event_id_tmp_ < treeReader_->GetEntries()-1) { 101 EventChanged(event_id_tmp_); 102 } else { 103 printf("Error: no such event.\n"); 104 } 105 } 83 106 84 void InitSummaryPlots(); 107 void InitSummaryPlots() { 108 plotSummary_->FillSample(treeReader_, event_id_); 109 plotSummary_->FillEvent(); 110 plotSummary_->Draw(); 111 } 85 112 86 void DisplayProgress(Int_t p); 113 void DisplayProgress(Int_t p) { 114 fStatusBar_->SetText(Form("Processing... %d %%",p), 1); 115 gSystem->ProcessEvents(); 116 } 87 117 }; 88 118 -
doc/genMakefile.tcl
r9343566 re33e6db 283 283 dictDeps {DISPLAY_DICT} {display/DisplayLinkDef.h} 284 284 285 sourceDeps {DELPHES} {classes/*.cc} {modules/*.cc} {external/ExRootAnalysis/*.cc} {external/Hector/*.cc} {external/PUPPI/*.cc}285 sourceDeps {DELPHES} {classes/*.cc} {modules/*.cc} {external/ExRootAnalysis/*.cc} {external/Hector/*.cc} 286 286 287 287 sourceDeps {FASTJET} {modules/FastJet*.cc} {external/fastjet/*.cc} {external/fastjet/tools/*.cc} {external/fastjet/plugins/*/*.cc} {external/fastjet/contribs/*/*.cc} -
examples/EventDisplay.C
r9343566 re33e6db 3 3 * root -l examples/EventDisplay.C'("cards/delphes_card_FCC_basic.tcl","delphes_output.root","ParticlePropagator","ChargedHadronTrackingEfficiency","MuonTrackingEfficiency","Ecal,Hcal")' 4 4 */ 5 6 #ifdef __CLING__7 R__LOAD_LIBRARY(libEve)8 R__LOAD_LIBRARY(libDelphesDisplay)9 #include "display/DelphesEventDisplay.h"10 #include "display/Delphes3DGeometry.h"11 #endif12 5 13 6 void EventDisplay(const char *configfile = "delphes_card_CMS.tcl", … … 40 33 41 34 // create the application 42 DelphesEventDisplay *display = new DelphesEventDisplay(configfile, datafile, det3D);35 DelphesEventDisplay* display = new DelphesEventDisplay(configfile, datafile, det3D); 43 36 } 44 37 } -
examples/Example1.C
r9343566 re33e6db 6 6 root -l examples/Example1.C'("delphes_output.root")' 7 7 */ 8 9 #ifdef __CLING__10 R__LOAD_LIBRARY(libDelphes)11 #include "classes/DelphesClasses.h"12 #include "external/ExRootAnalysis/ExRootTreeReader.h"13 #endif14 8 15 9 //------------------------------------------------------------------------------ -
examples/Example2.C
r9343566 re33e6db 8 8 #include "TH1.h" 9 9 #include "TSystem.h" 10 11 #ifdef __CLING__12 R__LOAD_LIBRARY(libDelphes)13 #include "classes/DelphesClasses.h"14 #include "external/ExRootAnalysis/ExRootTreeReader.h"15 #include "external/ExRootAnalysis/ExRootResult.h"16 #endif17 10 18 11 //------------------------------------------------------------------------------ -
examples/Example3.C
r9343566 re33e6db 6 6 */ 7 7 8 #ifdef __CLING__9 R__LOAD_LIBRARY(libDelphes)10 #include "classes/DelphesClasses.h"11 #include "external/ExRootAnalysis/ExRootTreeReader.h"12 #include "external/ExRootAnalysis/ExRootResult.h"13 #else14 class ExRootTreeReader;15 class ExRootResult;16 #endif17 18 8 //------------------------------------------------------------------------------ 19 9 … … 35 25 TH1 *fJetDeltaPT; 36 26 }; 27 28 //------------------------------------------------------------------------------ 29 30 class ExRootResult; 31 class ExRootTreeReader; 37 32 38 33 //------------------------------------------------------------------------------ -
examples/Example4.C
r9343566 re33e6db 1 1 /* 2 2 3 This macro shows how to compute jet energy scale. 3 4 root -l examples/Example4.C'("delphes_output.root", "plots.root")' 4 5 5 The output ROOT file contains the pT(MC)/pT(Reco) distributions for 6 various pT(Reco) and |eta| bins. The peak value of such distribution is 7 interpreted as the jet energy correction to be applied for that 8 given pT(Reco), |eta| bin. 9 10 This can be done by modifying the "ScaleFormula" input parameter to 11 the JetEnergyScale module in the delphes_card_XXX.tcl 6 The output ROOT file contains the pT(MC)/pT(Reco) distributions for various pT(Reco) and |eta| bins. 7 The peak value of such distribution is interpreted as the jet energy correction to be applied for that given pT(Reco), |eta| bin. 8 9 This can be done by modifying the "ScaleFormula" input parameter to the JetEnergyScale module in the delphes_card_XXX.tcl 10 11 12 12 13 13 e.g a smooth function: 14 14 15 set ScaleFormula { sqrt(3.0 - 0.1*(abs(eta)))^2 / pt + 1.0) } 15 16 set ScaleFormula { sqrt(3.0 - 0.1*(abs(eta)))^2 / pt + 1.0 ) } 17 16 18 17 19 or a binned function: 20 18 21 19 22 set ScaleFormula {(abs(eta) > 0.0 && abs(eta) <= 2.5) * (pt > 20.0 && pt <= 50.0) * (1.10) + … … 24 27 (abs(eta) > 2.5 && abs(eta) <= 5.0) * (pt > 100.0) * (1.00)} 25 28 26 Be aware that a binned jet energy scale can produce "steps" in the corrected 27 jet pt distribution ... 29 30 Be aware that a binned jet energy scale can produce "steps" in the corrected jet pt distribution ... 31 32 33 28 34 */ 29 30 #ifdef __CLING__31 R__LOAD_LIBRARY(libDelphes)32 #include "classes/DelphesClasses.h"33 #include "external/ExRootAnalysis/ExRootTreeReader.h"34 #include "external/ExRootAnalysis/ExRootResult.h"35 #else36 class ExRootTreeReader;37 class ExRootResult;38 #endif39 35 40 36 //------------------------------------------------------------------------------ … … 165 161 166 162 Jet *jet, *genjet; 167 GenParticle *part icle;163 GenParticle *part; 168 164 TObject *object; 169 165 170 TLorentzVector jetMomentum, genJetMomentum, bestGenJetMomentum;171 172 Float_t deltaR;166 TLorentzVector JetMom, GenJetMom, BestGenJetMom; 167 168 Float_t Dr; 173 169 Float_t pt, eta; 174 170 Long64_t entry; … … 181 177 // Load selected branches with data from specified event 182 178 treeReader->ReadEntry(entry); 179 // cout<<"-- New event -- "<<endl; 183 180 184 181 if(entry%500 == 0) cout << "Event number: "<< entry <<endl; … … 189 186 190 187 jet = (Jet*) branchJet->At(i); 191 jetMomentum = jet->P4();192 193 plots->fJetPT->Fill( jetMomentum.Pt());194 195 deltaR= 999;188 JetMom = jet-> P4(); 189 190 plots->fJetPT->Fill(JetMom.Pt()); 191 192 Dr = 999; 196 193 197 194 // Loop over all hard partons in event 198 195 for(j = 0; j < branchParticle->GetEntriesFast(); ++j) 199 196 { 200 particle = (GenParticle*) branchParticle->At(j); 201 202 genJetMomentum = particle->P4(); 203 204 // this is simply to avoid warnings from initial state particle 205 //having infite rapidity ...206 if( genJetMomentum.Px() == 0 && genJetMomentum.Py() == 0) continue;207 208 // 209 if( genJetMomentum.DeltaR(jetMomentum) < deltaR)197 198 part = (GenParticle*) branchParticle->At(j); 199 200 GenJetMom = part -> P4(); 201 202 //this is simply to avoid warnings from initial state particle having infite rapidity ... 203 if(GenJetMom.Px() == 0 && GenJetMom.Py() == 0) continue; 204 205 //take the closest parton candidate 206 if( GenJetMom.DeltaR(JetMom) < Dr ) 210 207 { 211 deltaR = genJetMomentum.DeltaR(jetMomentum);212 bestGenJetMomentum = genJetMomentum;208 Dr = GenJetMom.DeltaR(JetMom); 209 BestGenJetMom = GenJetMom; 213 210 } 211 214 212 } 215 213 216 if(deltaR < 0.3) 217 { 218 pt = jetMomentum.Pt(); 219 eta = TMath::Abs(jetMomentum.Eta()); 220 221 222 if(pt > 20.0 && pt < 50.0 && eta > 0.0 && eta < 2.5) plots -> fJetRes_Pt_20_50_Eta_0_25->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 223 if(pt > 20.0 && pt < 50.0 && eta > 2.5 && eta < 5.0) plots -> fJetRes_Pt_20_50_Eta_25_5->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 224 225 if(pt > 50.0 && pt < 100.0 && eta > 0.0 && eta < 2.5) plots -> fJetRes_Pt_50_100_Eta_0_25->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 226 if(pt > 50.0 && pt < 100.0 && eta > 2.5 && eta < 5.0) plots -> fJetRes_Pt_50_100_Eta_25_5->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 227 228 if(pt > 100.0 && pt < 200.0 && eta > 0.0 && eta < 2.5) plots -> fJetRes_Pt_100_200_Eta_0_25->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 229 if(pt > 100.0 && pt < 200.0 && eta > 2.5 && eta < 5.0) plots -> fJetRes_Pt_100_200_Eta_25_5->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 230 231 if(pt > 200.0 && pt < 500.0 && eta > 0.0 && eta < 2.5) plots -> fJetRes_Pt_200_500_Eta_0_25->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 232 if(pt > 200.0 && pt < 500.0 && eta > 2.5 && eta < 5.0) plots -> fJetRes_Pt_200_500_Eta_25_5->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 233 234 if(pt > 500.0 && eta > 0.0 && eta < 2.5) plots -> fJetRes_Pt_500_inf_Eta_0_25->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 235 if(pt > 500.0 && eta > 2.5 && eta < 5.0) plots -> fJetRes_Pt_500_inf_Eta_25_5->Fill(bestGenJetMomentum.Pt()/jetMomentum.Pt()); 236 237 } 214 if(Dr < 0.3) 215 { 216 pt = JetMom.Pt(); 217 eta = TMath::Abs(JetMom.Eta()); 218 219 220 if( pt > 20.0 && pt < 50.0 && eta > 0.0 && eta < 2.5 ) plots -> fJetRes_Pt_20_50_Eta_0_25->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 221 if( pt > 20.0 && pt < 50.0 && eta > 2.5 && eta < 5.0 ) plots -> fJetRes_Pt_20_50_Eta_25_5->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 222 223 if( pt > 50.0 && pt < 100.0 && eta > 0.0 && eta < 2.5 ) plots -> fJetRes_Pt_50_100_Eta_0_25->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 224 if( pt > 50.0 && pt < 100.0 && eta > 2.5 && eta < 5.0 ) plots -> fJetRes_Pt_50_100_Eta_25_5->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 225 226 if( pt > 100.0 && pt < 200.0 && eta > 0.0 && eta < 2.5 ) plots -> fJetRes_Pt_100_200_Eta_0_25->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 227 if( pt > 100.0 && pt < 200.0 && eta > 2.5 && eta < 5.0 ) plots -> fJetRes_Pt_100_200_Eta_25_5->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 228 229 if( pt > 200.0 && pt < 500.0 && eta > 0.0 && eta < 2.5 ) plots -> fJetRes_Pt_200_500_Eta_0_25->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 230 if( pt > 200.0 && pt < 500.0 && eta > 2.5 && eta < 5.0 ) plots -> fJetRes_Pt_200_500_Eta_25_5->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 231 232 if( pt > 500.0 && eta > 0.0 && eta < 2.5 ) plots -> fJetRes_Pt_500_inf_Eta_0_25->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 233 if( pt > 500.0 && eta > 2.5 && eta < 5.0 ) plots -> fJetRes_Pt_500_inf_Eta_25_5->Fill(BestGenJetMom.Pt()/JetMom.Pt()); 234 235 236 } 237 238 238 239 } 239 240 } 240 241 } 242 241 243 242 244 //------------------------------------------------------------------------------ -
modules/BTagging.cc
r9343566 re33e6db 22 22 * Determines origin of jet, 23 23 * applies b-tagging efficiency (miss identification rate) formulas 24 * and sets b-tagging flags 24 * and sets b-tagging flags 25 25 * 26 26 * \author P. Demin - UCL, Louvain-la-Neuve … … 46 46 #include "TLorentzVector.h" 47 47 48 #include <algorithm> 48 #include <algorithm> 49 49 #include <stdexcept> 50 50 #include <iostream> … … 62 62 63 63 Int_t GetCategory(TObject *object); 64 64 65 65 Double_t fEtaMax, fPTMin; 66 66 }; … … 75 75 76 76 if(momentum.Pt() <= fPTMin || TMath::Abs(momentum.Eta()) > fEtaMax) return -1; 77 77 78 78 pdgCode = TMath::Abs(parton->PID); 79 79 if(pdgCode != 21 && pdgCode > 5) return -1; … … 117 117 param = GetParam("EfficiencyFormula"); 118 118 size = param.GetSize(); 119 119 120 120 fEfficiencyMap.clear(); 121 121 for(i = 0; i < size/2; ++i) … … 143 143 144 144 fFilter = new ExRootFilter(fPartonInputArray); 145 145 146 146 fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets")); 147 147 fItJetInputArray = fJetInputArray->MakeIterator(); … … 170 170 void BTagging::Process() 171 171 { 172 Candidate *jet ;172 Candidate *jet, *parton; 173 173 Double_t pt, eta, phi, e; 174 174 TObjArray *partonArray; 175 175 map< Int_t, DelphesFormula * >::iterator itEfficiencyMap; 176 176 DelphesFormula *formula; 177 Int_t pdgCode, pdgCodeMax; 177 178 178 179 // select quark and gluons 179 180 fFilter->Reset(); 180 181 partonArray = fFilter->GetSubArray(fClassifier, 0); 181 182 182 183 if(partonArray == 0) return; 183 184 184 185 TIter itPartonArray(partonArray); 185 186 186 187 // loop over all input jets 187 188 fItJetInputArray->Reset(); … … 189 190 { 190 191 const TLorentzVector &jetMomentum = jet->Momentum; 192 pdgCodeMax = -1; 191 193 eta = jetMomentum.Eta(); 192 194 phi = jetMomentum.Phi(); 193 195 pt = jetMomentum.Pt(); 194 196 e = jetMomentum.E(); 197 198 // loop over all input partons 199 itPartonArray.Reset(); 200 while((parton = static_cast<Candidate*>(itPartonArray.Next()))) 201 { 202 pdgCode = TMath::Abs(parton->PID); 203 if(pdgCode == 21) pdgCode = 0; 204 if(jetMomentum.DeltaR(parton->Momentum) <= fDeltaR) 205 { 206 if(pdgCodeMax < pdgCode) pdgCodeMax = pdgCode; 207 } 208 } 209 if(pdgCodeMax == 0) pdgCodeMax = 21; 210 if(pdgCodeMax == -1) pdgCodeMax = 0; 195 211 196 212 // find an efficency formula 197 itEfficiencyMap = fEfficiencyMap.find( jet->Flavor);213 itEfficiencyMap = fEfficiencyMap.find(pdgCodeMax); 198 214 if(itEfficiencyMap == fEfficiencyMap.end()) 199 215 { … … 204 220 // apply an efficency formula 205 221 jet->BTag |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber; 206 207 // find an efficency formula for algo flavor definition 208 itEfficiencyMap = fEfficiencyMap.find(jet->FlavorAlgo); 209 if(itEfficiencyMap == fEfficiencyMap.end()) 210 { 211 itEfficiencyMap = fEfficiencyMap.find(0); 212 } 213 formula = itEfficiencyMap->second; 214 215 // apply an efficency formula 216 jet->BTagAlgo |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber; 217 218 // find an efficency formula for phys flavor definition 219 itEfficiencyMap = fEfficiencyMap.find(jet->FlavorPhys); 220 if(itEfficiencyMap == fEfficiencyMap.end()) 221 { 222 itEfficiencyMap = fEfficiencyMap.find(0); 223 } 224 formula = itEfficiencyMap->second; 225 226 // apply an efficency formula 227 jet->BTagPhys |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber; 228 } 229 } 230 231 //------------------------------------------------------------------------------ 222 } 223 } 224 225 //------------------------------------------------------------------------------ -
modules/Calorimeter.cc
r9343566 re33e6db 150 150 */ 151 151 152 // read min E value for timing measurement in ECAL153 fTimingEMin = GetDouble("TimingEMin",4.);154 // For timing155 // So far this flag needs to be false156 // Curved extrapolation not supported157 fElectronsFromTrack = false;158 159 160 152 // read min E value for towers to be saved 161 153 fECalEnergyMin = GetDouble("ECalEnergyMin", 0.0); … … 364 356 fTrackHCalEnergy = 0.0; 365 357 358 fTowerECalTime = 0.0; 359 fTowerHCalTime = 0.0; 360 361 fTrackECalTime = 0.0; 362 fTrackHCalTime = 0.0; 363 364 fTowerECalTimeWeight = 0.0; 365 fTowerHCalTimeWeight = 0.0; 366 366 367 fTowerTrackHits = 0; 367 368 fTowerPhotonHits = 0; … … 379 380 position = track->Position; 380 381 382 381 383 ecalEnergy = momentum.E() * fTrackECalFractions[number]; 382 384 hcalEnergy = momentum.E() * fTrackHCalFractions[number]; … … 385 387 fTrackHCalEnergy += hcalEnergy; 386 388 387 bool dbg_scz = false; 388 if (dbg_scz) { 389 cout << " Calorimeter input track has x y z t " << track->Position.X() << " " << track->Position.Y() << " " << track->Position.Z() << " " << track->Position.T() 390 << endl; 391 Candidate *prt = static_cast<Candidate*>(track->GetCandidates()->Last()); 392 const TLorentzVector &ini = prt->Position; 393 394 cout << " and parent has x y z t " << ini.X() << " " << ini.Y() << " " << ini.Z() << " " << ini.T(); 395 396 } 397 398 if (ecalEnergy > fTimingEMin && fTower) { 399 if (fElectronsFromTrack) { 400 // cout << " SCZ Debug pushing back track hit E=" << ecalEnergy << " T=" << track->Position.T() << " isPU=" << track->IsPU << " isRecoPU=" << track->IsRecoPU 401 // << " PID=" << track->PID << endl; 402 fTower->Ecal_E_t.push_back(std::make_pair<float,float>(ecalEnergy,track->Position.T())); 403 } else { 404 // cout << " Skipping track hit E=" << ecalEnergy << " T=" << track->Position.T() << " isPU=" << track->IsPU << " isRecoPU=" << track->IsRecoPU 405 // << " PID=" << track->PID << endl; 406 } 407 } 408 389 fTrackECalTime += TMath::Sqrt(ecalEnergy)*position.T(); 390 fTrackHCalTime += TMath::Sqrt(hcalEnergy)*position.T(); 391 392 fTrackECalTimeWeight += TMath::Sqrt(ecalEnergy); 393 fTrackHCalTimeWeight += TMath::Sqrt(hcalEnergy); 409 394 410 395 fTowerTrackArray->Add(track); … … 412 397 continue; 413 398 } 414 399 415 400 // check for photon and electron hits in current tower 416 401 if(flags & 2) ++fTowerPhotonHits; … … 427 412 fTowerHCalEnergy += hcalEnergy; 428 413 429 if (ecalEnergy > fTimingEMin && fTower) { 430 if (abs(particle->PID) != 11 || !fElectronsFromTrack) { 431 // cout << " SCZ Debug About to push back particle hit E=" << ecalEnergy << " T=" << particle->Position.T() << " isPU=" << particle->IsPU 432 // << " PID=" << particle->PID << endl; 433 fTower->Ecal_E_t.push_back(std::make_pair<Float_t,Float_t>(ecalEnergy,particle->Position.T())); 434 } else { 435 436 // N.B. Only charged particle set to leave ecal energy is the electrons 437 // cout << " SCZ Debug To avoid double-counting, skipping particle hit E=" << ecalEnergy << " T=" << particle->Position.T() << " isPU=" << particle->IsPU 438 // << " PID=" << particle->PID << endl; 439 440 } 441 } 414 fTowerECalTime += TMath::Sqrt(ecalEnergy)*position.T(); 415 fTowerHCalTime += TMath::Sqrt(hcalEnergy)*position.T(); 416 417 fTowerECalTimeWeight += TMath::Sqrt(ecalEnergy); 418 fTowerHCalTimeWeight += TMath::Sqrt(hcalEnergy); 419 442 420 443 421 fTower->AddCandidate(particle); … … 456 434 Double_t ecalEnergy, hcalEnergy; 457 435 Double_t ecalSigma, hcalSigma; 458 436 Double_t ecalTime, hcalTime, time; 437 459 438 if(!fTower) return; 460 439 … … 465 444 hcalEnergy = LogNormal(fTowerHCalEnergy, hcalSigma); 466 445 446 ecalTime = (fTowerECalTimeWeight < 1.0E-09 ) ? 0.0 : fTowerECalTime/fTowerECalTimeWeight; 447 hcalTime = (fTowerHCalTimeWeight < 1.0E-09 ) ? 0.0 : fTowerHCalTime/fTowerHCalTimeWeight; 448 467 449 ecalSigma = fECalResolutionFormula->Eval(0.0, fTowerEta, 0.0, ecalEnergy); 468 450 hcalSigma = fHCalResolutionFormula->Eval(0.0, fTowerEta, 0.0, hcalEnergy); … … 472 454 473 455 energy = ecalEnergy + hcalEnergy; 474 456 time = (TMath::Sqrt(ecalEnergy)*ecalTime + TMath::Sqrt(hcalEnergy)*hcalTime)/(TMath::Sqrt(ecalEnergy) + TMath::Sqrt(hcalEnergy)); 457 475 458 if(fSmearTowerCenter) 476 459 { … … 486 469 pt = energy / TMath::CosH(eta); 487 470 488 // Time calculation for tower 489 fTower->Ntimes = 0; 490 Float_t tow_sumT = 0; 491 Float_t tow_sumW = 0; 492 493 for (Int_t i = 0 ; i < fTower->Ecal_E_t.size() ; i++) 494 { 495 Float_t w = TMath::Sqrt(fTower->Ecal_E_t[i].first); 496 tow_sumT += w*fTower->Ecal_E_t[i].second; 497 tow_sumW += w; 498 fTower->Ntimes++; 499 } 500 501 if (tow_sumW > 0.) { 502 fTower->Position.SetPtEtaPhiE(1.0, eta, phi,tow_sumT/tow_sumW); 503 } else { 504 fTower->Position.SetPtEtaPhiE(1.0,eta,phi,999999.); 505 } 506 507 471 fTower->Position.SetPtEtaPhiE(1.0, eta, phi, time); 508 472 fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 509 473 fTower->Eem = ecalEnergy; -
modules/Calorimeter.h
r9343566 re33e6db 60 60 Double_t fTrackECalEnergy, fTrackHCalEnergy; 61 61 62 Double_t fTimingEMin; 63 Bool_t fElectronsFromTrack; // for timing 64 62 Double_t fTowerECalTime, fTowerHCalTime; 63 Double_t fTrackECalTime, fTrackHCalTime; 64 65 Double_t fTowerECalTimeWeight, fTowerHCalTimeWeight; 66 Double_t fTrackECalTimeWeight, fTrackHCalTimeWeight; 67 65 68 Int_t fTowerTrackHits, fTowerPhotonHits; 66 69 -
modules/FastJetFinder.cc
r9343566 re33e6db 65 65 #include "fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh" 66 66 #include "fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.hh" 67 68 #include "fastjet/tools/Filter.hh"69 #include "fastjet/tools/Pruner.hh"70 #include "fastjet/contribs/RecursiveTools/SoftDrop.hh"71 67 72 68 using namespace std; … … 124 120 fRcutOff = GetDouble("RcutOff", 0.8); // used only if Njettiness is used as jet clustering algo (case 8) 125 121 fN = GetInt("N", 2); // used only if Njettiness is used as jet clustering algo (case 8) 126 127 //-- Trimming parameters --128 129 fComputeTrimming = GetBool("ComputeTrimming", false);130 fRTrim = GetDouble("RTrim", 0.2);131 fPtFracTrim = GetDouble("PtFracTrim", 0.05);132 133 134 //-- Pruning parameters --135 136 fComputePruning = GetBool("ComputePruning", false);137 fZcutPrun = GetDouble("ZcutPrun", 0.1);138 fRcutPrun = GetDouble("RcutPrun", 0.5);139 fRPrun = GetDouble("RPrun", 0.8);140 141 //-- SoftDrop parameters --142 143 fComputeSoftDrop = GetBool("ComputeSoftDrop", false);144 fBetaSoftDrop = GetDouble("BetaSoftDrop", 0.0);145 fSymmetryCutSoftDrop = GetDouble("SymmetryCutSoftDrop", 0.1);146 fR0SoftDrop= GetDouble("R0SoftDrop=", 0.8);147 148 122 149 123 // --- Jet Area Parameters --- … … 286 260 PseudoJet jet, area; 287 261 ClusterSequence *sequence; 288 vector< PseudoJet > inputList, outputList , subjets;262 vector< PseudoJet > inputList, outputList; 289 263 vector< PseudoJet >::iterator itInputList, itOutputList; 290 264 vector< TEstimatorStruct >::iterator itEstimators; … … 378 352 candidate->DeltaEta = detaMax; 379 353 candidate->DeltaPhi = dphiMax; 380 381 //------------------------------------ 382 // Trimming 383 //------------------------------------ 384 385 if(fComputeTrimming) 386 { 387 388 fastjet::Filter trimmer(fastjet::JetDefinition(fastjet::kt_algorithm,fRTrim),fastjet::SelectorPtFractionMin(fPtFracTrim)); 389 fastjet::PseudoJet trimmed_jet = trimmer(*itOutputList); 390 391 trimmed_jet = join(trimmed_jet.constituents()); 392 393 candidate->TrimmedP4[0].SetPtEtaPhiM(trimmed_jet.pt(), trimmed_jet.eta(), trimmed_jet.phi(), trimmed_jet.m()); 394 395 // four hardest subjets 396 subjets.clear(); 397 subjets = trimmed_jet.pieces(); 398 subjets = sorted_by_pt(subjets); 399 400 candidate->NSubJetsTrimmed = subjets.size(); 401 402 for (size_t i = 0; i < subjets.size() and i < 4; i++){ 403 if(subjets.at(i).pt() < 0) continue ; 404 candidate->TrimmedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m()); 405 } 406 } 407 408 409 //------------------------------------ 410 // Pruning 411 //------------------------------------ 412 413 414 if(fComputePruning) 415 { 416 417 fastjet::Pruner pruner(fastjet::JetDefinition(fastjet::cambridge_algorithm,fRPrun),fZcutPrun,fRcutPrun); 418 fastjet::PseudoJet pruned_jet = pruner(*itOutputList); 419 420 candidate->PrunedP4[0].SetPtEtaPhiM(pruned_jet.pt(), pruned_jet.eta(), pruned_jet.phi(), pruned_jet.m()); 421 422 // four hardest subjet 423 subjets.clear(); 424 subjets = pruned_jet.pieces(); 425 subjets = sorted_by_pt(subjets); 426 427 candidate->NSubJetsPruned = subjets.size(); 428 429 for (size_t i = 0; i < subjets.size() and i < 4; i++){ 430 if(subjets.at(i).pt() < 0) continue ; 431 candidate->PrunedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m()); 432 } 433 434 } 435 436 //------------------------------------ 437 // SoftDrop 438 //------------------------------------ 439 440 if(fComputeSoftDrop) 441 { 442 443 contrib::SoftDrop softDrop(fBetaSoftDrop,fSymmetryCutSoftDrop,fR0SoftDrop); 444 fastjet::PseudoJet softdrop_jet = softDrop(*itOutputList); 445 446 candidate->SoftDroppedP4[0].SetPtEtaPhiM(softdrop_jet.pt(), softdrop_jet.eta(), softdrop_jet.phi(), softdrop_jet.m()); 447 448 // four hardest subjet 449 450 subjets.clear(); 451 subjets = softdrop_jet.pieces(); 452 subjets = sorted_by_pt(subjets); 453 candidate->NSubJetsSoftDropped = softdrop_jet.pieces().size(); 454 455 for (size_t i = 0; i < subjets.size() and i < 4; i++){ 456 if(subjets.at(i).pt() < 0) continue ; 457 candidate->SoftDroppedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m()); 458 } 459 } 460 354 461 355 // --- compute N-subjettiness with N = 1,2,3,4,5 ---- 462 356 -
modules/FastJetFinder.h
r9343566 re33e6db 83 83 Int_t fN ; 84 84 85 //-- Trimming parameters --86 87 Bool_t fComputeTrimming;88 Double_t fRTrim;89 Double_t fPtFracTrim;90 91 //-- Pruning parameters --92 93 Bool_t fComputePruning;94 Double_t fZcutPrun;95 Double_t fRcutPrun;96 Double_t fRPrun;97 98 //-- SoftDrop parameters --99 100 Bool_t fComputeSoftDrop;101 Double_t fBetaSoftDrop;102 Double_t fSymmetryCutSoftDrop;103 Double_t fR0SoftDrop;104 105 85 // --- FastJet Area method -------- 106 86 -
modules/Isolation.cc
r9343566 re33e6db 25 25 * the transverse momenta fraction within (PTRatioMin, PTRatioMax]. 26 26 * 27 * \author P. Demin , M. Selvaggi, R. Gerosa- UCL, Louvain-la-Neuve27 * \author P. Demin - UCL, Louvain-la-Neuve 28 28 * 29 29 */ … … 109 109 fUsePTSum = GetBool("UsePTSum", false); 110 110 111 fVetoLeptons = GetBool("VetoLeptons", true);112 113 111 fClassifier->fPTMin = GetDouble("PTMin", 0.5); 114 115 112 116 113 // import input array(s) … … 156 153 Candidate *candidate, *isolation, *object; 157 154 TObjArray *isolationArray; 158 Double_t sum Charged, sumNeutral, sumAllParticles, sumChargedPU, sumDBeta, ratioDBeta, sumRhoCorr, ratioRhoCorr;155 Double_t sum, ratio; 159 156 Int_t counter; 160 157 Double_t eta = 0.0; … … 183 180 184 181 // loop over all input tracks 185 186 sumNeutral = 0.0; 187 sumCharged = 0.0; 188 sumChargedPU = 0.0; 189 sumAllParticles = 0.0; 190 182 sum = 0.0; 191 183 counter = 0; 192 184 itIsolationArray.Reset(); 193 194 185 while((isolation = static_cast<Candidate*>(itIsolationArray.Next()))) 195 186 { … … 197 188 198 189 if(candidateMomentum.DeltaR(isolationMomentum) <= fDeltaRMax && 199 candidate->GetUniqueID() != isolation->GetUniqueID() && 200 ( !fVetoLeptons || (TMath::Abs(candidate->PID) != 11 && (TMath::Abs(candidate->PID) != 13)) ) ) 190 candidate->GetUniqueID() != isolation->GetUniqueID()) 201 191 { 202 203 sumAllParticles += isolationMomentum.Pt(); 204 if(isolation->Charge !=0) 205 { 206 sumCharged += isolationMomentum.Pt(); 207 if(isolation->IsRecoPU != 0) sumChargedPU += isolationMomentum.Pt(); 208 } 209 210 else sumNeutral += isolationMomentum.Pt(); 211 192 sum += isolationMomentum.Pt(); 212 193 ++counter; 213 194 } … … 228 209 } 229 210 230 231 // correct sum for pile-up contamination 232 sumDBeta = sumCharged + TMath::Max(sumNeutral-0.5*sumChargedPU,0.0); 233 sumRhoCorr = sumCharged + TMath::Max(sumNeutral-TMath::Max(rho,0.0)*fDeltaRMax*fDeltaRMax*TMath::Pi(),0.0); 234 ratioDBeta = sumDBeta/candidateMomentum.Pt(); 235 ratioRhoCorr = sumRhoCorr/candidateMomentum.Pt(); 236 237 candidate->IsolationVar = ratioDBeta; 238 candidate->IsolationVarRhoCorr = ratioRhoCorr; 239 candidate->SumPtCharged = sumCharged; 240 candidate->SumPtNeutral = sumNeutral; 241 candidate->SumPtChargedPU = sumChargedPU; 242 candidate->SumPt = sumAllParticles; 243 244 if((fUsePTSum && sumDBeta > fPTSumMax) || ratioDBeta > fPTRatioMax) continue; 211 // correct sum for pile-up contamination 212 sum = sum - rho*fDeltaRMax*fDeltaRMax*TMath::Pi(); 213 214 ratio = sum/candidateMomentum.Pt(); 215 if((fUsePTSum && sum > fPTSumMax) || ratio > fPTRatioMax) continue; 216 245 217 fOutputArray->Add(candidate); 246 218 } -
modules/Isolation.h
r9343566 re33e6db 59 59 Bool_t fUsePTSum; 60 60 61 Bool_t fVetoLeptons;62 63 61 IsolationClassifier *fClassifier; //! 64 62 -
modules/ModulesLinkDef.h
r9343566 re33e6db 58 58 #include "modules/Weighter.h" 59 59 #include "modules/Hector.h" 60 #include "modules/RunPUPPI.h"61 #include "modules/JetFlavorAssociation.h"62 60 #include "modules/ExampleModule.h" 63 61 … … 100 98 #pragma link C++ class Weighter+; 101 99 #pragma link C++ class Hector+; 102 #pragma link C++ class RunPUPPI+;103 #pragma link C++ class JetFlavorAssociation+;104 100 #pragma link C++ class ExampleModule+; 105 101 -
modules/PdgCodeFilter.cc
r9343566 re33e6db 74 74 fPTMin = GetDouble("PTMin", 0.0); 75 75 76 fInvertPdg = GetBool("InvertPdg", false);77 78 fRequireStatus = GetBool("RequireStatus", false);79 fStatus = GetInt("Status", 1);80 81 76 // import input array 82 77 fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles")); … … 114 109 Double_t pt; 115 110 116 const Bool_t requireStatus = fRequireStatus;117 const Bool_t invertPdg = fInvertPdg;118 const int reqStatus = fStatus;119 120 111 fItInputArray->Reset(); 121 112 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) … … 125 116 pt = candidateMomentum.Pt(); 126 117 127 if(pt < fPTMin) continue; 128 if(requireStatus && (candidate->Status != reqStatus)) continue; 118 pass = kTRUE; 129 119 130 pass = kTRUE;120 if(pt < fPTMin) pass = kFALSE; 131 121 if(find(fPdgCodes.begin(), fPdgCodes.end(), pdgCode) != fPdgCodes.end()) pass = kFALSE; 132 122 133 if (invertPdg) pass = !pass;134 123 if(pass) fOutputArray->Add(candidate); 135 124 } -
modules/PdgCodeFilter.h
r9343566 re33e6db 50 50 51 51 Double_t fPTMin; //! 52 Bool_t fInvertPdg; //!53 Bool_t fRequireStatus; //!54 Int_t fStatus; //!55 52 56 53 std::vector<Int_t> fPdgCodes; -
modules/PileUpJetID.cc
r9343566 re33e6db 1 /* 2 * Delphes: a framework for fast simulation of a generic collider experiment 3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 1 19 2 20 /** \class PileUpJetID 3 21 * 4 * CMS PileUp Jet ID Variables 5 * 6 * \author S. Zenz 22 * CMS PileUp Jet ID Variables, based on http://cds.cern.ch/record/1581583 23 * 24 * \author S. Zenz, December 2013 7 25 * 8 26 */ … … 23 41 #include "TRandom3.h" 24 42 #include "TObjArray.h" 25 //#include "TDatabasePDG.h"43 #include "TDatabasePDG.h" 26 44 #include "TLorentzVector.h" 27 45 … … 36 54 37 55 PileUpJetID::PileUpJetID() : 38 fItJetInputArray(0),fTrackInputArray(0),fNeutralInputArray(0) 56 fItJetInputArray(0),fTrackInputArray(0),fNeutralInputArray(0),fItVertexInputArray(0) 39 57 { 40 58 … … 52 70 void PileUpJetID::Init() 53 71 { 54 55 72 fJetPTMin = GetDouble("JetPTMin", 20.0); 56 73 fParameterR = GetDouble("ParameterR", 0.5); 57 74 fUseConstituents = GetInt("UseConstituents", 0); 58 75 59 60 /*61 Double_t fMeanSqDeltaRMaxBarrel; // |eta| < 1.562 Double_t fBetaMinBarrel; // |eta| < 2.563 Double_t fMeanSqDeltaRMaxEndcap; // 1.5 < |eta| < 4.064 Double_t fBetaMinEndcap; // 1.5 < |eta| < 4.065 Double_t fMeanSqDeltaRMaxForward; // |eta| > 4.066 */67 68 fMeanSqDeltaRMaxBarrel = GetDouble("MeanSqDeltaRMaxBarrel",0.1);69 fBetaMinBarrel = GetDouble("BetaMinBarrel",0.1);70 fMeanSqDeltaRMaxEndcap = GetDouble("MeanSqDeltaRMaxEndcap",0.1);71 fBetaMinEndcap = GetDouble("BetaMinEndcap",0.1);72 fMeanSqDeltaRMaxForward = GetDouble("MeanSqDeltaRMaxForward",0.1);73 fJetPTMinForNeutrals = GetDouble("JetPTMinForNeutrals", 20.0);74 fNeutralPTMin = GetDouble("NeutralPTMin", 2.0);75 76 77 78 cout << " set MeanSqDeltaRMaxBarrel " << fMeanSqDeltaRMaxBarrel << endl;79 cout << " set BetaMinBarrel " << fBetaMinBarrel << endl;80 cout << " set MeanSqDeltaRMaxEndcap " << fMeanSqDeltaRMaxEndcap << endl;81 cout << " set BetaMinEndcap " << fBetaMinEndcap << endl;82 cout << " set MeanSqDeltaRMaxForward " << fMeanSqDeltaRMaxForward << endl;83 84 85 86 76 fAverageEachTower = false; // for timing 87 77 … … 91 81 fItJetInputArray = fJetInputArray->MakeIterator(); 92 82 93 94 // cout << "BeforE SCZ additions in init" << endl; 95 // cout << GetString("TrackInputArray", "ParticlePropagator/tracks") << endl; 96 // cout << GetString("EFlowTrackInputArray", "ParticlePropagator/tracks") << endl; 97 98 fTrackInputArray = ImportArray(GetString("TrackInputArray", "ParticlePropagator/tracks")); 83 fTrackInputArray = ImportArray(GetString("TrackInputArray", "Calorimeter/eflowTracks")); 99 84 fItTrackInputArray = fTrackInputArray->MakeIterator(); 100 85 101 fNeutralInputArray = ImportArray(GetString("NeutralInputArray", " ParticlePropagator/tracks"));86 fNeutralInputArray = ImportArray(GetString("NeutralInputArray", "Calorimeter/eflowTowers")); 102 87 fItNeutralInputArray = fNeutralInputArray->MakeIterator(); 103 88 89 fVertexInputArray = ImportArray(GetString("VertexInputArray", "PileUpMerger/vertices")); 90 fItVertexInputArray = fVertexInputArray->MakeIterator(); 91 92 fZVertexResolution = GetDouble("ZVertexResolution", 0.005)*1.0E3; 104 93 105 94 // create output array(s) 106 95 107 96 fOutputArray = ExportArray(GetString("OutputArray", "jets")); 108 109 fNeutralsInPassingJets = ExportArray(GetString("NeutralsInPassingJets","eflowtowers"));110 111 112 // cout << " end of INIT " << endl;113 114 97 } 115 98 … … 118 101 void PileUpJetID::Finish() 119 102 { 120 // cout << "In finish" << endl;121 122 103 if(fItJetInputArray) delete fItJetInputArray; 123 104 if(fItTrackInputArray) delete fItTrackInputArray; 124 105 if(fItNeutralInputArray) delete fItNeutralInputArray; 125 106 if(fItVertexInputArray) delete fItVertexInputArray; 126 107 } 127 108 … … 130 111 void PileUpJetID::Process() 131 112 { 132 // cout << "start of process" << endl;133 134 113 Candidate *candidate, *constituent; 135 114 TLorentzVector momentum, area; 136 137 // cout << "BeforE SCZ additions in process" << endl; 138 139 // SCZ 140 Candidate *trk; 115 Int_t i, nc, nn; 116 Double_t sumpt, sumptch, sumptchpv, sumptchpu, sumdrsqptsq, sumptsq; 117 Double_t dr, pt, pt_ann[5]; 118 Double_t zvtx = 0.0; 119 120 Candidate *track; 121 122 // find z position of primary vertex 123 124 fItVertexInputArray->Reset(); 125 while((candidate = static_cast<Candidate*>(fItVertexInputArray->Next()))) 126 { 127 if(!candidate->IsPU) 128 { 129 zvtx = candidate->Position.Z(); 130 break; 131 } 132 } 141 133 142 134 // loop over all input candidates … … 147 139 area = candidate->Area; 148 140 149 float sumT0 = 0.; 150 float sumT1 = 0.; 151 float sumT10 = 0.; 152 float sumT20 = 0.; 153 float sumT30 = 0.; 154 float sumT40 = 0.; 155 float sumWeightsForT = 0.; 156 candidate->Ntimes = 0; 157 158 float sumpt = 0.; 159 float sumptch = 0.; 160 float sumptchpv = 0.; 161 float sumptchpu = 0.; 162 float sumdrsqptsq = 0.; 163 float sumptsq = 0.; 164 int nc = 0; 165 int nn = 0; 166 float pt_ann[5]; 167 168 for (int i = 0 ; i < 5 ; i++) { 169 pt_ann[i] = 0.; 170 } 171 172 if (fUseConstituents) { 141 sumpt = 0.0; 142 sumptch = 0.0; 143 sumptchpv = 0.0; 144 sumptchpu = 0.0; 145 sumdrsqptsq = 0.0; 146 sumptsq = 0.0; 147 nc = 0; 148 nn = 0; 149 150 for(i = 0; i < 5; ++i) 151 { 152 pt_ann[i] = 0.0; 153 } 154 155 if(fUseConstituents) 156 { 173 157 TIter itConstituents(candidate->GetCandidates()); 174 while((constituent = static_cast<Candidate*>(itConstituents.Next()))) { 175 float pt = constituent->Momentum.Pt(); 176 float dr = candidate->Momentum.DeltaR(constituent->Momentum); 177 // cout << " There exists a constituent with dr=" << dr << endl; 178 sumpt += pt; 179 sumdrsqptsq += dr*dr*pt*pt; 180 sumptsq += pt*pt; 181 if (constituent->Charge == 0) { 182 nn++; 183 } else { 184 if (constituent->IsRecoPU) { 185 sumptchpu += pt; 186 } else { 187 sumptchpv += pt; 188 } 189 sumptch += pt; 190 nc++; 191 } 192 for (int i = 0 ; i < 5 ; i++) { 193 if (dr > 0.1*i && dr < 0.1*(i+1)) { 194 pt_ann[i] += pt; 195 } 196 } 197 float tow_sumT = 0; 198 float tow_sumW = 0; 199 for (int i = 0 ; i < constituent->Ecal_E_t.size() ; i++) { 200 float w = TMath::Sqrt(constituent->Ecal_E_t[i].first); 201 if (fAverageEachTower) { 202 tow_sumT += w*constituent->Ecal_E_t[i].second; 203 tow_sumW += w; 204 } else { 205 sumT0 += w*constituent->Ecal_E_t[i].second; 206 sumT1 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.001); 207 sumT10 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.010); 208 sumT20 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.020); 209 sumT30 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.030); 210 sumT40 += w*gRandom->Gaus(constituent->Ecal_E_t[i].second,0.040); 211 sumWeightsForT += w; 212 candidate->Ntimes++; 213 } 214 } 215 if (fAverageEachTower && tow_sumW > 0.) { 216 sumT0 += tow_sumT; 217 sumT1 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.001); 218 sumT10 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.0010); 219 sumT20 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.0020); 220 sumT30 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.0030); 221 sumT40 += tow_sumW*gRandom->Gaus(tow_sumT/tow_sumW,0.0040); 222 sumWeightsForT += tow_sumW; 223 candidate->Ntimes++; 224 } 225 } 226 } else { 158 while((constituent = static_cast<Candidate*>(itConstituents.Next()))) 159 { 160 pt = constituent->Momentum.Pt(); 161 dr = candidate->Momentum.DeltaR(constituent->Momentum); 162 sumpt += pt; 163 sumdrsqptsq += dr*dr*pt*pt; 164 sumptsq += pt*pt; 165 if(constituent->Charge == 0) 166 { 167 // neutrals 168 ++nn; 169 } 170 else 171 { 172 // charged 173 if(constituent->IsPU && TMath::Abs(constituent->Position.Z()-zvtx) > fZVertexResolution) 174 { 175 sumptchpu += pt; 176 } 177 else 178 { 179 sumptchpv += pt; 180 } 181 sumptch += pt; 182 ++nc; 183 } 184 for(i = 0; i < 5; ++i) 185 { 186 if(dr > 0.1*i && dr < 0.1*(i + 1)) 187 { 188 pt_ann[i] += pt; 189 } 190 } 191 } 192 } 193 else 194 { 227 195 // Not using constituents, using dr 228 196 fItTrackInputArray->Reset(); 229 while ((trk = static_cast<Candidate*>(fItTrackInputArray->Next()))) { 230 if (trk->Momentum.DeltaR(candidate->Momentum) < fParameterR) { 231 float pt = trk->Momentum.Pt(); 232 sumpt += pt; 233 sumptch += pt; 234 if (trk->IsRecoPU) { 235 sumptchpu += pt; 236 } else { 237 sumptchpv += pt; 238 } 239 float dr = candidate->Momentum.DeltaR(trk->Momentum); 240 sumdrsqptsq += dr*dr*pt*pt; 241 sumptsq += pt*pt; 242 nc++; 243 for (int i = 0 ; i < 5 ; i++) { 244 if (dr > 0.1*i && dr < 0.1*(i+1)) { 245 pt_ann[i] += pt; 246 } 247 } 248 } 249 } 197 while((track = static_cast<Candidate*>(fItTrackInputArray->Next()))) 198 { 199 if(track->Momentum.DeltaR(candidate->Momentum) < fParameterR) 200 { 201 pt = track->Momentum.Pt(); 202 sumpt += pt; 203 sumptch += pt; 204 if(track->IsPU && TMath::Abs(track->Position.Z()-zvtx) > fZVertexResolution) 205 { 206 sumptchpu += pt; 207 } 208 else 209 { 210 sumptchpv += pt; 211 } 212 dr = candidate->Momentum.DeltaR(track->Momentum); 213 sumdrsqptsq += dr*dr*pt*pt; 214 sumptsq += pt*pt; 215 nc++; 216 for(i = 0; i < 5; ++i) 217 { 218 if(dr > 0.1*i && dr < 0.1*(i + 1)) 219 { 220 pt_ann[i] += pt; 221 } 222 } 223 } 224 } 225 250 226 fItNeutralInputArray->Reset(); 251 while ((constituent = static_cast<Candidate*>(fItNeutralInputArray->Next()))) { 252 if (constituent->Momentum.DeltaR(candidate->Momentum) < fParameterR) { 253 float pt = constituent->Momentum.Pt(); 254 sumpt += pt; 255 float dr = candidate->Momentum.DeltaR(constituent->Momentum); 256 sumdrsqptsq += dr*dr*pt*pt; 257 sumptsq += pt*pt; 258 nn++; 259 for (int i = 0 ; i < 5 ; i++) { 260 if (dr > 0.1*i && dr < 0.1*(i+1)) { 261 pt_ann[i] += pt; 262 } 263 } 264 } 265 } 266 } 267 268 if (sumptch > 0.) { 269 candidate->Beta = sumptchpv/sumptch; 270 candidate->BetaStar = sumptchpu/sumptch; 271 } else { 272 candidate->Beta = -999.; 273 candidate->BetaStar = -999.; 274 } 275 if (sumptsq > 0.) { 227 while ((constituent = static_cast<Candidate*>(fItNeutralInputArray->Next()))) 228 { 229 if(constituent->Momentum.DeltaR(candidate->Momentum) < fParameterR) 230 { 231 pt = constituent->Momentum.Pt(); 232 sumpt += pt; 233 dr = candidate->Momentum.DeltaR(constituent->Momentum); 234 sumdrsqptsq += dr*dr*pt*pt; 235 sumptsq += pt*pt; 236 nn++; 237 for(i = 0; i < 5; ++i) 238 { 239 if(dr > 0.1*i && dr < 0.1*(i + 1)) 240 { 241 pt_ann[i] += pt; 242 } 243 } 244 } 245 } 246 } 247 248 if(sumptch > 0.0) 249 { 250 candidate->Beta = sumptchpu/sumptch; 251 candidate->BetaStar = sumptchpv/sumptch; 252 } 253 else 254 { 255 candidate->Beta = -999.0; 256 candidate->BetaStar = -999.0; 257 } 258 if(sumptsq > 0.0) 259 { 276 260 candidate->MeanSqDeltaR = sumdrsqptsq/sumptsq; 277 } else { 278 candidate->MeanSqDeltaR = -999.; 261 } 262 else 263 { 264 candidate->MeanSqDeltaR = -999.0; 279 265 } 280 266 candidate->NCharged = nc; 281 267 candidate->NNeutrals = nn; 282 if (sumpt > 0.) { 268 if(sumpt > 0.0) 269 { 283 270 candidate->PTD = TMath::Sqrt(sumptsq) / sumpt; 284 for (int i = 0 ; i < 5 ; i++) { 271 for(i = 0; i < 5; ++i) 272 { 285 273 candidate->FracPt[i] = pt_ann[i]/sumpt; 286 274 } 287 } else { 288 candidate->PTD = -999.; 289 for (int i = 0 ; i < 5 ; i++) { 290 candidate->FracPt[i] = -999.; 275 } 276 else 277 { 278 candidate->PTD = -999.0; 279 for(i = 0; i < 5; ++i) 280 { 281 candidate->FracPt[i] = -999.0; 291 282 } 292 283 } 293 284 294 285 fOutputArray->Add(candidate); 295 296 // New stuff297 /*298 fMeanSqDeltaRMaxBarrel = GetDouble("MeanSqDeltaRMaxBarrel",0.1);299 fBetaMinBarrel = GetDouble("BetaMinBarrel",0.1);300 fMeanSqDeltaRMaxEndcap = GetDouble("MeanSqDeltaRMaxEndcap",0.1);301 fBetaMinEndcap = GetDouble("BetaMinEndcap",0.1);302 fMeanSqDeltaRMaxForward = GetDouble("MeanSqDeltaRMaxForward",0.1);303 */304 305 bool passId = false;306 if (candidate->Momentum.Pt() > fJetPTMinForNeutrals && candidate->MeanSqDeltaR > -0.1) {307 if (fabs(candidate->Momentum.Eta())<1.5) {308 passId = ((candidate->Beta > fBetaMinBarrel) && (candidate->MeanSqDeltaR < fMeanSqDeltaRMaxBarrel));309 } else if (fabs(candidate->Momentum.Eta())<4.0) {310 passId = ((candidate->Beta > fBetaMinEndcap) && (candidate->MeanSqDeltaR < fMeanSqDeltaRMaxEndcap));311 } else {312 passId = (candidate->MeanSqDeltaR < fMeanSqDeltaRMaxForward);313 }314 }315 316 // cout << " Pt Eta MeanSqDeltaR Beta PassId " << candidate->Momentum.Pt()317 // << " " << candidate->Momentum.Eta() << " " << candidate->MeanSqDeltaR << " " << candidate->Beta << " " << passId << endl;318 319 if (passId) {320 if (fUseConstituents) {321 TIter itConstituents(candidate->GetCandidates());322 while((constituent = static_cast<Candidate*>(itConstituents.Next()))) {323 if (constituent->Charge == 0 && constituent->Momentum.Pt() > fNeutralPTMin) {324 fNeutralsInPassingJets->Add(constituent);325 // cout << " Constitutent added Pt Eta Charge " << constituent->Momentum.Pt() << " " << constituent->Momentum.Eta() << " " << constituent->Charge << endl;326 }327 }328 } else { // use DeltaR329 fItNeutralInputArray->Reset();330 while ((constituent = static_cast<Candidate*>(fItNeutralInputArray->Next()))) {331 if (constituent->Momentum.DeltaR(candidate->Momentum) < fParameterR && constituent->Momentum.Pt() > fNeutralPTMin) {332 fNeutralsInPassingJets->Add(constituent);333 // cout << " Constitutent added Pt Eta Charge " << constituent->Momentum.Pt() << " " << constituent->Momentum.Eta() << " " << constituent->Charge << endl;334 }335 }336 }337 }338 339 340 286 } 341 287 } 342 288 343 289 //------------------------------------------------------------------------------ 290 -
modules/PileUpJetID.h
r9343566 re33e6db 1 /* 2 * Delphes: a framework for fast simulation of a generic collider experiment 3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 1 19 #ifndef PileUpJetID_h 2 20 #define PileUpJetID_h … … 4 22 /** \class PileUpJetID 5 23 * 6 * CMS PileUp Jet ID Variables 24 * CMS PileUp Jet ID Variables, based on http://cds.cern.ch/record/1581583 7 25 * 8 * \author S. Zenz 26 * \author S. Zenz, December 2013 9 27 * 10 28 */ … … 16 34 17 35 class TObjArray; 18 class DelphesFormula;19 36 20 37 class PileUpJetID: public DelphesModule … … 34 51 Double_t fParameterR; 35 52 36 Double_t fMeanSqDeltaRMaxBarrel; // |eta| < 1.537 Double_t fBetaMinBarrel; // |eta| < 2.538 Double_t fMeanSqDeltaRMaxEndcap; // 1.5 < |eta| < 4.039 Double_t fBetaMinEndcap; // 1.5 < |eta| < 4.040 Double_t fMeanSqDeltaRMaxForward; // |eta| > 4.041 42 Double_t fNeutralPTMin;43 Double_t fJetPTMinForNeutrals;44 45 /*46 JAY47 ---48 49 |Eta|<1.550 51 meanSqDeltaR betaStar SigEff BgdEff52 0.13 0.92 96% 8%53 0.13 0.95 97% 16%54 0.13 0.97 98% 27%55 56 |Eta|>1.557 58 meanSqDeltaR betaStar SigEff BgdEff59 0.14 0.91 95% 15%60 0.14 0.94 97% 19%61 0.14 0.97 98% 29%62 63 BRYAN64 -----65 66 Barrel (MeanSqDR, Beta, sig eff, bg eff):67 0.10, 0.08, 90%, 8%68 0.11, 0.12, 90%, 6%69 0.13, 0.16, 89%, 5%70 71 Endcap (MeanSqDR, Beta, sig eff, bg eff):72 0.07, 0.06, 89%, 4%73 0.08, 0.08, 92%, 6%74 0.09, 0.08, 95%, 10%75 0.10, 0.08, 97%, 13%76 77 SETH GUESSES FOR |eta| > 4.078 ----------------------------79 80 MeanSqDeltaR81 0.0782 0.1083 0.1484 0.285 */86 87 53 // If set to true, may have weird results for PFCHS 88 54 // If set to false, uses everything within dR < fParameterR even if in other jets &c. 89 55 // Results should be very similar for PF 90 Int_t fUseConstituents; 56 Int_t fUseConstituents; 91 57 92 58 Bool_t fAverageEachTower; … … 96 62 const TObjArray *fJetInputArray; //! 97 63 98 const TObjArray *fTrackInputArray; // SCZ99 const TObjArray *fNeutralInputArray; 64 const TObjArray *fTrackInputArray; //! 65 const TObjArray *fNeutralInputArray; //! 100 66 101 TIterator *fItTrackInputArray; // SCZ102 TIterator *fItNeutralInputArray; // SCZ67 TIterator *fItTrackInputArray; //! 68 TIterator *fItNeutralInputArray; //! 103 69 104 70 TObjArray *fOutputArray; //! 105 TObjArray *fNeutralsInPassingJets; // SCZ106 71 72 TIterator *fItVertexInputArray; //! 73 const TObjArray *fVertexInputArray; //! 107 74 108 ClassDef(PileUpJetID, 2) 75 Double_t fZVertexResolution; 76 77 ClassDef(PileUpJetID, 1) 109 78 }; 110 79 111 80 #endif 81 -
modules/PileUpMerger.cc
r9343566 re33e6db 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 -
modules/PileUpMerger.h
r9343566 re33e6db 53 53 Double_t fTVertexSpread; 54 54 55 Double_t fInputBeamSpotX;56 Double_t fInputBeamSpotY;57 Double_t fOutputBeamSpotX;58 Double_t fOutputBeamSpotY;59 60 55 DelphesTF2 *fFunction; //! 61 56 -
modules/PileUpMergerPythia8.cc
r9343566 re33e6db 29 29 #include "classes/DelphesClasses.h" 30 30 #include "classes/DelphesFactory.h" 31 #include "classes/Delphes TF2.h"31 #include "classes/DelphesFormula.h" 32 32 #include "classes/DelphesPileUpReader.h" 33 33 … … 56 56 57 57 PileUpMergerPythia8::PileUpMergerPythia8() : 58 f Function(0), fPythia(0), fItInputArray(0)58 fPythia(0), fItInputArray(0) 59 59 { 60 fFunction = new DelphesTF2;61 60 } 62 61 … … 65 64 PileUpMergerPythia8::~PileUpMergerPythia8() 66 65 { 67 delete fFunction;68 66 } 69 67 … … 74 72 const char *fileName; 75 73 76 fPileUpDistribution = GetInt("PileUpDistribution", 0);77 78 74 fMeanPileUp = GetDouble("MeanPileUp", 10); 79 80 fZVertexSpread = GetDouble("ZVertexSpread", 0.15); 81 fTVertexSpread = GetDouble("TVertexSpread", 1.5E-09); 82 83 fInputBeamSpotX = GetDouble("InputBeamSpotX", 0.0); 84 fInputBeamSpotY = GetDouble("InputBeamSpotY", 0.0); 85 fOutputBeamSpotX = GetDouble("OutputBeamSpotX", 0.0); 86 fOutputBeamSpotY = GetDouble("OutputBeamSpotY", 0.0); 75 fZVertexSpread = GetDouble("ZVertexSpread", 0.05)*1.0E3; 87 76 88 77 fPTMin = GetDouble("PTMin", 0.0); 89 90 fFunction->Compile(GetString("VertexDistributionFormula", "0.0"));91 fFunction->SetRange(-fZVertexSpread, -fTVertexSpread, fZVertexSpread, fTVertexSpread);92 78 93 79 fileName = GetString("ConfigFile", "MinBias.cmnd"); … … 100 86 101 87 // create output arrays 102 fParticleOutputArray = ExportArray(GetString("ParticleOutputArray", "stableParticles")); 103 fVertexOutputArray = ExportArray(GetString("VertexOutputArray", "vertices")); 88 fOutputArray = ExportArray(GetString("OutputArray", "stableParticles")); 104 89 } 105 90 … … 118 103 TParticlePDG *pdgParticle; 119 104 Int_t pid, status; 120 Float_t x, y, z, t , vx, vy;105 Float_t x, y, z, t; 121 106 Float_t px, py, pz, e; 122 Double_t dz, dphi , dt;123 Int_t numberOfEvents, event, numberOfParticles, i;124 Candidate *candidate , *vertex;107 Double_t dz, dphi; 108 Int_t poisson, event, i; 109 Candidate *candidate; 125 110 DelphesFactory *factory; 126 111 127 const Double_t c_light = 2.99792458E8;128 129 112 fItInputArray->Reset(); 130 131 // --- Deal with primary vertex first ------132 133 fFunction->GetRandom2(dz, dt);134 135 dt *= c_light*1.0E3; // necessary in order to make t in mm/c136 dz *= 1.0E3; // necessary in order to make z in mm137 vx = 0.0;138 vy = 0.0;139 numberOfParticles = fInputArray->GetEntriesFast();140 113 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 141 114 { 142 vx += candidate->Position.X(); 143 vy += candidate->Position.Y(); 144 z = candidate->Position.Z(); 145 t = candidate->Position.T(); 146 candidate->Position.SetZ(z + dz); 147 candidate->Position.SetT(t + dt); 148 fParticleOutputArray->Add(candidate); 149 } 150 151 if(numberOfParticles > 0) 152 { 153 vx /= numberOfParticles; 154 vy /= numberOfParticles; 115 fOutputArray->Add(candidate); 155 116 } 156 117 157 118 factory = GetFactory(); 158 119 159 vertex = factory->NewCandidate(); 160 vertex->Position.SetXYZT(vx, vy, dz, dt); 161 fVertexOutputArray->Add(vertex); 120 poisson = gRandom->Poisson(fMeanPileUp); 162 121 163 // --- Then with pile-up vertices ------ 164 165 switch(fPileUpDistribution) 166 { 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 } 177 178 for(event = 0; event < numberOfEvents; ++event) 122 for(event = 0; event < poisson; ++event) 179 123 { 180 124 while(!fPythia->next()); 181 125 182 // --- Pile-up vertex smearing 183 184 fFunction->GetRandom2(dz, dt); 185 186 dt *= c_light*1.0E3; // necessary in order to make t in mm/c 187 dz *= 1.0E3; // necessary in order to make z in mm 188 126 dz = gRandom->Gaus(0.0, fZVertexSpread); 189 127 dphi = gRandom->Uniform(-TMath::Pi(), TMath::Pi()); 190 128 191 vx = 0.0; 192 vy = 0.0; 193 numberOfParticles = fPythia->event.size(); 194 for(i = 1; i < numberOfParticles; ++i) 129 for(i = 1; i < fPythia->event.size(); ++i) 195 130 { 196 131 Pythia8::Particle &particle = fPythia->event[i]; … … 208 143 candidate->PID = pid; 209 144 210 candidate->Status = 1;145 candidate->Status = status; 211 146 212 147 pdgParticle = pdg->GetParticle(pid); … … 219 154 candidate->Momentum.RotateZ(dphi); 220 155 221 x -= fInputBeamSpotX; 222 y -= fInputBeamSpotY; 223 candidate->Position.SetXYZT(x, y, z + dz, t + dt); 156 candidate->Position.SetXYZT(x, y, z + dz, t); 224 157 candidate->Position.RotateZ(dphi); 225 candidate->Position += TLorentzVector(fOutputBeamSpotX, fOutputBeamSpotY, 0.0, 0.0);226 158 227 vx += candidate->Position.X(); 228 vy += candidate->Position.Y(); 229 230 fParticleOutputArray->Add(candidate); 159 fOutputArray->Add(candidate); 231 160 } 232 233 if(numberOfParticles > 0)234 {235 vx /= numberOfParticles;236 vy /= numberOfParticles;237 }238 239 vertex = factory->NewCandidate();240 vertex->Position.SetXYZT(vx, vy, dz, dt);241 vertex->IsPU = 1;242 243 fVertexOutputArray->Add(vertex);244 161 } 245 162 } 246 163 247 164 //------------------------------------------------------------------------------ 165 -
modules/PileUpMergerPythia8.h
r9343566 re33e6db 31 31 32 32 class TObjArray; 33 class DelphesTF2;34 33 35 34 namespace Pythia8 … … 51 50 private: 52 51 53 Int_t fPileUpDistribution;54 52 Double_t fMeanPileUp; 55 56 53 Double_t fZVertexSpread; 57 Double_t fTVertexSpread;58 59 Double_t fInputBeamSpotX;60 Double_t fInputBeamSpotY;61 Double_t fOutputBeamSpotX;62 Double_t fOutputBeamSpotY;63 64 54 Double_t fPTMin; 65 66 DelphesTF2 *fFunction; //!67 55 68 56 Pythia8::Pythia *fPythia; //! … … 72 60 const TObjArray *fInputArray; //! 73 61 74 TObjArray *fParticleOutputArray; //! 75 TObjArray *fVertexOutputArray; //! 62 TObjArray *fOutputArray; //! 76 63 77 64 ClassDef(PileUpMergerPythia8, 1) -
modules/SimpleCalorimeter.cc
r9343566 re33e6db 149 149 150 150 fEnergySignificanceMin = GetDouble("EnergySignificanceMin", 0.0); 151 152 // flag that says if current calo is Ecal of Hcal (will then fill correct values of Eem and Ehad)153 fIsEcal = GetBool("IsEcal", false);154 151 155 152 // switch on or off the dithering of the center of calorimeter towers … … 428 425 fTower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 429 426 430 fTower->Eem = (!fIsEcal) ? 0 : energy;431 fTower->Ehad = (fIsEcal) ? 0 : energy;432 433 427 fTower->Edges[0] = fTowerEdges[0]; 434 428 fTower->Edges[1] = fTowerEdges[1]; … … 453 447 pt = energy / TMath::CosH(eta); 454 448 455 tower->Eem = (!fIsEcal) ? 0 : energy;456 tower->Ehad = (fIsEcal) ? 0 : energy;457 458 449 tower->Momentum.SetPtEtaPhiE(pt, eta, phi, energy); 459 450 fEFlowTowerOutputArray->Add(tower); -
modules/SimpleCalorimeter.h
r9343566 re33e6db 1 2 1 /* 3 2 * Delphes: a framework for fast simulation of a generic collider experiment … … 75 74 Bool_t fSmearTowerCenter; 76 75 77 Bool_t fIsEcal; //!78 79 76 TFractionMap fFractionMap; //! 80 77 TBinMap fBinMap; //! -
modules/TrackPileUpSubtractor.cc
r9343566 re33e6db 74 74 fZVertexResolution = GetDouble("ZVertexResolution", 0.005)*1.0E3; 75 75 76 fPTMin = GetDouble("PTMin", 0.);77 76 // import arrays with output from other modules 78 77 79 78 ExRootConfParam param = GetParam("InputArray"); 80 79 Long_t i, size; … … 148 147 // assume perfect pile-up subtraction for tracks outside fZVertexResolution 149 148 150 if(candidate->IsPU && TMath::Abs(z-zvtx) > fZVertexResolution) candidate->IsRecoPU = 1; 151 else 152 { 153 candidate->IsRecoPU = 0; 154 if( candidate->Momentum.Pt() > fPTMin) array->Add(candidate); 155 } 149 if(candidate->IsPU && TMath::Abs(z-zvtx) > fZVertexResolution) continue; 150 151 array->Add(candidate); 156 152 } 157 153 } -
modules/TrackPileUpSubtractor.h
r9343566 re33e6db 50 50 Double_t fZVertexResolution; 51 51 52 Double_t fPTMin;53 54 52 std::map< TIterator *, TObjArray * > fInputMap; //! 55 53 -
modules/TreeWriter.cc
r9343566 re33e6db 291 291 entry->ZOuter = position.Z(); 292 292 entry->TOuter = position.T()*1.0E-3/c_light; 293 293 294 294 entry->Dxy = candidate->Dxy; 295 295 entry->SDxy = candidate->SDxy ; … … 297 297 entry->Yd = candidate->Yd; 298 298 entry->Zd = candidate->Zd; 299 299 300 300 const TLorentzVector &momentum = candidate->Momentum; 301 301 … … 362 362 363 363 entry->T = position.T()*1.0E-3/c_light; 364 entry->Ntimes = candidate->Ntimes;365 364 366 365 FillParticles(candidate, &entry->Particles); … … 404 403 entry->T = position.T()*1.0E-3/c_light; 405 404 406 // Isolation variables407 408 entry->IsolationVar = candidate->IsolationVar;409 entry->IsolationVarRhoCorr = candidate->IsolationVarRhoCorr ;410 entry->SumPtCharged = candidate->SumPtCharged ;411 entry->SumPtNeutral = candidate->SumPtNeutral ;412 entry->SumPtChargedPU = candidate->SumPtChargedPU ;413 entry->SumPt = candidate->SumPt ;414 415 405 entry->EhadOverEem = candidate->Eem > 0.0 ? candidate->Ehad/candidate->Eem : 999.9; 416 406 … … 452 442 entry->T = position.T()*1.0E-3/c_light; 453 443 454 // Isolation variables455 456 entry->IsolationVar = candidate->IsolationVar;457 entry->IsolationVarRhoCorr = candidate->IsolationVarRhoCorr ;458 entry->SumPtCharged = candidate->SumPtCharged ;459 entry->SumPtNeutral = candidate->SumPtNeutral ;460 entry->SumPtChargedPU = candidate->SumPtChargedPU ;461 entry->SumPt = candidate->SumPt ;462 463 464 444 entry->Charge = candidate->Charge; 465 445 … … 489 469 const TLorentzVector &momentum = candidate->Momentum; 490 470 const TLorentzVector &position = candidate->Position; 471 491 472 492 473 pt = momentum.Pt(); … … 507 488 entry->T = position.T()*1.0E-3/c_light; 508 489 509 // Isolation variables510 511 entry->IsolationVar = candidate->IsolationVar;512 entry->IsolationVarRhoCorr = candidate->IsolationVarRhoCorr ;513 entry->SumPtCharged = candidate->SumPtCharged ;514 entry->SumPtNeutral = candidate->SumPtNeutral ;515 entry->SumPtChargedPU = candidate->SumPtChargedPU ;516 entry->SumPt = candidate->SumPt ;517 518 490 entry->Charge = candidate->Charge; 519 491 … … 532 504 Double_t ecalEnergy, hcalEnergy; 533 505 const Double_t c_light = 2.99792458E8; 534 Int_t i;535 506 536 507 array->Sort(); … … 561 532 entry->Mass = momentum.M(); 562 533 563 entry->Area = candidate->Area;564 565 534 entry->DeltaEta = candidate->DeltaEta; 566 535 entry->DeltaPhi = candidate->DeltaPhi; 567 536 568 entry->Flavor = candidate->Flavor;569 entry->FlavorAlgo = candidate->FlavorAlgo;570 entry->FlavorPhys = candidate->FlavorPhys;571 572 537 entry->BTag = candidate->BTag; 573 574 entry->BTagAlgo = candidate->BTagAlgo;575 entry->BTagPhys = candidate->BTagPhys;576 577 538 entry->TauTag = candidate->TauTag; 578 539 … … 600 561 entry->MeanSqDeltaR = candidate->MeanSqDeltaR; 601 562 entry->PTD = candidate->PTD; 602 603 //--- Sub-structure variables ---- 604 605 entry->NSubJetsTrimmed = candidate->NSubJetsTrimmed; 606 entry->NSubJetsPruned = candidate->NSubJetsPruned; 607 entry->NSubJetsSoftDropped = candidate->NSubJetsSoftDropped; 608 609 for(i = 0; i < 5; i++) 610 { 611 entry->FracPt[i] = candidate -> FracPt[i]; 612 entry->Tau[i] = candidate -> Tau[i]; 613 entry->TrimmedP4[i] = candidate -> TrimmedP4[i]; 614 entry->PrunedP4[i] = candidate -> PrunedP4[i]; 615 entry->SoftDroppedP4[i] = candidate -> SoftDroppedP4[i]; 616 } 617 563 entry->FracPt[0] = candidate->FracPt[0]; 564 entry->FracPt[1] = candidate->FracPt[1]; 565 entry->FracPt[2] = candidate->FracPt[2]; 566 entry->FracPt[3] = candidate->FracPt[3]; 567 entry->FracPt[4] = candidate->FracPt[4]; 568 569 //--- N-subjettiness variables ---- 570 571 entry->Tau1 = candidate->Tau[0]; 572 entry->Tau2 = candidate->Tau[1]; 573 entry->Tau3 = candidate->Tau[2]; 574 entry->Tau4 = candidate->Tau[3]; 575 entry->Tau5 = candidate->Tau[4]; 576 618 577 FillParticles(candidate, &entry->Particles); 619 578 } -
readers/DelphesLHEF.cpp
r9343566 re33e6db 63 63 TStopwatch readStopWatch, procStopWatch; 64 64 ExRootTreeWriter *treeWriter = 0; 65 ExRootTreeBranch *branchEvent = 0, *branch Weight = 0;65 ExRootTreeBranch *branchEvent = 0, *branchRwgt = 0; 66 66 ExRootConfReader *confReader = 0; 67 67 Delphes *modularDelphes = 0; … … 103 103 104 104 branchEvent = treeWriter->NewBranch("Event", LHEFEvent::Class()); 105 branch Weight = treeWriter->NewBranch("Weight", Weight::Class());105 branchRwgt = treeWriter->NewBranch("Rwgt", Weight::Class()); 106 106 107 107 confReader = new ExRootConfReader; … … 196 196 197 197 reader->AnalyzeEvent(branchEvent, eventCounter, &readStopWatch, &procStopWatch); 198 reader->Analyze Weight(branchWeight);198 reader->AnalyzeRwgt(branchRwgt); 199 199 200 200 treeWriter->Fill(); -
readers/DelphesPythia8.cpp
r9343566 re33e6db 20 20 #include <iostream> 21 21 #include <sstream> 22 #include <string>23 22 24 23 #include <signal.h> … … 39 38 #include "classes/DelphesClasses.h" 40 39 #include "classes/DelphesFactory.h" 41 #include "classes/DelphesLHEFReader.h"42 40 43 41 #include "ExRootAnalysis/ExRootTreeWriter.h" … … 151 149 char appName[] = "DelphesPythia8"; 152 150 stringstream message; 153 FILE *inputFile = 0;154 151 TFile *outputFile = 0; 155 152 TStopwatch readStopWatch, procStopWatch; 156 153 ExRootTreeWriter *treeWriter = 0; 157 154 ExRootTreeBranch *branchEvent = 0; 158 ExRootTreeBranch *branchEventLHEF = 0, *branchWeightLHEF = 0;159 155 ExRootConfReader *confReader = 0; 160 156 Delphes *modularDelphes = 0; 161 157 DelphesFactory *factory = 0; 162 158 TObjArray *stableParticleOutputArray = 0, *allParticleOutputArray = 0, *partonOutputArray = 0; 163 TObjArray *stableParticleOutputArrayLHEF = 0, *allParticleOutputArrayLHEF = 0, *partonOutputArrayLHEF = 0;164 DelphesLHEFReader *reader = 0;165 159 Long64_t eventCounter, errorCounter; 166 160 Long64_t numberOfEvents, timesAllowErrors; … … 211 205 partonOutputArray = modularDelphes->ExportArray("partons"); 212 206 213 // Initialize Pythia 207 modularDelphes->InitTask(); 208 209 // Initialize pythia 214 210 pythia = new Pythia8::Pythia; 215 211 … … 225 221 numberOfEvents = pythia->mode("Main:numberOfEvents"); 226 222 timesAllowErrors = pythia->mode("Main:timesAllowErrors"); 227 228 inputFile = fopen(pythia->word("Beams:LHEF").c_str(), "r");229 if(inputFile)230 {231 reader = new DelphesLHEFReader;232 reader->SetInputFile(inputFile);233 234 branchEventLHEF = treeWriter->NewBranch("EventLHEF", LHEFEvent::Class());235 branchWeightLHEF = treeWriter->NewBranch("WeightLHEF", LHEFWeight::Class());236 237 allParticleOutputArrayLHEF = modularDelphes->ExportArray("allParticlesLHEF");238 stableParticleOutputArrayLHEF = modularDelphes->ExportArray("stableParticlesLHEF");239 partonOutputArrayLHEF = modularDelphes->ExportArray("partonsLHEF");240 }241 242 modularDelphes->InitTask();243 223 244 224 pythia->init(); … … 254 234 for(eventCounter = 0; eventCounter < numberOfEvents && !interrupted; ++eventCounter) 255 235 { 256 while(reader && reader->ReadBlock(factory, allParticleOutputArrayLHEF,257 stableParticleOutputArrayLHEF, partonOutputArrayLHEF) && !reader->EventReady());258 259 236 if(!pythia->next()) 260 237 { 261 238 // If failure because reached end of file then exit event loop 262 if (pythia->info.atEndOfFile())239 if (pythia->info.atEndOfFile()) 263 240 { 264 241 cerr << "Aborted since reached end of Les Houches Event File" << endl; … … 267 244 268 245 // First few failures write off as "acceptable" errors, then quit 269 if(++errorCounter > timesAllowErrors) 270 { 271 cerr << "Event generation aborted prematurely, owing to error!" << endl; 272 break; 273 } 274 275 modularDelphes->Clear(); 276 reader->Clear(); 277 continue; 246 if (++errorCounter < timesAllowErrors) continue; 247 cerr << "Event generation aborted prematurely, owing to error!" << endl; 248 break; 278 249 } 279 250 … … 287 258 procStopWatch.Stop(); 288 259 289 if(reader)290 {291 reader->AnalyzeEvent(branchEventLHEF, eventCounter, &readStopWatch, &procStopWatch);292 reader->AnalyzeWeight(branchWeightLHEF);293 }294 295 260 treeWriter->Fill(); 296 261 297 262 treeWriter->Clear(); 298 263 modularDelphes->Clear(); 299 if(reader) reader->Clear();300 264 301 265 readStopWatch.Start(); … … 313 277 cout << "** Exiting..." << endl; 314 278 315 delete reader;316 279 delete pythia; 317 280 delete modularDelphes;
Note:
See TracChangeset
for help on using the changeset viewer.