ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/kiesel/TreeWriter/SusyEvent.h
Revision: 1.4
Committed: Fri Apr 19 11:44:17 2013 UTC (12 years ago) by kiesel
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +3 -3 lines
Log Message:
int-> UShort, cause nTupled datasets are done with different version

This should not affect the output, cause the information is not used

File Contents

# User Rev Content
1 kiesel 1.1 // -*- C++ -*-
2     //
3     // Package: SusyNtuplizer
4     // Class: SusyEvent.h
5     //
6     /*
7    
8     Description: Objects definitions used for SusyNtuples
9    
10     Implementation:
11    
12     */
13     //
14     // Original Author: Dongwook Jang
15 kiesel 1.4 // $Id: SusyEvent.h,v 1.3 2013/04/09 07:28:02 kiesel Exp $
16 kiesel 1.1 //
17    
18     #ifndef SusyEvent_h
19     #define SusyEvent_h
20    
21     #include <vector>
22     #include <map>
23     #include <math.h>
24    
25     #include <TLorentzVector.h>
26    
27    
28     namespace susy {
29    
30     const float etaGapBegin = 1.4442;
31     const float etaGapEnd = 1.566;
32     const float etaGap = 1.499;
33     const float etaMax = 2.5;
34    
35     // b-tagging vector positions -- same as susyNtuplizer_cfi.py order
36     const unsigned int kTCHE = 0;
37     const unsigned int kTCHP = 1;
38     const unsigned int kJP = 2;
39     const unsigned int kJBP = 3;
40     const unsigned int kSSV = 4;
41     const unsigned int kCSV = 5;
42     const unsigned int kCSVMVA = 6;
43     const unsigned int kSE = 7;
44     const unsigned int kSM = 8;
45    
46     // pileup jet id vector positions -- same as susyNtuplizer_cfi.py order
47     const unsigned int kFull = 0;
48     const unsigned int kCutBased = 1;
49     const unsigned int kSimple = 2;
50    
51     class PUSummaryInfo { /*each PUSummaryInfo object holds information for one BX (early, in time,
52     or late)*/
53    
54     public:
55    
56     PUSummaryInfo() { Init(); }
57     ~PUSummaryInfo() { Init(); }
58     void Init();
59    
60     //all info below from https://twiki.cern.ch/twiki/bin/view/CMS/PileupInformation
61     /*low_cut = 0.1 GeV, high_cut = 0.5 GeV, tracks summed/counted are TrackingParticles from
62     simulation truth info*/
63     int numInteractions; //the number of pileup interactions that have been added to the event
64     std::vector<float> zPositions; /*the true primary vertex position along the z axis for each
65     added interaction*/
66     std::vector<float> sumPTLowPT; /*the sum of the transverse momentum of the tracks originating
67     from each interaction, where track pT > low_cut*/
68     std::vector<float> sumPTHighPT; /*the sum of the transverse momentum of the tracks originating
69     from each interaction, where track pT > high_cut*/
70     std::vector<int> numTracksLowPT; /*the number of tracks originating from each interaction,
71     where track pT > low_cut*/
72     std::vector<int> numTracksHighPT; /*the number of tracks originating from each interaction,
73     where track pT > high_cut*/
74     std::vector<float> instLumi; //for PU from DataMixer
75     std::vector<unsigned int> dataMixerRun;
76     std::vector<unsigned int> dataMixerEvt;
77     std::vector<unsigned int> dataMixerLumiSection;
78     int BX; /*to which bunch crossing does this interaction belong? New in 3_11_3 and 4_1_3 or
79     later*/
80     float trueNumInteractions;
81    
82     };
83    
84    
85     class Particle {
86    
87     public:
88    
89     Particle() { Init(); }
90     ~Particle() { Init(); }
91     void Init();
92    
93     UChar_t status;
94     Short_t motherIndex;
95     Int_t pdgId;
96     Char_t charge;
97     TVector3 vertex;
98     TLorentzVector momentum;
99    
100     };
101    
102    
103     class CorrMETData {
104    
105     public:
106     CorrMETData() { Init(); }
107     ~CorrMETData() { Init(); }
108    
109     void Init();
110    
111     Float_t dmEx; // for uncorrection, correctedEx - dmEx
112     Float_t dmEy; // for uncorrection, correctedEy - dmEy
113     Float_t dsumEt; // for uncorrection, correctedSumEt - dsumEt
114     Float_t dSignificance; // for uncorrection, correctedSig - dSignificance
115    
116     };
117    
118    
119     class MET {
120    
121     public:
122    
123     MET() { Init(); }
124     ~MET() { Init(); }
125     void Init();
126    
127     Float_t met() const { return mEt.Mod(); }
128     Float_t metX() const { return mEt.X(); }
129     Float_t metY() const { return mEt.Y(); }
130    
131     Float_t sumEt;
132     Float_t significance;
133     TVector2 mEt;
134     TVector3 vertex;
135     std::vector<susy::CorrMETData> mEtCorr;
136    
137     };
138    
139    
140    
141     class Vertex {
142    
143     public:
144    
145     Vertex() { Init(); }
146     ~Vertex() { Init(); }
147     void Init();
148     bool isFake() { return (chi2 == 0 && ndof == 0 && tracksSize == 0); }
149    
150     Float_t chi2;
151     Float_t ndof;
152     UChar_t tracksSize;
153     TVector3 position;
154    
155     };
156    
157    
158     class Cluster {
159    
160     public:
161    
162     Cluster() { Init(); }
163     ~Cluster() { Init(); }
164     void Init();
165    
166     UChar_t nCrystals;
167     Float_t energy;
168     TVector3 position;
169    
170     };
171    
172    
173     class SuperCluster {
174    
175     public:
176    
177     SuperCluster() { Init(); }
178     ~SuperCluster() { Init(); }
179     void Init();
180    
181     Short_t seedClusterIndex; // index in vector<Cluster> below
182     Float_t energy;
183     Float_t preshowerEnergy;
184     Float_t phiWidth;
185     Float_t etaWidth;
186     TVector3 position;
187 kiesel 1.4 std::vector<UShort_t> basicClusterIndices;
188 kiesel 1.1
189     };
190    
191    
192     class Track {
193    
194     public:
195    
196     Track() { Init(); }
197     ~Track() { Init(); }
198     void Init();
199    
200     // derived quantities
201     float normChi2() const { return (ndof != 0) ? chi2/ndof : chi2*1e6; }
202     float qoverp() const { return charge/momentum.P(); }
203     float lambda() const { return M_PI/2 - momentum.Theta(); }
204     float dsz() const { return vertex.Z()*momentum.Pt()/momentum.P() - (vertex.X()*momentum.Px()+vertex.Y()*momentum.Py())/momentum.Pt() * momentum.Pz()/momentum.P(); }
205     float dz() const { return vertex.Z() - (vertex.X()*momentum.Px()+vertex.Y()*momentum.Py())/momentum.Pt() * (momentum.Pz()/momentum.Pt()); }
206     float dxy() const { return (-vertex.X()*momentum.Py() + vertex.Y()*momentum.Px())/momentum.Pt(); }
207     float d0() const { return -dxy(); }
208     float phi() const { return momentum.Phi(); }
209     bool loose() const { return (quality & ( 0x1 << 0)); }
210     bool tight() const { return (quality & ( 0x1 << 1)); }
211     bool highPurity() const { return (quality & ( 0x1 << 2)); }
212     bool confirmed() const { return (quality & ( 0x1 << 3)); }
213     bool goodIterative() const { return (confirmed() || highPurity()); }
214    
215     Int_t algorithm;
216     Int_t quality;
217     UChar_t numberOfValidHits;
218     UChar_t numberOfValidTrackerHits;
219     UChar_t numberOfValidMuonHits;
220     UChar_t numberOfValidPixelHits;
221     UChar_t numberOfValidStripHits;
222     Float_t chi2;
223     Float_t ndof;
224     Float_t charge;
225     Float_t error[5]; // qoverp, lambda, phi, dxy, dsz
226     TVector3 vertex;
227     TLorentzVector momentum;
228     std::map<TString,TVector3> extrapolatedPositions;
229    
230     };
231    
232    
233     class Photon {
234    
235     public:
236    
237     Photon() { Init(); }
238     ~Photon() { Init(); }
239     void Init();
240    
241     // fiducial bits
242     bool isEB() { return (fidBit & (0x1 << 0)); }
243     bool isEE() { return (fidBit & (0x1 << 1)); }
244     bool isEBEtaGap() { return (fidBit & (0x1 << 2)); }
245     bool isEBPhiGap() { return (fidBit & (0x1 << 3)); }
246     bool isEERingGap() { return (fidBit & (0x1 << 4)); }
247     bool isEEDeeGap() { return (fidBit & (0x1 << 5)); }
248     bool isEBEEGap() { return (fidBit & (0x1 << 6)); }
249     bool isPF() { return (fidBit & (0x1 << 7)); }
250    
251     Float_t hcalTowerSumEtConeDR04() { return (hcalDepth1TowerSumEtConeDR04+hcalDepth2TowerSumEtConeDR04); }
252     Float_t hcalTowerSumEtConeDR03() { return (hcalDepth1TowerSumEtConeDR03+hcalDepth2TowerSumEtConeDR03); }
253     Float_t r1x5() { return ((e5x5 > 0) ? e1x5/e5x5 : 0); }
254     Float_t r2x5() { return ((e5x5 > 0) ? e2x5/e5x5 : 0); }
255    
256     Int_t fidBit;
257     Int_t nPixelSeeds;
258     bool passelectronveto;
259     Float_t hadronicOverEm;
260     Float_t hadTowOverEm; //2012 hOverE
261     Float_t hadronicDepth1OverEm;
262     Float_t hadronicDepth2OverEm;
263     Float_t e1x2;
264     Float_t e1x5;
265     Float_t e2x5;
266     Float_t e3x3;
267     Float_t e5x5;
268     Float_t maxEnergyXtal;
269     Float_t sigmaEtaEta;
270     Float_t sigmaIetaIeta;
271     Float_t sigmaIphiIphi;
272     Float_t r9;
273    
274     Float_t ecalRecHitSumEtConeDR04;
275     Float_t hcalDepth1TowerSumEtConeDR04;
276     Float_t hcalDepth2TowerSumEtConeDR04;
277     Float_t hcalIsoConeDR04_2012;
278     Float_t trkSumPtSolidConeDR04;
279     Float_t trkSumPtHollowConeDR04;
280     UChar_t nTrkSolidConeDR04;
281     UChar_t nTrkHollowConeDR04;
282    
283     Float_t ecalRecHitSumEtConeDR03;
284     Float_t hcalDepth1TowerSumEtConeDR03;
285     Float_t hcalDepth2TowerSumEtConeDR03;
286     Float_t hcalIsoConeDR03_2012;
287     Float_t trkSumPtSolidConeDR03;
288     Float_t trkSumPtHollowConeDR03;
289     UChar_t nTrkSolidConeDR03;
290     UChar_t nTrkHollowConeDR03;
291    
292     // calculated from alternative code
293     Float_t chargedHadronIso;
294     Float_t neutralHadronIso;
295     Float_t photonIso;
296    
297     // read from IsoDeposit
298     Float_t chargedHadronIsoDeposit;
299     Float_t neutralHadronIsoDeposit;
300     Float_t photonIsoDeposit;
301    
302     Float_t seedTime; // seed timing
303    
304     // MIP Variables
305    
306     Float_t mipChi2;
307     Float_t mipTotEnergy;
308     Float_t mipSlope;
309     Float_t mipIntercept;
310     Int_t mipNhitCone;
311     bool mipIsHalo;
312    
313     // Conversion info
314     Bool_t convInfo;
315     Float_t convDist;
316     Float_t convDcot;
317     Float_t convVtxChi2;
318     Float_t convVtxNdof;
319     TVector3 convVertex;
320     Float_t convDxy;
321     Float_t convDz;
322     Float_t convLxy;
323     Float_t convLz;
324     Float_t convZofPVFromTracks;
325     Int_t convTrackChargeProd;
326     Int_t convTrack1nHit;
327     Int_t convTrack2nHit;
328     Float_t convTrack1chi2;
329     Float_t convTrack2chi2;
330     Float_t convTrack1pT;
331     Float_t convTrack2pT;
332     Float_t convTrack1InnerZ;
333     Float_t convTrack2InnerZ;
334     Float_t convTrack1InnerX;
335     Float_t convTrack2InnerX;
336     Float_t convTrack1InnerY;
337     Float_t convTrack2InnerY;
338     Float_t convTrack1Signedd0;
339     Float_t convTrack2Signedd0;
340    
341     Short_t superClusterIndex;
342     Float_t superClusterPreshowerEnergy;
343     Float_t superClusterPhiWidth;
344     Float_t superClusterEtaWidth;
345     TVector3 caloPosition;
346    
347     std::pair<double,double> MVAregEnergyAndErr;
348     TLorentzVector MVAcorrMomentum;
349    
350     TVector3 vertex; // photon vertex when reconstructed.
351     TLorentzVector momentum;
352     std::map<TString,UChar_t> idPairs;
353    
354     };
355    
356    
357     class Electron {
358    
359     public:
360    
361     Electron() { Init(); }
362     ~Electron() { Init(); }
363     void Init();
364    
365     // fiducial bits
366     bool isEB() { return (fidBit & (0x1 << 0)); }
367     bool isEE() { return (fidBit & (0x1 << 1)); }
368     bool isEBEEGap() { return (fidBit & (0x1 << 2)); }
369     bool isEBEtaGap() { return (fidBit & (0x1 << 3)); }
370     bool isEBPhiGap() { return (fidBit & (0x1 << 4)); }
371     bool isEEDeeGap() { return (fidBit & (0x1 << 5)); }
372     bool isEERingGap() { return (fidBit & (0x1 << 6)); }
373     bool isEBGap() { return (isEBEtaGap() || isEBPhiGap()); }
374     bool isEEGap() { return (isEEDeeGap() || isEERingGap()); }
375     bool isGap() { return (isEBGap() || isEEGap() || isEBEEGap()); }
376    
377     // boolean variables packed in boolPack
378     bool isGsfCtfScPixChargeConsistent() { return (boolPack & (0x1 << 0)); }
379     bool isGsfScPixChargeConsistent() { return (boolPack & (0x1 << 1)); }
380     bool isGsfCtfChargeConsistent() { return (boolPack & (0x1 << 2)); }
381     bool ecalDrivenSeed() { return (boolPack & (0x1 << 3)); }
382     bool trackerDrivenSeed() { return (boolPack & (0x1 << 4)); }
383     bool passingCutBasedPreselection() { return (boolPack & (0x1 << 5)); }
384     bool passingMvaPreselection() { return (boolPack & (0x1 << 6)); }
385     bool ambiguous() { return (boolPack & (0x1 << 7)); }
386     bool isEcalEnergyCorrected() { return (boolPack & (0x1 << 8)); }
387     bool isEnergyScaleCorrected() { return (boolPack & (0x1 << 9)); }
388     bool convFlags() { return (boolPack & (0x1 << 10)); }
389     bool isPF() { return (boolPack & (0x1 << 11)); }
390     bool ecalDriven() { return (ecalDrivenSeed() && passingCutBasedPreselection()); }
391    
392     Float_t hcalOverEcal() { return (hcalDepth1OverEcal + hcalDepth2OverEcal); }
393     Float_t dr03HcalTowerSumEt() { return (dr03HcalDepth1TowerSumEt + dr03HcalDepth2TowerSumEt); }
394     Float_t dr04HcalTowerSumEt() { return (dr04HcalDepth1TowerSumEt + dr04HcalDepth2TowerSumEt); }
395    
396     Int_t fidBit;
397     Int_t boolPack;
398     Int_t scPixCharge;
399    
400     Float_t eSuperClusterOverP;
401     Float_t eSeedClusterOverP;
402     Float_t eSeedClusterOverPout;
403     Float_t eEleClusterOverPout;
404     Float_t deltaEtaSuperClusterTrackAtVtx;
405     Float_t deltaEtaSeedClusterTrackAtCalo;
406     Float_t deltaEtaEleClusterTrackAtCalo;
407     Float_t deltaPhiSuperClusterTrackAtVtx;
408     Float_t deltaPhiSeedClusterTrackAtCalo;
409     Float_t deltaPhiEleClusterTrackAtCalo;
410    
411     Float_t shFracInnerHits;
412    
413     Float_t sigmaEtaEta;
414     Float_t sigmaIetaIeta;
415     Float_t e1x5;
416     Float_t e2x5Max;
417     Float_t e5x5;
418     Float_t hcalDepth1OverEcal; // hadronic energy on depth1 / em enrgy
419     Float_t hcalDepth2OverEcal; // hadronic energy on depth2 / em enrgy
420     Float_t hcalOverEcalBc; //2012 hOverE
421    
422     Float_t dr03TkSumPt;
423     Float_t dr03EcalRecHitSumEt;
424     Float_t dr03HcalDepth1TowerSumEt;
425     Float_t dr03HcalDepth2TowerSumEt;
426     Float_t dr03HcalDepth1TowerSumEtBc; //2012 iso with new hOverE
427     Float_t dr03HcalDepth2TowerSumEtBc; //2012 iso with new hOverE
428    
429     Float_t dr04TkSumPt;
430     Float_t dr04EcalRecHitSumEt;
431     Float_t dr04HcalDepth1TowerSumEt;
432     Float_t dr04HcalDepth2TowerSumEt;
433     Float_t dr04HcalDepth1TowerSumEtBc; //2012 iso with new hOverE
434     Float_t dr04HcalDepth2TowerSumEtBc; //2012 iso with new hOverE
435    
436     // Conversion info
437     Float_t convDist;
438     Float_t convDcot;
439     Float_t convRadius;
440    
441     Float_t chargedHadronIso;
442     Float_t neutralHadronIso;
443     Float_t photonIso;
444     Int_t mvaStatus;
445     Float_t mva;
446    
447     Char_t bremClass;
448     Float_t fbrem;
449    
450     Float_t ecalEnergy; // corrected
451     Float_t ecalEnergyError; // correction error
452     Float_t trackMomentumError;
453    
454     Short_t gsfTrackIndex;
455     Short_t closestCtfTrackIndex;
456     Short_t electronClusterIndex;
457     Short_t superClusterIndex;
458    
459     // AtVtx, AtCalo
460     std::map<TString,TVector3> trackPositions;
461     // AtVtx, AtCalo, Out, AtEleClus, AtVtxWithConstraint
462     std::map<TString,TLorentzVector> trackMomentums;
463    
464     TVector3 vertex;
465     TLorentzVector momentum;
466     std::map<TString,Float_t> idPairs;
467    
468     };
469    
470    
471    
472     class Muon {
473    
474     public:
475    
476     Muon() { Init(); }
477     ~Muon() { Init(); }
478     void Init();
479    
480     // muon type
481     bool isGlobalMuon() { return (type & (0x1 << 1)); }
482     bool isTrackerMuon() { return (type & (0x1 << 2)); }
483     bool isStandAloneMuon() { return (type & (0x1 << 3)); }
484     bool isCaloMuon() { return (type & (0x1 << 4)); }
485     bool isPFMuon() { return (type & (0x1 << 5)); }
486     Short_t bestTrackIndex() { switch(bestTrackType){
487     case 1: return trackIndex; case 2: return standAloneTrackIndex;
488     case 3: return combinedTrackIndex; default: return -1;
489     } }
490    
491     // arbitration type is default
492     UChar_t type;
493     UChar_t bestTrackType;
494     UChar_t nMatches; // number of muon chambers with matched segments (<= nChambers)
495     UChar_t nValidHits; // *
496     UChar_t nValidTrackerHits; // *
497     UChar_t nValidMuonHits; // *
498     UChar_t nPixelLayersWithMeasurement; // *
499     UChar_t nStripLayersWithMeasurement; // * values from combinedMuon (= globalTrack)
500     UChar_t nChambers; // number of muon chambers the track traversed through (regardless of segment existence)
501     UChar_t nMatchedStations; // number of muon stations with matched segments (<= nMatches)
502     UChar_t timeNDof;
503     Char_t timeDirection;
504     Float_t timeAtIp;
505     Float_t timeAtIpError;
506     Float_t caloCompatibility;
507     Float_t emEnergy;
508     Float_t hadEnergy;
509     Float_t trackIsoR03;
510     Float_t ecalIsoR03;
511     Float_t hcalIsoR03;
512     Float_t trackIsoR05;
513     Float_t ecalIsoR05;
514     Float_t hcalIsoR05;
515    
516     Float_t sumChargedHadronPt03;
517     Float_t sumChargedParticlePt03;
518     Float_t sumNeutralHadronEt03;
519     Float_t sumPhotonEt03;
520     Float_t sumNeutralHadronEtHighThreshold03;
521     Float_t sumPhotonEtHighThreshold03;
522     Float_t sumPUPt03;
523    
524     Float_t sumChargedHadronPt04;
525     Float_t sumChargedParticlePt04;
526     Float_t sumNeutralHadronEt04;
527     Float_t sumPhotonEt04;
528     Float_t sumNeutralHadronEtHighThreshold04;
529     Float_t sumPhotonEtHighThreshold04;
530     Float_t sumPUPt04;
531    
532     Short_t trackIndex; // tracker only
533     Short_t standAloneTrackIndex; // muon detector only
534     Short_t combinedTrackIndex; // combined
535     TLorentzVector momentum;
536    
537     std::map<TString, UChar_t> idPairs;
538    
539     };
540    
541    
542     class CaloJet {
543    
544     public:
545    
546     CaloJet() { Init(); }
547     ~CaloJet() { Init(); }
548     void Init();
549    
550     // Basic Jet Info
551     Float_t partonFlavour;
552     Float_t jetCharge;
553     Float_t etaMean;
554     Float_t phiMean;
555     Float_t etaEtaMoment;
556     Float_t etaPhiMoment;
557     Float_t phiPhiMoment;
558     Float_t maxDistance;
559     Float_t jetArea;
560     Float_t pileup;
561     UChar_t nPasses;
562     UChar_t nConstituents;
563    
564     // CaloJet info
565     Float_t maxEInEmTowers;
566     Float_t maxEInHadTowers;
567     Float_t energyFractionHadronic;
568     Float_t emEnergyFraction;
569     Float_t hadEnergyInHB;
570     Float_t hadEnergyInHO;
571     Float_t hadEnergyInHE;
572     Float_t hadEnergyInHF;
573     Float_t emEnergyInEB;
574     Float_t emEnergyInEE;
575     Float_t emEnergyInHF;
576     Float_t towersArea;
577     UChar_t n90;
578     UChar_t n60;
579    
580     // Jet ID info
581     Float_t fHPD;
582     Float_t fRBX;
583     Float_t n90Hits;
584     Float_t fSubDetector1;
585     Float_t fSubDetector2;
586     Float_t fSubDetector3;
587     Float_t fSubDetector4;
588     Float_t restrictedEMF;
589     UChar_t nHCALTowers;
590     UChar_t nECALTowers;
591     Float_t approximatefHPD;
592     Float_t approximatefRBX;
593     UChar_t hitsInN90;
594     UChar_t numberOfHits2RPC;
595     UChar_t numberOfHits3RPC;
596     UChar_t numberOfHitsRPC;
597    
598     TVector3 vertex;
599     TLorentzVector momentum; // uncorrected momentum
600     TLorentzVector detectorP4;
601    
602     std::map<TString, Float_t> jecScaleFactors;
603     };
604    
605    
606     class PFJet {
607    
608     public:
609    
610     PFJet() { Init(); }
611     ~PFJet() { Init(); }
612     void Init();
613    
614     // Basic Jet Info
615     Int_t phyDefFlavour;
616     Int_t algDefFlavour;
617     Float_t jetCharge;
618     Float_t etaMean;
619     Float_t phiMean;
620     Float_t etaEtaMoment;
621     Float_t etaPhiMoment;
622     Float_t phiPhiMoment;
623     Float_t maxDistance;
624     Float_t jetArea;
625     Float_t pileup;
626     UChar_t nPasses;
627     UChar_t nConstituents;
628    
629     // PF Jet Info
630     Float_t chargedHadronEnergy;
631     Float_t neutralHadronEnergy;
632     Float_t photonEnergy;
633     Float_t electronEnergy;
634     Float_t muonEnergy;
635     Float_t HFHadronEnergy;
636     Float_t HFEMEnergy;
637     Float_t chargedEmEnergy;
638     Float_t chargedMuEnergy;
639     Float_t neutralEmEnergy;
640     UChar_t chargedHadronMultiplicity;
641     UChar_t neutralHadronMultiplicity;
642     UChar_t photonMultiplicity;
643     UChar_t electronMultiplicity;
644     UChar_t muonMultiplicity;
645     UChar_t HFHadronMultiplicity;
646     UChar_t HFEMMultiplicity;
647     UChar_t chargedMultiplicity;
648     UChar_t neutralMultiplicity;
649    
650     // Should contain ntuple indices of tracks associated with this jet
651 kiesel 1.4 std::vector<UShort_t> tracklist;
652 kiesel 1.1
653     // Pileup Jet Id info
654     std::vector<Float_t> puJetIdDiscriminants;
655     std::vector<Int_t> puJetIdFlags;
656    
657     bool passPuJetIdLoose(unsigned int type) const { return type < puJetIdFlags.size() ? ( puJetIdFlags[type] & (1 << 2) ) != 0 : false ; }
658     bool passPuJetIdMedium(unsigned int type) const { return type < puJetIdFlags.size() ? ( puJetIdFlags[type] & (1 << 1) ) != 0 : false ; }
659     bool passPuJetIdTight(unsigned int type) const { return type < puJetIdFlags.size() ? ( puJetIdFlags[type] & (1 << 0) ) != 0 : false ; }
660    
661     // IMPORTANT: This vector of float stores btag-discriminator variables from various collections
662     // which defined in susyNtuplizer_cfi.py file. The order of variables are strongly
663     // dependent on the order of collections in python file.
664     std::vector<Float_t> bTagDiscriminators;
665    
666     TVector3 vertex;
667     TLorentzVector momentum; // uncorrected momentum
668    
669     std::map<TString, Float_t> jecScaleFactors;
670     };
671    
672    
673     class JPTJet {
674    
675     public:
676    
677     JPTJet() { Init(); }
678     ~JPTJet() { Init(); }
679     void Init();
680    
681     // Basic Jet Info
682     Float_t partonFlavour;
683     Float_t jetCharge;
684     Float_t etaMean;
685     Float_t phiMean;
686     Float_t etaEtaMoment;
687     Float_t etaPhiMoment;
688     Float_t phiPhiMoment;
689     Float_t maxDistance;
690     Float_t jetArea;
691     Float_t pileup;
692     UChar_t nPasses;
693     UChar_t nConstituents;
694    
695     Float_t chargedHadronEnergy;
696     Float_t neutralHadronEnergy;
697     Float_t chargedEmEnergy;
698     Float_t neutralEmEnergy;
699     UChar_t chargedMultiplicity;
700     UChar_t muonMultiplicity;
701     UChar_t elecMultiplicity;
702     Float_t getZSPCor;
703    
704     TVector3 vertex;
705     TLorentzVector momentum; // uncorrected momentum
706    
707     std::map<TString, Float_t> jecScaleFactors;
708     };
709    
710    
711     class PFParticle {
712    
713     public:
714     PFParticle() { Init(); }
715     ~PFParticle() { Init(); }
716     void Init();
717    
718     Int_t pdgId;
719     Char_t charge;
720     Float_t ecalEnergy;
721     Float_t rawEcalEnergy;
722     Float_t hcalEnergy;
723     Float_t rawHcalEnergy;
724     Float_t pS1Energy;
725     Float_t pS2Energy;
726    
727     TVector3 vertex;
728     TVector3 positionAtECALEntrance;
729     TLorentzVector momentum;
730    
731     };
732    
733    
734    
735     typedef std::vector<susy::Electron> ElectronCollection;
736     typedef std::vector<susy::Photon> PhotonCollection;
737     typedef std::vector<susy::CaloJet> CaloJetCollection;
738     typedef std::vector<susy::PFJet> PFJetCollection;
739     typedef std::vector<susy::JPTJet> JPTJetCollection;
740     typedef std::vector<susy::PFParticle> PFParticleCollection;
741     typedef std::vector<susy::PUSummaryInfo> PUSummaryInfoCollection;
742     typedef std::vector<susy::Muon> MuonCollection;
743     typedef std::map<TString, std::pair<Int_t, UChar_t> > TriggerMap;
744    
745    
746    
747     class Event {
748    
749     public:
750    
751     Event() { Init(); }
752     ~Event() { Init(); }
753    
754     // Initialize members
755     void Init();
756    
757     bool passCSCBeamHalo() const { return metFilterBit & (0x1 << 0); }
758     bool passHcalNoise() const { return metFilterBit & (0x1 << 1); }
759     bool passEcalDeadCellTP() const { return metFilterBit & (0x1 << 2); }
760     bool passEcalDeadCellBE() const { return metFilterBit & (0x1 << 3); }
761     bool passHcalLaser() const { return metFilterBit & (0x1 << 4); }
762     bool passTrackingFailure() const { return metFilterBit & (0x1 << 5); }
763     bool passEEBadSC() const { return metFilterBit & (0x1 << 6); }
764    
765     bool passEERingOfFire() const { return metFilterBit_2 & (0x1 << 0); }
766     bool passInconsistentMuon() const { return metFilterBit_2 & (0x1 << 1); }
767     bool passGreedyMuon() const { return metFilterBit_2 & (0x1 << 2); }
768    
769     // JetMET recommended met filters
770     bool passMetFilters() const { return passCSCBeamHalo() && passHcalNoise() &&
771     passEcalDeadCellTP() && passHcalLaser() && passTrackingFailure() && passEEBadSC(); }
772    
773     // Members are made as public intentionally for easy access
774    
775     UChar_t isRealData;
776     Int_t runNumber;
777     ULong_t eventNumber;
778     Int_t luminosityBlockNumber;
779     Int_t bunchCrossing;
780     Float_t avgInsRecLumi;
781     Float_t intgRecLumi;
782     UChar_t cosmicFlag; // empty for now
783     Float_t rho; // from kt6PFJets
784     Float_t rhoBarrel; // from kt6PFJetsRhoBarrelOnly
785     Float_t rho25; // from kt6PFJetsRho25
786     Int_t metFilterBit;
787     Int_t metFilterBit_2;
788    
789     TVector3 beamSpot;
790    
791     susy::TriggerMap l1Map; // <name, <prescale, bit> >
792     susy::TriggerMap hltMap; // <name, <prescale, bit> >
793     std::map<TString,susy::MET> metMap;
794    
795     std::vector<susy::Vertex> vertices;
796     std::vector<susy::Track> tracks; // only selected tracks associated with objects directly and photons with dR<0.4
797     std::vector<susy::SuperCluster> superClusters; // only selected super clusters associated with objects
798     std::vector<susy::Cluster> clusters; // only selected basic clusters associated with super clusters
799     std::map<TString,susy::MuonCollection> muons;
800     std::map<TString,susy::ElectronCollection> electrons;
801     std::map<TString,susy::PhotonCollection> photons;
802     std::map<TString,susy::CaloJetCollection> caloJets;
803     std::map<TString,susy::PFJetCollection> pfJets;
804     std::map<TString,susy::JPTJetCollection> jptJets; // dropped for 2011B analysis
805     std::map<TString,susy::PFParticleCollection> pfParticles;
806    
807     // optional collections
808     std::vector<susy::Track> generalTracks; // not stored by default
809    
810     // generated information. Valid only for isRealData == 0, i.e. MC
811     susy::PUSummaryInfoCollection pu; //PU summary info
812     std::vector<TVector3> simVertices; // Geant vertex, primary only, dropped for 2011B analysis
813     std::vector<susy::Particle> genParticles;
814     std::map<TString, Float_t> gridParams; // pairs of parameter name and value
815    
816     };
817    
818    
819    
820    
821     } // namespace susy
822    
823     #endif