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.11 by bendavid, Fri Jul 25 16:04:44 2008 UTC vs.
Revision 1.26 by bendavid, Thu Feb 26 17:06:24 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/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 ChargedParticle
21    {
22      public:
23 <      Electron() {}
24 <      ~Electron() {}
25 <      
26 <      const Track         *BestTrk()         const;
27 <      const Track         *GsfTrk()          const;
28 <      const Track         *TrackerTrk()      const;
29 <      Double_t             Mass()            const { return 0.51099892e-3; }
30 <      
29 <      void                 SetGsfTrk(Track* t)     { fGsfTrackRef = t; }
30 <      void                 SetTrackerTrk(Track* t) { fTrackerTrackRef = t; }
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        
32 +      const Track         *BestTrk()               const;
33 +      const Track         *GsfTrk()                const { return fGsfTrackRef.Obj();       }
34 +      const Track         *TrackerTrk()            const { return fTrackerTrackRef.Obj();   }
35 +      const SuperCluster  *SCluster()              const { return fSuperClusterRef.Obj();   }
36 +      const Track         *Trk()                   const { return BestTrk();                }
37 +      Double_t    CaloIsolation()                  const { return fCaloIsolation;           }
38 +      Double_t    CaloTowerIsolation()             const { return fCaloTowerIsolation;      }
39 +      Double_t    Classification()                 const { return fClassification;          }
40 +      Double_t    CovEtaEta()                      const { return fCovEtaEta;               }
41 +      Double_t    CovEtaPhi()                      const { return fCovEtaPhi;               }
42 +      Double_t    CovPhiPhi()                      const { return fCovPhiPhi;               }
43 +      Double_t    CoviEtaiEta()                    const { return fCoviEtaiEta;             }
44 +      Double_t    DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
45 +      Double_t    DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
46 +      Double_t    DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
47 +      Double_t    DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
48 +      Double_t    E33()                            const { return fE33;                     }
49 +      Double_t    E55()                            const { return fE55;                     }
50 +      Double_t    EcalJurassicIsolation()          const { return fEcalJurassicIsolation;   }
51 +      Double_t    ESuperClusterOverP()             const { return fESuperClusterOverP;      }
52 +      Double_t    ESeedClusterOverPout()           const { return fESeedClusterOverPout;    }
53 +      Double_t    ESeedClusterOverPIn()            const;
54 +      Double_t    IDLikelihood()                   const { return fIDLikelihood;            }
55 +      Double_t    IsEnergyScaleCorrected()         const { return fIsEnergyScaleCorrected;  }
56 +      Double_t    IsMomentumCorrected()            const { return fIsMomentumCorrected;     }
57 +      Double_t    HadronicOverEm()                 const { return fHadronicOverEm;          }
58 +      Bool_t      HasGsfTrk()                      const { return fGsfTrackRef.IsValid();   }
59 +      Bool_t      HasTrackerTrk()                  const { return fTrackerTrackRef.IsValid(); }
60 +      Bool_t      HasSuperCluster()                const { return fSuperClusterRef.IsValid(); }
61 +      Double_t    HcalIsolation()                  const { return fHcalJurassicIsolation;   }
62 +      Double_t    NumberOfClusters()               const { return fNumberOfClusters;        }
63 +      EObjType    ObjType()                        const { return kElectron;                }      
64 +      Double_t    PassLooseID()                    const { return fPassLooseID;             }
65 +      Double_t    PassTightID()                    const { return fPassTightID;             }
66 +      Double_t    PIn()                            const { return fPIn;                     }
67 +      Double_t    POut()                           const { return fPOut;                    }
68 +      Double_t    TrackIsolation()                 const { return fTrackIsolation;          }
69 +      void        SetGsfTrk(const Track* t)                     { fGsfTrackRef = t; ClearMom(); ClearCharge(); }
70 +      void        SetTrackerTrk(const Track* t)                 { fTrackerTrackRef = t; ClearMom(); ClearCharge(); }
71 +      void        SetSuperCluster(const SuperCluster* sc)       { fSuperClusterRef = sc; ClearMom(); }
72 +      void        SetCaloIsolation(Double_t CaloIsolation)      { fCaloIsolation = CaloIsolation;  }
73 +      void        SetCaloTowerIsolation(Double_t TowerIso)      { fCaloTowerIsolation = TowerIso;  }
74 +      void        SetClassification(Double_t x)                 { fClassification = x;             }
75 +      void        SetCovEtaEta(Double_t CovEtaEta)              { fCovEtaEta = CovEtaEta;          }
76 +      void        SetCovEtaPhi(Double_t CovEtaPhi)              { fCovEtaPhi = CovEtaPhi;          }
77 +      void        SetCovPhiPhi(Double_t CovPhiPhi)              { fCovPhiPhi = CovPhiPhi;          }
78 +      void        SetCoviEtaiEta(Double_t CoviEtaiEta)          { fCoviEtaiEta = CoviEtaiEta;      }
79 +      void        SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) { fDeltaEtaSuperClTrkAtVtx = x;    }
80 +      void        SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) { fDeltaEtaSeedClTrkAtCalo = x;    }
81 +      void        SetDeltaPhiSuperClusterTrackAtVtx(Double_t x) { fDeltaPhiSuperClTrkAtVtx = x;    }
82 +      void        SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) { fDeltaPhiSeedClTrkAtCalo = x;    }
83 +      void        SetE33(Double_t E33)                          { fE33 = E33;                      }
84 +      void        SetE55(Double_t E55)                          { fE55 = E55;                      }
85 +      void        SetEcalJurassicIsolation(Double_t iso )       { fEcalJurassicIsolation = iso;    }
86 +      void        SetESuperClusterOverP(Double_t x)             { fESuperClusterOverP = x;         }
87 +      void        SetESeedClusterOverPout(Double_t x)           { fESeedClusterOverPout = x;       }
88 +      void        SetHadronicOverEm(Double_t x)                 { fHadronicOverEm = x;             }
89 +      void        SetIDLikelihood(Double_t likelihood)          { fIDLikelihood = likelihood;      }
90 +      void        SetIsEnergyScaleCorrected(Double_t x)         { fIsEnergyScaleCorrected = x;     }
91 +      void        SetIsMomentumCorrected(Double_t x)            { fIsMomentumCorrected = x;        }
92 +      void        SetHcalIsolation(Double_t iso )               { fHcalJurassicIsolation = iso;    }
93 +      void        SetNumberOfClusters(Double_t x)               { fNumberOfClusters = x;           }
94 +      void        SetPassLooseID(Double_t passLooseID)          { fPassLooseID = passLooseID;      }
95 +      void        SetPassTightID(Double_t passTightID)          { fPassTightID = passTightID;      }
96 +      void        SetPIn(Double_t PIn)                          { fPIn = PIn;                      }
97 +      void        SetPOut(Double_t POut)                        { fPOut = POut;                    }
98 +      void        SetTrackIsolation(Double_t trkiso)            { fTrackIsolation = trkiso;        }
99 +
100      protected:
101 <      TRef                 fGsfTrackRef;     //global combined track reference
102 <      TRef                 fTrackerTrackRef; //tracker track reference
103 <      
101 >      Double_t    GetMass()                  const              { return 0.51099892e-3;            }
102 >      void        GetMom()                   const;
103 >
104 >      Ref<Track>  fGsfTrackRef;               //gsf track reference
105 >      Ref<Track>  fTrackerTrackRef;           //tracker track reference
106 >      Ref<SuperCluster> fSuperClusterRef;     //reference to SuperCluster
107 >      Double_t    fESuperClusterOverP;        //
108 >      Double_t    fESeedClusterOverPout;      //
109 >      Double_t    fDeltaEtaSuperClTrkAtVtx;   //
110 >      Double_t    fDeltaEtaSeedClTrkAtCalo;   //
111 >      Double_t    fDeltaPhiSuperClTrkAtVtx;   //
112 >      Double_t    fDeltaPhiSeedClTrkAtCalo;   //
113 >      Double_t    fHadronicOverEm;            //
114 >      Double_t    fIsEnergyScaleCorrected;    //
115 >      Double_t    fIsMomentumCorrected;       //
116 >      Double_t    fNumberOfClusters;          //
117 >      Double_t    fClassification;            //
118 >      Double_t    fE33;                       //
119 >      Double_t    fE55;                       //
120 >      Double_t    fCovEtaEta;                 //
121 >      Double_t    fCoviEtaiEta;               //
122 >      Double_t    fCovEtaPhi;                 //
123 >      Double_t    fCovPhiPhi;                 //
124 >      Double_t    fCaloIsolation;             //
125 >      Double_t    fCaloTowerIsolation;        //
126 >      Double_t    fTrackIsolation;            //
127 >      Double_t    fEcalJurassicIsolation;     //
128 >      Double_t    fHcalJurassicIsolation;     //
129 >      Double_t    fPassLooseID;               //
130 >      Double_t    fPassTightID;               //
131 >      Double_t    fIDLikelihood;              //
132 >      Double_t    fPIn;                       //
133 >      Double_t    fPOut;                      //
134 >
135      ClassDef(Electron, 1) // Electron class
136    };
137   }
# Line 42 | Line 141 | inline const mithep::Track *mithep::Elec
141   {
142    // Return "best" track.
143  
144 <  if (GsfTrk())
144 >  if (HasGsfTrk())
145      return GsfTrk();
146 <  else if (TrackerTrk())
146 >  else if (HasTrackerTrk())
147      return TrackerTrk();
148  
149    return 0;
150   }
151  
152   //--------------------------------------------------------------------------------------------------
153 < inline const mithep::Track *mithep::Electron::GsfTrk() const
153 > inline void mithep::Electron::GetMom() const
154   {
155 <  // Return global combined track.
155 >  // Get momentum of the electron. We use the direction of the
156 >  // track and the energy of the SuperCluster.
157 >
158 >  const mithep::Track *trk = Trk();
159 >
160 >  if (!trk) {
161 >    fCachedMom.SetCoordinates(0,0,0,0);
162 >    return;
163 >  }
164 >
165 >  Double_t p = 0;
166 >  Double_t mass = GetMass();
167 >
168 >  const mithep::SuperCluster *sc = SCluster();
169 >  if (sc)
170 >    p = TMath::Sqrt(sc->Energy()*sc->Energy() - mass*mass);
171 >  else
172 >    p = trk->P();
173  
174 <  return static_cast<const Track*>(fGsfTrackRef.GetObject());
174 >  Double_t pt = TMath::Abs(p*TMath::Cos(trk->Lambda()));
175 >  fCachedMom.SetCoordinates(pt,trk->Eta(),trk->Phi(),mass);
176   }
177  
178 < //--------------------------------------------------------------------------------------------------
179 < inline const mithep::Track *mithep::Electron::TrackerTrk() const
178 > //-------------------------------------------------------------------------------------------------
179 > inline Double_t mithep::Electron::ESeedClusterOverPIn() const
180   {
181 <  // Return tracker track.
182 <
183 <  return static_cast<const Track*>(fTrackerTrackRef.GetObject());
181 >  // Return energy of the SuperCluster seed divided by the magnitude
182 >  // of the track momentum at the vertex.
183 >  
184 >  return SCluster()->Seed()->Energy() / PIn();
185   }
186   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines