ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Photon.h
Revision: 1.37
Committed: Fri May 27 14:15:45 2011 UTC (13 years, 11 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_023, Mit_022a, Mit_022
Changes since 1.36: +16 -2 lines
Log Message:
backwards compatibility for old samples

File Contents

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