ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Photon.h
Revision: 1.38
Committed: Wed Aug 3 17:14:41 2011 UTC (13 years, 9 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_024b, Mit_024a, Mit_024
Changes since 1.37: +8 -2 lines
Log Message:
add pv reference to photon class

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.38 // $Id: Photon.h,v 1.37 2011/05/27 14:15:45 bendavid Exp $
3 loizides 1.1 //
4     // Photon
5     //
6 loizides 1.24 // This class holds the reconstructed photon quantities.
7 loizides 1.1 //
8 loizides 1.2 // Authors: J.Bendavid, C.Loizides
9 loizides 1.1 //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.12 #ifndef MITANA_DATATREE_PHOTON_H
12     #define MITANA_DATATREE_PHOTON_H
13 loizides 1.1
14 loizides 1.24 #include "MitCommon/DataFormats/interface/Vect4M.h"
15 bendavid 1.3 #include "MitAna/DataTree/interface/Particle.h"
16     #include "MitAna/DataTree/interface/Conversion.h"
17 bendavid 1.38 #include "MitAna/DataTree/interface/Vertex.h"
18 loizides 1.11 #include "MitAna/DataCont/interface/RefArray.h"
19 loizides 1.1
20     namespace mithep
21     {
22 bendavid 1.3 class Photon : public Particle
23 loizides 1.1 {
24     public:
25 loizides 1.29 Photon() :
26 bendavid 1.33 fR9(0),fHadOverEm(0),fHcalDepth1OverEcal(0),
27     fHcalDepth2OverEcal(0), fMaxEnergyXtal(0), fE15(0), fE25(0), fE33(0),
28     fE55(0), fCovEtaEta(0), fCoviEtaiEta(0),
29     fEcalRecHitIso(0),fHcalRecHitIso(0), fHcalTowerSumEtDr04(0),
30 loizides 1.29 fHcalDepth1TowerSumEtDr04(0), fHcalDepth2TowerSumEtDr04(0), fSolidConeTrkIso(0),
31     fHollowConeTrkIso(0),fSolidConeNTrk(0),fHollowConeNTrk(0), fEcalRecHitIsoDr03(0),
32     fHcalTowerSumEtDr03(0), fHcalDepth1TowerSumEtDr03(0), fHcalDepth2TowerSumEtDr03(0),
33     fSolidConeTrkIsoDr03(0), fHollowConeTrkIsoDr03(0),fSolidConeNTrkDr03(0),
34 bendavid 1.36 fHollowConeNTrkDr03(0), fPFChargedHadronIso(0), fPFNeutralHadronIso(0), fPFPhotonIso(0),
35     fHasPixelSeed(0), fIsEB(0), fIsEE(0), fIsEBGap(0),
36 loizides 1.29 fIsEEGap(0),fIsEBEEGap(0), fIsLooseEM(0),fIsLoosePhoton(0), fIsTightPhoton(0),
37     fIsConverted(0) {}
38 loizides 1.21 Photon(Double_t px, Double_t py, Double_t pz, Double_t e) :
39 loizides 1.24 fMom(FourVector(px,py,pz,e)),
40 bendavid 1.33 fR9(0),fHadOverEm(0),fHcalDepth1OverEcal(0),
41     fHcalDepth2OverEcal(0), fMaxEnergyXtal(0), fE15(0), fE25(0), fE33(0),
42     fE55(0), fCovEtaEta(0), fCoviEtaiEta(0),
43     fEcalRecHitIso(0),fHcalRecHitIso(0), fHcalTowerSumEtDr04(0),
44 bendavid 1.25 fHcalDepth1TowerSumEtDr04(0), fHcalDepth2TowerSumEtDr04(0), fSolidConeTrkIso(0),
45     fHollowConeTrkIso(0),fSolidConeNTrk(0),fHollowConeNTrk(0), fEcalRecHitIsoDr03(0),
46     fHcalTowerSumEtDr03(0), fHcalDepth1TowerSumEtDr03(0), fHcalDepth2TowerSumEtDr03(0),
47     fSolidConeTrkIsoDr03(0), fHollowConeTrkIsoDr03(0),fSolidConeNTrkDr03(0),
48 bendavid 1.36 fHollowConeNTrkDr03(0), fPFChargedHadronIso(0), fPFNeutralHadronIso(0), fPFPhotonIso(0),
49     fHasPixelSeed(0), fIsEB(0), fIsEE(0), fIsEBGap(0),
50 bendavid 1.26 fIsEEGap(0),fIsEBEEGap(0), fIsLooseEM(0),fIsLoosePhoton(0), fIsTightPhoton(0),
51     fIsConverted(0) {}
52 loizides 1.2
53 loizides 1.29 const Conversion *ConvCand(UInt_t i) const { return fConversions.At(i); }
54     Double_t EcalRecHitIsoDr03() const { return fEcalRecHitIsoDr03; }
55     Double_t EcalRecHitIsoDr04() const { return fEcalRecHitIso; }
56     Double_t HadOverEm() const { return fHadOverEm; }
57 bendavid 1.33 Double_t HcalDepth1OverEcal() const { return fHcalDepth1OverEcal; }
58     Double_t HcalDepth2OverEcal() const { return fHcalDepth2OverEcal; }
59     Double_t MaxEnergyXtal() const { return fMaxEnergyXtal; }
60     Double_t E15() const { return fE15; }
61     Double_t E25() const { return fE25; }
62     Double_t E33() const { return fE33; }
63     Double_t E55() const { return fE55; }
64 bendavid 1.37 ThreeVectorC CaloPos() const;
65 bendavid 1.33 Double_t CovEtaEta() const { return fCovEtaEta; }
66     Double_t CoviEtaiEta() const { return fCoviEtaiEta; }
67 loizides 1.29 Bool_t HasPixelSeed() const { return fHasPixelSeed; }
68     Double_t HcalDepth1TowerSumEtDr03() const { return fHcalDepth1TowerSumEtDr03; }
69     Double_t HcalDepth1TowerSumEtDr04() const { return fHcalDepth1TowerSumEtDr04; }
70     Double_t HcalDepth2TowerSumEtDr03() const { return fHcalDepth2TowerSumEtDr03; }
71 bendavid 1.32 Double_t HcalDepth2TowerSumEtDr04() const { return fHcalDepth2TowerSumEtDr04; }
72 ceballos 1.31 Double_t HcalRecHitIso() const { return fHcalRecHitIso; } // *DEPRECATED*
73 loizides 1.29 Double_t HcalTowerSumEtDr03() const { return fHcalTowerSumEtDr03; }
74 bendavid 1.32 Double_t HcalTowerSumEtDr04() const { return fHcalTowerSumEtDr04; }
75 loizides 1.29 UShort_t HollowConeNTrkDr03() const { return fHollowConeNTrkDr03; }
76     UShort_t HollowConeNTrkDr04() const { return fHollowConeNTrk; }
77     Double_t HollowConeTrkIsoDr03() const { return fHollowConeTrkIsoDr03; }
78     Double_t HollowConeTrkIsoDr04() const { return fHollowConeTrkIso; }
79 bendavid 1.36 Double_t PFChargedHadronIso() const { return fPFChargedHadronIso; }
80     Double_t PFNeutralHadronIso() const { return fPFNeutralHadronIso; }
81     Double_t PFPhotonIso() const { return fPFPhotonIso; }
82 loizides 1.29 Bool_t IsEB() const { return fIsEB; }
83     Bool_t IsEE() const { return fIsEE; }
84     Bool_t IsEBGap() const { return fIsEBGap; }
85     Bool_t IsEEGap() const { return fIsEEGap; }
86     Bool_t IsEBEEGap() const { return fIsEBEEGap; }
87 ceballos 1.31 Bool_t IsLooseEM() const { return fIsLooseEM; } // *DEPRECATED*
88 loizides 1.29 Bool_t IsLoosePhoton() const { return fIsLoosePhoton; }
89     Bool_t IsTightPhoton() const { return fIsTightPhoton; }
90     Bool_t IsConverted() const { return fIsConverted; }
91 bendavid 1.34 ThreeVector Mom3(const ThreeVector &vtx) const { return E()*(ThreeVector(CaloPos()) - vtx).Unit(); }
92 bendavid 1.35 FourVectorM MomVtx(const ThreeVector &vtx) const;
93 loizides 1.29 UInt_t NConversions() const { return fConversions.Entries(); }
94     EObjType ObjType() const { return kPhoton; }
95     Double_t R9() const { return fR9; }
96     const SuperCluster *SCluster() const { return fSuperClusterRef.Obj(); }
97     Double_t SolidConeTrkIsoDr03() const { return fSolidConeTrkIsoDr03; }
98     Double_t SolidConeTrkIsoDr04() const { return fSolidConeTrkIso; }
99     UShort_t SolidConeNTrkDr03() const { return fSolidConeNTrkDr03; }
100     UShort_t SolidConeNTrkDr04() const { return fSolidConeNTrk; }
101     void AddConversion(const Conversion *c) { fConversions.Add(c); }
102     void SetIsConverted(Bool_t isConv) { fIsConverted = isConv; }
103     void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
104     void SetSuperCluster(const SuperCluster* sc) { fSuperClusterRef = sc; }
105     void SetR9(Double_t x) { fR9 = x; }
106     void SetHadOverEm(Double_t x) { fHadOverEm = x; }
107 bendavid 1.33 void SetHcalDepth1OverEcal(Double_t x) { fHcalDepth1OverEcal = x; }
108     void SetHcalDepth2OverEcal(Double_t x) { fHcalDepth2OverEcal = x; }
109     void SetMaxEnergyXtal(Double_t x) { fMaxEnergyXtal = x; }
110     void SetE15(Double_t x) { fE15 = x; }
111     void SetE25(Double_t x) { fE25 = x; }
112     void SetE33(Double_t x) { fE33 = x; }
113     void SetE55(Double_t x) { fE55 = x; }
114     void SetCovEtaEta(Double_t CovEtaEta) { fCovEtaEta = CovEtaEta; }
115     void SetCoviEtaiEta(Double_t CoviEtaiEta) { fCoviEtaiEta = CoviEtaiEta; }
116 loizides 1.29 void SetHasPixelSeed(Bool_t x) { fHasPixelSeed = x; }
117     void SetEcalRecHitIsoDr04(Double_t x) { fEcalRecHitIso = x; }
118     void SetHcalTowerSumEtDr04(Double_t x) { fHcalTowerSumEtDr04 = x; }
119     void SetHcalDepth1TowerSumEtDr04(Double_t x) { fHcalDepth1TowerSumEtDr04 = x; }
120     void SetHcalDepth2TowerSumEtDr04(Double_t x) { fHcalDepth2TowerSumEtDr04 = x; }
121     void SetSolidConeTrkIsoDr04(Double_t x) { fSolidConeTrkIso = x; }
122     void SetHollowConeTrkIsoDr04(Double_t x) { fHollowConeTrkIso = x; }
123     void SetSolidConeNTrkDr04(UShort_t x) { fSolidConeNTrk = x; }
124     void SetHollowConeNTrkDr04(UShort_t x) { fHollowConeNTrk = x; }
125     void SetEcalRecHitIsoDr03(Double_t x) { fEcalRecHitIsoDr03 = x; }
126     void SetHcalTowerSumEtDr03(Double_t x) { fHcalTowerSumEtDr03 = x; }
127     void SetHcalDepth1TowerSumEtDr03(Double_t x) { fHcalDepth1TowerSumEtDr03 = x; }
128     void SetHcalDepth2TowerSumEtDr03(Double_t x) { fHcalDepth2TowerSumEtDr03 = x; }
129     void SetSolidConeTrkIsoDr03(Double_t x) { fSolidConeTrkIsoDr03 = x; }
130     void SetHollowConeTrkIsoDr03(Double_t x) { fHollowConeTrkIsoDr03 = x; }
131     void SetSolidConeNTrkDr03(UShort_t x) { fSolidConeNTrkDr03 = x; }
132     void SetHollowConeNTrkDr03(UShort_t x) { fHollowConeNTrkDr03 = x; }
133 bendavid 1.36 void SetPFChargedHadronIso(Double_t x) { fPFChargedHadronIso = x; }
134     void SetPFNeutralHadronIso(Double_t x) { fPFNeutralHadronIso = x; }
135     void SetPFPhotonIso(Double_t x) { fPFPhotonIso = x; }
136 loizides 1.29 void SetIsEB(Bool_t x) { fIsEB = x; }
137     void SetIsEE(Bool_t x) { fIsEE = x; }
138     void SetIsEBGap(Bool_t x) { fIsEBGap = x; }
139     void SetIsEEGap(Bool_t x) { fIsEEGap = x; }
140     void SetIsEBEEGap(Bool_t x) { fIsEBEEGap = x; }
141     void SetIsLooseEM(Bool_t x) { fIsLooseEM = x; }
142     void SetIsLoosePhoton(Bool_t x) { fIsLoosePhoton = x; }
143     void SetIsTightPhoton(Bool_t x) { fIsTightPhoton = x; }
144 bendavid 1.34 void SetCaloPosXYZ(Double_t x, Double_t y, Double_t z) { fCaloPos.SetXYZ(x,y,z); }
145 bendavid 1.38 void SetPV(const Vertex *v) { fPVRef = v; }
146     Bool_t HasPV() const { return fPVRef.IsValid(); }
147     const Vertex *PV() const { return fPVRef.Obj(); }
148    
149 bendavid 1.34
150 sixie 1.16
151 loizides 1.1 protected:
152 loizides 1.29 void GetMom() const;
153 loizides 1.21
154 loizides 1.29 Vect4M fMom; //four momentum vector
155 bendavid 1.34 Vect3C fCaloPos; //shower position
156 loizides 1.29 Double32_t fR9; //[0,0,14]r9=e3x3/etotal variable
157     Double32_t fHadOverEm; //[0,0,14]hadronic over em fraction
158 bendavid 1.33 Double32_t fHcalDepth1OverEcal; //[0,0,14]hadronic over em fraction depth1
159     Double32_t fHcalDepth2OverEcal; //[0,0,14]hadronic over em fraction depth2
160     Double32_t fMaxEnergyXtal; //[0,0,14]maximum single crystal energy
161     Double32_t fE15; //[0,0,14]1x5 crystal energy
162     Double32_t fE25; //[0,0,14]2x5 crystal energy
163     Double32_t fE33; //[0,0,14]3x3 crystal energy
164     Double32_t fE55; //[0,0,14]5x5 crystal energy
165     Double32_t fCovEtaEta; //[0,0,14]variance eta-eta
166     Double32_t fCoviEtaiEta; //[0,0,14]covariance eta-eta (in crystals)
167 loizides 1.29 Double32_t fEcalRecHitIso; //[0,0,14]ecal rechit based isolation dR 0.4 *RENAMING*
168     Double32_t fHcalRecHitIso; //[0,0,14]hcal rechit based isolation dR 0.4 - *DEPRECATED*
169     Double32_t fHcalTowerSumEtDr04; //[0,0,14]hcal tower based isolation dR 0.4
170     Double32_t fHcalDepth1TowerSumEtDr04; //[0,0,14]hcal depth1 tower based isolation dR 0.4
171     Double32_t fHcalDepth2TowerSumEtDr04; //[0,0,14]hcal depth2 tower based isolation dR 0.4
172     Double32_t fSolidConeTrkIso; //[0,0,14]sum track pT in cone of dR 0.4 *RENAMING*
173     Double32_t fHollowConeTrkIso; //[0,0,14]as above excluding the core, dR 0.4 *RENAMING*
174     UShort_t fSolidConeNTrk; //number of tracks in a cone of dR 0.4 *RENAMING*
175     UShort_t fHollowConeNTrk; //as above excluding the core, dR 0.4 *RENAMING*
176     Double32_t fEcalRecHitIsoDr03; //[0,0,14]ecal rechit based isolation dR 0.3
177     Double32_t fHcalTowerSumEtDr03; //[0,0,14] hcal tower based isolation dR 0.3
178     Double32_t fHcalDepth1TowerSumEtDr03; //[0,0,14]hcal depth1 tower based isolation dR 0.3
179     Double32_t fHcalDepth2TowerSumEtDr03; //[0,0,14]hcal depth2 tower based isolation dR 0.3
180     Double32_t fSolidConeTrkIsoDr03; //[0,0,14]sum track pT in cone of dR 0.3
181     Double32_t fHollowConeTrkIsoDr03; //[0,0,14]as above excluding the core, dR 0.3
182     UShort_t fSolidConeNTrkDr03; //number of tracks in a cone of dR 0.3
183     UShort_t fHollowConeNTrkDr03; //as above excluding the core, dR 0.3
184 bendavid 1.36 Double32_t fPFChargedHadronIso; //[0,0,14]pf isolation, charged hadrons
185     Double32_t fPFNeutralHadronIso; //[0,0,14]pf isolation, neutral hadrons
186     Double32_t fPFPhotonIso; //[0,0,14]pf isolation, photons
187 loizides 1.29 Bool_t fHasPixelSeed; //=true if super cluster has matched seed
188     Bool_t fIsEB; //=true if photon is ECal barrel
189     Bool_t fIsEE; //=true if photon is ECAL endcap
190     Bool_t fIsEBGap; //=true photon is in ECAL barrel crystal gap
191     Bool_t fIsEEGap; //=true photon is in ECAL endcap crystal gap
192     Bool_t fIsEBEEGap; //=true photon is in boundary between EB/EE
193     Bool_t fIsLooseEM; //=true if loose em cuts are passed *DEPRECATED*
194     // LooseEM corresponds to supercluster preselection in 3_1_X
195     //so this variable is now always true for photon objects
196     Bool_t fIsLoosePhoton; //=true if loose photon cuts are passed
197     Bool_t fIsTightPhoton; //=true if tight photon cuts are passed
198     Bool_t fIsConverted; //=true if photon converted
199     RefArray<Conversion> fConversions; //refs to associated conversion candidates
200     Ref<SuperCluster> fSuperClusterRef; //ref to associated super cluster
201 bendavid 1.38 Ref<Vertex> fPVRef; //ref to associated primary vertex
202 loizides 1.1
203 bendavid 1.38 ClassDef(Photon,6) // Photon class
204 loizides 1.1 };
205     }
206 loizides 1.2
207     //--------------------------------------------------------------------------------------------------
208 bendavid 1.37 inline mithep::ThreeVectorC mithep::Photon::CaloPos() const
209     {
210     // Get caloposition
211     mithep::ThreeVectorC calopos = fCaloPos.V();
212     if (calopos.Rho()>1.0) {
213     return calopos;
214     }
215     else {
216     return SCluster()->Point();
217     }
218    
219     }
220    
221     //--------------------------------------------------------------------------------------------------
222 loizides 1.21 inline void mithep::Photon::GetMom() const
223     {
224     // Get momentum values from stored values.
225    
226 loizides 1.24 fCachedMom.SetCoordinates(fMom.Pt(),fMom.Eta(),fMom.Phi(),fMom.M());
227 loizides 1.21 }
228    
229     //--------------------------------------------------------------------------------------------------
230 loizides 1.2 inline void mithep::Photon::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
231     {
232 loizides 1.21 // Set momentum vector.
233 loizides 1.2
234 loizides 1.21 fMom.SetXYZT(px, py, pz, e);
235 bendavid 1.22 ClearMom();
236 loizides 1.2 }
237 bendavid 1.34
238     //--------------------------------------------------------------------------------------------------
239 bendavid 1.35 inline mithep::FourVectorM mithep::Photon::MomVtx(const ThreeVector &vtx) const
240 bendavid 1.34 {
241     // Get momentum values from stored values.
242     ThreeVector momv = Mom3(vtx);
243     FourVectorM newmom;
244    
245     newmom.SetCoordinates(momv.Rho(),momv.Eta(),momv.Phi(),0.);
246    
247     return newmom;
248     }
249    
250 loizides 1.1 #endif