ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootMuon.h
(Generate patch)

Comparing UserCode/Morgan/interface/TRootMuon.h (file contents):
Revision 1.5 by lethuill, Wed Dec 17 16:23:49 2008 UTC vs.
Revision 1.9 by lethuill, Tue Apr 14 16:50:16 2009 UTC

# Line 3 | Line 3
3  
4   #include "../interface/TRootParticle.h"
5  
6
6   using namespace std;
7  
8   class TRootMuon : public TRootParticle
9   {
10 <        
10 >
11   public:
12 <        
12 >
13          TRootMuon() :
14                  TRootParticle()
15                  ,et_em_(-9999.)
# Line 38 | Line 37 | public:
37                  ,direction_(-9999)
38                  ,algo_(-9999)
39                  ,id_(-9999)
40 <                ,momentumMCMuon_()
41 <                ,vertexMCMuon_()
42 <                ,pdgIdMCMuon_(0)
40 >                ,pixelLayersWithMeasurement_(-1)
41 >                ,stripLayersWithMeasurement_(-1)
42 >                ,d0_(-9999.)
43 >                ,d0Error_(-9999.)
44 >                ,dsz_(-9999.)
45 >                ,dszError_(-9999.)
46 >                ,normalizedChi2_(-9999.)
47 >                ,ptError_(-9999.)
48 >                ,etaError_(-9999.)
49 >                ,phiError_(-9999.)
50                  {;}
51 <                        
51 >
52          TRootMuon(const TRootMuon& muon) :
53                  TRootParticle(muon)
54                  ,et_em_(muon.et_em_)
# Line 70 | Line 76 | public:
76                  ,direction_(muon.direction_)
77                  ,algo_(muon.algo_)
78                  ,id_(muon.id_)
79 <                ,momentumMCMuon_(muon.momentumMCMuon_)
80 <                ,vertexMCMuon_(muon.vertexMCMuon_)
81 <                ,pdgIdMCMuon_(muon.pdgIdMCMuon_)
79 >                ,pixelLayersWithMeasurement_(muon.pixelLayersWithMeasurement_)
80 >                ,stripLayersWithMeasurement_(muon.stripLayersWithMeasurement_)
81 >                ,d0_(muon.d0_)
82 >                ,d0Error_(muon.d0Error_)
83 >                ,dsz_(muon.dsz_)
84 >                ,dszError_(muon.dszError_)
85 >                ,normalizedChi2_(muon.normalizedChi2_)
86 >                ,ptError_(muon.ptError_)
87 >                ,etaError_(muon.etaError_)
88 >                ,phiError_(muon.phiError_)
89                  {;}
90 <                                
90 >
91          TRootMuon(Double_t px, Double_t py, Double_t pz, Double_t e) :
92                  TRootParticle(px,py,pz,e)
93                  ,et_em_(-9999.)
# Line 102 | Line 115 | public:
115                  ,direction_(-9999)
116                  ,algo_(-9999)
117                  ,id_(-9999)
118 <                ,momentumMCMuon_()
119 <                ,vertexMCMuon_()
120 <                ,pdgIdMCMuon_(0)
118 >                ,pixelLayersWithMeasurement_(-1)
119 >                ,stripLayersWithMeasurement_(-1)
120 >                ,d0_(-9999.)
121 >                ,d0Error_(-9999.)
122 >                ,dsz_(-9999.)
123 >                ,dszError_(-9999.)
124 >                ,normalizedChi2_(-9999.)
125 >                ,ptError_(-9999.)
126 >                ,etaError_(-9999.)
127 >                ,phiError_(-9999.)
128                  {;}
129 <        
129 >
130          TRootMuon(Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vtx_x, Double_t vtx_y, Double_t vtx_z) :
131                  TRootParticle(px,py,pz,e,vtx_x,vtx_y,vtx_z)
132                  ,et_em_(-9999.)
# Line 134 | Line 154 | public:
154                  ,direction_(-9999)
155                  ,algo_(-9999)
156                  ,id_(-9999)
157 <                ,momentumMCMuon_()
158 <                ,vertexMCMuon_()
159 <                ,pdgIdMCMuon_(0)
157 >                ,pixelLayersWithMeasurement_(-1)
158 >                ,stripLayersWithMeasurement_(-1)
159 >                ,d0_(-9999.)
160 >                ,d0Error_(-9999.)
161 >                ,dsz_(-9999.)
162 >                ,dszError_(-9999.)
163 >                ,normalizedChi2_(-9999.)
164 >                ,ptError_(-9999.)
165 >                ,etaError_(-9999.)
166 >                ,phiError_(-9999.)
167                  {;}
168 <        
168 >
169          TRootMuon(Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vtx_x, Double_t vtx_y, Double_t vtx_z, Int_t type, Float_t charge) :
170                  TRootParticle(px,py,pz,e,vtx_x,vtx_y,vtx_z,type,charge)
171                  ,et_em_(-9999.)
# Line 166 | Line 193 | public:
193                  ,direction_(-9999)
194                  ,algo_(-9999)
195                  ,id_(-9999)
196 <                ,momentumMCMuon_()
197 <                ,vertexMCMuon_()
198 <                ,pdgIdMCMuon_(0)
196 >                ,pixelLayersWithMeasurement_(-1)
197 >                ,stripLayersWithMeasurement_(-1)
198 >                ,d0_(-9999.)
199 >                ,d0Error_(-9999.)
200 >                ,dsz_(-9999.)
201 >                ,dszError_(-9999.)
202 >                ,normalizedChi2_(-9999.)
203 >                ,ptError_(-9999.)
204 >                ,etaError_(-9999.)
205 >                ,phiError_(-9999.)
206                  {;}
207 <        
207 >
208          TRootMuon(const TLorentzVector &momentum) :
209                  TRootParticle(momentum)
210                  ,et_em_(-9999.)
# Line 198 | Line 232 | public:
232                  ,direction_(-9999)
233                  ,algo_(-9999)
234                  ,id_(-9999)
235 <                ,momentumMCMuon_()
236 <                ,vertexMCMuon_()
237 <                ,pdgIdMCMuon_(0)
235 >                ,pixelLayersWithMeasurement_(-1)
236 >                ,stripLayersWithMeasurement_(-1)
237 >                ,d0_(-9999.)
238 >                ,d0Error_(-9999.)
239 >                ,dsz_(-9999.)
240 >                ,dszError_(-9999.)
241 >                ,normalizedChi2_(-9999.)
242 >                ,ptError_(-9999.)
243 >                ,etaError_(-9999.)
244 >                ,phiError_(-9999.)
245                  {;}
246 <
246 >
247          TRootMuon(const TLorentzVector &momentum, const TVector3 &vertex, Int_t type, Float_t charge) :
248                  TRootParticle(momentum, vertex, type, charge)
249                  ,et_em_(-9999.)
# Line 230 | Line 271 | public:
271                  ,direction_(-9999)
272                  ,algo_(-9999)
273                  ,id_(-9999)
274 <                ,momentumMCMuon_()
275 <                ,vertexMCMuon_()
276 <                ,pdgIdMCMuon_(0)
274 >                ,pixelLayersWithMeasurement_(-1)
275 >                ,stripLayersWithMeasurement_(-1)
276 >                ,d0_(-9999.)
277 >                ,d0Error_(-9999.)
278 >                ,dsz_(-9999.)
279 >                ,dszError_(-9999.)
280 >                ,normalizedChi2_(-9999.)
281 >                ,ptError_(-9999.)
282 >                ,etaError_(-9999.)
283 >                ,phiError_(-9999.)
284                  {;}
285 <        
285 >
286          ~TRootMuon() {;}
287 <        
288 <        
287 >
288 >
289          Float_t et_em() const { return et_em_;}
290          Float_t et_emS9() const { return et_emS9_;}
291          Float_t et_had() const { return et_had_;}
# Line 281 | Line 329 | public:
329          Bool_t idTM2DCompatibilityLoose() const { return id_ & 32; }
330          Bool_t idTM2DCompatibilityTight() const { return id_ & 64; }
331  
332 <        //TObject* genMuon() const { return genMuon_.GetObject() ;}
333 <        //Int_t muonMCIndex() const { return muonMCIndex_; }
334 <        TLorentzVector momentumMCMuon() const  { return momentumMCMuon_; }
335 <        TVector3 vertexMCMuon() const { return vertexMCMuon_; }
336 <        Int_t pdgIdMCMuon() const { return pdgIdMCMuon_; }
332 >        Int_t pixelLayersWithMeasurement() const { return pixelLayersWithMeasurement_; }
333 >        Int_t stripLayersWithMeasurement() const { return stripLayersWithMeasurement_; }
334 >        Float_t d0() const { return d0_ ;}
335 >        Float_t d0Error() const { return d0Error_ ;}
336 >        Float_t dsz() const { return dsz_ ;}
337 >        Float_t dszError() const { return dszError_ ;}
338 >        Float_t normalizedChi2() const { return normalizedChi2_ ;}
339 >        Float_t ptError() const { return ptError_ ;}
340 >        Float_t etaError() const { return etaError_ ;}
341 >        Float_t phiError() const { return phiError_ ;}
342 >
343  
344 +        //TObject* genMuon() const { return genMuon_.GetObject() ;}
345          virtual TString typeName() const { return "TRootMuon"; }
346  
347  
# Line 342 | Line 397 | public:
397          )
398          { id_ = trackerMuonArbitrated*1 + allArbitrated*2 + globalMuonPromptTight*4 + tmLastStationLoose*8 + tmLastStationTight*16 + tm2DCompatibilityLoose*32 + tm2DCompatibilityTight*64; }
399  
400 <        //void setMuonMCIndex(Int_t muonMCIndex) { muonMCIndex_ = muonMCIndex; }
401 <        void setMomentumMCMuon(Float_t px, Float_t py, Float_t pz , Float_t energy) { momentumMCMuon_ =  TLorentzVector(px,py,pz,energy); }
402 <        void setVertexMCMuon(TVector3 vertexMCMuon) { vertexMCMuon_ = vertexMCMuon; }
403 <        void setPdgIdMCMuon(Int_t pdgIdMCMuon) { pdgIdMCMuon_ = pdgIdMCMuon; }
400 >        void setPixelLayersWithMeasurement(Int_t pixelLayersWithMeasurement) { pixelLayersWithMeasurement_ = pixelLayersWithMeasurement; }
401 >        void setStripLayersWithMeasurement(Int_t stripLayersWithMeasurement) { stripLayersWithMeasurement_ = stripLayersWithMeasurement; }
402 >        void setD0(Float_t d0) { d0_ = d0; }
403 >        void setD0Error(Float_t d0Error) { d0Error_ = d0Error; }
404 >        void setDsz(Float_t dsz) { dsz_ = dsz; }
405 >        void setDszError(Float_t dszError) { dszError_ = dszError; }
406 >        void setNormalizedChi2(Float_t normalizedChi2) { normalizedChi2_ = normalizedChi2; }
407 >        void setPtError(Float_t ptError) { ptError_ = ptError; }
408 >        void setEtaError(Float_t etaError) { etaError_ = etaError; }
409 >        void setPhiError(Float_t phiError) { phiError_ = phiError; }
410  
411  
412          friend std::ostream& operator<< (std::ostream& stream, const TRootMuon& muon) {
# Line 396 | Line 457 | public:
457          // TMLastStationLoose=0001000 , TMLastStationTight=0010000 , TM2DCompatibilityLoose=0100000 , TM2DCompatibilityTight=1000000
458          Int_t id_;
459  
460 <        TLorentzVector momentumMCMuon_;
461 <        TVector3 vertexMCMuon_;
462 <        Int_t pdgIdMCMuon_;
460 >        
461 >        // Variables from reco::GsfTrack
462 >
463 >        /* cf: http://cmslxr.fnal.gov/lxr/source/DataFormats/TrackReco/interface/TrackBase.h
464 >        For tracks reconstructed in the CMS Tracker, the reference position is the point of closest approach to the centre
465 >        of CMS. For muons, this is not necessarily true. Parameters associated to the 5D curvilinear covariance matrix:
466 >                qoverp = q / abs(p) = signed inverse of momentum [1/GeV]
467 >                lambda = pi/2 - polar angle at the given point
468 >                phi = azimuth angle at the given point
469 >                dxy = -vx*sin(phi) + vy*cos(phi) [cm]
470 >                dsz = vz*cos(lambda) - (vx*cos(phi)+vy*sin(phi))*sin(lambda) [cm]
471 >
472 >        Geometrically, dxy is the signed distance in the XY plane between the straight line passing through (vx,vy) with
473 >        azimuthal angle phi and the point (0,0). The dsz parameter is the signed distance in the SZ plane between the straight
474 >        line passing through (vx,vy,vz) with angles (phi, lambda) and the point (s=0,z=0). The S axis is defined by the projection
475 >        of the straight line onto the XY plane. The convention is to assign the S coordinate for (vx,vy) as the value
476 >        vx*cos(phi)+vy*sin(phi). This value is zero when (vx,vy) is the point of minimum transverse distance to (0,0).
477 >
478 >        Note that dxy and dsz provide sensible estimates of the distance from the true particle trajectory to (0,0,0) ONLY
479 >        in two cases:
480 >                - When (vx,vy,vz) already correspond to the point of minimum transverse distance to (0,0,0) or is close to it
481 >                (so that the differences between considering the exact trajectory or a straight line in this range  are negligible).
482 >                This is usually true for Tracker tracks.
483 >                - When the track has infinite or extremely high momentum */
484 >
485 >        Int_t pixelLayersWithMeasurement_; // Number of pixel layers with at least one valid hit
486 >        Int_t stripLayersWithMeasurement_; // Number of strip layers with at least one valid hit
487 >
488 >        Float_t d0_;             // d0=-dxy
489 >     Float_t d0Error_;        // error on d0_
490 >     Float_t dsz_;            // dsz parameter
491 >     Float_t dszError_;       // error on dsz_
492 >     Float_t normalizedChi2_; // chi-squared divided by n.d.o.f. of track fit
493 >
494 >     Float_t ptError_; // needed ?  ptError()
495 >     Float_t etaError_; // needed ?  etaError()
496 >     Float_t phiError_; // needed ?  phiError()
497 >
498  
499 <        ClassDef (TRootMuon,1);
499 >        ClassDef (TRootMuon,2);
500   };
501  
502   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines