ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Photon.h
Revision: 1.21
Committed: Wed Feb 18 15:38:54 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.20: +35 -23 lines
Log Message:
Reworked particle interface to cache FourVectorM

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.21 // $Id: Photon.h,v 1.20 2009/02/17 15:09:45 bendavid Exp $
3 loizides 1.1 //
4     // Photon
5     //
6 loizides 1.19 // Details to be worked out...(TODO)
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.4 #include "MitAna/DataTree/interface/Types.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.21 Photon() : fR9(0),fR19(0),fE5x5(0),fHadOverEm(0),fHasPixelSeed(0),fEcalRecHitIso(0),
25     fHcalRecHitIso(0),fSolidConeTrkIso(0),fHollowConeTrkIso(0),fSolidConeNTrk(0),
26     fHollowConeNTrk(0),fIsEBGap(0),fIsEEGap(0),fIsEBEEGap(0),fIsLooseEM(0),
27     fIsLoosePhoton(0),fIsTightPhoton(0),fIsConverted(0) {}
28     Photon(Double_t px, Double_t py, Double_t pz, Double_t e) :
29     fMom(FourVector(px,py,pz,e)), fR9(0),fR19(0),fE5x5(0),fHadOverEm(0),fHasPixelSeed(0),
30     fEcalRecHitIso(0),fHcalRecHitIso(0),fSolidConeTrkIso(0),fHollowConeTrkIso(0),
31     fSolidConeNTrk(0),fHollowConeNTrk(0),fIsEBGap(0),fIsEEGap(0),fIsEBEEGap(0),fIsLooseEM(0),
32     fIsLoosePhoton(0),fIsTightPhoton(0),fIsConverted(0) {}
33 loizides 1.2
34 loizides 1.19 const Conversion *ConvCand(UInt_t i) const { return fConversions.At(i); }
35 sixie 1.16 Double_t E5x5() const { return fE5x5; }
36 loizides 1.19 Double_t EcalRecHitIso() const { return fEcalRecHitIso; }
37 sixie 1.16 Double_t HadOverEm() const { return fHadOverEm; }
38     Double_t HasPixelSeed() const { return fHasPixelSeed; }
39     Double_t HcalRecHitIso() const { return fHcalRecHitIso; }
40 loizides 1.19 Int_t HollowConeNTrk() const { return fHollowConeNTrk; }
41 sixie 1.16 Double_t HollowConeTrkIso() const { return fHollowConeTrkIso; }
42     Bool_t IsEBGap() const { return fIsEBGap; }
43     Bool_t IsEEGap() const { return fIsEEGap; }
44     Bool_t IsEBEEGap() const { return fIsEBEEGap; }
45     Bool_t IsLooseEM() const { return fIsLooseEM; }
46     Bool_t IsLoosePhoton() const { return fIsLoosePhoton; }
47     Bool_t IsTightPhoton() const { return fIsTightPhoton; }
48     Bool_t IsConverted() const { return fIsConverted; }
49 loizides 1.21 UInt_t NConversions() const { return fConversions.Entries(); }
50     EObjType ObjType() const { return kPhoton; }
51     Double_t R9() const { return fR9; }
52     Double_t R19() const { return fR19; }
53     const SuperCluster *SCluster() const { return fSuperClusterRef.Obj(); }
54     Double_t SolidConeTrkIso() const { return fSolidConeTrkIso; }
55     Int_t SolidConeNTrk() const { return fSolidConeNTrk; }
56     void AddConversion(const Conversion *c) { fConversions.Add(c); }
57     void SetIsConverted(Bool_t isConv) { fIsConverted = isConv; }
58 loizides 1.2 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e);
59 bendavid 1.20 void SetSuperCluster(const SuperCluster* sc) { fSuperClusterRef = sc; }
60 sixie 1.16 void SetR9(Double_t x) { fR9 = x; }
61     void SetR19(Double_t x) { fR19 = x; }
62     void SetE5x5(Double_t x) { fE5x5 = x; }
63     void SetHadOverEm(Double_t x) { fHadOverEm = x; }
64     void SetHasPixelSeed(Double_t x) { fHasPixelSeed = x; }
65     void SetEcalRecHitIso(Double_t x) { fEcalRecHitIso = x; }
66     void SetHcalRecHitIso(Double_t x) { fHcalRecHitIso = x; }
67     void SetSolidConeTrkIso(Double_t x) { fSolidConeTrkIso = x; }
68     void SetHollowConeTrkIso(Double_t x) { fHollowConeTrkIso = x; }
69     void SetSolidConeNTrk(Int_t x) { fSolidConeNTrk = x; }
70     void SetHollowConeNTrk(Int_t x) { fHollowConeNTrk = x; }
71     void SetIsEBGap(Bool_t x) { fIsEBGap = x; }
72     void SetIsEEGap(Bool_t x) { fIsEEGap = x; }
73     void SetIsEBEEGap(Bool_t x) { fIsEBEEGap = x; }
74     void SetIsLooseEM(Bool_t x) { fIsLooseEM = x; }
75     void SetIsLoosePhoton(Bool_t x) { fIsLoosePhoton = x; }
76     void SetIsTightPhoton(Bool_t x) { fIsTightPhoton = x; }
77    
78 loizides 1.1 protected:
79 loizides 1.21 void GetMom() const;
80    
81     FourVectorM32 fMom; //four momentum vector
82 sixie 1.16 Double32_t fR9;
83     Double32_t fR19;
84     Double32_t fE5x5;
85     Double32_t fHadOverEm;
86     Double32_t fHasPixelSeed;
87     Double32_t fEcalRecHitIso;
88     Double32_t fHcalRecHitIso;
89     Double32_t fSolidConeTrkIso;
90     Double32_t fHollowConeTrkIso;
91     Int_t fSolidConeNTrk;
92     Int_t fHollowConeNTrk;
93     Bool_t fIsEBGap;
94     Bool_t fIsEEGap;
95     Bool_t fIsEBEEGap;
96     Bool_t fIsLooseEM;
97     Bool_t fIsLoosePhoton;
98     Bool_t fIsTightPhoton;
99 loizides 1.21 RefArray<Conversion,128> fConversions; //references to associated conversion candidates
100     Bool_t fIsConverted; //conversion flag
101     Ref<SuperCluster> fSuperClusterRef; //superCluster
102 loizides 1.1
103 loizides 1.2 ClassDef(Photon,1) // Photon class
104 loizides 1.1 };
105     }
106 loizides 1.2
107     //--------------------------------------------------------------------------------------------------
108 loizides 1.21 inline void mithep::Photon::GetMom() const
109     {
110     // Get momentum values from stored values.
111    
112     fCachedMom.SetCoordinates(fMom.Pt(),fMom.Eta(),fMom.Phi(),fMom.M());
113     }
114    
115     //--------------------------------------------------------------------------------------------------
116 loizides 1.2 inline void mithep::Photon::SetMom(Double_t px, Double_t py, Double_t pz, Double_t e)
117     {
118 loizides 1.21 // Set momentum vector.
119 loizides 1.2
120 loizides 1.21 fMom.SetXYZT(px, py, pz, e);
121 loizides 1.2 }
122 loizides 1.1 #endif