All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Utilities.h
Go to the documentation of this file.
1 #ifndef UTILITIES_H
2 #define UTILITIES_H
3 
4 // *******************************************************
5 // some useful functions
6 // *******************************************************
7 
8 #include "lcio.h"
9 #include <EVENT/LCCollection.h>
10 #include <EVENT/MCParticle.h>
11 #include <EVENT/ReconstructedParticle.h>
12 #include <IMPL/ReconstructedParticleImpl.h>
13 
14 #include "TROOT.h"
15 #include "TVector3.h"
16 #include "TLorentzVector.h"
17 
18 using namespace lcio ;
19 using namespace std;
20 
21 namespace isolep{
22 
23  Int_t getMCSerial(MCParticle *mcPart, LCCollection *colMCP);
24  //MCParticle* getLinkedMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL, Double_t &weight, Int_t &nMCTL);
25  MCParticle *getMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL);
26  MCParticle *getMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL, Double_t &weight);
27  MCParticle *getMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL, Double_t &weight, Int_t &nMCTL);
28  Int_t getLinkedMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL, Double_t &weight, Int_t &nMCTL);
29  Int_t getOriginalPDG(MCParticle *mcPart, Bool_t iHiggs = 0);
30  Int_t getOriginalPDGForIsoLep(MCParticle *mcPart, LCCollection *colMC);
31  Int_t getOriginalPDGForIsoLep(MCParticle *mcPart);
32  Int_t getOriginalSerial(MCParticle *mcPart, LCCollection *colMCP, Bool_t iHiggs = 0);
33  Int_t getOriginalSerial(ReconstructedParticle *recPart, LCCollection *colMCTL, LCCollection *colMCP, Bool_t iHiggs = 0);
34  Int_t getOriginalSerialForZHH(MCParticle *mcPart, LCCollection *colMCP);
35  Double_t getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone);
36  Double_t getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone, Int_t mode);
37  Double_t getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone,
38  std::vector<lcio::ReconstructedParticle*> &conePFOs);
39  Double_t getInvariantMass(ReconstructedParticle *recPart1, ReconstructedParticle *recPart2);
40  Double_t getInvariantMass(ReconstructedParticle *recPart1, ReconstructedParticle *recPart2, ReconstructedParticle *recPart3);
41 
42  Int_t getLeptonID(ReconstructedParticle *recPart);
43  Bool_t getFSRTag(ReconstructedParticle *motherPart, ReconstructedParticle *recPart, Double_t fCosFSRCut = 0.999);
44  Bool_t getSplitTag(ReconstructedParticle *motherPart, ReconstructedParticle *recPart);
45 //TVector3 getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone, Bool_t woFSR);
46 //void getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone, Bool_t woFSR, TVector3 coneEnergy0);
47  void getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone, Bool_t woFSR, Double_t coneEnergy[3], Double_t pFSR[4]);
48  void getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone, Bool_t woFSR, Double_t coneEnergy[3], Double_t pFSR[4],
49  Double_t conCone2, Double_t pCone2[4], Int_t &nConePhoton);
50  void getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone,
51  Double_t coneEnergy[3], Double_t cosCone2, Double_t pCone2[4]);
52  TLorentzVector getFSRMomentum(ReconstructedParticle *recPart, LCCollection *colPFO);
53  Int_t isSelectedByFastJet( ReconstructedParticle *pfo, LCCollection *colFastJet, Double_t &ratioEPartEJet, Double_t &ratioPTMJet);
54  void doPhotonRecovery(ReconstructedParticle *electron, LCCollection *colPFO, ReconstructedParticleImpl *recoElectron, Double_t fCosFSRCut = 0.999);
55  void doPhotonRecovery(ReconstructedParticle *electron, LCCollection *colPFO, ReconstructedParticleImpl *recoElectron, Double_t fCosFSRCut, Int_t lepType, std::vector<lcio::ReconstructedParticle*> &photons);
56  Bool_t isFoundInVector(ReconstructedParticle *pfo, std::vector<lcio::ReconstructedParticle*> &pfos);
57 
58  Double_t jetFunction( TLorentzVector lortz, float beta, float power);
59  Double_t jetFunction( TLorentzVector lortz, float virtual_scale=20); // GeV
60 
61  Int_t calculateEnergyComponents(LCCollection *colMC, LCCollection *colMCTL, ReconstructedParticle *jet, Double_t energyComponents[4]);
62  Int_t calculateEnergyComponents(LCCollection *colMC, LCCollection *colMCTL, ReconstructedParticle *jet, Double_t energyComponents[4],
63  Int_t iColor1, Int_t iColor2, Int_t iColor3);
64 
65  Double_t getLikelihood(TString fname, TString hist, Double_t mass);
66 
67  void listMCParticles(LCCollection *colMC);
68 
69  Bool_t isOverlay(ReconstructedParticle *pfo, LCCollection *colMCTL);
70 
71  void dumpJetParticles(ReconstructedParticle *jet, LCCollection *colMC, LCCollection *colMCTL);
72 
73  Int_t getVertexComponents(LCCollection *colMC, LCCollection *colMCTL, ReconstructedParticle *vetex, Double_t energyComponents[2], Int_t nparticles[2]);
74 
75  Int_t isVertexFromOverlay( ReconstructedParticle *vertex, LCCollection *colMC, LCCollection *colMCTL);
76 
77  Double_t getJetDistance( ReconstructedParticle *i, ReconstructedParticle *j, TString algorithm, Double_t R);
78 
79  Int_t isFromVertex( ReconstructedParticle *recPart, LCCollection *colVertex);
80 
81  std::vector<Int_t> getHiggsDecayModes(LCCollection *colMC);
82  std::vector<Int_t> getNumberOfOverlayEvents(Double_t fEcm, LCCollection *colMC);
83 
84  void mcDebug(LCCollection *colMC);
85  TLorentzVector getLorentzEcm(Double_t fEcm);
86  TLorentzVector getLorentzEcm(Double_t fEcm,Bool_t isCrossingAngle);
87  Double_t getRecoilMass(TLorentzVector lortzEcm, TLorentzVector lortzZ);
88  Double_t getAcoPlanarity(TLorentzVector lortz1, TLorentzVector lortz2);
89  TLorentzVector getLorentzVector(ReconstructedParticle *pfo);
90  Double_t getCosTheta(ReconstructedParticle *part1, ReconstructedParticle *part2);
91  Double_t getCosTheta(TLorentzVector part1, TLorentzVector part2);
92 
93 }
94 
95 #endif
Int_t getLeptonID(ReconstructedParticle *recPart)
Definition: Utilities.cc:237
Bool_t getSplitTag(ReconstructedParticle *motherPart, ReconstructedParticle *recPart)
Definition: Utilities.cc:308
Int_t getOriginalPDGForIsoLep(MCParticle *mcPart, LCCollection *colMC)
Definition: Utilities.cc:150
void mcDebug(LCCollection *colMC)
Definition: Utilities.cc:1171
Double_t getLikelihood(TString fname, TString hist, Double_t mass)
Definition: Utilities.cc:849
Int_t getOriginalSerialForZHH(MCParticle *mcPart, LCCollection *colMCP)
Definition: Utilities.cc:214
Double_t getCosTheta(ReconstructedParticle *part1, ReconstructedParticle *part2)
Definition: Utilities.cc:1246
Double_t getJetDistance(ReconstructedParticle *i, ReconstructedParticle *j, TString algorithm, Double_t R)
Definition: Utilities.cc:1033
Int_t isVertexFromOverlay(ReconstructedParticle *vertex, LCCollection *colMC, LCCollection *colMCTL)
Definition: Utilities.cc:1022
Int_t calculateEnergyComponents(LCCollection *colMC, LCCollection *colMCTL, ReconstructedParticle *jet, Double_t energyComponents[4])
Definition: Utilities.cc:745
void dumpJetParticles(ReconstructedParticle *jet, LCCollection *colMC, LCCollection *colMCTL)
Definition: Utilities.cc:933
Double_t getConeEnergy(ReconstructedParticle *recPart, LCCollection *colPFO, Double_t cosCone)
Definition: Utilities.cc:361
TLorentzVector getFSRMomentum(ReconstructedParticle *recPart, LCCollection *colPFO)
Definition: Utilities.cc:469
Int_t getLinkedMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL, Double_t &weight, Int_t &nMCTL)
Definition: Utilities.cc:61
std::vector< Int_t > getNumberOfOverlayEvents(Double_t fEcm, LCCollection *colMC)
Definition: Utilities.cc:1130
Double_t getRecoilMass(TLorentzVector lortzEcm, TLorentzVector lortzZ)
Definition: Utilities.cc:1224
Double_t getAcoPlanarity(TLorentzVector lortz1, TLorentzVector lortz2)
Definition: Utilities.cc:1231
void doPhotonRecovery(ReconstructedParticle *electron, LCCollection *colPFO, ReconstructedParticleImpl *recoElectron, Double_t fCosFSRCut=0.999)
Definition: Utilities.cc:645
Int_t getOriginalPDG(MCParticle *mcPart, Bool_t iHiggs=0)
Definition: Utilities.cc:85
Int_t isFromVertex(ReconstructedParticle *recPart, LCCollection *colVertex)
Definition: Utilities.cc:1055
TLorentzVector getLorentzEcm(Double_t fEcm)
Definition: Utilities.cc:1208
Int_t getMCSerial(MCParticle *mcPart, LCCollection *colMCP)
Definition: Utilities.cc:16
Double_t getInvariantMass(ReconstructedParticle *recPart1, ReconstructedParticle *recPart2)
Definition: Utilities.cc:577
TLorentzVector getLorentzVector(ReconstructedParticle *pfo)
Definition: Utilities.cc:1240
MCParticle * getMCParticle(ReconstructedParticle *recPart, LCCollection *colMCTL)
Definition: Utilities.cc:30
Bool_t isOverlay(ReconstructedParticle *pfo, LCCollection *colMCTL)
Definition: Utilities.cc:918
Int_t getVertexComponents(LCCollection *colMC, LCCollection *colMCTL, ReconstructedParticle *vetex, Double_t energyComponents[2], Int_t nparticles[2])
Definition: Utilities.cc:982
std::vector< Int_t > getHiggsDecayModes(LCCollection *colMC)
Definition: Utilities.cc:1073
Int_t getOriginalSerial(MCParticle *mcPart, LCCollection *colMCP, Bool_t iHiggs=0)
Definition: Utilities.cc:179
Bool_t getFSRTag(ReconstructedParticle *motherPart, ReconstructedParticle *recPart, Double_t fCosFSRCut=0.999)
Definition: Utilities.cc:289
Bool_t isFoundInVector(ReconstructedParticle *pfo, std::vector< lcio::ReconstructedParticle * > &pfos)
Definition: Utilities.cc:706
Double_t jetFunction(TLorentzVector lortz, float beta, float power)
Definition: Utilities.cc:715
Int_t isSelectedByFastJet(ReconstructedParticle *pfo, LCCollection *colFastJet, Double_t &ratioEPartEJet, Double_t &ratioPTMJet)
Definition: Utilities.cc:613
void listMCParticles(LCCollection *colMC)
Definition: Utilities.cc:875