////////////////////////////////////////////////////////// // This class has been automatically generated on // Wed Aug 22 11:44:17 2012 by ROOT version 5.33/03 // from TTree HMTTree/MuTauTauTree // found on file: rootFiles/elecDiTauAnalysis.root ////////////////////////////////////////////////////////// #ifndef ElecTauAnalysis_h #define ElecTauAnalysis_h #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "puUtils.h" // Fixed size dimensions of array or collections stored in the TTree if any. class ElecTauAnalysis { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leaf types Long64_t runNumber; Long64_t eventNumber; Float_t TrueNumPU; Int_t InTimePU; Int_t OutTimePlusPU; Int_t OutTimeMinusPU; UInt_t nVtx; UInt_t nGoodVtx; Bool_t passedHLTElec27WP80; Float_t elecRhoIso; Float_t MEt; Bool_t zEvent; Float_t zMassDiff; Float_t zPtAsymm; Float_t wCandGenPt; Float_t zCandGenMass; std::vector *PDFWweights; Double_t ISRGluonWeight; Double_t ISRGammaWeight; Double_t FSRWeight; std::vector *hadTauMatched; std::vector *hadTauMotherId; std::vector *hadTauIsGenElec; std::vector *hadTauGenPt; std::vector *hadTauGenE; std::vector *hadTauGenEta; std::vector *hadTauGenPhi; std::vector *hadTauPt; std::vector *hadTauAltLVPt; std::vector *hadTauAltLVEnergy; std::vector *hadTauEnergy; std::vector *hadTauEta; std::vector *hadTauPhi; std::vector *hadTauCharge; std::vector *hadTauLeadChargedCandPt; std::vector *hadTauLeadChargedCandCharge; std::vector *hadTauLeadChargedCandDxyVtx; std::vector *hadTauLeadChargedCandDxyBS; std::vector *hadTauLeadChargedCandDxyError; std::vector *hadTauLeadChargedCandDzVtx; std::vector *hadTauLeadChargedCandDzBS; std::vector *hadTauLeadChargedCandDzError; std::vector *hadTauLeadChargedCandVx; std::vector *hadTauLeadChargedCandVy; std::vector *hadTauLeadChargedCandVz; std::vector *hadTauDeltaZVtx; std::vector *hadTauNProngs; std::vector *hadTauEmFraction; std::vector *hadTauHcalTotOverPLead; std::vector *hadTauHcalMaxOverPLead; std::vector *hadTauHcal3x3OverPLead; std::vector *hadTauElectronPreId; std::vector *hadTauModifiedEOverP; std::vector *hadTauBremsRecoveryEOverPLead; std::vector *hadTauLTSignedIp; std::vector *hadTauTrkIsoSumPt; std::vector *hadTauECALIsoSumEt; std::vector *hadTauIdByDecayModeFinding; std::vector *hadTauIdByDecayModeFindingNewDMs; std::vector *hadTauIdByDecayModeFindingOldDMs; std::vector *hadTauIdByLooseCombinedIsolationDBSumPtCorr; std::vector *hadTauIdByMediumCombinedIsolationDBSumPtCorr; std::vector *hadTauIdByTightCombinedIsolationDBSumPtCorr; std::vector *hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits; std::vector *hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits; std::vector *hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits; std::vector *hadTauIdByVLooseIsolationMVA3newDMwLT; std::vector *hadTauIdByLooseIsolationMVA3newDMwLT; std::vector *hadTauIdByMediumIsolationMVA3newDMwLT; std::vector *hadTauIdByTightIsolationMVA3newDMwLT; std::vector *hadTauIdByVTightIsolationMVA3newDMwLT; std::vector *hadTauIdByVVTightIsolationMVA3newDMwLT; std::vector *hadTauIdByVLooseIsolationMVA3newDMwoLT; std::vector *hadTauIdByLooseIsolationMVA3newDMwoLT; std::vector *hadTauIdByMediumIsolationMVA3newDMwoLT; std::vector *hadTauIdByTightIsolationMVA3newDMwoLT; std::vector *hadTauIdByVTightIsolationMVA3newDMwoLT; std::vector *hadTauIdByVVTightIsolationMVA3newDMwoLT; std::vector *hadTauIdByVLooseIsolationMVA3oldDMwLT; std::vector *hadTauIdByLooseIsolationMVA3oldDMwLT; std::vector *hadTauIdByMediumIsolationMVA3oldDMwLT; std::vector *hadTauIdByTightIsolationMVA3oldDMwLT; std::vector *hadTauIdByVTightIsolationMVA3oldDMwLT; std::vector *hadTauIdByVVTightIsolationMVA3oldDMwLT; std::vector *hadTauIdByVLooseIsolationMVA3oldDMwoLT; std::vector *hadTauIdByLooseIsolationMVA3oldDMwoLT; std::vector *hadTauIdByMediumIsolationMVA3oldDMwoLT; std::vector *hadTauIdByTightIsolationMVA3oldDMwoLT; std::vector *hadTauIdByVTightIsolationMVA3oldDMwoLT; std::vector *hadTauIdByVVTightIsolationMVA3oldDMwoLT; std::vector *hadTauIdByLooseElectronRejection; std::vector *hadTauIdByMediumElectronRejection; std::vector *hadTauIdByTightElectronRejection; std::vector *hadTauIdByMVA5rawElectronRejection; std::vector *hadTauIdByMVA5ElectronRejectionCat; std::vector *hadTauIdByMVA5VLooseElectronRejection; std::vector *hadTauIdByMVA5LooseElectronRejection; std::vector *hadTauIdByMVA5MediumElectronRejection; std::vector *hadTauIdByMVA5TightElectronRejection; std::vector *hadTauIdByMVA5VTightElectronRejection; std::vector *hadTauIdByElectronDeadECAL; std::vector *hadTauIdByLooseMuonRejection; std::vector *hadTauIdByMediumMuonRejection; std::vector *hadTauIdByTightMuonRejection; std::vector *hadTauIdByLooseMuonRejection2; std::vector *hadTauIdByMediumMuonRejection2; std::vector *hadTauIdByTightMuonRejection2; std::vector *hadTauIdByLooseMuonRejection3; std::vector *hadTauIdByTightMuonRejection3; std::vector *hadTauIdByLooseMVAMuonRejection; std::vector *hadTauIdByMediumMVAMuonRejection; std::vector *hadTauIdByTightMVAMuonRejection; std::vector *hadTauMEtMt; std::vector *elecMatched; std::vector *elecMotherId; std::vector *elecGenPt; std::vector *elecGenE; std::vector *elecGenEta; std::vector *elecGenPhi; std::vector *elecPt; std::vector *elecE; std::vector *elecEta; std::vector *elecPhi; std::vector *elecCharge; std::vector *elecDxyVtx; std::vector *elecDxyBS; std::vector *elecDxyError; std::vector *elecDzVtx; std::vector *elecDzBS; std::vector *elecDzError; std::vector *elecVx; std::vector *elecVy; std::vector *elecVz; std::vector *elecDEtaIn; std::vector *elecDPhiIn; std::vector *elecSigmaIEtaIEta; std::vector *elecHadOverE; std::vector *elecFbrem; std::vector *elecEOverPIn; std::vector *elecOneOverEMinusOneOverPIn; std::vector *elecMissingHits; std::vector *elecConversionRejection; std::vector *elecFiducialFlag; std::vector *elecPFIsoDR03SumChargedHadronPt; std::vector *elecPFIsoDR03SumNeutralHadronPt; std::vector *elecPFIsoDR03SumPhotonPt; std::vector *elecPFIsoDR03SumPUPt; std::vector *elecPFIsoDR04SumChargedHadronPt; std::vector *elecPFIsoDR04SumNeutralHadronPt; std::vector *elecPFIsoDR04SumPhotonPt; std::vector *elecPFIsoDR04SumPUPt; std::vector *elecIsoDR03SumPtTrk; std::vector *elecIsoDR03SumEtEcal; std::vector *_elecIsoDR03SumEtHcal; std::vector *elecClass; std::vector *elecMVAStatus; std::vector *elecMVAOut; std::vector *elecMEtMt; std::vector *elecMetCosDPhi; std::vector *elecHadTauCosDPhi; std::vector *elecHadTauDelatR; std::vector *elecHadTauMass; std::vector *elecHadTauMetMass; std::vector *elecHadTauCollMass; std::vector *elecHadTauPZeta; std::vector *elecHadTauPZetaVis; std::vector *nVBFJets; std::vector *diJetMass; std::vector *diJetDEta; std::vector *jet1Pt; std::vector *jet1Eta; std::vector *jet2Pt; std::vector *jet2Eta; std::vector *elecDiJetMass; std::vector *hadTauDiJetMass; std::vector *elecTauDiJetMass; Float_t maxDiJetDEta; Float_t maxDiJetMass; std::vector *nJets; std::vector *jetEtSum; std::vector *nBtagsHiEffTrkCnt; std::vector *nBtagsHiPurityTrkCnt; std::vector *nBTagsCombSecVtxLoose; std::vector *nBTagsCombSecVtxMedium; std::vector *nBTagsCombSecVtxTight; // List of branches TBranch *b_runNumber; //! TBranch *b_eventNumber; //! TBranch *b_TrueNumPU; //! TBranch *b_InTimePU; //! TBranch *b_OutTimePlusPU; //! TBranch *b_OutTimeMinusPU; //! TBranch *b_nVtx; //! TBranch *b_nGoodVtx; //! TBranch *b_passedHLTElec27WP80; //! TBranch *b_elecRhoIso; //! TBranch *b_MEt; //! TBranch *b_zEvent; //! TBranch *b_zMassDiff; //! TBranch *b_zPtAsymm; //! TBranch *b_wCandGenPt; //! TBranch *b_zCandGenMass; //! TBranch *b_PDFWweights; //! TBranch *b_ISRGluonWeight; //! TBranch *b_ISRGammaWeight; //! TBranch *b_FSRWeight; //! TBranch *b_hadTauMatched; //! TBranch *b_hadTauMotherId; //! TBranch *b_hadTauIsGenElec; //! TBranch *b_hadTauGenPt; //! TBranch *b_hadTauGenE; //! TBranch *b_hadTauGenEta; //! TBranch *b_hadTauGenPhi; //! TBranch *b_hadTauPt; //! TBranch *b_hadTauAltLVPt; //! TBranch *b_hadTauAltLVEnergy; //! TBranch *b_hadTauEnergy; //! TBranch *b_hadTauEta; //! TBranch *b_hadTauPhi; //! TBranch *b_hadTauCharge; //! TBranch *b_hadTauLeadChargedCandPt; //! TBranch *b_hadTauLeadChargedCandCharge; //! TBranch *b_hadTauLeadChargedCandDxyVtx; //! TBranch *b_hadTauLeadChargedCandDxyBS; //! TBranch *b_hadTauLeadChargedCandDxyError; //! TBranch *b_hadTauLeadChargedCandDzVtx; //! TBranch *b_hadTauLeadChargedCandDzBS; //! TBranch *b_hadTauLeadChargedCandDzError; //! TBranch *b_hadTauLeadChargedCandVx; //! TBranch *b_hadTauLeadChargedCandVy; //! TBranch *b_hadTauLeadChargedCandVz; //! TBranch *b_hadTauDeltaZVtx; //! TBranch *b_hadTauNProngs; //! TBranch *b_hadTauEmFraction; //! TBranch *b_hadTauHcalTotOverPLead; //! TBranch *b_hadTauHcalMaxOverPLead; //! TBranch *b_hadTauHcal3x3OverPLead; //! TBranch *b_hadTauElectronPreId; //! TBranch *b_hadTauModifiedEOverP; //! TBranch *b_hadTauBremsRecoveryEOverPLead; //! TBranch *b_hadTauLTSignedIp; //! TBranch *b_hadTauTrkIsoSumPt; //! TBranch *b_hadTauECALIsoSumEt; //! TBranch *b_hadTauIdByDecayModeFinding; //! TBranch *b_hadTauIdByDecayModeFindingNewDMs; //! TBranch *b_hadTauIdByDecayModeFindingOldDMs; //! TBranch *b_hadTauIdByLooseCombinedIsolationDBSumPtCorr; //! TBranch *b_hadTauIdByMediumCombinedIsolationDBSumPtCorr; //! TBranch *b_hadTauIdByTightCombinedIsolationDBSumPtCorr; //! TBranch *b_hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits; //! TBranch *b_hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits; //! TBranch *b_hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits; //! TBranch *b_hadTauIdByVLooseIsolationMVA3newDMwLT; //! TBranch *b_hadTauIdByLooseIsolationMVA3newDMwLT; //! TBranch *b_hadTauIdByMediumIsolationMVA3newDMwLT; //! TBranch *b_hadTauIdByTightIsolationMVA3newDMwLT; //! TBranch *b_hadTauIdByVTightIsolationMVA3newDMwLT; //! TBranch *b_hadTauIdByVVTightIsolationMVA3newDMwLT; //! TBranch *b_hadTauIdByVLooseIsolationMVA3newDMwoLT; //! TBranch *b_hadTauIdByLooseIsolationMVA3newDMwoLT; //! TBranch *b_hadTauIdByMediumIsolationMVA3newDMwoLT; //! TBranch *b_hadTauIdByTightIsolationMVA3newDMwoLT; //! TBranch *b_hadTauIdByVTightIsolationMVA3newDMwoLT; //! TBranch *b_hadTauIdByVVTightIsolationMVA3newDMwoLT; //! TBranch *b_hadTauIdByVLooseIsolationMVA3oldDMwLT; //! TBranch *b_hadTauIdByLooseIsolationMVA3oldDMwLT; //! TBranch *b_hadTauIdByMediumIsolationMVA3oldDMwLT; //! TBranch *b_hadTauIdByTightIsolationMVA3oldDMwLT; //! TBranch *b_hadTauIdByVTightIsolationMVA3oldDMwLT; //! TBranch *b_hadTauIdByVVTightIsolationMVA3oldDMwLT; //! TBranch *b_hadTauIdByVLooseIsolationMVA3oldDMwoLT; //! TBranch *b_hadTauIdByLooseIsolationMVA3oldDMwoLT; //! TBranch *b_hadTauIdByMediumIsolationMVA3oldDMwoLT; //! TBranch *b_hadTauIdByTightIsolationMVA3oldDMwoLT; //! TBranch *b_hadTauIdByVTightIsolationMVA3oldDMwoLT; //! TBranch *b_hadTauIdByVVTightIsolationMVA3oldDMwoLT; //! TBranch *b_hadTauIdByLooseElectronRejection; //! TBranch *b_hadTauIdByMediumElectronRejection; //! TBranch *b_hadTauIdByTightElectronRejection; //! TBranch *b_hadTauIdByMVA5rawElectronRejection; //! TBranch *b_hadTauIdByMVA5ElectronRejectionCat; //! TBranch *b_hadTauIdByMVA5VLooseElectronRejection; //! TBranch *b_hadTauIdByMVA5LooseElectronRejection; //! TBranch *b_hadTauIdByMVA5MediumElectronRejection; //! TBranch *b_hadTauIdByMVA5TightElectronRejection; //! TBranch *b_hadTauIdByMVA5VTightElectronRejection; //! TBranch *b_hadTauIdByElectronDeadECAL; //! TBranch *b_hadTauIdByLooseMuonRejection; //! TBranch *b_hadTauIdByMediumMuonRejection; //! TBranch *b_hadTauIdByTightMuonRejection; //! TBranch *b_hadTauIdByLooseMuonRejection2; //! TBranch *b_hadTauIdByMediumMuonRejection2; //! TBranch *b_hadTauIdByTightMuonRejection2; //! TBranch *b_hadTauIdByLooseMuonRejection3; //! TBranch *b_hadTauIdByTightMuonRejection3; //! TBranch *b_hadTauIdByLooseMVAMuonRejection; //! TBranch *b_hadTauIdByMediumMVAMuonRejection; //! TBranch *b_hadTauIdByTightMVAMuonRejection; //! TBranch *b_hadTauMEtMt; //! TBranch *b_elecMatched; //! TBranch *b_elecMotherId; //! TBranch *b_elecGenPt; //! TBranch *b_elecGenE; //! TBranch *b_elecGenEta; //! TBranch *b_elecGenPhi; //! TBranch *b_elecPt; //! TBranch *b_elecE; //! TBranch *b_elecEta; //! TBranch *b_elecPhi; //! TBranch *b_elecCharge; //! TBranch *b_elecDxyVtx; //! TBranch *b_elecDxyBS; //! TBranch *b_elecDxyError; //! TBranch *b_elecDzVtx; //! TBranch *b_elecDzBS; //! TBranch *b_elecDzError; //! TBranch *b_elecVx; //! TBranch *b_elecVy; //! TBranch *b_elecVz; //! TBranch *b_elecDEtaIn; //! TBranch *b_elecDPhiIn; //! TBranch *b_elecSigmaIEtaIEta; //! TBranch *b_elecHadOverE; //! TBranch *b_elecFbrem; //! TBranch *b_elecEOverPIn; //! TBranch *b_elecOneOverEMinusOneOverPIn; //! TBranch *b_elecMissingHits; //! TBranch *b_elecConversionRejection; //! TBranch *b_elecFiducialFlag; //! TBranch *b_elecPFIsoDR03SumChargedHadronPt; //! TBranch *b_elecPFIsoDR03SumNeutralHadronPt; //! TBranch *b_elecPFIsoDR03SumPhotonPt; //! TBranch *b_elecPFIsoDR03SumPUPt; //! TBranch *b_elecPFIsoDR04SumChargedHadronPt; //! TBranch *b_elecPFIsoDR04SumNeutralHadronPt; //! TBranch *b_elecPFIsoDR04SumPhotonPt; //! TBranch *b_elecPFIsoDR04SumPUPt; //! TBranch *b_elecIsoDR03SumPtTrk; //! TBranch *b_elecIsoDR03SumEtEcal; //! TBranch *b__elecIsoDR03SumEtHcal; //! TBranch *b_elecClass; //! TBranch *b_elecMVAStatus; //! TBranch *b_elecMVAOut; //! TBranch *b_elecMEtMt; //! TBranch *b_elecMetCosDPhi; //! TBranch *b_elecHadTauCosDPhi; //! TBranch *b_elecHadTauDelatR; //! TBranch *b_elecHadTauMass; //! TBranch *b_elecHadTauMetMass; //! TBranch *b_elecHadTauCollMass; //! TBranch *b_elecHadTauPZeta; //! TBranch *b_elecHadTauPZetaVis; //! TBranch *b_nVBFJets; //! TBranch *b_diJetMass; //! TBranch *b_diJetDEta; //! TBranch *b_jet1Pt; //! TBranch *b_jet1Eta; //! TBranch *b_jet2Pt; //! TBranch *b_jet2Eta; //! TBranch *b_elecDiJetMass; //! TBranch *b_hadTauDiJetMass; //! TBranch *b_elecTauDiJetMass; //! TBranch *b_maxDiJetDEta; //! TBranch *b_maxDiJetMass; //! TBranch *b_nJets; //! TBranch *b_jetEtSum; //! TBranch *b_nBtagsHiEffTrkCnt; //! TBranch *b_nBtagsHiPurityTrkCnt; //! TBranch *b_nBTagsCombSecVtxLoose; //! TBranch *b_nBTagsCombSecVtxMedium; //! TBranch *b_nBTagsCombSecVtxTight; //! ElecTauAnalysis(TTree *tree=0); virtual ~ElecTauAnalysis(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TTree *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); void SetElecAccCuts(double minElecPtCut, double maxElecEtaCut); void SetElecIdGlobalCuts(double maxElecDzCut, double maxElecDxyCut, int maxElecMissingHitsCut, double elecIsoDr, double maxElecPFRelIsoCut); void SetElecIdBarrelCuts(double maxElecDPhiInEBCut, double maxElecDEtaInEBCut, double maxElecSigmaIEtaIEtaEBCut, double maxElecHadFracEBCut, double maxOneOverEMinusOneOverPEBCut); void SetElecIdEndCapCuts(double maxElecDPhiInBBCut, double maxElecDEtaInBBCut, double maxElecSigmaIEtaIEtaBBCut, double maxElecHadFracBBCut, double maxOneOverEMinusOneOverPBBCut); void SetHadTauAccCuts(double minElecTauDRCut, double minTauPtCut, double maxTauEtaCut, bool useAltLV); void SetHadTauIdCuts(std::string tauMuonDiscType, std::string tauElecDiscType, std::string tauIsoDiscType, std::string nProngs); void SetTopologyCuts(std::string chargeType, double minMET, std::string btagType, unsigned int btagCut, double elecTauCosDPhi, double pzetaSlope, double pzetaCut, double minElecTauMass, double maxElecTauMass); void SetVBFJetsCuts(bool doVBF, double vbfJet1PtCut, double vbfJet2PtCut, double diJetDEtaCut, double minJetMassCut, double maxDiJetMassCut); void SetWJetsVeto(unsigned int doWJetsCR, double elecMETMinMass, double elecMETMaxMass); void SetZEEVeto(double zMassWidthCut, double zPtAsymmCut, bool doZEECR); void SetSignalXSection(double theXSection); void SetLumi(double theLumi); void SetNEvents(int nEvents); void SetSource(std::string theSource); void SetOutputLogFileName(std::string theLogfileName); void SetOutputRootFileName(std::string theRootFileName); void SetPileupRootFile(std::string thePURootFileName); private: //cuts from cfg double _minElecPtCut; double _maxElecEtaCut; double _maxElecDzCut; double _maxElecDxyCut; double _maxElecMissingHitsCut; double _elecIsoDr; double _maxElecPFRelIsoCut; double _maxElecDPhiInEBCut; double _maxElecDEtaInEBCut; double _maxElecSigmaIEtaIEtaEBCut; double _maxElecHadFracEBCut; double _maxOneOverEMinusOneOverPEBCut; double _maxElecDPhiInEECut; double _maxElecDEtaInEECut; double _maxElecSigmaIEtaIEtaEECut; double _maxElecHadFracEECut; double _maxOneOverEMinusOneOverPEECut; double _minHadTauPtCut; double _maxHadTauEtaCut; double _minElecTauDRCut; bool _useAltLV; std::string _hadTauMuonDiscType; std::string _hadTauElecDiscType; std::string _hadTauIsoDiscType; std::string _tauChargeType; std::string _nProngs; double _elecTauCosDPhiCut; double _zeta2DSlope; double _zeta2DCut; double _minMEtCut; unsigned int _nBTagsCut; std::string _btaggingType; bool _doVBF; double _vbfJet1PtCut; double _vbfJet2PtCut; double _diJetDEtaCut; double _minDiJetMassCut; double _maxDiJetMassCut; bool _doZEECR; unsigned int _doWJetsCR; double _elecMETMinMassCut; double _elecMETMaxMassCut; double _maxElecTauMassCut; double _minElecTauMassCut; double _zMassWidthCut; double _zPtAsymmCut; bool _doFactorization; double _signalXSection; double _theLumi; Long64_t _nEvents; std::string _source; std::string _outRootFileName; std::string _outLogFile; std::string _thePileUpRootFileName; TFile* outRootFile; std::pair skimmedEvents; std::pair > skimEff; std::pair _theXSection; // xsection, error std::pair nSkimmedAtLumi; std::pair eventsAtLumi; std::vector _thePUWeights; float _eventPUWeight; //private functions bool passedElecMatched(unsigned int theIndex); bool passedTauMatched(unsigned int theIndex); bool passedTrigger(); bool passedElecPtCut(unsigned int theIndex); bool elecInBarrel(unsigned int theIndex); bool elecInEndCap(unsigned int theIndex); bool elecInGaps(unsigned int theIndex); bool passedElecEtaCut(unsigned int theIndex); bool passedElecAccCuts(unsigned int theIndex); bool passedElecDPhiIn(unsigned int theIndex); bool passedElecDEtaIn(unsigned int theIndex); bool passedElecSigmaIEtaIEta(unsigned int theIndex); bool passedElecHOverE(unsigned int theIndex); bool passedElecOneOverEMinusOneOverP(unsigned int theIndex); bool passedElecDxyVtx(unsigned int theIndex); bool passedElecDzVtx(unsigned int theIndex); bool passedElecMissingHits(unsigned int theIndex); bool passedElecPFRelIso(unsigned int theIndex); double getEffAreaData(unsigned int theIndex); double getEffAreaMC(unsigned int theIndex); bool passedElecMVAID(unsigned int theIndex); bool passedElecId(unsigned int theIndex); bool passedHadTauMinPt(unsigned int theIndex); bool passedHadTauMaxEta(unsigned int theIndex); bool passedHadTauCrackVeto(unsigned int theIndex); bool passedElecTauDR(unsigned int theIndex); bool passedHadTauAcc(unsigned int theIndex); bool passedHadTauDecayModeFinding(unsigned int theIndex); bool passedHadTauMuonDisc(unsigned int theIndex); bool passedHadTauElecDisc(unsigned int theIndex); bool passedTauNProngs(unsigned int theIndex); bool passedHadTauIsoDisc(unsigned int theIndex); bool passedHadTauId(unsigned int theIndex); bool passedElecTauCharge(unsigned int theIndex); bool passedElecTauCosDPhi(unsigned int theIndex); bool passed2DZetaCut(unsigned int theIndex); bool passedMET(); bool passedBTagVeto(unsigned int theIndex); bool passedWJetsVeto(unsigned int theIndex); bool passedZEEVeto(); bool passedElecTauMass(unsigned int theIndex); bool passedTopologyCuts(unsigned int theIndex); bool passedNVBFJets(unsigned int theIndex); bool passedVBFJetsPt(unsigned int theIndex); bool passedDiJetDEta(unsigned int theIndex); bool passedDiJetMass(unsigned int theIndex); bool passedVBFSel(unsigned int theIndex); void getEventCounters(); void getCandCounters(); void getNMinus1CandCounters(unsigned int theIndex); void resetCandCounters(); void resetHistosDefault(); void GetPUWeights(); void getReport(); std::string PrintBgFromDataInfo(); std::string PrintXMLFormat(std::string tag, std::string name, double nume, double deno, bool printAbsEff); std::string PrintXMLFormat(std::string tag, std::string name, double nume, double numeCorr, double deno, double denoCorr, bool printAbsEff); void bookHistos(); void fillHistos(); void writeOutFile(); std::pair GetFactorizedEvents(std::pair nLoose, std::pair effLoose, std::pair effTight); //cand counters unsigned int _triggerCounter; unsigned int _elecMatchCounter; unsigned int _tauMatchCounter; unsigned int _elecPtCounter; unsigned int _elecEtaCounter; unsigned int _elecAccCounter; unsigned int _elecDPhiInCounter; unsigned int _elecDEtaInCounter; unsigned int _elecSigmaIEtaIEtaCounter; unsigned int _elecHadFracCounter; unsigned int _elecEOverPCounter; unsigned int _elecDxyCounter; unsigned int _elecDzCounter; unsigned int _elecMissHitsCounter; unsigned int _elecPFRelIsoCounter; unsigned int _elecIdCounter; unsigned int _elecTauDRCounter; unsigned int _hadTauPtCounter; unsigned int _hadTauEtaCounter; unsigned int _hadTauAccCounter; unsigned int _hadTauDecayModeCounter; unsigned int _hadTauMuonDiscCounter; unsigned int _hadTauElecDiscCounter; unsigned int _hadTauNProngsCounter; unsigned int _hadTauIsoDiscCounter; unsigned int _hadTauIdCounter; unsigned int _elecHadTauChargeCounter; unsigned int _elecHadTauCosDPhiCounter; unsigned int _elecHadTauPZetaCounter; unsigned int _metCounter; unsigned int _bTagsCounter; unsigned int _wjetsVetoCounter; unsigned int _zeeVetoCounter; unsigned int _elecTauMassCounter; unsigned int _topologyCounter; unsigned int _nVBFJetsCounter; unsigned int _vbfJetsPtCounter; unsigned int _diJetDEtaCounter; unsigned int _diJetMassCounter; unsigned int _vbfCounter; //for data CRs unsigned int _zeeCR1CentralCutsCounter; unsigned int _zeeCR1OSCounter; unsigned int _zeeCR1LSCounter; unsigned int _zeeCR1METCounter; unsigned int _zeeCR1VBFCounter; unsigned int _zeeCR2Counter; unsigned int _zeeCR2AntiElecDiscCounter; unsigned int _zeeCR2ElecDiscCounter; unsigned int _wjetsCR1Counter; unsigned int _wjetsCR1LSCounter; unsigned int _wjetsCR1OSCounter; unsigned int _wjetsCR1TauIsoCounter; unsigned int _wjetsCR1VBFCounter; unsigned int _wjetsCR1ETauCosDPhiPZetaCounter; unsigned int _wjetsCR2Counter; unsigned int _wjetsCR2MtVetoCounter; unsigned int _wjetsCRCentralCutsCounter; unsigned int _wjetsCRVBFCounter; unsigned int _ttbarCR1Counter; unsigned int _ttbarCR1OSCounter; unsigned int _ttbarCR1LSCounter; unsigned int _ttbarCR1ETauCosDPhiPZetaCounter; unsigned int _ttbarCR2Counter; unsigned int _ttbarCR2BtagVetoCounter; unsigned int _ttbarCR2TwoBtagCounter; unsigned int _ttbarCRVBFCounter; unsigned int _qcdLSCounter; unsigned int _qcdRevTauIsoCounter; unsigned int _qcdRevTauIsoLSCounter; unsigned int _qcdRevTauIsoOSCounter; unsigned int _zttCRCounter; unsigned int _zttCRVBFCounter; //for factorization unsigned int _tightDiTauChargeCounter; unsigned int _hadTauTightIsoCounter; //N-1 counters unsigned int _nMinus1ElecPtCounter; unsigned int _nMinus1ElecEtaCounter; unsigned int _nMinus1ElecDPhiInCounter; unsigned int _nMinus1ElecDEtaInCounter; unsigned int _nMinus1ElecSigmaIEtaIEtaCounter; unsigned int _nMinus1ElecHOverECounter; unsigned int _nMinus1OneOverEMinusOneOverPCounter; unsigned int _nMinus1ElecDxyVtxCounter; unsigned int _nMinus1ElecDzVtxCounter; unsigned int _nMinus1ElecMissHitsCounter; unsigned int _nMinus1ElecPFRelIsoCounter; unsigned int _nMinus1ElecHadTauDRCounter; unsigned int _nMinus1TauPtCounter; unsigned int _nMinus1TauEtaCounter; unsigned int _nMinus1TauDecayModeCounter; unsigned int _nMinus1TauNProngsCounter; unsigned int _nMinus1TauIsoCounter; unsigned int _nMinus1TauMuonDiscCounter; unsigned int _nMinus1TauElecDiscCounter; unsigned int _nMinus1ElecTauChargeCounter; unsigned int _nMinus1ElecTauCosDPhiCounter; unsigned int _nMinus1METCounter; unsigned int _nMinus1PZeta2DCounter; unsigned int _nMinus1NBtagsCounter; unsigned int _nMinus1NVBFJetsCounter; unsigned int _nMinus1JetsPtCounter; unsigned int _nMinus1DiJetDEtaCounter; unsigned int _nMinus1DiJetMassCounter; // event counters floats due to weights double _nTriggers; double _nElecMatched; double _nTauMatched; double _puWeightedEvents; double _nElecPt; double _nElecEta; double _nElecAcc; double _nElecDPhiIn; double _nElecDEtaIn; double _nElecSigmaIEtaIEta; double _nElecHadFrac; double _nElecEOverP; double _nElecDxy; double _nElecDz; double _nElecMissHits; double _nElecPFRelIso; double _nElecId; double _nElecTauDR; double _nHadTauPt; double _nHadTauEta; double _nHadTauAcc; double _nHadTauDecayMode; double _nHadTauMuonDisc; double _nHadTauElecDisc; double _nHadTauNProngs; double _nHadTauIsoDisc; double _nHadTauId; double _nElecHadTauCharge; double _nElecHadTauCosDPhi; double _nElecHadTauPZeta; double _nMEt; double _nZEEVeto; double _nBTags; double _nWJetsVeto; double _nElecTauMass; double _nTopology; double _nVBFJets; double _nVBFJetsPt; double _nDiJetDEta; double _nDiJetsMass; double _nVBFSel; double _nTightTauIso; double _nTightDiTauCharge; double _nZEECR1CentralCuts; double _nZEECR1OS; double _nZEECR1LS; double _nZEECR1MET; double _nZEECR1VBFSel; double _nZEECR2; double _nZEECR2AntiElecDisc; double _nZEECR2ElecDisc; double _nWJetsCR1; double _nWJetsCR1LS; double _nWJetsCR1OS; double _nWJetsCR1TauIso; double _nWJetsCR1VBF; double _nWJetsCR1ElecTauCosDPhiPZeta; double _nWJetsCR2; double _nWJetsCR2MtVeto; double _nWJetsCRCentralCuts; double _nTTbarCR1; double _nTTbarCR1LS; double _nTTbarCR1OS; double _nTTbarCR1ElecTauCosDPhiPZeta; double _nTTbarCR2; double _nTTbarCR2BtagVeto; double _nTTbarCR2TwoBtag; double _nTTbarVBFSel; double _nQCDLSSel; double _nQCDTauRevIso; double _nQCDTauRevIsoLS; double _nQCDTauRevIsoOS; double _nZTTCR; double _nZTTCRVBF; //N-1 double _nMinus1ElecPt; double _nMinus1ElecEta; double _nMinus1ElecDPhiIn; double _nMinus1ElecDEtaIn; double _nMinus1ElecSigmaIEtaIEta; double _nMinus1ElecHOverE; double _nMinus1ElecOneOverEMinusOneOverP; double _nMinus1ElecDxy; double _nMinus1ElecDz; double _nMinus1ElecMissHits; double _nMinus1ElecPFRelIso; double _nMinus1ElecTauDR; double _nMinus1TauPt; double _nMinus1TauEta; double _nMinus1TauDecayMode; double _nMinus1TauMuonDisc; double _nMinus1TauElecDisc; double _nMinus1TauNProngs; double _nMinus1TauIso; double _nMinus1ElecTauCharge; double _nMinus1ElecTauCosDPhi; double _nMinus1MEt; double _nMinus1PZeta2D; double _nMinus1BTags; double _nMinus1NVBFJets; double _nMinus1JetsPt; double _nMinus1DiJetDEta; double _nMinus1DiJetMass; //values for histos float _maxElecPt; float _minElecEta; float _minElecDPhiEB; float _minElecDPhiEE; float _minElecDEtaEB; float _minElecDEtaEE; float _minElecSigmaIEtaIEtaEB; float _minElecSigmaIEtaIEtaEE; float _minElecHOverEEB; float _minElecHOverEEE; float _minElecOneOverEMinusOneOverPEB; float _minElecOneOverEMinusOneOverPEE; float _minElecDxy; float _minElecDz; int _minElecMissHits; float _minElecPFRelIsoDR03; float _minElecPFRelIsoDR04; float _maxElecTauDR; float _maxTauPt; float _maxTauAltLVPt; float _minTauEta; int _maxTauDecayMode; int _maxTauNProngs; int _tauIsoDB; int _tauMVAIso; int _tauMuonDisc; int _tauElecDisc; int _tauMVA5ElecDisc; float _maxTauGenPtBeforeDecayMode; float _maxTauGenPtAfterDecayMode; float _maxTauGenPtAfterMuonDisc; float _maxTauGenPtAfterElecDisc; float _maxTauPtBeforeDecayMode; float _maxTauPtAfterDecayMode; float _maxTauPtAfterMuonDisc; float _maxTauPtAfterElecDisc; float _maxTauPtBeforeIso; float _maxTauPtAfterIso; float _maxTauGenPtBeforeIso; float _maxTauGenPtAfterIso; int _minElecTauCharge; float _minElecTauCosDPhi; float _maxMET; float _maxPZeta; float _minPZetaVis; float _maxTauPtAfterAllCuts; float _maxElecPtAfterAllCuts; float _maxMETAfterAllCuts; unsigned int _minBtagsTCHEM; unsigned int _minBtagsTCHPT; unsigned int _minBtagsCSVL; unsigned int _minBtagsCSVM; unsigned int _minBtagsCSVT; unsigned int _minNJets; float _maxJetEtSum; float _maxDiJetMass; float _minElecMETCosDPhi; float _maxElecMETMass; int _maxVBFJets; float _maxElecTauMass; float _maxElecTauLSMass; float _maxElecTauMetMass; float _maxElecTauMetLSMass; unsigned int _minBtagsTCHEMTTJetsCR; unsigned int _minBtagsTCHPTTTJetsCR; unsigned int _minBtagsCSVLTTJetsCR; unsigned int _minBtagsCSVMTTJetsCR; unsigned int _minBtagsCSVTTTJetsCR; float _maxElecPtNMinus1; float _minElecEtaNMinus1; float _minElecDPhiEBNMinus1; float _minElecDPhiEENMinus1; float _minElecDEtaEBNMinus1; float _minElecDEtaEENMinus1; float _minElecSigmaIEtaIEtaEBNMinus1; float _minElecSigmaIEtaIEtaEENMinus1; float _minElecHOverEEBNMinus1; float _minElecHOverEEENMinus1; float _minElecOneOverEMinusOneOverPEBNMinus1; float _minElecOneOverEMinusOneOverPEENMinus1; float _minElecDxyNMinus1; float _minElecDzNMinus1; int _minElecMissHitsNMinus1; float _minElecPFRelIsoDR03NMinus1; float _minElecPFRelIsoDR04NMinus1; float _maxElecTauDRNMinus1; float _maxTauPtNMinus1; float _maxTauAltLVPtNMinus1; float _minTauEtaNMinus1; int _maxTauDecayModeNMinus1; int _maxTauNProngsNMinus1; int _tauIsoDBNMinus1; int _tauIsoDB3HitsNMinus1; int _tauMVAIsoNMinus1; int _tauMuonDiscNMinus1; int _tauElecDiscNMinus1; int _tauMVA5ElecDiscNMinus1; int _minElecTauChargeNMinus1; float _minElecTauCosDPhiNMinus1; float _maxMETNMinus1; float _maxPZetaNMinus1; float _minPZetaVisNMinus1; int _minBtagsTCHEMNMinus1; int _minBtagsTCHPTNMinus1; int _minBtagsCSVLNMinus1; int _minBtagsCSVMNMinus1; int _minBtagsCSVTNMinus1; int _minNJetsNminus1; float _maxJetEtSumNMinus1; int _maxNVBFJetsNMinus1; float _maxJet1PtNMinus1; float _maxJet2PtNMinus1; float _maxDiJetDEtaNMinus1; float _maxDiJetMassNMinus1; float _maxTauPtTTbarCR1; float _maxTauPtTTbarCRNoTauId; float _maxZEECRDiJetMass; float _maxZTTCRDiJetMass; float _maxWJetsCRDiJetMass; float _maxTTJetsCRDiJetMass; //histos //Official PileUp histo TH1F* dataPUHisto; TH1F* _pileUPDistro; TH1F* _pileUPReweighted; TH1F* _elecPtHisto; TH1F* _elecEtaHisto; TH1F* _elecDPhiInEBHisto; TH1F* _elecDPhiInEEHisto; TH1F* _elecDEtaInEBHisto; TH1F* _elecDEtaInEEHisto; TH1F* _elecSigmaIEtaIEtaEBHisto; TH1F* _elecSigmaIEtaIEtaEEHisto; TH1F* _elecHOverEEBHisto; TH1F* _elecHOverEEEHisto; TH1F* _elecOneOverEMinusOneOverPEBHisto; TH1F* _elecOneOverEMinusOneOverPEEHisto; TH1F* _elecDxyVtxHisto; TH1F* _elecDzVtxHisto; TH1F* _elecMissHisto; TH1F* _elecPFRelIsoDR03Histo; TH1F* _elecPFRelIsoDR04Histo; TH1F* _elecTauDRHisto; TH1F* _tauPtHisto; TH1F* _tauAltLVPtHisto; TH1F* _tauEtaHisto; TH1F* _tauDecayModeHisto; TH1F* _tauMuonDiscHisto; TH1F* _tauElecDiscHisto; TH1F* _tauElecMVA5DiscHisto; TH1F* _tauNProngsHisto; TH1F* _tauIsoDB3HitsHisto; TH1F* _tauIsoMVAHisto; TH1F* _tauGenPtBeforeDecayModeHisto; TH1F* _tauPtBeforeDecayModeHisto; TH1F* _tauGenPtAfterDecayModeHisto; TH1F* _tauPtAfterDecayModeHisto; TH1F* _tauGenPtAfterMuonDiscHisto; TH1F* _tauPtAfterMuonDiscHisto; TH1F* _tauGenPtAfterElecDiscHisto; TH1F* _tauPtAfterElecDiscHisto; TH1F* _tauGenPtBeforeIsoHisto; TH1F* _tauGenPtAfterIsoHisto; TH1F* _tauPtBeforeIsoHisto; TH1F* _tauPtAfterIsoHisto; TH1F* _ptResAfterIsoHisto; TH1F* _ptResBeforeTauIdHisto; TH1F* _elecTauChargeHisto; TH1F* _elecTauCosDPhiHisto; TH1F* _metHisto; TH2F* _pZetaVsPZetaVis2DHisto; TH1F* _pZetaHisto; TH1F* _pZetaVisHisto; TH1F* _nBTagsTCHEMHisto; TH1F* _nBTagsTCHPTHisto; TH1F* _nBTagsCSVLHisto; TH1F* _nBTagsCSVMHisto; TH1F* _nBTagsCSVTHisto; TH1F* _nJetsHisto; TH2F* _nJetsVsNBtagsCSVM2DHisto; TH2F* _jetEtSumVsNBtagsCSVM2DHisto; TH1F* _jetEtSumHisto; TH1F* _vbfDiJetMassHisto; TH1F* _elecMETMassHisto; TH1F* _elecMETCosDPhi; TH2F* _elecMETMassVsElecMETCosDPhi; TH2F* _elecMETMassVsElecTauCosDPhi; TH1F* _nVBFJetsHisto; TH1F* _elecTauMassHisto; TH1F* _elecTauLSMassHisto; TH1F* _elecTauMetMassHisto; TH1F* _elecTauMetLSMassHisto; TH1F* _nBTagsTCHEMTTJetsCRHisto; TH1F* _nBTagsTCHPTTTJetsCRHisto; TH1F* _nBTagsCSVLTTJetsCRHisto; TH1F* _nBTagsCSVMTTJetsCRHisto; TH1F* _nBTagsCSVTTTJetsCRHisto; TH1F* _tauPtTTbarCR1Histo; TH1F* _tauPtTTbarCR1HistoNoTauId; TH2F* _diElecAsymmVsdiElecMassDiff; TH1F* _tauPtAfterAllCutsHisto; TH1F* _elecPtAfterAllCutsHisto; TH1F* _metAfterAllCutsHisto; TH1F* _elecPtNMinus1Histo; TH1F* _elecEtaNMinus1Histo; TH1F* _elecDPhiInEBNMinus1Histo; TH1F* _elecDPhiInEENMinus1Histo; TH1F* _elecDEtaInEBNMinus1Histo; TH1F* _elecDEtaInEENMinus1Histo; TH1F* _elecSigmaIEtaIEtaEBNMinus1Histo; TH1F* _elecSigmaIEtaIEtaEENMinus1Histo; TH1F* _elecHOverEEBNMinus1Histo; TH1F* _elecHOverEEENMinus1Histo; TH1F* _elecOneOverEMinusOneOverPEBNMinus1Histo; TH1F* _elecOneOverEMinusOneOverPEENMinus1Histo; TH1F* _elecDxyVtxNMinus1Histo; TH1F* _elecDzVtxNMinus1Histo; TH1F* _elecMissNMinus1Histo; TH1F* _elecPFRelIsoDR03NMinus1Histo; TH1F* _elecPFRelIsoDR04NMinus1Histo; TH1F* _elecTauDRNMinus1Histo; TH1F* _tauPtNMinus1Histo; TH1F* _tauAltLVPtNMinus1Histo; TH1F* _tauEtaNMinus1Histo; TH1F* _tauDecayModeNMinus1Histo; TH1F* _tauMuonDiscNMinus1Histo; TH1F* _tauNProngsNMinus1Histo; TH1F* _tauElecDiscNMinus1Histo; TH1F* _tauElecMVA5DiscNMinus1Histo; TH1F* _tauIsoDBNMinus1Histo; TH1F* _tauIsoDB3HitsNMinus1Histo; TH1F* _tauIsoMVANMinus1Histo; TH1F* _elecTauChargeNMinus1Histo; TH1F* _elecTauCosDPhiNMinus1Histo; TH1F* _metNMinus1Histo; TH2F* _pZetaVsPZetaVis2DNMinus1Histo; TH1F* _pZetaNMinus1Histo; TH1F* _pZetaMinusPZetaVisNMinus1Histo; TH1F* _pZetaVisNMinus1Histo; TH1F* _nBTagsTCHEMNMinus1Histo; TH1F* _nBTagsTCHPTNMinus1Histo; TH1F* _nBTagsCSVLNMinus1Histo; TH1F* _nBTagsCSVMNMinus1Histo; TH1F* _nBTagsCSVTNMinus1Histo; TH1F* _nJetsNMinus1Histo; TH1F* _jetEtSumNMinus1Histo; TH1F* _nVBFJetsNMinus1Histo; TH1F* _jet1PtNMinus1Histo; TH1F* _jet2PtNMinus1Histo; TH1F* _vbfDiJetDEtaNMinus1Histo; TH1F* _vbfDiJetMassNMinus1Histo; TH1F* _zeeCRVBFDiJetMassHisto; TH1F* _ztautauCRVBFDiJetMassHisto; TH1F* _wjetsCRVBFDiJetMassHisto; TH1F* _ttjetsCRVBFDiJetMassHisto; }; #endif #ifdef ElecTauAnalysis_cxx ElecTauAnalysis::ElecTauAnalysis(TTree *tree) : fChain(0) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("rootFiles/elecDiTauAnalysis.root"); if (!f || !f->IsOpen()) { f = new TFile("rootFiles/elecDiTauAnalysis.root"); } TDirectory * dir = (TDirectory*)f->Get("rootFiles/elecDiTauAnalysis.root:/analyzeHiMassTau"); dir->GetObject("HMTTree",tree); } Init(tree); _doFactorization = false; _puWeightedEvents = 0.; _nTriggers = 0.; _nElecPt = 0.; _nElecEta = 0.; _nElecAcc = 0.; _nElecDPhiIn = 0.; _nElecDEtaIn = 0.; _nElecSigmaIEtaIEta = 0.; _nElecHadFrac = 0.; _nElecEOverP = 0.; _nElecDxy = 0.; _nElecDz = 0.; _nElecMissHits = 0.; _nElecPFRelIso = 0.; _nElecId = 0.; _nElecTauDR = 0.; _nHadTauPt = 0.; _nHadTauEta = 0.; _nHadTauAcc = 0.; _nHadTauDecayMode = 0.; _nHadTauNProngs = 0.; _nHadTauMuonDisc = 0.; _nHadTauElecDisc = 0.; _nHadTauIsoDisc = 0.; _nHadTauId = 0.; _nElecHadTauCharge = 0.; _nElecHadTauCosDPhi = 0.; _nElecHadTauPZeta = 0.; _nWJetsVeto = 0.; _nZEEVeto = 0.; _nMEt = 0.; _nBTags = 0.; _nElecTauMass = 0.; _nTopology = 0.; _nVBFJets = 0.; _nVBFJetsPt = 0.; _nDiJetDEta = 0.; _nDiJetsMass = 0.; _nVBFSel = 0.; _nTightTauIso = 0.; _nTightDiTauCharge = 0.; _nZEECR1CentralCuts = 0.; _nZEECR1OS = 0.; _nZEECR1LS = 0.; _nZEECR1MET = 0.; _nZEECR1VBFSel = 0.; _nZEECR2 = 0.; _nZEECR2AntiElecDisc = 0.; _nZEECR2ElecDisc = 0.; _nWJetsCR1 = 0.; _nWJetsCR1LS = 0.; _nWJetsCR1OS = 0.; _nWJetsCR1TauIso = 0.; _nWJetsCR1VBF = 0.; _nWJetsCR1ElecTauCosDPhiPZeta = 0.; _nWJetsCR2MtVeto = 0.; _nWJetsCR2 = 0.; _nWJetsCRCentralCuts = 0.; _nTTbarCR1 = 0.; _nTTbarCR1OS = 0.; _nTTbarCR1LS = 0.; _nTTbarCR1ElecTauCosDPhiPZeta = 0.; _nTTbarCR2 = 0.; _nTTbarCR2BtagVeto = 0.; _nTTbarCR2TwoBtag = 0.; _nTTbarVBFSel = 0.; _nQCDLSSel = 0.; _nQCDTauRevIso = 0.; _nQCDTauRevIsoLS = 0.; _nQCDTauRevIsoOS = 0.; _nZTTCR = 0.; _nZTTCRVBF = 0.; //N-1 _nMinus1ElecPt = 0.; _nMinus1ElecEta = 0.; _nMinus1ElecDPhiIn = 0.; _nMinus1ElecDEtaIn = 0.; _nMinus1ElecSigmaIEtaIEta = 0.; _nMinus1ElecHOverE = 0.; _nMinus1ElecOneOverEMinusOneOverP = 0.; _nMinus1ElecDxy = 0.; _nMinus1ElecDz = 0.; _nMinus1ElecMissHits = 0.; _nMinus1ElecPFRelIso = 0.; _nMinus1ElecTauDR = 0.; _nMinus1TauPt = 0.; _nMinus1TauEta = 0.; _nMinus1TauDecayMode = 0.; _nMinus1TauNProngs = 0.; _nMinus1TauMuonDisc = 0.; _nMinus1TauElecDisc = 0.; _nMinus1TauElecDisc = 0.; _nMinus1TauIso = 0.; _nMinus1ElecTauCharge = 0.; _nMinus1ElecTauCosDPhi = 0.; _nMinus1MEt = 0.; _nMinus1PZeta2D = 0.; _nMinus1BTags = 0.; _nMinus1DiJetMass = 0.; } ElecTauAnalysis::~ElecTauAnalysis(){ if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t ElecTauAnalysis::GetEntry(Long64_t entry){ // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t ElecTauAnalysis::LoadTree(Long64_t entry){ // Set the environment to read one entry if (!fChain) return -5; Long64_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (fChain->GetTreeNumber() != fCurrent) { fCurrent = fChain->GetTreeNumber(); Notify(); } return centry; } void ElecTauAnalysis::Init(TTree *tree){ // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. // It is normally not necessary to make changes to the generated // code, but the routine can be extended by the user if needed. // Init() will be called many times when running on PROOF // (once per file to be processed). // Set object pointer PDFWweights = 0; hadTauMatched = 0; hadTauMotherId = 0; hadTauIsGenElec = 0; hadTauGenPt = 0; hadTauGenE = 0; hadTauGenEta = 0; hadTauGenPhi = 0; hadTauPt = 0; hadTauAltLVPt = 0; hadTauAltLVEnergy = 0; hadTauEnergy = 0; hadTauEta = 0; hadTauPhi = 0; hadTauCharge = 0; hadTauLeadChargedCandPt = 0; hadTauLeadChargedCandCharge = 0; hadTauLeadChargedCandDxyVtx = 0; hadTauLeadChargedCandDxyBS = 0; hadTauLeadChargedCandDxyError = 0; hadTauLeadChargedCandDzVtx = 0; hadTauLeadChargedCandDzBS = 0; hadTauLeadChargedCandDzError = 0; hadTauLeadChargedCandVx = 0; hadTauLeadChargedCandVy = 0; hadTauLeadChargedCandVz = 0; hadTauDeltaZVtx = 0; hadTauNProngs = 0; hadTauEmFraction = 0; hadTauHcalTotOverPLead = 0; hadTauHcalMaxOverPLead = 0; hadTauHcal3x3OverPLead = 0; hadTauElectronPreId = 0; hadTauModifiedEOverP = 0; hadTauBremsRecoveryEOverPLead = 0; hadTauLTSignedIp = 0; hadTauTrkIsoSumPt = 0; hadTauECALIsoSumEt = 0; hadTauIdByDecayModeFinding = 0; hadTauIdByDecayModeFindingNewDMs = 0; hadTauIdByDecayModeFindingOldDMs = 0; hadTauIdByLooseCombinedIsolationDBSumPtCorr = 0; hadTauIdByMediumCombinedIsolationDBSumPtCorr = 0; hadTauIdByTightCombinedIsolationDBSumPtCorr = 0; hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits = 0; hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits = 0; hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits = 0; hadTauIdByVLooseIsolationMVA3newDMwLT = 0; hadTauIdByLooseIsolationMVA3newDMwLT = 0; hadTauIdByMediumIsolationMVA3newDMwLT = 0; hadTauIdByTightIsolationMVA3newDMwLT = 0; hadTauIdByVTightIsolationMVA3newDMwLT = 0; hadTauIdByVVTightIsolationMVA3newDMwLT = 0; hadTauIdByVLooseIsolationMVA3newDMwoLT = 0; hadTauIdByLooseIsolationMVA3newDMwoLT = 0; hadTauIdByMediumIsolationMVA3newDMwoLT = 0; hadTauIdByTightIsolationMVA3newDMwoLT = 0; hadTauIdByVTightIsolationMVA3newDMwoLT = 0; hadTauIdByVVTightIsolationMVA3newDMwoLT = 0; hadTauIdByVLooseIsolationMVA3oldDMwLT = 0; hadTauIdByLooseIsolationMVA3oldDMwLT = 0; hadTauIdByMediumIsolationMVA3oldDMwLT = 0; hadTauIdByTightIsolationMVA3oldDMwLT = 0; hadTauIdByVTightIsolationMVA3oldDMwLT = 0; hadTauIdByVVTightIsolationMVA3oldDMwLT = 0; hadTauIdByVLooseIsolationMVA3oldDMwoLT = 0; hadTauIdByLooseIsolationMVA3oldDMwoLT = 0; hadTauIdByMediumIsolationMVA3oldDMwoLT = 0; hadTauIdByTightIsolationMVA3oldDMwoLT = 0; hadTauIdByVTightIsolationMVA3oldDMwoLT = 0; hadTauIdByVVTightIsolationMVA3oldDMwoLT = 0; hadTauIdByLooseElectronRejection = 0; hadTauIdByMediumElectronRejection = 0; hadTauIdByTightElectronRejection = 0; hadTauIdByMVA5rawElectronRejection = 0; hadTauIdByMVA5ElectronRejectionCat = 0; hadTauIdByMVA5VLooseElectronRejection = 0; hadTauIdByMVA5LooseElectronRejection = 0; hadTauIdByMVA5MediumElectronRejection = 0; hadTauIdByMVA5TightElectronRejection = 0; hadTauIdByMVA5VTightElectronRejection = 0; hadTauIdByElectronDeadECAL = 0; hadTauIdByLooseMuonRejection = 0; hadTauIdByMediumMuonRejection = 0; hadTauIdByTightMuonRejection = 0; hadTauIdByLooseMuonRejection2 = 0; hadTauIdByMediumMuonRejection2 = 0; hadTauIdByTightMuonRejection2 = 0; hadTauIdByLooseMuonRejection3 = 0; hadTauIdByTightMuonRejection3 = 0; hadTauIdByLooseMVAMuonRejection = 0; hadTauIdByMediumMVAMuonRejection = 0; hadTauIdByTightMVAMuonRejection = 0; hadTauMEtMt = 0; elecMatched = 0; elecMotherId = 0; elecGenPt = 0; elecGenE = 0; elecGenEta = 0; elecGenPhi = 0; elecPt = 0; elecE = 0; elecEta = 0; elecPhi = 0; elecCharge = 0; elecDxyVtx = 0; elecDxyBS = 0; elecDxyError = 0; elecDzVtx = 0; elecDzBS = 0; elecDzError = 0; elecVx = 0; elecVy = 0; elecVz = 0; elecDEtaIn = 0; elecDPhiIn = 0; elecSigmaIEtaIEta = 0; elecHadOverE = 0; elecFbrem = 0; elecEOverPIn = 0; elecOneOverEMinusOneOverPIn = 0; elecMissingHits = 0; elecConversionRejection = 0; elecFiducialFlag = 0; elecPFIsoDR03SumChargedHadronPt = 0; elecPFIsoDR03SumNeutralHadronPt = 0; elecPFIsoDR03SumPhotonPt = 0; elecPFIsoDR03SumPUPt = 0; elecPFIsoDR04SumChargedHadronPt = 0; elecPFIsoDR04SumNeutralHadronPt = 0; elecPFIsoDR04SumPhotonPt = 0; elecPFIsoDR04SumPUPt = 0; elecIsoDR03SumPtTrk = 0; elecIsoDR03SumEtEcal = 0; _elecIsoDR03SumEtHcal = 0; elecClass = 0; elecMVAStatus = 0; elecMVAOut = 0; elecMEtMt = 0; elecMetCosDPhi = 0; elecHadTauCosDPhi = 0; elecHadTauDelatR = 0; elecHadTauMass = 0; elecHadTauMetMass = 0; elecHadTauCollMass = 0; elecHadTauPZeta = 0; elecHadTauPZetaVis = 0; nVBFJets = 0; diJetMass = 0; diJetDEta = 0; jet1Pt = 0; jet1Eta = 0; jet2Pt = 0; jet2Eta = 0; elecDiJetMass = 0; hadTauDiJetMass = 0; elecTauDiJetMass = 0; nJets = 0; jetEtSum = 0; nBtagsHiEffTrkCnt = 0; nBtagsHiPurityTrkCnt = 0; nBTagsCombSecVtxLoose = 0; nBTagsCombSecVtxMedium = 0; nBTagsCombSecVtxTight = 0; // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("runNumber", &runNumber, &b_runNumber); fChain->SetBranchAddress("eventNumber", &eventNumber, &b_eventNumber); fChain->SetBranchAddress("TrueNumPU", &TrueNumPU, &b_TrueNumPU); fChain->SetBranchAddress("InTimePU", &InTimePU, &b_InTimePU); fChain->SetBranchAddress("OutTimePlusPU", &OutTimePlusPU, &b_OutTimePlusPU); fChain->SetBranchAddress("OutTimeMinusPU", &OutTimeMinusPU, &b_OutTimeMinusPU); fChain->SetBranchAddress("nVtx", &nVtx, &b_nVtx); fChain->SetBranchAddress("nGoodVtx", &nGoodVtx, &b_nGoodVtx); fChain->SetBranchAddress("passedHLTElec27WP80", &passedHLTElec27WP80, &b_passedHLTElec27WP80); fChain->SetBranchAddress("elecRhoIso", &elecRhoIso, &b_elecRhoIso); fChain->SetBranchAddress("MEt", &MEt, &b_MEt); fChain->SetBranchAddress("zEvent", &zEvent, &b_zEvent); fChain->SetBranchAddress("zMassDiff", &zMassDiff, &b_zMassDiff); fChain->SetBranchAddress("zPtAsymm", &zPtAsymm, &b_zPtAsymm); fChain->SetBranchAddress("wCandGenPt", &wCandGenPt, &b_wCandGenPt); fChain->SetBranchAddress("zCandGenMass", &zCandGenMass, &b_zCandGenMass); fChain->SetBranchAddress("PDFWweights", &PDFWweights, &b_PDFWweights); fChain->SetBranchAddress("ISRGluonWeight", &ISRGluonWeight, &b_ISRGluonWeight); fChain->SetBranchAddress("ISRGammaWeight", &ISRGammaWeight, &b_ISRGammaWeight); fChain->SetBranchAddress("FSRWeight", &FSRWeight, &b_FSRWeight); fChain->SetBranchAddress("hadTauMatched", &hadTauMatched, &b_hadTauMatched); fChain->SetBranchAddress("hadTauMotherId", &hadTauMotherId, &b_hadTauMotherId); fChain->SetBranchAddress("hadTauIsGenElec", &hadTauIsGenElec, &b_hadTauIsGenElec); fChain->SetBranchAddress("hadTauGenPt", &hadTauGenPt, &b_hadTauGenPt); fChain->SetBranchAddress("hadTauGenE", &hadTauGenE, &b_hadTauGenE); fChain->SetBranchAddress("hadTauGenEta", &hadTauGenEta, &b_hadTauGenEta); fChain->SetBranchAddress("hadTauGenPhi", &hadTauGenPhi, &b_hadTauGenPhi); fChain->SetBranchAddress("hadTauPt", &hadTauPt, &b_hadTauPt); fChain->SetBranchAddress("hadTauAltLVPt", &hadTauAltLVPt, &b_hadTauAltLVPt); fChain->SetBranchAddress("hadTauAltLVEnergy", &hadTauAltLVEnergy, &b_hadTauAltLVEnergy); fChain->SetBranchAddress("hadTauEnergy", &hadTauEnergy, &b_hadTauEnergy); fChain->SetBranchAddress("hadTauEta", &hadTauEta, &b_hadTauEta); fChain->SetBranchAddress("hadTauPhi", &hadTauPhi, &b_hadTauPhi); fChain->SetBranchAddress("hadTauCharge", &hadTauCharge, &b_hadTauCharge); fChain->SetBranchAddress("hadTauLeadChargedCandPt", &hadTauLeadChargedCandPt, &b_hadTauLeadChargedCandPt); fChain->SetBranchAddress("hadTauLeadChargedCandCharge", &hadTauLeadChargedCandCharge, &b_hadTauLeadChargedCandCharge); fChain->SetBranchAddress("hadTauLeadChargedCandDxyVtx", &hadTauLeadChargedCandDxyVtx, &b_hadTauLeadChargedCandDxyVtx); fChain->SetBranchAddress("hadTauLeadChargedCandDxyBS", &hadTauLeadChargedCandDxyBS, &b_hadTauLeadChargedCandDxyBS); fChain->SetBranchAddress("hadTauLeadChargedCandDxyError", &hadTauLeadChargedCandDxyError, &b_hadTauLeadChargedCandDxyError); fChain->SetBranchAddress("hadTauLeadChargedCandDzVtx", &hadTauLeadChargedCandDzVtx, &b_hadTauLeadChargedCandDzVtx); fChain->SetBranchAddress("hadTauLeadChargedCandDzBS", &hadTauLeadChargedCandDzBS, &b_hadTauLeadChargedCandDzBS); fChain->SetBranchAddress("hadTauLeadChargedCandDzError", &hadTauLeadChargedCandDzError, &b_hadTauLeadChargedCandDzError); fChain->SetBranchAddress("hadTauLeadChargedCandVx", &hadTauLeadChargedCandVx, &b_hadTauLeadChargedCandVx); fChain->SetBranchAddress("hadTauLeadChargedCandVy", &hadTauLeadChargedCandVy, &b_hadTauLeadChargedCandVy); fChain->SetBranchAddress("hadTauLeadChargedCandVz", &hadTauLeadChargedCandVz, &b_hadTauLeadChargedCandVz); fChain->SetBranchAddress("hadTauDeltaZVtx", &hadTauDeltaZVtx, &b_hadTauDeltaZVtx); fChain->SetBranchAddress("hadTauNProngs", &hadTauNProngs, &b_hadTauNProngs); fChain->SetBranchAddress("hadTauEmFraction", &hadTauEmFraction, &b_hadTauEmFraction); fChain->SetBranchAddress("hadTauHcalTotOverPLead", &hadTauHcalTotOverPLead, &b_hadTauHcalTotOverPLead); fChain->SetBranchAddress("hadTauHcalMaxOverPLead", &hadTauHcalMaxOverPLead, &b_hadTauHcalMaxOverPLead); fChain->SetBranchAddress("hadTauHcal3x3OverPLead", &hadTauHcal3x3OverPLead, &b_hadTauHcal3x3OverPLead); fChain->SetBranchAddress("hadTauElectronPreId", &hadTauElectronPreId, &b_hadTauElectronPreId); fChain->SetBranchAddress("hadTauModifiedEOverP", &hadTauModifiedEOverP, &b_hadTauModifiedEOverP); fChain->SetBranchAddress("hadTauBremsRecoveryEOverPLead", &hadTauBremsRecoveryEOverPLead, &b_hadTauBremsRecoveryEOverPLead); fChain->SetBranchAddress("hadTauLTSignedIp", &hadTauLTSignedIp, &b_hadTauLTSignedIp); fChain->SetBranchAddress("hadTauTrkIsoSumPt", &hadTauTrkIsoSumPt, &b_hadTauTrkIsoSumPt); fChain->SetBranchAddress("hadTauECALIsoSumEt", &hadTauECALIsoSumEt, &b_hadTauECALIsoSumEt); fChain->SetBranchAddress("hadTauIdByDecayModeFinding", &hadTauIdByDecayModeFinding, &b_hadTauIdByDecayModeFinding); fChain->SetBranchAddress("hadTauIdByDecayModeFindingNewDMs", &hadTauIdByDecayModeFindingNewDMs, &b_hadTauIdByDecayModeFindingNewDMs); fChain->SetBranchAddress("hadTauIdByDecayModeFindingOldDMs", &hadTauIdByDecayModeFindingOldDMs, &b_hadTauIdByDecayModeFindingOldDMs); fChain->SetBranchAddress("hadTauIdByLooseCombinedIsolationDBSumPtCorr", &hadTauIdByLooseCombinedIsolationDBSumPtCorr, &b_hadTauIdByLooseCombinedIsolationDBSumPtCorr); fChain->SetBranchAddress("hadTauIdByMediumCombinedIsolationDBSumPtCorr", &hadTauIdByMediumCombinedIsolationDBSumPtCorr, &b_hadTauIdByMediumCombinedIsolationDBSumPtCorr); fChain->SetBranchAddress("hadTauIdByTightCombinedIsolationDBSumPtCorr", &hadTauIdByTightCombinedIsolationDBSumPtCorr, &b_hadTauIdByTightCombinedIsolationDBSumPtCorr); fChain->SetBranchAddress("hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits", &hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits, &b_hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits); fChain->SetBranchAddress("hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits", &hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits, &b_hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits); fChain->SetBranchAddress("hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits", &hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits, &b_hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits); fChain->SetBranchAddress("hadTauIdByVLooseIsolationMVA3newDMwLT", &hadTauIdByVLooseIsolationMVA3newDMwLT, &b_hadTauIdByVLooseIsolationMVA3newDMwLT); fChain->SetBranchAddress("hadTauIdByLooseIsolationMVA3newDMwLT", &hadTauIdByLooseIsolationMVA3newDMwLT, &b_hadTauIdByLooseIsolationMVA3newDMwLT); fChain->SetBranchAddress("hadTauIdByMediumIsolationMVA3newDMwLT", &hadTauIdByMediumIsolationMVA3newDMwLT, &b_hadTauIdByMediumIsolationMVA3newDMwLT); fChain->SetBranchAddress("hadTauIdByTightIsolationMVA3newDMwLT", &hadTauIdByTightIsolationMVA3newDMwLT, &b_hadTauIdByTightIsolationMVA3newDMwLT); fChain->SetBranchAddress("hadTauIdByVTightIsolationMVA3newDMwLT", &hadTauIdByVTightIsolationMVA3newDMwLT, &b_hadTauIdByVTightIsolationMVA3newDMwLT); fChain->SetBranchAddress("hadTauIdByVVTightIsolationMVA3newDMwLT", &hadTauIdByVVTightIsolationMVA3newDMwLT, &b_hadTauIdByVVTightIsolationMVA3newDMwLT); fChain->SetBranchAddress("hadTauIdByVLooseIsolationMVA3newDMwoLT", &hadTauIdByVLooseIsolationMVA3newDMwoLT, &b_hadTauIdByVLooseIsolationMVA3newDMwoLT); fChain->SetBranchAddress("hadTauIdByLooseIsolationMVA3newDMwoLT", &hadTauIdByLooseIsolationMVA3newDMwoLT, &b_hadTauIdByLooseIsolationMVA3newDMwoLT); fChain->SetBranchAddress("hadTauIdByMediumIsolationMVA3newDMwoLT", &hadTauIdByMediumIsolationMVA3newDMwoLT, &b_hadTauIdByMediumIsolationMVA3newDMwoLT); fChain->SetBranchAddress("hadTauIdByTightIsolationMVA3newDMwoLT", &hadTauIdByTightIsolationMVA3newDMwoLT, &b_hadTauIdByTightIsolationMVA3newDMwoLT); fChain->SetBranchAddress("hadTauIdByVTightIsolationMVA3newDMwoLT", &hadTauIdByVTightIsolationMVA3newDMwoLT, &b_hadTauIdByVTightIsolationMVA3newDMwoLT); fChain->SetBranchAddress("hadTauIdByVVTightIsolationMVA3newDMwoLT", &hadTauIdByVVTightIsolationMVA3newDMwoLT, &b_hadTauIdByVVTightIsolationMVA3newDMwoLT); fChain->SetBranchAddress("hadTauIdByVLooseIsolationMVA3oldDMwLT", &hadTauIdByVLooseIsolationMVA3oldDMwLT, &b_hadTauIdByVLooseIsolationMVA3oldDMwLT); fChain->SetBranchAddress("hadTauIdByLooseIsolationMVA3oldDMwLT", &hadTauIdByLooseIsolationMVA3oldDMwLT, &b_hadTauIdByLooseIsolationMVA3oldDMwLT); fChain->SetBranchAddress("hadTauIdByMediumIsolationMVA3oldDMwLT", &hadTauIdByMediumIsolationMVA3oldDMwLT, &b_hadTauIdByMediumIsolationMVA3oldDMwLT); fChain->SetBranchAddress("hadTauIdByTightIsolationMVA3oldDMwLT", &hadTauIdByTightIsolationMVA3oldDMwLT, &b_hadTauIdByTightIsolationMVA3oldDMwLT); fChain->SetBranchAddress("hadTauIdByVTightIsolationMVA3oldDMwLT", &hadTauIdByVTightIsolationMVA3oldDMwLT, &b_hadTauIdByVTightIsolationMVA3oldDMwLT); fChain->SetBranchAddress("hadTauIdByVVTightIsolationMVA3oldDMwLT", &hadTauIdByVVTightIsolationMVA3oldDMwLT, &b_hadTauIdByVVTightIsolationMVA3oldDMwLT); fChain->SetBranchAddress("hadTauIdByVLooseIsolationMVA3oldDMwoLT", &hadTauIdByVLooseIsolationMVA3oldDMwoLT, &b_hadTauIdByVLooseIsolationMVA3oldDMwoLT); fChain->SetBranchAddress("hadTauIdByLooseIsolationMVA3oldDMwoLT", &hadTauIdByLooseIsolationMVA3oldDMwoLT, &b_hadTauIdByLooseIsolationMVA3oldDMwoLT); fChain->SetBranchAddress("hadTauIdByMediumIsolationMVA3oldDMwoLT", &hadTauIdByMediumIsolationMVA3oldDMwoLT, &b_hadTauIdByMediumIsolationMVA3oldDMwoLT); fChain->SetBranchAddress("hadTauIdByTightIsolationMVA3oldDMwoLT", &hadTauIdByTightIsolationMVA3oldDMwoLT, &b_hadTauIdByTightIsolationMVA3oldDMwoLT); fChain->SetBranchAddress("hadTauIdByVTightIsolationMVA3oldDMwoLT", &hadTauIdByVTightIsolationMVA3oldDMwoLT, &b_hadTauIdByVTightIsolationMVA3oldDMwoLT); fChain->SetBranchAddress("hadTauIdByVVTightIsolationMVA3oldDMwoLT", &hadTauIdByVVTightIsolationMVA3oldDMwoLT, &b_hadTauIdByVVTightIsolationMVA3oldDMwoLT); fChain->SetBranchAddress("hadTauIdByLooseElectronRejection", &hadTauIdByLooseElectronRejection, &b_hadTauIdByLooseElectronRejection); fChain->SetBranchAddress("hadTauIdByMediumElectronRejection", &hadTauIdByMediumElectronRejection, &b_hadTauIdByMediumElectronRejection); fChain->SetBranchAddress("hadTauIdByTightElectronRejection", &hadTauIdByTightElectronRejection, &b_hadTauIdByTightElectronRejection); fChain->SetBranchAddress("hadTauIdByMVA5rawElectronRejection", &hadTauIdByMVA5rawElectronRejection, &b_hadTauIdByMVA5rawElectronRejection); fChain->SetBranchAddress("hadTauIdByMVA5ElectronRejectionCat", &hadTauIdByMVA5ElectronRejectionCat, &b_hadTauIdByMVA5ElectronRejectionCat); fChain->SetBranchAddress("hadTauIdByMVA5VLooseElectronRejection", &hadTauIdByMVA5VLooseElectronRejection, &b_hadTauIdByMVA5VLooseElectronRejection); fChain->SetBranchAddress("hadTauIdByMVA5LooseElectronRejection", &hadTauIdByMVA5LooseElectronRejection, &b_hadTauIdByMVA5LooseElectronRejection); fChain->SetBranchAddress("hadTauIdByMVA5MediumElectronRejection", &hadTauIdByMVA5MediumElectronRejection, &b_hadTauIdByMVA5MediumElectronRejection); fChain->SetBranchAddress("hadTauIdByMVA5TightElectronRejection", &hadTauIdByMVA5TightElectronRejection, &b_hadTauIdByMVA5TightElectronRejection); fChain->SetBranchAddress("hadTauIdByMVA5VTightElectronRejection", &hadTauIdByMVA5VTightElectronRejection, &b_hadTauIdByMVA5VTightElectronRejection); fChain->SetBranchAddress("hadTauIdByElectronDeadECAL", &hadTauIdByElectronDeadECAL, &b_hadTauIdByElectronDeadECAL); fChain->SetBranchAddress("hadTauIdByLooseMuonRejection", &hadTauIdByLooseMuonRejection, &b_hadTauIdByLooseMuonRejection); fChain->SetBranchAddress("hadTauIdByMediumMuonRejection", &hadTauIdByMediumMuonRejection, &b_hadTauIdByMediumMuonRejection); fChain->SetBranchAddress("hadTauIdByTightMuonRejection", &hadTauIdByTightMuonRejection, &b_hadTauIdByTightMuonRejection); fChain->SetBranchAddress("hadTauIdByLooseMuonRejection2", &hadTauIdByLooseMuonRejection2, &b_hadTauIdByLooseMuonRejection2); fChain->SetBranchAddress("hadTauIdByMediumMuonRejection2", &hadTauIdByMediumMuonRejection2, &b_hadTauIdByMediumMuonRejection2); fChain->SetBranchAddress("hadTauIdByTightMuonRejection2", &hadTauIdByTightMuonRejection2, &b_hadTauIdByTightMuonRejection2); fChain->SetBranchAddress("hadTauIdByLooseMuonRejection3", &hadTauIdByLooseMuonRejection3, &b_hadTauIdByLooseMuonRejection3); fChain->SetBranchAddress("hadTauIdByTightMuonRejection3", &hadTauIdByTightMuonRejection3, &b_hadTauIdByTightMuonRejection3); fChain->SetBranchAddress("hadTauIdByLooseMVAMuonRejection", &hadTauIdByLooseMVAMuonRejection, &b_hadTauIdByLooseMVAMuonRejection); fChain->SetBranchAddress("hadTauIdByMediumMVAMuonRejection", &hadTauIdByMediumMVAMuonRejection, &b_hadTauIdByMediumMVAMuonRejection); fChain->SetBranchAddress("hadTauIdByTightMVAMuonRejection", &hadTauIdByTightMVAMuonRejection, &b_hadTauIdByTightMVAMuonRejection); fChain->SetBranchAddress("hadTauMEtMt", &hadTauMEtMt, &b_hadTauMEtMt); fChain->SetBranchAddress("elecMatched", &elecMatched, &b_elecMatched); fChain->SetBranchAddress("elecMotherId", &elecMotherId, &b_elecMotherId); fChain->SetBranchAddress("elecGenPt", &elecGenPt, &b_elecGenPt); fChain->SetBranchAddress("elecGenE", &elecGenE, &b_elecGenE); fChain->SetBranchAddress("elecGenEta", &elecGenEta, &b_elecGenEta); fChain->SetBranchAddress("elecGenPhi", &elecGenPhi, &b_elecGenPhi); fChain->SetBranchAddress("elecPt", &elecPt, &b_elecPt); fChain->SetBranchAddress("elecE", &elecE, &b_elecE); fChain->SetBranchAddress("elecEta", &elecEta, &b_elecEta); fChain->SetBranchAddress("elecPhi", &elecPhi, &b_elecPhi); fChain->SetBranchAddress("elecCharge", &elecCharge, &b_elecCharge); fChain->SetBranchAddress("elecDxyVtx", &elecDxyVtx, &b_elecDxyVtx); fChain->SetBranchAddress("elecDxyBS", &elecDxyBS, &b_elecDxyBS); fChain->SetBranchAddress("elecDxyError", &elecDxyError, &b_elecDxyError); fChain->SetBranchAddress("elecDzVtx", &elecDzVtx, &b_elecDzVtx); fChain->SetBranchAddress("elecDzBS", &elecDzBS, &b_elecDzBS); fChain->SetBranchAddress("elecDzError", &elecDzError, &b_elecDzError); fChain->SetBranchAddress("elecVx", &elecVx, &b_elecVx); fChain->SetBranchAddress("elecVy", &elecVy, &b_elecVy); fChain->SetBranchAddress("elecVz", &elecVz, &b_elecVz); fChain->SetBranchAddress("elecDEtaIn", &elecDEtaIn, &b_elecDEtaIn); fChain->SetBranchAddress("elecDPhiIn", &elecDPhiIn, &b_elecDPhiIn); fChain->SetBranchAddress("elecSigmaIEtaIEta", &elecSigmaIEtaIEta, &b_elecSigmaIEtaIEta); fChain->SetBranchAddress("elecHadOverE", &elecHadOverE, &b_elecHadOverE); fChain->SetBranchAddress("elecFbrem", &elecFbrem, &b_elecFbrem); fChain->SetBranchAddress("elecEOverPIn", &elecEOverPIn, &b_elecEOverPIn); fChain->SetBranchAddress("elecOneOverEMinusOneOverPIn", &elecOneOverEMinusOneOverPIn, &b_elecOneOverEMinusOneOverPIn); fChain->SetBranchAddress("elecMissingHits", &elecMissingHits, &b_elecMissingHits); fChain->SetBranchAddress("elecConversionRejection", &elecConversionRejection, &b_elecConversionRejection); fChain->SetBranchAddress("elecFiducialFlag", &elecFiducialFlag, &b_elecFiducialFlag); fChain->SetBranchAddress("elecPFIsoDR03SumChargedHadronPt", &elecPFIsoDR03SumChargedHadronPt, &b_elecPFIsoDR03SumChargedHadronPt); fChain->SetBranchAddress("elecPFIsoDR03SumNeutralHadronPt", &elecPFIsoDR03SumNeutralHadronPt, &b_elecPFIsoDR03SumNeutralHadronPt); fChain->SetBranchAddress("elecPFIsoDR03SumPhotonPt", &elecPFIsoDR03SumPhotonPt, &b_elecPFIsoDR03SumPhotonPt); fChain->SetBranchAddress("elecPFIsoDR03SumPUPt", &elecPFIsoDR03SumPUPt, &b_elecPFIsoDR03SumPUPt); fChain->SetBranchAddress("elecPFIsoDR04SumChargedHadronPt", &elecPFIsoDR04SumChargedHadronPt, &b_elecPFIsoDR04SumChargedHadronPt); fChain->SetBranchAddress("elecPFIsoDR04SumNeutralHadronPt", &elecPFIsoDR04SumNeutralHadronPt, &b_elecPFIsoDR04SumNeutralHadronPt); fChain->SetBranchAddress("elecPFIsoDR04SumPhotonPt", &elecPFIsoDR04SumPhotonPt, &b_elecPFIsoDR04SumPhotonPt); fChain->SetBranchAddress("elecPFIsoDR04SumPUPt", &elecPFIsoDR04SumPUPt, &b_elecPFIsoDR04SumPUPt); fChain->SetBranchAddress("elecIsoDR03SumPtTrk", &elecIsoDR03SumPtTrk, &b_elecIsoDR03SumPtTrk); fChain->SetBranchAddress("elecIsoDR03SumEtEcal", &elecIsoDR03SumEtEcal, &b_elecIsoDR03SumEtEcal); fChain->SetBranchAddress("_elecIsoDR03SumEtHcal", &_elecIsoDR03SumEtHcal, &b__elecIsoDR03SumEtHcal); fChain->SetBranchAddress("elecClass", &elecClass, &b_elecClass); fChain->SetBranchAddress("elecMVAStatus", &elecMVAStatus, &b_elecMVAStatus); fChain->SetBranchAddress("elecMVAOut", &elecMVAOut, &b_elecMVAOut); fChain->SetBranchAddress("elecMEtMt", &elecMEtMt, &b_elecMEtMt); fChain->SetBranchAddress("elecMetCosDPhi", &elecMetCosDPhi, &b_elecMetCosDPhi); fChain->SetBranchAddress("elecHadTauCosDPhi", &elecHadTauCosDPhi, &b_elecHadTauCosDPhi); fChain->SetBranchAddress("elecHadTauDelatR", &elecHadTauDelatR, &b_elecHadTauDelatR); fChain->SetBranchAddress("elecHadTauMass", &elecHadTauMass, &b_elecHadTauMass); fChain->SetBranchAddress("elecHadTauMetMass", &elecHadTauMetMass, &b_elecHadTauMetMass); fChain->SetBranchAddress("elecHadTauCollMass", &elecHadTauCollMass, &b_elecHadTauCollMass); fChain->SetBranchAddress("elecHadTauPZeta", &elecHadTauPZeta, &b_elecHadTauPZeta); fChain->SetBranchAddress("elecHadTauPZetaVis", &elecHadTauPZetaVis, &b_elecHadTauPZetaVis); fChain->SetBranchAddress("nVBFJets", &nVBFJets, &b_nVBFJets); fChain->SetBranchAddress("diJetMass", &diJetMass, &b_diJetMass); fChain->SetBranchAddress("diJetDEta", &diJetDEta, &b_diJetDEta); fChain->SetBranchAddress("jet1Pt", &jet1Pt, &b_jet1Pt); fChain->SetBranchAddress("jet1Eta", &jet1Eta, &b_jet1Eta); fChain->SetBranchAddress("jet2Pt", &jet2Pt, &b_jet2Pt); fChain->SetBranchAddress("jet2Eta", &jet2Eta, &b_jet2Eta); fChain->SetBranchAddress("elecDiJetMass", &elecDiJetMass, &b_elecDiJetMass); fChain->SetBranchAddress("hadTauDiJetMass", &hadTauDiJetMass, &b_hadTauDiJetMass); fChain->SetBranchAddress("elecTauDiJetMass", &elecTauDiJetMass, &b_elecTauDiJetMass); fChain->SetBranchAddress("maxDiJetDEta", &maxDiJetDEta, &b_maxDiJetDEta); fChain->SetBranchAddress("maxDiJetMass", &maxDiJetMass, &b_maxDiJetMass); fChain->SetBranchAddress("nJets", &nJets, &b_nJets); fChain->SetBranchAddress("jetEtSum", &jetEtSum, &b_jetEtSum); fChain->SetBranchAddress("nBtagsHiEffTrkCnt", &nBtagsHiEffTrkCnt, &b_nBtagsHiEffTrkCnt); fChain->SetBranchAddress("nBtagsHiPurityTrkCnt", &nBtagsHiPurityTrkCnt, &b_nBtagsHiPurityTrkCnt); fChain->SetBranchAddress("nBTagsCombSecVtxLoose", &nBTagsCombSecVtxLoose, &b_nBTagsCombSecVtxLoose); fChain->SetBranchAddress("nBTagsCombSecVtxMedium", &nBTagsCombSecVtxMedium, &b_nBTagsCombSecVtxMedium); fChain->SetBranchAddress("nBTagsCombSecVtxTight", &nBTagsCombSecVtxTight, &b_nBTagsCombSecVtxTight); Notify(); } Bool_t ElecTauAnalysis::Notify(){ // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. It is normally not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. return kTRUE; } void ElecTauAnalysis::Show(Long64_t entry){ // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t ElecTauAnalysis::Cut(Long64_t entry){ // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } bool ElecTauAnalysis::passedElecMatched(unsigned int theIndex){ return elecMatched->at(theIndex) > 0; } bool ElecTauAnalysis::passedTauMatched(unsigned int theIndex){ return hadTauMatched->at(theIndex) > 0; } bool ElecTauAnalysis::passedTrigger(){ return passedHLTElec27WP80; } bool ElecTauAnalysis::passedElecPtCut(unsigned int theIndex){ return elecPt->at(theIndex) > _minElecPtCut; } bool ElecTauAnalysis::elecInBarrel(unsigned int theIndex){ return elecFiducialFlag->at(theIndex) == 1; } bool ElecTauAnalysis::elecInEndCap(unsigned int theIndex){ return elecFiducialFlag->at(theIndex) == 2; } bool ElecTauAnalysis::elecInGaps(unsigned int theIndex){ return elecFiducialFlag->at(theIndex) == 3; } bool ElecTauAnalysis::passedElecEtaCut(unsigned int theIndex){ return fabs(elecEta->at(theIndex)) < _maxElecEtaCut && !elecInGaps(theIndex); } bool ElecTauAnalysis::passedElecAccCuts(unsigned int theIndex){ return passedElecPtCut(theIndex) && passedElecEtaCut(theIndex); } bool ElecTauAnalysis::passedElecDPhiIn(unsigned int theIndex){ bool passed = false; if(elecInBarrel(theIndex)) passed = fabs(elecDPhiIn->at(theIndex)) < _maxElecDPhiInEBCut; if(elecInEndCap(theIndex)) passed = fabs(elecDPhiIn->at(theIndex)) < _maxElecDPhiInEECut; return passed; } bool ElecTauAnalysis::passedElecDEtaIn(unsigned int theIndex){ bool passed = false; if(elecInBarrel(theIndex)) passed = fabs(elecDEtaIn->at(theIndex)) < _maxElecDEtaInEBCut; if(elecInEndCap(theIndex)) passed = fabs(elecDEtaIn->at(theIndex)) < _maxElecDEtaInEECut; return passed; } bool ElecTauAnalysis::passedElecSigmaIEtaIEta(unsigned int theIndex){ bool passed = false; if(elecInBarrel(theIndex)) passed = elecSigmaIEtaIEta->at(theIndex) < _maxElecSigmaIEtaIEtaEBCut; if(elecInEndCap(theIndex)) passed = elecSigmaIEtaIEta->at(theIndex) < _maxElecSigmaIEtaIEtaEECut; return passed; } bool ElecTauAnalysis::passedElecHOverE(unsigned int theIndex){ bool passed = false; if(elecInBarrel(theIndex)) passed = elecHadOverE->at(theIndex) < _maxElecHadFracEBCut; if(elecInEndCap(theIndex)) passed = elecHadOverE->at(theIndex) < _maxElecHadFracEECut; return passed; } bool ElecTauAnalysis::passedElecOneOverEMinusOneOverP(unsigned int theIndex){ bool passed = false; if(elecInBarrel(theIndex)) passed = fabs(elecOneOverEMinusOneOverPIn->at(theIndex)) < _maxOneOverEMinusOneOverPEBCut; if(elecInEndCap(theIndex)) passed = fabs(elecOneOverEMinusOneOverPIn->at(theIndex)) < _maxOneOverEMinusOneOverPEECut; return passed; } bool ElecTauAnalysis::passedElecDxyVtx(unsigned int theIndex){ return fabs(elecDxyVtx->at(theIndex)) < _maxElecDxyCut; } bool ElecTauAnalysis::passedElecDzVtx(unsigned int theIndex){ return fabs(elecDzVtx->at(theIndex)) < _maxElecDzCut; } bool ElecTauAnalysis::passedElecMissingHits(unsigned int theIndex){ return elecMissingHits->at(theIndex) <= _maxElecMissingHitsCut; } bool ElecTauAnalysis::passedElecPFRelIso(unsigned int theIndex){ float pfRelIso = 10.; double effArea = 0.; if(_source == "Data") effArea = getEffAreaData(theIndex); else effArea = getEffAreaMC(theIndex); if(_elecIsoDr == (double)0.3) pfRelIso = (elecPFIsoDR03SumChargedHadronPt->at(theIndex) + std::max(0., elecPFIsoDR03SumNeutralHadronPt->at(theIndex) + elecPFIsoDR03SumPhotonPt->at(theIndex) - elecRhoIso * effArea))/elecPt->at(theIndex); if(_elecIsoDr == (double)0.4) pfRelIso = (elecPFIsoDR04SumChargedHadronPt->at(theIndex) + std::max(0., elecPFIsoDR04SumNeutralHadronPt->at(theIndex) + elecPFIsoDR04SumPhotonPt->at(theIndex) - elecRhoIso * effArea))/elecPt->at(theIndex); if(_elecIsoDr == (double)0.3) pfRelIso = (elecPFIsoDR03SumChargedHadronPt->at(theIndex) + std::max(0., elecPFIsoDR03SumNeutralHadronPt->at(theIndex) + elecPFIsoDR03SumPhotonPt->at(theIndex) - 0.5*elecPFIsoDR03SumPUPt->at(theIndex)))/elecPt->at(theIndex); if(_elecIsoDr == (double)0.4) pfRelIso = (elecPFIsoDR04SumChargedHadronPt->at(theIndex) + std::max(0., elecPFIsoDR04SumNeutralHadronPt->at(theIndex) + elecPFIsoDR04SumPhotonPt->at(theIndex) - 0.5*elecPFIsoDR04SumPUPt->at(theIndex)))/elecPt->at(theIndex); return pfRelIso < _maxElecPFRelIsoCut; //return true; } double ElecTauAnalysis::getEffAreaData(unsigned int theIndex){ double effArea = 0.; if(_elecIsoDr == (double)0.3){ if(fabs(elecEta->at(theIndex)) >= 0 && fabs(elecEta->at(theIndex)) < 1.) effArea = 0.130; if(fabs(elecEta->at(theIndex)) >= 1 && fabs(elecEta->at(theIndex)) < 1.479) effArea = 0.137; if(fabs(elecEta->at(theIndex)) >= 1.479 && fabs(elecEta->at(theIndex)) < 2.) effArea = 0.067; if(fabs(elecEta->at(theIndex)) >= 2 && fabs(elecEta->at(theIndex)) < 2.2) effArea = 0.089; if(fabs(elecEta->at(theIndex)) >= 2.2 && fabs(elecEta->at(theIndex)) < 2.3) effArea = 0.107; if(fabs(elecEta->at(theIndex)) >= 2.3 && fabs(elecEta->at(theIndex)) < 2.4) effArea = 0.110; if(fabs(elecEta->at(theIndex)) >= 2.4) effArea = 0.138; } if(_elecIsoDr == (double)0.4){ if(fabs(elecEta->at(theIndex)) >= 0 && fabs(elecEta->at(theIndex)) < 1.) effArea = 0.208; if(fabs(elecEta->at(theIndex)) >= 1 && fabs(elecEta->at(theIndex)) < 1.479) effArea = 0.209; if(fabs(elecEta->at(theIndex)) >= 1.479 && fabs(elecEta->at(theIndex)) < 2.) effArea = 0.115; if(fabs(elecEta->at(theIndex)) >= 2 && fabs(elecEta->at(theIndex)) < 2.2) effArea = 0.143; if(fabs(elecEta->at(theIndex)) >= 2.2 && fabs(elecEta->at(theIndex)) < 2.3) effArea = 0.183; if(fabs(elecEta->at(theIndex)) >= 2.3 && fabs(elecEta->at(theIndex)) < 2.4) effArea = 0.194; if(fabs(elecEta->at(theIndex)) >= 2.4) effArea = 0.261; } return effArea; } double ElecTauAnalysis::getEffAreaMC(unsigned int theIndex){ double effArea = 0.; if(_elecIsoDr == (double)0.3){ if(fabs(elecEta->at(theIndex)) >= 0 && fabs(elecEta->at(theIndex)) < 1.) effArea = 0.110; if(fabs(elecEta->at(theIndex)) >= 1 && fabs(elecEta->at(theIndex)) < 1.479) effArea = 0.130; if(fabs(elecEta->at(theIndex)) >= 1.479 && fabs(elecEta->at(theIndex)) < 2.) effArea = 0.089; if(fabs(elecEta->at(theIndex)) >= 2 && fabs(elecEta->at(theIndex)) < 2.2) effArea = 0.130; if(fabs(elecEta->at(theIndex)) >= 2.2 && fabs(elecEta->at(theIndex)) < 2.3) effArea = 0.150; if(fabs(elecEta->at(theIndex)) >= 2.3 && fabs(elecEta->at(theIndex)) < 2.4) effArea = 0.160; if(fabs(elecEta->at(theIndex)) >= 2.4) effArea = 0.190; } if(_elecIsoDr == (double)0.4){ if(fabs(elecEta->at(theIndex)) >= 0 && fabs(elecEta->at(theIndex)) < 1.) effArea = 0.180; if(fabs(elecEta->at(theIndex)) >= 1 && fabs(elecEta->at(theIndex)) < 1.479) effArea = 0.210; if(fabs(elecEta->at(theIndex)) >= 1.479 && fabs(elecEta->at(theIndex)) < 2.) effArea = 0.160; if(fabs(elecEta->at(theIndex)) >= 2 && fabs(elecEta->at(theIndex)) < 2.2) effArea = 0.220; if(fabs(elecEta->at(theIndex)) >= 2.2 && fabs(elecEta->at(theIndex)) < 2.3) effArea = 0.270; if(fabs(elecEta->at(theIndex)) >= 2.3 && fabs(elecEta->at(theIndex)) < 2.4) effArea = 0.300; if(fabs(elecEta->at(theIndex)) >= 2.4) effArea = 0.410; } return effArea; } bool ElecTauAnalysis::passedElecMVAID(unsigned int theIndex){ bool passed = false; if(elecPt->at(theIndex) <= 20.){ if(fabs(elecEta->at(theIndex)) < 0.8) passed = elecMVAOut->at(theIndex) > 0.925; else if(fabs(elecEta->at(theIndex)) >= 0.8 && fabs(elecEta->at(theIndex)) < 1.479) passed = elecMVAOut->at(theIndex) > 0.915; else passed = elecMVAOut->at(theIndex) > 0.965; } else{ if(fabs(elecEta->at(theIndex)) < 0.8) passed = elecMVAOut->at(theIndex) > 0.925; else if(fabs(elecEta->at(theIndex)) >= 0.8 && fabs(elecEta->at(theIndex)) < 1.479) passed = elecMVAOut->at(theIndex) > 0.975; else passed = elecMVAOut->at(theIndex) > 0.985; } return passed; } bool ElecTauAnalysis::passedElecId(unsigned int theIndex){ return passedElecDPhiIn(theIndex) && passedElecDEtaIn(theIndex) && passedElecSigmaIEtaIEta(theIndex) && passedElecHOverE(theIndex) && passedElecOneOverEMinusOneOverP(theIndex) && passedElecDxyVtx(theIndex) && passedElecDzVtx(theIndex) && passedElecMissingHits(theIndex) && passedElecPFRelIso(theIndex); } bool ElecTauAnalysis::passedElecTauDR(unsigned int theIndex){ return elecHadTauDelatR->at(theIndex) > _minElecTauDRCut; } bool ElecTauAnalysis::passedHadTauMinPt(unsigned int theIndex){ if(_useAltLV) return hadTauAltLVPt->at(theIndex) > _minHadTauPtCut; else return hadTauPt->at(theIndex) > _minHadTauPtCut; } bool ElecTauAnalysis::passedHadTauMaxEta(unsigned int theIndex){ //need to remove taus in the gaps return fabs(hadTauEta->at(theIndex)) < _maxHadTauEtaCut && passedHadTauCrackVeto(theIndex); } bool ElecTauAnalysis::passedHadTauCrackVeto(unsigned int theIndex){ bool crackRegion = fabs(hadTauEta->at(theIndex)) < 0.018 || (fabs(hadTauEta->at(theIndex)) > 0.423 && fabs(hadTauEta->at(theIndex)) < 0.461) || (fabs(hadTauEta->at(theIndex)) > 0.770 && fabs(hadTauEta->at(theIndex)) < 0.806) || (fabs(hadTauEta->at(theIndex)) > 1.127 && fabs(hadTauEta->at(theIndex)) < 1.163) || (fabs(hadTauEta->at(theIndex)) > 1.460 && fabs(hadTauEta->at(theIndex)) < 1.558); return !crackRegion; } bool ElecTauAnalysis::passedHadTauAcc(unsigned int theIndex){ return passedHadTauMinPt(theIndex) && passedHadTauMaxEta(theIndex) && passedElecTauDR(theIndex); } bool ElecTauAnalysis::passedHadTauDecayModeFinding(unsigned int theIndex){ if(_hadTauIsoDiscType.find("Old") != std::string::npos) return hadTauIdByDecayModeFindingOldDMs->at(theIndex) > 0; else return hadTauIdByDecayModeFindingNewDMs->at(theIndex) > 0; } bool ElecTauAnalysis::passedTauNProngs(unsigned int theIndex){ if(_nProngs == "1Or3") return (hadTauNProngs->at(theIndex) == 1 || hadTauNProngs->at(theIndex) == 3); else if(_nProngs == "One") return hadTauNProngs->at(theIndex) == 1; else if(_nProngs == "Three") return hadTauNProngs->at(theIndex) == 3; else if(_nProngs == "none") return true; else return false; } bool ElecTauAnalysis::passedHadTauMuonDisc(unsigned int theIndex){ bool passed = false; if(_hadTauMuonDiscType == "Loose") passed = hadTauIdByLooseMuonRejection->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Medium") passed = hadTauIdByMediumMuonRejection->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Tight") passed = hadTauIdByTightMuonRejection->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Loose2") passed = hadTauIdByLooseMuonRejection2->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Medium2") passed = hadTauIdByMediumMuonRejection2->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Tight2") passed = hadTauIdByTightMuonRejection2->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Loose3") passed = hadTauIdByLooseMuonRejection3->at(theIndex) > 0; else if(_hadTauMuonDiscType == "Tight3") passed = hadTauIdByTightMuonRejection3->at(theIndex) > 0; else if(_hadTauMuonDiscType == "MVALoose") passed = hadTauIdByLooseMVAMuonRejection->at(theIndex) > 0; else if(_hadTauMuonDiscType == "MVAMedium") passed = hadTauIdByMediumMVAMuonRejection->at(theIndex) > 0; else if(_hadTauMuonDiscType == "MVATight") passed = hadTauIdByTightMVAMuonRejection->at(theIndex) > 0; else if(_hadTauMuonDiscType == "none") passed = true; else{ std::cout << _hadTauMuonDiscType << " is not a valid Muon Discriminator type\n"; exit (-1); } return passed; } bool ElecTauAnalysis::passedHadTauElecDisc(unsigned int theIndex){ bool passed = false; if(_hadTauElecDiscType == "Loose") passed = hadTauIdByLooseElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "Medium") passed = hadTauIdByMediumElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "Tight") passed = hadTauIdByTightElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "MVA5VLoose") passed = hadTauIdByMVA5VLooseElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "MVA5Loose") passed = hadTauIdByMVA5LooseElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "MVA5Medium") passed = hadTauIdByMVA5MediumElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "MVA5Tight") passed = hadTauIdByMVA5TightElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "MVA5VTight") passed = hadTauIdByMVA5VTightElectronRejection->at(theIndex) > 0; else if(_hadTauElecDiscType == "ReversedMVA5VLoose") passed = hadTauIdByMVA5VLooseElectronRejection->at(theIndex) < 0.5; else if(_hadTauElecDiscType == "ReversedLoose") passed = hadTauIdByLooseElectronRejection->at(theIndex) < 0.5; else if(_hadTauElecDiscType == "none") passed = true; else{ std::cout << _hadTauElecDiscType << " is not a valid Elec Discriminator type\n"; exit(-1); } return passed; } bool ElecTauAnalysis::passedHadTauIsoDisc(unsigned int theIndex){ bool passed = false; if(_hadTauIsoDiscType == "MVAVLooseWLt") passed = hadTauIdByVLooseIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVALooseWLt") passed = hadTauIdByLooseIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVAMediumWLt") passed = hadTauIdByMediumIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVATightWLt") passed = hadTauIdByTightIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVAVTightWLt") passed = hadTauIdByVTightIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVAVLooseWoLt") passed = hadTauIdByVLooseIsolationMVA3newDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVALooseWoLt") passed = hadTauIdByLooseIsolationMVA3newDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVAMediumWoLt") passed = hadTauIdByMediumIsolationMVA3newDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVATightWoLt") passed = hadTauIdByTightIsolationMVA3newDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVAVTightWoLt") passed = hadTauIdByVTightIsolationMVA3newDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVAVLooseWLt") passed = hadTauIdByVLooseIsolationMVA3oldDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVALooseWLt") passed = hadTauIdByLooseIsolationMVA3oldDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVAMediumWLt") passed = hadTauIdByMediumIsolationMVA3oldDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVATightWLt") passed = hadTauIdByTightIsolationMVA3oldDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVAVTightWLt") passed = hadTauIdByVTightIsolationMVA3oldDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVAVLooseWoLt") passed = hadTauIdByVLooseIsolationMVA3oldDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVALooseWoLt") passed = hadTauIdByLooseIsolationMVA3oldDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVAMediumWoLt") passed = hadTauIdByMediumIsolationMVA3oldDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVATightWoLt") passed = hadTauIdByTightIsolationMVA3oldDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "OldMVAVTightWoLt") passed = hadTauIdByVTightIsolationMVA3oldDMwoLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "LooseCombDB") passed = hadTauIdByLooseCombinedIsolationDBSumPtCorr->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MediumCombDB") passed = hadTauIdByMediumCombinedIsolationDBSumPtCorr->at(theIndex) > 0; else if(_hadTauIsoDiscType == "TightCombDB") passed = hadTauIdByTightCombinedIsolationDBSumPtCorr->at(theIndex) > 0; else if(_hadTauIsoDiscType == "LooseCombDB3Hits") passed = hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MediumCombDB3Hits") passed = hadTauIdByMediumCombinedIsolationDBSumPtCorr3Hits->at(theIndex) > 0; else if(_hadTauIsoDiscType == "TightCombDB3Hits") passed = hadTauIdByTightCombinedIsolationDBSumPtCorr3Hits->at(theIndex) > 0; else if(_hadTauIsoDiscType == "ReversedLooseCombDB3Hits") passed = hadTauIdByLooseCombinedIsolationDBSumPtCorr3Hits->at(theIndex) < 1; else if(_hadTauIsoDiscType == "ReversedLooseCombDB") passed = hadTauIdByLooseCombinedIsolationDBSumPtCorr->at(theIndex) < 1; else if(_hadTauIsoDiscType == "ReversedMVAVLooseWLt") passed = hadTauIdByVLooseIsolationMVA3newDMwLT->at(theIndex) < 1; else if(_hadTauIsoDiscType == "ReversedMVAVLooseWoLt") passed = hadTauIdByVLooseIsolationMVA3newDMwoLT->at(theIndex) < 1; else if(_hadTauIsoDiscType == "MVATWLtSB") passed = hadTauIdByTightIsolationMVA3newDMwoLT->at(theIndex) < 1 && hadTauIdByVLooseIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "MVAMWLtSB") passed = hadTauIdByMediumIsolationMVA3newDMwoLT->at(theIndex) < 1 && hadTauIdByVLooseIsolationMVA3newDMwLT->at(theIndex) > 0; else if(_hadTauIsoDiscType == "none") passed = true; else{ std::cout << _hadTauIsoDiscType << " is not a valid Tau Iso Discriminator\n"; exit(-1); } return passed; } bool ElecTauAnalysis::passedHadTauId(unsigned int theIndex){ return passedHadTauDecayModeFinding(theIndex) && passedTauNProngs(theIndex) && passedHadTauIsoDisc(theIndex) && passedHadTauMuonDisc(theIndex) && passedHadTauElecDisc(theIndex); } bool ElecTauAnalysis::passedElecTauCharge(unsigned int theIndex){ if(_tauChargeType == "TauChargeOS"){ return elecCharge->at(theIndex)*hadTauCharge->at(theIndex) < 0; } else if(_tauChargeType == "TauChargeLS"){ return elecCharge->at(theIndex)*hadTauCharge->at(theIndex) > 0; } else if(_tauChargeType == "LeadCandChargeOS"){ return elecCharge->at(theIndex)*hadTauLeadChargedCandCharge->at(theIndex) < 0; } else if(_tauChargeType == "LeadCandChargeLS"){ return elecCharge->at(theIndex)*hadTauLeadChargedCandCharge->at(theIndex) > 0; } else if(_tauChargeType == "none") return true; else return false; } bool ElecTauAnalysis::passedElecTauCosDPhi(unsigned int theIndex){ bool passed = elecHadTauCosDPhi->at(theIndex) <= _elecTauCosDPhiCut; if(_doWJetsCR == 2) return !passed; else return passed; } bool ElecTauAnalysis::passed2DZetaCut(unsigned int theIndex){ bool passed = elecHadTauPZeta->at(theIndex) - _zeta2DSlope*elecHadTauPZetaVis->at(theIndex) > _zeta2DCut; if(_doWJetsCR == 2) return !passed; else return passed; //return true; } bool ElecTauAnalysis::passedMET(){ bool passed = MEt > _minMEtCut; if(_doZEECR) return !passed; else return passed; } bool ElecTauAnalysis::passedBTagVeto(unsigned int theIndex){ if(_btaggingType == "TCHEM") return nBtagsHiEffTrkCnt->at(theIndex) < _nBTagsCut; else if(_btaggingType == "TCHPT") return nBtagsHiPurityTrkCnt->at(theIndex) < _nBTagsCut; else if(_btaggingType == "CSVL") return nBTagsCombSecVtxLoose->at(theIndex) < _nBTagsCut; else if(_btaggingType == "CSVM") return nBTagsCombSecVtxMedium->at(theIndex) < _nBTagsCut; else if(_btaggingType == "CSVT") return nBTagsCombSecVtxTight->at(theIndex) < _nBTagsCut; else if(_btaggingType == "ReversedCSVL") return nBTagsCombSecVtxLoose->at(theIndex) >= _nBTagsCut; else if(_btaggingType == "ReversedCSVM") return nBTagsCombSecVtxMedium->at(theIndex) >= _nBTagsCut; else if(_btaggingType == "ReversedCSVT") return nBTagsCombSecVtxTight->at(theIndex) >= _nBTagsCut; else if(_btaggingType == "ReversedJets") return nJets->at(theIndex) >= _nBTagsCut; else if(_btaggingType == "JetSumEt") return jetEtSum->at(theIndex) >= _nBTagsCut; else return false; } bool ElecTauAnalysis::passedWJetsVeto(unsigned int theIndex){ bool wjetsEvents = elecMEtMt->at(theIndex) < _elecMETMaxMassCut && elecMEtMt->at(theIndex) > _elecMETMinMassCut; if(_doWJetsCR == 1) return wjetsEvents; //else if(_doWJetsCR == 2) return true; else return true; //return true; } bool ElecTauAnalysis::passedZEEVeto(){ /* double zWidth = 2.4952; // GeV //bool isZEE = fabs(zMassDiff) < _zMassWidthCut * zWidth || fabs(zPtAsymm) < _zPtAsymmCut; bool isZEE = fabs(zMassDiff) + _zPtAsymmCut * fabs(zPtAsymm) <= _zMassWidthCut; if(_doZEECR) return isZEE; else return !isZEE; //return !zEvent; */ return true; } bool ElecTauAnalysis::passedElecTauMass(unsigned int theIndex){ //return elecHadTauMass->at(theIndex) <= _maxElecTauMassCut && elecHadTauMass->at(theIndex) >= _minElecTauMassCut; return elecHadTauMetMass->at(theIndex) <= _maxElecTauMassCut && elecHadTauMetMass->at(theIndex) >= _minElecTauMassCut; } bool ElecTauAnalysis::passedTopologyCuts(unsigned int theIndex){ return passedElecTauCharge(theIndex) && passedElecTauCosDPhi(theIndex) && passedZEEVeto() && passedMET() && passed2DZetaCut(theIndex) && passedBTagVeto(theIndex) && passedWJetsVeto(theIndex) && passedElecTauMass(theIndex); } bool ElecTauAnalysis::passedNVBFJets(unsigned int theIndex){ if(_doVBF) return jet1Pt->at(theIndex) > 0 && jet2Pt->at(theIndex) > 0; else return true; } bool ElecTauAnalysis::passedVBFJetsPt(unsigned int theIndex){ if(_doVBF) return jet1Pt->at(theIndex) > _vbfJet1PtCut && jet2Pt->at(theIndex) > _vbfJet2PtCut; else return true; } bool ElecTauAnalysis::passedDiJetDEta(unsigned int theIndex){ if(_doVBF) return diJetDEta->at(theIndex) >= _diJetDEtaCut; else return true; } bool ElecTauAnalysis::passedDiJetMass(unsigned int theIndex){ if(_doVBF) return diJetMass->at(theIndex) >= _minDiJetMassCut && diJetMass->at(theIndex) < _maxDiJetMassCut; else return true; } bool ElecTauAnalysis::passedVBFSel(unsigned int theIndex){ return passedNVBFJets(theIndex) && passedVBFJetsPt(theIndex) && passedDiJetDEta(theIndex) && passedDiJetMass(theIndex); } void ElecTauAnalysis::SetElecAccCuts(double minElecPtCut, double maxElecEtaCut){ _minElecPtCut = minElecPtCut; _maxElecEtaCut = maxElecEtaCut; } void ElecTauAnalysis::SetElecIdGlobalCuts(double maxElecDzCut, double maxElecDxyCut, int maxElecMissingHitsCut, double elecIsoDr, double maxElecPFRelIsoCut){ _maxElecDzCut = maxElecDzCut; _maxElecDxyCut = maxElecDxyCut; _maxElecMissingHitsCut = maxElecMissingHitsCut; _elecIsoDr = elecIsoDr; _maxElecPFRelIsoCut = maxElecPFRelIsoCut; } void ElecTauAnalysis::SetElecIdBarrelCuts(double maxElecDPhiInEBCut, double maxElecDEtaInEBCut, double maxElecSigmaIEtaIEtaEBCut, double maxElecHadFracEBCut, double maxOneOverEMinusOneOverPEBCut){ _maxElecDPhiInEBCut = maxElecDPhiInEBCut; _maxElecDEtaInEBCut = maxElecDEtaInEBCut; _maxElecSigmaIEtaIEtaEBCut = maxElecSigmaIEtaIEtaEBCut; _maxElecHadFracEBCut = maxElecHadFracEBCut; _maxOneOverEMinusOneOverPEBCut = maxOneOverEMinusOneOverPEBCut; } void ElecTauAnalysis::SetElecIdEndCapCuts(double maxElecDPhiInEECut, double maxElecDEtaInEECut, double maxElecSigmaIEtaIEtaEECut, double maxElecHadFracEECut, double maxOneOverEMinusOneOverPEECut){ _maxElecDPhiInEECut = maxElecDPhiInEECut; _maxElecDEtaInEECut = maxElecDEtaInEECut; _maxElecSigmaIEtaIEtaEECut = maxElecSigmaIEtaIEtaEECut; _maxElecHadFracEECut = maxElecHadFracEECut; _maxOneOverEMinusOneOverPEECut = maxOneOverEMinusOneOverPEECut; } void ElecTauAnalysis::SetHadTauAccCuts(double minElecTauDRCut, double minTauPtCut, double maxTauEtaCut, bool useAltLV){ _minElecTauDRCut = minElecTauDRCut; _minHadTauPtCut = minTauPtCut; _maxHadTauEtaCut = maxTauEtaCut; _useAltLV = useAltLV; } void ElecTauAnalysis::SetHadTauIdCuts(std::string tauMuonDiscType, std::string tauElecDiscType, std::string tauIsoDiscType, std::string tauNProngs){ _hadTauMuonDiscType = tauMuonDiscType; _hadTauElecDiscType = tauElecDiscType; _hadTauIsoDiscType = tauIsoDiscType; _nProngs = tauNProngs; } void ElecTauAnalysis::SetTopologyCuts(std::string chargeType, double minMET, std::string btagType, unsigned int btagCut, double elecTauCosDPhi, double pzetaSlope, double pzetaCut, double minElecTauMass, double maxElecTauMass){ _tauChargeType = chargeType; _minMEtCut = minMET; _btaggingType = btagType; _nBTagsCut = btagCut; _elecTauCosDPhiCut = elecTauCosDPhi; _zeta2DSlope = pzetaSlope; _zeta2DCut = pzetaCut; _maxElecTauMassCut = maxElecTauMass; _minElecTauMassCut = minElecTauMass; } void ElecTauAnalysis::SetWJetsVeto(unsigned int doWJetsCR, double elecMETMinMass, double elecMETMaxMass){ _doWJetsCR = doWJetsCR; _elecMETMinMassCut = elecMETMinMass; _elecMETMaxMassCut = elecMETMaxMass; } void ElecTauAnalysis::SetZEEVeto(double zMassWidthCut, double zPtAsymmCut, bool doZEECR){ _zMassWidthCut = zMassWidthCut; zPtAsymm = zPtAsymmCut; _doZEECR = doZEECR; } void ElecTauAnalysis::SetVBFJetsCuts(bool doVBFJets, double vbfJet1PtCut, double vbfJet2PtCut, double diJetDEtaCut, double minDiJetMassCut, double maxDiJetMassCut){ _doVBF = doVBFJets; _vbfJet1PtCut = vbfJet1PtCut; _vbfJet2PtCut = vbfJet2PtCut; _diJetDEtaCut = diJetDEtaCut; _minDiJetMassCut = minDiJetMassCut; _maxDiJetMassCut = maxDiJetMassCut; } void ElecTauAnalysis::SetSignalXSection(double theXSection){ _signalXSection = theXSection; } void ElecTauAnalysis::SetLumi(double theLumi){ _theLumi = theLumi; } void ElecTauAnalysis::SetNEvents(int nEvents){ _nEvents = nEvents; } void ElecTauAnalysis::SetSource(std::string theSource){ _source = theSource; } void ElecTauAnalysis::SetOutputLogFileName(std::string theLogfileName){ _outLogFile = theLogfileName; } void ElecTauAnalysis::SetOutputRootFileName(std::string theRootFileName){ _outRootFileName = theRootFileName; } void ElecTauAnalysis::SetPileupRootFile(std::string thePURootFileName){ _thePileUpRootFileName = thePURootFileName; } void ElecTauAnalysis::getEventCounters(){ if(_triggerCounter > 0) _nTriggers += _eventPUWeight; if(_elecMatchCounter > 0) _nElecMatched += _eventPUWeight; if(_tauMatchCounter > 0) _nTauMatched += _eventPUWeight; if(_elecPtCounter > 0) _nElecPt += _eventPUWeight; if(_elecEtaCounter > 0) _nElecEta += _eventPUWeight; if(_elecAccCounter > 0) _nElecAcc += _eventPUWeight; if(_elecDPhiInCounter > 0) _nElecDPhiIn += _eventPUWeight; if(_elecDEtaInCounter > 0) _nElecDEtaIn += _eventPUWeight; if(_elecSigmaIEtaIEtaCounter > 0) _nElecSigmaIEtaIEta += _eventPUWeight; if(_elecHadFracCounter > 0) _nElecHadFrac += _eventPUWeight; if(_elecEOverPCounter > 0) _nElecEOverP += _eventPUWeight; if(_elecDxyCounter > 0) _nElecDxy += _eventPUWeight; if(_elecDzCounter > 0) _nElecDz += _eventPUWeight; if(_elecMissHitsCounter > 0) _nElecMissHits += _eventPUWeight; if(_elecPFRelIsoCounter > 0) _nElecPFRelIso += _eventPUWeight; if(_elecIdCounter > 0) _nElecId += _eventPUWeight; if(_elecTauDRCounter > 0) _nElecTauDR += _eventPUWeight; if(_hadTauPtCounter > 0) _nHadTauPt += _eventPUWeight; if(_hadTauEtaCounter > 0) _nHadTauEta += _eventPUWeight; if(_hadTauAccCounter > 0) _nHadTauAcc += _eventPUWeight; if(_hadTauDecayModeCounter > 0) _nHadTauDecayMode += _eventPUWeight; if(_hadTauNProngsCounter > 0) _nHadTauNProngs += _eventPUWeight; if(_hadTauMuonDiscCounter > 0) _nHadTauMuonDisc += _eventPUWeight; if(_hadTauElecDiscCounter > 0) _nHadTauElecDisc += _eventPUWeight; if(_hadTauIsoDiscCounter > 0) _nHadTauIsoDisc += _eventPUWeight; if(_hadTauIdCounter > 0) _nHadTauId += _eventPUWeight; if(_zeeVetoCounter > 0) _nZEEVeto += _eventPUWeight; if(_elecHadTauChargeCounter > 0) _nElecHadTauCharge += _eventPUWeight; if(_elecHadTauCosDPhiCounter > 0) _nElecHadTauCosDPhi += _eventPUWeight; if(_elecHadTauPZetaCounter > 0) _nElecHadTauPZeta += _eventPUWeight; if(_metCounter > 0) _nMEt += _eventPUWeight; if(_bTagsCounter > 0) _nBTags += _eventPUWeight; if(_wjetsVetoCounter > 0) _nWJetsVeto += _eventPUWeight; if(_elecTauMassCounter > 0) _nElecTauMass += _eventPUWeight; if(_topologyCounter > 0) _nTopology += _eventPUWeight; if(_nVBFJetsCounter > 0) _nVBFJets += _eventPUWeight; if(_vbfJetsPtCounter > 0) _nVBFJetsPt += _eventPUWeight; if(_diJetDEtaCounter > 0) _nDiJetDEta += _eventPUWeight; if(_diJetMassCounter > 0) _nDiJetsMass += _eventPUWeight; if(_vbfCounter > 0) _nVBFSel += _eventPUWeight; if(_zeeCR1CentralCutsCounter > 0) _nZEECR1CentralCuts += _eventPUWeight; if(_zeeCR1OSCounter > 0) _nZEECR1OS += _eventPUWeight; if(_zeeCR1LSCounter > 0) _nZEECR1LS += _eventPUWeight; if(_zeeCR1METCounter > 0) _nZEECR1MET += _eventPUWeight; if(_zeeCR1VBFCounter > 0) _nZEECR1VBFSel += _eventPUWeight; if(_zeeCR2Counter > 0) _nZEECR2 += _eventPUWeight; if(_zeeCR2AntiElecDiscCounter > 0) _nZEECR2AntiElecDisc += _eventPUWeight; if(_zeeCR2ElecDiscCounter > 0) _nZEECR2ElecDisc += _eventPUWeight; if(_wjetsCR1Counter > 0) _nWJetsCR1 += _eventPUWeight; if(_wjetsCR1LSCounter > 0) _nWJetsCR1LS += _eventPUWeight; if(_wjetsCR1OSCounter > 0) _nWJetsCR1OS += _eventPUWeight; if(_wjetsCR1TauIsoCounter > 0) _nWJetsCR1TauIso += _eventPUWeight; if(_wjetsCR1VBFCounter > 0) _nWJetsCR1VBF += _eventPUWeight; if(_wjetsCR1ETauCosDPhiPZetaCounter > 0) _nWJetsCR1ElecTauCosDPhiPZeta += _eventPUWeight; if(_wjetsCR2Counter > 0) _nWJetsCR2 += _eventPUWeight; if(_wjetsCR2MtVetoCounter > 0) _nWJetsCR2MtVeto += _eventPUWeight; if(_wjetsCRCentralCutsCounter > 0) _nWJetsCRCentralCuts += _eventPUWeight; if(_ttbarCR1Counter > 0) _nTTbarCR1 += _eventPUWeight; if(_ttbarCR1LSCounter > 0) _nTTbarCR1LS += _eventPUWeight; if(_ttbarCR1OSCounter > 0) _nTTbarCR1OS += _eventPUWeight; if(_ttbarCR1ETauCosDPhiPZetaCounter > 0) _nTTbarCR1ElecTauCosDPhiPZeta += _eventPUWeight; if(_ttbarCR2Counter > 0) _nTTbarCR2 += _eventPUWeight; if(_ttbarCR2BtagVetoCounter > 0) _nTTbarCR2BtagVeto += _eventPUWeight; if(_ttbarCR2TwoBtagCounter > 0) _nTTbarCR2TwoBtag += _eventPUWeight; if(_ttbarCRVBFCounter > 0) _nTTbarVBFSel += _eventPUWeight; if(_qcdLSCounter > 0) _nQCDLSSel += _eventPUWeight; if(_qcdRevTauIsoCounter > 0) _nQCDTauRevIso += _eventPUWeight; if(_qcdRevTauIsoLSCounter > 0) _nQCDTauRevIsoLS += _eventPUWeight; if(_qcdRevTauIsoOSCounter > 0) _nQCDTauRevIsoOS += _eventPUWeight; if(_zttCRCounter > 0) _nZTTCR += _eventPUWeight; if(_zttCRVBFCounter > 0) _nZTTCRVBF += _eventPUWeight; if(_hadTauTightIsoCounter > 0) _nTightTauIso += _eventPUWeight; if(_tightDiTauChargeCounter > 0) _nTightDiTauCharge += _eventPUWeight; // N-1 if(_nMinus1ElecPtCounter > 0) _nMinus1ElecPt += _eventPUWeight; if(_nMinus1ElecEtaCounter > 0) _nMinus1ElecEta += _eventPUWeight; if(_nMinus1ElecDPhiInCounter > 0) _nMinus1ElecDPhiIn += _eventPUWeight; if(_nMinus1ElecDEtaInCounter > 0) _nMinus1ElecDEtaIn += _eventPUWeight; if(_nMinus1ElecSigmaIEtaIEtaCounter > 0) _nMinus1ElecSigmaIEtaIEta += _eventPUWeight; if(_nMinus1ElecHOverECounter > 0) _nMinus1ElecHOverE += _eventPUWeight; if(_nMinus1OneOverEMinusOneOverPCounter > 0) _nMinus1ElecOneOverEMinusOneOverP += _eventPUWeight; if(_nMinus1ElecDxyVtxCounter > 0) _nMinus1ElecDxy += _eventPUWeight; if(_nMinus1ElecDzVtxCounter > 0) _nMinus1ElecDz += _eventPUWeight; if(_nMinus1ElecMissHitsCounter > 0) _nMinus1ElecMissHits += _eventPUWeight; if(_nMinus1ElecPFRelIsoCounter > 0) _nMinus1ElecPFRelIso += _eventPUWeight; if(_nMinus1ElecHadTauDRCounter > 0) _nMinus1ElecTauDR += _eventPUWeight; if(_nMinus1TauPtCounter > 0) _nMinus1TauPt += _eventPUWeight; if(_nMinus1TauEtaCounter > 0) _nMinus1TauEta += _eventPUWeight; if(_nMinus1TauDecayModeCounter > 0) _nMinus1TauDecayMode += _eventPUWeight; if(_nMinus1TauNProngsCounter > 0) _nMinus1TauNProngs += _eventPUWeight; if(_nMinus1TauIsoCounter > 0) _nMinus1TauMuonDisc += _eventPUWeight; if(_nMinus1TauMuonDiscCounter > 0) _nMinus1TauElecDisc += _eventPUWeight; if(_nMinus1TauElecDiscCounter > 0) _nMinus1TauIso += _eventPUWeight; if(_nMinus1ElecTauChargeCounter > 0) _nMinus1ElecTauCharge += _eventPUWeight; if(_nMinus1ElecTauCosDPhiCounter > 0) _nMinus1ElecTauCosDPhi += _eventPUWeight; if(_nMinus1METCounter > 0) _nMinus1MEt += _eventPUWeight; if(_nMinus1PZeta2DCounter > 0) _nMinus1PZeta2D += _eventPUWeight; if(_nMinus1NBtagsCounter > 0) _nMinus1BTags += _eventPUWeight; if(_nMinus1NVBFJetsCounter > 0) _nMinus1NVBFJets += _eventPUWeight; if(_nMinus1JetsPtCounter > 0) _nMinus1JetsPt += _eventPUWeight; if(_nMinus1DiJetDEtaCounter > 0) _nMinus1DiJetDEta += _eventPUWeight; if(_nMinus1DiJetMassCounter > 0) _nMinus1DiJetMass += _eventPUWeight; } void ElecTauAnalysis::resetCandCounters(){ _triggerCounter = 0; _elecMatchCounter = 0; _tauMatchCounter = 0; _elecPtCounter = 0; _elecEtaCounter = 0; _elecAccCounter = 0; _elecDPhiInCounter = 0; _elecDEtaInCounter = 0; _elecSigmaIEtaIEtaCounter = 0; _elecHadFracCounter =0; _elecEOverPCounter = 0; _elecDxyCounter = 0; _elecDzCounter = 0; _elecMissHitsCounter = 0; _elecPFRelIsoCounter = 0; _elecIdCounter = 0; _elecTauDRCounter = 0; _hadTauPtCounter = 0; _hadTauEtaCounter = 0; _hadTauAccCounter = 0; _hadTauDecayModeCounter = 0; _hadTauNProngsCounter = 0; _hadTauMuonDiscCounter = 0; _hadTauElecDiscCounter = 0; _hadTauIsoDiscCounter = 0; _hadTauIdCounter = 0; _elecHadTauChargeCounter = 0; _elecHadTauCosDPhiCounter = 0; _elecHadTauPZetaCounter = 0; _zeeVetoCounter = 0; _metCounter = 0; _bTagsCounter = 0; _wjetsVetoCounter = 0; _elecTauMassCounter = 0; _topologyCounter = 0; _nVBFJetsCounter = 0; _vbfJetsPtCounter = 0; _diJetDEtaCounter = 0; _diJetMassCounter = 0; _vbfCounter = 0; _zeeCR1CentralCutsCounter = 0; _zeeCR1OSCounter = 0; _zeeCR1LSCounter = 0; _zeeCR1METCounter = 0; _zeeCR1VBFCounter = 0; _zeeCR2Counter = 0; _zeeCR2AntiElecDiscCounter = 0; _zeeCR2ElecDiscCounter = 0; _wjetsCR1Counter = 0; _wjetsCR1LSCounter = 0.; _wjetsCR1OSCounter = 0.; _wjetsCR1TauIsoCounter = 0.; _wjetsCR1VBFCounter = 0.; _wjetsCR1ETauCosDPhiPZetaCounter = 0; _wjetsCR2MtVetoCounter = 0; _wjetsCR2Counter = 0; _wjetsCRCentralCutsCounter = 0; _wjetsCRVBFCounter = 0; _ttbarCR1Counter = 0; _ttbarCR1LSCounter = 0; _ttbarCR1OSCounter = 0; _ttbarCR1ETauCosDPhiPZetaCounter = 0; _ttbarCR2Counter = 0; _ttbarCR2BtagVetoCounter = 0; _ttbarCR2TwoBtagCounter = 0; _ttbarCRVBFCounter = 0; _qcdLSCounter = 0; _qcdRevTauIsoCounter = 0; _qcdRevTauIsoLSCounter = 0; _qcdRevTauIsoOSCounter = 0; _zttCRCounter = 0; _zttCRVBFCounter = 0; _hadTauTightIsoCounter = 0; _tightDiTauChargeCounter = 0; _nMinus1ElecPtCounter = 0; _nMinus1ElecEtaCounter = 0; _nMinus1ElecDPhiInCounter = 0; _nMinus1ElecDEtaInCounter = 0; _nMinus1ElecSigmaIEtaIEtaCounter = 0; _nMinus1ElecHOverECounter = 0; _nMinus1OneOverEMinusOneOverPCounter = 0; _nMinus1ElecDxyVtxCounter = 0; _nMinus1ElecDzVtxCounter = 0; _nMinus1ElecMissHitsCounter = 0; _nMinus1ElecPFRelIsoCounter = 0; _nMinus1ElecHadTauDRCounter = 0; _nMinus1TauPtCounter = 0; _nMinus1TauEtaCounter = 0; _nMinus1TauDecayModeCounter = 0; _nMinus1TauNProngsCounter = 0; _nMinus1TauIsoCounter = 0; _nMinus1TauMuonDiscCounter = 0; _nMinus1TauElecDiscCounter = 0; _nMinus1ElecTauChargeCounter = 0; _nMinus1ElecTauCosDPhiCounter = 0; _nMinus1METCounter = 0; _nMinus1PZeta2DCounter = 0; _nMinus1NBtagsCounter = 0; _nMinus1NVBFJetsCounter = 0; _nMinus1JetsPtCounter = 0; _nMinus1DiJetDEtaCounter = 0; _nMinus1DiJetMassCounter = 0; } void ElecTauAnalysis::resetHistosDefault(){ _maxElecPt = -10.; _minElecEta = 10.; _minElecDPhiEB = 100.; _minElecDPhiEE = 100.; _minElecDEtaEB = 100.; _minElecDEtaEE = 100.; _minElecSigmaIEtaIEtaEB = 100.; _minElecSigmaIEtaIEtaEE = 100.; _minElecHOverEEB = 100.; _minElecHOverEEE = 100.; _minElecOneOverEMinusOneOverPEB = 100.; _minElecOneOverEMinusOneOverPEE = 100.; _minElecDxy = 100.; _minElecDz = 100.; _minElecMissHits = 10; _minElecPFRelIsoDR03 = 100.; _minElecPFRelIsoDR04 = 100.; _maxElecTauDR = -10.; _maxTauPt = -10.; _maxTauAltLVPt = -10.; _minTauEta = 10.; _maxTauDecayMode = -10; _maxTauNProngs = -10; _tauIsoDB = -10; _tauMVAIso = -10; _tauMuonDisc = -10; _tauElecDisc = -10; _tauMVA5ElecDisc = -10; _maxTauGenPtBeforeDecayMode = -10.; _maxTauGenPtAfterDecayMode = -10.; _maxTauGenPtAfterMuonDisc = -10.; _maxTauGenPtAfterElecDisc = -10.; _maxTauPtBeforeDecayMode = -10.; _maxTauPtAfterDecayMode = -10.; _maxTauPtAfterMuonDisc = -10.; _maxTauPtAfterElecDisc = -10.; _maxTauPtBeforeIso = -10.; _maxTauPtAfterIso = -10.; _maxTauGenPtBeforeIso = -10.; _maxTauGenPtAfterIso = -10.; _minElecTauCharge = 10; _minElecTauCosDPhi = 2.; _maxMET = -10.; _maxPZeta = -1000.; _minPZetaVis = 1000.; _minBtagsTCHEM = 10; _minBtagsTCHPT = 10; _minBtagsCSVL = 10; _minBtagsCSVM = 10; _minBtagsCSVT = 10; _minNJets = 20; _maxJetEtSum = -10.; _maxDiJetMass = -10.; _maxElecMETMass = -10.; _minElecMETCosDPhi = 10.; _maxVBFJets = -10; _maxElecTauMass = -10; _maxElecTauLSMass = -10; _maxElecTauMetMass = -10; _maxElecTauMetLSMass = -10; _minBtagsTCHEMTTJetsCR = 10; _minBtagsTCHPTTTJetsCR = 10; _minBtagsCSVLTTJetsCR = 10; _minBtagsCSVMTTJetsCR = 10; _minBtagsCSVTTTJetsCR = 10; _maxTauPtAfterAllCuts = -10.; _maxElecPtAfterAllCuts = -10.; _maxMETAfterAllCuts = -10.; _maxElecPtNMinus1 = -10.; _minElecEtaNMinus1 = 10.; _minElecDPhiEBNMinus1 = 100.; _minElecDPhiEENMinus1 = 100.; _minElecDEtaEBNMinus1 = 100.; _minElecDEtaEENMinus1 = 100.; _minElecSigmaIEtaIEtaEBNMinus1 = 100.; _minElecSigmaIEtaIEtaEENMinus1 = 100.; _minElecHOverEEBNMinus1 = 100.; _minElecHOverEEENMinus1 = 100.; _minElecOneOverEMinusOneOverPEBNMinus1 = 100.; _minElecOneOverEMinusOneOverPEENMinus1 = 100.; _minElecDxyNMinus1 = 100.; _minElecDzNMinus1 = 100.; _minElecMissHitsNMinus1 = 10; _minElecPFRelIsoDR03NMinus1 = 100.; _minElecPFRelIsoDR04NMinus1 = 100.; _maxElecTauDRNMinus1 = -10.; _maxTauPtNMinus1 = -10.; _maxTauAltLVPtNMinus1 = -10.; _minTauEtaNMinus1 = 10.; _maxTauDecayModeNMinus1 = -10; _maxTauNProngsNMinus1 = -10; _tauIsoDBNMinus1 = -10; _tauIsoDB3HitsNMinus1 = -10; //_tauMVAIsoNMinus1 = -10; _tauMuonDiscNMinus1 = -10; _tauElecDiscNMinus1 = -10; _tauMVA5ElecDiscNMinus1 = -10; _minElecTauChargeNMinus1 = 10; _minElecTauCosDPhiNMinus1 = 2.; _maxMETNMinus1 = -10.; _maxPZetaNMinus1 = -10.; _minPZetaVisNMinus1 = 1000.; _minBtagsTCHEMNMinus1 = 10; _minBtagsTCHPTNMinus1 = 10; _minBtagsCSVLNMinus1 = 10; _minBtagsCSVMNMinus1 = 10; _minBtagsCSVTNMinus1 = 10; _minNJetsNminus1 = 20; _maxJetEtSumNMinus1 = -10.; _maxNVBFJetsNMinus1 = -1; _maxJet1PtNMinus1 = -10.; _maxJet2PtNMinus1 = -10.; _maxDiJetDEtaNMinus1 = -10.; _maxDiJetMassNMinus1 = -10.; _maxTauPtTTbarCR1 = -10.; _maxTauPtTTbarCRNoTauId = -10.; _maxZEECRDiJetMass = -10.; _maxZTTCRDiJetMass = -10.; _maxWJetsCRDiJetMass = -10.; _maxTTJetsCRDiJetMass = -10.; } #endif // #ifdef ElecTauAnalysis_cxx