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.6 by loizides, Wed Jun 18 19:08:14 2008 UTC vs.
Revision 1.15 by sixie, Fri Aug 22 09:55:40 2008 UTC

# Line 5 | Line 5
5   //
6   // Details to be worked out...
7   //
8 < // Authors: C.Loizides, J. Bendavid
9 < //
8 > // Authors: C.Loizides, J.Bendavid, S.Xie
9   //--------------------------------------------------------------------------------------------------
10  
11   #ifndef DATATREE_ELECTRON_H
12   #define 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  
17   namespace mithep
18   {
19 <  class Electron : public Lepton
19 >  class Electron : public ChargedParticle
20    {
21      public:
22        Electron() {}
23      Electron(Double_t px, Double_t py, Double_t pz, Double_t e) : Lepton(px,py,pz,e) {}
23        ~Electron() {}
24        
25 <      ClassDef(Electron, 1) // Electron class
25 >      const Track         *BestTrk()               const;
26 >      const Track         *GsfTrk()                const;
27 >      const Track         *TrackerTrk()            const;
28 >      const SuperCluster  *SCluster()              const;
29 >      FourVector           Mom()                   const;
30 >      const Track         *Trk()                   const { return BestTrk();                }
31 >      Double_t             E()                     const {return SCluster()->Energy();      }
32 >
33 >
34 >      Double_t    Mass()                           const { return 0.51099892e-3;            }
35 >      Double_t    ESuperClusterOverP()             const { return fESuperClusterOverP;      }
36 >      Double_t    ESeedClusterOverPout()           const { return fESeedClusterOverPout;    }
37 >      Double_t    ESeedClusterOverPIn()            const;
38 >      Double_t    PIn()                            const { return fPIn;                     }
39 >      Double_t    POut()                           const { return fPOut;                    }
40 >      Double_t    DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
41 >      Double_t    DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
42 >      Double_t    DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
43 >      Double_t    DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
44 >      Double_t    HadronicOverEm()                 const { return fHadronicOverEm;          }
45 >      Double_t    IsEnergyScaleCorrected()         const { return fIsEnergyScaleCorrected;  }
46 >      Double_t    IsMomentumCorrected()            const { return fIsMomentumCorrected;     }
47 >      Double_t    NumberOfClusters()               const { return fNumberOfClusters;        }
48 >      Double_t    Classification()                 const { return fClassification;          }
49 >      Double_t    E33()                            const { return fE33;                     }
50 >      Double_t    E55()                            const { return fE55;                     }
51 >      Double_t    CovEtaEta()                      const { return fCovEtaEta;               }
52 >      Double_t    CovEtaPhi()                      const { return fCovEtaPhi;               }
53 >      Double_t    CovPhiPhi()                      const { return fCovPhiPhi;               }
54 >      Double_t    CaloIsolation()                  const { return fCaloIsolation;           }
55 >      Double_t    TrackIsolation()                 const { return fTrackIsolation;          }
56 >      Double_t    PassLooseID()                    const { return fPassLooseID;             }
57 >      Double_t    PassTightID()                    const { return fPassTightID;             }
58 >      Double_t    IDLikelihood()                   const { return fIDLikelihood;            }
59 >      Double_t    ComputeTrackIsolation   (  Double_t extRadius, Double_t intRadius,
60 >                                             Double_t ptLow, Double_t maxVtxZDist,
61 >                                             mithep::Collection<Track> *tracks              );
62 >      Double_t    ComputeEcalIsolation    (  Double_t coneSize, Double_t etLow,
63 >                                             mithep::Collection<BasicCluster> *basicClusters);
64 >
65 >      void        SetGsfTrk(Track* t)                           { fGsfTrackRef = t;                }
66 >      void        SetTrackerTrk(Track* t)                       { fTrackerTrackRef = t;            }
67 >      void        SetSuperCluster(SuperCluster* sc)             { fSuperClusterRef = sc;           }
68 >      void        SetESuperClusterOverP(Double_t x)             { fESuperClusterOverP = x;         }
69 >      void        SetESeedClusterOverPout(Double_t x)           { fESeedClusterOverPout = x;       }
70 >      void        SetPIn(Double_t PIn)                          { fPIn = PIn;                      }
71 >      void        SetPOut(Double_t POut)                        { fPOut = POut;                    }
72 >      void        SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) { fDeltaEtaSuperClTrkAtVtx = x;    }
73 >      void        SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) { fDeltaEtaSeedClTrkAtCalo = x;    }
74 >      void        SetDeltaPhiSuperClusterTrackAtVtx(Double_t x) { fDeltaPhiSuperClTrkAtVtx = x;    }
75 >      void        SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) { fDeltaPhiSeedClTrkAtCalo = x;    }
76 >      void        SetHadronicOverEm(Double_t x)                 { fHadronicOverEm = x;             }
77 >      void        SetIsEnergyScaleCorrected(Double_t x)         { fIsEnergyScaleCorrected = x;     }
78 >      void        SetIsMomentumCorrected(Double_t x)            { fIsMomentumCorrected = x;        }
79 >      void        SetNumberOfClusters(Double_t x)               { fNumberOfClusters = x;           }
80 >      void        SetClassification(Double_t x)                 { fClassification = x;             }
81 >      void        SetE33(Double_t E33)                          { fE33 = E33;                      }
82 >      void        SetE55(Double_t E55)                          { fE55 = E55;                      }
83 >      void        SetCovEtaEta(Double_t CovEtaEta)              { fCovEtaEta = CovEtaEta;          }
84 >      void        SetCovEtaPhi(Double_t CovEtaPhi)              { fCovEtaPhi = CovEtaPhi;          }
85 >      void        SetCovPhiPhi(Double_t CovPhiPhi)              { fCovPhiPhi = CovPhiPhi;          }
86 >      void        SetCaloIsolation(Double_t CaloIsolation)      { fCaloIsolation = CaloIsolation;  }
87 >      void        SetTrackIsolation(Double_t TrackIsolation)    { fTrackIsolation = TrackIsolation;}
88 >      void        SetPassLooseID(Double_t passLooseID)          { fPassLooseID = passLooseID;      }
89 >      void        SetPassTightID(Double_t passTightID)          { fPassTightID = passTightID;      }
90 >      void        SetIDLikelihood(Double_t likelihood)          { fIDLikelihood = likelihood;      }
91 >
92 >    protected:
93 >      TRef                 fGsfTrackRef;     //global combined track reference
94 >      TRef                 fTrackerTrackRef; //tracker track reference
95 >      TRef                 fSuperClusterRef; //superCluster
96 >
97 >      Double_t             fESuperClusterOverP;
98 >      Double_t             fESeedClusterOverPout;
99 >      Double_t             fDeltaEtaSuperClTrkAtVtx;
100 >      Double_t             fDeltaEtaSeedClTrkAtCalo;
101 >      Double_t             fDeltaPhiSuperClTrkAtVtx;
102 >      Double_t             fDeltaPhiSeedClTrkAtCalo;
103 >      Double_t             fHadronicOverEm;
104 >      Double_t             fIsEnergyScaleCorrected;
105 >      Double_t             fIsMomentumCorrected;      
106 >      Double_t             fNumberOfClusters;
107 >      Double_t             fClassification;          
108 >      Double_t             fSuperClusterPx;
109 >      Double_t             fSuperClusterPy;
110 >      Double_t             fSuperClusterPz;
111 >      Double_t             fSuperClusterE;
112 >      Double_t             fE33;
113 >      Double_t             fE55;
114 >      Double_t             fCovEtaEta;
115 >      Double_t             fCovEtaPhi;
116 >      Double_t             fCovPhiPhi;
117 >      Double_t             fCaloIsolation;
118 >      Double_t             fTrackIsolation;
119 >      Double_t             fPassLooseID;
120 >      Double_t             fPassTightID;
121 >      Double_t             fIDLikelihood;
122 >      Double_t             fPIn;
123 >      Double_t             fPOut;
124 >
125 >    ClassDef(Electron, 1) // Electron class
126    };
127   }
128 +
129 + //--------------------------------------------------------------------------------------------------
130 + inline const mithep::Track *mithep::Electron::BestTrk() const
131 + {
132 +  // Return "best" track.
133 +
134 +  if (GsfTrk())
135 +    return GsfTrk();
136 +  else if (TrackerTrk())
137 +    return TrackerTrk();
138 +
139 +  return 0;
140 + }
141 +
142 + //--------------------------------------------------------------------------------------------------
143 + inline const mithep::Track *mithep::Electron::GsfTrk() const
144 + {
145 +  // Return global combined track.
146 +
147 +  return static_cast<const Track*>(fGsfTrackRef.GetObject());
148 + }
149 +
150 + //--------------------------------------------------------------------------------------------------
151 + inline const mithep::Track *mithep::Electron::TrackerTrk() const
152 + {
153 +  // Return tracker track.
154 +
155 +  return static_cast<const Track*>(fTrackerTrackRef.GetObject());
156 + }
157 + //--------------------------------------------------------------------------------------------------
158 + inline const mithep::SuperCluster *mithep::Electron::SCluster() const
159 + {
160 +  // Return Super cluster
161 +
162 +  return static_cast<const SuperCluster*>(fSuperClusterRef.GetObject());
163 + }
164 +
165 + //-------------------------------------------------------------------------------------------------
166 + inline mithep::FourVector mithep::Electron::Mom() const
167 + {
168 +  // Return Momentum of the electron. We use the direction of the
169 +  // Track and the Energy of the Super Cluster
170 +
171 +  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());
174 + }
175 +
176 + inline Double_t mithep::Electron::ESeedClusterOverPIn() const
177 + {
178 +  // Return Energy of the SuperCluster Seed Divided by the magnitude
179 +  // of the track momentum at the vertex
180 +  
181 +  return SCluster()->Seed()->Energy() / PIn();
182 + }
183 +
184 +
185   #endif
186 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines