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.28 by amagnan, Thu Sep 15 09:46:20 2011 UTC vs.
Revision 1.29 by agilbert, Tue Oct 25 13:26:50 2011 UTC

# Line 4 | Line 4
4   #include <vector>
5   #include <string>
6   #include <iostream>
7 + #include <map>
8  
9   #include "TLorentzVector.h"
10   #include "TMath.h"
11  
12   namespace HbbAnalysis {
13  
14 +  struct Point{
15 +    double vx;
16 +    double vy;
17 +    double vz;
18 +    
19 +    Point() : vx(0), vy(0), vz(0) {}
20 +    Point(double x, double y, double z) : vx(x), vy(y), vz(z) {}
21 +    void Clear() {
22 +      vx = 0;
23 +      vy = 0;
24 +      vz = 0;
25 +    }
26 +  };
27 +
28 +  struct P4Total {
29 +    double comE;
30 +    double sumPx;
31 +    double sumPy;
32 +    double sumPz;
33 +    double sumE;
34 +    P4Total() :
35 +      comE(0),
36 +      sumPx(0),
37 +      sumPy(0),
38 +      sumPz(0),
39 +      sumE(0)
40 +    {}
41 +    void Clear() {
42 +      comE = 0;
43 +      sumPx = 0;
44 +      sumPy = 0;
45 +      sumPz = 0;
46 +      sumE = 0;
47 +    }
48 +  };
49 +
50 +  struct FourMomentum {
51 +      double px;
52 +      double py;
53 +      double pz;
54 +      double e;
55 +
56 +      FourMomentum() :
57 +        px(0),
58 +        py(0),
59 +        pz(0),
60 +        e(0)
61 +    {}
62 +      void Clear() {
63 +        px = 0;
64 +        py = 0;
65 +        pz = 0;
66 +        e = 0;
67 +      }
68 +      TLorentzVector GetTLorentzVector() const {
69 +        return TLorentzVector(px,py,pz,e);
70 +      }
71 +  };
72 +
73    struct PUVars {
74      int bunchCrossing;
75      unsigned int numInteractions;
# Line 17 | Line 77 | namespace HbbAnalysis {
77        bunchCrossing = 0;
78        numInteractions = 0;
79      }
80 +    void Clear(){
81 +      bunchCrossing = 0;
82 +      numInteractions = 0;
83 +    }
84    };
85  
86 <  struct MCVars {
87 <    unsigned int index;
88 <    double E;
89 <    double pT;
90 <    double eta;
91 <    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),
86 >  struct GenJetVars {
87 >    int flavour;
88 >    double mass;
89 >    int nConstituents;
90 >    GenJetVars():
91 >      flavour(0),
92        mass(0),
93 <      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)
93 >      nConstituents(0)
94      {}
95 <
95 >    void Clear() {
96 >      flavour = 0;
97 >      mass = 0;
98 >      nConstituents = 0;
99 >    }
100    };
101  
102    struct GenVars {
103 <    bool valid;
86 <    double E;
87 <    double pT;
88 <    double eta;
89 <    double y;
90 <    double phi;
91 <    int charge;
103 >    float charge;
104      int pdgId;
105 <    int status;
106 <    double mass;
107 <    double vx;
96 <    double vy;
97 <    double vz;
105 >    short status;
106 >    int index;
107 >    Point vertex;
108      GenVars():
99      valid(false),
100      E(0),
101      pT(0),
102      eta(0),
103      y(0),
104      phi(0),
109        charge(0),
110        pdgId(0),
111        status(0),
112 <      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)
112 >      index(0)
113      {}
114 +    void Clear() {
115 +      charge = 0;
116 +      pdgId = 0;
117 +      status = 0;
118 +      index = 0;
119 +      vertex.Clear();
120 +    }
121    };
122  
123    struct SCVars {
# Line 156 | Line 137 | namespace HbbAnalysis {
137        e5x5(0),
138        eOverP(0)
139      {}
140 +    void Clear() {
141 +    eta = 0;
142 +    sigmaEtaEta = 0;
143 +    sigmaIEtaIEta = 0;
144 +    e1x5 = 0;
145 +    e2x5Max = 0;
146 +    e5x5 = 0;
147 +    eOverP = 0;
148 +    }
149    };
150  
151    struct EleIsoVars {
162    float calo;
152      float track;
153      float ecal;
154      float hcal;
155      EleIsoVars():
167      calo(0),
156        track(0),
157        ecal(0),
158        hcal(0)
159      {}
160 +    void Clear() {
161 +    track = 0;
162 +    ecal = 0;
163 +    hcal = 0;
164 +    }
165    };
166    
167    struct EleIDVars{
168      unsigned short idAndIso;
169 <    std::vector<std::pair<std::string,float> > electronIDs;
169 >    std::map<std::string,float> electronIDs;
170      float hOverE;
171      float deltaPhiIn;
172      float deltaEtaIn;
173      bool ecalDrivenSeed;
174      bool trackerDrivenSeed;
182    float dB;
175      EleIDVars():
176        idAndIso(0),
177        hOverE(0),
178        deltaPhiIn(0),
179        deltaEtaIn(0),
180        ecalDrivenSeed(false),
181 <      trackerDrivenSeed(false),
182 <      dB(0)
183 <    {
184 <      electronIDs.clear();
181 >      trackerDrivenSeed(false)
182 >    {}
183 >    void Clear() {
184 >    idAndIso = 0;
185 >    electronIDs.clear();
186 >    hOverE = 0;
187 >    deltaPhiIn = 0;
188 >    deltaEtaIn = 0;
189 >    ecalDrivenSeed = false;
190 >    trackerDrivenSeed = false;
191      }
192    };
193  
# Line 210 | Line 208 | namespace HbbAnalysis {
208        trackerHits(0),
209        pixelHits(0)
210      {}
211 +    void Clear() {
212 +      dxy = 0;
213 +      dz = 0;
214 +      normalizedChi2 = 0;
215 +      muonHits = 0;
216 +      charge = 0;
217 +      trackerHits = 0;
218 +      pixelHits = 0;
219 +    }
220    };
221    
222    struct MuIsoVars {
223      float sumPt;
224      float emEt;
225      float hadEt;
226 <    float nTracks;
220 <    float nJets;
226 >    int nTracks;
227      MuIsoVars():
228        sumPt(0),
229        emEt(0),
230        hadEt(0),
231 <      nTracks(0),
226 <      nJets(0)
231 >      nTracks(0)
232      {}
233 +    void Clear() {
234 +    sumPt = 0;
235 +    emEt = 0;
236 +    hadEt = 0;
237 +    nTracks = 0;
238 +    }
239    };
240    
241    struct MuIDVars{
# Line 236 | Line 247 | namespace HbbAnalysis {
247      unsigned int nMatchesLoose;
248      unsigned int nMatchesMedium;
249      unsigned int nMatchesTight;
239    float dB;
250      MuIDVars():
251        type(0),
252        caloCompat(0),
# Line 244 | Line 254 | namespace HbbAnalysis {
254        nChambers(0),
255        nMatchesLoose(0),
256        nMatchesMedium(0),
257 <      nMatchesTight(0),
258 <      dB(0)
259 <    {
257 >      nMatchesTight(0)
258 >    {}
259 >    void Clear() {
260 >      type = 0;
261        ids.clear();
262 +      caloCompat = 0;
263 +      segCompat = 0;
264 +      nChambers = 0;
265 +      nMatchesLoose = 0;
266 +      nMatchesMedium = 0;
267 +      nMatchesTight = 0;
268      }
252
253
269    };
270  
271    
# Line 412 | Line 427 | namespace HbbAnalysis {
427      {}
428    };
429  
415  struct JetVars{
416    //1=had, 2=e, 3=mu for heavy quarks;
417    //2=uds, 3=g for light quarks
418    unsigned int flavour;
419    int partonFlavour;
420    unsigned int nAssociatedTracks;
421    double rawpT;
422    float etaMean;
423    float phiMean;
424    float etaEtaMoment;
425    float phiPhiMoment;
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  };
430  
431    struct CaloJetVars{
432 <    double maxEInEmTowers;
433 <    double maxEInHadTowers;
434 <    double energyFractionHadronic;
435 <    double emEnergyFraction;
436 <    double hadEnergyInHB;
437 <    double hadEnergyInHO;
438 <    double hadEnergyInHE;
439 <    double hadEnergyInHF;
440 <    double emEnergyInEB;
441 <    double emEnergyInEE;
442 <    double emEnergyInHF;
443 <    double towersArea;
444 <    double n90;
445 <    double n60;
432 >    float maxEInEmTowers;
433 >    float maxEInHadTowers;
434 >    float energyFractionHadronic;
435 >    float emEnergyFraction;
436 >    float hadEnergyInHB;
437 >    float hadEnergyInHO;
438 >    float hadEnergyInHE;
439 >    float hadEnergyInHF;
440 >    float emEnergyInEB;
441 >    float emEnergyInEE;
442 >    float emEnergyInHF;
443 >    float towersArea;
444 >    int n90;
445 >    int n60;
446      CaloJetVars():
447        maxEInEmTowers(0),
448        maxEInHadTowers(0),
# Line 470 | Line 459 | namespace HbbAnalysis {
459        n90(0),
460        n60(0)
461      {}
462 +    void Clear() {
463 +      maxEInEmTowers = 0;
464 +      maxEInHadTowers = 0;
465 +      energyFractionHadronic = 0;
466 +      emEnergyFraction = 0;
467 +      hadEnergyInHB = 0;
468 +      hadEnergyInHO = 0;
469 +      hadEnergyInHE = 0;
470 +      hadEnergyInHF = 0;
471 +      emEnergyInEB = 0;
472 +      emEnergyInEE = 0;
473 +      emEnergyInHF = 0;
474 +      towersArea = 0;
475 +      n90 = 0;
476 +      n60 = 0;
477 +    }
478    };
479  
480    struct JPTJetVars{
# Line 492 | Line 497 | namespace HbbAnalysis {
497        elecMultiplicity(0),
498        calopT(0),
499        caloEta(0)
500 <    {
500 >    {}
501 >    void Clear() {
502 >      zspCorrection = 0;
503 >      elecMultiplicity = 0;
504 >      calopT = 0;
505 >      caloEta = 0;
506        particleStatusPt.clear();
507      }
508    };
509  
510    struct JPTPFJetVars{
511 <    double chargedHadronEnergy;
512 <    double chargedHadronEnergyFraction;
513 <    double neutralHadronEnergy;
514 <    double neutralHadronEnergyFraction;
515 <    double chargedEmEnergy;
516 <    double chargedEmEnergyFraction;
517 <    double neutralEmEnergy;
518 <    double neutralEmEnergyFraction;
519 <    double chargedMultiplicity;
520 <    double muonMultiplicity;
511 >    float chargedHadronEnergy;
512 >    float chargedHadronEnergyFraction;
513 >    float neutralHadronEnergy;
514 >    float neutralHadronEnergyFraction;
515 >    float chargedEmEnergy;
516 >    float chargedEmEnergyFraction;
517 >    float neutralEmEnergy;
518 >    float neutralEmEnergyFraction;
519 >    int chargedMultiplicity;
520 >    int muonMultiplicity;
521      JPTPFJetVars():
522        chargedHadronEnergy(0),
523        chargedHadronEnergyFraction(0),
# Line 520 | Line 530 | namespace HbbAnalysis {
530        chargedMultiplicity(0),
531        muonMultiplicity(0)
532      {}
533 +    void Clear() {
534 +      chargedHadronEnergy = 0;
535 +      chargedHadronEnergyFraction = 0;
536 +      neutralHadronEnergy = 0;
537 +      neutralHadronEnergyFraction = 0;
538 +      chargedEmEnergy = 0;
539 +      chargedEmEnergyFraction = 0;
540 +      neutralEmEnergy = 0;
541 +      neutralEmEnergyFraction = 0;
542 +      chargedMultiplicity = 0;
543 +      muonMultiplicity = 0;
544 +    }
545    };
546  
547    struct PFJetVars{
# Line 535 | Line 557 | namespace HbbAnalysis {
557        numberOfDaughters(0),
558        HFHadronEnergy(0)
559      {}
560 +    void Clear() {
561 +      chargedMuEnergy = 0;
562 +      chargedMuEnergyFraction = 0;
563 +      neutralMultiplicity = 0;
564 +      numberOfDaughters = 0;
565 +      HFHadronEnergy = 0;
566 +    }
567    };
568  
569    struct JetBtagVars{
570 <    double cSV;
571 <    double cSVMVA;
572 <    double iPMVA;
573 <    double bProba;
574 <    double probability;
575 <    double sSVHE;
576 <    double sSVHP;
577 <    double softElectronByPt;
578 <    double softElectronByIP3d;
579 <    double softMuon;
580 <    double softMuonByPt;
581 <    double softMuonByIP3d;
582 <    double tCHE;
583 <    double tCHP;
570 >    float cSV;
571 >    float cSVMVA;
572 >    float iPMVA;
573 >    float bProba;
574 >    float probability;
575 >    float sSVHE;
576 >    float sSVHP;
577 >    float softElectronByPt;
578 >    float softElectronByIP3d;
579 >    float softMuon;
580 >    float softMuonByPt;
581 >    float softMuonByIP3d;
582 >    float tCHE;
583 >    float tCHP;
584      JetBtagVars():
585        cSV(0),
586        cSVMVA(0),
# Line 568 | Line 597 | namespace HbbAnalysis {
597        tCHE(0),
598        tCHP(0)
599      {}
600 +    void Clear() {
601 +      cSV = 0;
602 +      cSVMVA = 0;
603 +      iPMVA = 0;
604 +      bProba = 0;
605 +      probability = 0;
606 +      sSVHE = 0;
607 +      sSVHP = 0;
608 +      softElectronByPt = 0;
609 +      softElectronByIP3d = 0;
610 +      softMuon = 0;
611 +      softMuonByPt = 0;
612 +      softMuonByIP3d = 0;
613 +      tCHE = 0;
614 +      tCHP = 0;
615 +    }
616 +  };
617 +
618 +  struct JetSecVertexVars{
619 +    HbbAnalysis::FourMomentum fourVec;
620 +    HbbAnalysis::Point vertex;
621 +    JetSecVertexVars(){}
622 +    void Clear() {
623 +      fourVec.Clear();
624 +      vertex.Clear();
625 +    }
626    };
627  
628  
# Line 598 | Line 653 | namespace HbbAnalysis {
653        nECALTowers(0),
654        hitsInN90(0)
655      {}
656 +    void Clear() {
657 +      fHPD = 0;
658 +      fRBX = 0;
659 +      n90Hits = 0;
660 +      restrictedEMF = 0;
661 +      nHCALTowers = 0;
662 +      nECALTowers = 0;
663 +      hitsInN90 = 0;
664 +    }
665    };
666  
667    struct JetECorVars{
668 <    std::vector<std::pair<std::string,double> > Levels;
668 >    //std::vector<std::pair<std::string,double> > Levels;
669 >    std::map<std::string, double> Levels;
670      JetECorVars(){
671 +    }
672 +    void Clear() {
673        Levels.clear();
674      }
675    };
# Line 630 | Line 697 | namespace HbbAnalysis {
697      std::string name;
698      unsigned int index;
699      bool accept;
700 +    int prescale;
701      TriggerVars():
702        name(""),
703        index(0),
704 <      accept(false)
704 >      accept(false),
705 >      prescale(0)
706      {}
707    };
708  
709  
710    struct VertexVars{
711 <    std::vector<float> trackWeights;
712 <    std::vector<float> trackpT;
711 >    //std::vector<float> trackWeights;
712 >    //std::vector<float> trackpT;
713 >    double sumPtSq;
714      double chi2;
715      double ndof;
716      double x;
# Line 654 | Line 724 | namespace HbbAnalysis {
724      double cov02;
725      double cov12;
726      VertexVars():
727 +      sumPtSq(0),
728        chi2(0),
729        ndof(0),
730        x(0),
# Line 667 | Line 738 | namespace HbbAnalysis {
738        cov02(0),
739        cov12(0)
740      {
741 <      trackWeights.clear();
742 <      trackpT.clear();
741 >    }
742 >    void Clear() {
743 >    sumPtSq = 0;
744 >    chi2 = 0;
745 >    ndof = 0;
746 >    x = 0;
747 >    y = 0;
748 >    z = 0;
749 >    rho = 0;
750 >    xError = 0;
751 >    yError = 0;
752 >    zError = 0;
753 >    cov01 = 0;
754 >    cov02 = 0;
755 >    cov12 = 0;
756      }
757    };
758  
# Line 708 | Line 792 | namespace HbbAnalysis {
792        BeamWidthXError(0),
793        BeamWidthYError(0)
794      {}
711
795    };
796  
797    double DeltaPhi(const double phi1, const double phi2);
# Line 722 | Line 805 | namespace HbbAnalysis {
805      return sqrt(dEta*dEta+dPhi*dPhi);
806    }
807  
808 <  double SameSign(const BaseVars & v1, const BaseVars & v2);
808 >  bool SameSign(double charge1, double charge2);
809  
810 <  double OppSign(const BaseVars & v1, const BaseVars & v2);
810 >  bool OppSign(double charge1, double charge2);
811  
812 <  TLorentzVector FourMomentum(const BaseVars & v, const double scale=1) ;
812 >  //TLorentzVector FourMomentum(const BaseVars & v, const double scale=1) ;
813  
814    double TransverseMass(const TLorentzVector & leg1,
815                          const TLorentzVector & leg2,
# Line 747 | Line 830 | namespace HbbAnalysis {
830                                               double mEx,
831                                               double mEy);
832  
833 <  double EtaDetector(const BaseVars & v1);
834 <  double EtaDetector(const GenVars & v1);
833 >  //double EtaDetector(const BaseVars & v1);
834 >  //double EtaDetector(const GenVars & v1);
835  
836   }//namespace
837  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines