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.22 by loizides, Tue Dec 9 17:47:00 2008 UTC vs.
Revision 1.49 by paus, Wed Mar 28 12:15:34 2012 UTC

# Line 3 | Line 3
3   //
4   // Electron
5   //
6 < // Details to be worked out... TODO: Needs description ala Muon class
6 > // This class holds information about reconstructed electrons from CMSSW.
7   //
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() : 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() {}
23 >      Electron() :
24 >        fCharge(-99), fScPixCharge(0),
25 >        fESuperClusterOverP(0), fESeedClusterOverPout(0), fDeltaEtaSuperClTrkAtVtx(0),
26 >        fDeltaEtaSeedClTrkAtCalo(0), fDeltaPhiSuperClTrkAtVtx(0),
27 >        fDeltaPhiSeedClTrkAtCalo(0), fFBrem(0), fHadronicOverEm(0), fHcalDepth1OverEcal(0),
28 >        fHcalDepth2OverEcal(0), fNumberOfClusters(0), fE15(0), fE25Max(0),
29 >        fE55(0), fCovEtaEta(0), fCoviEtaiEta(0),
30 >        fCaloIsolation(0), fHcalJurassicIsolation(0),
31 >        fHcalDepth1TowerSumEtDr04(0), fHcalDepth2TowerSumEtDr04(0),
32 >        fEcalJurassicIsolation(0), fTrackIsolationDr04(0), fCaloTowerIsolation(0),
33 >        fHcalDepth1TowerSumEtDr03(0), fHcalDepth2TowerSumEtDr03(0),
34 >        fEcalRecHitSumEtDr03(0), fTrackIsolation(0), fPassLooseID(0),
35 >        fPassTightID(0), fIDLikelihood(0), fPIn(0), fPOut(0), fFracSharedHits(0),
36 >        fMva(0), fD0PV(0), fD0PVErr(0), fIp3dPV(0), fIp3dPVErr(0),
37 >        fD0PVBS(0), fD0PVBSErr(0), fIp3dPVBS(0), fIp3dPVBSErr(0),
38 >        fD0PVCkf(0), fD0PVCkfErr(0), fIp3dPVCkf(0), fIp3dPVCkfErr(0),
39 >        fD0PVBSCkf(0), fD0PVBSCkfErr(0), fIp3dPVBSCkf(0), fIp3dPVBSCkfErr(0),
40 >        fD0PVUB(0), fD0PVUBErr(0), fIp3dPVUB(0), fIp3dPVUBErr(0),
41 >        fD0PVUBBS(0), fD0PVUBBSErr(0), fIp3dPVUBBS(0), fIp3dPVUBBSErr(0),
42 >        fD0PVUBCkf(0), fD0PVUBCkfErr(0), fIp3dPVUBCkf(0), fIp3dPVUBCkfErr(0),
43 >        fD0PVUBBSCkf(0), fD0PVUBBSCkfErr(0), fIp3dPVUBBSCkf(0), fIp3dPVUBBSCkfErr(0),
44 >        fGsfPVCompatibility(0), fGsfPVBSCompatibility(0),
45 >        fGsfPVCompatibilityMatched(0), fGsfPVBSCompatibilityMatched(0),
46 >        fConvPartnerDCotTheta(0), fConvPartnerDist(0), fConvPartnerRadius(0),
47 >        fPFChargedHadronIso(0), fPFNeutralHadronIso(0), fPFPhotonIso(0),
48 >        fConvFlag(0), fIsEnergyScaleCorrected(0), fIsMomentumCorrected(0),
49 >        fClassification(0), fIsEB(), fIsEE(0), fIsEBEEGap(0), fIsEBEtaGap(0),
50 >        fIsEBPhiGap(0), fIsEEDeeGap(0), fIsEERingGap(0),
51 >        fIsEcalDriven(0), fIsTrackerDriven(0), fMatchesVertexConversion(0) {}
52 >
53 >      const Track         *BestTrk()                     const;
54 >      Double_t             D0PV()                        const { return fD0PV; }
55 >      Double_t             D0PVErr()                     const { return fD0PVErr; }
56 >      Double_t             D0PVSignificance()            const { return fD0PV/fD0PVErr; }
57 >      Double_t             Ip3dPV()                      const { return fIp3dPV; }
58 >      Double_t             Ip3dPVErr()                   const { return fIp3dPVErr; }
59 >      Double_t             Ip3dPVSignificance()          const { return fIp3dPV/fIp3dPVErr; }
60 >      Double_t             D0PVBS()                      const { return fD0PVBS; }
61 >      Double_t             D0PVBSErr()                   const { return fD0PVBSErr; }
62 >      Double_t             D0PVBSSignificance()          const { return fD0PVBS/fD0PVBSErr; }
63 >      Double_t             Ip3dPVBS()                    const { return fIp3dPVBS; }
64 >      Double_t             Ip3dPVBSErr()                 const { return fIp3dPVBSErr; }
65 >      Double_t             Ip3dPVBSSignificance()        const { return fIp3dPVBS/fIp3dPVBSErr; }
66 >      Double_t             D0PVCkf()                     const { return fD0PVCkf; }
67 >      Double_t             D0PVCkfErr()                  const { return fD0PVCkfErr; }
68 >      Double_t             D0PVCkfSignificance()         const { return fD0PVCkf/fD0PVCkfErr; }
69 >      Double_t             Ip3dPVCkf()                   const { return fIp3dPVCkf; }
70 >      Double_t             Ip3dPVCkfErr()                const { return fIp3dPVCkfErr; }
71 >      Double_t             Ip3dPVCkfSignificance()       const { return fIp3dPVCkf/fIp3dPVCkfErr; }
72 >      Double_t             D0PVBSCkf()                   const { return fD0PVBSCkf; }
73 >      Double_t             D0PVBSCkfErr()                const { return fD0PVBSCkfErr; }
74 >      Double_t             D0PVBSCkfSignificance()       const { return fD0PVBSCkf/fD0PVBSCkfErr; }
75 >      Double_t             Ip3dPVBSCkf()                 const { return fIp3dPVBSCkf; }
76 >      Double_t             Ip3dPVBSCkfErr()              const { return fIp3dPVBSCkfErr; }
77 >      Double_t             Ip3dPVBSCkfSignificance()     const { return fIp3dPVBSCkf/fIp3dPVBSCkfErr; }
78 >      Double_t             D0PVUB()                      const { return fD0PVUB; }
79 >      Double_t             D0PVUBErr()                   const { return fD0PVUBErr; }
80 >      Double_t             D0PVUBSignificance()          const { return fD0PVUB/fD0PVUBErr; }
81 >      Double_t             Ip3dPVUB()                    const { return fIp3dPVUB; }
82 >      Double_t             Ip3dPVUBErr()                 const { return fIp3dPVUBErr; }
83 >      Double_t             Ip3dPVUBSignificance()        const { return fIp3dPVUB/fIp3dPVUBErr; }
84 >      Double_t             D0PVUBBS()                    const { return fD0PVUBBS; }
85 >      Double_t             D0PVUBBSErr()                 const { return fD0PVUBBSErr; }
86 >      Double_t             D0PVUBBSSignificance()        const { return fD0PVUBBS/fD0PVUBBSErr; }
87 >      Double_t             Ip3dPVUBBS()                  const { return fIp3dPVUBBS; }
88 >      Double_t             Ip3dPVUBBSErr()               const { return fIp3dPVUBBSErr; }
89 >      Double_t             Ip3dPVUBBSSignificance()      const { return fIp3dPVUBBS/fIp3dPVUBBSErr; }
90 >      Double_t             D0PVUBCkf()                   const { return fD0PVUBCkf; }
91 >      Double_t             D0PVUBCkfErr()                const { return fD0PVUBCkfErr; }
92 >      Double_t             D0PVUBCkfSignificance()       const { return fD0PVUBCkf/fD0PVUBCkfErr; }
93 >      Double_t             Ip3dPVUBCkf()                 const { return fIp3dPVUBCkf; }
94 >      Double_t             Ip3dPVUBCkfErr()              const { return fIp3dPVUBCkfErr; }
95 >      Double_t             Ip3dPVUBCkfSignificance()     const { return fIp3dPVUBCkf/fIp3dPVUBCkfErr; }
96 >      Double_t             D0PVUBBSCkf()                 const { return fD0PVUBBSCkf; }
97 >      Double_t             D0PVUBBSCkfErr()              const { return fD0PVUBBSCkfErr; }
98 >      Double_t             D0PVUBBSCkfSignificance()     const { return fD0PVUBBSCkf/fD0PVUBBSCkfErr; }
99 >      Double_t             Ip3dPVUBBSCkf()               const { return fIp3dPVUBBSCkf; }
100 >      Double_t             Ip3dPVUBBSCkfErr()            const { return fIp3dPVUBBSCkfErr; }
101 >      Double_t             Ip3dPVUBBSCkfSignificance()   const { return fIp3dPVUBBSCkf/fIp3dPVUBBSCkfErr; }
102 >      Double_t             GsfPVCompatibility()          const { return fGsfPVCompatibility; }
103 >      Double_t             GsfPVBSCompatibility()        const { return fGsfPVBSCompatibility; }
104 >      Double_t             GsfPVCompatibilityMatched()   const { return fGsfPVCompatibilityMatched; }
105 >      Double_t             GsfPVBSCompatibilityMatched() const { return fGsfPVBSCompatibilityMatched; }
106 >      Double_t             ConvPartnerDCotTheta()        const { return fConvPartnerDCotTheta; }
107 >      Double_t             ConvPartnerDist()             const { return fConvPartnerDist; }
108 >      Double_t             ConvPartnerRadius()           const { return fConvPartnerRadius; }
109 >      Int_t                ConvFlag()                    const { return fConvFlag; }
110 >      Double_t             CaloIsolation()               const { return fCaloIsolation; } // *DEPRECATED*
111 >      Int_t                Classification()              const { return fClassification; }
112 >      Double_t             CovEtaEta()                   const { return fCovEtaEta; }
113 >      Double_t             CoviEtaiEta()                 const { return fCoviEtaiEta; }
114 >      Double_t             DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
115 >      Double_t             DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
116 >      Double_t             DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
117 >      Double_t             DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
118 >      Double_t             E15()                            const { return fE15; }
119 >      Double_t             E25Max()                         const { return fE25Max; }
120 >      Double_t             E55()                            const { return fE55; }
121 >      Double_t             ESuperClusterOverP()             const { return fESuperClusterOverP; }
122 >      Double_t             ESeedClusterOverPout()           const { return fESeedClusterOverPout; }
123 >      Double_t             ESeedClusterOverPIn()            const;
124 >      Double_t             FBrem()                          const { return fFBrem; }
125 >      Double_t             FBremOld()                       const { return (PIn() - POut())/PIn(); }
126 >      Double_t             FracSharedHits()                 const { return fFracSharedHits; }
127 >      const Track         *GsfTrk()                         const { return fGsfTrackRef.Obj(); }
128 >      Double_t             HadronicOverEm()                 const { return fHadronicOverEm; }
129 >      Double_t             HcalDepth1OverEcal()             const { return fHcalDepth1OverEcal; }
130 >      Double_t             HcalDepth2OverEcal()             const { return fHcalDepth2OverEcal; }
131 >      Bool_t               HasGsfTrk()                      const { return fGsfTrackRef.IsValid(); }
132 >      Bool_t               HasTrackerTrk()                  const { return fTrackerTrackRef.IsValid(); }
133 >      Bool_t               HasSuperCluster()                const { return fSuperClusterRef.IsValid(); }
134 >      Double_t             HcalIsolation()                  const { return fHcalJurassicIsolation; } // *DEPRECATED*
135 >      Double_t             IDLikelihood()                   const { return fIDLikelihood; }
136 >      Bool_t               IsEnergyScaleCorrected()         const { return fIsEnergyScaleCorrected; }
137 >      Bool_t               IsMomentumCorrected()            const { return fIsMomentumCorrected; }
138 >      Bool_t               IsEB()                           const { return fIsEB; }
139 >      Bool_t               IsEE()                           const { return fIsEE; }
140 >      Bool_t               IsEBEEGap()                      const { return fIsEBEEGap; }
141 >      Bool_t               IsEBEtaGap()                     const { return fIsEBEtaGap; }
142 >      Bool_t               IsEBPhiGap()                     const { return fIsEBPhiGap; }
143 >      Bool_t               IsEEDeeGap()                     const { return fIsEEDeeGap; }
144 >      Bool_t               IsEERingGap()                    const { return fIsEERingGap; }
145 >      Bool_t               IsEcalDriven()                   const { return fIsEcalDriven; }
146 >      Bool_t               IsTrackerDriven()                const { return fIsTrackerDriven; }
147 >      Double_t             Mva()                            const { return fMva; }
148 >      Double_t             NumberOfClusters()               const { return fNumberOfClusters; }
149 >      EObjType             ObjType()                        const { return kElectron; }
150 >      Double_t             PassLooseID()                    const { return fPassLooseID; }
151 >      Double_t             PassTightID()                    const { return fPassTightID; }
152 >      Double_t             PIn()                            const { return fPIn; }
153 >      Double_t             POut()                           const { return fPOut; }
154 >      const SuperCluster  *SCluster()                       const { return fSuperClusterRef.Obj(); }
155 >      Double_t             ScPixCharge()                    const { return fScPixCharge; }
156 >                                                            
157 >      Double_t             EcalRecHitIsoDr04()              const { return fEcalJurassicIsolation; }
158 >      Double_t             HcalTowerSumEtDr04()             const { return HcalDepth1TowerSumEtDr04() +
159 >                                                                   HcalDepth2TowerSumEtDr04(); }
160 >      Double_t             HcalDepth1TowerSumEtDr04()       const { return fHcalDepth1TowerSumEtDr04; }
161 >      Double_t             HcalDepth2TowerSumEtDr04()       const { return fHcalDepth2TowerSumEtDr04; }
162 >      Double_t             TrackIsolationDr04()             const { return fTrackIsolationDr04; }
163 >      Double_t             EcalRecHitIsoDr03()              const { return fEcalRecHitSumEtDr03; }
164 >      Double_t             HcalTowerSumEtDr03()             const { return fCaloTowerIsolation; }
165 >      Double_t             HcalDepth1TowerSumEtDr03()       const { return fHcalDepth1TowerSumEtDr03; }
166 >      Double_t             HcalDepth2TowerSumEtDr03()       const { return fHcalDepth2TowerSumEtDr03; }
167 >      Double_t             TrackIsolationDr03()             const { return fTrackIsolation; }
168 >      Double_t             PFChargedHadronIso()             const { return fPFChargedHadronIso; }
169 >      Double_t             PFNeutralHadronIso()             const { return fPFNeutralHadronIso; }
170 >      Double_t             PFPhotonIso()                    const { return fPFPhotonIso; }
171 >      Bool_t               MatchesVertexConversion()        const { return fMatchesVertexConversion; }
172 >      UInt_t               NAmbiguousGsfTracks()            const { return fAmbiguousGsfTracks.Entries(); }
173 >      Bool_t               HasAmbiguousGsfTrack(const Track *t) const { return fAmbiguousGsfTracks.HasObject(t); }
174 >      const Track         *AmbiguousGsfTrack(UInt_t i)      const { return fAmbiguousGsfTracks.At(i); }
175        
176 <      const Track         *BestTrk()               const;
177 <      const Track         *GsfTrk()                const;
178 <      const Track         *TrackerTrk()            const;
179 <      const SuperCluster  *SCluster()              const;
180 <      FourVector           Mom()                   const;
181 <      const Track         *Trk()                   const { return BestTrk();                }
182 <      Double_t    CaloIsolation()                  const { return fCaloIsolation;           }
183 <      Double_t    CaloTowerIsolation()             const { return fCaloTowerIsolation;      }
184 <      Double_t    Classification()                 const { return fClassification;          }
185 <      Double_t    CovEtaEta()                      const { return fCovEtaEta;               }
186 <      Double_t    CovEtaPhi()                      const { return fCovEtaPhi;               }
187 <      Double_t    CovPhiPhi()                      const { return fCovPhiPhi;               }
188 <      Double_t    CoviEtaiEta()                    const { return fCoviEtaiEta;             }
189 <      Double_t    DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
190 <      Double_t    DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
191 <      Double_t    DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
192 <      Double_t    DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
193 <      Double_t    E()                              const;
194 <      Double_t    E33()                            const { return fE33;                     }
195 <      Double_t    E55()                            const { return fE55;                     }
196 <      Double_t    EcalJurassicIsolation()          const { return fEcalJurassicIsolation;   }
197 <      Double_t    ESuperClusterOverP()             const { return fESuperClusterOverP;      }
198 <      Double_t    ESeedClusterOverPout()           const { return fESeedClusterOverPout;    }
199 <      Double_t    ESeedClusterOverPIn()            const;
200 <      Double_t    IDLikelihood()                   const { return fIDLikelihood;            }
201 <      Double_t    IsEnergyScaleCorrected()         const { return fIsEnergyScaleCorrected;  }
202 <      Double_t    IsMomentumCorrected()            const { return fIsMomentumCorrected;     }
203 <      Double_t    HadronicOverEm()                 const { return fHadronicOverEm;          }
204 <      Double_t    HcalIsolation()                  const { return fHcalJurassicIsolation;   }
205 <      Double_t    Mass()                           const { return 0.51099892e-3;            }
206 <      Double_t    NumberOfClusters()               const { return fNumberOfClusters;        }
207 <      EObjType    ObjType()                        const { return kElectron;                }      
208 <      Double_t    PassLooseID()                    const { return fPassLooseID;             }
209 <      Double_t    PassTightID()                    const { return fPassTightID;             }
210 <      Double_t    PIn()                            const { return fPIn;                     }
211 <      Double_t    POut()                           const { return fPOut;                    }
212 <      Double_t    P()                              const;
213 <      Double_t    Pt()                             const;
214 <      Double_t    Px()                             const;
215 <      Double_t    Py()                             const;
216 <      Double_t    Pz()                             const;
217 <      Double_t    TrackIsolation()                 const { return fTrackIsolation;          }
218 <      void        SetGsfTrk(const Track* t)                    
219 <                    { fGsfTrackRef = const_cast<Track*>(t); }
220 <      void        SetTrackerTrk(const Track* t)                
221 <                    { fTrackerTrackRef = const_cast<Track*>(t); }
222 <      void        SetSuperCluster(const SuperCluster* sc)      
223 <                    { fSuperClusterRef = const_cast<SuperCluster*>(sc); }
224 <      void        SetCaloIsolation(Double_t CaloIsolation)      { fCaloIsolation = CaloIsolation;  }
225 <      void        SetCaloTowerIsolation(Double_t TowerIso)      { fCaloTowerIsolation = TowerIso;  }
226 <      void        SetClassification(Double_t x)                 { fClassification = x;             }
227 <      void        SetCovEtaEta(Double_t CovEtaEta)              { fCovEtaEta = CovEtaEta;          }
228 <      void        SetCovEtaPhi(Double_t CovEtaPhi)              { fCovEtaPhi = CovEtaPhi;          }
229 <      void        SetCovPhiPhi(Double_t CovPhiPhi)              { fCovPhiPhi = CovPhiPhi;          }
230 <      void        SetCoviEtaiEta(Double_t CoviEtaiEta)          { fCoviEtaiEta = CoviEtaiEta;      }
231 <      void        SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) { fDeltaEtaSuperClTrkAtVtx = x;    }
232 <      void        SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) { fDeltaEtaSeedClTrkAtCalo = x;    }
233 <      void        SetDeltaPhiSuperClusterTrackAtVtx(Double_t x) { fDeltaPhiSuperClTrkAtVtx = x;    }
234 <      void        SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) { fDeltaPhiSeedClTrkAtCalo = x;    }
235 <      void        SetE33(Double_t E33)                          { fE33 = E33;                      }
236 <      void        SetE55(Double_t E55)                          { fE55 = E55;                      }
237 <      void        SetEcalJurassicIsolation(Double_t iso )       { fEcalJurassicIsolation = iso;    }
238 <      void        SetESuperClusterOverP(Double_t x)             { fESuperClusterOverP = x;         }
239 <      void        SetESeedClusterOverPout(Double_t x)           { fESeedClusterOverPout = x;       }
240 <      void        SetHadronicOverEm(Double_t x)                 { fHadronicOverEm = x;             }
241 <      void        SetIDLikelihood(Double_t likelihood)          { fIDLikelihood = likelihood;      }
242 <      void        SetIsEnergyScaleCorrected(Double_t x)         { fIsEnergyScaleCorrected = x;     }
243 <      void        SetIsMomentumCorrected(Double_t x)            { fIsMomentumCorrected = x;        }
244 <      void        SetHcalIsolation(Double_t iso )               { fHcalJurassicIsolation = iso;    }
245 <      void        SetNumberOfClusters(Double_t x)               { fNumberOfClusters = x;           }
246 <      void        SetPassLooseID(Double_t passLooseID)          { fPassLooseID = passLooseID;      }
247 <      void        SetPassTightID(Double_t passTightID)          { fPassTightID = passTightID;      }
248 <      void        SetPIn(Double_t PIn)                          { fPIn = PIn;                      }
249 <      void        SetPOut(Double_t POut)                        { fPOut = POut;                    }
250 <      void        SetTrackIsolation(Double_t TrackIsolation)    { fTrackIsolation = TrackIsolation;}
176 >      void                 AddAmbiguousGsfTrack(const Track *t)          { fAmbiguousGsfTracks.Add(t); }
177 >      void                 SetCharge(Char_t x)                           { fCharge = x; ClearCharge(); }
178 >      void                 SetScPixCharge(Char_t x)                      { fScPixCharge = x; }
179 >      void                 SetD0PV(Double_t x)                           { fD0PV = x; }
180 >      void                 SetD0PVErr(Double_t x)                        { fD0PVErr = x; }
181 >      void                 SetIp3dPV(Double_t x)                         { fIp3dPV = x; }
182 >      void                 SetIp3dPVErr(Double_t x)                      { fIp3dPVErr = x; }
183 >      void                 SetD0PVBS(Double_t x)                         { fD0PVBS = x; }
184 >      void                 SetD0PVBSErr(Double_t x)                      { fD0PVBSErr = x; }
185 >      void                 SetIp3dPVBS(Double_t x)                       { fIp3dPVBS = x; }
186 >      void                 SetIp3dPVBSErr(Double_t x)                    { fIp3dPVBSErr = x; }
187 >      void                 SetD0PVCkf(Double_t x)                        { fD0PVCkf = x; }
188 >      void                 SetD0PVCkfErr(Double_t x)                     { fD0PVCkfErr = x; }
189 >      void                 SetIp3dPVCkf(Double_t x)                      { fIp3dPVCkf = x; }
190 >      void                 SetIp3dPVCkfErr(Double_t x)                   { fIp3dPVCkfErr = x; }
191 >      void                 SetD0PVBSCkf(Double_t x)                      { fD0PVBSCkf = x; }
192 >      void                 SetD0PVBSCkfErr(Double_t x)                   { fD0PVBSCkfErr = x; }
193 >      void                 SetIp3dPVBSCkf(Double_t x)                    { fIp3dPVBSCkf = x; }
194 >      void                 SetIp3dPVBSCkfErr(Double_t x)                 { fIp3dPVBSCkfErr = x; }
195 >      void                 SetD0PVUB(Double_t x)                         { fD0PVUB = x; }
196 >      void                 SetD0PVUBErr(Double_t x)                      { fD0PVUBErr = x; }
197 >      void                 SetIp3dPVUB(Double_t x)                       { fIp3dPVUB = x; }
198 >      void                 SetIp3dPVUBErr(Double_t x)                    { fIp3dPVUBErr = x; }
199 >      void                 SetD0PVUBBS(Double_t x)                       { fD0PVUBBS = x; }
200 >      void                 SetD0PVUBBSErr(Double_t x)                    { fD0PVUBBSErr = x; }
201 >      void                 SetIp3dPVUBBS(Double_t x)                     { fIp3dPVUBBS = x; }
202 >      void                 SetIp3dPVUBBSErr(Double_t x)                  { fIp3dPVUBBSErr = x; }
203 >      void                 SetD0PVUBCkf(Double_t x)                      { fD0PVUBCkf = x; }
204 >      void                 SetD0PVUBCkfErr(Double_t x)                   { fD0PVUBCkfErr = x; }
205 >      void                 SetIp3dPVUBCkf(Double_t x)                    { fIp3dPVUBCkf = x; }
206 >      void                 SetIp3dPVUBCkfErr(Double_t x)                 { fIp3dPVUBCkfErr = x; }
207 >      void                 SetD0PVUBBSCkf(Double_t x)                    { fD0PVUBBSCkf = x; }
208 >      void                 SetD0PVUBBSCkfErr(Double_t x)                 { fD0PVUBBSCkfErr = x; }
209 >      void                 SetIp3dPVUBBSCkf(Double_t x)                  { fIp3dPVUBBSCkf = x; }
210 >      void                 SetIp3dPVUBBSCkfErr(Double_t x)               { fIp3dPVUBBSCkfErr = x; }
211 >      void                 SetGsfPVCompatibility(Double_t x)             { fGsfPVCompatibility = x; }
212 >      void                 SetGsfPVBSCompatibility(Double_t x)           { fGsfPVBSCompatibility = x; }
213 >      void                 SetGsfPVCompatibilityMatched(Double_t x)      { fGsfPVCompatibilityMatched = x; }
214 >      void                 SetGsfPVBSCompatibilityMatched(Double_t x)    { fGsfPVBSCompatibilityMatched = x; }
215 >      void                 SetConvPartnerDCotTheta(Double_t x)           { fConvPartnerDCotTheta = x; }
216 >      void                 SetConvPartnerDist(Double_t x)                { fConvPartnerDist = x; }
217 >      void                 SetConvPartnerRadius(Double_t x)              { fConvPartnerRadius = x; }
218 >      void                 SetConvFlag(Int_t n)                          { fConvFlag = n; }
219 >      void                 SetClassification(Int_t x)                    { fClassification = x; }
220 >      void                 SetCovEtaEta(Double_t x)                      { fCovEtaEta = x; }
221 >      void                 SetCoviEtaiEta(Double_t x)                    { fCoviEtaiEta = x; }
222 >      void                 SetDeltaEtaSuperClusterTrackAtVtx(Double_t x)  
223 >                             { fDeltaEtaSuperClTrkAtVtx = x; }
224 >      void                 SetDeltaEtaSeedClusterTrackAtCalo(Double_t x)  
225 >                             { fDeltaEtaSeedClTrkAtCalo = x; }
226 >      void                 SetDeltaPhiSuperClusterTrackAtVtx(Double_t x)  
227 >                             { fDeltaPhiSuperClTrkAtVtx = x; }
228 >      void                 SetDeltaPhiSeedClusterTrackAtCalo(Double_t x)  
229 >                             { fDeltaPhiSeedClTrkAtCalo = x; }
230 >      void                 SetE15(Double_t x)                     { fE15 = x; }
231 >      void                 SetE25Max(Double_t x)                  { fE25Max = x; }
232 >      void                 SetE55(Double_t x)                     { fE55 = x; }
233 >      void                 SetESeedClusterOverPout(Double_t x)    { fESeedClusterOverPout = x; }
234 >      void                 SetESuperClusterOverP(Double_t x)      { fESuperClusterOverP = x; }
235 >      void                 SetFBrem(Double_t x)                   { fFBrem = x; }
236 >      void                 SetFracSharedHits(Double_t x)          { fFracSharedHits = x; }
237 >      void                 SetGsfTrk(const Track* t)                    
238 >                             { fGsfTrackRef = t; ClearCharge(); }
239 >      void                 SetHadronicOverEm(Double_t x)          { fHadronicOverEm = x; }
240 >      void                 SetHcalDepth1OverEcal(Double_t x)      { fHcalDepth1OverEcal = x; }
241 >      void                 SetHcalDepth2OverEcal(Double_t x)      { fHcalDepth2OverEcal = x; }
242 >      void                 SetIDLikelihood(Double_t x)            { fIDLikelihood = x; }
243 >      void                 SetIsEnergyScaleCorrected(Bool_t x)    { fIsEnergyScaleCorrected = x; }
244 >      void                 SetIsMomentumCorrected(Bool_t x)       { fIsMomentumCorrected = x; }
245 >      void                 SetNumberOfClusters(Double_t x)        { fNumberOfClusters = x; }
246 >      void                 SetPIn(Double_t pIn)                   { fPIn = pIn; }
247 >      void                 SetPOut(Double_t pOut)                 { fPOut = pOut; }
248 >      void                 SetPassLooseID(Double_t passLooseID)   { fPassLooseID = passLooseID; }
249 >      void                 SetPassTightID(Double_t passTightID)   { fPassTightID = passTightID; }
250 >      void                 SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi);
251 >      void                 SetSuperCluster(const SuperCluster* sc)
252 >                             { fSuperClusterRef = sc; }
253 >      void                 SetTrackerTrk(const Track* t)                
254 >                             { fTrackerTrackRef = t; ClearCharge(); }
255 >      void                 SetConvPartnerTrk(const Track *t)
256 >                             { fConvPartnerTrackRef = t; }
257 >      void                 SetEcalRecHitIsoDr04(Double_t x)        { fEcalJurassicIsolation = x; }
258 >      void                 SetHcalDepth1TowerSumEtDr04(Double_t x) { fHcalDepth1TowerSumEtDr04 = x; }
259 >      void                 SetHcalDepth2TowerSumEtDr04(Double_t x) { fHcalDepth2TowerSumEtDr04 = x; }
260 >      void                 SetTrackIsolationDr04(Double_t x)       { fTrackIsolationDr04 = x; }
261 >      void                 SetEcalRecHitIsoDr03(Double_t x)        { fEcalRecHitSumEtDr03 = x; }
262 >      void                 SetHcalTowerSumEtDr03(Double_t x)       { fCaloTowerIsolation = x; }
263 >      void                 SetHcalDepth1TowerSumEtDr03(Double_t x) { fHcalDepth1TowerSumEtDr03 = x; }
264 >      void                 SetHcalDepth2TowerSumEtDr03(Double_t x) { fHcalDepth2TowerSumEtDr03 = x; }
265 >      void                 SetTrackIsolationDr03(Double_t x)       { fTrackIsolation = x; }
266 >      void                 SetPFChargedHadronIso(Double_t x)       { fPFChargedHadronIso = x; }
267 >      void                 SetPFNeutralHadronIso(Double_t x)       { fPFNeutralHadronIso = x; }
268 >      void                 SetPFPhotonIso(Double_t x)              { fPFPhotonIso = x; }
269 >      void                 SetMva(Double_t x)                      { fMva = x; }
270 >      void                 SetIsEB(Bool_t b)                       { fIsEB = b; }
271 >      void                 SetIsEE(Bool_t b)                       { fIsEE = b; }
272 >      void                 SetIsEBEEGap(Bool_t b)                  { fIsEBEEGap = b; }
273 >      void                 SetIsEBEtaGap(Bool_t b)                 { fIsEBEtaGap = b; }
274 >      void                 SetIsEBPhiGap(Bool_t b)                 { fIsEBPhiGap = b; }
275 >      void                 SetIsEEDeeGap(Bool_t b)                 { fIsEEDeeGap = b; }
276 >      void                 SetIsEERingGap(Bool_t b)                { fIsEERingGap = b; }
277 >      void                 SetIsEcalDriven(Bool_t b)               { fIsEcalDriven = b; }
278 >      void                 SetIsTrackerDriven(Bool_t b)            { fIsTrackerDriven = b; }
279 >      void                 SetMatchesVertexConversion(Bool_t b)    { fMatchesVertexConversion = b; }
280 >      void                 SetConversionXYZ(Double_t x, Double_t y, Double_t z)
281 >                                  { fConvPosition.SetXYZ(x,y,z); }
282 >      
283 >    
284 >      const Track         *TrackerTrk()            const { return fTrackerTrackRef.Obj(); }
285 >      const Track         *Trk()                   const { return BestTrk(); }
286 >      const Track         *ConvPartnerTrk()        const { return fConvPartnerTrackRef.Obj(); }
287 >
288 >      // Some structural tools
289 >      void                 Mark()                  const;
290  
291      protected:
292 <      TRef        fGsfTrackRef;               //global combined track reference
293 <      TRef        fTrackerTrackRef;           //tracker track reference
294 <      TRef        fSuperClusterRef;           //reference to SuperCluster
295 <      Double_t    fESuperClusterOverP;        //
296 <      Double_t    fESeedClusterOverPout;      //
297 <      Double_t    fDeltaEtaSuperClTrkAtVtx;   //
298 <      Double_t    fDeltaEtaSeedClTrkAtCalo;   //
299 <      Double_t    fDeltaPhiSuperClTrkAtVtx;   //
300 <      Double_t    fDeltaPhiSeedClTrkAtCalo;   //
301 <      Double_t    fHadronicOverEm;            //
302 <      Double_t    fIsEnergyScaleCorrected;    //
303 <      Double_t    fIsMomentumCorrected;       //
304 <      Double_t    fNumberOfClusters;          //
305 <      Double_t    fClassification;            //
306 <      Double_t    fE33;                       //
307 <      Double_t    fE55;                       //
308 <      Double_t    fCovEtaEta;                 //
309 <      Double_t    fCoviEtaiEta;               //
310 <      Double_t    fCovEtaPhi;                 //
311 <      Double_t    fCovPhiPhi;                 //
312 <      Double_t    fCaloIsolation;             //
313 <      Double_t    fCaloTowerIsolation;        //
314 <      Double_t    fTrackIsolation;            //
315 <      Double_t    fEcalJurassicIsolation;     //
316 <      Double_t    fHcalJurassicIsolation;     //
317 <      Double_t    fPassLooseID;               //
318 <      Double_t    fPassTightID;               //
319 <      Double_t    fIDLikelihood;              //
320 <      Double_t    fPIn;                       //
321 <      Double_t    fPOut;                      //
292 >      Double_t             GetCharge()             const;
293 >      Double_t             GetMass()               const { return 0.51099892e-3; }
294 >      void                 GetMom()                const;
295 >
296 >      Vect3C               fMom;                       //stored three-momentum
297 >      Char_t               fCharge;                    //stored charge - filled with -99 when reading old files
298 >      Char_t               fScPixCharge;               //charge from supercluster-pixel matching
299 >      Ref<Track>           fGsfTrackRef;               //gsf track reference
300 >      Ref<Track>           fTrackerTrackRef;           //tracker track reference
301 >      Ref<Track>           fConvPartnerTrackRef;       //conversion partner track reference
302 >      Ref<SuperCluster>    fSuperClusterRef;           //reference to SuperCluster
303 >      Double32_t           fESuperClusterOverP;        //[0,0,14]super cluster e over p ratio
304 >      Double32_t           fESeedClusterOverPout;      //[0,0,14]seed cluster e over p mom
305 >      Double32_t           fDeltaEtaSuperClTrkAtVtx;   //[0,0,14]delta eta of super cluster with trk
306 >      Double32_t           fDeltaEtaSeedClTrkAtCalo;   //[0,0,14]delta eta of seeed cluster with trk
307 >      Double32_t           fDeltaPhiSuperClTrkAtVtx;   //[0,0,14]delta phi of super cluster with trk
308 >      Double32_t           fDeltaPhiSeedClTrkAtCalo;   //[0,0,14]delta phi of seeed cluster with trk
309 >      Double32_t           fFBrem;                     //[0,0,14]brem fraction
310 >      Double32_t           fHadronicOverEm;            //[0,0,14]hadronic over em fraction *DEPRECATED*
311 >      Double32_t           fHcalDepth1OverEcal;        //[0,0,14]hadronic over em fraction depth1
312 >      Double32_t           fHcalDepth2OverEcal;        //[0,0,14]hadronic over em fraction depth2
313 >      Double32_t           fNumberOfClusters;          //[0,0,14]number of associated clusters
314 >      Double32_t           fE15;                       //[0,0,14]1x5 crystal energy
315 >      Double32_t           fE25Max;                    //[0,0,14]2x5 crystal energy (max of two possible sums)
316 >      Double32_t           fE55;                       //[0,0,14]5x5 crystal energy
317 >      Double32_t           fCovEtaEta;                 //[0,0,14]variance eta-eta
318 >      Double32_t           fCoviEtaiEta;               //[0,0,14]covariance eta-eta (in crystals)
319 >      Double32_t           fCaloIsolation;             //[0,0,14](non-jura) ecal isolation based on rechits dR 0.3 *DEPRECATED*
320 >      Double32_t           fHcalJurassicIsolation;     //[0,0,14]hcal jura iso dR 0.4 *DEPRECATED*
321 >      Double32_t           fHcalDepth1TowerSumEtDr04;  //[0,0,14]hcal depth1 tower based isolation dR 0.4
322 >      Double32_t           fHcalDepth2TowerSumEtDr04;  //[0,0,14]hcal depth2 tower based isolation dR 0.4
323 >      Double32_t           fEcalJurassicIsolation;     //[0,0,14]ecal jura iso dR 0.4 *RENAMING*
324 >      Double32_t           fTrackIsolationDr04;        //[0,0,14]isolation based on tracks dR 0.4
325 >      Double32_t           fCaloTowerIsolation;        //[0,0,14]hcal tower based isolation dR 0.3 *DEPRECATED*
326 >      Double32_t           fHcalDepth1TowerSumEtDr03;  //[0,0,14]hcal depth1 tower based isolation dR 0.3
327 >      Double32_t           fHcalDepth2TowerSumEtDr03;  //[0,0,14]hcal depth2 tower based isolation dR 0.3
328 >      Double32_t           fEcalRecHitSumEtDr03;       //[0,0,14]ecal jura iso dR 0.3
329 >      Double32_t           fTrackIsolation;            //[0,0,14]isolation based on tracks dR 0.3 *RENAMING*
330 >      Double32_t           fPassLooseID;               //[0,0,14]pass loose id
331 >      Double32_t           fPassTightID;               //[0,0,14]pass tight id
332 >      Double32_t           fIDLikelihood;              //[0,0,14]likelihood value
333 >      Double32_t           fPIn;                       //[0,0,14]momentum at vtx
334 >      Double32_t           fPOut;                      //[0,0,14]momentum at ecal surface
335 >      Double32_t           fFracSharedHits;            //[0,0,14]fraction of shared hits btw gsf and std. track
336 >      Double32_t           fMva;                       //[0,0,14] pflow mva output
337 >      Double32_t           fD0PV;                      //[0,0,14]transverse impact parameter to signal PV (gsf track)
338 >      Double32_t           fD0PVErr;                   //[0,0,14]transverse impact parameter uncertainty to signal PV (gsf track)
339 >      Double32_t           fIp3dPV;                    //[0,0,14]3d impact parameter to signal PV (gsf track)
340 >      Double32_t           fIp3dPVErr;                 //[0,0,14]3d impact parameter uncertainty to signal PV (gsf track)
341 >      Double32_t           fD0PVBS;                    //[0,0,14]transverse impact parameter to signal PV w/ bs constraint (gsf track)
342 >      Double32_t           fD0PVBSErr;                 //[0,0,14]transverse impact parameter uncertainty to signal PV w/ bs constraint (gsf track)
343 >      Double32_t           fIp3dPVBS;                  //[0,0,14]3d impact parameter to signal PV w/ bs constraint (gsf track)
344 >      Double32_t           fIp3dPVBSErr;               //[0,0,14]3d impact parameter uncertainty to signal PV w/ bs constraint (gsf track)
345 >      Double32_t           fD0PVCkf;                      //[0,0,14]transverse impact parameter to signal PV (ckf track)
346 >      Double32_t           fD0PVCkfErr;                   //[0,0,14]transverse impact parameter uncertainty to signal PV (ckf track)
347 >      Double32_t           fIp3dPVCkf;                    //[0,0,14]3d impact parameter to signal PV (ckf track)
348 >      Double32_t           fIp3dPVCkfErr;                 //[0,0,14]3d impact parameter uncertainty to signal PV (ckf track)
349 >      Double32_t           fD0PVBSCkf;                    //[0,0,14]transverse impact parameter to signal PV w/ bs constraint (ckf track)
350 >      Double32_t           fD0PVBSCkfErr;                 //[0,0,14]transverse impact parameter uncertainty to signal PV w/ bs constraint (ckf track)
351 >      Double32_t           fIp3dPVBSCkf;                  //[0,0,14]3d impact parameter to signal PV w/ bs constraint (ckf track)
352 >      Double32_t           fIp3dPVBSCkfErr;               //[0,0,14]3d impact parameter uncertainty to signal PV w/ bs constraint (ckf track)
353 >      Double32_t           fD0PVUB;                      //[0,0,14]transverse impact parameter to signal PVUB (gsf track)
354 >      Double32_t           fD0PVUBErr;                   //[0,0,14]transverse impact parameter uncertainty to signal PVUB (gsf track)
355 >      Double32_t           fIp3dPVUB;                    //[0,0,14]3d impact parameter to signal PVUB (gsf track)
356 >      Double32_t           fIp3dPVUBErr;                 //[0,0,14]3d impact parameter uncertainty to signal PVUB (gsf track)
357 >      Double32_t           fD0PVUBBS;                    //[0,0,14]transverse impact parameter to signal PVUB w/ bs constraint (gsf track)
358 >      Double32_t           fD0PVUBBSErr;                 //[0,0,14]transverse impact parameter uncertainty to signal PVUB w/ bs constraint (gsf track)
359 >      Double32_t           fIp3dPVUBBS;                  //[0,0,14]3d impact parameter to signal PVUB w/ bs constraint (gsf track)
360 >      Double32_t           fIp3dPVUBBSErr;               //[0,0,14]3d impact parameter uncertainty to signal PVUB w/ bs constraint (gsf track)
361 >      Double32_t           fD0PVUBCkf;                      //[0,0,14]transverse impact parameter to signal PVUB (ckf track)
362 >      Double32_t           fD0PVUBCkfErr;                   //[0,0,14]transverse impact parameter uncertainty to signal PVUB (ckf track)
363 >      Double32_t           fIp3dPVUBCkf;                    //[0,0,14]3d impact parameter to signal PVUB (ckf track)
364 >      Double32_t           fIp3dPVUBCkfErr;                 //[0,0,14]3d impact parameter uncertainty to signal PVUB (ckf track)
365 >      Double32_t           fD0PVUBBSCkf;                    //[0,0,14]transverse impact parameter to signal PVUB w/ bs constraint (ckf track)
366 >      Double32_t           fD0PVUBBSCkfErr;                 //[0,0,14]transverse impact parameter uncertainty to signal PVUB w/ bs constraint (ckf track)
367 >      Double32_t           fIp3dPVUBBSCkf;                  //[0,0,14]3d impact parameter to signal PVUB w/ bs constraint (ckf track)
368 >      Double32_t           fIp3dPVUBBSCkfErr;               //[0,0,14]3d impact parameter uncertainty to signal PVUB w/ bs constraint (ckf track)
369 >      Double32_t           fGsfPVCompatibility;        //[0,0,14]gsf compatibility with signal PV
370 >      Double32_t           fGsfPVBSCompatibility;      //[0,0,14]gsf compatibility with signal PV w/ bs constraint
371 >      Double32_t           fGsfPVCompatibilityMatched; //[0,0,14]gsf compatibility with signal PV (matching ckf track excluded from vertex)
372 >      Double32_t           fGsfPVBSCompatibilityMatched; //[0,0,14]gsf compatibility with signal PV w/ bs constraint (matching ckf track excluded from vertex)
373 >      Double32_t           fConvPartnerDCotTheta;      //[0,0,14]delta cot theta to nearest conversion partner track
374 >      Double32_t           fConvPartnerDist;           //[0,0,14]distance in x-y plane to nearest conversion partner track
375 >      Double32_t           fConvPartnerRadius;         //[0,0,14]radius of helix intersection with conversion partner track
376 >      Double32_t           fPFChargedHadronIso;        //[0,0,14]pf isolation, charged hadrons
377 >      Double32_t           fPFNeutralHadronIso;        //[0,0,14]pf isolation, neutral hadrons
378 >      Double32_t           fPFPhotonIso;               //[0,0,14]pf isolation, photons
379 >      Int_t                fConvFlag;                  //conversion flag indicating which track combination was used
380 >      Vect3C               fConvPosition;
381 >      Bool_t               fIsEnergyScaleCorrected;    //class dependent escale correction
382 >      Bool_t               fIsMomentumCorrected;       //class dependent E-p combination
383 >      Int_t                fClassification;            //classification (see GsfElectron.h)
384 >      Bool_t               fIsEB;                      //is ECAL barrel
385 >      Bool_t               fIsEE;                      //is ECAL Endcap
386 >      Bool_t               fIsEBEEGap;                 //is in barrel-endcap gap
387 >      Bool_t               fIsEBEtaGap;                //is in EB eta module gap
388 >      Bool_t               fIsEBPhiGap;                //is in EB phi module gap
389 >      Bool_t               fIsEEDeeGap;                //is in EE dee gap
390 >      Bool_t               fIsEERingGap;               //is in EE ring gap
391 >      Bool_t               fIsEcalDriven;              //is std. egamma electron
392 >      Bool_t               fIsTrackerDriven;           //is pflow track-seeded electron
393 >      Bool_t               fMatchesVertexConversion;
394 >      RefArray<Track>      fAmbiguousGsfTracks;        //ambiguous gsf tracks for this electron
395  
396 <    ClassDef(Electron, 1) // Electron class
396 >    ClassDef(Electron, 12) // Electron class
397    };
398   }
399  
400   //--------------------------------------------------------------------------------------------------
401 + inline void mithep::Electron::Mark() const
402 + {
403 +  // mark myself
404 +  mithep::DataObject::Mark();
405 +  // mark my dependencies if they are there
406 +  if (HasSuperCluster())
407 +    SCluster()->Mark();
408 +  if (HasGsfTrk())
409 +    GsfTrk()->Mark();
410 +  if (HasTrackerTrk())
411 +    TrackerTrk()->Mark();
412 +  if (fConvPartnerTrackRef.IsValid())
413 +    ConvPartnerTrk()->Mark();
414 +  for (UInt_t i=0; i<NAmbiguousGsfTracks(); i++)
415 +    fAmbiguousGsfTracks.At(i)->Mark();
416 + }
417 +  
418 + //--------------------------------------------------------------------------------------------------
419   inline const mithep::Track *mithep::Electron::BestTrk() const
420   {
421    // Return "best" track.
422  
423 <  if (GsfTrk())
423 >  if (HasGsfTrk())
424      return GsfTrk();
425 <  else if (TrackerTrk())
425 >  else if (HasTrackerTrk())
426      return TrackerTrk();
427  
428    return 0;
429   }
430  
431   //--------------------------------------------------------------------------------------------------
432 < inline const mithep::Track *mithep::Electron::GsfTrk() const
159 < {
160 <  // Return global combined track.
161 <
162 <  return static_cast<const Track*>(fGsfTrackRef.GetObject());
163 < }
164 <
165 < //--------------------------------------------------------------------------------------------------
166 < inline const mithep::Track *mithep::Electron::TrackerTrk() const
432 > inline Double_t mithep::Electron::GetCharge() const
433   {
434 <  // Return tracker track.
434 >  // Return stored charge, unless it is set to invalid (-99),
435 >  // in that case get charge from track as before
436  
437 <  return static_cast<const Track*>(fTrackerTrackRef.GetObject());
438 < }
439 < //--------------------------------------------------------------------------------------------------
440 < inline const mithep::SuperCluster *mithep::Electron::SCluster() const
174 < {
175 <  // Return super cluster.
437 >  if (fCharge==-99)
438 >    return mithep::ChargedParticle::GetCharge();
439 >  else
440 >    return fCharge;
441  
177  return static_cast<const SuperCluster*>(fSuperClusterRef.GetObject());
442   }
443  
444 < //-------------------------------------------------------------------------------------------------
445 < inline mithep::FourVector mithep::Electron::Mom() const
444 > //--------------------------------------------------------------------------------------------------
445 > inline void mithep::Electron::GetMom() const
446   {
447 <  // Return momentum of the electron. We use the direction of the
448 <  // track and the energy of the SuperCluster.
447 >  // Get momentum of the electron. We use an explicitly stored three vector, with the pdg mass,
448 >  // since the momentum vector may be computed non-trivially in cmssw
449  
450 <  return FourVector(Px(), Py(), Pz(), E());
450 >  fCachedMom.SetCoordinates(fMom.Rho(),fMom.Eta(),fMom.Phi(),GetMass());
451   }
452  
453   //-------------------------------------------------------------------------------------------------
# Line 196 | Line 460 | inline Double_t mithep::Electron::ESeedC
460   }
461  
462   //-------------------------------------------------------------------------------------------------
463 < inline Double_t mithep::Electron::E() const
200 < {
201 <  // Return energy of the SuperCluster if present
202 <  // or else return energy derived from the track.
203 <  
204 <  const mithep::SuperCluster *sc = SCluster();
205 <  if (sc)
206 <    return sc->Energy();
207 <  else
208 <    return TMath::Sqrt(Trk()->P()*Trk()->P() + Mass()*Mass());
209 < }
210 <
211 < //-------------------------------------------------------------------------------------------------
212 < inline Double_t mithep::Electron::P() const
463 > inline void mithep::Electron::SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi)
464   {
465 <  // Return momentum derived from the SuperCluster if present
215 <  // or else return momentum from the track.
465 >  // Set three-vector
466    
467 <  const mithep::SuperCluster *sc = SCluster();
468 <  if (sc)
219 <    return TMath::Sqrt(sc->Energy()*sc->Energy() - Mass()*Mass());
220 <  else
221 <    return Trk()->P();
222 < }
223 <
224 < //-------------------------------------------------------------------------------------------------
225 < inline Double_t mithep::Electron::Px() const
226 < {
227 <  // Return px.
228 <
229 <  return Pt()*TMath::Cos(Trk()->Phi());
230 < }
231 <
232 < //-------------------------------------------------------------------------------------------------
233 < inline Double_t mithep::Electron::Py() const
234 < {
235 <  // Return py.
236 <
237 <  return Pt()*TMath::Sin(Trk()->Phi());
238 < }
239 <
240 < //-------------------------------------------------------------------------------------------------
241 < inline Double_t mithep::Electron::Pz() const
242 < {
243 <  // Return pz.
244 <
245 <  return P()*TMath::Sin(Trk()->Lambda());
246 < }
247 <
248 < //-------------------------------------------------------------------------------------------------
249 < inline Double_t mithep::Electron::Pt() const
250 < {
251 <  // Return pt.
252 <
253 <  return TMath::Abs(P()*TMath::Cos(Trk()->Lambda()));
467 >  fMom.Set(pt,eta,phi);
468 >  ClearMom();
469   }
470   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines