ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootMuon.h
Revision: 1.14
Committed: Wed Jun 10 12:09:10 2009 UTC (15 years, 10 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: all_3_3_2_01, all_3_2_5_02, all_3_2_5_01, all_2_2_9_03, all_2_2_9_02, all_2_2_9_01, HEAD
Branch point for: CMSSW_2_2_X_br
Changes since 1.13: +25 -0 lines
Log Message:
Add candidate ecal and hcal energy in a cone for pat::Muon

File Contents

# User Rev Content
1 mlethuil 1.1 #ifndef TRootMuon_h
2     #define TRootMuon_h
3    
4     #include "../interface/TRootParticle.h"
5    
6     using namespace std;
7    
8     class TRootMuon : public TRootParticle
9     {
10 lethuill 1.13
11     public:
12    
13     TRootMuon() :
14     TRootParticle()
15     ,et_em_(-9999.)
16     ,et_emS9_(-9999.)
17     ,et_had_(-9999.)
18     ,et_hadS9_(-9999.)
19     ,et_ho_(-9999.)
20     ,et_hoS9_(-9999.)
21     ,caloCompatibility_(-9999.)
22     ,isoR03_emEt_(-9999.)
23     ,isoR03_hadEt_(-9999.)
24     ,isoR03_hoEt_(-9999.)
25     ,isoR03_sumPt_(-9999.)
26     ,isoR03_nTracks_(-9999)
27     ,isoR03_nJets_(-9999)
28     ,isoR05_emEt_(-9999.)
29     ,isoR05_hadEt_(-9999.)
30     ,isoR05_hoEt_(-9999.)
31     ,isoR05_sumPt_(-9999.)
32     ,isoR05_nTracks_(-9999)
33     ,isoR05_nJets_(-9999)
34     ,energyValid_(false)
35     ,matchesValid_(false)
36     ,isolationValid_(false)
37     ,direction_(-9999)
38     ,algo_(-9999)
39     ,id_(-9999)
40     ,numberOfValidPixelHits_(-1)
41     ,numberOfValidTrackerHits_(-1)
42     ,pixelLayersWithMeasurement_(-1)
43     ,stripLayersWithMeasurement_(-1)
44     ,d0_(-9999.)
45     ,d0Error_(-9999.)
46     ,dsz_(-9999.)
47     ,dszError_(-9999.)
48     ,normalizedChi2_(-9999.)
49     ,ptError_(-9999.)
50     ,etaError_(-9999.)
51     ,phiError_(-9999.)
52     ,ip3DSignificance_(-9999.)
53     ,innerTrack_(0.,0.,0.,0.)
54     ,outerTrack_(0.,0.,0.,0.)
55     ,globalTrack_(0.,0.,0.,0.)
56 lethuill 1.14 ,ecalCandEnergy_(-9999.)
57     ,hcalCandEnergy_(-9999.)
58 lethuill 1.13 {;}
59    
60     TRootMuon(const TRootMuon& muon) :
61     TRootParticle(muon)
62     ,et_em_(muon.et_em_)
63     ,et_emS9_(muon.et_emS9_)
64     ,et_had_(muon.et_had_)
65     ,et_hadS9_(muon.et_hadS9_)
66     ,et_ho_(muon.et_ho_)
67     ,et_hoS9_(muon.et_hoS9_)
68     ,caloCompatibility_(muon.caloCompatibility_)
69     ,isoR03_emEt_(muon.isoR03_emEt_)
70     ,isoR03_hadEt_(muon.isoR03_hadEt_)
71     ,isoR03_hoEt_(muon.isoR03_hoEt_)
72     ,isoR03_sumPt_(muon.isoR03_sumPt_)
73     ,isoR03_nTracks_(muon.isoR03_nTracks_)
74     ,isoR03_nJets_(muon.isoR03_nJets_)
75     ,isoR05_emEt_(muon.isoR05_emEt_)
76     ,isoR05_hadEt_(muon.isoR05_hadEt_)
77     ,isoR05_hoEt_(muon.isoR05_hoEt_)
78     ,isoR05_sumPt_(muon.isoR05_sumPt_)
79     ,isoR05_nTracks_(muon.isoR05_nTracks_)
80     ,isoR05_nJets_(muon.isoR05_nJets_)
81     ,energyValid_(muon.energyValid_)
82     ,matchesValid_(muon.matchesValid_)
83     ,isolationValid_(muon.isolationValid_)
84     ,direction_(muon.direction_)
85     ,algo_(muon.algo_)
86     ,id_(muon.id_)
87     ,numberOfValidPixelHits_(muon.numberOfValidPixelHits_)
88     ,numberOfValidTrackerHits_(muon.numberOfValidTrackerHits_)
89     ,pixelLayersWithMeasurement_(muon.pixelLayersWithMeasurement_)
90     ,stripLayersWithMeasurement_(muon.stripLayersWithMeasurement_)
91     ,d0_(muon.d0_)
92     ,d0Error_(muon.d0Error_)
93     ,dsz_(muon.dsz_)
94     ,dszError_(muon.dszError_)
95     ,normalizedChi2_(muon.normalizedChi2_)
96     ,ptError_(muon.ptError_)
97     ,etaError_(muon.etaError_)
98     ,phiError_(muon.phiError_)
99     ,ip3DSignificance_(muon.ip3DSignificance_)
100     ,innerTrack_(muon.innerTrack_)
101     ,outerTrack_(muon.outerTrack_)
102     ,globalTrack_(muon.globalTrack_)
103 lethuill 1.14 ,ecalCandEnergy_(muon.ecalCandEnergy_)
104     ,hcalCandEnergy_(muon.hcalCandEnergy_)
105 lethuill 1.13 {;}
106    
107     TRootMuon(Double_t px, Double_t py, Double_t pz, Double_t e) :
108     TRootParticle(px,py,pz,e)
109     ,et_em_(-9999.)
110     ,et_emS9_(-9999.)
111     ,et_had_(-9999.)
112     ,et_hadS9_(-9999.)
113     ,et_ho_(-9999.)
114     ,et_hoS9_(-9999.)
115     ,caloCompatibility_(-9999.)
116     ,isoR03_emEt_(-9999.)
117     ,isoR03_hadEt_(-9999.)
118     ,isoR03_hoEt_(-9999.)
119     ,isoR03_sumPt_(-9999.)
120     ,isoR03_nTracks_(-9999)
121     ,isoR03_nJets_(-9999)
122     ,isoR05_emEt_(-9999.)
123     ,isoR05_hadEt_(-9999.)
124     ,isoR05_hoEt_(-9999.)
125     ,isoR05_sumPt_(-9999.)
126     ,isoR05_nTracks_(-9999)
127     ,isoR05_nJets_(-9999)
128     ,energyValid_(false)
129     ,matchesValid_(false)
130     ,isolationValid_(false)
131     ,direction_(-9999)
132     ,algo_(-9999)
133     ,id_(-9999)
134     ,numberOfValidPixelHits_(-1)
135     ,numberOfValidTrackerHits_(-1)
136     ,pixelLayersWithMeasurement_(-1)
137     ,stripLayersWithMeasurement_(-1)
138     ,d0_(-9999.)
139     ,d0Error_(-9999.)
140     ,dsz_(-9999.)
141     ,dszError_(-9999.)
142     ,normalizedChi2_(-9999.)
143     ,ptError_(-9999.)
144     ,etaError_(-9999.)
145     ,phiError_(-9999.)
146     ,ip3DSignificance_(-9999.)
147     ,innerTrack_(0.,0.,0.,0.)
148     ,outerTrack_(0.,0.,0.,0.)
149     ,globalTrack_(0.,0.,0.,0.)
150 lethuill 1.14 ,ecalCandEnergy_(-9999.)
151     ,hcalCandEnergy_(-9999.)
152 lethuill 1.13 {;}
153    
154     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) :
155     TRootParticle(px,py,pz,e,vtx_x,vtx_y,vtx_z)
156     ,et_em_(-9999.)
157     ,et_emS9_(-9999.)
158     ,et_had_(-9999.)
159     ,et_hadS9_(-9999.)
160     ,et_ho_(-9999.)
161     ,et_hoS9_(-9999.)
162     ,caloCompatibility_(-9999.)
163     ,isoR03_emEt_(-9999.)
164     ,isoR03_hadEt_(-9999.)
165     ,isoR03_hoEt_(-9999.)
166     ,isoR03_sumPt_(-9999.)
167     ,isoR03_nTracks_(-9999)
168     ,isoR03_nJets_(-9999)
169     ,isoR05_emEt_(-9999.)
170     ,isoR05_hadEt_(-9999.)
171     ,isoR05_hoEt_(-9999.)
172     ,isoR05_sumPt_(-9999.)
173     ,isoR05_nTracks_(-9999)
174     ,isoR05_nJets_(-9999)
175     ,energyValid_(false)
176     ,matchesValid_(false)
177     ,isolationValid_(false)
178     ,direction_(-9999)
179     ,algo_(-9999)
180     ,id_(-9999)
181     ,numberOfValidPixelHits_(-1)
182     ,numberOfValidTrackerHits_(-1)
183     ,pixelLayersWithMeasurement_(-1)
184     ,stripLayersWithMeasurement_(-1)
185     ,d0_(-9999.)
186     ,d0Error_(-9999.)
187     ,dsz_(-9999.)
188     ,dszError_(-9999.)
189     ,normalizedChi2_(-9999.)
190     ,ptError_(-9999.)
191     ,etaError_(-9999.)
192     ,phiError_(-9999.)
193     ,ip3DSignificance_(-9999.)
194     ,innerTrack_(0.,0.,0.,0.)
195     ,outerTrack_(0.,0.,0.,0.)
196     ,globalTrack_(0.,0.,0.,0.)
197 lethuill 1.14 ,ecalCandEnergy_(-9999.)
198     ,hcalCandEnergy_(-9999.)
199 lethuill 1.13 {;}
200    
201     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) :
202     TRootParticle(px,py,pz,e,vtx_x,vtx_y,vtx_z,type,charge)
203     ,et_em_(-9999.)
204     ,et_emS9_(-9999.)
205     ,et_had_(-9999.)
206     ,et_hadS9_(-9999.)
207     ,et_ho_(-9999.)
208     ,et_hoS9_(-9999.)
209     ,caloCompatibility_(-9999.)
210     ,isoR03_emEt_(-9999.)
211     ,isoR03_hadEt_(-9999.)
212     ,isoR03_hoEt_(-9999.)
213     ,isoR03_sumPt_(-9999.)
214     ,isoR03_nTracks_(-9999)
215     ,isoR03_nJets_(-9999)
216     ,isoR05_emEt_(-9999.)
217     ,isoR05_hadEt_(-9999.)
218     ,isoR05_hoEt_(-9999.)
219     ,isoR05_sumPt_(-9999.)
220     ,isoR05_nTracks_(-9999)
221     ,isoR05_nJets_(-9999)
222     ,energyValid_(false)
223     ,matchesValid_(false)
224     ,isolationValid_(false)
225     ,direction_(-9999)
226     ,algo_(-9999)
227     ,id_(-9999)
228     ,numberOfValidPixelHits_(-1)
229     ,numberOfValidTrackerHits_(-1)
230     ,pixelLayersWithMeasurement_(-1)
231     ,stripLayersWithMeasurement_(-1)
232     ,d0_(-9999.)
233     ,d0Error_(-9999.)
234     ,dsz_(-9999.)
235     ,dszError_(-9999.)
236     ,normalizedChi2_(-9999.)
237     ,ptError_(-9999.)
238     ,etaError_(-9999.)
239     ,phiError_(-9999.)
240     ,ip3DSignificance_(-9999.)
241     ,innerTrack_(0.,0.,0.,0.)
242     ,outerTrack_(0.,0.,0.,0.)
243     ,globalTrack_(0.,0.,0.,0.)
244 lethuill 1.14 ,ecalCandEnergy_(-9999.)
245     ,hcalCandEnergy_(-9999.)
246 lethuill 1.13 {;}
247    
248     TRootMuon(const TLorentzVector &momentum) :
249     TRootParticle(momentum)
250     ,et_em_(-9999.)
251     ,et_emS9_(-9999.)
252     ,et_had_(-9999.)
253     ,et_hadS9_(-9999.)
254     ,et_ho_(-9999.)
255     ,et_hoS9_(-9999.)
256     ,caloCompatibility_(-9999.)
257     ,isoR03_emEt_(-9999.)
258     ,isoR03_hadEt_(-9999.)
259     ,isoR03_hoEt_(-9999.)
260     ,isoR03_sumPt_(-9999.)
261     ,isoR03_nTracks_(-9999)
262     ,isoR03_nJets_(-9999)
263     ,isoR05_emEt_(-9999.)
264     ,isoR05_hadEt_(-9999.)
265     ,isoR05_hoEt_(-9999.)
266     ,isoR05_sumPt_(-9999.)
267     ,isoR05_nTracks_(-9999)
268     ,isoR05_nJets_(-9999)
269     ,energyValid_(false)
270     ,matchesValid_(false)
271     ,isolationValid_(false)
272     ,direction_(-9999)
273     ,algo_(-9999)
274     ,id_(-9999)
275     ,numberOfValidPixelHits_(-1)
276     ,numberOfValidTrackerHits_(-1)
277     ,pixelLayersWithMeasurement_(-1)
278     ,stripLayersWithMeasurement_(-1)
279     ,d0_(-9999.)
280     ,d0Error_(-9999.)
281     ,dsz_(-9999.)
282     ,dszError_(-9999.)
283     ,normalizedChi2_(-9999.)
284     ,ptError_(-9999.)
285     ,etaError_(-9999.)
286     ,phiError_(-9999.)
287     ,ip3DSignificance_(-9999.)
288     ,innerTrack_(0.,0.,0.,0.)
289     ,outerTrack_(0.,0.,0.,0.)
290     ,globalTrack_(0.,0.,0.,0.)
291 lethuill 1.14 ,ecalCandEnergy_(-9999.)
292     ,hcalCandEnergy_(-9999.)
293 lethuill 1.13 {;}
294    
295     TRootMuon(const TLorentzVector &momentum, const TVector3 &vertex, Int_t type, Float_t charge) :
296     TRootParticle(momentum, vertex, type, charge)
297     ,et_em_(-9999.)
298     ,et_emS9_(-9999.)
299     ,et_had_(-9999.)
300     ,et_hadS9_(-9999.)
301     ,et_ho_(-9999.)
302     ,et_hoS9_(-9999.)
303     ,caloCompatibility_(-9999.)
304     ,isoR03_emEt_(-9999.)
305     ,isoR03_hadEt_(-9999.)
306     ,isoR03_hoEt_(-9999.)
307     ,isoR03_sumPt_(-9999.)
308     ,isoR03_nTracks_(-9999)
309     ,isoR03_nJets_(-9999)
310     ,isoR05_emEt_(-9999.)
311     ,isoR05_hadEt_(-9999.)
312     ,isoR05_hoEt_(-9999.)
313     ,isoR05_sumPt_(-9999.)
314     ,isoR05_nTracks_(-9999)
315     ,isoR05_nJets_(-9999)
316     ,energyValid_(false)
317     ,matchesValid_(false)
318     ,isolationValid_(false)
319     ,direction_(-9999)
320     ,algo_(-9999)
321     ,id_(-9999)
322     ,numberOfValidPixelHits_(-1)
323     ,numberOfValidTrackerHits_(-1)
324     ,pixelLayersWithMeasurement_(-1)
325     ,stripLayersWithMeasurement_(-1)
326     ,d0_(-9999.)
327     ,d0Error_(-9999.)
328     ,dsz_(-9999.)
329     ,dszError_(-9999.)
330     ,normalizedChi2_(-9999.)
331     ,ptError_(-9999.)
332     ,etaError_(-9999.)
333     ,phiError_(-9999.)
334     ,ip3DSignificance_(-9999.)
335     ,innerTrack_(0.,0.,0.,0.)
336     ,outerTrack_(0.,0.,0.,0.)
337     ,globalTrack_(0.,0.,0.,0.)
338 lethuill 1.14 ,ecalCandEnergy_(-9999.)
339     ,hcalCandEnergy_(-9999.)
340 lethuill 1.13 {;}
341    
342     ~TRootMuon() {;}
343    
344    
345     Float_t et_em() const { return et_em_;}
346     Float_t et_emS9() const { return et_emS9_;}
347     Float_t et_had() const { return et_had_;}
348     Float_t et_hadS9() const { return et_hadS9_;}
349     Float_t et_ho() const { return et_ho_;}
350     Float_t et_hoS9() const { return et_hoS9_;}
351     Float_t caloCompatibility() const { return caloCompatibility_;}
352    
353     Float_t isoR03_emEt() const { return isoR03_emEt_;}
354     Float_t isoR03_hadEt() const { return isoR03_hadEt_;}
355     Float_t isoR03_hoEt() const { return isoR03_hoEt_;}
356     Float_t isoR03_sumPt() const { return isoR03_sumPt_;}
357     Int_t isoR03_nTracks() const { return isoR03_nTracks_;}
358     Int_t isoR03_nJets() const { return isoR03_nJets_;}
359    
360     Float_t isoR05_emEt() const { return isoR05_emEt_;}
361     Float_t isoR05_hadEt() const { return isoR05_hadEt_;}
362     Float_t isoR05_hoEt() const { return isoR05_hoEt_;}
363     Float_t isoR05_sumPt() const { return isoR05_sumPt_;}
364     Int_t isoR05_nTracks() const { return isoR05_nTracks_;}
365     Int_t isoR05_nJets() const { return isoR05_nJets_;}
366    
367     Bool_t energyValid() const { return energyValid_;}
368     Bool_t matchesValid() const { return matchesValid_;}
369     Bool_t isolationValid() const { return isolationValid_;}
370    
371     Int_t direction() const { return direction_;}
372     Int_t algo() const { return algo_;}
373    
374     Bool_t isGlobalMuon() const { return algo_ & 2; }
375     Bool_t isTrackerMuon() const { return algo_ & 4; }
376     Bool_t isStandAloneMuon() const { return algo_ & 8; }
377     Bool_t isCaloMuon() const { return algo_ & 16; }
378    
379     Int_t id() const { return id_;}
380     Bool_t idTrackerMuonArbitrated() const { return id_ & 1; }
381     Bool_t idAllArbitrated() const { return id_ & 2; }
382     Bool_t idGlobalMuonPromptTight() const { return id_ & 4; }
383     Bool_t idTMLastStationLoose() const { return id_ & 8; }
384     Bool_t idTMLastStationTight() const { return id_ & 16; }
385     Bool_t idTM2DCompatibilityLoose() const { return id_ & 32; }
386     Bool_t idTM2DCompatibilityTight() const { return id_ & 64; }
387    
388     Int_t numberOfValidPixelHits() const { return numberOfValidPixelHits_; }
389     Int_t numberOfValidTrackerHits() const { return numberOfValidTrackerHits_; }
390     Int_t pixelLayersWithMeasurement() const { return pixelLayersWithMeasurement_; }
391     Int_t stripLayersWithMeasurement() const { return stripLayersWithMeasurement_; }
392     Float_t d0() const { return d0_ ;}
393     Float_t d0Error() const { return d0Error_ ;}
394     Float_t dsz() const { return dsz_ ;}
395     Float_t dszError() const { return dszError_ ;}
396     Float_t normalizedChi2() const { return normalizedChi2_ ;}
397     Float_t ptError() const { return ptError_ ;}
398     Float_t etaError() const { return etaError_ ;}
399     Float_t phiError() const { return phiError_ ;}
400     Float_t ip3DSignificance() const { return ip3DSignificance_ ;}
401    
402     TLorentzVector innerTrack() const { return innerTrack_; }
403     TLorentzVector outerTrack() const { return outerTrack_; }
404     TLorentzVector globalTrack() const { return globalTrack_; }
405    
406 lethuill 1.14 Float_t ecalCandEnergy() const { return ecalCandEnergy_; }
407     Float_t hcalCandEnergy() const { return hcalCandEnergy_; }
408    
409 lethuill 1.13 //TObject* genMuon() const { return genMuon_.GetObject() ;}
410     virtual TString typeName() const { return "TRootMuon"; }
411    
412    
413     void setCaloEnergy(Float_t et_em, Float_t et_emS9, Float_t et_had, Float_t et_hadS9, Float_t et_ho, Float_t et_hoS9, Float_t caloCompatibility)
414     {
415     et_em_ = et_em;
416     et_emS9_ = et_emS9;
417     et_had_ = et_had;
418     et_hadS9_ = et_hadS9;
419     et_ho_ = et_ho;
420     et_hoS9_ = et_hoS9;
421     caloCompatibility_ = caloCompatibility;
422     }
423    
424     void setIsoR03(Float_t isoR03_emEt, Float_t isoR03_hadEt, Float_t isoR03_hoEt, Float_t isoR03_sumPt, Int_t isoR03_nTracks, Int_t isoR03_nJets)
425     {
426     isoR03_emEt_ = isoR03_emEt;
427     isoR03_hadEt_ = isoR03_hadEt;
428     isoR03_hoEt_ = isoR03_hoEt;
429     isoR03_sumPt_ = isoR03_sumPt;
430     isoR03_nTracks_ = isoR03_nTracks;
431     isoR03_nJets_ = isoR03_nJets;
432     }
433    
434     void setIsoR05(Float_t isoR05_emEt, Float_t isoR05_hadEt, Float_t isoR05_hoEt, Float_t isoR05_sumPt, Int_t isoR05_nTracks, Int_t isoR05_nJets)
435     {
436     isoR05_emEt_ = isoR05_emEt;
437     isoR05_hadEt_ = isoR05_hadEt;
438     isoR05_hoEt_ = isoR05_hoEt;
439     isoR05_sumPt_ = isoR05_sumPt;
440     isoR05_nTracks_ = isoR05_nTracks;
441     isoR05_nJets_ = isoR05_nJets;
442     }
443    
444     void setValidity(Bool_t energyValid, Bool_t matchesValid, Bool_t isolationValid)
445     {
446     energyValid_ = energyValid;
447     matchesValid_ = matchesValid;
448     isolationValid_ = isolationValid;
449     }
450    
451     void setDirection(Int_t direction) { direction_ = direction; }
452     void setAlgo(Int_t algo) { algo_ = algo; }
453     void setID(Int_t id) { id_ = id; }
454     void setID(
455     Int_t trackerMuonArbitrated
456     ,Int_t allArbitrated
457     ,Int_t globalMuonPromptTight
458     ,Int_t tmLastStationLoose
459     ,Int_t tmLastStationTight
460     ,Int_t tm2DCompatibilityLoose
461     ,Int_t tm2DCompatibilityTight
462     )
463     { id_ = trackerMuonArbitrated*1 + allArbitrated*2 + globalMuonPromptTight*4 + tmLastStationLoose*8 + tmLastStationTight*16 + tm2DCompatibilityLoose*32 + tm2DCompatibilityTight*64; }
464    
465     void setNumberOfValidPixelHits(Int_t numberOfValidPixelHits) { numberOfValidPixelHits_ = numberOfValidPixelHits; }
466     void setNumberOfValidTrackerHits(Int_t numberOfValidTrackerHits) { numberOfValidTrackerHits_ = numberOfValidTrackerHits; }
467     void setPixelLayersWithMeasurement(Int_t pixelLayersWithMeasurement) { pixelLayersWithMeasurement_ = pixelLayersWithMeasurement; }
468     void setStripLayersWithMeasurement(Int_t stripLayersWithMeasurement) { stripLayersWithMeasurement_ = stripLayersWithMeasurement; }
469     void setD0(Float_t d0) { d0_ = d0; }
470     void setD0Error(Float_t d0Error) { d0Error_ = d0Error; }
471     void setDsz(Float_t dsz) { dsz_ = dsz; }
472     void setDszError(Float_t dszError) { dszError_ = dszError; }
473     void setNormalizedChi2(Float_t normalizedChi2) { normalizedChi2_ = normalizedChi2; }
474     void setPtError(Float_t ptError) { ptError_ = ptError; }
475     void setEtaError(Float_t etaError) { etaError_ = etaError; }
476     void setPhiError(Float_t phiError) { phiError_ = phiError; }
477     void setIP3DSignificance(Float_t ip3DSignificance) { ip3DSignificance_ = ip3DSignificance; }
478    
479     void setXYZTInnerTrack(Double_t x, Double_t y, Double_t z, Double_t t) { innerTrack_.SetXYZT(x,y,z,t); }
480     void setXYZTOuterTrack(Double_t x, Double_t y, Double_t z, Double_t t) { outerTrack_.SetXYZT(x,y,z,t); }
481     void setXYZTGlobalTrack(Double_t x, Double_t y, Double_t z, Double_t t) { globalTrack_.SetXYZT(x,y,z,t); }
482    
483 lethuill 1.14 void setEcalCandEnergy(Float_t ecalCandEnergy) { ecalCandEnergy_ = ecalCandEnergy; }
484     void setHcalCandEnergy(Float_t hcalCandEnergy) { hcalCandEnergy_ = hcalCandEnergy;}
485    
486 lethuill 1.13 friend std::ostream& operator<< (std::ostream& stream, const TRootMuon& muon) {
487     stream << "TRootMuon - Charge=" << muon.charge() << " (Et,eta,phi)=("<< muon.Et() <<","<< muon.Eta() <<","<< muon.Phi() << ") vertex(x,y,z)=("<< muon.vx() <<","<< muon.vy() <<","<< muon.vz() << ")" << endl
488     << " Type(G,T,S,C)=(" << muon.isGlobalMuon() << "," << muon.isTrackerMuon() << "," << muon.isStandAloneMuon() << "," << muon.isCaloMuon() << ") "
489     << " ID=(" << muon.idTrackerMuonArbitrated() << "," << muon.idAllArbitrated() << "," << muon.idGlobalMuonPromptTight() << "," << muon.idTMLastStationLoose()
490     << "," << muon.idTMLastStationTight() << "," << muon.idTM2DCompatibilityLoose() << "," << muon.idTM2DCompatibilityTight() << ")" << " Direction=" << muon.direction_
491     << " caloCompatibility="<< muon.caloCompatibility_ << " validity(energy,matches,isolation)=(" << muon.energyValid_ <<","<< muon.matchesValid_ <<","<< muon.isolationValid_ << ")" << endl
492     << " 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
493     << " 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
494     << " 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
495     << " d0=" << muon.d0_ << " +- " << muon.d0Error_ << " dsz=" << muon.dsz_ << " +- " << muon.dszError_ << " IP 3D Significance=" << muon.ip3DSignificance_;
496     return stream;
497     };
498    
499    
500     private:
501    
502     // Variables from reco::Muon
503     Float_t et_em_; // energy deposited in crossed ECAL crystals
504     Float_t et_emS9_; // energy deposited in 3x3 ECAL crystal matrix around crossed crystal
505     Float_t et_had_; // energy deposited in crossed HCAL tower (RecHits)
506     Float_t et_hadS9_; // energy deposited in 3x3 HCAL tower matrix around crossed tower (RecHits)
507     Float_t et_ho_; // energy deposited in crossed HO tower (RecHits)
508     Float_t et_hoS9_; // energy deposited in 3x3 HO tower matrix around crossed tower (RecHits)
509     Float_t caloCompatibility_; // Relative likelihood based on ECAL, HCAL, HO energy defined as L_muon/(L_muon+L_not_muon)
510    
511     // Muon isolation encapsulated in reco::Muon
512     // http://cmslxr.fnal.gov/lxr/source/RecoMuon/MuonIsolationProducers/doc/MuonIsolationProducers.doc
513     // Cone DR=0.3
514     Float_t isoR03_emEt_;
515     Float_t isoR03_hadEt_;
516     Float_t isoR03_hoEt_;
517     Float_t isoR03_sumPt_;
518     Int_t isoR03_nTracks_;
519     Int_t isoR03_nJets_;
520    
521     // Cone DR=0.5
522     Float_t isoR05_emEt_;
523     Float_t isoR05_hadEt_;
524     Float_t isoR05_hoEt_;
525     Float_t isoR05_sumPt_;
526     Int_t isoR05_nTracks_;
527     Int_t isoR05_nJets_;
528    
529     Bool_t energyValid_;
530     Bool_t matchesValid_;
531     Bool_t isolationValid_;
532    
533     Int_t direction_; // OutsideIn = -1, Undefined = 0, InsideOut = 1
534     Int_t algo_; // binary => GlobalMuon=00010 , TrackerMuon=00100 , StandAloneMuon=01000 , CaloMuon=10000
535     Int_t id_; // MuonId coded in binary word id_ ==> TrackerMuonArbitrated=0000001 , AllArbitrated=0000010 , GlobalMuonPromptTight=0000100 ,
536     // TMLastStationLoose=0001000 , TMLastStationTight=0010000 , TM2DCompatibilityLoose=0100000 , TM2DCompatibilityTight=1000000
537    
538    
539     // Variables from reco::GsfTrack
540    
541     /* cf: http://cmslxr.fnal.gov/lxr/source/DataFormats/TrackReco/interface/TrackBase.h
542     For tracks reconstructed in the CMS Tracker, the reference position is the point of closest approach to the centre
543     of CMS. For muons, this is not necessarily true. Parameters associated to the 5D curvilinear covariance matrix:
544     qoverp = q / abs(p) = signed inverse of momentum [1/GeV]
545     lambda = pi/2 - polar angle at the given point
546     phi = azimuth angle at the given point
547     dxy = -vx*sin(phi) + vy*cos(phi) [cm]
548     dsz = vz*cos(lambda) - (vx*cos(phi)+vy*sin(phi))*sin(lambda) [cm]
549    
550     Geometrically, dxy is the signed distance in the XY plane between the straight line passing through (vx,vy) with
551     azimuthal angle phi and the point (0,0). The dsz parameter is the signed distance in the SZ plane between the straight
552     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
553     of the straight line onto the XY plane. The convention is to assign the S coordinate for (vx,vy) as the value
554     vx*cos(phi)+vy*sin(phi). This value is zero when (vx,vy) is the point of minimum transverse distance to (0,0).
555    
556     Note that dxy and dsz provide sensible estimates of the distance from the true particle trajectory to (0,0,0) ONLY
557     in two cases:
558     - When (vx,vy,vz) already correspond to the point of minimum transverse distance to (0,0,0) or is close to it
559     (so that the differences between considering the exact trajectory or a straight line in this range are negligible).
560     This is usually true for Tracker tracks.
561     - When the track has infinite or extremely high momentum */
562    
563     Int_t numberOfValidPixelHits_; // Number of valid pixel hits
564     Int_t numberOfValidTrackerHits_; // Number of valid tracker hits (pixel+strip) - More than 1 hit per layer (even mono) is possible due to modules overlap
565     Int_t pixelLayersWithMeasurement_; // Number of pixel layers with at least one valid hit
566     Int_t stripLayersWithMeasurement_; // Number of strip layers with at least one valid hit
567    
568     Float_t d0_; // d0=-dxy
569     Float_t d0Error_; // error on d0_
570     Float_t dsz_; // dsz parameter
571     Float_t dszError_; // error on dsz_
572     Float_t normalizedChi2_; // chi-squared divided by n.d.o.f. of track fit
573    
574     Float_t ptError_; // needed ? ptError()
575     Float_t etaError_; // needed ? etaError()
576     Float_t phiError_; // needed ? phiError()
577    
578     Float_t ip3DSignificance_; // Significance of the impact parameter wrt to the selected primary vertex
579    
580     TLorentzVector innerTrack_; // Tracker only
581     TLorentzVector outerTrack_; // Muon detector only
582     TLorentzVector globalTrack_; // Tracker + Muon detector
583    
584 lethuill 1.14 // Variables from pat::Muons
585     Float_t ecalCandEnergy_; // energy within the cone of DR=0.07 in the ECAL (CandEnergy of the ecalIsoDeposit)
586     Float_t hcalCandEnergy_; // energy within the cone of DR=1.0 in the HCAL (CandEnergy of the hcalIsoDeposit)
587    
588    
589 lethuill 1.13 ClassDef (TRootMuon,6);
590    
591 mlethuil 1.1 };
592    
593     #endif