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.21 by agilbert, Thu May 5 15:09:04 2011 UTC vs.
Revision 1.28 by amagnan, Thu Sep 15 09:46:20 2011 UTC

# Line 6 | Line 6
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;
# Line 18 | Line 28 | namespace HbbAnalysis {
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 {
# Line 27 | Line 48 | namespace HbbAnalysis {
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 {
# Line 41 | Line 70 | namespace HbbAnalysis {
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 57 | 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 {
# Line 69 | Line 123 | namespace HbbAnalysis {
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 85 | 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{
# Line 95 | Line 179 | namespace HbbAnalysis {
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 {
# Line 105 | Line 201 | namespace HbbAnalysis {
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 113 | 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 124 | 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    
# Line 135 | 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  
# Line 148 | 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 166 | 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 173 | 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 192 | 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 200 | 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 220 | Line 424 | namespace HbbAnalysis {
424      float etaEtaMoment;
425      float phiPhiMoment;
426      float etaPhiMoment;
223    bool l1Match;
224    bool hltMatch;
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 241 | 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{
# Line 258 | Line 487 | namespace HbbAnalysis {
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 JPTPFJetVars{
# Line 271 | Line 508 | namespace HbbAnalysis {
508      double neutralEmEnergyFraction;
509      double chargedMultiplicity;
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 294 | 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  
# Line 315 | Line 589 | namespace HbbAnalysis {
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 329 | 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  
# Line 353 | Line 653 | namespace HbbAnalysis {
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{
# Line 377 | Line 694 | namespace HbbAnalysis {
694      //double emittanceX() const { return emittanceX_; }
695      //double emittanceY() const { return emittanceY_; }
696      //double betaStar() const { return betaStar_; }
697 <  };
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 +  double DeltaR(const TLorentzVector & v1, const TLorentzVector & v2);
716  
717 +  template <class T1, class T2>
718 +  double DeltaR(const T1 & v1, const T2 & v2){
719 +    double dEta = v1.eta - v2.eta;
720 +    double dPhi = fabs(v1.phi - v2.phi);
721 +    if (dPhi > TMath::Pi()) dPhi = (2.0*TMath::Pi() - dPhi);
722 +    return sqrt(dEta*dEta+dPhi*dPhi);
723 +  }
724  
385  double DeltaPhi(const double phi1, const double phi2);
386
387  double DeltaR(const BaseVars & v1, const BaseVars & v2);
388  double DeltaR(const BaseVars & v1, const GenVars & v2);
389
725    double SameSign(const BaseVars & v1, const BaseVars & v2);
726  
727    double OppSign(const BaseVars & v1, const BaseVars & v2);
728  
729    TLorentzVector FourMomentum(const BaseVars & v, const double scale=1) ;
730  
731 <  double TransverseMass(const BaseVars & leg1,
732 <                        const BaseVars & leg2,
731 >  double TransverseMass(const TLorentzVector & leg1,
732 >                        const TLorentzVector & leg2,
733                          const double mEx,
734                          const double mEy);
735  
736 <  double TransverseMass(const BaseVars & leg1,
736 >  double TransverseMass(const TLorentzVector & leg1,
737                          const double mEx,
738                          const double mEy);
739  
740 <  TLorentzVector FourMomentumCDFmethod(const BaseVars & leg1,
741 <                                       const BaseVars & leg2,
740 >  TLorentzVector FourMomentumCDFmethod(const TLorentzVector & leg1,
741 >                                       const TLorentzVector & leg2,
742                                         double mEx,
743                                         double mEy);
744  
745 <  TLorentzVector FourMomentumCollinearApprox(const BaseVars & leg1,
746 <                                             const BaseVars & leg2,
745 >  TLorentzVector FourMomentumCollinearApprox(const TLorentzVector & leg1,
746 >                                             const TLorentzVector & leg2,
747                                               double mEx,
748                                               double mEy);
749  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines