12 |
|
#define MITPHYSICS_UTILS_PHOTONTOOLS_H |
13 |
|
|
14 |
|
#include "MitAna/DataTree/interface/Photon.h" |
15 |
+ |
#include "MitAna/DataTree/interface/PhotonCol.h" |
16 |
|
#include "MitAna/DataTree/interface/TrackCol.h" |
17 |
|
#include "MitAna/DataTree/interface/Electron.h" |
18 |
|
#include "MitAna/DataTree/interface/ElectronCol.h" |
21 |
|
#include "MitAna/DataTree/interface/VertexCol.h" |
22 |
|
#include "MitAna/DataTree/interface/BeamSpotCol.h" |
23 |
|
#include "MitAna/DataTree/interface/TriggerObjectCol.h" |
24 |
+ |
#include "MitAna/DataTree/interface/MCParticleCol.h" |
25 |
+ |
#include "MitAna/DataTree/interface/SuperCluster.h" |
26 |
+ |
#include "MitAna/DataTree/interface/SuperClusterCol.h" |
27 |
|
#include "MitCommon/MathTools/interface/MathUtils.h" |
28 |
|
|
29 |
+ |
#include "MitAna/DataTree/interface/PFCandidateCol.h" |
30 |
+ |
|
31 |
+ |
class TRandom3; |
32 |
+ |
|
33 |
|
namespace mithep { |
34 |
|
class PhotonTools { |
35 |
|
public: |
42 |
|
kCat4 //barrel-endcap+endcap-endcap highr9/lowr9 + lowr9-lowr9 |
43 |
|
}; |
44 |
|
|
45 |
+ |
enum DiphotonR9EtaPtCats { |
46 |
+ |
kOctCat0, |
47 |
+ |
kOctCat1, |
48 |
+ |
kOctCat2, |
49 |
+ |
kOctCat3, |
50 |
+ |
kOctCat4, |
51 |
+ |
kOctCat5, |
52 |
+ |
kOctCat6, |
53 |
+ |
kOctCat7 |
54 |
+ |
}; |
55 |
+ |
|
56 |
|
enum DiphotonR9EtaConversionCats { |
57 |
|
kNewCat1 = 0, //barrel-barrel highr9/highr9 |
58 |
|
kNewCat2, //barrel-barrel highr9/lowr9+lowr9/lowr9 one/two conversion |
63 |
|
}; |
64 |
|
|
65 |
|
enum CiCBaseLineCats { |
66 |
< |
kCiCCat1 = 0, |
66 |
> |
kCiCNoCat = 0, |
67 |
> |
kCiCCat1, |
68 |
|
kCiCCat2, |
69 |
|
kCiCCat3, |
70 |
|
kCiCCat4 |
71 |
|
}; |
72 |
+ |
|
73 |
+ |
enum eScaleCats { |
74 |
+ |
kEBlowEtaGoldCenter = 0, |
75 |
+ |
kEBlowEtaGoldGap, |
76 |
+ |
kEBlowEtaBad, |
77 |
+ |
kEBlowEtaBadCenter, |
78 |
+ |
kEBlowEtaBadGap, |
79 |
+ |
kEBhighEtaGold, |
80 |
+ |
kEBhighEtaBad, |
81 |
+ |
kEElowEtaGold, |
82 |
+ |
kEElowEtaBad, |
83 |
+ |
kEEhighEtaGold, |
84 |
+ |
kEEhighEtaBad |
85 |
+ |
}; |
86 |
+ |
|
87 |
+ |
enum ShowerShapeScales { |
88 |
+ |
kNoShowerShapeScaling = 0, |
89 |
+ |
k2011ShowerShape, |
90 |
+ |
k2012ShowerShape |
91 |
+ |
}; |
92 |
+ |
|
93 |
+ |
static eScaleCats EScaleCat(const Photon *p); |
94 |
+ |
static eScaleCats EScaleCatHCP(const Photon *p); |
95 |
+ |
|
96 |
+ |
// Methods for scaling/smearing Photons |
97 |
+ |
static void ScalePhoton(Photon* p, Double_t scale); |
98 |
+ |
static void SmearPhoton(Photon* p, TRandom3* rng, Double_t width, UInt_t iSeed); |
99 |
+ |
static void SmearPhotonError(Photon* p, Double_t width); |
100 |
+ |
static void ScalePhotonR9(Photon *p, Double_t scale); |
101 |
+ |
static void ScalePhotonError(Photon *p, Double_t scale); |
102 |
+ |
|
103 |
+ |
static void ScalePhotonShowerShapes(Photon *p, ShowerShapeScales scale); |
104 |
+ |
|
105 |
+ |
|
106 |
+ |
static Bool_t PassSinglePhotonPresel(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol, const Vertex *vtx, double rho, Bool_t applyElectronVeto = kTRUE, Bool_t invertElectronVeto = kFALSE); |
107 |
+ |
static Bool_t PassSinglePhotonPreselPFISO(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, const PFCandidateCol *fPFCands, Bool_t applyElectronVeto = kTRUE, Bool_t invertElectronVeto = kFALSE); |
108 |
+ |
static Bool_t PassSinglePhotonPreselPFISONoEcal(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, const PFCandidateCol *fPFCands, Bool_t applyElectronVeto = kTRUE, Bool_t invertElectronVeto = kFALSE); |
109 |
+ |
static Bool_t PassSinglePhotonPreselPFISONoEcalNoPFChargedIso(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, const PFCandidateCol *fPFCands, Bool_t applyElectronVeto = kTRUE, Bool_t invertElectronVeto = kFALSE); |
110 |
+ |
static Bool_t PassSinglePhotonPreselPFISO_NoTrigger(const Photon *p,const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *bs, const TrackCol* trackCol,const Vertex *vtx, double rho, const PFCandidateCol *fPFCands, Bool_t applyElectronVeto = kTRUE, Bool_t invertElectronVeto = kFALSE); |
111 |
+ |
static Bool_t PassConversionId(const Photon *p, const DecayParticle *c); |
112 |
+ |
static Bool_t PassElectronVeto(const Photon *p, const ElectronCol *els); |
113 |
+ |
static Double_t ElectronVetoCiC(const Photon *p, const ElectronCol *els); |
114 |
+ |
static Bool_t PassElectronVetoConvRecovery(const Photon *p, const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *v); |
115 |
+ |
static Bool_t PassTriggerMatching(const Photon *p, const TriggerObjectCol *trigobjs); |
116 |
+ |
static const DecayParticle *MatchedConversion(const Photon *p, const DecayParticleCol *conversions, |
117 |
+ |
const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6, |
118 |
+ |
Double_t lxyMin = 2.0, Double_t dRMin = 0.1); |
119 |
+ |
static const DecayParticle *MatchedConversion(const SuperCluster *sc, const DecayParticleCol *conversions, |
120 |
+ |
const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6, |
121 |
+ |
Double_t lxyMin = 2.0, Double_t dRMin = 0.1); |
122 |
+ |
static const DecayParticle *MatchedConversion(const Track *t, const DecayParticleCol *conversions, |
123 |
+ |
const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6, |
124 |
+ |
Double_t lxyMin = 2.0); |
125 |
+ |
static DiphotonR9EtaCats DiphotonR9EtaCat(const Photon *p1, const Photon *p2); |
126 |
+ |
static DiphotonR9EtaPtCats DiphotonR9EtaPtCat(const Photon *p1, const Photon *p2); |
127 |
+ |
static DiphotonR9EtaConversionCats DiphotonR9EtaConversionCat(const Photon *p1, const Photon *p2, const DecayParticleCol *conversions, const BaseVertex *v); |
128 |
+ |
static CiCBaseLineCats CiCBaseLineCat(const Photon *p); |
129 |
+ |
|
130 |
+ |
static const DecayParticle *MatchedCiCConversion(const Photon *p, const DecayParticleCol *conversions, |
131 |
+ |
Double_t dPhiMin=0.1, Double_t dEtaMin=0.1,Double_t dRMin=0.1, |
132 |
+ |
bool print = false, |
133 |
+ |
int* numLegs = NULL, int* convIdx = NULL); // for debugging |
134 |
+ |
|
135 |
+ |
|
136 |
+ |
static const Electron *MatchedElectron(const Photon *p, const ElectronCol *els); |
137 |
+ |
static const Photon *MatchedPhoton(const Electron *e, const PhotonCol *phs); |
138 |
+ |
static const SuperCluster *MatchedSC(const SuperCluster *psc, const SuperClusterCol *scs, Double_t drMin=0.3); |
139 |
+ |
|
140 |
+ |
static const SuperCluster *MatchedPFSC(const SuperCluster *psc, const PhotonCol *pfphos, const ElectronCol *eles, Double_t drMin=0.1); |
141 |
+ |
|
142 |
+ |
static bool PassCiCSelection(const Photon* ph, |
143 |
+ |
const Vertex* vtx, |
144 |
+ |
const TrackCol* trackCol, |
145 |
+ |
const ElectronCol* eleCol, |
146 |
+ |
const VertexCol* vtxCol, |
147 |
+ |
double rho, double ptmin, |
148 |
+ |
bool applyEleVeto = true, |
149 |
+ |
bool print = false, float* kin=NULL); |
150 |
+ |
|
151 |
+ |
static bool PassCiCPFIsoSelection(const Photon* ph, |
152 |
+ |
const Vertex* vtx, |
153 |
+ |
const PFCandidateCol* pfCol, |
154 |
+ |
const VertexCol* vtxCol, |
155 |
+ |
double rho, double ptmin, |
156 |
+ |
std::vector<double>* kin = NULL); |
157 |
+ |
|
158 |
+ |
static bool PassCiCPFIsoSelectionWithEleVeto(const Photon* ph, |
159 |
+ |
const ElectronCol *els, |
160 |
+ |
const DecayParticleCol *conversions, const BaseVertex *bs, |
161 |
+ |
const Vertex* vtx, |
162 |
+ |
const PFCandidateCol* pfCol, |
163 |
+ |
const VertexCol* vtxCol, |
164 |
+ |
double rho, double ptmin, |
165 |
+ |
Bool_t applyElectronVeto, Bool_t invertElectronVeto, |
166 |
+ |
std::vector<double>* kin= NULL // store variables for debugging... |
167 |
+ |
);// add for mono photon |
168 |
+ |
|
169 |
+ |
static bool PassVgamma2011Selection(const Photon* ph, double rho); |
170 |
|
|
171 |
< |
static Bool_t PassConversionId(const Photon *p, const DecayParticle *c); |
54 |
< |
static Bool_t PassElectronVeto(const Photon *p, const ElectronCol *els); |
55 |
< |
static Double_t ElectronVetoCiC(const Photon *p, const ElectronCol *els); |
56 |
< |
static Bool_t PassElectronVetoConvRecovery(const Photon *p, const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *v); |
57 |
< |
static Bool_t PassTriggerMatching(const Photon *p, const TriggerObjectCol *trigobjs); |
58 |
< |
static const DecayParticle *MatchedConversion(const Photon *p, const DecayParticleCol *conversions, |
59 |
< |
const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6, |
60 |
< |
Double_t lxyMin = 2.0, Double_t dRMin = 0.1); |
61 |
< |
static const DecayParticle *MatchedConversion(const Track *t, const DecayParticleCol *conversions, |
62 |
< |
const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6, |
63 |
< |
Double_t lxyMin = 2.0); |
64 |
< |
static DiphotonR9EtaCats DiphotonR9EtaCat(const Photon *p1, const Photon *p2); |
65 |
< |
static DiphotonR9EtaConversionCats DiphotonR9EtaConversionCat(const Photon *p1, const Photon *p2, const DecayParticleCol *conversions, const BaseVertex *v); |
66 |
< |
static CiCBaseLineCats CiCBaseLineCat(const Photon *p); |
67 |
< |
|
68 |
< |
static const DecayParticle *MatchedCiCConversion(const Photon *p, const DecayParticleCol *conversions, |
69 |
< |
Double_t dPhiMin=0.1, Double_t dEtaMin=0.1,Double_t dRMin=0.1, |
70 |
< |
bool print = false); |
71 |
< |
|
72 |
< |
static bool PassCiCSelection(Photon* ph, |
73 |
< |
const Vertex* vtx, |
74 |
< |
const TrackCol* trackCol, |
75 |
< |
const ElectronCol* eleCol, |
76 |
< |
const VertexCol* vtxCol, |
77 |
< |
double rho, double ptmin, |
78 |
< |
bool print = false, float* kin=NULL); |
79 |
< |
|
171 |
> |
static const MCParticle *MatchMC(const Particle *ph, const MCParticleCol *c, Bool_t matchElectrons = kFALSE); |
172 |
|
ClassDef(PhotonTools, 0) // Muon tools |
173 |
< |
}; |
173 |
> |
}; |
174 |
|
} |
175 |
|
|
176 |
|
#endif |