ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/PhotonTools.h
Revision: 1.21
Committed: Wed Jun 6 14:42:32 2012 UTC (12 years, 10 months ago) by fabstoec
Content type: text/plain
Branch: MAIN
Changes since 1.20: +5 -4 lines
Log Message:
updated CiC4 PF

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id $
3 //
4 // PhotonTools
5 //
6 // Helper Class for photon Identification decisions.
7 //
8 // Authors: J.Bendavid
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITPHYSICS_UTILS_PHOTONTOOLS_H
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"
19 #include "MitAna/DataTree/interface/BaseVertex.h"
20 #include "MitAna/DataTree/interface/DecayParticleCol.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:
36 PhotonTools();
37
38 enum DiphotonR9EtaCats {
39 kCat1 = 0, //barrel-barrel highr9/highr9
40 kCat2, //barrel-barrel highr9/lowr9+lowr9/lowr9
41 kCat3, //barrel-endcap+endcap/endcap highr9/highr9
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
59 kNewCat3, //barrel-barrel highr9/lowr9+lowr9/lowr9 no conversion
60 kNewCat4, //barrel-endcap+endcap/endcap highr9/highr9
61 kNewCat5, //barrel-endcap+endcap-endcap highr9/lowr9 + lowr9-lowr9 one/two conversion
62 kNewCat6 //barrel-endcap+endcap-endcap highr9/lowr9 + lowr9-lowr9 no conversion
63 };
64
65 enum CiCBaseLineCats {
66 kCiCNoCat = 0,
67 kCiCCat1,
68 kCiCCat2,
69 kCiCCat3,
70 kCiCCat4
71 };
72
73 enum eScaleCats {
74 kEBlowEtaGoldCenter = 0,
75 kEBlowEtaGoldGap,
76 kEBlowEtaBad,
77 kEBhighEtaGold,
78 kEBhighEtaBad,
79 kEElowEtaGold,
80 kEElowEtaBad,
81 kEEhighEtaGold,
82 kEEhighEtaBad
83 };
84
85
86 static eScaleCats EScaleCat(const Photon *p);
87
88 // Methods for scaling/smearing Photons
89 static void ScalePhoton(Photon* p, Double_t scale);
90 static void SmearPhoton(Photon* p, TRandom3* rng, Double_t width, UInt_t iSeed);
91 static void SmearPhotonError(Photon* p, Double_t width);
92 static void ScalePhotonR9(Photon *p, Double_t scale);
93 static void ScalePhotonError(Photon *p, Double_t scale);
94
95 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);
96 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);
97 static Bool_t PassConversionId(const Photon *p, const DecayParticle *c);
98 static Bool_t PassElectronVeto(const Photon *p, const ElectronCol *els);
99 static Double_t ElectronVetoCiC(const Photon *p, const ElectronCol *els);
100 static Bool_t PassElectronVetoConvRecovery(const Photon *p, const ElectronCol *els, const DecayParticleCol *conversions, const BaseVertex *v);
101 static Bool_t PassTriggerMatching(const Photon *p, const TriggerObjectCol *trigobjs);
102 static const DecayParticle *MatchedConversion(const Photon *p, const DecayParticleCol *conversions,
103 const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6,
104 Double_t lxyMin = 2.0, Double_t dRMin = 0.1);
105 static const DecayParticle *MatchedConversion(const SuperCluster *sc, const DecayParticleCol *conversions,
106 const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6,
107 Double_t lxyMin = 2.0, Double_t dRMin = 0.1);
108 static const DecayParticle *MatchedConversion(const Track *t, const DecayParticleCol *conversions,
109 const BaseVertex *vtx, Int_t nWrongHitsMax=1, Double_t probMin=1e-6,
110 Double_t lxyMin = 2.0);
111 static DiphotonR9EtaCats DiphotonR9EtaCat(const Photon *p1, const Photon *p2);
112 static DiphotonR9EtaPtCats DiphotonR9EtaPtCat(const Photon *p1, const Photon *p2);
113 static DiphotonR9EtaConversionCats DiphotonR9EtaConversionCat(const Photon *p1, const Photon *p2, const DecayParticleCol *conversions, const BaseVertex *v);
114 static CiCBaseLineCats CiCBaseLineCat(const Photon *p);
115
116 static const DecayParticle *MatchedCiCConversion(const Photon *p, const DecayParticleCol *conversions,
117 Double_t dPhiMin=0.1, Double_t dEtaMin=0.1,Double_t dRMin=0.1,
118 bool print = false);
119
120
121 static const Electron *MatchedElectron(const Photon *p, const ElectronCol *els);
122 static const Photon *MatchedPhoton(const Electron *e, const PhotonCol *phs);
123 static const SuperCluster *MatchedSC(const SuperCluster *psc, const SuperClusterCol *scs, Double_t drMin=0.3);
124
125 static const SuperCluster *MatchedPFSC(const SuperCluster *psc, const PhotonCol *pfphos, const ElectronCol *eles, Double_t drMin=0.1);
126
127 static bool PassCiCSelection(const Photon* ph,
128 const Vertex* vtx,
129 const TrackCol* trackCol,
130 const ElectronCol* eleCol,
131 const VertexCol* vtxCol,
132 double rho, double ptmin,
133 bool applyEleVeto = true,
134 bool print = false, float* kin=NULL);
135
136 static bool PassCiCPFIsoSelection(const Photon* ph,
137 const Vertex* vtx,
138 const PFCandidateCol* pfCol,
139 const VertexCol* vtxCol,
140 double rho, double ptmin,
141 std::vector<double>* kin = NULL);
142
143 static const MCParticle *MatchMC(const Particle *ph, const MCParticleCol *c, Bool_t matchElectrons = kFALSE);
144 ClassDef(PhotonTools, 0) // Muon tools
145 };
146 }
147
148 #endif