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.8 by amagnan, Thu Apr 29 09:33:48 2010 UTC vs.
Revision 1.27 by amagnan, Mon Sep 5 17:15:15 2011 UTC

# Line 6 | Line 6
6   #include <iostream>
7  
8   #include "TLorentzVector.h"
9 + #include "TMath.h"
10  
11   namespace HbbAnalysis {
12 <
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 {
# Line 24 | Line 86 | namespace HbbAnalysis {
86      double E;
87      double pT;
88      double eta;
89 +    double y;
90      double phi;
91      int charge;
92      int pdgId;
# Line 32 | Line 95 | namespace HbbAnalysis {
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 eta;
144      float sigmaEtaEta;
145      float sigmaIEtaIEta;
146      float e1x5;
147      float e2x5Max;
148      float e5x5;
149      float eOverP;
150 +    SCVars():
151 +      eta(0),
152 +      sigmaEtaEta(0),
153 +      sigmaIEtaIEta(0),
154 +      e1x5(0),
155 +      e2x5Max(0),
156 +      e5x5(0),
157 +      eOverP(0)
158 +    {}
159    };
160  
161    struct EleIsoVars {
# Line 59 | Line 163 | namespace HbbAnalysis {
163      float track;
164      float ecal;
165      float hcal;
166 +    EleIsoVars():
167 +      calo(0),
168 +      track(0),
169 +      ecal(0),
170 +      hcal(0)
171 +    {}
172    };
173    
174    struct EleIDVars{
175 +    unsigned short idAndIso;
176      std::vector<std::pair<std::string,float> > electronIDs;
177      float hOverE;
178      float deltaPhiIn;
179      float deltaEtaIn;
180      bool ecalDrivenSeed;
181      bool trackerDrivenSeed;
182 +    float dB;
183 +    EleIDVars():
184 +      idAndIso(0),
185 +      hOverE(0),
186 +      deltaPhiIn(0),
187 +      deltaEtaIn(0),
188 +      ecalDrivenSeed(false),
189 +      trackerDrivenSeed(false),
190 +      dB(0)
191 +    {
192 +      electronIDs.clear();
193 +    }
194    };
195  
196    struct MuTrkVars {
197 <    float IPd0;
198 <    float IPdz;
199 <    unsigned int nHits;
197 >    float dxy;
198 >    float dz;
199 >    float normalizedChi2;
200 >    unsigned int muonHits;
201 >    int charge;
202 >    unsigned int trackerHits;
203 >    unsigned int pixelHits;
204 >    MuTrkVars():
205 >      dxy(0),
206 >      dz(0),
207 >      normalizedChi2(0),
208 >      muonHits(0),
209 >      charge(0),
210 >      trackerHits(0),
211 >      pixelHits(0)
212 >    {}
213    };
214    
215    struct MuIsoVars {
# Line 82 | Line 218 | namespace HbbAnalysis {
218      float hadEt;
219      float nTracks;
220      float nJets;
221 +    MuIsoVars():
222 +      sumPt(0),
223 +      emEt(0),
224 +      hadEt(0),
225 +      nTracks(0),
226 +      nJets(0)
227 +    {}
228    };
229    
230    struct MuIDVars{
# Line 93 | Line 236 | namespace HbbAnalysis {
236      unsigned int nMatchesLoose;
237      unsigned int nMatchesMedium;
238      unsigned int nMatchesTight;
239 +    float dB;
240 +    MuIDVars():
241 +      type(0),
242 +      caloCompat(0),
243 +      segCompat(0),
244 +      nChambers(0),
245 +      nMatchesLoose(0),
246 +      nMatchesMedium(0),
247 +      nMatchesTight(0),
248 +      dB(0)
249 +    {
250 +      ids.clear();
251 +    }
252 +
253 +
254    };
255  
256 <  struct TauLeadTrkVars{
256 >  
257 >  struct TrkVars{
258      double pT;
259      double eta;
260      double phi;
# Line 103 | Line 262 | namespace HbbAnalysis {
262      double IPxy;
263      double IPz;
264      float signedSipt;
265 +    TrkVars():
266 +      pT(0),
267 +      eta(0),
268 +      phi(0),
269 +      matchDist(0),
270 +      IPxy(0),
271 +      IPz(0),
272 +      signedSipt(0)
273 +    {}
274 +
275    };
276 +  
277  
278    struct CaloTauIsoVars{
279      unsigned int nIsoTracks;
# Line 115 | Line 285 | namespace HbbAnalysis {
285      float isolationTracksPtSum;
286      float isolationECALhitsEtSum;
287      float maximumHCALhitEt;
288 +    CaloTauIsoVars():
289 +      nIsoTracks(0),
290 +      nSigTracks(0),
291 +      leadTrackHCAL3x3hitsEtSum(0),
292 +      leadTrackHCAL3x3hottesthitDEta(0),
293 +      signalTracksInvariantMass(0),
294 +      tracksInvariantMass(0),
295 +      isolationTracksPtSum(0),
296 +      isolationECALhitsEtSum(0),
297 +      maximumHCALhitEt(0)
298 +    {}
299 +
300 +
301 +
302    };
303  
304    struct CaloTauIDVars{
305      float byIsolation;
306      float byLeadingTrackFinding;
307      float byLeadingTrackPtCut;
308 +    CaloTauIDVars():
309 +      byIsolation(0),
310 +      byLeadingTrackFinding(0),
311 +      byLeadingTrackPtCut(0)
312 +    {}
313 +
314    };
315  
316    struct PFTauIsoVars{
# Line 133 | Line 323 | namespace HbbAnalysis {
323      double hcal3x3OverPLead;
324      double ecalStripSumEOverPLead;
325      double bremsRecoveryEOverPLead;
326 +    PFTauIsoVars():
327 +      nSigCands(0),
328 +      nIsoCands(0),
329 +      maximumHCALPFClusterEt(0),
330 +                //emFraction(0),
331 +      hcalTotOverPLead(0),
332 +      hcalMaxOverPLead(0),
333 +      hcal3x3OverPLead(0),
334 +      ecalStripSumEOverPLead(0),
335 +      bremsRecoveryEOverPLead(0)
336 +    {}
337    };
338  
339    //for hadr, neutr and gamma cands
# Line 140 | Line 341 | namespace HbbAnalysis {
341      unsigned int nSigCands;
342      unsigned int nIsoCands;
343      double isolationPtSum;
344 +    PFTauCandVars():
345 +      nSigCands(0),
346 +      nIsoCands(0),
347 +      isolationPtSum(0)
348 +    {}
349    };
350  
351    struct PFTauIDVars{
# Line 159 | Line 365 | namespace HbbAnalysis {
365      float ecalIsolationUsingLeadingPion;
366      float leadingPionPtCut;
367      float trackIsolationUsingLeadingPion;
368 +    PFTauIDVars():
369 +      byLeadingTrackFinding(0),
370 +      byLeadingTrackPtCut(0),
371 +      byTrackIsolation(0),
372 +      byECALIsolation(0),
373 +      byIsolation(0),
374 +      againstElectron(0),
375 +      againstMuon(0),
376 +      byIsolationUsingLeadingPion(0),
377 +      byTaNC(0),
378 +      byTaNCfrHalfPercent(0),
379 +      byTaNCfrOnePercent(0),
380 +      byTaNCfrQuarterPercent(0),
381 +      byTaNCfrTenthPercent(0),
382 +      ecalIsolationUsingLeadingPion(0),
383 +      leadingPionPtCut(0),
384 +      trackIsolationUsingLeadingPion(0)
385 +    {}
386    };
387  
388    struct PFTauEleIDVars{
# Line 167 | Line 391 | namespace HbbAnalysis {
391      double phi;
392      float output;
393      float decision;
394 +
395 +    PFTauEleIDVars():
396 +      pT(0),
397 +      eta(0),
398 +      phi(0),
399 +      output(0),
400 +      decision(0)
401 +    {}
402    };
403      
404    struct PFTauMuIDVars{
405      float caloCompat;
406      float segCompat;
407      float decision;
408 +    PFTauMuIDVars():
409 +      caloCompat(0),
410 +      segCompat(0),
411 +      decision(0)
412 +    {}
413    };
414  
415    struct JetVars{
# Line 189 | Line 426 | namespace HbbAnalysis {
426      float etaPhiMoment;
427      //double rawEta;
428      //double rawPhi;
429 +    JetVars():
430 +      flavour(0),
431 +      partonFlavour(0),
432 +      nAssociatedTracks(0),
433 +      rawpT(0),
434 +      etaMean(0),
435 +      phiMean(0),
436 +      etaEtaMoment(0),
437 +      phiPhiMoment(0),
438 +      etaPhiMoment(0)
439 +    {}
440    };
441  
442    struct CaloJetVars{
# Line 206 | Line 454 | namespace HbbAnalysis {
454      double towersArea;
455      double n90;
456      double n60;
457 +    CaloJetVars():
458 +      maxEInEmTowers(0),
459 +      maxEInHadTowers(0),
460 +      energyFractionHadronic(0),
461 +      emEnergyFraction(0),
462 +      hadEnergyInHB(0),
463 +      hadEnergyInHO(0),
464 +      hadEnergyInHE(0),
465 +      hadEnergyInHF(0),
466 +      emEnergyInEB(0),
467 +      emEnergyInEE(0),
468 +      emEnergyInHF(0),
469 +      towersArea(0),
470 +      n90(0),
471 +      n60(0)
472 +    {}
473 +  };
474 +
475 +  struct JPTJetVars{
476 +    float zspCorrection;
477 +    int elecMultiplicity;
478 +    float calopT;
479 +    float caloEta;
480 +    //std::vector<TrkVars> pionsInCone;
481 +    //std::vector<TrkVars> pionsCurledOut;
482 +    //std::vector<TrkVars> pionsCurledIn;
483 +    //std::vector<TrkVars> elecsInCone;
484 +    //std::vector<TrkVars> elecsCurledOut;
485 +    //std::vector<TrkVars> elecsCurledIn;
486 +    //std::vector<TrkVars> muonsInCone;
487 +    //std::vector<TrkVars> muonsCurledOut;
488 +    //std::vector<TrkVars> muonsCurledIn;
489 +    std::vector< std::pair<unsigned int,double> > particleStatusPt;
490 +    JPTJetVars():
491 +      zspCorrection(0),
492 +      elecMultiplicity(0),
493 +      calopT(0),
494 +      caloEta(0)
495 +    {
496 +      particleStatusPt.clear();
497 +    }
498    };
499  
500 <  struct PFJetVars{
500 >  struct JPTPFJetVars{
501      double chargedHadronEnergy;
502      double chargedHadronEnergyFraction;
503      double neutralHadronEnergy;
504      double neutralHadronEnergyFraction;
505      double chargedEmEnergy;
506      double chargedEmEnergyFraction;
218    double chargedMuEnergy;
219    double chargedMuEnergyFraction;
507      double neutralEmEnergy;
508      double neutralEmEnergyFraction;
509      double chargedMultiplicity;
223    double neutralMultiplicity;
510      double muonMultiplicity;
511 +    JPTPFJetVars():
512 +      chargedHadronEnergy(0),
513 +      chargedHadronEnergyFraction(0),
514 +      neutralHadronEnergy(0),
515 +      neutralHadronEnergyFraction(0),
516 +      chargedEmEnergy(0),
517 +      chargedEmEnergyFraction(0),
518 +      neutralEmEnergy(0),
519 +      neutralEmEnergyFraction(0),
520 +      chargedMultiplicity(0),
521 +      muonMultiplicity(0)
522 +    {}
523 +  };
524 +
525 +  struct PFJetVars{
526 +    double chargedMuEnergy;
527 +    double chargedMuEnergyFraction;
528 +    double neutralMultiplicity;
529 +    unsigned numberOfDaughters;
530 +    double HFHadronEnergy;
531 +    PFJetVars():
532 +      chargedMuEnergy(0),
533 +      chargedMuEnergyFraction(0),
534 +      neutralMultiplicity(0),
535 +      numberOfDaughters(0),
536 +      HFHadronEnergy(0)
537 +    {}
538    };
539  
540    struct JetBtagVars{
# Line 239 | Line 552 | namespace HbbAnalysis {
552      double softMuonByIP3d;
553      double tCHE;
554      double tCHP;
555 +    JetBtagVars():
556 +      cSV(0),
557 +      cSVMVA(0),
558 +      iPMVA(0),
559 +      bProba(0),
560 +      probability(0),
561 +      sSVHE(0),
562 +      sSVHP(0),
563 +      softElectronByPt(0),
564 +      softElectronByIP3d(0),
565 +      softMuon(0),
566 +      softMuonByPt(0),
567 +      softMuonByIP3d(0),
568 +      tCHE(0),
569 +      tCHP(0)
570 +    {}
571    };
572  
573  
574    struct JetIDVars{
575      double fHPD;
576      double fRBX;
577 <    double n90Hits;
577 >    int n90Hits;
578      //double fSubDetector1;
579      //double fSubDetector2;
580      //double fSubDetector3;
581      //double fSubDetector4;
582 <    //double restrictedEMF;
583 <    //int    nHCALTowers;
584 <    //int    nECALTowers;
582 >    double restrictedEMF;
583 >    int    nHCALTowers;
584 >    int    nECALTowers;
585      //double approximatefHPD;
586      //double approximatefRBX;
587 <    //int    hitsInN90;
587 >    int hitsInN90;
588      // muon hits id
589      //int numberOfHits2RPC;
590      //int numberOfHits3RPC;
591      //int numberOfHitsRPC;
592 +    JetIDVars():
593 +      fHPD(0),
594 +      fRBX(0),
595 +      n90Hits(0),
596 +      restrictedEMF(0),
597 +      nHCALTowers(0),
598 +      nECALTowers(0),
599 +      hitsInN90(0)
600 +    {}
601 +  };
602 +
603 +  struct JetECorVars{
604 +    std::vector<std::pair<std::string,double> > Levels;
605 +    JetECorVars(){
606 +      Levels.clear();
607 +    }
608    };
609  
610  
# Line 270 | Line 615 | namespace HbbAnalysis {
615      double sumET;
616      double phi;
617      double mEtSig;
618 +    MetVars():
619 +      mET(0),
620 +      mEx(0),
621 +      mEy(0),
622 +      sumET(0),
623 +      phi(0),
624 +      mEtSig(0)
625 +    {}
626 +
627    };
628  
629    struct TriggerVars{
630      std::string name;
631      unsigned int index;
632      bool accept;
633 +    TriggerVars():
634 +      name(""),
635 +      index(0),
636 +      accept(false)
637 +    {}
638    };
639  
640  
641    struct VertexVars{
642      std::vector<float> trackWeights;
643 +    std::vector<float> trackpT;
644      double chi2;
645      double ndof;
646      double x;
647      double y;
648      double z;
649 +    double rho;
650      double xError;
651      double yError;
652      double zError;
653      double cov01;
654      double cov02;
655      double cov12;
656 +    VertexVars():
657 +      chi2(0),
658 +      ndof(0),
659 +      x(0),
660 +      y(0),
661 +      z(0),
662 +      rho(0),
663 +      xError(0),
664 +      yError(0),
665 +      zError(0),
666 +      cov01(0),
667 +      cov02(0),
668 +      cov12(0)
669 +    {
670 +      trackWeights.clear();
671 +      trackpT.clear();
672 +    }
673 +  };
674 +
675 +  struct BeamSpotVars{
676 +    double x0;
677 +    double y0;
678 +    double z0;
679 +    double sigmaZ;
680 +    double BeamWidthX;
681 +    double BeamWidthY;
682 +    double x0Error;
683 +    double y0Error;
684 +    double z0Error;
685 +    double sigmaZ0Error;
686 +    double BeamWidthXError;
687 +    double BeamWidthYError;    
688 +    //double dxdz;
689 +    //double dydz;
690 +    //double dxdzError;
691 +    //double dydzError;
692 +    //BeamType type();
693 +    //enum BeamType { Unknown=-1, Fake=0, LHC=1, Tracker=2 };
694 +    //double emittanceX() const { return emittanceX_; }
695 +    //double emittanceY() const { return emittanceY_; }
696 +    //double betaStar() const { return betaStar_; }
697 +    BeamSpotVars():
698 +      x0(0),
699 +      y0(0),
700 +      z0(0),
701 +      sigmaZ(0),
702 +      BeamWidthX(0),
703 +      BeamWidthY(0),
704 +      x0Error(0),
705 +      y0Error(0),
706 +      z0Error(0),
707 +      sigmaZ0Error(0),
708 +      BeamWidthXError(0),
709 +      BeamWidthYError(0)
710 +    {}
711 +
712    };
713  
714    double DeltaPhi(const double phi1, const double phi2);
715  
716 <  double DeltaR(const BaseVars & v1, const BaseVars & v2);
717 <  double DeltaR(const BaseVars & v1, const GenVars & v2);
718 <
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 = fabs(v1.phi - v2.phi);
720 >    if (dPhi > TMath::Pi()) dPhi = (2.0*TMath::Pi() - dPhi);
721 >    return sqrt(dEta*dEta+dPhi*dPhi);
722 >  }
723 >
724    double SameSign(const BaseVars & v1, const BaseVars & v2);
725  
726    double OppSign(const BaseVars & v1, const BaseVars & v2);
# Line 324 | Line 746 | namespace HbbAnalysis {
746                                               double mEx,
747                                               double mEy);
748  
749 +  double EtaDetector(const BaseVars & v1);
750 +  double EtaDetector(const GenVars & v1);
751 +
752   }//namespace
753  
754   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines