ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Electron.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/Electron.h (file contents):
Revision 1.10 by loizides, Mon Jul 14 20:55:19 2008 UTC vs.
Revision 1.24 by bendavid, Tue Feb 17 15:09:45 2009 UTC

# Line 3 | Line 3
3   //
4   // Electron
5   //
6 < // Details to be worked out...
6 > // Details to be worked out... TODO: Needs description ala Muon class
7   //
8 < // Authors: C.Loizides, J.Bendavid
8 > // Authors: C.Loizides, J.Bendavid, S.Xie
9   //--------------------------------------------------------------------------------------------------
10  
11 < #ifndef DATATREE_ELECTRON_H
12 < #define DATATREE_ELECTRON_H
11 > #ifndef MITANA_DATATREE_ELECTRON_H
12 > #define MITANA_DATATREE_ELECTRON_H
13  
14 < #include "MitAna/DataTree/interface/Lepton.h"
14 > #include "MitAna/DataTree/interface/SuperCluster.h"
15 > #include "MitAna/DataTree/interface/ChargedParticle.h"
16 > #include "MitAna/DataCont/interface/Ref.h"
17  
18   namespace mithep
19   {
20 <  class Electron : public Lepton
20 >  class Electron : public ChargedParticle
21    {
22      public:
23 <      Electron() {}
23 >      Electron() : fESuperClusterOverP(0), fESeedClusterOverPout(0), fDeltaEtaSuperClTrkAtVtx(0),
24 >                   fDeltaEtaSeedClTrkAtCalo(0), fDeltaPhiSuperClTrkAtVtx(0),
25 >                   fDeltaPhiSeedClTrkAtCalo(0), fHadronicOverEm(0), fIsEnergyScaleCorrected(0),
26 >                   fIsMomentumCorrected(0), fNumberOfClusters(0), fClassification(0), fE33(0),
27 >                   fE55(0), fCovEtaEta(0), fCoviEtaiEta(0), fCovEtaPhi(0), fCovPhiPhi(0),
28 >                   fCaloIsolation(0), fCaloTowerIsolation(0), fTrackIsolation(0),
29 >                   fEcalJurassicIsolation(0), fHcalJurassicIsolation(0), fPassLooseID(0),
30 >                   fPassTightID(0), fIDLikelihood(0), fPIn(0), fPOut(0) {}
31        ~Electron() {}
32        
33 <      const Track         *BestTrk()         const;
34 <      const Track         *GsfTrk()          const;
35 <      const Track         *TrackerTrk()      const;
36 <      Double_t             Mass()            const { return 0.51099892e-3; }
37 <      
38 <      void                 SetGsfTrk(Track* t)     { fGsfTrackRef = t; }
39 <      void                 SetTrackerTrk(Track* t) { fTrackerTrackRef = t; }
40 <      
33 >      const Track         *BestTrk()               const;
34 >      const Track         *GsfTrk()                const { return fGsfTrackRef.Obj();       }
35 >      const Track         *TrackerTrk()            const { return fTrackerTrackRef.Obj();   }
36 >      const SuperCluster  *SCluster()              const { return fSuperClusterRef.Obj();   }
37 >      FourVector           Mom()                   const;
38 >      const Track         *Trk()                   const { return BestTrk();                }
39 >      Double_t    CaloIsolation()                  const { return fCaloIsolation;           }
40 >      Double_t    CaloTowerIsolation()             const { return fCaloTowerIsolation;      }
41 >      Double_t    Classification()                 const { return fClassification;          }
42 >      Double_t    CovEtaEta()                      const { return fCovEtaEta;               }
43 >      Double_t    CovEtaPhi()                      const { return fCovEtaPhi;               }
44 >      Double_t    CovPhiPhi()                      const { return fCovPhiPhi;               }
45 >      Double_t    CoviEtaiEta()                    const { return fCoviEtaiEta;             }
46 >      Double_t    DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
47 >      Double_t    DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
48 >      Double_t    DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
49 >      Double_t    DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
50 >      Double_t    E()                              const;
51 >      Double_t    E33()                            const { return fE33;                     }
52 >      Double_t    E55()                            const { return fE55;                     }
53 >      Double_t    EcalJurassicIsolation()          const { return fEcalJurassicIsolation;   }
54 >      Double_t    ESuperClusterOverP()             const { return fESuperClusterOverP;      }
55 >      Double_t    ESeedClusterOverPout()           const { return fESeedClusterOverPout;    }
56 >      Double_t    ESeedClusterOverPIn()            const;
57 >      Double_t    IDLikelihood()                   const { return fIDLikelihood;            }
58 >      Double_t    IsEnergyScaleCorrected()         const { return fIsEnergyScaleCorrected;  }
59 >      Double_t    IsMomentumCorrected()            const { return fIsMomentumCorrected;     }
60 >      Double_t    HadronicOverEm()                 const { return fHadronicOverEm;          }
61 >      Bool_t      HasGsfTrk()                      const { return fGsfTrackRef.IsValid();   }
62 >      Bool_t      HasTrackerTrk()                  const { return fTrackerTrackRef.IsValid(); }
63 >      Bool_t      HasSuperCluster()                const { return fSuperClusterRef.IsValid(); }
64 >      Double_t    HcalIsolation()                  const { return fHcalJurassicIsolation;   }
65 >      Double_t    Mass()                           const { return 0.51099892e-3;            }
66 >      Double_t    NumberOfClusters()               const { return fNumberOfClusters;        }
67 >      EObjType    ObjType()                        const { return kElectron;                }      
68 >      Double_t    PassLooseID()                    const { return fPassLooseID;             }
69 >      Double_t    PassTightID()                    const { return fPassTightID;             }
70 >      Double_t    PIn()                            const { return fPIn;                     }
71 >      Double_t    POut()                           const { return fPOut;                    }
72 >      Double_t    P()                              const;
73 >      Double_t    Pt()                             const;
74 >      Double_t    Px()                             const;
75 >      Double_t    Py()                             const;
76 >      Double_t    Pz()                             const;
77 >      Double_t    TrackIsolation()                 const { return fTrackIsolation;          }
78 >      void        SetGsfTrk(const Track* t)              { fGsfTrackRef = t;                }
79 >      void        SetTrackerTrk(const Track* t)          { fTrackerTrackRef = t;            }
80 >      void        SetSuperCluster(const SuperCluster* sc) { fSuperClusterRef = sc;          }
81 >      void        SetCaloIsolation(Double_t CaloIsolation)      { fCaloIsolation = CaloIsolation;  }
82 >      void        SetCaloTowerIsolation(Double_t TowerIso)      { fCaloTowerIsolation = TowerIso;  }
83 >      void        SetClassification(Double_t x)                 { fClassification = x;             }
84 >      void        SetCovEtaEta(Double_t CovEtaEta)              { fCovEtaEta = CovEtaEta;          }
85 >      void        SetCovEtaPhi(Double_t CovEtaPhi)              { fCovEtaPhi = CovEtaPhi;          }
86 >      void        SetCovPhiPhi(Double_t CovPhiPhi)              { fCovPhiPhi = CovPhiPhi;          }
87 >      void        SetCoviEtaiEta(Double_t CoviEtaiEta)          { fCoviEtaiEta = CoviEtaiEta;      }
88 >      void        SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) { fDeltaEtaSuperClTrkAtVtx = x;    }
89 >      void        SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) { fDeltaEtaSeedClTrkAtCalo = x;    }
90 >      void        SetDeltaPhiSuperClusterTrackAtVtx(Double_t x) { fDeltaPhiSuperClTrkAtVtx = x;    }
91 >      void        SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) { fDeltaPhiSeedClTrkAtCalo = x;    }
92 >      void        SetE33(Double_t E33)                          { fE33 = E33;                      }
93 >      void        SetE55(Double_t E55)                          { fE55 = E55;                      }
94 >      void        SetEcalJurassicIsolation(Double_t iso )       { fEcalJurassicIsolation = iso;    }
95 >      void        SetESuperClusterOverP(Double_t x)             { fESuperClusterOverP = x;         }
96 >      void        SetESeedClusterOverPout(Double_t x)           { fESeedClusterOverPout = x;       }
97 >      void        SetHadronicOverEm(Double_t x)                 { fHadronicOverEm = x;             }
98 >      void        SetIDLikelihood(Double_t likelihood)          { fIDLikelihood = likelihood;      }
99 >      void        SetIsEnergyScaleCorrected(Double_t x)         { fIsEnergyScaleCorrected = x;     }
100 >      void        SetIsMomentumCorrected(Double_t x)            { fIsMomentumCorrected = x;        }
101 >      void        SetHcalIsolation(Double_t iso )               { fHcalJurassicIsolation = iso;    }
102 >      void        SetNumberOfClusters(Double_t x)               { fNumberOfClusters = x;           }
103 >      void        SetPassLooseID(Double_t passLooseID)          { fPassLooseID = passLooseID;      }
104 >      void        SetPassTightID(Double_t passTightID)          { fPassTightID = passTightID;      }
105 >      void        SetPIn(Double_t PIn)                          { fPIn = PIn;                      }
106 >      void        SetPOut(Double_t POut)                        { fPOut = POut;                    }
107 >      void        SetTrackIsolation(Double_t TrackIsolation)    { fTrackIsolation = TrackIsolation;}
108 >
109      protected:
110 <      TRef                 fGsfTrackRef;     //global combined track reference
111 <      TRef                 fTrackerTrackRef; //tracker track reference
112 <      
110 >      Ref<Track>  fGsfTrackRef;               //gsf track reference
111 >      Ref<Track>  fTrackerTrackRef;           //tracker track reference
112 >      Ref<SuperCluster> fSuperClusterRef;     //reference to SuperCluster
113 >      Double_t    fESuperClusterOverP;        //
114 >      Double_t    fESeedClusterOverPout;      //
115 >      Double_t    fDeltaEtaSuperClTrkAtVtx;   //
116 >      Double_t    fDeltaEtaSeedClTrkAtCalo;   //
117 >      Double_t    fDeltaPhiSuperClTrkAtVtx;   //
118 >      Double_t    fDeltaPhiSeedClTrkAtCalo;   //
119 >      Double_t    fHadronicOverEm;            //
120 >      Double_t    fIsEnergyScaleCorrected;    //
121 >      Double_t    fIsMomentumCorrected;       //
122 >      Double_t    fNumberOfClusters;          //
123 >      Double_t    fClassification;            //
124 >      Double_t    fE33;                       //
125 >      Double_t    fE55;                       //
126 >      Double_t    fCovEtaEta;                 //
127 >      Double_t    fCoviEtaiEta;               //
128 >      Double_t    fCovEtaPhi;                 //
129 >      Double_t    fCovPhiPhi;                 //
130 >      Double_t    fCaloIsolation;             //
131 >      Double_t    fCaloTowerIsolation;        //
132 >      Double_t    fTrackIsolation;            //
133 >      Double_t    fEcalJurassicIsolation;     //
134 >      Double_t    fHcalJurassicIsolation;     //
135 >      Double_t    fPassLooseID;               //
136 >      Double_t    fPassTightID;               //
137 >      Double_t    fIDLikelihood;              //
138 >      Double_t    fPIn;                       //
139 >      Double_t    fPOut;                      //
140 >
141      ClassDef(Electron, 1) // Electron class
142    };
143   }
# Line 42 | Line 147 | inline const mithep::Track *mithep::Elec
147   {
148    // Return "best" track.
149  
150 <  if (GsfTrk())
150 >  if (HasGsfTrk())
151      return GsfTrk();
152 <  else if (TrackerTrk())
152 >  else if (HasTrackerTrk())
153      return TrackerTrk();
154  
155    return 0;
156   }
157  
158 < //--------------------------------------------------------------------------------------------------
159 < inline const mithep::Track *mithep::Electron::GsfTrk() const
158 > //-------------------------------------------------------------------------------------------------
159 > inline mithep::FourVector mithep::Electron::Mom() const
160   {
161 <  // Return global combined track.
161 >  // Return momentum of the electron. We use the direction of the
162 >  // track and the energy of the SuperCluster.
163  
164 <  return static_cast<const Track*>(fGsfTrackRef.GetObject());
164 >  return FourVector(Px(), Py(), Pz(), E());
165   }
166  
167 < //--------------------------------------------------------------------------------------------------
168 < inline const mithep::Track *mithep::Electron::TrackerTrk() const
167 > //-------------------------------------------------------------------------------------------------
168 > inline Double_t mithep::Electron::ESeedClusterOverPIn() const
169 > {
170 >  // Return energy of the SuperCluster seed divided by the magnitude
171 >  // of the track momentum at the vertex.
172 >  
173 >  return SCluster()->Seed()->Energy() / PIn();
174 > }
175 >
176 > //-------------------------------------------------------------------------------------------------
177 > inline Double_t mithep::Electron::E() const
178 > {
179 >  // Return energy of the SuperCluster if present
180 >  // or else return energy derived from the track.
181 >  
182 >  const mithep::SuperCluster *sc = SCluster();
183 >  if (sc)
184 >    return sc->Energy();
185 >  else
186 >    return TMath::Sqrt(Trk()->P()*Trk()->P() + Mass()*Mass());
187 > }
188 >
189 > //-------------------------------------------------------------------------------------------------
190 > inline Double_t mithep::Electron::P() const
191 > {
192 >  // Return momentum derived from the SuperCluster if present
193 >  // or else return momentum from the track.
194 >  
195 >  const mithep::SuperCluster *sc = SCluster();
196 >  if (sc)
197 >    return TMath::Sqrt(sc->Energy()*sc->Energy() - Mass()*Mass());
198 >  else
199 >    return Trk()->P();
200 > }
201 >
202 > //-------------------------------------------------------------------------------------------------
203 > inline Double_t mithep::Electron::Px() const
204 > {
205 >  // Return px.
206 >
207 >  return Pt()*TMath::Cos(Trk()->Phi());
208 > }
209 >
210 > //-------------------------------------------------------------------------------------------------
211 > inline Double_t mithep::Electron::Py() const
212 > {
213 >  // Return py.
214 >
215 >  return Pt()*TMath::Sin(Trk()->Phi());
216 > }
217 >
218 > //-------------------------------------------------------------------------------------------------
219 > inline Double_t mithep::Electron::Pz() const
220 > {
221 >  // Return pz.
222 >
223 >  return P()*TMath::Sin(Trk()->Lambda());
224 > }
225 >
226 > //-------------------------------------------------------------------------------------------------
227 > inline Double_t mithep::Electron::Pt() const
228   {
229 <  // Return tracker track.
229 >  // Return pt.
230  
231 <  return static_cast<const Track*>(fTrackerTrackRef.GetObject());
231 >  return TMath::Abs(P()*TMath::Cos(Trk()->Lambda()));
232   }
233   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines