ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/Objects.hh
Revision: 1.26
Committed: Sun Aug 7 09:51:36 2011 UTC (13 years, 9 months ago) by agilbert
Content type: text/plain
Branch: MAIN
Changes since 1.25: +3 -1 lines
Log Message:
Change DR in FilterZbb

File Contents

# Content
1 #ifndef HbbAnalysis_Objects_hh
2 #define HbbAnalysis_Objects_hh
3
4 #include <vector>
5 #include <string>
6 #include <iostream>
7
8 #include "TLorentzVector.h"
9 #include "TMath.h"
10
11 namespace HbbAnalysis {
12
13 struct PUVars {
14 int bunchCrossing;
15 unsigned int numInteractions;
16 PUVars(){
17 bunchCrossing = 0;
18 numInteractions = 0;
19 }
20 };
21
22 struct MCVars {
23 unsigned int index;
24 double E;
25 double pT;
26 double eta;
27 double y;
28 double phi;
29 int pdgId;
30 int status;
31
32 MCVars():
33 index(0),
34 E(0),
35 pT(0),
36 eta(0),
37 y(0),
38 phi(0),
39 pdgId(0),
40 status(0)
41 {;}
42 };
43
44 struct HLTVars {
45 float pT;
46 float eta;
47 float phi;
48 int id;
49 float mass;
50 unsigned int type;//1=EM, 2=muon, 3=jet, 0=unknown
51 HLTVars():
52 pT(0),
53 eta(0),
54 phi(0),
55 id(0),
56 mass(0),
57 type(0)
58 {}
59 };
60
61 struct L1Vars {
62 //type:
63 //0 = empty
64 //1 = central jet
65 //2 = tau jet
66 //3 = forward jet
67 unsigned int type;
68 int bx;
69 float pT;
70 float ET;
71 float eta;
72 float phi;
73 L1Vars():
74 type(0),
75 bx(0),
76 pT(0),
77 ET(0),
78 eta(0),
79 phi(0)
80 {}
81
82 };
83
84 struct GenVars {
85 bool valid;
86 double E;
87 double pT;
88 double eta;
89 double y;
90 double phi;
91 int charge;
92 int pdgId;
93 int status;
94 double mass;
95 double vx;
96 double vy;
97 double vz;
98 GenVars():
99 valid(false),
100 E(0),
101 pT(0),
102 eta(0),
103 y(0),
104 phi(0),
105 charge(0),
106 pdgId(0),
107 status(0),
108 mass(0),
109 vx(0),
110 vy(0),
111 vz(0)
112 {}
113
114 };
115
116 struct BaseVars {
117 double E;
118 double pT;
119 double eta;
120 double y;
121 double phi;
122 float charge;
123 double vx;
124 double vy;
125 double vz;
126 bool hltMatch;
127
128 BaseVars():
129 E(0),
130 pT(0),
131 eta(0),
132 y(0),
133 phi(0),
134 charge(0),
135 vx(0),
136 vy(0),
137 vz(0),
138 hltMatch(true)
139 {}
140 };
141
142 struct SCVars {
143 float sigmaEtaEta;
144 float sigmaIEtaIEta;
145 float e1x5;
146 float e2x5Max;
147 float e5x5;
148 float eOverP;
149 SCVars():
150 sigmaEtaEta(0),
151 sigmaIEtaIEta(0),
152 e1x5(0),
153 e2x5Max(0),
154 e5x5(0),
155 eOverP(0)
156 {}
157 };
158
159 struct EleIsoVars {
160 float calo;
161 float track;
162 float ecal;
163 float hcal;
164 EleIsoVars():
165 calo(0),
166 track(0),
167 ecal(0),
168 hcal(0)
169 {}
170 };
171
172 struct EleIDVars{
173 unsigned short idAndIso;
174 std::vector<std::pair<std::string,float> > electronIDs;
175 float hOverE;
176 float deltaPhiIn;
177 float deltaEtaIn;
178 bool ecalDrivenSeed;
179 bool trackerDrivenSeed;
180 float dB;
181 EleIDVars():
182 idAndIso(0),
183 hOverE(0),
184 deltaPhiIn(0),
185 deltaEtaIn(0),
186 ecalDrivenSeed(false),
187 trackerDrivenSeed(false),
188 dB(0)
189 {
190 electronIDs.clear();
191 }
192 };
193
194 struct MuTrkVars {
195 float dxy;
196 float dz;
197 float normalizedChi2;
198 unsigned int muonHits;
199 int charge;
200 unsigned int trackerHits;
201 unsigned int pixelHits;
202 MuTrkVars():
203 dxy(0),
204 dz(0),
205 normalizedChi2(0),
206 muonHits(0),
207 charge(0),
208 trackerHits(0),
209 pixelHits(0)
210 {}
211 };
212
213 struct MuIsoVars {
214 float sumPt;
215 float emEt;
216 float hadEt;
217 float nTracks;
218 float nJets;
219 MuIsoVars():
220 sumPt(0),
221 emEt(0),
222 hadEt(0),
223 nTracks(0),
224 nJets(0)
225 {}
226 };
227
228 struct MuIDVars{
229 unsigned short type;
230 std::vector<unsigned short> ids;
231 float caloCompat;
232 float segCompat;
233 unsigned int nChambers;
234 unsigned int nMatchesLoose;
235 unsigned int nMatchesMedium;
236 unsigned int nMatchesTight;
237 float dB;
238 MuIDVars():
239 type(0),
240 caloCompat(0),
241 segCompat(0),
242 nChambers(0),
243 nMatchesLoose(0),
244 nMatchesMedium(0),
245 nMatchesTight(0),
246 dB(0)
247 {
248 ids.clear();
249 }
250
251
252 };
253
254
255 struct TrkVars{
256 double pT;
257 double eta;
258 double phi;
259 double matchDist;
260 double IPxy;
261 double IPz;
262 float signedSipt;
263 TrkVars():
264 pT(0),
265 eta(0),
266 phi(0),
267 matchDist(0),
268 IPxy(0),
269 IPz(0),
270 signedSipt(0)
271 {}
272
273 };
274
275
276 struct CaloTauIsoVars{
277 unsigned int nIsoTracks;
278 unsigned int nSigTracks;
279 float leadTrackHCAL3x3hitsEtSum;
280 float leadTrackHCAL3x3hottesthitDEta;
281 float signalTracksInvariantMass;
282 float tracksInvariantMass;
283 float isolationTracksPtSum;
284 float isolationECALhitsEtSum;
285 float maximumHCALhitEt;
286 CaloTauIsoVars():
287 nIsoTracks(0),
288 nSigTracks(0),
289 leadTrackHCAL3x3hitsEtSum(0),
290 leadTrackHCAL3x3hottesthitDEta(0),
291 signalTracksInvariantMass(0),
292 tracksInvariantMass(0),
293 isolationTracksPtSum(0),
294 isolationECALhitsEtSum(0),
295 maximumHCALhitEt(0)
296 {}
297
298
299
300 };
301
302 struct CaloTauIDVars{
303 float byIsolation;
304 float byLeadingTrackFinding;
305 float byLeadingTrackPtCut;
306 CaloTauIDVars():
307 byIsolation(0),
308 byLeadingTrackFinding(0),
309 byLeadingTrackPtCut(0)
310 {}
311
312 };
313
314 struct PFTauIsoVars{
315 unsigned int nSigCands;
316 unsigned int nIsoCands;
317 double maximumHCALPFClusterEt;
318 //double emFraction;
319 double hcalTotOverPLead;
320 double hcalMaxOverPLead;
321 double hcal3x3OverPLead;
322 double ecalStripSumEOverPLead;
323 double bremsRecoveryEOverPLead;
324 PFTauIsoVars():
325 nSigCands(0),
326 nIsoCands(0),
327 maximumHCALPFClusterEt(0),
328 //emFraction(0),
329 hcalTotOverPLead(0),
330 hcalMaxOverPLead(0),
331 hcal3x3OverPLead(0),
332 ecalStripSumEOverPLead(0),
333 bremsRecoveryEOverPLead(0)
334 {}
335 };
336
337 //for hadr, neutr and gamma cands
338 struct PFTauCandVars{
339 unsigned int nSigCands;
340 unsigned int nIsoCands;
341 double isolationPtSum;
342 PFTauCandVars():
343 nSigCands(0),
344 nIsoCands(0),
345 isolationPtSum(0)
346 {}
347 };
348
349 struct PFTauIDVars{
350 float byLeadingTrackFinding;
351 float byLeadingTrackPtCut;
352 float byTrackIsolation;
353 float byECALIsolation;
354 float byIsolation;
355 float againstElectron;
356 float againstMuon;
357 float byIsolationUsingLeadingPion;
358 float byTaNC;
359 float byTaNCfrHalfPercent;
360 float byTaNCfrOnePercent;
361 float byTaNCfrQuarterPercent;
362 float byTaNCfrTenthPercent;
363 float ecalIsolationUsingLeadingPion;
364 float leadingPionPtCut;
365 float trackIsolationUsingLeadingPion;
366 PFTauIDVars():
367 byLeadingTrackFinding(0),
368 byLeadingTrackPtCut(0),
369 byTrackIsolation(0),
370 byECALIsolation(0),
371 byIsolation(0),
372 againstElectron(0),
373 againstMuon(0),
374 byIsolationUsingLeadingPion(0),
375 byTaNC(0),
376 byTaNCfrHalfPercent(0),
377 byTaNCfrOnePercent(0),
378 byTaNCfrQuarterPercent(0),
379 byTaNCfrTenthPercent(0),
380 ecalIsolationUsingLeadingPion(0),
381 leadingPionPtCut(0),
382 trackIsolationUsingLeadingPion(0)
383 {}
384 };
385
386 struct PFTauEleIDVars{
387 double pT;
388 double eta;
389 double phi;
390 float output;
391 float decision;
392
393 PFTauEleIDVars():
394 pT(0),
395 eta(0),
396 phi(0),
397 output(0),
398 decision(0)
399 {}
400 };
401
402 struct PFTauMuIDVars{
403 float caloCompat;
404 float segCompat;
405 float decision;
406 PFTauMuIDVars():
407 caloCompat(0),
408 segCompat(0),
409 decision(0)
410 {}
411 };
412
413 struct JetVars{
414 //1=had, 2=e, 3=mu for heavy quarks;
415 //2=uds, 3=g for light quarks
416 unsigned int flavour;
417 int partonFlavour;
418 unsigned int nAssociatedTracks;
419 double rawpT;
420 float etaMean;
421 float phiMean;
422 float etaEtaMoment;
423 float phiPhiMoment;
424 float etaPhiMoment;
425 //double rawEta;
426 //double rawPhi;
427 JetVars():
428 flavour(0),
429 partonFlavour(0),
430 nAssociatedTracks(0),
431 rawpT(0),
432 etaMean(0),
433 phiMean(0),
434 etaEtaMoment(0),
435 phiPhiMoment(0),
436 etaPhiMoment(0)
437 {}
438 };
439
440 struct CaloJetVars{
441 double maxEInEmTowers;
442 double maxEInHadTowers;
443 double energyFractionHadronic;
444 double emEnergyFraction;
445 double hadEnergyInHB;
446 double hadEnergyInHO;
447 double hadEnergyInHE;
448 double hadEnergyInHF;
449 double emEnergyInEB;
450 double emEnergyInEE;
451 double emEnergyInHF;
452 double towersArea;
453 double n90;
454 double n60;
455 CaloJetVars():
456 maxEInEmTowers(0),
457 maxEInHadTowers(0),
458 energyFractionHadronic(0),
459 emEnergyFraction(0),
460 hadEnergyInHB(0),
461 hadEnergyInHO(0),
462 hadEnergyInHE(0),
463 hadEnergyInHF(0),
464 emEnergyInEB(0),
465 emEnergyInEE(0),
466 emEnergyInHF(0),
467 towersArea(0),
468 n90(0),
469 n60(0)
470 {}
471 };
472
473 struct JPTJetVars{
474 float zspCorrection;
475 int elecMultiplicity;
476 float calopT;
477 float caloEta;
478 //std::vector<TrkVars> pionsInCone;
479 //std::vector<TrkVars> pionsCurledOut;
480 //std::vector<TrkVars> pionsCurledIn;
481 //std::vector<TrkVars> elecsInCone;
482 //std::vector<TrkVars> elecsCurledOut;
483 //std::vector<TrkVars> elecsCurledIn;
484 //std::vector<TrkVars> muonsInCone;
485 //std::vector<TrkVars> muonsCurledOut;
486 //std::vector<TrkVars> muonsCurledIn;
487 std::vector< std::pair<unsigned int,double> > particleStatusPt;
488 JPTJetVars():
489 zspCorrection(0),
490 elecMultiplicity(0),
491 calopT(0),
492 caloEta(0)
493 {
494 particleStatusPt.clear();
495 }
496 };
497
498 struct JPTPFJetVars{
499 double chargedHadronEnergy;
500 double chargedHadronEnergyFraction;
501 double neutralHadronEnergy;
502 double neutralHadronEnergyFraction;
503 double chargedEmEnergy;
504 double chargedEmEnergyFraction;
505 double neutralEmEnergy;
506 double neutralEmEnergyFraction;
507 double chargedMultiplicity;
508 double muonMultiplicity;
509 JPTPFJetVars():
510 chargedHadronEnergy(0),
511 chargedHadronEnergyFraction(0),
512 neutralHadronEnergy(0),
513 neutralHadronEnergyFraction(0),
514 chargedEmEnergy(0),
515 chargedEmEnergyFraction(0),
516 neutralEmEnergy(0),
517 neutralEmEnergyFraction(0),
518 chargedMultiplicity(0),
519 muonMultiplicity(0)
520 {}
521 };
522
523 struct PFJetVars{
524 double chargedMuEnergy;
525 double chargedMuEnergyFraction;
526 double neutralMultiplicity;
527 unsigned numberOfDaughters;
528 double HFHadronEnergy;
529 PFJetVars():
530 chargedMuEnergy(0),
531 chargedMuEnergyFraction(0),
532 neutralMultiplicity(0),
533 numberOfDaughters(0),
534 HFHadronEnergy(0)
535 {}
536 };
537
538 struct JetBtagVars{
539 double cSV;
540 double cSVMVA;
541 double iPMVA;
542 double bProba;
543 double probability;
544 double sSVHE;
545 double sSVHP;
546 double softElectronByPt;
547 double softElectronByIP3d;
548 double softMuon;
549 double softMuonByPt;
550 double softMuonByIP3d;
551 double tCHE;
552 double tCHP;
553 JetBtagVars():
554 cSV(0),
555 cSVMVA(0),
556 iPMVA(0),
557 bProba(0),
558 probability(0),
559 sSVHE(0),
560 sSVHP(0),
561 softElectronByPt(0),
562 softElectronByIP3d(0),
563 softMuon(0),
564 softMuonByPt(0),
565 softMuonByIP3d(0),
566 tCHE(0),
567 tCHP(0)
568 {}
569 };
570
571
572 struct JetIDVars{
573 double fHPD;
574 double fRBX;
575 int n90Hits;
576 //double fSubDetector1;
577 //double fSubDetector2;
578 //double fSubDetector3;
579 //double fSubDetector4;
580 double restrictedEMF;
581 int nHCALTowers;
582 int nECALTowers;
583 //double approximatefHPD;
584 //double approximatefRBX;
585 int hitsInN90;
586 // muon hits id
587 //int numberOfHits2RPC;
588 //int numberOfHits3RPC;
589 //int numberOfHitsRPC;
590 JetIDVars():
591 fHPD(0),
592 fRBX(0),
593 n90Hits(0),
594 restrictedEMF(0),
595 nHCALTowers(0),
596 nECALTowers(0),
597 hitsInN90(0)
598 {}
599 };
600
601 struct JetECorVars{
602 std::vector<std::pair<std::string,double> > Levels;
603 JetECorVars(){
604 Levels.clear();
605 }
606 };
607
608
609 struct MetVars{
610 double mET;
611 double mEx;
612 double mEy;
613 double sumET;
614 double phi;
615 double mEtSig;
616 MetVars():
617 mET(0),
618 mEx(0),
619 mEy(0),
620 sumET(0),
621 phi(0),
622 mEtSig(0)
623 {}
624
625 };
626
627 struct TriggerVars{
628 std::string name;
629 unsigned int index;
630 bool accept;
631 TriggerVars():
632 name(""),
633 index(0),
634 accept(false)
635 {}
636 };
637
638
639 struct VertexVars{
640 std::vector<float> trackWeights;
641 std::vector<float> trackpT;
642 double chi2;
643 double ndof;
644 double x;
645 double y;
646 double z;
647 double rho;
648 double xError;
649 double yError;
650 double zError;
651 double cov01;
652 double cov02;
653 double cov12;
654 VertexVars():
655 chi2(0),
656 ndof(0),
657 x(0),
658 y(0),
659 z(0),
660 rho(0),
661 xError(0),
662 yError(0),
663 zError(0),
664 cov01(0),
665 cov02(0),
666 cov12(0)
667 {
668 trackWeights.clear();
669 trackpT.clear();
670 }
671 };
672
673 struct BeamSpotVars{
674 double x0;
675 double y0;
676 double z0;
677 double sigmaZ;
678 double BeamWidthX;
679 double BeamWidthY;
680 double x0Error;
681 double y0Error;
682 double z0Error;
683 double sigmaZ0Error;
684 double BeamWidthXError;
685 double BeamWidthYError;
686 //double dxdz;
687 //double dydz;
688 //double dxdzError;
689 //double dydzError;
690 //BeamType type();
691 //enum BeamType { Unknown=-1, Fake=0, LHC=1, Tracker=2 };
692 //double emittanceX() const { return emittanceX_; }
693 //double emittanceY() const { return emittanceY_; }
694 //double betaStar() const { return betaStar_; }
695 BeamSpotVars():
696 x0(0),
697 y0(0),
698 z0(0),
699 sigmaZ(0),
700 BeamWidthX(0),
701 BeamWidthY(0),
702 x0Error(0),
703 y0Error(0),
704 z0Error(0),
705 sigmaZ0Error(0),
706 BeamWidthXError(0),
707 BeamWidthYError(0)
708 {}
709
710 };
711
712 double DeltaPhi(const double phi1, const double phi2);
713
714 template <class T1, class T2>
715 double DeltaR(const T1 & v1, const T2 & v2){
716 double dEta = v1.eta - v2.eta;
717 double dPhi = fabs(v1.phi - v2.phi);
718 if (dPhi > TMath::Pi()) dPhi = (2.0*TMath::Pi() - dPhi);
719 return sqrt(dEta*dEta+dPhi*dPhi);
720 }
721
722 double SameSign(const BaseVars & v1, const BaseVars & v2);
723
724 double OppSign(const BaseVars & v1, const BaseVars & v2);
725
726 TLorentzVector FourMomentum(const BaseVars & v, const double scale=1) ;
727
728 double TransverseMass(const BaseVars & leg1,
729 const BaseVars & leg2,
730 const double mEx,
731 const double mEy);
732
733 double TransverseMass(const BaseVars & leg1,
734 const double mEx,
735 const double mEy);
736
737 TLorentzVector FourMomentumCDFmethod(const BaseVars & leg1,
738 const BaseVars & leg2,
739 double mEx,
740 double mEy);
741
742 TLorentzVector FourMomentumCollinearApprox(const BaseVars & leg1,
743 const BaseVars & leg2,
744 double mEx,
745 double mEy);
746
747 double EtaDetector(const BaseVars & v1);
748 double EtaDetector(const GenVars & v1);
749
750 }//namespace
751
752 #endif