ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/interface/Objects.hh
(Generate patch)

Comparing UserCode/HbbAnalysis/interface/Objects.hh (file contents):
Revision 1.1 by amagnan, Thu Sep 17 19:39:51 2009 UTC vs.
Revision 1.24 by amagnan, Fri Jun 24 14:49:11 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines