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.10 by lethuill, Fri Apr 17 15:17:38 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 >                ,ip3DSignificance_(-9999.)
51                  {;}
52 <                        
52 >
53          TRootMuon(const TRootMuon& muon) :
54                  TRootParticle(muon)
55                  ,et_em_(muon.et_em_)
# Line 70 | Line 77 | public:
77                  ,direction_(muon.direction_)
78                  ,algo_(muon.algo_)
79                  ,id_(muon.id_)
80 <                ,momentumMCMuon_(muon.momentumMCMuon_)
81 <                ,vertexMCMuon_(muon.vertexMCMuon_)
82 <                ,pdgIdMCMuon_(muon.pdgIdMCMuon_)
80 >                ,pixelLayersWithMeasurement_(muon.pixelLayersWithMeasurement_)
81 >                ,stripLayersWithMeasurement_(muon.stripLayersWithMeasurement_)
82 >                ,d0_(muon.d0_)
83 >                ,d0Error_(muon.d0Error_)
84 >                ,dsz_(muon.dsz_)
85 >                ,dszError_(muon.dszError_)
86 >                ,normalizedChi2_(muon.normalizedChi2_)
87 >                ,ptError_(muon.ptError_)
88 >                ,etaError_(muon.etaError_)
89 >                ,phiError_(muon.phiError_)
90 >                ,ip3DSignificance_(muon.ip3DSignificance_)
91                  {;}
92 <                                
92 >
93          TRootMuon(Double_t px, Double_t py, Double_t pz, Double_t e) :
94                  TRootParticle(px,py,pz,e)
95                  ,et_em_(-9999.)
# Line 102 | Line 117 | public:
117                  ,direction_(-9999)
118                  ,algo_(-9999)
119                  ,id_(-9999)
120 <                ,momentumMCMuon_()
121 <                ,vertexMCMuon_()
122 <                ,pdgIdMCMuon_(0)
120 >                ,pixelLayersWithMeasurement_(-1)
121 >                ,stripLayersWithMeasurement_(-1)
122 >                ,d0_(-9999.)
123 >                ,d0Error_(-9999.)
124 >                ,dsz_(-9999.)
125 >                ,dszError_(-9999.)
126 >                ,normalizedChi2_(-9999.)
127 >                ,ptError_(-9999.)
128 >                ,etaError_(-9999.)
129 >                ,phiError_(-9999.)
130 >                ,ip3DSignificance_(-9999.)
131                  {;}
132 <        
132 >
133          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) :
134                  TRootParticle(px,py,pz,e,vtx_x,vtx_y,vtx_z)
135                  ,et_em_(-9999.)
# Line 134 | Line 157 | public:
157                  ,direction_(-9999)
158                  ,algo_(-9999)
159                  ,id_(-9999)
160 <                ,momentumMCMuon_()
161 <                ,vertexMCMuon_()
162 <                ,pdgIdMCMuon_(0)
160 >                ,pixelLayersWithMeasurement_(-1)
161 >                ,stripLayersWithMeasurement_(-1)
162 >                ,d0_(-9999.)
163 >                ,d0Error_(-9999.)
164 >                ,dsz_(-9999.)
165 >                ,dszError_(-9999.)
166 >                ,normalizedChi2_(-9999.)
167 >                ,ptError_(-9999.)
168 >                ,etaError_(-9999.)
169 >                ,phiError_(-9999.)
170 >                ,ip3DSignificance_(-9999.)
171                  {;}
172 <        
172 >
173          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) :
174                  TRootParticle(px,py,pz,e,vtx_x,vtx_y,vtx_z,type,charge)
175                  ,et_em_(-9999.)
# Line 166 | Line 197 | public:
197                  ,direction_(-9999)
198                  ,algo_(-9999)
199                  ,id_(-9999)
200 <                ,momentumMCMuon_()
201 <                ,vertexMCMuon_()
202 <                ,pdgIdMCMuon_(0)
200 >                ,pixelLayersWithMeasurement_(-1)
201 >                ,stripLayersWithMeasurement_(-1)
202 >                ,d0_(-9999.)
203 >                ,d0Error_(-9999.)
204 >                ,dsz_(-9999.)
205 >                ,dszError_(-9999.)
206 >                ,normalizedChi2_(-9999.)
207 >                ,ptError_(-9999.)
208 >                ,etaError_(-9999.)
209 >                ,phiError_(-9999.)
210 >                ,ip3DSignificance_(-9999.)
211                  {;}
212 <        
212 >
213          TRootMuon(const TLorentzVector &momentum) :
214                  TRootParticle(momentum)
215                  ,et_em_(-9999.)
# Line 198 | Line 237 | public:
237                  ,direction_(-9999)
238                  ,algo_(-9999)
239                  ,id_(-9999)
240 <                ,momentumMCMuon_()
241 <                ,vertexMCMuon_()
242 <                ,pdgIdMCMuon_(0)
240 >                ,pixelLayersWithMeasurement_(-1)
241 >                ,stripLayersWithMeasurement_(-1)
242 >                ,d0_(-9999.)
243 >                ,d0Error_(-9999.)
244 >                ,dsz_(-9999.)
245 >                ,dszError_(-9999.)
246 >                ,normalizedChi2_(-9999.)
247 >                ,ptError_(-9999.)
248 >                ,etaError_(-9999.)
249 >                ,phiError_(-9999.)
250 >                ,ip3DSignificance_(-9999.)
251                  {;}
252 <
252 >
253          TRootMuon(const TLorentzVector &momentum, const TVector3 &vertex, Int_t type, Float_t charge) :
254                  TRootParticle(momentum, vertex, type, charge)
255                  ,et_em_(-9999.)
# Line 230 | Line 277 | public:
277                  ,direction_(-9999)
278                  ,algo_(-9999)
279                  ,id_(-9999)
280 <                ,momentumMCMuon_()
281 <                ,vertexMCMuon_()
282 <                ,pdgIdMCMuon_(0)
280 >                ,pixelLayersWithMeasurement_(-1)
281 >                ,stripLayersWithMeasurement_(-1)
282 >                ,d0_(-9999.)
283 >                ,d0Error_(-9999.)
284 >                ,dsz_(-9999.)
285 >                ,dszError_(-9999.)
286 >                ,normalizedChi2_(-9999.)
287 >                ,ptError_(-9999.)
288 >                ,etaError_(-9999.)
289 >                ,phiError_(-9999.)
290 >                ,ip3DSignificance_(-9999.)
291                  {;}
292 <        
292 >
293          ~TRootMuon() {;}
294 <        
295 <        
294 >
295 >
296          Float_t et_em() const { return et_em_;}
297          Float_t et_emS9() const { return et_emS9_;}
298          Float_t et_had() const { return et_had_;}
# Line 281 | Line 336 | public:
336          Bool_t idTM2DCompatibilityLoose() const { return id_ & 32; }
337          Bool_t idTM2DCompatibilityTight() const { return id_ & 64; }
338  
339 <        //TObject* genMuon() const { return genMuon_.GetObject() ;}
340 <        //Int_t muonMCIndex() const { return muonMCIndex_; }
341 <        TLorentzVector momentumMCMuon() const  { return momentumMCMuon_; }
342 <        TVector3 vertexMCMuon() const { return vertexMCMuon_; }
343 <        Int_t pdgIdMCMuon() const { return pdgIdMCMuon_; }
339 >        Int_t pixelLayersWithMeasurement() const { return pixelLayersWithMeasurement_; }
340 >        Int_t stripLayersWithMeasurement() const { return stripLayersWithMeasurement_; }
341 >        Float_t d0() const { return d0_ ;}
342 >        Float_t d0Error() const { return d0Error_ ;}
343 >        Float_t dsz() const { return dsz_ ;}
344 >        Float_t dszError() const { return dszError_ ;}
345 >        Float_t normalizedChi2() const { return normalizedChi2_ ;}
346 >        Float_t ptError() const { return ptError_ ;}
347 >        Float_t etaError() const { return etaError_ ;}
348 >        Float_t phiError() const { return phiError_ ;}
349 >        Float_t ip3DSignificance() const { return ip3DSignificance_ ;}
350 >
351  
352 +        //TObject* genMuon() const { return genMuon_.GetObject() ;}
353          virtual TString typeName() const { return "TRootMuon"; }
354  
355  
# Line 342 | Line 405 | public:
405          )
406          { id_ = trackerMuonArbitrated*1 + allArbitrated*2 + globalMuonPromptTight*4 + tmLastStationLoose*8 + tmLastStationTight*16 + tm2DCompatibilityLoose*32 + tm2DCompatibilityTight*64; }
407  
408 <        //void setMuonMCIndex(Int_t muonMCIndex) { muonMCIndex_ = muonMCIndex; }
409 <        void setMomentumMCMuon(Float_t px, Float_t py, Float_t pz , Float_t energy) { momentumMCMuon_ =  TLorentzVector(px,py,pz,energy); }
410 <        void setVertexMCMuon(TVector3 vertexMCMuon) { vertexMCMuon_ = vertexMCMuon; }
411 <        void setPdgIdMCMuon(Int_t pdgIdMCMuon) { pdgIdMCMuon_ = pdgIdMCMuon; }
408 >        void setPixelLayersWithMeasurement(Int_t pixelLayersWithMeasurement) { pixelLayersWithMeasurement_ = pixelLayersWithMeasurement; }
409 >        void setStripLayersWithMeasurement(Int_t stripLayersWithMeasurement) { stripLayersWithMeasurement_ = stripLayersWithMeasurement; }
410 >        void setD0(Float_t d0) { d0_ = d0; }
411 >        void setD0Error(Float_t d0Error) { d0Error_ = d0Error; }
412 >        void setDsz(Float_t dsz) { dsz_ = dsz; }
413 >        void setDszError(Float_t dszError) { dszError_ = dszError; }
414 >        void setNormalizedChi2(Float_t normalizedChi2) { normalizedChi2_ = normalizedChi2; }
415 >        void setPtError(Float_t ptError) { ptError_ = ptError; }
416 >        void setEtaError(Float_t etaError) { etaError_ = etaError; }
417 >        void setPhiError(Float_t phiError) { phiError_ = phiError; }
418 >        void setIP3DSignificance(Float_t ip3DSignificance) { ip3DSignificance_ = ip3DSignificance; }
419  
420  
421          friend std::ostream& operator<< (std::ostream& stream, const TRootMuon& muon) {
# Line 356 | Line 426 | public:
426                                  << "  caloCompatibility="<<  muon.caloCompatibility_ << "  validity(energy,matches,isolation)=(" << muon.energyValid_ <<","<< muon.matchesValid_ <<","<< muon.isolationValid_ << ")" << endl
427                                  << "            Et_em=" << muon.et_em_ << " Et_emS9=" << muon.et_emS9_ << "  Et_had=" << muon.et_had_ << " Et_hadS9=" << muon.et_hadS9_ << "  Et_ho=" << muon.et_ho_ << "  Et_hoS9=" << muon.et_hoS9_ << endl
428                                  << "            isolation cone 0.3: Et_em=" << muon.isoR03_emEt_ << "  Et_had=" << muon.isoR03_hadEt_ <<"  Et_ho=" << muon.isoR03_hoEt_  << "  nTracks=" << muon.isoR03_nTracks_ <<"  nJets=" << muon.isoR03_nJets_ << endl
429 <                                << "            isolation cone 0.5: Et_em=" << muon.isoR05_emEt_ << "  Et_had=" << muon.isoR05_hadEt_ <<"  Et_ho=" << muon.isoR05_hoEt_  << "  nTracks=" << muon.isoR05_nTracks_ <<"  nJets=" << muon.isoR05_nJets_;
429 >                                << "            isolation cone 0.5: Et_em=" << muon.isoR05_emEt_ << "  Et_had=" << muon.isoR05_hadEt_ <<"  Et_ho=" << muon.isoR05_hoEt_  << "  nTracks=" << muon.isoR05_nTracks_ <<"  nJets=" << muon.isoR05_nJets_ << endl
430 >                                << "            IP 3D Significance=" << muon.ip3DSignificance_;
431                  return stream;
432          };
433  
# Line 396 | Line 467 | public:
467          // TMLastStationLoose=0001000 , TMLastStationTight=0010000 , TM2DCompatibilityLoose=0100000 , TM2DCompatibilityTight=1000000
468          Int_t id_;
469  
470 <        TLorentzVector momentumMCMuon_;
471 <        TVector3 vertexMCMuon_;
472 <        Int_t pdgIdMCMuon_;
470 >        
471 >        // Variables from reco::GsfTrack
472 >
473 >        /* cf: http://cmslxr.fnal.gov/lxr/source/DataFormats/TrackReco/interface/TrackBase.h
474 >        For tracks reconstructed in the CMS Tracker, the reference position is the point of closest approach to the centre
475 >        of CMS. For muons, this is not necessarily true. Parameters associated to the 5D curvilinear covariance matrix:
476 >                qoverp = q / abs(p) = signed inverse of momentum [1/GeV]
477 >                lambda = pi/2 - polar angle at the given point
478 >                phi = azimuth angle at the given point
479 >                dxy = -vx*sin(phi) + vy*cos(phi) [cm]
480 >                dsz = vz*cos(lambda) - (vx*cos(phi)+vy*sin(phi))*sin(lambda) [cm]
481 >
482 >        Geometrically, dxy is the signed distance in the XY plane between the straight line passing through (vx,vy) with
483 >        azimuthal angle phi and the point (0,0). The dsz parameter is the signed distance in the SZ plane between the straight
484 >        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
485 >        of the straight line onto the XY plane. The convention is to assign the S coordinate for (vx,vy) as the value
486 >        vx*cos(phi)+vy*sin(phi). This value is zero when (vx,vy) is the point of minimum transverse distance to (0,0).
487 >
488 >        Note that dxy and dsz provide sensible estimates of the distance from the true particle trajectory to (0,0,0) ONLY
489 >        in two cases:
490 >                - When (vx,vy,vz) already correspond to the point of minimum transverse distance to (0,0,0) or is close to it
491 >                (so that the differences between considering the exact trajectory or a straight line in this range  are negligible).
492 >                This is usually true for Tracker tracks.
493 >                - When the track has infinite or extremely high momentum */
494 >
495 >        Int_t pixelLayersWithMeasurement_; // Number of pixel layers with at least one valid hit
496 >        Int_t stripLayersWithMeasurement_; // Number of strip layers with at least one valid hit
497 >
498 >        Float_t d0_;             // d0=-dxy
499 >     Float_t d0Error_;        // error on d0_
500 >     Float_t dsz_;            // dsz parameter
501 >     Float_t dszError_;       // error on dsz_
502 >     Float_t normalizedChi2_; // chi-squared divided by n.d.o.f. of track fit
503 >
504 >     Float_t ptError_; // needed ?  ptError()
505 >     Float_t etaError_; // needed ?  etaError()
506 >     Float_t phiError_; // needed ?  phiError()
507 >
508 >     Float_t ip3DSignificance_;
509  
510 <        ClassDef (TRootMuon,1);
510 >        ClassDef (TRootMuon,3);
511   };
512  
513   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines