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.17 by sixie, Tue Sep 9 12:50:43 2008 UTC vs.
Revision 1.20 by loizides, Thu Nov 27 16:14:37 2008 UTC

# Line 28 | Line 28 | namespace mithep
28        const SuperCluster  *SCluster()              const;
29        FourVector           Mom()                   const;
30        const Track         *Trk()                   const { return BestTrk();                }
31 <      Double_t             E()                     const {return SCluster()->Energy();      }
31 >      Double_t             E()                     const;
32 >      Double_t             P()                     const;
33 >      Double_t             Pt()                    const;
34 >      Double_t             Px()                    const;
35 >      Double_t             Py()                    const;
36 >      Double_t             Pz()                    const;
37  
38        Double_t    Mass()                           const { return 0.51099892e-3;            }
39        Double_t    ESuperClusterOverP()             const { return fESuperClusterOverP;      }
# Line 50 | Line 55 | namespace mithep
55        Double_t    CovEtaEta()                      const { return fCovEtaEta;               }
56        Double_t    CovEtaPhi()                      const { return fCovEtaPhi;               }
57        Double_t    CovPhiPhi()                      const { return fCovPhiPhi;               }
58 +      Double_t    CoviEtaiEta()                    const { return fCoviEtaiEta;             }
59        Double_t    CaloIsolation()                  const { return fCaloIsolation;           }
60        Double_t    CaloTowerIsolation()             const { return fCaloTowerIsolation;      }
61        Double_t    TrackIsolation()                 const { return fTrackIsolation;          }
62        Double_t    EcalJurassicIsolation()          const { return fEcalJurassicIsolation;   }
63 <      Double_t    HcalJurassicIsolation()          const { return fHcalJurassicIsolation;   }
58 <
63 >      Double_t    HcalIsolation()                  const { return fHcalJurassicIsolation;   }
64        Double_t    PassLooseID()                    const { return fPassLooseID;             }
65        Double_t    PassTightID()                    const { return fPassTightID;             }
66        Double_t    IDLikelihood()                   const { return fIDLikelihood;            }
# Line 81 | Line 86 | namespace mithep
86        void        SetCovEtaEta(Double_t CovEtaEta)              { fCovEtaEta = CovEtaEta;          }
87        void        SetCovEtaPhi(Double_t CovEtaPhi)              { fCovEtaPhi = CovEtaPhi;          }
88        void        SetCovPhiPhi(Double_t CovPhiPhi)              { fCovPhiPhi = CovPhiPhi;          }
89 +      void        SetCoviEtaiEta(Double_t CoviEtaiEta)          { fCoviEtaiEta = CoviEtaiEta;      }
90        void        SetCaloIsolation(Double_t CaloIsolation)      { fCaloIsolation = CaloIsolation;  }
91        void        SetCaloTowerIsolation(Double_t TowerIso)      { fCaloTowerIsolation = TowerIso;  }
92        void        SetTrackIsolation(Double_t TrackIsolation)    { fTrackIsolation = TrackIsolation;}
93        void        SetEcalJurassicIsolation(Double_t iso )       { fEcalJurassicIsolation = iso;    }
94 <      void        SetHcalJurassicIsolation(Double_t iso )       { fHcalJurassicIsolation = iso;    }
94 >      void        SetHcalIsolation(Double_t iso )               { fHcalJurassicIsolation = iso;    }
95        void        SetPassLooseID(Double_t passLooseID)          { fPassLooseID = passLooseID;      }
96        void        SetPassTightID(Double_t passTightID)          { fPassTightID = passTightID;      }
97        void        SetIDLikelihood(Double_t likelihood)          { fIDLikelihood = likelihood;      }
# Line 109 | Line 115 | namespace mithep
115        Double_t             fE33;
116        Double_t             fE55;
117        Double_t             fCovEtaEta;
118 +      Double_t             fCoviEtaiEta;
119        Double_t             fCovEtaPhi;
120        Double_t             fCovPhiPhi;
121        Double_t             fCaloIsolation;
# Line 168 | Line 175 | inline mithep::FourVector mithep::Electr
175    // Return Momentum of the electron. We use the direction of the
176    // Track and the Energy of the Super Cluster
177  
178 <  double P = TMath::Sqrt( E()*E() - Mass()*Mass());
172 <  return FourVector(P*sin(Trk()->Theta())*cos(Trk()->Phi()),
173 <                    P*sin(Trk()->Theta())*sin(Trk()->Phi()), P*cos(Trk()->Theta()), E());
178 >  return FourVector(Px(), Py(), Pz(), E());
179   }
180  
181 + //-------------------------------------------------------------------------------------------------
182   inline Double_t mithep::Electron::ESeedClusterOverPIn() const
183   {
184    // Return Energy of the SuperCluster Seed Divided by the magnitude
# Line 181 | Line 187 | inline Double_t mithep::Electron::ESeedC
187    return SCluster()->Seed()->Energy() / PIn();
188   }
189  
190 + //-------------------------------------------------------------------------------------------------
191 + inline Double_t mithep::Electron::E() const
192 + {
193 +  // Return Energy of the SuperCluster if present
194 +  // or else return energy derived from the track
195 +  
196 +  const mithep::SuperCluster *sc = SCluster();
197 +  if (sc)
198 +    return sc->Energy();
199 +  else
200 +    return TMath::Sqrt(Trk()->P()*Trk()->P() + Mass()*Mass());
201 + }
202  
203 < #endif
203 > //-------------------------------------------------------------------------------------------------
204 > inline Double_t mithep::Electron::P() const
205 > {
206 >  // Return momentum derived from the SuperCluster if present
207 >  // or else return momentum from the track
208 >  
209 >  const mithep::SuperCluster *sc = SCluster();
210 >  if (sc)
211 >    return TMath::Sqrt(sc->Energy()*sc->Energy() - Mass()*Mass());
212 >  else
213 >    return Trk()->P();
214 > }
215  
216 + //-------------------------------------------------------------------------------------------------
217 + inline Double_t mithep::Electron::Px() const
218 + {
219 +  return Pt()*TMath::Cos(Trk()->Phi());
220 + }
221 +
222 + //-------------------------------------------------------------------------------------------------
223 + inline Double_t mithep::Electron::Py() const
224 + {
225 +  return Pt()*TMath::Sin(Trk()->Phi());
226 + }
227 +
228 + //-------------------------------------------------------------------------------------------------
229 + inline Double_t mithep::Electron::Pz() const
230 + {
231 +  return P()*TMath::Sin(Trk()->Lambda());
232 + }
233 +
234 + //-------------------------------------------------------------------------------------------------
235 + inline Double_t mithep::Electron::Pt() const
236 + {
237 +  return TMath::Abs(P()*TMath::Cos(Trk()->Lambda()));
238 + }
239 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines