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.30 by loizides, Fri Mar 20 18:23:27 2009 UTC vs.
Revision 1.31 by bendavid, Fri Mar 20 18:44:17 2009 UTC

# Line 88 | Line 88 | namespace mithep
88        void                 SetESuperClusterOverP(Double_t x)      { fESuperClusterOverP = x;       }
89        void                 SetEcalJurassicIso(Double_t iso )      { fEcalJurassicIsolation = iso;  }
90        void                 SetGsfTrk(const Track* t)                    
91 <                             { fGsfTrackRef = t; ClearMom(); ClearCharge(); }
91 >                             { fGsfTrackRef = t; ClearCharge(); }
92        void                 SetHadronicOverEm(Double_t x)          { fHadronicOverEm = x;           }
93        void                 SetHcalIsolation(Double_t iso )        { fHcalJurassicIsolation = iso;  }
94        void                 SetIDLikelihood(Double_t likelihood)   { fIDLikelihood = likelihood;    }
# Line 99 | Line 99 | namespace mithep
99        void                 SetPOut(Double_t POut)                 { fPOut = POut;                  }
100        void                 SetPassLooseID(Double_t passLooseID)   { fPassLooseID = passLooseID;    }
101        void                 SetPassTightID(Double_t passTightID)   { fPassTightID = passTightID;    }
102 <      void                 SetSuperCluster(const SuperCluster* sc)      
103 <                             { fSuperClusterRef = sc; ClearMom(); }
102 >      void                 SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi);
103 >      void                 SetSuperCluster(const SuperCluster* sc)
104 >                             { fSuperClusterRef = sc; }
105        void                 SetTrackerTrk(const Track* t)                
106 <                             { fTrackerTrackRef = t; ClearMom(); ClearCharge(); }
106 >                             { fTrackerTrackRef = t; ClearCharge(); }
107        void                 SetTrackIsolation(Double_t trkiso)     { fTrackIsolation = trkiso;      }
108        const Track         *TrackerTrk()            const { return fTrackerTrackRef.Obj();          }
109        Double_t             TrackIsolation()        const { return fTrackIsolation;                 }
# Line 112 | Line 113 | namespace mithep
113        Double_t             GetMass()               const          { return 0.51099892e-3;          }
114        void                 GetMom()                const;
115  
116 +      Vect3C               fMom;                       //stored three-momentum
117        Ref<Track>           fGsfTrackRef;               //gsf track reference
118        Ref<Track>           fTrackerTrackRef;           //tracker track reference
119        Ref<SuperCluster>    fSuperClusterRef;           //reference to SuperCluster
# Line 163 | Line 165 | inline const mithep::Track *mithep::Elec
165   //--------------------------------------------------------------------------------------------------
166   inline void mithep::Electron::GetMom() const
167   {
168 <  // Get momentum of the electron. We use the direction of the
169 <  // track and the energy of the SuperCluster.
168 >  // Get momentum of the electron. We use an explicitly stored three vector, with the pdg mass,
169 >  // since the momentum vector may be computed non-trivially in cmssw
170  
171 <  const mithep::Track *trk = Trk();
170 <
171 <  if (!trk) {
172 <    fCachedMom.SetCoordinates(0,0,0,0);
173 <    return;
174 <  }
175 <
176 <  Double_t p = 0;
177 <  Double_t mass = GetMass();
178 <
179 <  const mithep::SuperCluster *sc = SCluster();
180 <  if (sc)
181 <    p = TMath::Sqrt(sc->Energy()*sc->Energy() - mass*mass);
182 <  else
183 <    p = trk->P();
184 <
185 <  Double_t pt = TMath::Abs(p*TMath::Cos(trk->Lambda()));
186 <  fCachedMom.SetCoordinates(pt,trk->Eta(),trk->Phi(),mass);
171 >  fCachedMom.SetCoordinates(fMom.Rho(),fMom.Eta(),fMom.Phi(),GetMass());
172   }
173  
174   //-------------------------------------------------------------------------------------------------
# Line 194 | Line 179 | inline Double_t mithep::Electron::ESeedC
179    
180    return SCluster()->Seed()->Energy() / PIn();
181   }
182 +
183 + //-------------------------------------------------------------------------------------------------
184 + inline void mithep::Electron::SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi)
185 + {
186 +  // Set three-vector
187 +  
188 +  fMom.Set(pt,eta,phi);
189 +  ClearMom();
190 + }
191   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines