--- UserCode/HbbAnalysis/interface/Objects.hh 2009/10/13 12:14:04 1.3 +++ UserCode/HbbAnalysis/interface/Objects.hh 2011/06/24 14:49:11 1.24 @@ -8,15 +8,76 @@ #include "TLorentzVector.h" namespace HbbAnalysis { - + + struct PUVars { + int bunchCrossing; + unsigned int numInteractions; + PUVars(){ + bunchCrossing = 0; + numInteractions = 0; + } + }; + struct MCVars { unsigned int index; double E; double pT; double eta; + double y; double phi; int pdgId; int status; + + MCVars(): + index(0), + E(0), + pT(0), + eta(0), + y(0), + phi(0), + pdgId(0), + status(0) + {;} + }; + + struct HLTVars { + float pT; + float eta; + float phi; + int id; + float mass; + unsigned int type;//1=EM, 2=muon, 3=jet, 0=unknown + HLTVars(): + pT(0), + eta(0), + phi(0), + id(0), + mass(0), + type(0) + {} + }; + + struct L1Vars { + //type: + //0 = empty + //1 = central jet + //2 = tau jet + //3 = forward jet + unsigned int type; + int bx; + float pT; + float ET; + float eta; + float phi; + L1Vars(): + type(0), + bx(0), + pT(0), + ET(0), + eta(0), + phi(0) + {} + }; struct GenVars { @@ -24,6 +85,7 @@ namespace HbbAnalysis { double E; double pT; double eta; + double y; double phi; int charge; int pdgId; @@ -32,17 +94,48 @@ namespace HbbAnalysis { double vx; double vy; double vz; + GenVars(): + valid(false), + E(0), + pT(0), + eta(0), + y(0), + phi(0), + charge(0), + pdgId(0), + status(0), + mass(0), + vx(0), + vy(0), + vz(0) + {} + }; struct BaseVars { double E; double pT; double eta; + double y; double phi; float charge; double vx; double vy; double vz; + bool hltMatch; + + BaseVars(): + E(0), + pT(0), + eta(0), + y(0), + phi(0), + charge(0), + vx(0), + vy(0), + vz(0), + hltMatch(true) + {} }; struct SCVars { @@ -52,6 +145,14 @@ namespace HbbAnalysis { float e2x5Max; float e5x5; float eOverP; + SCVars(): + sigmaEtaEta(0), + sigmaIEtaIEta(0), + e1x5(0), + e2x5Max(0), + e5x5(0), + eOverP(0) + {} }; struct EleIsoVars { @@ -59,19 +160,53 @@ namespace HbbAnalysis { float track; float ecal; float hcal; + EleIsoVars(): + calo(0), + track(0), + ecal(0), + hcal(0) + {} }; struct EleIDVars{ + unsigned short idAndIso; std::vector > electronIDs; float hOverE; float deltaPhiIn; float deltaEtaIn; + bool ecalDrivenSeed; + bool trackerDrivenSeed; + float dB; + EleIDVars(): + idAndIso(0), + hOverE(0), + deltaPhiIn(0), + deltaEtaIn(0), + ecalDrivenSeed(false), + trackerDrivenSeed(false), + dB(0) + { + electronIDs.clear(); + } }; struct MuTrkVars { - float IPd0; - float IPdz; - unsigned int nHits; + float dxy; + float dz; + float normalizedChi2; + unsigned int muonHits; + int charge; + unsigned int trackerHits; + unsigned int pixelHits; + MuTrkVars(): + dxy(0), + dz(0), + normalizedChi2(0), + muonHits(0), + charge(0), + trackerHits(0), + pixelHits(0) + {} }; struct MuIsoVars { @@ -80,6 +215,13 @@ namespace HbbAnalysis { float hadEt; float nTracks; float nJets; + MuIsoVars(): + sumPt(0), + emEt(0), + hadEt(0), + nTracks(0), + nJets(0) + {} }; struct MuIDVars{ @@ -91,9 +233,25 @@ namespace HbbAnalysis { unsigned int nMatchesLoose; unsigned int nMatchesMedium; unsigned int nMatchesTight; + float dB; + MuIDVars(): + type(0), + caloCompat(0), + segCompat(0), + nChambers(0), + nMatchesLoose(0), + nMatchesMedium(0), + nMatchesTight(0), + dB(0) + { + ids.clear(); + } + + }; - struct TauLeadTrkVars{ + + struct TrkVars{ double pT; double eta; double phi; @@ -101,7 +259,18 @@ namespace HbbAnalysis { double IPxy; double IPz; float signedSipt; + TrkVars(): + pT(0), + eta(0), + phi(0), + matchDist(0), + IPxy(0), + IPz(0), + signedSipt(0) + {} + }; + struct CaloTauIsoVars{ unsigned int nIsoTracks; @@ -113,12 +282,32 @@ namespace HbbAnalysis { float isolationTracksPtSum; float isolationECALhitsEtSum; float maximumHCALhitEt; + CaloTauIsoVars(): + nIsoTracks(0), + nSigTracks(0), + leadTrackHCAL3x3hitsEtSum(0), + leadTrackHCAL3x3hottesthitDEta(0), + signalTracksInvariantMass(0), + tracksInvariantMass(0), + isolationTracksPtSum(0), + isolationECALhitsEtSum(0), + maximumHCALhitEt(0) + {} + + + }; struct CaloTauIDVars{ float byIsolation; float byLeadingTrackFinding; float byLeadingTrackPtCut; + CaloTauIDVars(): + byIsolation(0), + byLeadingTrackFinding(0), + byLeadingTrackPtCut(0) + {} + }; struct PFTauIsoVars{ @@ -131,6 +320,17 @@ namespace HbbAnalysis { double hcal3x3OverPLead; double ecalStripSumEOverPLead; double bremsRecoveryEOverPLead; + PFTauIsoVars(): + nSigCands(0), + nIsoCands(0), + maximumHCALPFClusterEt(0), + //emFraction(0), + hcalTotOverPLead(0), + hcalMaxOverPLead(0), + hcal3x3OverPLead(0), + ecalStripSumEOverPLead(0), + bremsRecoveryEOverPLead(0) + {} }; //for hadr, neutr and gamma cands @@ -138,6 +338,11 @@ namespace HbbAnalysis { unsigned int nSigCands; unsigned int nIsoCands; double isolationPtSum; + PFTauCandVars(): + nSigCands(0), + nIsoCands(0), + isolationPtSum(0) + {} }; struct PFTauIDVars{ @@ -148,6 +353,33 @@ namespace HbbAnalysis { float byIsolation; float againstElectron; float againstMuon; + float byIsolationUsingLeadingPion; + float byTaNC; + float byTaNCfrHalfPercent; + float byTaNCfrOnePercent; + float byTaNCfrQuarterPercent; + float byTaNCfrTenthPercent; + float ecalIsolationUsingLeadingPion; + float leadingPionPtCut; + float trackIsolationUsingLeadingPion; + PFTauIDVars(): + byLeadingTrackFinding(0), + byLeadingTrackPtCut(0), + byTrackIsolation(0), + byECALIsolation(0), + byIsolation(0), + againstElectron(0), + againstMuon(0), + byIsolationUsingLeadingPion(0), + byTaNC(0), + byTaNCfrHalfPercent(0), + byTaNCfrOnePercent(0), + byTaNCfrQuarterPercent(0), + byTaNCfrTenthPercent(0), + ecalIsolationUsingLeadingPion(0), + leadingPionPtCut(0), + trackIsolationUsingLeadingPion(0) + {} }; struct PFTauEleIDVars{ @@ -156,12 +388,25 @@ namespace HbbAnalysis { double phi; float output; float decision; + + PFTauEleIDVars(): + pT(0), + eta(0), + phi(0), + output(0), + decision(0) + {} }; struct PFTauMuIDVars{ float caloCompat; float segCompat; float decision; + PFTauMuIDVars(): + caloCompat(0), + segCompat(0), + decision(0) + {} }; struct JetVars{ @@ -171,8 +416,24 @@ namespace HbbAnalysis { int partonFlavour; unsigned int nAssociatedTracks; double rawpT; + float etaMean; + float phiMean; + float etaEtaMoment; + float phiPhiMoment; + float etaPhiMoment; //double rawEta; //double rawPhi; + JetVars(): + flavour(0), + partonFlavour(0), + nAssociatedTracks(0), + rawpT(0), + etaMean(0), + phiMean(0), + etaEtaMoment(0), + phiPhiMoment(0), + etaPhiMoment(0) + {} }; struct CaloJetVars{ @@ -190,22 +451,87 @@ namespace HbbAnalysis { double towersArea; double n90; double n60; + CaloJetVars(): + maxEInEmTowers(0), + maxEInHadTowers(0), + energyFractionHadronic(0), + emEnergyFraction(0), + hadEnergyInHB(0), + hadEnergyInHO(0), + hadEnergyInHE(0), + hadEnergyInHF(0), + emEnergyInEB(0), + emEnergyInEE(0), + emEnergyInHF(0), + towersArea(0), + n90(0), + n60(0) + {} + }; + + struct JPTJetVars{ + float zspCorrection; + int elecMultiplicity; + float calopT; + float caloEta; + //std::vector pionsInCone; + //std::vector pionsCurledOut; + //std::vector pionsCurledIn; + //std::vector elecsInCone; + //std::vector elecsCurledOut; + //std::vector elecsCurledIn; + //std::vector muonsInCone; + //std::vector muonsCurledOut; + //std::vector muonsCurledIn; + std::vector< std::pair > particleStatusPt; + JPTJetVars(): + zspCorrection(0), + elecMultiplicity(0), + calopT(0), + caloEta(0) + { + particleStatusPt.clear(); + } }; - struct PFJetVars{ + struct JPTPFJetVars{ double chargedHadronEnergy; double chargedHadronEnergyFraction; double neutralHadronEnergy; double neutralHadronEnergyFraction; double chargedEmEnergy; double chargedEmEnergyFraction; - double chargedMuEnergy; - double chargedMuEnergyFraction; double neutralEmEnergy; double neutralEmEnergyFraction; double chargedMultiplicity; - double neutralMultiplicity; double muonMultiplicity; + JPTPFJetVars(): + chargedHadronEnergy(0), + chargedHadronEnergyFraction(0), + neutralHadronEnergy(0), + neutralHadronEnergyFraction(0), + chargedEmEnergy(0), + chargedEmEnergyFraction(0), + neutralEmEnergy(0), + neutralEmEnergyFraction(0), + chargedMultiplicity(0), + muonMultiplicity(0) + {} + }; + + struct PFJetVars{ + double chargedMuEnergy; + double chargedMuEnergyFraction; + double neutralMultiplicity; + unsigned numberOfDaughters; + double HFHadronEnergy; + PFJetVars(): + chargedMuEnergy(0), + chargedMuEnergyFraction(0), + neutralMultiplicity(0), + numberOfDaughters(0), + HFHadronEnergy(0) + {} }; struct JetBtagVars{ @@ -214,14 +540,71 @@ namespace HbbAnalysis { double iPMVA; double bProba; double probability; - double sSV; - double softElectron; + double sSVHE; + double sSVHP; + double softElectronByPt; + double softElectronByIP3d; double softMuon; - double softMuonNoIP; + double softMuonByPt; + double softMuonByIP3d; double tCHE; double tCHP; + JetBtagVars(): + cSV(0), + cSVMVA(0), + iPMVA(0), + bProba(0), + probability(0), + sSVHE(0), + sSVHP(0), + softElectronByPt(0), + softElectronByIP3d(0), + softMuon(0), + softMuonByPt(0), + softMuonByIP3d(0), + tCHE(0), + tCHP(0) + {} + }; + + + struct JetIDVars{ + double fHPD; + double fRBX; + int n90Hits; + //double fSubDetector1; + //double fSubDetector2; + //double fSubDetector3; + //double fSubDetector4; + double restrictedEMF; + int nHCALTowers; + int nECALTowers; + //double approximatefHPD; + //double approximatefRBX; + int hitsInN90; + // muon hits id + //int numberOfHits2RPC; + //int numberOfHits3RPC; + //int numberOfHitsRPC; + JetIDVars(): + fHPD(0), + fRBX(0), + n90Hits(0), + restrictedEMF(0), + nHCALTowers(0), + nECALTowers(0), + hitsInN90(0) + {} + }; + + struct JetECorVars{ + std::vector > Levels; + JetECorVars(){ + Levels.clear(); + } }; + struct MetVars{ double mET; double mEx; @@ -229,18 +612,114 @@ namespace HbbAnalysis { double sumET; double phi; double mEtSig; + MetVars(): + mET(0), + mEx(0), + mEy(0), + sumET(0), + phi(0), + mEtSig(0) + {} + }; struct TriggerVars{ std::string name; unsigned int index; bool accept; + TriggerVars(): + name(""), + index(0), + accept(false) + {} + }; + + + struct VertexVars{ + std::vector trackWeights; + std::vector trackpT; + double chi2; + double ndof; + double x; + double y; + double z; + double rho; + double xError; + double yError; + double zError; + double cov01; + double cov02; + double cov12; + VertexVars(): + chi2(0), + ndof(0), + x(0), + y(0), + z(0), + rho(0), + xError(0), + yError(0), + zError(0), + cov01(0), + cov02(0), + cov12(0) + { + trackWeights.clear(); + trackpT.clear(); + } + }; + + struct BeamSpotVars{ + double x0; + double y0; + double z0; + double sigmaZ; + double BeamWidthX; + double BeamWidthY; + double x0Error; + double y0Error; + double z0Error; + double sigmaZ0Error; + double BeamWidthXError; + double BeamWidthYError; + //double dxdz; + //double dydz; + //double dxdzError; + //double dydzError; + //BeamType type(); + //enum BeamType { Unknown=-1, Fake=0, LHC=1, Tracker=2 }; + //double emittanceX() const { return emittanceX_; } + //double emittanceY() const { return emittanceY_; } + //double betaStar() const { return betaStar_; } + BeamSpotVars(): + x0(0), + y0(0), + z0(0), + sigmaZ(0), + BeamWidthX(0), + BeamWidthY(0), + x0Error(0), + y0Error(0), + z0Error(0), + sigmaZ0Error(0), + BeamWidthXError(0), + BeamWidthYError(0) + {} + }; + + + double DeltaPhi(const double phi1, const double phi2); - double DeltaR(const BaseVars & v1, const BaseVars & v2); - + template + double DeltaR(const T1 & v1, const T2 & v2){ + double dEta = v1.eta - v2.eta; + double dPhi = v1.phi - v2.phi; + return sqrt(dEta*dEta+dPhi*dPhi); + } + double SameSign(const BaseVars & v1, const BaseVars & v2); double OppSign(const BaseVars & v1, const BaseVars & v2); @@ -266,6 +745,9 @@ namespace HbbAnalysis { double mEx, double mEy); + double EtaDetector(const BaseVars & v1); + double EtaDetector(const GenVars & v1); + }//namespace #endif