diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..60fd1be --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Analyzer/python/wsuciutils"] + path = Analyzer/python/wsuciutils + url = git@github.com:jsturdy/wsu-ci-analysis-tools.git diff --git a/Analyzer/plugins/BuildFile.xml b/Analyzer/plugins/BuildFile.xml index 570bc8e..12da09e 100755 --- a/Analyzer/plugins/BuildFile.xml +++ b/Analyzer/plugins/BuildFile.xml @@ -1,5 +1,9 @@ + + + + diff --git a/Analyzer/plugins/MakeZprimeMiniAodTree.cc b/Analyzer/plugins/MakeZprimeMiniAodTree.cc index b28f98b..a9c0c2b 100644 --- a/Analyzer/plugins/MakeZprimeMiniAodTree.cc +++ b/Analyzer/plugins/MakeZprimeMiniAodTree.cc @@ -69,7 +69,7 @@ #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" #include "DataFormats/MuonReco/interface/MuonCocktails.h" #include "DataFormats/Common/interface/RefCore.h" @@ -154,7 +154,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { // ----------member data --------------------------- // edm::EDGetTokenT rhoToken; edm::EDGetTokenT genInfoProductToken; - edm::EDGetTokenT EDMGenJetsToken_; + edm::EDGetTokenT EDMGenJetsToken_; edm::EDGetTokenT scProducer_; edm::EDGetTokenT vtxToken_; edm::EDGetTokenT muonToken_; @@ -230,7 +230,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { std::vector Ele_phiTrack; std::vector Ele_hadronicOverEm; std::vector Ele_deltaEtaInSeedCluster; - std::vector Ele_deltaPhiInSeedCluster; + std::vector Ele_deltaPhiInSeedCluster; std::vector Ele_deltaEtaInSC; std::vector Ele_deltaPhiInSC; std::vector Ele_sigmaIetaIeta; @@ -275,7 +275,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { std::vector Ele_hcalDepth2OverEcal; std::vector Ele_dr03HcalDepth2TowerSumEt; std::vector Ele_hcalDepth2TowerSumEtNoVeto; - std::vector Ele_hcalDepth1TowerSumEtNoVeto; + std::vector Ele_hcalDepth1TowerSumEtNoVeto; //------------- PF isolation from pat::ele ------------------------- std::vector Ele_pfSumPhotonEt; std::vector Ele_pfSumChargedHadronPt; @@ -290,9 +290,9 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { std::vector Ele_phiWidth; std::vector Ele_etaWidth; //============================================================= - // + // // Create Branchs for ecal rec hits - // + // //============================================================= std::vector ecaleb_rawId; std::vector ecalee_rawId; @@ -371,7 +371,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { std::vector Tau_id; std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits; //============================================================= - // + // // Create Branchs for PileUp tree // //============================================================= @@ -379,13 +379,13 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { int PU_BunchCrossing; int num_PU_gen_vertices; //============================================================= - // + // // Create Branch for Rho // //============================================================= float Rho; //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -410,7 +410,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { //=================================================== std::vector iGen; std::vector idGen; - std::vector statusGen; + std::vector statusGen; std::vector ptGen; std::vector etaGen; std::vector phiGen; @@ -448,7 +448,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { std::vector Mu_eta; std::vector Mu_phi; std::vector Mu_et; - std::vector Mu_charge; + std::vector Mu_charge; std::vector Mu_normalizedChi2; std::vector Mu_trackiso; std::vector Mu_numberOfMatchedStations; @@ -496,7 +496,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { std::vector Mu_absdz; std::vector Mu_patDeltaBeta; //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -514,7 +514,7 @@ class MakeZprimeMiniAodTree : public edm::EDAnalyzer { double PFMet_pt_uncor; double PFMet_phi_uncor; double PFMet_sumEt_uncor; - //The raw calo ETmiss + //The raw calo ETmiss double CaloMet_pt; double CaloMet_phi; double CaloMet_sumEt; @@ -578,7 +578,7 @@ MakeZprimeMiniAodTree::MakeZprimeMiniAodTree(const edm::ParameterSet& iConfig): eleTrkPtIso_(consumes >(iConfig.getParameter("eleTrkPtIsoLabel"))), outputFile_(iConfig.getParameter("outputFile")) { - rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms + rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms BosonID_ = iConfig.getParameter("GenBosonID"); ParticleID1_ = iConfig.getParameter("ParticleID1"); ParticleID2_ = iConfig.getParameter("ParticleID2"); @@ -612,7 +612,7 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("event_evtNo", &Event, "event_evtNo/I"); mytree->Branch("event_lumi", &lumi, "event_lumi/I"); mytree->Branch("event_bunch", &bunch, "event_bunch/I"); - + if(Analysis_== "ZprimeToMuMu"){ //=================================================== // @@ -642,7 +642,7 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("pxGen",&pxGen); mytree->Branch("pyGen",&pyGen); mytree->Branch("pzGen",&pzGen); - //============================================================= + //============================================================= // // Create Branchs for Muons variables // @@ -703,11 +703,11 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("Mu_nbofpv",&Mu_nbofpv); mytree->Branch("Mu_patDeltaBeta",&Mu_patDeltaBeta); //mytree->Branch("Mu_pfDeltaBeta",&Mu_pfDeltaBeta); - //============================================================= + //============================================================= // // Create Branchs for Muons match HLT variables // - //============================================================= + //============================================================= mytree->Branch("HLT_nb", &HLT_nb); mytree->Branch("HLT_name", &HLT_name); mytree->Branch("HLT_isaccept", &HLT_isaccept); @@ -717,7 +717,7 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("HLTObj_phi",&HLTObj_phi); mytree->Branch("HLTObj_collection", &HLTObj_collection); //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -731,7 +731,7 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D"); mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D"); mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D"); - //The raw calo ETmiss + //The raw calo ETmiss mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D"); mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D"); mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D"); @@ -744,9 +744,9 @@ void MakeZprimeMiniAodTree::beginJob() //mytree->Branch("METSign",&METSign,"METSign/D"); //============================================================= // - // Create Branches for jets variables + // Create Branches for jets variables // - //============================================================= + //============================================================= mytree->Branch("jet_nb",&jet_nb); mytree->Branch("jet_charge",&jet_charge); mytree->Branch("jet_et",&jet_et); @@ -759,9 +759,9 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc); //============================================================= // - // Create Branches for Btagging variables + // Create Branches for Btagging variables // - //============================================================= + //============================================================= mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators); mytree->Branch("jet_btag_pt",&jet_btag_pt); mytree->Branch("jet_btag_eta",&jet_btag_eta); @@ -795,21 +795,21 @@ void MakeZprimeMiniAodTree::beginJob() //mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart); //mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho); //============================================================= - // - // Create Branchs for PileUp tree + // + // Create Branchs for PileUp tree // //============================================================= mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I"); mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I"); mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I"); //============================================================= - // + // // Create Branch for Rho // //============================================================= mytree->Branch("Rho",&Rho,"Rho/F"); //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -897,12 +897,12 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("Ele_dr03TkSumPt",&Ele_dr03TkSumPt); mytree->Branch("Ele_dr03TkSumPt_corrected",&Ele_dr03TkSumPt_corrected); } - + if(Analysis_== "ZprimeToEE"){ - //============================================================= - // + //============================================================= + // // Create Branchs for ecal rec hits variables - // + // //============================================================= mytree->Branch("ecaleb_rawId",&ecaleb_rawId); mytree->Branch("ecaleb_iRechit",&ecaleb_iRechit); @@ -942,21 +942,21 @@ void MakeZprimeMiniAodTree::beginJob() mytree->Branch("PositionY",&PositionY); mytree->Branch("PositionZ",&PositionZ); //============================================================= - // - // Create Branchs for PileUp tree + // + // Create Branchs for PileUp tree // //============================================================= mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I"); mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I"); mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I"); //============================================================= - // + // // Create Branch for Rho // //============================================================= mytree->Branch("Rho",&Rho,"Rho/F"); //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -968,7 +968,7 @@ void MakeZprimeMiniAodTree::analyze(const edm::Event& iEvent, const edm::EventSe { //============================================== //= Begin of the main program = - //============================================== + //============================================== Run = iEvent.id().run(); Event = iEvent.id().event(); lumi = iEvent.luminosityBlock(); @@ -984,8 +984,8 @@ void MakeZprimeMiniAodTree::analyze(const edm::Event& iEvent, const edm::EventSe PatMuonTree(iEvent,iSetup); ComputeMuonMassVtx(iEvent,iSetup); accessGenInfo(iEvent,iSetup); - TriggerMatchingTree(iEvent,iSetup); - fillMET(iEvent); + TriggerMatchingTree(iEvent,iSetup); + fillMET(iEvent); JetsTree(iEvent,iSetup); GenJetTree(iEvent); ParticleFlowPhotonTree(iEvent,iSetup); @@ -996,16 +996,16 @@ void MakeZprimeMiniAodTree::analyze(const edm::Event& iEvent, const edm::EventSe TauTree(iEvent); PatElectronTree(iEvent,iSetup); } - - + + //============================================== //= End of the main program = - //============================================== + //============================================== mytree->Fill(); } // ------------ method called once each job just after ending the event loop ------------ -void MakeZprimeMiniAodTree::endJob() +void MakeZprimeMiniAodTree::endJob() { // go to *OUR* root file and store histograms rootFile_->cd(); @@ -1044,7 +1044,7 @@ bool MakeZprimeMiniAodTree::PrimaryVertex(const reco::VertexCollection &vertices // //============================================================= void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbElectrons = 0; Ele_rawId.clear(); Ele_nbElectrons.clear(); @@ -1066,7 +1066,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: Ele_phiTrack.clear(); Ele_hadronicOverEm.clear(); Ele_deltaEtaInSeedCluster.clear(); - Ele_deltaPhiInSeedCluster.clear(); + Ele_deltaPhiInSeedCluster.clear(); Ele_deltaEtaInSC.clear(); Ele_deltaPhiInSC.clear(); Ele_sigmaIetaIeta.clear(); @@ -1110,7 +1110,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: Ele_hcalDepth2OverEcal.clear(); Ele_dr03HcalDepth2TowerSumEt.clear(); Ele_hcalDepth2TowerSumEtNoVeto.clear(); - Ele_hcalDepth1TowerSumEtNoVeto.clear(); + Ele_hcalDepth1TowerSumEtNoVeto.clear(); Ele_pfSumPhotonEt.clear(); Ele_pfSumChargedHadronPt.clear(); Ele_pfSumNeutralHadronEt.clear(); @@ -1136,7 +1136,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: //------------ Rec Hits in EB ---------------- edm::Handle ecalEB; iEvent.getByToken(tok_EB_,ecalEB); - //------------ Rec Hits in EE ---------------- + //------------ Rec Hits in EE ---------------- edm::Handle ecalEE; iEvent.getByToken(tok_EE_,ecalEE); //------------ Rec Hits in ES ---------------- @@ -1151,21 +1151,21 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: edm::Handle> eleTrkPtIsoHandle_; iEvent.getByToken(eleTrkPtIso_,eleTrkPtIsoHandle_); std::auto_ptr lazyTools_; - lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); + lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); for (const pat::Electron &el : *electrons) { if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue; NbElectrons++; - Ele_nbElectrons.push_back(NbElectrons); + Ele_nbElectrons.push_back(NbElectrons); Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta())); Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta())); - Ele_pt.push_back(el.pt()); + Ele_pt.push_back(el.pt()); Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC - Ele_phiWidth.push_back(el.superCluster()->phiWidth()); - Ele_etaWidth.push_back(el.superCluster()->etaWidth()); + Ele_phiWidth.push_back(el.superCluster()->phiWidth()); + Ele_etaWidth.push_back(el.superCluster()->etaWidth()); Ele_energySC.push_back(el.superCluster()->energy()); //energy SC - Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); + Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); Ele_thetaTrack.push_back(el.p4().theta()); //theta track Ele_etaTrack.push_back(el.p4().eta()); //eta track Ele_phiTrack.push_back(el.p4().phi()); //phi track @@ -1186,7 +1186,7 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: Ele_e5x5.push_back(el.e5x5()); Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5()); Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5()); - Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); + Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max()); Ele_e1x5Full5x5.push_back(el.full5x5_e1x5()); Ele_e5x5Full5x5.push_back(el.full5x5_e5x5()); @@ -1212,29 +1212,29 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() ); Ele_nbVtx.push_back(vertices->size()); if(vertices->size()>0){ - Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); - Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); + Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); + Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); } else{ - Ele_dxy.push_back(el.gsfTrack()->dxy()); + Ele_dxy.push_back(el.gsfTrack()->dxy()); Ele_dz.push_back(el.gsfTrack()->dz()); } Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed()); Ele_isPassConversionVeto.push_back(el.passConversionVeto()); Ele_charge.push_back(el.gsfTrack()->charge()); Ele_rhoIso.push_back(rhoIso); - Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); + Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); Ele_fbrem.push_back(el.fbrem()); Ele_EoverP.push_back(el.eSeedClusterOverP()); - Ele_Xposition.push_back(el.caloPosition().x()); - Ele_Yposition.push_back(el.caloPosition().y()); + Ele_Xposition.push_back(el.caloPosition().x()); + Ele_Yposition.push_back(el.caloPosition().y()); //------------- detector isolation ------------------------- Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal()); Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal()); Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt()); - Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with + Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with // electron footprint removed - Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with + Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with // electron footprint removed Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt()); Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt()); @@ -1244,9 +1244,9 @@ void MakeZprimeMiniAodTree::PatElectronTree(const edm::Event& iEvent,const edm:: Ele_dr03TkSumPt_corrected.push_back((*eleTrkPtIsoHandle_).get(NbElectrons)); //------------- PF isolation from pat::ele ------------------------- Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt); - Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); + Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt); - Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); + Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); // do deltaBeta double charged = el.pfIsolationVariables().sumPhotonEt; double neutral = el.pfIsolationVariables().sumNeutralHadronEt; @@ -1276,7 +1276,7 @@ bool MakeZprimeMiniAodTree::isAncestor(const reco::Candidate* ancestor, const re } void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbGenMuons = 0; iGen.clear(); idGen.clear(); @@ -1292,12 +1292,12 @@ void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::Ev // Pruned particles are the one containing "important" stuff Handle > pruned; iEvent.getByToken(prunedGenToken_,pruned); - if (!(pruned.isValid())) return; + if (!(pruned.isValid())) return; // Packed particles are all the status 1, so usable to remake jets // The navigation from status 1 to pruned is possible (the other direction should be made by hand) Handle > packed; iEvent.getByToken(packedGenToken_,packed); - //let's try to find all status1 originating directly from a B meson decay + //let's try to find all status1 originating directly from a B meson decay for(size_t i=0; isize();i++){ //if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){ if(abs((*pruned)[i].pdgId()) < BosonID_){ @@ -1305,12 +1305,12 @@ void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::Ev //std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl; //std::cout << " found daugthers: " << std::endl; for(size_t j=0; jsize();j++){ - //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection + //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ; if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){ if( (*packed)[j].pt() < 20.0 ) continue; - if( fabs((*packed)[j].pdgId()) != ParticleID1_ && - fabs((*packed)[j].pdgId()) != ParticleID2_ && + if( fabs((*packed)[j].pdgId()) != ParticleID1_ && + fabs((*packed)[j].pdgId()) != ParticleID2_ && fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue; if( (*packed)[j].status() > ParticleStatus_ ) continue; NbGenMuons++; @@ -1330,13 +1330,13 @@ void MakeZprimeMiniAodTree::accessGenInfo(const edm::Event& iEvent,const edm::Ev } } } -//============================================================= +//============================================================= //// //// Method for ECAL Rec Hits Tree //// ////============================================================= void MakeZprimeMiniAodTree::EBecalRecHitsTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int nbRecHits = 0; ecaleb_iRechit.clear(); ecaleb_EnRecHit.clear(); @@ -1369,7 +1369,7 @@ void MakeZprimeMiniAodTree::EBecalRecHitsTree(const edm::Event& iEvent,const edm for(EcalRecHitCollection::const_iterator it = ebhits->begin(); it != ebhits->end(); ++it) { if( (*it).energy() < 10.0 ) continue; nbRecHits++; - EBDetId elementId = it->id() ; + EBDetId elementId = it->id() ; ecaleb_rawId.push_back(it->id().rawId()); ecaleb_iRechit.push_back(nbRecHits); ecaleb_EnRecHit.push_back( (*it).energy() ); @@ -1392,7 +1392,7 @@ void MakeZprimeMiniAodTree::EBecalRecHitsTree(const edm::Event& iEvent,const edm } } void MakeZprimeMiniAodTree::EEecalRecHitsTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int nbRecHits = 0; ecalee_iRechit.clear(); ecalee_EnRecHit.clear(); @@ -1447,7 +1447,7 @@ void MakeZprimeMiniAodTree::EEecalRecHitsTree(const edm::Event& iEvent,const edm // //============================================================= void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbTriggers = 0; int NbTriggerObj = 0; HLT_nb.clear(); @@ -1479,7 +1479,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" && names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" && names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" && - names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && + names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v1" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v2" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v3" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v4" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v5" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v6" && @@ -1500,11 +1500,11 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e //full_name = name; NbTriggers++; HLT_nb.push_back(NbTriggers); - HLT_name.push_back(names.triggerName(i)); + HLT_name.push_back(names.triggerName(i)); HLT_isaccept.push_back(triggerBits->accept(i)); - /*std::cout << "Trigger " << names.triggerName(i) << + /*std::cout << "Trigger " << names.triggerName(i) << ", prescale " << triggerPrescales->getPrescaleForIndex(i) << - ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") + ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") << std::endl;*/ } for (unsigned i = 0; i < trigobj_handle->size(); ++i) { @@ -1525,7 +1525,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" && pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" && pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" && - pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && + pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v1" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v2" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v3" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v4" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v5" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v6" && @@ -1543,7 +1543,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" ) continue; HLTObj_nbObj.push_back(NbTriggerObj); - HLTObj_pt.push_back(src.pt()); + HLTObj_pt.push_back(src.pt()); HLTObj_eta.push_back(src.eta()); HLTObj_phi.push_back(src.phi()); HLTObj_collection.push_back(pathnames[j]); @@ -1557,7 +1557,7 @@ void MakeZprimeMiniAodTree::TriggerMatchingTree(const edm::Event& iEvent,const e // //============================================================= void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons = 0; Mu_nbMuon.clear(); Mu_isTightMuon.clear(); @@ -1597,7 +1597,7 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe Mu_thetaTunePMuonBestTrack.clear(); Mu_chargeTunePMuonBestTrack.clear(); Mu_absdxyTunePMuonBestTrack.clear(); - Mu_absdzTunePMuonBestTrack.clear(); + Mu_absdzTunePMuonBestTrack.clear(); Mu_ptInnerTrack.clear(); Mu_dPToverPTInnerTrack.clear(); Mu_pxInnerTrack.clear(); @@ -1613,7 +1613,7 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe Mu_absdxy.clear(); Mu_absdz.clear(); Mu_patDeltaBeta.clear(); - // Get TransientTracks (for use in e.g. the vertex fit) for each of + // Get TransientTracks (for use in e.g. the vertex fit) for each of // the muon tracks, using e.g. the cocktail momentum. //edm::ESHandle ttkb; //es.get().get("TransientTrackBuilder", ttkb); @@ -1659,10 +1659,10 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack(); Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt()); Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt()); - Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track - Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track - Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track - Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector + Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track + Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track + Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track + Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta()); Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi()); Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta()); @@ -1675,12 +1675,12 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe Mu_eta.push_back(mu.eta()); Mu_phi.push_back(mu.phi()); Mu_charge.push_back(mu.charge()); - Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); + Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt()); - Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); - Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); - Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); - Mu_pInnerTrack.push_back(mu.innerTrack()->p()); + Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); + Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); + Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); + Mu_pInnerTrack.push_back(mu.innerTrack()->p()); Mu_etaInnerTrack.push_back(mu.innerTrack()->eta()); Mu_phiInnerTrack.push_back(mu.innerTrack()->phi()); Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta()); @@ -1713,7 +1713,7 @@ void MakeZprimeMiniAodTree::PatMuonTree(const edm::Event& evt,const edm::EventSe } } void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons1 = 0; int NbMuons2 = 0; int NbMuons3 = 0; @@ -1753,10 +1753,10 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm:: MuonBestTrack1 = mu.tunePMuonBestTrack(); //if(fabs(mu.innerTrack()->eta())<=1.2) MuonBestTrack1 = mu.tunePMuonBestTrack(); //else if(fabs(mu.innerTrack()->eta())>1.2) MuonBestTrack1 = mu.innerTrack(); - if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) - && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && + if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) + && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 && - mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && mu.numberOfMatchedStations()>1 ){ @@ -1777,10 +1777,10 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm:: //else if(fabs(mu2.innerTrack()->eta())>1.2) MuonBestTrack2 = mu2.innerTrack(); //cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl; if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue; - if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) - && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && + if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) + && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 && - mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && mu2.numberOfMatchedStations()>1 ){ @@ -1815,12 +1815,12 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm:: //if(fabs(mu3.innerTrack()->eta())<=1.2) MuonBestTrack3 = mu3.tunePMuonBestTrack(); //else if(fabs(mu3.innerTrack()->eta())>1.2) MuonBestTrack3 = mu3.innerTrack(); //cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl; - if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; - if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; - if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) - && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && + if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; + if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; + if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) + && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 && - mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && mu3.numberOfMatchedStations()>1 ){ @@ -1873,16 +1873,16 @@ void MakeZprimeMiniAodTree::ComputeMuonMassVtx(const edm::Event& evt,const edm:: } void MakeZprimeMiniAodTree::SuperClusterTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ using namespace edm; - // Get raw SuperClusters from the event + // Get raw SuperClusters from the event Handle pRawSuperClusters; - try { + try { iEvent.getByToken(scProducer_, pRawSuperClusters); } catch ( cms::Exception& ex ) { - edm::LogError("EgammaSCCorrectionMakerError") + edm::LogError("EgammaSCCorrectionMakerError") << "Error! can't get the rawSuperClusters "; - } + } // Create a pointer to the RecHits and raw SuperClusters const reco::SuperClusterCollection *rawClusters = pRawSuperClusters.product(); // Loop over raw clusters and make corrected ones @@ -1911,7 +1911,7 @@ void MakeZprimeMiniAodTree::PrimaryVertexTree(const edm::Event& iEvent,const edm PositionY.clear(); PositionZ.clear(); PositionRho.clear(); - edm::Handle pvHandle; + edm::Handle pvHandle; iEvent.getByToken(vtxToken_,pvHandle); const reco::VertexCollection &vertices = *pvHandle.product(); for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){ @@ -1936,41 +1936,41 @@ void MakeZprimeMiniAodTree::fillMET(const edm::Event& iEvent) iEvent.getByToken(metToken_, mets); const pat::MET &met = mets->front(); //[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections - //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. - //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how - //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction - //and uncertainties with the latest and greatest JEC. - //You can find instructions for each analysis release. + //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. + //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how + //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction + //and uncertainties with the latest and greatest JEC. + //You can find instructions for each analysis release. //[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign //the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X) //The default type1 corrected MET - PFMet_et_cor = met.et(); - PFMet_pt_cor = met.pt(); - PFMet_phi_cor = met.phi(); - PFMet_en_cor = met.energy(); - PFMet_px_cor = met.px(); - PFMet_py_cor = met.py(); - PFMet_pz_cor = met.pz(); + PFMet_et_cor = met.et(); + PFMet_pt_cor = met.pt(); + PFMet_phi_cor = met.phi(); + PFMet_en_cor = met.energy(); + PFMet_px_cor = met.px(); + PFMet_py_cor = met.py(); + PFMet_pz_cor = met.pz(); PFMet_sumEt_cor = met.sumEt(); //The Raw PF Met (un-corrected MET in CMSSW_7_4_12 or later, on 74X version 2 miniAODs) - /*PFMet_pt_uncor = met.uncorPt(); - PFMet_phi_uncor = met.uncorPhi(); - PFMet_en_uncor = met.uncorEnergy(); - PFMet_px_uncor = met.uncorPx(); - PFMet_py_uncor = met.uncorPy(); - PFMet_pz_uncor = met.uncorPz(); + /*PFMet_pt_uncor = met.uncorPt(); + PFMet_phi_uncor = met.uncorPhi(); + PFMet_en_uncor = met.uncorEnergy(); + PFMet_px_uncor = met.uncorPx(); + PFMet_py_uncor = met.uncorPy(); + PFMet_pz_uncor = met.uncorPz(); PFMet_sumEt_uncor = met.uncorSumEt(); //The Raw PF Met (un-corrected MET in CMSSW_7_4_11 or earlier, on 74X version 1 miniAODs) - PFMet_pt_uncor = met.uncorrectedPt(); - PFMet_phi_uncor = met.uncorrectedPhi(); + PFMet_pt_uncor = met.uncorrectedPt(); + PFMet_phi_uncor = met.uncorrectedPhi(); PFMet_sumEt_uncor = met.uncorrectedSumEt();*/ - //The raw calo ETmiss - CaloMet_pt = met.caloMETPt(); - CaloMet_phi = met.caloMETPhi(); + //The raw calo ETmiss + CaloMet_pt = met.caloMETPt(); + CaloMet_phi = met.caloMETPhi(); CaloMet_sumEt = met.caloMETSumEt(); PFMet_shiftedPt_JetEnUp = met.shiftedPt(pat::MET::JetEnUp); PFMet_shiftedPt_JetEnDown = met.shiftedPt(pat::MET::JetEnDown); - if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); + if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); /*edm::Handle metsighandle; iEvent.getByToken(theMETSignificance_, metsighandle); METSign=*metsighandle;*/ @@ -1982,7 +1982,7 @@ void MakeZprimeMiniAodTree::fillMET(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTree::GenJetTree(const edm::Event& iEvent) -{ +{ int NbGenJets = 0; iGenJet.clear(); idGenJet.clear(); @@ -1994,7 +1994,7 @@ void MakeZprimeMiniAodTree::GenJetTree(const edm::Event& iEvent) /**** GET GENJETS ****/ edm::Handle h_genjets; iEvent.getByToken( EDMGenJetsToken_,h_genjets ); - if (!(h_genjets.isValid())) return; + if (!(h_genjets.isValid())) return; std::vector const &genjets = *h_genjets; for(size_t i=0; i(*j.daughter(id)); if (dau.charge() == 0) continue; @@ -2062,7 +2062,7 @@ void MakeZprimeMiniAodTree::JetsTree(const edm::Event& iEvent,const edm::EventSe jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant")); } else continue; - } + } } //============================================================= // @@ -2084,7 +2084,7 @@ void MakeZprimeMiniAodTree::BtaggingTree(const edm::Event& iEvent) iEvent.getByToken(jetToken_, jets); // loop over jets for( auto jet = jets->begin(); jet != jets->end(); ++jet ) - { + { // fill discriminator variables int flavor = std::abs( jet->partonFlavour() ); for( const std::string &bDiscr : bDiscriminators_ ) @@ -2114,7 +2114,7 @@ void MakeZprimeMiniAodTree::BtaggingTree(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTree::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ pfphoton_size = 0; pfphoton_pt.clear(); pfphoton_eta.clear(); @@ -2164,7 +2164,7 @@ void MakeZprimeMiniAodTree::ParticleFlowPhotonTree(const edm::Event& iEvent,cons } } } -//madgraph MC samples reweighing +//madgraph MC samples reweighing void MakeZprimeMiniAodTree::EventsReWeighting(const edm::Event& evt){ MC_weighting.clear(); float EventWeight = 1.0; @@ -2242,8 +2242,8 @@ void MakeZprimeMiniAodTree::TauTree(const edm::Event& iEvent) [11] kKilled, // MC only flag: the channel is killed in the real detector [12] kTPSaturated, // the channel is in a region with saturated TP [13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0 - [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) - [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal + [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) + [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal [16] kHasSwitchToGain6, // at least one data frame is in G6 [17] kHasSwitchToGain1, // at least one data frame is in G1 [18] kUnknown // to ease the interface with functions returning flags. diff --git a/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc b/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc index 3bb07b2..73d6ab2 100644 --- a/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc +++ b/Analyzer/plugins/MakeZprimeMiniAodTreeHEEP.cc @@ -10,7 +10,7 @@ //corresponds to which which cutnr //this is fixed for a given ID (and can be different for each ID) //hence its hard coded -//also these headerfiles are intentionally completely standalone +//also these headerfiles are intentionally completely standalone //so you can easily include them in your analysis if you find them //useful #include "FWCore/Utilities/interface/InputTag.h" @@ -77,7 +77,7 @@ using namespace pat; #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" #include "DataFormats/MuonReco/interface/MuonCocktails.h" #include "DataFormats/Common/interface/RefCore.h" @@ -139,7 +139,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { static void globalEndJob(const NrPassFail* nrPassFail) { std::cout <<"nr eles pass "<nrPass<<" / "<nrPass+nrPassFail->nrFail< > eleToken_; // ----------member data --------------------------- // edm::EDGetTokenT rhoToken; edm::EDGetTokenT genInfoProductToken; - edm::EDGetTokenT EDMGenJetsToken_; + edm::EDGetTokenT EDMGenJetsToken_; edm::EDGetTokenT scProducer_; edm::EDGetTokenT vtxToken_; edm::EDGetTokenT muonToken_; @@ -237,7 +237,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { std::vector Ele_phiTrack; std::vector Ele_hadronicOverEm; std::vector Ele_deltaEtaInSeedCluster; - std::vector Ele_deltaPhiInSeedCluster; + std::vector Ele_deltaPhiInSeedCluster; std::vector Ele_deltaEtaInSC; std::vector Ele_deltaPhiInSC; std::vector Ele_sigmaIetaIeta; @@ -282,7 +282,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { std::vector Ele_hcalDepth2OverEcal; std::vector Ele_dr03HcalDepth2TowerSumEt; std::vector Ele_hcalDepth2TowerSumEtNoVeto; - std::vector Ele_hcalDepth1TowerSumEtNoVeto; + std::vector Ele_hcalDepth1TowerSumEtNoVeto; //------------- PF isolation from pat::ele ------------------------- std::vector Ele_pfSumPhotonEt; std::vector Ele_pfSumChargedHadronPt; @@ -360,7 +360,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { std::vector Tau_id; std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits; //============================================================= - // + // // Create Branchs for PileUp tree // //============================================================= @@ -368,13 +368,13 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { int PU_BunchCrossing; int num_PU_gen_vertices; //============================================================= - // + // // Create Branch for Rho // //============================================================= float Rho; //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -386,7 +386,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { //=================================================== std::vector iGen; std::vector idGen; - std::vector statusGen; + std::vector statusGen; std::vector ptGen; std::vector etaGen; std::vector phiGen; @@ -427,7 +427,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { std::vector Mu_eta; std::vector Mu_phi; std::vector Mu_et; - std::vector Mu_charge; + std::vector Mu_charge; std::vector Mu_normalizedChi2; std::vector Mu_trackiso; std::vector Mu_numberOfMatchedStations; @@ -477,7 +477,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { std::vector Mu_stationMask; std::vector Mu_numberOfMatchedRPCLayers; //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -495,7 +495,7 @@ class MakeZprimeMiniAodTreeHEEP : public edm::EDAnalyzer { double PFMet_pt_uncor; double PFMet_phi_uncor; double PFMet_sumEt_uncor; - //The raw calo ETmiss + //The raw calo ETmiss double CaloMet_pt; double CaloMet_phi; double CaloMet_sumEt; @@ -559,7 +559,7 @@ MakeZprimeMiniAodTreeHEEP::MakeZprimeMiniAodTreeHEEP(const edm::ParameterSet& iC bDiscriminators_(iConfig.getParameter >("bDiscriminators")), outputFile_(iConfig.getParameter("outputFile")) { - rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms + rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms BosonID_ = iConfig.getParameter("GenBosonID"); ParticleID1_ = iConfig.getParameter("ParticleID1"); ParticleID2_ = iConfig.getParameter("ParticleID2"); @@ -579,7 +579,7 @@ MakeZprimeMiniAodTreeHEEP::~MakeZprimeMiniAodTreeHEEP() // ------------ method called once each job just before starting event loop ------------ void MakeZprimeMiniAodTreeHEEP::beginJob() { - + // go to *OUR* rootfile and book histograms rootFile_->cd(); // Declare histograms @@ -677,11 +677,11 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() mytree->Branch("Ele_dr03TkSumPt_corrected",&Ele_dr03TkSumPt_corrected); mytree->Branch("Ele_nrSatCrys",&Ele_nrSatCrys); mytree->Branch("Ele_isPassHeepID",&Ele_isPassHeepID); - //============================================================= + //============================================================= // // Create Branchs for Muons match HLT variables // - //============================================================= + //============================================================= mytree->Branch("HLT_nb", &HLT_nb); mytree->Branch("HLT_name", &HLT_name); mytree->Branch("HLT_isaccept", &HLT_isaccept); @@ -718,7 +718,7 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() mytree->Branch("pxGen",&pxGen); mytree->Branch("pyGen",&pyGen); mytree->Branch("pzGen",&pzGen); - //============================================================= + //============================================================= // // Create Branchs for Muons variables // @@ -784,7 +784,7 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() mytree->Branch("Mu_stationMask",&Mu_stationMask); mytree->Branch("Mu_numberOfMatchedRPCLayers",&Mu_numberOfMatchedRPCLayers); //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -798,7 +798,7 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D"); mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D"); mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D"); - //The raw calo ETmiss + //The raw calo ETmiss mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D"); mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D"); mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D"); @@ -811,9 +811,9 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() //mytree->Branch("METSign",&METSign,"METSign/D"); //============================================================= // - // Create Branches for jets variables + // Create Branches for jets variables // - //============================================================= + //============================================================= mytree->Branch("jet_nb",&jet_nb); mytree->Branch("jet_charge",&jet_charge); mytree->Branch("jet_et",&jet_et); @@ -826,9 +826,9 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc); //============================================================= // - // Create Branches for Btagging variables + // Create Branches for Btagging variables // - //============================================================= + //============================================================= mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators); mytree->Branch("jet_btag_pt",&jet_btag_pt); mytree->Branch("jet_btag_eta",&jet_btag_eta); @@ -862,21 +862,21 @@ void MakeZprimeMiniAodTreeHEEP::beginJob() //mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart); //mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho); //============================================================= - // - // Create Branchs for PileUp tree + // + // Create Branchs for PileUp tree // //============================================================= mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I"); mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I"); mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I"); //============================================================= - // + // // Create Branch for Rho // //============================================================= mytree->Branch("Rho",&Rho,"Rho/F"); //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -899,7 +899,7 @@ void MakeZprimeMiniAodTreeHEEP::analyze(const edm::Event& iEvent, const edm::Eve { //============================================== //= Begin of the main program = - //============================================== + //============================================== Run = (unsigned int) iEvent.id().run(); Event = (unsigned int) iEvent.id().event(); lumi = (unsigned int) iEvent.luminosityBlock(); @@ -913,10 +913,10 @@ void MakeZprimeMiniAodTreeHEEP::analyze(const edm::Event& iEvent, const edm::Eve if( GoodPv == 0 ) return; //the aim of that command is to select only events PatElectronTree(iEvent,iSetup); PatMuonTree(iEvent,iSetup); - TriggerMatchingTree(iEvent,iSetup); + TriggerMatchingTree(iEvent,iSetup); ComputeMuonMassVtx(iEvent,iSetup); accessGenInfo(iEvent,iSetup); - fillMET(iEvent); + fillMET(iEvent); JetsTree(iEvent,iSetup); GenJetTree(iEvent); ParticleFlowPhotonTree(iEvent,iSetup); @@ -927,11 +927,11 @@ void MakeZprimeMiniAodTreeHEEP::analyze(const edm::Event& iEvent, const edm::Eve TauTree(iEvent); //============================================== //= End of the main program = - //============================================== + //============================================== mytree->Fill(); } // ------------ method called once each job just after ending the event loop ------------ -void MakeZprimeMiniAodTreeHEEP::endJob() +void MakeZprimeMiniAodTreeHEEP::endJob() { // go to *OUR* root file and store histograms rootFile_->cd(); @@ -969,7 +969,7 @@ bool MakeZprimeMiniAodTreeHEEP::PrimaryVertex(const reco::VertexCollection &vert // //============================================================= void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ unsigned int NbElectrons = -1 ; Ele_nbElectrons.clear(); Ele_dr03TkSumPt.clear(); @@ -993,7 +993,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e Ele_phiTrack.clear(); Ele_hadronicOverEm.clear(); Ele_deltaEtaInSeedCluster.clear(); - Ele_deltaPhiInSeedCluster.clear(); + Ele_deltaPhiInSeedCluster.clear(); Ele_deltaEtaInSC.clear(); Ele_deltaPhiInSC.clear(); Ele_sigmaIetaIeta.clear(); @@ -1035,7 +1035,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e Ele_hcalDepth2OverEcal.clear(); Ele_dr03HcalDepth2TowerSumEt.clear(); Ele_hcalDepth2TowerSumEtNoVeto.clear(); - Ele_hcalDepth1TowerSumEtNoVeto.clear(); + Ele_hcalDepth1TowerSumEtNoVeto.clear(); Ele_pfSumPhotonEt.clear(); Ele_pfSumChargedHadronPt.clear(); Ele_pfSumNeutralHadronEt.clear(); @@ -1063,17 +1063,17 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e //------------ Rec Hits in EB ---------------- edm::Handle ecalEB; iEvent.getByToken(tok_EB_,ecalEB); - //------------ Rec Hits in EE ---------------- + //------------ Rec Hits in EE ---------------- edm::Handle ecalEE; iEvent.getByToken(tok_EE_,ecalEE); std::auto_ptr lazyTools_; - lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); + lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); edm::Handle > eleHandle; iEvent.getByToken(eleToken_,eleHandle); for(auto& el : *eleHandle){ if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue; NbElectrons++; - Ele_nbElectrons.push_back(NbElectrons); + Ele_nbElectrons.push_back(NbElectrons); Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta())); Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta())); //================================================================ @@ -1098,14 +1098,14 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e // End New piece of code by Sam // //================================================================ - Ele_pt.push_back(el.pt()); + Ele_pt.push_back(el.pt()); Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC - Ele_phiWidth.push_back(el.superCluster()->phiWidth()); - Ele_etaWidth.push_back(el.superCluster()->etaWidth()); + Ele_phiWidth.push_back(el.superCluster()->phiWidth()); + Ele_etaWidth.push_back(el.superCluster()->etaWidth()); Ele_energySC.push_back(el.superCluster()->energy()); //energy SC - Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); + Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); Ele_thetaTrack.push_back(el.p4().theta()); //theta track Ele_etaTrack.push_back(el.p4().eta()); //eta track Ele_phiTrack.push_back(el.p4().phi()); //phi track @@ -1126,7 +1126,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e Ele_e5x5.push_back(el.e5x5()); Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5()); Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5()); - Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); + Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max()); Ele_e1x5Full5x5.push_back(el.full5x5_e1x5()); Ele_e5x5Full5x5.push_back(el.full5x5_e5x5()); @@ -1152,29 +1152,29 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() ); Ele_nbVtx.push_back(vertices->size()); if(vertices->size()>0){ - Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); - Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); + Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); + Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); } else{ - Ele_dxy.push_back(el.gsfTrack()->dxy()); + Ele_dxy.push_back(el.gsfTrack()->dxy()); Ele_dz.push_back(el.gsfTrack()->dz()); } Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed()); Ele_isPassConversionVeto.push_back(el.passConversionVeto()); Ele_charge.push_back(el.gsfTrack()->charge()); Ele_rhoIso.push_back(rhoIso); - Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); + Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); Ele_fbrem.push_back(el.fbrem()); Ele_EoverP.push_back(el.eSeedClusterOverP()); - Ele_Xposition.push_back(el.caloPosition().x()); - Ele_Yposition.push_back(el.caloPosition().y()); + Ele_Xposition.push_back(el.caloPosition().x()); + Ele_Yposition.push_back(el.caloPosition().y()); //------------- detector isolation ------------------------- Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal()); Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal()); Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt()); - Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with + Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with // electron footprint removed - Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with + Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with // electron footprint removed Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt()); Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt()); @@ -1182,16 +1182,16 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e Ele_dr03HcalDepth1TowerSumEtBc.push_back(el.dr03HcalDepth1TowerSumEtBc()); //------------- PF isolation from pat::ele ------------------------- Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt); - Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); + Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt); - Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); + Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); // do deltaBeta double charged = el.pfIsolationVariables().sumPhotonEt; double neutral = el.pfIsolationVariables().sumNeutralHadronEt; double pileup = el.pfIsolationVariables().sumPUPt; double deltaBeta = charged + std::max(0.0, neutral-0.5*pileup); Ele_pfDeltaBeta.push_back(deltaBeta); - } + } } //============================================================= // @@ -1199,7 +1199,7 @@ void MakeZprimeMiniAodTreeHEEP::PatElectronTree(const edm::Event& iEvent,const e // //============================================================= void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbTriggers = 0; int NbTriggerObj = 0; HLT_nb.clear(); @@ -1231,7 +1231,7 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" && names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" && names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" && - names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && + names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v1" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v2" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v3" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v4" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v5" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v6" && @@ -1251,17 +1251,17 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v3" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v4" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v5" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v6" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v7" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v8" && - names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" + names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" ) continue; //std::string const& name = names.triggerName(i); //full_name = name; NbTriggers++; HLT_nb.push_back(NbTriggers); - HLT_name.push_back(names.triggerName(i)); + HLT_name.push_back(names.triggerName(i)); HLT_isaccept.push_back(triggerBits->accept(i)); - /*std::cout << "Trigger " << names.triggerName(i) << + /*std::cout << "Trigger " << names.triggerName(i) << ", prescale " << triggerPrescales->getPrescaleForIndex(i) << - ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") + ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") << std::endl;*/ } for (unsigned i = 0; i < trigobj_handle->size(); ++i) { @@ -1282,7 +1282,7 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" && pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" && pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" && - pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && + pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v1" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v2" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v3" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v4" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v5" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v6" && @@ -1305,7 +1305,7 @@ void MakeZprimeMiniAodTreeHEEP::TriggerMatchingTree(const edm::Event& iEvent,con pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" ) continue; HLTObj_nbObj.push_back(NbTriggerObj); - HLTObj_pt.push_back(src.pt()); + HLTObj_pt.push_back(src.pt()); HLTObj_eta.push_back(src.eta()); HLTObj_phi.push_back(src.phi()); HLTObj_collection.push_back(pathnames[j]); @@ -1333,7 +1333,7 @@ bool MakeZprimeMiniAodTreeHEEP::isAncestor(const reco::Candidate* ancestor, cons } void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbGenMuons = 0; iGen.clear(); idGen.clear(); @@ -1349,12 +1349,12 @@ void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm // Pruned particles are the one containing "important" stuff Handle > pruned; iEvent.getByToken(prunedGenToken_,pruned); - if (!(pruned.isValid())) return; + if (!(pruned.isValid())) return; // Packed particles are all the status 1, so usable to remake jets // The navigation from status 1 to pruned is possible (the other direction should be made by hand) Handle > packed; iEvent.getByToken(packedGenToken_,packed); - //let's try to find all status1 originating directly from a B meson decay + //let's try to find all status1 originating directly from a B meson decay for(size_t i=0; isize();i++){ //if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){ if(abs((*pruned)[i].pdgId()) < BosonID_){ @@ -1362,12 +1362,12 @@ void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm //std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl; //std::cout << " found daugthers: " << std::endl; for(size_t j=0; jsize();j++){ - //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection + //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ; if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){ if( (*packed)[j].pt() < 20.0 ) continue; - if( fabs((*packed)[j].pdgId()) != ParticleID1_ && - fabs((*packed)[j].pdgId()) != ParticleID2_ && + if( fabs((*packed)[j].pdgId()) != ParticleID1_ && + fabs((*packed)[j].pdgId()) != ParticleID2_ && fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue; if( (*packed)[j].status() > ParticleStatus_ ) continue; NbGenMuons++; @@ -1393,7 +1393,7 @@ void MakeZprimeMiniAodTreeHEEP::accessGenInfo(const edm::Event& iEvent,const edm // //============================================================= void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons = 0; Mu_nbMuon.clear(); Mu_isTightMuon.clear(); @@ -1434,7 +1434,7 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_thetaTunePMuonBestTrack.clear(); Mu_chargeTunePMuonBestTrack.clear(); Mu_absdxyTunePMuonBestTrack.clear(); - Mu_absdzTunePMuonBestTrack.clear(); + Mu_absdzTunePMuonBestTrack.clear(); Mu_ptInnerTrack.clear(); Mu_dPToverPTInnerTrack.clear(); Mu_pxInnerTrack.clear(); @@ -1454,7 +1454,7 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_passOldMatchedStationsCut.clear(); Mu_stationMask.clear(); Mu_numberOfMatchedRPCLayers.clear(); - // Get TransientTracks (for use in e.g. the vertex fit) for each of + // Get TransientTracks (for use in e.g. the vertex fit) for each of // the muon tracks, using e.g. the cocktail momentum. //edm::ESHandle ttkb; //es.get().get("TransientTrackBuilder", ttkb); @@ -1503,10 +1503,10 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack(); Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt()); Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt()); - Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track - Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track - Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track - Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector + Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track + Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track + Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track + Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta()); Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi()); Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta()); @@ -1519,12 +1519,12 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_eta.push_back(mu.eta()); Mu_phi.push_back(mu.phi()); Mu_charge.push_back(mu.charge()); - Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); + Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt()); - Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); - Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); - Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); - Mu_pInnerTrack.push_back(mu.innerTrack()->p()); + Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); + Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); + Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); + Mu_pInnerTrack.push_back(mu.innerTrack()->p()); Mu_etaInnerTrack.push_back(mu.innerTrack()->eta()); Mu_phiInnerTrack.push_back(mu.innerTrack()->phi()); Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta()); @@ -1567,7 +1567,7 @@ void MakeZprimeMiniAodTreeHEEP::PatMuonTree(const edm::Event& evt,const edm::Eve } void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons1 = 0; int NbMuons2 = 0; int NbMuons3 = 0; @@ -1604,10 +1604,10 @@ void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const e if( !mu.globalTrack().isNonnull() ) continue; if( mu.isTrackerMuon()==false ) continue; MuonBestTrack1 = mu.tunePMuonBestTrack(); - if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) - && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && + if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) + && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 && - mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu.numberOfMatchedStations()>1 @@ -1627,10 +1627,10 @@ void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const e MuonBestTrack2 = mu2.tunePMuonBestTrack(); //cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl; if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue; - if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) - && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && + if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) + && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 && - mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu2.numberOfMatchedStations()>1 @@ -1664,12 +1664,12 @@ void MakeZprimeMiniAodTreeHEEP::ComputeMuonMassVtx(const edm::Event& evt,const e if( mu3.isTrackerMuon()==false ) continue; MuonBestTrack3 = mu3.tunePMuonBestTrack(); //cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl; - if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; - if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; - if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) - && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && + if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; + if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; + if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) + && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 && - mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu3.numberOfMatchedStations()>1 @@ -1736,7 +1736,7 @@ void MakeZprimeMiniAodTreeHEEP::PrimaryVertexTree(const edm::Event& iEvent,const PositionY.clear(); PositionZ.clear(); PositionRho.clear(); - edm::Handle pvHandle; + edm::Handle pvHandle; iEvent.getByToken(vtxToken_,pvHandle); const reco::VertexCollection &vertices = *pvHandle.product(); for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){ @@ -1761,41 +1761,41 @@ void MakeZprimeMiniAodTreeHEEP::fillMET(const edm::Event& iEvent) iEvent.getByToken(metToken_, mets); const pat::MET &met = mets->front(); //[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections - //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. - //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how - //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction - //and uncertainties with the latest and greatest JEC. - //You can find instructions for each analysis release. + //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. + //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how + //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction + //and uncertainties with the latest and greatest JEC. + //You can find instructions for each analysis release. //[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign //the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X) //The default type1 corrected MET - PFMet_et_cor = met.et(); - PFMet_pt_cor = met.pt(); - PFMet_phi_cor = met.phi(); - PFMet_en_cor = met.energy(); - PFMet_px_cor = met.px(); - PFMet_py_cor = met.py(); - PFMet_pz_cor = met.pz(); + PFMet_et_cor = met.et(); + PFMet_pt_cor = met.pt(); + PFMet_phi_cor = met.phi(); + PFMet_en_cor = met.energy(); + PFMet_px_cor = met.px(); + PFMet_py_cor = met.py(); + PFMet_pz_cor = met.pz(); PFMet_sumEt_cor = met.sumEt(); //The Raw PF Met (un-corrected MET in CMSSW_7_4_12 or later, on 74X version 2 miniAODs) - /*PFMet_pt_uncor = met.uncorPt(); - PFMet_phi_uncor = met.uncorPhi(); - PFMet_en_uncor = met.uncorEnergy(); - PFMet_px_uncor = met.uncorPx(); - PFMet_py_uncor = met.uncorPy(); - PFMet_pz_uncor = met.uncorPz(); + /*PFMet_pt_uncor = met.uncorPt(); + PFMet_phi_uncor = met.uncorPhi(); + PFMet_en_uncor = met.uncorEnergy(); + PFMet_px_uncor = met.uncorPx(); + PFMet_py_uncor = met.uncorPy(); + PFMet_pz_uncor = met.uncorPz(); PFMet_sumEt_uncor = met.uncorSumEt(); //The Raw PF Met (un-corrected MET in CMSSW_7_4_11 or earlier, on 74X version 1 miniAODs) - PFMet_pt_uncor = met.uncorrectedPt(); - PFMet_phi_uncor = met.uncorrectedPhi(); + PFMet_pt_uncor = met.uncorrectedPt(); + PFMet_phi_uncor = met.uncorrectedPhi(); PFMet_sumEt_uncor = met.uncorrectedSumEt();*/ - //The raw calo ETmiss - CaloMet_pt = met.caloMETPt(); - CaloMet_phi = met.caloMETPhi(); + //The raw calo ETmiss + CaloMet_pt = met.caloMETPt(); + CaloMet_phi = met.caloMETPhi(); CaloMet_sumEt = met.caloMETSumEt(); PFMet_shiftedPt_JetEnUp = met.shiftedPt(pat::MET::JetEnUp); PFMet_shiftedPt_JetEnDown = met.shiftedPt(pat::MET::JetEnDown); - if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); + if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); /*edm::Handle metsighandle; iEvent.getByToken(theMETSignificance_, metsighandle); METSign=*metsighandle;*/ @@ -1807,7 +1807,7 @@ void MakeZprimeMiniAodTreeHEEP::fillMET(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTreeHEEP::GenJetTree(const edm::Event& iEvent) -{ +{ int NbGenJets = 0; iGenJet.clear(); idGenJet.clear(); @@ -1819,7 +1819,7 @@ void MakeZprimeMiniAodTreeHEEP::GenJetTree(const edm::Event& iEvent) /**** GET GENJETS ****/ edm::Handle h_genjets; iEvent.getByToken( EDMGenJetsToken_,h_genjets ); - if (!(h_genjets.isValid())) return; + if (!(h_genjets.isValid())) return; std::vector const &genjets = *h_genjets; for(size_t i=0; i(*j.daughter(id)); if (dau.charge() == 0) continue; @@ -1887,7 +1887,7 @@ void MakeZprimeMiniAodTreeHEEP::JetsTree(const edm::Event& iEvent,const edm::Eve jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant")); } else continue; - } + } } //============================================================= // @@ -1909,7 +1909,7 @@ void MakeZprimeMiniAodTreeHEEP::BtaggingTree(const edm::Event& iEvent) iEvent.getByToken(jetToken_, jets); // loop over jets for( auto jet = jets->begin(); jet != jets->end(); ++jet ) - { + { // fill discriminator variables int flavor = std::abs( jet->partonFlavour() ); for( const std::string &bDiscr : bDiscriminators_ ) @@ -1939,7 +1939,7 @@ void MakeZprimeMiniAodTreeHEEP::BtaggingTree(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTreeHEEP::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ pfphoton_size = 0; pfphoton_pt.clear(); pfphoton_eta.clear(); @@ -1989,7 +1989,7 @@ void MakeZprimeMiniAodTreeHEEP::ParticleFlowPhotonTree(const edm::Event& iEvent, } } } -//madgraph MC samples reweighing +//madgraph MC samples reweighing void MakeZprimeMiniAodTreeHEEP::EventsReWeighting(const edm::Event& evt){ MC_weighting.clear(); float EventWeight = 1.0; @@ -2067,8 +2067,8 @@ void MakeZprimeMiniAodTreeHEEP::TauTree(const edm::Event& iEvent) [11] kKilled, // MC only flag: the channel is killed in the real detector [12] kTPSaturated, // the channel is in a region with saturated TP [13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0 - [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) - [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal + [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) + [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal [16] kHasSwitchToGain6, // at least one data frame is in G6 [17] kHasSwitchToGain1, // at least one data frame is in G1 [18] kUnknown // to ease the interface with functions returning flags. diff --git a/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc b/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc index fad62fe..4445c81 100644 --- a/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc +++ b/Analyzer/plugins/MakeZprimeMiniAodTreeMC.cc @@ -10,7 +10,7 @@ //corresponds to which which cutnr //this is fixed for a given ID (and can be different for each ID) //hence its hard coded -//also these headerfiles are intentionally completely standalone +//also these headerfiles are intentionally completely standalone //so you can easily include them in your analysis if you find them //useful #include "FWCore/Utilities/interface/InputTag.h" @@ -26,8 +26,12 @@ #include "HEEP/VID/interface/CutNrs.h" #include "HEEP/VID/interface/VIDCutCodes.h" //new by Sherif +// TFile Service +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" #include "TTree.h" -#include "TFile.h" +// #include "TTree.h" +// #include "TFile.h" using namespace std; using namespace edm; using namespace reco; @@ -77,7 +81,7 @@ using namespace pat; #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" #include "DataFormats/MuonReco/interface/MuonCocktails.h" #include "DataFormats/Common/interface/RefCore.h" @@ -139,7 +143,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { static void globalEndJob(const NrPassFail* nrPassFail) { std::cout <<"nr eles pass "<nrPass<<" / "<nrPass+nrPassFail->nrFail< > eleToken_; // ----------member data --------------------------- // edm::EDGetTokenT rhoToken; edm::EDGetTokenT genInfoProductToken; - edm::EDGetTokenT EDMGenJetsToken_; + edm::EDGetTokenT m_passMInvCutToken, m_passPreFSRMInvCutToken, m_passST1MInvCutToken, m_passST23MInvCutToken, m_passHSMInvCutToken; + edm::EDGetTokenT m_xsWeightToken; + edm::EDGetTokenT EDMGenJetsToken_; edm::EDGetTokenT scProducer_; edm::EDGetTokenT vtxToken_; edm::EDGetTokenT muonToken_; @@ -238,7 +244,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { std::vector Ele_phiTrack; std::vector Ele_hadronicOverEm; std::vector Ele_deltaEtaInSeedCluster; - std::vector Ele_deltaPhiInSeedCluster; + std::vector Ele_deltaPhiInSeedCluster; std::vector Ele_deltaEtaInSC; std::vector Ele_deltaPhiInSC; std::vector Ele_sigmaIetaIeta; @@ -283,7 +289,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { std::vector Ele_hcalDepth2OverEcal; std::vector Ele_dr03HcalDepth2TowerSumEt; std::vector Ele_hcalDepth2TowerSumEtNoVeto; - std::vector Ele_hcalDepth1TowerSumEtNoVeto; + std::vector Ele_hcalDepth1TowerSumEtNoVeto; //------------- PF isolation from pat::ele ------------------------- std::vector Ele_pfSumPhotonEt; std::vector Ele_pfSumChargedHadronPt; @@ -361,7 +367,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { std::vector Tau_id; std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits; //============================================================= - // + // // Create Branchs for PileUp tree // //============================================================= @@ -369,13 +375,13 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { int PU_BunchCrossing; int num_PU_gen_vertices; //============================================================= - // + // // Create Branch for Rho // //============================================================= float Rho; //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -387,7 +393,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { //=================================================== std::vector iGen; std::vector idGen; - std::vector statusGen; + std::vector statusGen; std::vector ptGen; std::vector etaGen; std::vector phiGen; @@ -407,6 +413,17 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { std::vector McZpy; std::vector McZpz; std::vector McZen; + //============================================================= + // + // Create tree variables for extra GEN level info + // + //============================================================= + double xsWeight; + bool passPreFSRMInvCut; + bool passMInvCut; + bool passST1MInvCut; + bool passST23MInvCut; + bool passHSMInvCut; //================================================== // // Create vectors for Muons variables @@ -427,7 +444,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { std::vector Mu_eta; std::vector Mu_phi; std::vector Mu_et; - std::vector Mu_charge; + std::vector Mu_charge; std::vector Mu_normalizedChi2; std::vector Mu_trackiso; std::vector Mu_numberOfMatchedStations; @@ -480,7 +497,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { std::vector Mu_stationMask; std::vector Mu_numberOfMatchedRPCLayers; //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -498,7 +515,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { double PFMet_pt_uncor; double PFMet_phi_uncor; double PFMet_sumEt_uncor; - //The raw calo ETmiss + //The raw calo ETmiss double CaloMet_pt; double CaloMet_phi; double CaloMet_sumEt; @@ -510,8 +527,8 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { double pfMETshiftedPtJetEnDn; double pfMETshiftedPtEleEnUp; double pfMETshiftedPtEleEnDn; - double pfMETshiftedPtMuEnUp; - double pfMETshiftedPtMuEnDn; + double pfMETshiftedPtMuEnUp; + double pfMETshiftedPtMuEnDn; double pfMETshiftedPtJetResUp; double pfMETshiftedPtJetResDn; double pfMETshiftedPtUnclEnUp; @@ -520,7 +537,7 @@ class MakeZprimeMiniAodTreeMC : public edm::EDAnalyzer { double pfMETshiftedPtPhoEnDn; //double pfMETshiftedPtJetEnUpSmear; //double pfMETshiftedPtJetEnDnSmear; - //double pfMETUncertaintySize; + //double pfMETUncertaintySize; //double pfMETFullUncertaintySize; //=================================================== // @@ -555,6 +572,12 @@ MakeZprimeMiniAodTreeMC::MakeZprimeMiniAodTreeMC(const edm::ParameterSet& iConfi eleToken_(consumes >(iConfig.getParameter("eles"))), rhoToken(consumes (edm::InputTag(std::string("fixedGridRhoFastjetAll")))), genInfoProductToken(consumes (edm::InputTag(std::string("generator")))), + m_passMInvCutToken(consumes(iConfig.getParameter("passMInvCutTag"))), + m_passPreFSRMInvCutToken(consumes(iConfig.getParameter("passPreFSRMInvCutTag"))), + m_passST1MInvCutToken(consumes(iConfig.getParameter("passST1MInvCutTag"))), + m_passST23MInvCutToken(consumes(iConfig.getParameter("passST23MInvCutTag"))), + m_passHSMInvCutToken(consumes(iConfig.getParameter("passHSMInvCutTag"))), + m_xsWeightToken(consumes(iConfig.getParameter("xsWeightTag"))), EDMGenJetsToken_(consumes(iConfig.getParameter("JetSource"))), scProducer_(consumes(iConfig.getParameter("scProducer"))), vtxToken_(consumes(iConfig.getParameter("vertices"))), @@ -579,7 +602,10 @@ MakeZprimeMiniAodTreeMC::MakeZprimeMiniAodTreeMC(const edm::ParameterSet& iConfi bDiscriminators_(iConfig.getParameter >("bDiscriminators")), outputFile_(iConfig.getParameter("outputFile")) { - rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms + edm::LogWarning("MakeZprimeMiniAodTreeMC::MakeZprimeMiniAodTreeMC") + << "Using outputFile named" << outputFile_; + + rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms BosonID_ = iConfig.getParameter("GenBosonID"); ParticleID1_ = iConfig.getParameter("ParticleID1"); ParticleID2_ = iConfig.getParameter("ParticleID2"); @@ -599,11 +625,13 @@ MakeZprimeMiniAodTreeMC::~MakeZprimeMiniAodTreeMC() // ------------ method called once each job just before starting event loop ------------ void MakeZprimeMiniAodTreeMC::beginJob() { - + // go to *OUR* rootfile and book histograms rootFile_->cd(); - // Declare histograms mytree = new TTree("tree","tr"); + // Better, use the TFileService for improved compatibility + // edm::Service< TFileService > fs; + // mytree = fs->make("tree","tr"); //============================================================= // // Create Branchs for Nb of event,run,lumi @@ -697,11 +725,11 @@ void MakeZprimeMiniAodTreeMC::beginJob() mytree->Branch("Ele_dr03TkSumPt_corrected",&Ele_dr03TkSumPt_corrected); mytree->Branch("Ele_nrSatCrys",&Ele_nrSatCrys); mytree->Branch("Ele_isPassHeepID",&Ele_isPassHeepID); - //============================================================= + //============================================================= // // Create Branchs for Muons match HLT variables // - //============================================================= + //============================================================= mytree->Branch("HLT_nb", &HLT_nb); mytree->Branch("HLT_name", &HLT_name); mytree->Branch("HLT_isaccept", &HLT_isaccept); @@ -738,9 +766,20 @@ void MakeZprimeMiniAodTreeMC::beginJob() mytree->Branch("pxGen",&pxGen); mytree->Branch("pyGen",&pyGen); mytree->Branch("pzGen",&pzGen); - //============================================================= + //============================================================= // - // Create Branchs for Muons variables + // Create Branches GEN level info + // + //============================================================= + mytree->Branch("xsWeight", &xsWeight); + mytree->Branch("passPreFSRMInvCut",&passPreFSRMInvCut); + mytree->Branch("passMInvCut", &passMInvCut); + mytree->Branch("passST1MInvCut",&passST1MInvCut); + mytree->Branch("passST23MInvCut",&passST23MInvCut); + mytree->Branch("passHSMInvCut",&passHSMInvCut); + //============================================================= + // + // Create Branchs for Muons variables // //============================================================= mytree->Branch("Mu_nbMuon",&Mu_nbMuon); @@ -807,7 +846,7 @@ void MakeZprimeMiniAodTreeMC::beginJob() mytree->Branch("Mu_vtxNormChi30GeV",&Mu_vtxNormChi30GeV); mytree->Branch("Mu_vtxMass30GeVLept",&Mu_vtxMass30GeVLept); //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -821,7 +860,7 @@ void MakeZprimeMiniAodTreeMC::beginJob() mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D"); mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D"); mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D"); - //The raw calo ETmiss + //The raw calo ETmiss mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D"); mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D"); mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D"); @@ -832,7 +871,7 @@ void MakeZprimeMiniAodTreeMC::beginJob() mytree->Branch("PFMet_phi_uncor", &PFMet_phi_uncor, "PFMet_phi_uncor/D"); mytree->Branch("PFMet_sumEt_uncor",&PFMet_sumEt_uncor,"PFMet_sumEt_uncor/D");*/ //mytree->Branch("METSign",&METSign,"METSign/D"); - + //Type I MET Uncertainties mytree->Branch("PFMet_METshiftedPtJetEnUp", &pfMETshiftedPtJetEnUp, "PFMet_METshiftedPtJetEnUp/D"); mytree->Branch("PFMet_METshiftedPtJetEnDn", &pfMETshiftedPtJetEnDn, "PFMet_METshiftedPtJetEnDn/D"); @@ -852,9 +891,9 @@ void MakeZprimeMiniAodTreeMC::beginJob() //mytree->Branch("PFMet_METFullUncertaintySize", &pfMETFullUncertaintySize, "PFMet_METFullUncertaintySize/D"); //============================================================= // - // Create Branches for jets variables + // Create Branches for jets variables // - //============================================================= + //============================================================= mytree->Branch("jet_nb",&jet_nb); mytree->Branch("jet_charge",&jet_charge); mytree->Branch("jet_et",&jet_et); @@ -867,9 +906,9 @@ void MakeZprimeMiniAodTreeMC::beginJob() mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc); //============================================================= // - // Create Branches for Btagging variables + // Create Branches for Btagging variables // - //============================================================= + //============================================================= mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators); mytree->Branch("jet_btag_pt",&jet_btag_pt); mytree->Branch("jet_btag_eta",&jet_btag_eta); @@ -903,21 +942,21 @@ void MakeZprimeMiniAodTreeMC::beginJob() //mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart); //mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho); //============================================================= - // - // Create Branchs for PileUp tree + // + // Create Branchs for PileUp tree // //============================================================= mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I"); mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I"); mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I"); //============================================================= - // + // // Create Branch for Rho // //============================================================= mytree->Branch("Rho",&Rho,"Rho/F"); //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -940,7 +979,7 @@ void MakeZprimeMiniAodTreeMC::analyze(const edm::Event& iEvent, const edm::Event { //============================================== //= Begin of the main program = - //============================================== + //============================================== Run = (unsigned int) iEvent.id().run(); Event = (unsigned int) iEvent.id().event(); lumi = (unsigned int) iEvent.luminosityBlock(); @@ -954,11 +993,11 @@ void MakeZprimeMiniAodTreeMC::analyze(const edm::Event& iEvent, const edm::Event if( GoodPv == 0 ) return; //the aim of that command is to select only events*/ PatElectronTree(iEvent,iSetup); PatMuonTree(iEvent,iSetup); - TriggerMatchingTree(iEvent,iSetup); + TriggerMatchingTree(iEvent,iSetup); ComputeMuonMassVtx(iEvent,iSetup); ComputeMuonMassVtx30GeV(iEvent,iSetup); accessGenInfo(iEvent,iSetup); - fillMET(iEvent); + fillMET(iEvent); JetsTree(iEvent,iSetup); GenJetTree(iEvent); ParticleFlowPhotonTree(iEvent,iSetup); @@ -969,11 +1008,11 @@ void MakeZprimeMiniAodTreeMC::analyze(const edm::Event& iEvent, const edm::Event TauTree(iEvent); //============================================== //= End of the main program = - //============================================== + //============================================== mytree->Fill(); } // ------------ method called once each job just after ending the event loop ------------ -void MakeZprimeMiniAodTreeMC::endJob() +void MakeZprimeMiniAodTreeMC::endJob() { // go to *OUR* root file and store histograms rootFile_->cd(); @@ -1011,7 +1050,7 @@ bool MakeZprimeMiniAodTreeMC::PrimaryVertex(const reco::VertexCollection &vertic // //============================================================= void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ unsigned int NbElectrons = -1 ; Ele_nbElectrons.clear(); Ele_dr03TkSumPt.clear(); @@ -1035,7 +1074,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm Ele_phiTrack.clear(); Ele_hadronicOverEm.clear(); Ele_deltaEtaInSeedCluster.clear(); - Ele_deltaPhiInSeedCluster.clear(); + Ele_deltaPhiInSeedCluster.clear(); Ele_deltaEtaInSC.clear(); Ele_deltaPhiInSC.clear(); Ele_sigmaIetaIeta.clear(); @@ -1077,7 +1116,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm Ele_hcalDepth2OverEcal.clear(); Ele_dr03HcalDepth2TowerSumEt.clear(); Ele_hcalDepth2TowerSumEtNoVeto.clear(); - Ele_hcalDepth1TowerSumEtNoVeto.clear(); + Ele_hcalDepth1TowerSumEtNoVeto.clear(); Ele_pfSumPhotonEt.clear(); Ele_pfSumChargedHadronPt.clear(); Ele_pfSumNeutralHadronEt.clear(); @@ -1105,17 +1144,17 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm //------------ Rec Hits in EB ---------------- edm::Handle ecalEB; iEvent.getByToken(tok_EB_,ecalEB); - //------------ Rec Hits in EE ---------------- + //------------ Rec Hits in EE ---------------- edm::Handle ecalEE; iEvent.getByToken(tok_EE_,ecalEE); std::auto_ptr lazyTools_; - lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); + lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); edm::Handle > eleHandle; iEvent.getByToken(eleToken_,eleHandle); for(auto& el : *eleHandle){ if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue; NbElectrons++; - Ele_nbElectrons.push_back(NbElectrons); + Ele_nbElectrons.push_back(NbElectrons); Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta())); Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta())); //================================================================ @@ -1140,14 +1179,14 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm // End New piece of code by Sam // //================================================================ - Ele_pt.push_back(el.pt()); + Ele_pt.push_back(el.pt()); Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC - Ele_phiWidth.push_back(el.superCluster()->phiWidth()); - Ele_etaWidth.push_back(el.superCluster()->etaWidth()); + Ele_phiWidth.push_back(el.superCluster()->phiWidth()); + Ele_etaWidth.push_back(el.superCluster()->etaWidth()); Ele_energySC.push_back(el.superCluster()->energy()); //energy SC - Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); + Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); Ele_thetaTrack.push_back(el.p4().theta()); //theta track Ele_etaTrack.push_back(el.p4().eta()); //eta track Ele_phiTrack.push_back(el.p4().phi()); //phi track @@ -1168,7 +1207,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm Ele_e5x5.push_back(el.e5x5()); Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5()); Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5()); - Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); + Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max()); Ele_e1x5Full5x5.push_back(el.full5x5_e1x5()); Ele_e5x5Full5x5.push_back(el.full5x5_e5x5()); @@ -1194,29 +1233,29 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() ); Ele_nbVtx.push_back(vertices->size()); if(vertices->size()>0){ - Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); - Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); + Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); + Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); } else{ - Ele_dxy.push_back(el.gsfTrack()->dxy()); + Ele_dxy.push_back(el.gsfTrack()->dxy()); Ele_dz.push_back(el.gsfTrack()->dz()); } Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed()); Ele_isPassConversionVeto.push_back(el.passConversionVeto()); Ele_charge.push_back(el.gsfTrack()->charge()); Ele_rhoIso.push_back(rhoIso); - Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); + Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); Ele_fbrem.push_back(el.fbrem()); Ele_EoverP.push_back(el.eSeedClusterOverP()); - Ele_Xposition.push_back(el.caloPosition().x()); - Ele_Yposition.push_back(el.caloPosition().y()); + Ele_Xposition.push_back(el.caloPosition().x()); + Ele_Yposition.push_back(el.caloPosition().y()); //------------- detector isolation ------------------------- Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal()); Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal()); Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt()); - Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with + Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with // electron footprint removed - Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with + Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with // electron footprint removed Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt()); Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt()); @@ -1224,16 +1263,16 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm Ele_dr03HcalDepth1TowerSumEtBc.push_back(el.dr03HcalDepth1TowerSumEtBc()); //------------- PF isolation from pat::ele ------------------------- Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt); - Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); + Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt); - Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); + Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); // do deltaBeta double charged = el.pfIsolationVariables().sumPhotonEt; double neutral = el.pfIsolationVariables().sumNeutralHadronEt; double pileup = el.pfIsolationVariables().sumPUPt; double deltaBeta = charged + std::max(0.0, neutral-0.5*pileup); Ele_pfDeltaBeta.push_back(deltaBeta); - } + } } //============================================================= // @@ -1241,7 +1280,7 @@ void MakeZprimeMiniAodTreeMC::PatElectronTree(const edm::Event& iEvent,const edm // //============================================================= void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbTriggers = 0; int NbTriggerObj = 0; HLT_nb.clear(); @@ -1283,7 +1322,7 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" && names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" && names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" && - names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && + names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v1" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v2" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v3" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v4" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v5" && names.triggerName(i) != "HLT_DoubleEle33_CaloIdL_MW_v6" && @@ -1303,17 +1342,17 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v3" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v4" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v5" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v6" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v7" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v8" && - names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" + names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && names.triggerName(i) != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" ) continue; //std::string const& name = names.triggerName(i); //full_name = name; NbTriggers++; HLT_nb.push_back(NbTriggers); - HLT_name.push_back(names.triggerName(i)); + HLT_name.push_back(names.triggerName(i)); HLT_isaccept.push_back(triggerBits->accept(i)); - /*std::cout << "Trigger " << names.triggerName(i) << + /*std::cout << "Trigger " << names.triggerName(i) << ", prescale " << triggerPrescales->getPrescaleForIndex(i) << - ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") + ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") << std::endl;*/ } for (unsigned i = 0; i < trigobj_handle->size(); ++i) { @@ -1344,7 +1383,7 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" && pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" && pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" && - pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && + pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v1" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v2" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v3" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v4" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v5" && pathnames[j] != "HLT_DoubleEle33_CaloIdL_MW_v6" && @@ -1367,7 +1406,7 @@ void MakeZprimeMiniAodTreeMC::TriggerMatchingTree(const edm::Event& iEvent,const pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v9" && pathnames[j] != "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v10" ) continue; HLTObj_nbObj.push_back(NbTriggerObj); - HLTObj_pt.push_back(src.pt()); + HLTObj_pt.push_back(src.pt()); HLTObj_eta.push_back(src.eta()); HLTObj_phi.push_back(src.phi()); HLTObj_collection.push_back(pathnames[j]); @@ -1395,7 +1434,7 @@ bool MakeZprimeMiniAodTreeMC::isAncestor(const reco::Candidate* ancestor, const } void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbGenMuons = 0; iGen.clear(); idGen.clear(); @@ -1408,15 +1447,91 @@ void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm:: pxGen.clear(); pyGen.clear(); pzGen.clear(); + + xsWeight = -1.; + passPreFSRMInvCut = false; + passMInvCut = false; + passST1MInvCut = false; + passST23MInvCut = false; + passHSMInvCut = false; + + edm::Handle h_passMInvCut; + edm::Handle h_passPreFSRMInvCut; + edm::Handle h_passST1MInvCut; + edm::Handle h_passST23MInvCut; + edm::Handle h_passHSMInvCut; + edm::Handle h_xsWeight; + + iEvent.getByToken(m_passMInvCutToken, h_passMInvCut); + iEvent.getByToken(m_passPreFSRMInvCutToken, h_passPreFSRMInvCut); + iEvent.getByToken(m_passST1MInvCutToken, h_passST1MInvCut); + iEvent.getByToken(m_passST23MInvCutToken, h_passST23MInvCut); + iEvent.getByToken(m_passHSMInvCutToken, h_passHSMInvCut); + iEvent.getByToken(m_xsWeightToken, h_xsWeight); + + if (h_xsWeight.isValid()) { + xsWeight = *h_xsWeight; + edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "xsWeight::" << *h_xsWeight; + } else { + edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "invalid handle to xsWeight"; + } + + if (h_passPreFSRMInvCut.isValid()) { + passPreFSRMInvCut = *h_passPreFSRMInvCut; + edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "passPreFSRMInvCut::" << *h_passPreFSRMInvCut; + } else { + edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "invalid handle to passPreFSRMInvCut"; + } + + if (h_passST1MInvCut.isValid()) { + passST1MInvCut = *h_passST1MInvCut; + edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "passST1MInvCut::" << *h_passST1MInvCut; + } else { + edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "invalid handle to passST1MInvCut"; + } + + if (h_passST23MInvCut.isValid()) { + passST23MInvCut = *h_passST23MInvCut; + edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "passST23MInvCut::" << *h_passST23MInvCut; + } else { + edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "invalid handle to passST23MInvCut"; + } + + if (h_passHSMInvCut.isValid()) { + passHSMInvCut = *h_passHSMInvCut; + edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "passHSMInvCut::" << *h_passHSMInvCut; + } else { + edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "invalid handle to passHSMInvCut"; + } + + if (h_passMInvCut.isValid()) { + passMInvCut = *h_passMInvCut; + edm::LogInfo("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "passMInvCut::" << *h_passMInvCut; + } else { + edm::LogWarning("MakeZprimeMiniAodTreeMC::accessGenInfo") + << "invalid handle to passMInvCut"; + } + // Pruned particles are the one containing "important" stuff Handle > pruned; iEvent.getByToken(prunedGenToken_,pruned); - if (!(pruned.isValid())) return; + if (!(pruned.isValid())) return; // Packed particles are all the status 1, so usable to remake jets // The navigation from status 1 to pruned is possible (the other direction should be made by hand) Handle > packed; iEvent.getByToken(packedGenToken_,packed); - //let's try to find all status1 originating directly from a B meson decay + //let's try to find all status1 originating directly from a B meson decay for(size_t i=0; isize();i++){ //if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){ if(abs((*pruned)[i].pdgId()) < BosonID_){ @@ -1424,12 +1539,12 @@ void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm:: //std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl; //std::cout << " found daugthers: " << std::endl; for(size_t j=0; jsize();j++){ - //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection + //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ; if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){ if( (*packed)[j].pt() < 20.0 ) continue; - if( fabs((*packed)[j].pdgId()) != ParticleID1_ && - fabs((*packed)[j].pdgId()) != ParticleID2_ && + if( fabs((*packed)[j].pdgId()) != ParticleID1_ && + fabs((*packed)[j].pdgId()) != ParticleID2_ && fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue; if( (*packed)[j].status() > ParticleStatus_ ) continue; NbGenMuons++; @@ -1455,7 +1570,7 @@ void MakeZprimeMiniAodTreeMC::accessGenInfo(const edm::Event& iEvent,const edm:: // //============================================================= void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons = 0; Mu_nbMuon.clear(); Mu_isTightMuon.clear(); @@ -1495,7 +1610,7 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event Mu_thetaTunePMuonBestTrack.clear(); Mu_chargeTunePMuonBestTrack.clear(); Mu_absdxyTunePMuonBestTrack.clear(); - Mu_absdzTunePMuonBestTrack.clear(); + Mu_absdzTunePMuonBestTrack.clear(); Mu_ptInnerTrack.clear(); Mu_dPToverPTInnerTrack.clear(); Mu_pxInnerTrack.clear(); @@ -1516,7 +1631,7 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event Mu_stationMask.clear(); Mu_numberOfMatchedRPCLayers.clear(); //Mu_isMuonsCleaned.clear(); - // Get TransientTracks (for use in e.g. the vertex fit) for each of + // Get TransientTracks (for use in e.g. the vertex fit) for each of // the muon tracks, using e.g. the cocktail momentum. //edm::ESHandle ttkb; //es.get().get("TransientTrackBuilder", ttkb); @@ -1563,10 +1678,10 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack(); Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt()); Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt()); - Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track - Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track - Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track - Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector + Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track + Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track + Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track + Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta()); Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi()); Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta()); @@ -1579,12 +1694,12 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event Mu_eta.push_back(mu.eta()); Mu_phi.push_back(mu.phi()); Mu_charge.push_back(mu.charge()); - Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); + Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt()); - Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); - Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); - Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); - Mu_pInnerTrack.push_back(mu.innerTrack()->p()); + Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); + Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); + Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); + Mu_pInnerTrack.push_back(mu.innerTrack()->p()); Mu_etaInnerTrack.push_back(mu.innerTrack()->eta()); Mu_phiInnerTrack.push_back(mu.innerTrack()->phi()); Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta()); @@ -1627,7 +1742,7 @@ void MakeZprimeMiniAodTreeMC::PatMuonTree(const edm::Event& evt,const edm::Event } void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons1 = 0; int NbMuons2 = 0; int NbMuons3 = 0; @@ -1664,10 +1779,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm if( !mu.globalTrack().isNonnull() ) continue; if( mu.isTrackerMuon()==false ) continue; MuonBestTrack1 = mu.tunePMuonBestTrack(); - if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) - && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && + if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) + && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 && - mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu.numberOfMatchedStations()>1 @@ -1687,10 +1802,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm MuonBestTrack2 = mu2.tunePMuonBestTrack(); //cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl; if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue; - if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) - && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && + if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) + && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 && - mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu2.numberOfMatchedStations()>1 @@ -1724,12 +1839,12 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm if( mu3.isTrackerMuon()==false ) continue; MuonBestTrack3 = mu3.tunePMuonBestTrack(); //cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl; - if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; - if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; - if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) - && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && + if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; + if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; + if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) + && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 && - mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu3.numberOfMatchedStations()>1 @@ -1783,7 +1898,7 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx(const edm::Event& evt,const edm } } void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons1 = 0; int NbMuons2 = 0; int NbMuons3 = 0; @@ -1820,10 +1935,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,cons if( !mu.globalTrack().isNonnull() ) continue; if( mu.isTrackerMuon()==false ) continue; MuonBestTrack1 = mu.tunePMuonBestTrack(); - if( MuonBestTrack1->pt()>30.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) - && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && + if( MuonBestTrack1->pt()>30.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) + && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 && - mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu.numberOfMatchedStations()>1 @@ -1839,10 +1954,10 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,cons if( mu2.isTrackerMuon()==false ) continue; MuonBestTrack2 = mu2.tunePMuonBestTrack(); if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue; - if( MuonBestTrack2->pt()>30.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) - && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && + if( MuonBestTrack2->pt()>30.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) + && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 && - mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu2.numberOfMatchedStations()>1 @@ -1868,12 +1983,12 @@ void MakeZprimeMiniAodTreeMC::ComputeMuonMassVtx30GeV(const edm::Event& evt,cons if( !mu3.globalTrack().isNonnull() ) continue; if( mu3.isTrackerMuon()==false ) continue; MuonBestTrack3 = mu3.tunePMuonBestTrack(); - if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; - if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; - if( MuonBestTrack3->pt()>30.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) - && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && + if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; + if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; + if( MuonBestTrack3->pt()>30.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) + && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 && - mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu3.numberOfMatchedStations()>1 @@ -1927,7 +2042,7 @@ void MakeZprimeMiniAodTreeMC::PrimaryVertexTree(const edm::Event& iEvent,const e PositionY.clear(); PositionZ.clear(); PositionRho.clear(); - edm::Handle pvHandle; + edm::Handle pvHandle; iEvent.getByToken(vtxToken_,pvHandle); const reco::VertexCollection &vertices = *pvHandle.product(); for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){ @@ -1952,21 +2067,21 @@ void MakeZprimeMiniAodTreeMC::fillMET(const edm::Event& iEvent) iEvent.getByToken(metToken_, mets); const pat::MET &met = mets->front(); //[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections - //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. - //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how - //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction - //and uncertainties with the latest and greatest JEC. - //You can find instructions for each analysis release. + //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. + //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how + //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction + //and uncertainties with the latest and greatest JEC. + //You can find instructions for each analysis release. //[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign //the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X) //The default type1 corrected MET - PFMet_et_cor = met.et(); - PFMet_pt_cor = met.pt(); - PFMet_phi_cor = met.phi(); - PFMet_en_cor = met.energy(); - PFMet_px_cor = met.px(); - PFMet_py_cor = met.py(); - PFMet_pz_cor = met.pz(); + PFMet_et_cor = met.et(); + PFMet_pt_cor = met.pt(); + PFMet_phi_cor = met.phi(); + PFMet_en_cor = met.energy(); + PFMet_px_cor = met.px(); + PFMet_py_cor = met.py(); + PFMet_pz_cor = met.pz(); PFMet_sumEt_cor = met.sumEt(); //Type I MET Uncertainties pfMETshiftedPtJetEnUp = met.shiftedPt(pat::MET::JetEnUp, pat::MET::Type1 ) ; @@ -1978,16 +2093,16 @@ void MakeZprimeMiniAodTreeMC::fillMET(const edm::Event& iEvent) pfMETshiftedPtJetResUp = met.shiftedPt(pat::MET::JetResUp, pat::MET::Type1 ) ; pfMETshiftedPtJetResDn = met.shiftedPt(pat::MET::JetResDown, pat::MET::Type1 ) ; pfMETshiftedPtUnclEnUp = met.shiftedPt(pat::MET::UnclusteredEnUp, pat::MET::Type1 ) ; - pfMETshiftedPtUnclEnDn = met.shiftedPt(pat::MET::UnclusteredEnDown, pat::MET::Type1 ) ; + pfMETshiftedPtUnclEnDn = met.shiftedPt(pat::MET::UnclusteredEnDown, pat::MET::Type1 ) ; pfMETshiftedPtPhoEnUp = met.shiftedPt(pat::MET::PhotonEnUp, pat::MET::Type1 ) ; - pfMETshiftedPtPhoEnDn = met.shiftedPt(pat::MET::PhotonEnDown, pat::MET::Type1 ) ; + pfMETshiftedPtPhoEnDn = met.shiftedPt(pat::MET::PhotonEnDown, pat::MET::Type1 ) ; //pfMETshiftedPtJetEnUpSmear = met.shiftedPhi(pat::MET::METUncertainty::JetResUpSmear); //pfMETshiftedPtJetEnDnSmear = met.shiftedPt(pat::MET::JetResDownSmear, pat::MET::Type1Smear ) ; //pfMETUncertaintySize = met.shiftedPt(pat::MET::METUncertaintySize, pat::MET::Type1 ) ; //pfMETFullUncertaintySize = met.shiftedPt(pat::MET::METFullUncertaintySize, pat::MET::Type1 ) ; //cout<<"jet smeared = "<pt(); + if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); /*edm::Handle metsighandle; iEvent.getByToken(theMETSignificance_, metsighandle); METSign=*metsighandle;*/ @@ -2025,7 +2140,7 @@ void MakeZprimeMiniAodTreeMC::fillMET(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTreeMC::GenJetTree(const edm::Event& iEvent) -{ +{ int NbGenJets = 0; iGenJet.clear(); idGenJet.clear(); @@ -2037,7 +2152,7 @@ void MakeZprimeMiniAodTreeMC::GenJetTree(const edm::Event& iEvent) /**** GET GENJETS ****/ edm::Handle h_genjets; iEvent.getByToken( EDMGenJetsToken_,h_genjets ); - if (!(h_genjets.isValid())) return; + if (!(h_genjets.isValid())) return; std::vector const &genjets = *h_genjets; for(size_t i=0; i(*j.daughter(id)); if (dau.charge() == 0) continue; @@ -2105,7 +2220,7 @@ void MakeZprimeMiniAodTreeMC::JetsTree(const edm::Event& iEvent,const edm::Event jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant")); } else continue; - } + } } //============================================================= // @@ -2127,7 +2242,7 @@ void MakeZprimeMiniAodTreeMC::BtaggingTree(const edm::Event& iEvent) iEvent.getByToken(jetToken_, jets); // loop over jets for( auto jet = jets->begin(); jet != jets->end(); ++jet ) - { + { // fill discriminator variables int flavor = std::abs( jet->partonFlavour() ); for( const std::string &bDiscr : bDiscriminators_ ) @@ -2157,7 +2272,7 @@ void MakeZprimeMiniAodTreeMC::BtaggingTree(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTreeMC::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ pfphoton_size = 0; pfphoton_pt.clear(); pfphoton_eta.clear(); @@ -2207,7 +2322,7 @@ void MakeZprimeMiniAodTreeMC::ParticleFlowPhotonTree(const edm::Event& iEvent,co } } } -//madgraph MC samples reweighing +//madgraph MC samples reweighing void MakeZprimeMiniAodTreeMC::EventsReWeighting(const edm::Event& evt){ MC_weighting.clear(); float EventWeight = 1.0; @@ -2285,8 +2400,8 @@ void MakeZprimeMiniAodTreeMC::TauTree(const edm::Event& iEvent) [11] kKilled, // MC only flag: the channel is killed in the real detector [12] kTPSaturated, // the channel is in a region with saturated TP [13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0 - [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) - [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal + [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) + [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal [16] kHasSwitchToGain6, // at least one data frame is in G6 [17] kHasSwitchToGain1, // at least one data frame is in G1 [18] kUnknown // to ease the interface with functions returning flags. diff --git a/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc b/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc index e7b8efb..ff14bbf 100644 --- a/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc +++ b/Analyzer/plugins/MakeZprimeMiniAodTreeMuon.cc @@ -10,7 +10,7 @@ //corresponds to which which cutnr //this is fixed for a given ID (and can be different for each ID) //hence its hard coded -//also these headerfiles are intentionally completely standalone +//also these headerfiles are intentionally completely standalone //so you can easily include them in your analysis if you find them //useful #include "FWCore/Utilities/interface/InputTag.h" @@ -77,7 +77,7 @@ using namespace pat; #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" #include "DataFormats/MuonReco/interface/MuonCocktails.h" #include "DataFormats/Common/interface/RefCore.h" @@ -139,7 +139,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { static void globalEndJob(const NrPassFail* nrPassFail) { std::cout <<"nr eles pass "<nrPass<<" / "<nrPass+nrPassFail->nrFail< > eleToken_; // ----------member data --------------------------- // edm::EDGetTokenT rhoToken; edm::EDGetTokenT genInfoProductToken; - edm::EDGetTokenT EDMGenJetsToken_; + edm::EDGetTokenT EDMGenJetsToken_; edm::EDGetTokenT scProducer_; edm::EDGetTokenT vtxToken_; edm::EDGetTokenT muonToken_; @@ -218,7 +218,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { // Create vectors for Electrons variables // //================================================== - + std::vector Ele_rawId; std::vector Ele_nbElectrons; std::vector Ele_isEcalDrivenSeed; @@ -239,7 +239,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { std::vector Ele_phiTrack; std::vector Ele_hadronicOverEm; std::vector Ele_deltaEtaInSeedCluster; - std::vector Ele_deltaPhiInSeedCluster; + std::vector Ele_deltaPhiInSeedCluster; std::vector Ele_deltaEtaInSC; std::vector Ele_deltaPhiInSC; std::vector Ele_sigmaIetaIeta; @@ -284,7 +284,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { std::vector Ele_hcalDepth2OverEcal; std::vector Ele_dr03HcalDepth2TowerSumEt; std::vector Ele_hcalDepth2TowerSumEtNoVeto; - std::vector Ele_hcalDepth1TowerSumEtNoVeto; + std::vector Ele_hcalDepth1TowerSumEtNoVeto; //------------- PF isolation from pat::ele ------------------------- std::vector Ele_pfSumPhotonEt; std::vector Ele_pfSumChargedHadronPt; @@ -300,7 +300,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { std::vector Ele_etaWidth; std::vector Ele_nrSatCrys; std::vector Ele_isPassHeepID; - + //============================================================= // // Create Branchs for Muons match HLT variables @@ -363,7 +363,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { std::vector Tau_id; std::vector Tau_LooseCombinedIsolationDeltaBetaCorr3Hits; //============================================================= - // + // // Create Branchs for PileUp tree // //============================================================= @@ -371,13 +371,13 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { int PU_BunchCrossing; int num_PU_gen_vertices; //============================================================= - // + // // Create Branch for Rho // //============================================================= float Rho; //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -389,7 +389,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { //=================================================== std::vector iGen; std::vector idGen; - std::vector statusGen; + std::vector statusGen; std::vector ptGen; std::vector etaGen; std::vector phiGen; @@ -429,7 +429,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { std::vector Mu_eta; std::vector Mu_phi; std::vector Mu_et; - std::vector Mu_charge; + std::vector Mu_charge; std::vector Mu_normalizedChi2; std::vector Mu_trackiso; std::vector Mu_numberOfMatchedStations; @@ -482,7 +482,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { std::vector Mu_stationMask; std::vector Mu_numberOfMatchedRPCLayers; //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -500,7 +500,7 @@ class MakeZprimeMiniAodTreeMuon : public edm::EDAnalyzer { double PFMet_pt_uncor; double PFMet_phi_uncor; double PFMet_sumEt_uncor; - //The raw calo ETmiss + //The raw calo ETmiss double CaloMet_pt; double CaloMet_phi; double CaloMet_sumEt; @@ -564,7 +564,7 @@ MakeZprimeMiniAodTreeMuon::MakeZprimeMiniAodTreeMuon(const edm::ParameterSet& iC bDiscriminators_(iConfig.getParameter >("bDiscriminators")), outputFile_(iConfig.getParameter("outputFile")) { - rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms + rootFile_ = TFile::Open(outputFile_.c_str(),"RECREATE"); // open output file to store histograms BosonID_ = iConfig.getParameter("GenBosonID"); ParticleID1_ = iConfig.getParameter("ParticleID1"); ParticleID2_ = iConfig.getParameter("ParticleID2"); @@ -584,7 +584,7 @@ MakeZprimeMiniAodTreeMuon::~MakeZprimeMiniAodTreeMuon() // ------------ method called once each job just before starting event loop ------------ void MakeZprimeMiniAodTreeMuon::beginJob() { - + // go to *OUR* rootfile and book histograms rootFile_->cd(); // Declare histograms @@ -684,11 +684,11 @@ void MakeZprimeMiniAodTreeMuon::beginJob() mytree->Branch("Ele_nrSatCrys",&Ele_nrSatCrys); mytree->Branch("Ele_isPassHeepID",&Ele_isPassHeepID); */ - //============================================================= + //============================================================= // // Create Branchs for Muons match HLT variables // - //============================================================= + //============================================================= mytree->Branch("HLT_nb", &HLT_nb); mytree->Branch("HLT_name", &HLT_name); mytree->Branch("HLT_isaccept", &HLT_isaccept); @@ -725,7 +725,7 @@ void MakeZprimeMiniAodTreeMuon::beginJob() mytree->Branch("pxGen",&pxGen); mytree->Branch("pyGen",&pyGen); mytree->Branch("pzGen",&pzGen); - //============================================================= + //============================================================= // // Create Branchs for Muons variables // @@ -794,7 +794,7 @@ void MakeZprimeMiniAodTreeMuon::beginJob() mytree->Branch("Mu_vtxNormChi30GeV",&Mu_vtxNormChi30GeV); mytree->Branch("Mu_vtxMass30GeVLept",&Mu_vtxMass30GeVLept); //============================================================= - // + // // Create Branches for PF MET // //============================================================= @@ -808,7 +808,7 @@ void MakeZprimeMiniAodTreeMuon::beginJob() mytree->Branch("PFMet_py_cor", &PFMet_py_cor, "PFMet_py_cor/D"); mytree->Branch("PFMet_pz_cor", &PFMet_pz_cor, "PFMet_pz_cor/D"); mytree->Branch("PFMet_sumEt_cor",&PFMet_sumEt_cor,"PFMet_sumEt_cor/D"); - //The raw calo ETmiss + //The raw calo ETmiss mytree->Branch("CaloMet_pt", &CaloMet_pt, "CaloMet_pt/D"); mytree->Branch("CaloMet_phi", &CaloMet_phi, "CaloMet_phi/D"); mytree->Branch("CaloMet_sumEt",&CaloMet_sumEt,"CaloMet_sumEt/D"); @@ -821,9 +821,9 @@ void MakeZprimeMiniAodTreeMuon::beginJob() //mytree->Branch("METSign",&METSign,"METSign/D"); //============================================================= // - // Create Branches for jets variables + // Create Branches for jets variables // - //============================================================= + //============================================================= mytree->Branch("jet_nb",&jet_nb); mytree->Branch("jet_charge",&jet_charge); mytree->Branch("jet_et",&jet_et); @@ -836,9 +836,9 @@ void MakeZprimeMiniAodTreeMuon::beginJob() mytree->Branch("jet_pileup_mva_disc",&jet_pileup_mva_disc); //============================================================= // - // Create Branches for Btagging variables + // Create Branches for Btagging variables // - //============================================================= + //============================================================= mytree->Branch("Nb_bDiscriminators",&Nb_bDiscriminators); mytree->Branch("jet_btag_pt",&jet_btag_pt); mytree->Branch("jet_btag_eta",&jet_btag_eta); @@ -872,21 +872,21 @@ void MakeZprimeMiniAodTreeMuon::beginJob() //mytree->Branch("pfphoton_PFPUchAllPart",&pfphoton_PFPUchAllPart); //mytree->Branch("pfphoton_pfphoton_PFX_rho",&pfphoton_pfphoton_PFX_rho); //============================================================= - // - // Create Branchs for PileUp tree + // + // Create Branchs for PileUp tree // //============================================================= mytree->Branch("num_PU_vertices",&num_PU_vertices,"num_PU_vertices/I"); mytree->Branch("PU_BunchCrossing",&PU_BunchCrossing,"PU_BunchCrossing/I"); mytree->Branch("num_PU_gen_vertices",&num_PU_gen_vertices,"num_PU_gen_vertices/I"); //============================================================= - // + // // Create Branch for Rho // //============================================================= mytree->Branch("Rho",&Rho,"Rho/F"); //============================================================= - // + // // Create Branch for events reweighting // //============================================================= @@ -909,7 +909,7 @@ void MakeZprimeMiniAodTreeMuon::analyze(const edm::Event& iEvent, const edm::Eve { //============================================== //= Begin of the main program = - //============================================== + //============================================== Run = (unsigned int) iEvent.id().run(); Event = (unsigned int) iEvent.id().event(); lumi = (unsigned int) iEvent.luminosityBlock(); @@ -923,11 +923,11 @@ void MakeZprimeMiniAodTreeMuon::analyze(const edm::Event& iEvent, const edm::Eve if( GoodPv == 0 ) return; //the aim of that command is to select only events //PatElectronTree(iEvent,iSetup); PatMuonTree(iEvent,iSetup); - TriggerMatchingTree(iEvent,iSetup); + TriggerMatchingTree(iEvent,iSetup); ComputeMuonMassVtx(iEvent,iSetup); ComputeMuonMassVtx30GeV(iEvent,iSetup); accessGenInfo(iEvent,iSetup); - fillMET(iEvent); + fillMET(iEvent); JetsTree(iEvent,iSetup); GenJetTree(iEvent); ParticleFlowPhotonTree(iEvent,iSetup); @@ -938,11 +938,11 @@ void MakeZprimeMiniAodTreeMuon::analyze(const edm::Event& iEvent, const edm::Eve TauTree(iEvent); //============================================== //= End of the main program = - //============================================== + //============================================== mytree->Fill(); } // ------------ method called once each job just after ending the event loop ------------ -void MakeZprimeMiniAodTreeMuon::endJob() +void MakeZprimeMiniAodTreeMuon::endJob() { // go to *OUR* root file and store histograms rootFile_->cd(); @@ -980,7 +980,7 @@ bool MakeZprimeMiniAodTreeMuon::PrimaryVertex(const reco::VertexCollection &vert // //============================================================= void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ unsigned int NbElectrons = -1 ; Ele_nbElectrons.clear(); Ele_dr03TkSumPt.clear(); @@ -1004,7 +1004,7 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e Ele_phiTrack.clear(); Ele_hadronicOverEm.clear(); Ele_deltaEtaInSeedCluster.clear(); - Ele_deltaPhiInSeedCluster.clear(); + Ele_deltaPhiInSeedCluster.clear(); Ele_deltaEtaInSC.clear(); Ele_deltaPhiInSC.clear(); Ele_sigmaIetaIeta.clear(); @@ -1046,7 +1046,7 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e Ele_hcalDepth2OverEcal.clear(); Ele_dr03HcalDepth2TowerSumEt.clear(); Ele_hcalDepth2TowerSumEtNoVeto.clear(); - Ele_hcalDepth1TowerSumEtNoVeto.clear(); + Ele_hcalDepth1TowerSumEtNoVeto.clear(); Ele_pfSumPhotonEt.clear(); Ele_pfSumChargedHadronPt.clear(); Ele_pfSumNeutralHadronEt.clear(); @@ -1074,17 +1074,17 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e //------------ Rec Hits in EB ---------------- edm::Handle ecalEB; iEvent.getByToken(tok_EB_,ecalEB); - //------------ Rec Hits in EE ---------------- + //------------ Rec Hits in EE ---------------- edm::Handle ecalEE; iEvent.getByToken(tok_EE_,ecalEE); std::auto_ptr lazyTools_; - lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); + lazyTools_ .reset(new EcalClusterLazyTools( iEvent, es, ecalRechitEBToken_, ecalRechitEEToken_ )); edm::Handle > eleHandle; iEvent.getByToken(eleToken_,eleHandle); for(auto& el : *eleHandle){ if(el.caloEnergy() * sin(el.p4().theta()) < 20) continue; NbElectrons++; - Ele_nbElectrons.push_back(NbElectrons); + Ele_nbElectrons.push_back(NbElectrons); Ele_Et.push_back(el.superCluster()->energy() * sin(el.p4().theta())); Ele_EtFromCaloEn.push_back(el.caloEnergy() * sin(el.p4().theta())); //================================================================ @@ -1109,14 +1109,14 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e // End New piece of code by Sam // //================================================================ - Ele_pt.push_back(el.pt()); + Ele_pt.push_back(el.pt()); Ele_thetaSC.push_back(el.caloPosition().theta()); //theta SC Ele_etaSC.push_back(el.superCluster()->eta()); //eta SC Ele_phiSC.push_back(el.superCluster()->phi()); //phi SC - Ele_phiWidth.push_back(el.superCluster()->phiWidth()); - Ele_etaWidth.push_back(el.superCluster()->etaWidth()); + Ele_phiWidth.push_back(el.superCluster()->phiWidth()); + Ele_etaWidth.push_back(el.superCluster()->etaWidth()); Ele_energySC.push_back(el.superCluster()->energy()); //energy SC - Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); + Ele_preshowerEnergySC.push_back(el.superCluster()->preshowerEnergy()); Ele_thetaTrack.push_back(el.p4().theta()); //theta track Ele_etaTrack.push_back(el.p4().eta()); //eta track Ele_phiTrack.push_back(el.p4().phi()); //phi track @@ -1137,7 +1137,7 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e Ele_e5x5.push_back(el.e5x5()); Ele_e2x5MaxOver5x5.push_back(el.e2x5Max()/el.e5x5()); Ele_e1x5Over5x5.push_back(el.e1x5()/el.e5x5()); - Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); + Ele_sigmaIetaIetaFull5x5.push_back(el.full5x5_sigmaIetaIeta()); Ele_e2x5MaxFull5x5.push_back(el.full5x5_e2x5Max()); Ele_e1x5Full5x5.push_back(el.full5x5_e1x5()); Ele_e5x5Full5x5.push_back(el.full5x5_e5x5()); @@ -1163,29 +1163,29 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e Ele_frac15.push_back( lazyTools_->e1x5(*(el.superCluster()->seed()))/el.full5x5_e5x5() ); Ele_nbVtx.push_back(vertices->size()); if(vertices->size()>0){ - Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); - Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); + Ele_dxy.push_back(el.gsfTrack()->dxy(PV.position())); + Ele_dz.push_back(el.gsfTrack()->dz(PV.position())); } else{ - Ele_dxy.push_back(el.gsfTrack()->dxy()); + Ele_dxy.push_back(el.gsfTrack()->dxy()); Ele_dz.push_back(el.gsfTrack()->dz()); } Ele_isEcalDrivenSeed.push_back(el.ecalDrivenSeed()); Ele_isPassConversionVeto.push_back(el.passConversionVeto()); Ele_charge.push_back(el.gsfTrack()->charge()); Ele_rhoIso.push_back(rhoIso); - Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); + Ele_nbOfMissingHits.push_back(el.gsfTrack()->numberOfLostHits()); Ele_fbrem.push_back(el.fbrem()); Ele_EoverP.push_back(el.eSeedClusterOverP()); - Ele_Xposition.push_back(el.caloPosition().x()); - Ele_Yposition.push_back(el.caloPosition().y()); + Ele_Xposition.push_back(el.caloPosition().x()); + Ele_Yposition.push_back(el.caloPosition().y()); //------------- detector isolation ------------------------- Ele_hcalDepth1OverEcal.push_back(el.hcalDepth1OverEcal()); Ele_hcalDepth2OverEcal.push_back(el.hcalDepth2OverEcal()); Ele_dr03HcalDepth2TowerSumEt.push_back(el.dr03HcalDepth2TowerSumEt()); - Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with + Ele_hcalDepth2TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth2TowerSumEt);// hcaldepht2 iso deposit with // electron footprint removed - Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with + Ele_hcalDepth1TowerSumEtNoVeto.push_back(el.isolationVariables03().hcalDepth1TowerSumEt);// hcaldepht1 iso deposit with // electron footprint removed Ele_EcalPlusHcald1iso.push_back(el.dr03EcalRecHitSumEt() + el.dr03HcalDepth1TowerSumEt()); Ele_dr03EcalRecHitSumEt.push_back(el.dr03EcalRecHitSumEt()); @@ -1193,16 +1193,16 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e Ele_dr03HcalDepth1TowerSumEtBc.push_back(el.dr03HcalDepth1TowerSumEtBc()); //------------- PF isolation from pat::ele ------------------------- Ele_pfSumPhotonEt.push_back(el.pfIsolationVariables().sumPhotonEt); - Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); + Ele_pfSumChargedHadronPt.push_back(el.pfIsolationVariables().sumChargedHadronPt); Ele_pfSumNeutralHadronEt.push_back(el.pfIsolationVariables().sumNeutralHadronEt); - Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); + Ele_pfSumPUPt.push_back(el.pfIsolationVariables().sumPUPt); // do deltaBeta double charged = el.pfIsolationVariables().sumPhotonEt; double neutral = el.pfIsolationVariables().sumNeutralHadronEt; double pileup = el.pfIsolationVariables().sumPUPt; double deltaBeta = charged + std::max(0.0, neutral-0.5*pileup); Ele_pfDeltaBeta.push_back(deltaBeta); - } + } } //============================================================= // @@ -1210,7 +1210,7 @@ void MakeZprimeMiniAodTreeMuon::PatElectronTree(const edm::Event& iEvent,const e // //============================================================= void MakeZprimeMiniAodTreeMuon::TriggerMatchingTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbTriggers = 0; int NbTriggerObj = 0; HLT_nb.clear(); @@ -1242,7 +1242,7 @@ void MakeZprimeMiniAodTreeMuon::TriggerMatchingTree(const edm::Event& iEvent,con names.triggerName(i) != "HLT_TkMu50_v3" && names.triggerName(i) != "HLT_TkMu50_v4" && names.triggerName(i) != "HLT_TkMu50_v5" && names.triggerName(i) != "HLT_TkMu50_v6" && names.triggerName(i) != "HLT_TkMu50_v7" && names.triggerName(i) != "HLT_TkMu50_v8" && - names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && + names.triggerName(i) != "HLT_TkMu50_v9" && names.triggerName(i) != "HLT_TkMu50_v10" && names.triggerName(i) != "HLT_Mu27_v1" && names.triggerName(i) != "HLT_Mu27_v2" && names.triggerName(i) != "HLT_Mu27_v3" && names.triggerName(i) != "HLT_Mu27_v4" && names.triggerName(i) != "HLT_Mu27_v5" && names.triggerName(i) != "HLT_Mu27_v6" && @@ -1257,11 +1257,11 @@ void MakeZprimeMiniAodTreeMuon::TriggerMatchingTree(const edm::Event& iEvent,con //full_name = name; NbTriggers++; HLT_nb.push_back(NbTriggers); - HLT_name.push_back(names.triggerName(i)); + HLT_name.push_back(names.triggerName(i)); HLT_isaccept.push_back(triggerBits->accept(i)); - /*std::cout << "Trigger " << names.triggerName(i) << + /*std::cout << "Trigger " << names.triggerName(i) << ", prescale " << triggerPrescales->getPrescaleForIndex(i) << - ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") + ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") << std::endl;*/ } for (unsigned i = 0; i < trigobj_handle->size(); ++i) { @@ -1282,7 +1282,7 @@ void MakeZprimeMiniAodTreeMuon::TriggerMatchingTree(const edm::Event& iEvent,con pathnames[j] != "HLT_TkMu50_v3" && pathnames[j] != "HLT_TkMu50_v4" && pathnames[j] != "HLT_TkMu50_v5" && pathnames[j] != "HLT_TkMu50_v6" && pathnames[j] != "HLT_TkMu50_v7" && pathnames[j] != "HLT_TkMu50_v8" && - pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && + pathnames[j] != "HLT_TkMu50_v9" && pathnames[j] != "HLT_TkMu50_v10" && pathnames[j] != "HLT_Mu27_v1" && pathnames[j] != "HLT_Mu27_v2" && pathnames[j] != "HLT_Mu27_v3" && pathnames[j] != "HLT_Mu27_v4" && pathnames[j] != "HLT_Mu27_v5" && pathnames[j] != "HLT_Mu27_v6" && @@ -1294,7 +1294,7 @@ void MakeZprimeMiniAodTreeMuon::TriggerMatchingTree(const edm::Event& iEvent,con pathnames[j] != "HLT_TkMu27_v7" && pathnames[j] != "HLT_TkMu27_v8" && pathnames[j] != "HLT_TkMu27_v9" && pathnames[j] != "HLT_TkMu27_v10" ) continue; HLTObj_nbObj.push_back(NbTriggerObj); - HLTObj_pt.push_back(src.pt()); + HLTObj_pt.push_back(src.pt()); HLTObj_eta.push_back(src.eta()); HLTObj_phi.push_back(src.phi()); HLTObj_collection.push_back(pathnames[j]); @@ -1322,7 +1322,7 @@ bool MakeZprimeMiniAodTreeMuon::isAncestor(const reco::Candidate* ancestor, cons } void MakeZprimeMiniAodTreeMuon::accessGenInfo(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ int NbGenMuons = 0; iGen.clear(); idGen.clear(); @@ -1338,12 +1338,12 @@ void MakeZprimeMiniAodTreeMuon::accessGenInfo(const edm::Event& iEvent,const edm // Pruned particles are the one containing "important" stuff Handle > pruned; iEvent.getByToken(prunedGenToken_,pruned); - if (!(pruned.isValid())) return; + if (!(pruned.isValid())) return; // Packed particles are all the status 1, so usable to remake jets // The navigation from status 1 to pruned is possible (the other direction should be made by hand) Handle > packed; iEvent.getByToken(packedGenToken_,packed); - //let's try to find all status1 originating directly from a B meson decay + //let's try to find all status1 originating directly from a B meson decay for(size_t i=0; isize();i++){ //if(abs((*pruned)[i].pdgId()) > 22 && abs((*pruned)[i].pdgId()) <24){ if(abs((*pruned)[i].pdgId()) < BosonID_){ @@ -1351,12 +1351,12 @@ void MakeZprimeMiniAodTreeMuon::accessGenInfo(const edm::Event& iEvent,const edm //std::cout << "PdgID: " << Zprime->pdgId() << " pt " << Zprime->pt() << " eta: " << Zprime->eta() << " phi: " << Zprime->phi() << std::endl; //std::cout << " found daugthers: " << std::endl; for(size_t j=0; jsize();j++){ - //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection + //get the pointer to the first survied ancestor of a given packed GenParticle in the prunedCollection const Candidate * motherInPrunedCollection = (*packed)[j].mother(0) ; if(motherInPrunedCollection != nullptr && isAncestor( Zprime , motherInPrunedCollection)){ if( (*packed)[j].pt() < 20.0 ) continue; - if( fabs((*packed)[j].pdgId()) != ParticleID1_ && - fabs((*packed)[j].pdgId()) != ParticleID2_ && + if( fabs((*packed)[j].pdgId()) != ParticleID1_ && + fabs((*packed)[j].pdgId()) != ParticleID2_ && fabs((*packed)[j].pdgId()) != ParticleID3_ ) continue; if( (*packed)[j].status() > ParticleStatus_ ) continue; NbGenMuons++; @@ -1382,7 +1382,7 @@ void MakeZprimeMiniAodTreeMuon::accessGenInfo(const edm::Event& iEvent,const edm // //============================================================= void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons = 0; Mu_nbMuon.clear(); Mu_isTightMuon.clear(); @@ -1423,7 +1423,7 @@ void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_thetaTunePMuonBestTrack.clear(); Mu_chargeTunePMuonBestTrack.clear(); Mu_absdxyTunePMuonBestTrack.clear(); - Mu_absdzTunePMuonBestTrack.clear(); + Mu_absdzTunePMuonBestTrack.clear(); Mu_ptInnerTrack.clear(); Mu_dPToverPTInnerTrack.clear(); Mu_pxInnerTrack.clear(); @@ -1443,7 +1443,7 @@ void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_passOldMatchedStationsCut.clear(); Mu_stationMask.clear(); Mu_numberOfMatchedRPCLayers.clear(); - // Get TransientTracks (for use in e.g. the vertex fit) for each of + // Get TransientTracks (for use in e.g. the vertex fit) for each of // the muon tracks, using e.g. the cocktail momentum. //edm::ESHandle ttkb; //es.get().get("TransientTrackBuilder", ttkb); @@ -1470,7 +1470,7 @@ void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_isPF.push_back(mu.isPFMuon()); //"Giovanni's filter"? //if ((bool)mu.userInt("muonsCleaned:oldPF") != mu.isPFMuon()) continue; - //cout<<""<size()); @@ -1493,10 +1493,10 @@ void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::Eve const reco::TrackRef& tunePTrack = mu.tunePMuonBestTrack(); Mu_ptTunePMuonBestTrack.push_back(tunePTrack->pt()); Mu_dPToverPTTunePMuonBestTrack.push_back(tunePTrack->ptError()/tunePTrack->pt()); - Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track - Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track - Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track - Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector + Mu_pxTunePMuonBestTrack.push_back(tunePTrack->px()); //px component of the track + Mu_pyTunePMuonBestTrack.push_back(tunePTrack->py()); //py component of the track + Mu_pzTunePMuonBestTrack.push_back(tunePTrack->pz()); //pz component of the track + Mu_pTunePMuonBestTrack.push_back(tunePTrack->p()); //magnitude of momentum vector Mu_etaTunePMuonBestTrack.push_back(tunePTrack->eta()); Mu_phiTunePMuonBestTrack.push_back(tunePTrack->phi()); Mu_thetaTunePMuonBestTrack.push_back(tunePTrack->theta()); @@ -1509,12 +1509,12 @@ void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::Eve Mu_eta.push_back(mu.eta()); Mu_phi.push_back(mu.phi()); Mu_charge.push_back(mu.charge()); - Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); + Mu_ptInnerTrack.push_back(mu.innerTrack()->pt()); Mu_dPToverPTInnerTrack.push_back(mu.innerTrack()->ptError()/mu.innerTrack()->pt()); - Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); - Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); - Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); - Mu_pInnerTrack.push_back(mu.innerTrack()->p()); + Mu_pxInnerTrack.push_back(mu.innerTrack()->px()); + Mu_pyInnerTrack.push_back(mu.innerTrack()->py()); + Mu_pzInnerTrack.push_back(mu.innerTrack()->pz()); + Mu_pInnerTrack.push_back(mu.innerTrack()->p()); Mu_etaInnerTrack.push_back(mu.innerTrack()->eta()); Mu_phiInnerTrack.push_back(mu.innerTrack()->phi()); Mu_thetaInnerTrack.push_back(mu.innerTrack()->theta()); @@ -1557,7 +1557,7 @@ void MakeZprimeMiniAodTreeMuon::PatMuonTree(const edm::Event& evt,const edm::Eve } void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons1 = 0; int NbMuons2 = 0; int NbMuons3 = 0; @@ -1594,10 +1594,10 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx(const edm::Event& evt,const e if( !mu.globalTrack().isNonnull() ) continue; if( mu.isTrackerMuon()==false ) continue; MuonBestTrack1 = mu.tunePMuonBestTrack(); - if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) - && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && + if( MuonBestTrack1->pt()>53.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) + && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 && - mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu.numberOfMatchedStations()>1 @@ -1617,10 +1617,10 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx(const edm::Event& evt,const e MuonBestTrack2 = mu2.tunePMuonBestTrack(); //cout << "PT 2mu= " << MuonBestTrack2->pt() << " and charge =" << MuonBestTrack2->charge()<< endl; if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue; - if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) - && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && + if( MuonBestTrack2->pt()>53.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) + && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 && - mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu2.numberOfMatchedStations()>1 @@ -1654,12 +1654,12 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx(const edm::Event& evt,const e if( mu3.isTrackerMuon()==false ) continue; MuonBestTrack3 = mu3.tunePMuonBestTrack(); //cout << "PT 3mu= " << MuonBestTrack3->pt() << " and charge =" << MuonBestTrack3->charge() << endl; - if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; - if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; - if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) - && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && + if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; + if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; + if( MuonBestTrack3->pt()>53.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) + && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 && - mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu3.numberOfMatchedStations()>1 @@ -1713,7 +1713,7 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx(const edm::Event& evt,const e } } void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx30GeV(const edm::Event& evt,const edm::EventSetup& es) -{ +{ int NbMuons1 = 0; int NbMuons2 = 0; int NbMuons3 = 0; @@ -1750,10 +1750,10 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx30GeV(const edm::Event& evt,co if( !mu.globalTrack().isNonnull() ) continue; if( mu.isTrackerMuon()==false ) continue; MuonBestTrack1 = mu.tunePMuonBestTrack(); - if( MuonBestTrack1->pt()>30.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) - && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && + if( MuonBestTrack1->pt()>30.0 && (mu.isolationR03().sumPt/mu.innerTrack()->pt()<0.10) + && (MuonBestTrack1->ptError()/MuonBestTrack1->pt()<0.3) && fabs(MuonBestTrack1->dxy(vertex.position()))<0.2 && - mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu.numberOfMatchedStations()>1 @@ -1769,10 +1769,10 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx30GeV(const edm::Event& evt,co if( mu2.isTrackerMuon()==false ) continue; MuonBestTrack2 = mu2.tunePMuonBestTrack(); if(MuonBestTrack2->pt() == MuonBestTrack1->pt()) continue; - if( MuonBestTrack2->pt()>30.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) - && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && + if( MuonBestTrack2->pt()>30.0 && (mu2.isolationR03().sumPt/mu2.innerTrack()->pt()<0.10) + && (MuonBestTrack2->ptError()/MuonBestTrack2->pt()<0.3) && fabs(MuonBestTrack2->dxy(vertex.position()))<0.2 && - mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu2.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu2.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu2.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu2.numberOfMatchedStations()>1 @@ -1798,12 +1798,12 @@ void MakeZprimeMiniAodTreeMuon::ComputeMuonMassVtx30GeV(const edm::Event& evt,co if( !mu3.globalTrack().isNonnull() ) continue; if( mu3.isTrackerMuon()==false ) continue; MuonBestTrack3 = mu3.tunePMuonBestTrack(); - if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; - if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; - if( MuonBestTrack3->pt()>30.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) - && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && + if(MuonBestTrack3->pt() == MuonBestTrack1->pt()) continue; + if(MuonBestTrack3->pt() == MuonBestTrack2->pt()) continue; + if( MuonBestTrack3->pt()>30.0 && (mu3.isolationR03().sumPt/mu3.innerTrack()->pt()<0.10) + && (MuonBestTrack3->ptError()/MuonBestTrack3->pt()<0.3) && fabs(MuonBestTrack3->dxy(vertex.position()))<0.2 && - mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && + mu3.globalTrack()->hitPattern().trackerLayersWithMeasurement()>5 && mu3.globalTrack()->hitPattern().numberOfValidPixelHits()>0 && mu3.globalTrack()->hitPattern().numberOfValidMuonHits()>0 && (mu3.numberOfMatchedStations()>1 @@ -1857,7 +1857,7 @@ void MakeZprimeMiniAodTreeMuon::PrimaryVertexTree(const edm::Event& iEvent,const PositionY.clear(); PositionZ.clear(); PositionRho.clear(); - edm::Handle pvHandle; + edm::Handle pvHandle; iEvent.getByToken(vtxToken_,pvHandle); const reco::VertexCollection &vertices = *pvHandle.product(); for(reco::VertexCollection::const_iterator it=vertices.begin() ; it!=vertices.end() ; ++it){ @@ -1882,41 +1882,41 @@ void MakeZprimeMiniAodTreeMuon::fillMET(const edm::Event& iEvent) iEvent.getByToken(metToken_, mets); const pat::MET &met = mets->front(); //[1] https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections - //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. - //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how - //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction - //and uncertainties with the latest and greatest JEC. - //You can find instructions for each analysis release. + //It is strongly recommended to use the Type-1 corrected MET, directly available from miniaod. + //In case it is needed to recompute the Type-1 MET, please follow this twiki: here you find how + //to get straight from miniAOD (slimmedMET and slimmedMETnoHF), how to recalculate correction + //and uncertainties with the latest and greatest JEC. + //You can find instructions for each analysis release. //[2] https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD#Run2_Fall15_MiniAOD_v2_campaign //the slimmedMETsNoHF was dropped (the recommendation from the MET group is to use standard slimmedMETs in 76X) //The default type1 corrected MET - PFMet_et_cor = met.et(); - PFMet_pt_cor = met.pt(); - PFMet_phi_cor = met.phi(); - PFMet_en_cor = met.energy(); - PFMet_px_cor = met.px(); - PFMet_py_cor = met.py(); - PFMet_pz_cor = met.pz(); + PFMet_et_cor = met.et(); + PFMet_pt_cor = met.pt(); + PFMet_phi_cor = met.phi(); + PFMet_en_cor = met.energy(); + PFMet_px_cor = met.px(); + PFMet_py_cor = met.py(); + PFMet_pz_cor = met.pz(); PFMet_sumEt_cor = met.sumEt(); //The Raw PF Met (un-corrected MET in CMSSW_7_4_12 or later, on 74X version 2 miniAODs) - /*PFMet_pt_uncor = met.uncorPt(); - PFMet_phi_uncor = met.uncorPhi(); - PFMet_en_uncor = met.uncorEnergy(); - PFMet_px_uncor = met.uncorPx(); - PFMet_py_uncor = met.uncorPy(); - PFMet_pz_uncor = met.uncorPz(); + /*PFMet_pt_uncor = met.uncorPt(); + PFMet_phi_uncor = met.uncorPhi(); + PFMet_en_uncor = met.uncorEnergy(); + PFMet_px_uncor = met.uncorPx(); + PFMet_py_uncor = met.uncorPy(); + PFMet_pz_uncor = met.uncorPz(); PFMet_sumEt_uncor = met.uncorSumEt(); //The Raw PF Met (un-corrected MET in CMSSW_7_4_11 or earlier, on 74X version 1 miniAODs) - PFMet_pt_uncor = met.uncorrectedPt(); - PFMet_phi_uncor = met.uncorrectedPhi(); + PFMet_pt_uncor = met.uncorrectedPt(); + PFMet_phi_uncor = met.uncorrectedPhi(); PFMet_sumEt_uncor = met.uncorrectedSumEt();*/ - //The raw calo ETmiss - CaloMet_pt = met.caloMETPt(); - CaloMet_phi = met.caloMETPhi(); + //The raw calo ETmiss + CaloMet_pt = met.caloMETPt(); + CaloMet_phi = met.caloMETPhi(); CaloMet_sumEt = met.caloMETSumEt(); PFMet_shiftedPt_JetEnUp = met.shiftedPt(pat::MET::JetEnUp); PFMet_shiftedPt_JetEnDown = met.shiftedPt(pat::MET::JetEnDown); - if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); + if (met.genMET() != NULL ) GenMet_pt = met.genMET()->pt(); /*edm::Handle metsighandle; iEvent.getByToken(theMETSignificance_, metsighandle); METSign=*metsighandle;*/ @@ -1928,7 +1928,7 @@ void MakeZprimeMiniAodTreeMuon::fillMET(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTreeMuon::GenJetTree(const edm::Event& iEvent) -{ +{ int NbGenJets = 0; iGenJet.clear(); idGenJet.clear(); @@ -1940,7 +1940,7 @@ void MakeZprimeMiniAodTreeMuon::GenJetTree(const edm::Event& iEvent) /**** GET GENJETS ****/ edm::Handle h_genjets; iEvent.getByToken( EDMGenJetsToken_,h_genjets ); - if (!(h_genjets.isValid())) return; + if (!(h_genjets.isValid())) return; std::vector const &genjets = *h_genjets; for(size_t i=0; i(*j.daughter(id)); if (dau.charge() == 0) continue; @@ -2008,7 +2008,7 @@ void MakeZprimeMiniAodTreeMuon::JetsTree(const edm::Event& iEvent,const edm::Eve jet_pileup_mva_disc.push_back(j.userFloat("pileupJetId:fullDiscriminant")); } else continue; - } + } } //============================================================= // @@ -2030,7 +2030,7 @@ void MakeZprimeMiniAodTreeMuon::BtaggingTree(const edm::Event& iEvent) iEvent.getByToken(jetToken_, jets); // loop over jets for( auto jet = jets->begin(); jet != jets->end(); ++jet ) - { + { // fill discriminator variables int flavor = std::abs( jet->partonFlavour() ); for( const std::string &bDiscr : bDiscriminators_ ) @@ -2060,7 +2060,7 @@ void MakeZprimeMiniAodTreeMuon::BtaggingTree(const edm::Event& iEvent) // //============================================================= void MakeZprimeMiniAodTreeMuon::ParticleFlowPhotonTree(const edm::Event& iEvent,const edm::EventSetup& es) -{ +{ pfphoton_size = 0; pfphoton_pt.clear(); pfphoton_eta.clear(); @@ -2110,7 +2110,7 @@ void MakeZprimeMiniAodTreeMuon::ParticleFlowPhotonTree(const edm::Event& iEvent, } } } -//madgraph MC samples reweighing +//madgraph MC samples reweighing void MakeZprimeMiniAodTreeMuon::EventsReWeighting(const edm::Event& evt){ MC_weighting.clear(); float EventWeight = 1.0; @@ -2188,8 +2188,8 @@ void MakeZprimeMiniAodTreeMuon::TauTree(const edm::Event& iEvent) [11] kKilled, // MC only flag: the channel is killed in the real detector [12] kTPSaturated, // the channel is in a region with saturated TP [13] kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0 - [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) - [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal + [14] kWeird, // the signal is believed to originate from an anomalous deposit (spike) + [15] kDiWeird, // the signal is anomalous, and neighbors another anomalous signal [16] kHasSwitchToGain6, // at least one data frame is in G6 [17] kHasSwitchToGain1, // at least one data frame is in G1 [18] kUnknown // to ease the interface with functions returning flags. diff --git a/Analyzer/python/wsuciutils b/Analyzer/python/wsuciutils new file mode 160000 index 0000000..f1b8eac --- /dev/null +++ b/Analyzer/python/wsuciutils @@ -0,0 +1 @@ +Subproject commit f1b8eac8342a4b80eb6a2782693357cc1abb864e diff --git a/Analyzer/test/ci_2e_samples.py b/Analyzer/test/ci_2e_samples.py new file mode 100644 index 0000000..bc0c49f --- /dev/null +++ b/Analyzer/test/ci_2e_samples.py @@ -0,0 +1,261 @@ +cito2esamples = { + "Lam1": { + "Con": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v2/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M2000_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam10": { + "Con": { + "LR": [ + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LRConM1300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LRConM300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LRConM800_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLConM1300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLConM2000_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLConM300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLConM800_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_RRConM1300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_RRConM300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_RRConM800_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LRDesM1300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LRDesM300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LRDesM800_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLDesM1300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLDesM300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_LLDesM800_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_RRDesM1300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_RRDesM300_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2E_GENSIM_Lam10/szaleski-EE_miniAODSIM_RRDesM800_remade-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + }, + "Lam16": { + "Con": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M2000_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v2/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam22": { + "Con": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam22TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam22TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam22TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M2000_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam22TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam22TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam22TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam22TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam22TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam22TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam22TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam22TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam22TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam22TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam22TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam22TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam28": { + "Con": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam28TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam28TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam28TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M2000_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam28TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam28TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam28TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam28TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam28TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam28TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam28TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam28TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam28TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam28TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam28TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam28TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam34": { + "Con": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam34TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam34TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam34TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M2000_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam34TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam34TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam34TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2E_M1300_CUETP8M1_Lam34TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam34TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam34TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2E_M1300_CUETP8M1_Lam34TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam34TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam34TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2E_M1300_CUETP8M1_Lam34TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M300_CUETP8M1_Lam34TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2E_M800_CUETP8M1_Lam34TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam100k": { + "Con": { + "LR": [ + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M1300_LR_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M300_LR_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M800_LR_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M1300_LL_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M2000_LL_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M300_LL_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M800_LL_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M1300_RR_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M300_RR_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M800_RR_Con-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + "Des": { + "LR": [ + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M1300_LR_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M300_LR_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M800_LR_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M1300_LL_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M300_LL_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M800_LL_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M1300_RR_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M300_RR_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToDielectron_L100k/pdong-Dielectron_100000000TeV_miniAOD_M800_RR_Des-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + }, + } diff --git a/Analyzer/test/ci_2mu_samples.py b/Analyzer/test/ci_2mu_samples.py new file mode 100644 index 0000000..6e2b83e --- /dev/null +++ b/Analyzer/test/ci_2mu_samples.py @@ -0,0 +1,261 @@ +cito2musamples = { + "Lam1": { + "Con": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M2000_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam10": { + "Con": { + "LR": [ + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LRConM1300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LRConM300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LRConM800_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLConM1300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLConM2000_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLConM300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLConM800_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_RRConM1300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_RRConM300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_RRConM800_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LRDesM1300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LRDesM300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LRDesM800_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLDesM1300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLDesM300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_LLDesM800_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_RRDesM1300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_RRDesM300_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CITo2Mu_GENSIM/szaleski-MuMu_miniAODSIM_RRDesM800_Use-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + }, + "Lam16": { + "Con": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M2000_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam16TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam22": { + "Con": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam22TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam22TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam22TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M2000_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam22TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam22TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam22TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam22TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam22TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam22TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam22TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam22TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam22TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam22TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam22TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam22TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam28": { + "Con": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam28TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam28TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam28TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M2000_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam28TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam28TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam28TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam28TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam28TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam28TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam28TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam28TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam28TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam28TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam28TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam28TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam28TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam34": { + "Con": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam34TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam34TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam34TeVConLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M2000_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam34TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam34TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam34TeVConRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + "Des": { + "LR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam34TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam34TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam34TeVDesLR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "LL": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam34TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam34TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam34TeVDesLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + "RR": [ + ["/CITo2Mu_M1300_CUETP8M1_Lam34TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M300_CUETP8M1_Lam34TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/CITo2Mu_M800_CUETP8M1_Lam34TeVDesRR_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + }, + }, + "Lam100k": { + "Con": { + "LR": [ + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M1300_L100K_LR_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M300_L100K_LR_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M800_L100K_LR_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M1300_L100K_LL_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M2000_L100K_LL_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M300_L100K_LL_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M800_L100K_LL_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M1300_L100K_RR_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M300_L100K_RR_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M800_L100K_RR_Con_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + "Des": { + "LR": [ + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M1300_L100K_LR_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M300_L100K_LR_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M800_L100K_LR_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "LL": [ + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M1300_L100K_LL_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M300_L100K_LL_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-crabConfig_MiniAod_CIToMuMu_M800_L100K_LL_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + "RR": [ + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M1300_L100K_RR_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M300_L100K_RR_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ["/CIToMuMuGenSim/pthapa-MiniAod_CIToMuMu_M800_L100K_RR_Des_Aug15-28028af67189b3de7224b79195bd0e1d/USER", None], + ], + }, + }, + } diff --git a/Analyzer/test/ci_driver.py b/Analyzer/test/ci_driver.py new file mode 100644 index 0000000..62cab5f --- /dev/null +++ b/Analyzer/test/ci_driver.py @@ -0,0 +1,81 @@ +import os + +class ciDriver: + + def __init__(self,*args,**kwargs): + from ci_2mu_samples import cito2musamples + from ci_2e_samples import cito2esamples + from dy_2mu_samples import dyto2musamples + from dy_2e_samples import dyto2esamples + + print("args:",args) + print("kwargs",kwargs) + + self.isDY = False + self.dy = args[0] + self.lam = None + self.intf = None + self.heli = None + + if self.dy in ["DYTo2L"]: + self.isDY = True + else: + self.isDY = False + self.lam = args[0] + self.intf = args[1] + self.heli = args[2] + pass + + if self.lam in ["Lam10","Lam100k"]: + self.dbs = "phys03" + else: + self.dbs = "global" + pass + + if self.isDY: + self.dyto2musamples = dyto2musamples["DY"] + self.dyto2esamples = dyto2esamples["DY"] + else: + self.cito2musamples = cito2musamples[self.lam][self.intf][self.heli] + self.cito2esamples = cito2esamples[self.lam][self.intf][self.heli] + pass + pass + + def getJobOptions(self): + if self.isDY: + mcfiles = list(mu for mu in self.dyto2musamples) + list(e for e in self.dyto2esamples) + else: + mcfiles = list(mu for mu in self.cito2musamples) + list(e for e in self.cito2esamples) + pass + + ci_job_options = { + "storageSite":"T3_US_FNALLPC", + "lfnBaseDir": "/store/user/%s/CINtuples_Dec15"%(os.getenv("USER")), + "cfgFile": "runMakeZprimeMiniAodTreeMC_cfg.py", + "dbs": self.dbs, + "datasets": { + "MC": mcfiles, + "data": [ + # ["/SingleMuon/Run2016B-23Sep2016-v3/MINIAOD",json], + # ["/SingleMuon/Run2016C-23Sep2016-v1/MINIAOD",json], + # ["/SingleMuon/Run2016D-23Sep2016-v1/MINIAOD",json], + # ["/SingleMuon/Run2016E-23Sep2016-v1/MINIAOD",json], + # ["/SingleMuon/Run2016F-23Sep2016-v1/MINIAOD",json], + # ["/SingleMuon/Run2016G-23Sep2016-v1/MINIAOD",json], + # ["/SingleMuon/Run2016H-PromptReco-v1/MINIAOD",json], + # ["/SingleMuon/Run2016H-PromptReco-v2/MINIAOD",json], + # ["/SingleMuon/Run2016H-PromptReco-v3/MINIAOD",json], + # ["/SingleElectron/Run2016B-23Sep2016-v3/MINIAOD",json], + # ["/SingleElectron/Run2016C-23Sep2016-v1/MINIAOD",json], + # ["/SingleElectron/Run2016D-23Sep2016-v1/MINIAOD",json], + # ["/SingleElectron/Run2016E-23Sep2016-v1/MINIAOD",json], + # ["/SingleElectron/Run2016F-23Sep2016-v1/MINIAOD",json], + # ["/SingleElectron/Run2016G-23Sep2016-v1/MINIAOD",json], + # ["/SingleElectron/Run2016H-PromptReco-v1/MINIAOD",json], + # ["/SingleElectron/Run2016H-PromptReco-v2/MINIAOD",json], + # ["/SingleElectron/Run2016H-PromptReco-v3/MINIAOD",json], + ], + }, + } + return ci_job_options + pass diff --git a/Analyzer/test/crabConfig_CI_ntupler.py b/Analyzer/test/crabConfig_CI_ntupler.py new file mode 100644 index 0000000..a33cfe0 --- /dev/null +++ b/Analyzer/test/crabConfig_CI_ntupler.py @@ -0,0 +1,32 @@ +from CRABClient.UserUtilities import config, getUsernameFromSiteDB +config = config() + +## change as needed +config.Data.inputDataset = '/CITo2Mu_M300_CUETP8M1_Lam22TeVConLL_13TeV_Pythia8_Corrected-v4/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM' +sample = config.Data.inputDataset.split('/') + +## change as needed +config.General.requestName = 'Dimuon_Ntuple_M300_CI_L22000_LL_Con_13TeV_test' +config.General.workArea = 'crab_projects' +config.General.transferOutputs = True +config.General.transferLogs = True + +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'runMakeZprimeMiniAodTreeMC_cfg.py' +#config.JobType.numCores = 4 + +config.JobType.pyCfgParams = ['sampleType=%s'%(sample[1]), 'runCrab=True'] +#config.Data.outputPrimaryDataset = 'CIToEEntuple' +config.Data.inputDBS = 'global' +config.Data.splitting = 'FileBased' +config.Data.unitsPerJob = 1 +## config.Data.totalUnits = 1 ## only do one job for testing purposes +#NJOBS = 100 +#config.Data.totalUnits = config.Data.unitsPerJob * NJOBS +## change as needed +config.Data.outLFNDirBase = '/store/user/sturdy' #%s/' % (getUsernameFromSiteDB()) +config.Data.publication = True +config.Data.outputDatasetTag = 'ntuples' + +## change as needed +config.Site.storageSite = 'T3_US_FNALLPC' diff --git a/Analyzer/test/dy_2e_samples.py b/Analyzer/test/dy_2e_samples.py new file mode 100644 index 0000000..926827a --- /dev/null +++ b/Analyzer/test/dy_2e_samples.py @@ -0,0 +1,6 @@ +dyto2esamples = { + "DY": [ + ["/DYTo2E_M1300_CUETP8M1_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v2/MINIAODSIM", None], + ["/DYTo2E_M800_CUETP8M1_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v2/MINIAODSIM", None], + ], + } diff --git a/Analyzer/test/dy_2mu_samples.py b/Analyzer/test/dy_2mu_samples.py new file mode 100644 index 0000000..c0abe8c --- /dev/null +++ b/Analyzer/test/dy_2mu_samples.py @@ -0,0 +1,7 @@ +dyto2musamples = { + "DY": [ + ["/DYTo2Mu_M1300_CUETP8M1_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/DYTo2Mu_M300_CUETP8M1_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ["/DYTo2Mu_M800_CUETP8M1_13TeV_Pythia8_Corrected-v3/RunIISummer16MiniAODv2-PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/MINIAODSIM", None], + ], + } diff --git a/Analyzer/test/getSamples.sh b/Analyzer/test/getSamples.sh new file mode 100644 index 0000000..6132e02 --- /dev/null +++ b/Analyzer/test/getSamples.sh @@ -0,0 +1,123 @@ +# CI Samples +lvals=( "1" "10" "16" "22" "28" "34" "100k" ) +intf=( "Con" "Des" ) +heli=( "LR" "LL" "RR" ) + +cat < ci_2mu_samples.py +cito2musamples = { +EOF + +cat < ci_2e_samples.py +cito2esamples = { +EOF + +for l in "${lvals[@]}" +do + cat <> ci_2mu_samples.py + "Lam${l}": { +EOF + cat <> ci_2e_samples.py + "Lam${l}": { +EOF + for i in "${intf[@]}" + do + cat <> ci_2mu_samples.py + "${i}": { +EOF + cat <> ci_2e_samples.py + "${i}": { +EOF + for h in "${heli[@]}" + do + cat <> ci_2mu_samples.py + "${h}": [ +EOF + cat <> ci_2e_samples.py + "${h}": [ +EOF + echo "ci_Lam${l}TeV${i}${h}.progress" + muquery="dataset dataset=/CITo2Mu*Lam${l}TeV${i}${h}*Corrected-v4/*/MINIAODSIM" + elquery="dataset dataset=/CITo2E*Lam${l}TeV${i}${h}*Corrected-v4/*/MINIAODSIM" + if [ "${l}" = "100k" ] + then + muquery="dataset dataset=/CIToMu*/pthapa-*MiniAod*_M*_L100K_${h}_${i}*/USER instance=prod/phys03" + elquery="dataset dataset=/CIToDie*/pdong-Dielectron_100*TeV_miniAOD_M*_${h}_${i}*/USER instance=prod/phys03" + elif [ "${l}" = "10" ] + then + : + muquery="dataset dataset=/CITo*/szaleski-MuMu_miniAODSIM_${h}${i}M*_Use-*/USER instance=prod/phys03" + elquery="dataset dataset=/CITo*Lam${l}/szaleski-EE_miniAODSIM*_${h}${i}M*_remade-*/USER instance=prod/phys03" + elif [ "${l}" = "1" ] + then + muquery="dataset dataset=/CITo2Mu*Lam16TeV${i}${h}*Corrected-v3/*/MINIAODSIM" + elquery="dataset dataset=/CITo2E*Lam16TeV${i}${h}*Corrected-v3/*/MINIAODSIM" + fi + echo "dasgoclient --query=\"${muquery}\"|egrep -v (test|Aug9)" + res=$(dasgoclient --query=${muquery}|egrep -v (test|Aug9)) + echo "$res" 2>&1 |tee -a ci_2mu_samples.py + # dasgoclient --query=${muquery} 2>&1 |tee -a ci_2mu_samples.py + echo "dasgoclient --query=\"${elquery}\"|egrep -v (test|Aug9)" + res=$(dasgoclient --query=${elquery}|egrep -v (test|Aug9)) + echo "$res" 2>&1 |tee -a ci_2e_samples.py + # dasgoclient --query=${elquery} 2>&1 |tee -a ci_2e_samples.py + + cat <> ci_2mu_samples.py + ], +EOF + cat <> ci_2e_samples.py + ], +EOF + done + cat <> ci_2mu_samples.py + }, +EOF + cat <> ci_2e_samples.py + }, +EOF + done + cat <> ci_2mu_samples.py + }, +EOF + cat <> ci_2e_samples.py + }, +EOF +done +cat <> ci_2mu_samples.py +} +EOF +cat <> ci_2e_samples.py +} +EOF + +# DY samples +cat < dy_2mu_samples.py +dyto2musamples = { +EOF + +cat < dy_2e_samples.py +dyto2esamples = { +EOF + +echo "dy_Lam${l}TeV${i}${h}.progress" +muquery="dataset dataset=/DYTo2Mu*Corrected-v3/*/MINIAODSIM" +elquery="dataset dataset=/DYTo2E*Corrected-v3/*/MINIAODSIM" +echo "dasgoclient --query=\"${muquery}\"|egrep -v (test|Aug9)" +res=$(dasgoclient --query=${muquery}|egrep -v (test|Aug9)) +echo "$res" 2>&1 |tee -a dy_2mu_samples.py +# dasgoclient --query=${muquery} 2>&1 |tee -a dy_2mu_samples.py +echo "dasgoclient --query=\"${elquery}\"|egrep -v (test|Aug9)" +res=$(dasgoclient --query=${elquery}|egrep -v (test|Aug9)) +echo "$res" 2>&1 |tee -a dy_2e_samples.py +# dasgoclient --query=${elquery} 2>&1 |tee -a dy_2e_samples.py + +cat <> dy_2mu_samples.py +} +EOF +cat <> dy_2e_samples.py +} +EOF + +perl -pi -e 's?/DYTo?["/DYTo?g' dy_2*_samples.py +perl -pi -e 's?/CITo?["/CITo?g' ci_2*_samples.py +perl -pi -e 's?/MINIAODSIM?/MINIAODSIM", None],?g' ??_2*_samples.py +perl -pi -e 's?/USER?/USER", None],?g' ??_2*_samples.py diff --git a/Analyzer/test/multicrab.py b/Analyzer/test/multicrab.py new file mode 100755 index 0000000..0d787b2 --- /dev/null +++ b/Analyzer/test/multicrab.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python + +""" +This is a small script that does the equivalent of multicrab. +""" + +import os +from optparse import OptionParser + +from CRABAPI.RawCommand import crabCommand +from CRABClient.ClientExceptions import ClientException +from CRABClient.UserUtilities import getUsernameFromSiteDB +from httplib import HTTPException + +def getOptions(): + """ + Parse and return the arguments provided by the user. + """ + usage = ("Usage: %prog --crabCmd CMD [--workArea WAR --crabCmdOpts OPTS --lumiJSON JSON --driverCFG]" + "\nThe multicrab command executes 'crab CMD OPTS' for each project directory contained in WAR" + "\nUse multicrab -h for help") + + parser = OptionParser(usage=usage) + + parser.add_option('-c', '--crabCmd', + dest = 'crabCmd', + default = '', + help = "crab command", + metavar = 'CMD') + + parser.add_option('-w', '--workArea', + dest = 'workArea', + default = '', + help = "work area directory (only if CMD != 'submit')", + metavar = 'WAR') + + parser.add_option('-j', '--lumiJSON', + dest = 'lumiJSON', + default = '', + help = "lumi JSON location (only if CMD != 'submit')", + metavar = 'LUMI') + + parser.add_option('-o', '--crabCmdOpts', + dest = 'crabCmdOpts', + default = '', + help = "options for crab command CMD", + metavar = 'OPTS') + + parser.add_option('--driverCFG', + dest = 'driverCFG', + default = '', + help = "multicrab driver file", + metavar = 'DRIVER') + + (options, arguments) = parser.parse_args() + + if arguments: + parser.error("Found positional argument(s): %s." % (arguments)) + if not options.crabCmd: + parser.error("(-c CMD, --crabCmd=CMD) option not provided.") + if options.crabCmd != 'submit': + if not options.workArea: + parser.error("(-w WAR, --workArea=WAR) option not provided.") + if not os.path.isdir(options.workArea): + parser.error("'%s' is not a valid directory." % (options.workArea)) + + return options + + +def main(): + from ci_driver import ciDriver + options = getOptions() + + # The submit command needs special treatment. + if options.crabCmd == 'submit': + + #-------------------------------------------------------- + # This is the base config: + #-------------------------------------------------------- + from CRABClient.UserUtilities import config + config = config() + + config.General.requestName = None + config.General.workArea = options.workArea.replace("-","",100) + config.General.transferOutputs = True + config.General.transferLogs = False + + config.JobType.pluginName = 'Analysis' + + driverOptions = options.workArea.split('-') + cidriver = ciDriver(*driverOptions) + driver = cidriver.getJobOptions() + + config.Data.inputDBS = driver["dbs"] + config.Data.inputDataset = None + config.Data.splitting = None + config.Data.outputDatasetTag = None + + config.Data.outLFNDirBase = driver["lfnBaseDir"] + + config.Site.storageSite = driver["storageSite"] + #-------------------------------------------------------- + + certFile = options.lumiJSON + # Will submit one task for each of these input datasets. + # pass in datasets as a dict {datasetname,mc/data} + inputDatasetMap = driver["datasets"] + + for key in inputDatasetMap.keys(): + inputDatasets = None + print(key) + if key.upper() == 'DATA': + inputDatasets = inputDatasetMap[key] + config.JobType.psetName = driver["cfgFile"] + + config.Data.splitting = 'LumiBased' + config.Data.unitsPerJob = 250 + + elif key.upper() == 'MC': + inputDatasets = inputDatasetMap[key] + config.JobType.psetName = driver["cfgFile"] + + # config.Data.useParent = True + config.Data.splitting = 'FileBased' + config.Data.unitsPerJob = 5 + else: + print("Unknown key: {}".format(key)) + continue + + for inDS in inputDatasets: + print "Key: %s - Creating config for for input dataset %s" % (key,inDS[0]) + # inDS is of the form /A/B/C. Since B is unique for each inDS, use this in the CRAB request name. + if key == 'DATA': + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,inDS[0].split('/')[1]) + else: + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,inDS[0].split('/')[1]) + pass + config.Data.inputDataset = inDS[0] + config.Data.outputDatasetTag = '{}_{}'.format(config.General.workArea, config.General.requestName) + if key == 'DATA': + config.Data.lumiMask = inDS[1] + pass + + sampleType = inDS[0].split('/')[1] + if sampleType == "CIToMuMuGenSim": + sampleType = inDS[0].split('/')[2].split('-')[1] + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,sampleType) + pass + elif sampleType == "CIToDielectron_L100k": + sampleType = inDS[0].split('/')[2].split('-')[1] + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,sampleType) + pass + elif sampleType == "CITo2Mu_GENSIM": + sampleType = inDS[0].split('/')[2].split('-')[1] + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,sampleType) + pass + elif sampleType == "CITo2E_GENSIM_Lam10": + sampleType = inDS[0].split('/')[2].split('-')[1] + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,sampleType) + pass + elif sampleType.find("Corrected-v3") > 0: + sampleType = sampleType.replace("Lam16","Lam1",100) + config.General.requestName = "{}_{}_{}".format(getUsernameFromSiteDB(),options.workArea,sampleType) + pass + config.JobType.pyCfgParams = ['sampleType=%s'%(sampleType), 'runCrab=True'] + + print config.General.workArea + print config.General.requestName + + # Submit. + try: + print "Submitting for input dataset %s" % (inDS[0]) + # continue ## uncomment for debugging + crabCommand(options.crabCmd, config = config, *options.crabCmdOpts.split()) + except HTTPException as hte: + print "Submission for input dataset %s failed: %s" % (inDS[0], hte.headers) + except ClientException as cle: + print "Submission for input dataset %s failed: %s" % (inDS[0], cle) + + # All other commands can be simply executed. + elif options.workArea: + + for dir in os.listdir(options.workArea): + projDir = os.path.join(options.workArea, dir) + if not os.path.isdir(projDir): + continue + # Execute the crab command. + msg = "Executing (the equivalent of): crab %s --dir %s %s" % (options.crabCmd, projDir, options.crabCmdOpts) + print "-"*len(msg) + print msg + print "-"*len(msg) + try: + crabCommand(options.crabCmd, dir = projDir, *options.crabCmdOpts.split()) + except HTTPException as hte: + print "Failed executing command %s for task %s: %s" % (options.crabCmd, projDir, hte.headers) + except ClientException as cle: + print "Failed executing command %s for task %s: %s" % (options.crabCmd, projDir, cle) + + +if __name__ == '__main__': + main() diff --git a/Analyzer/test/runMakeZprimeMiniAodTreeMC_cfg.py b/Analyzer/test/runMakeZprimeMiniAodTreeMC_cfg.py new file mode 100644 index 0000000..1f57e61 --- /dev/null +++ b/Analyzer/test/runMakeZprimeMiniAodTreeMC_cfg.py @@ -0,0 +1,276 @@ +import os,sys +import FWCore.ParameterSet.Config as cms +from FWCore.ParameterSet.VarParsing import VarParsing +options = VarParsing('analysis') +options.register('sampleType', + '', + VarParsing.multiplicity.singleton, + VarParsing.varType.string, + "Type of sample.") + +options.register('runCrab', + '', + VarParsing.multiplicity.singleton, + VarParsing.varType.bool, + "are we running a crab job.") +options.register('debug', + '', + VarParsing.multiplicity.singleton, + VarParsing.varType.bool, + "add debugging.") + +options.parseArguments() +if options.debug: + print("sampleType",options.sampleType) + print("runCrab",options.runCrab) +# set up process +process = cms.Process("HEEP") +process.options = cms.untracked.PSet( + wantSummary = cms.untracked.bool(True) +) +process.load("FWCore.MessageService.MessageLogger_cfi") +process.MessageLogger.cout.threshold = cms.untracked.string('WARNING') +process.MessageLogger.cerr.FwkReport = cms.untracked.PSet( + reportEvery = cms.untracked.int32(500), + limit = cms.untracked.int32(1000000), +) +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +#Track isolation correction +process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") +#setup global tag +# Global tag (MC) +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, '80X_mcRun2_asymptotic_2016_TrancheIV_v6', '') + + +# Global tag (data) +#from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, '80X_dataRun2_2016SeptRepro_v7', '') + +from ZprimeDiLeptons.Analyzer.wsuciutils.cisamples import cisamples +massBins = ["M300","M800","M1300","M2000"] +sample = options.sampleType.split('_') +# bad, self "organized" samples +if sample[0] == "MiniAod" or sample[0] == "crabConfig": + # prakash's samples format: + # MiniAod_CIToMuMu_M1300_L100K_LR_Con_Aug15 + # OR + # crabConfig_MiniAod_CIToMuMu_M1300_L100K_LR_Con_Aug15 + try: + sample.remove("crabConfig") + except ValueError as e: + pass + newsample = [] + newsample.append("CITo2Mu") # 0 + newsample.append(sample[2]) # 1 + newsample.append("CUETP8M1") # 2 + newsample.append("Lam%sTeV%s%s"%(sample[3][1:].lower(),sample[5],sample[4])) # 3 + sample = newsample + pass +elif sample[0] == "Dielectron": + # peter's samples format: + # Dielectron_100000000TeV_miniAOD_M300_RR_Des + newsample = [] + newsample.append("CITo2E") # 0 + newsample.append(sample[3]) # 1 + newsample.append("CUETP8M1") # 2 + newsample.append("Lam100kTeV%s%s"%(sample[5],sample[4])) # 3 + sample = newsample + pass +elif sample[0] == "MuMu": + # Shawn's samples format + # MuMu_miniAODSIM_LRDesM1300_Use + newsample = [] + newsample.append("CITo2Mu") # 0 + newsample.append(sample[2][5:]) # 1 + newsample.append("CUETP8M1") # 2 + newsample.append("Lam10TeV%s%s"%(sample[2][2:5],sample[2][0:2])) # 3 + sample = newsample + pass +elif sample[0] == "EE": + # Shawn's samples format + # EE_miniAODSIM_LRDesM1300_remade + newsample = [] + newsample.append("CITo2E") # 0 + newsample.append(sample[2][5:]) # 1 + newsample.append("CUETP8M1") # 2 + newsample.append("Lam10TeV%s%s"%(sample[2][2:5],sample[2][0:2])) # 3 + sample = newsample + pass + +# normal good samples format: +# CITo2E_M300_CUETP8M1_Lam34TeVConLL_13TeV_Pythia8_Corrected +if not "ConLL" in sample[3]: + massBins = massBins[:-1] +lowerCut = sample[1][1:] +upperCut = 1e10 +try: + val = cms.double(lowerCut) +except: + lowerCut = 0 + +for i,b in enumerate(massBins): + if lowerCut == b[1:] and i != (len(massBins)-1): + upperCut = massBins[i+1][1:] + continue + +weight = 1 +## for using the pickled sample information +# import cPickle as pickle +# from ZprimeDiLeptons.Analyzer.wsuciutils.xsec-tools.nesteddict import nesteddict +# with open("%s/src/ZprimeDiLeptons/Analyzer/python/ci_xsec_data.pkl"%(os.getenv("CMSSW_BASE")),"rb") as pkl: +# sdict = pickle.load(pkl) +## for using the json formatted sample information + +import json +with open("%s/src/ZprimeDiLeptons/Analyzer/python/wsuciutils/xsec-tools/data/ci_xsec_data.json"%(os.getenv("CMSSW_BASE")),"rb") as jsn: + sdict = json.load(jsn) + # pickle dict is: + # DY samples: + # d[sample]["M%d"%(mass)] + # CI samples: + # d[sample]["Lam%s"%(lval)][infm][heli]["M%s"%(mass)] + # Data is structured as: + #{ + # 'minCut': minCut, + # 'xsec': [xs_val, xs_err, xs_unit], + # 'maxCut': maxCut, + # 'cutEfficiency': [n_pass, n_fail] + #} + # sample = options.sampleType.split('_') + if "DY" in sample[0]: + print(sample) + mass = sample[1][1:] + xsdict = sdict[sample[0]]["M%s"%(mass)] + if not options.runCrab: + infiles = cisamples[sample[0]]["M{}".format(mass)] ## this should be com + outfile = '{}_M{}_MC_ntuple.root'.format(sample[0],mass) + elif "CI" in sample[0]: + special = sample[3].split("TeV") + lval = special[0] + infm = special[1][:-2] + heli = special[1][-2:] + mass = sample[1][1:] + if options.debug: + print(sdict[sample[0]].keys()) + print(sdict[sample[0]]["%s"%(lval)].keys()) + xsdict = sdict[sample[0]]["%s"%(lval)][infm][heli]["M%s"%(mass)] + print(sample[0],"%s"%(lval),infm,heli,"M%s"%(mass)) + + if not options.runCrab: + if options.debug: + print(cisamples[sample[0]].keys()) + print(cisamples[sample[0]]["%s"%(lval)].keys()) + infiles = cisamples[sample[0]][lval][infm][heli]["M{}".format(mass)] + outfile = '{}_M{}_{}{}_MC_ntuple.root'.format(lval,mass,infm,heli) + if xsdict: + weight = xsdict["xsec"][0] + else: + weight = 1. + infiles = None + outfile = '{}_MC_ntuple.root'.format(options.sampleType) + pass +print(outfile) +print(weight) + +if options.runCrab: + infiles = [] + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) ) +process.source = cms.Source ("PoolSource",fileNames = cms.untracked.vstring( + infiles + ) +) + +#we setup the HEEP ID V7.0 and enable VID via the following function +#and then add it to a new collection of pat::Electrons +#there is the option to call the new collection "slimmedElectrons" (useStdName=True) +#otherwise it calls them "heepElectrons" +#it creates a sequence "process.heepSequence" which we add to our path +from WSUDiLeptons.GenLevelFilter.genLevelFilter_cfi import genLevelFilter +process.genweightfilter = genLevelFilter.clone( + filterevent = cms.bool(False), + filterPreFSR = cms.bool(False), + filterST1 = cms.bool(False), + filterST23 = cms.bool(False), + filterHS = cms.bool(False), + debug = cms.bool(False), + minCut = cms.double(lowerCut), + sampleType = cms.string(sample[0]), + maxCut = cms.double(upperCut), + xsWeight = cms.double(weight), +) + +from HEEP.VID.tools import addHEEPV70ElesMiniAOD +addHEEPV70ElesMiniAOD(process,useStdName=True) + +process.TFileService = cms.Service("TFileService", + fileName = cms.string(outfile) +) +#this is our example analysis module reading the results, you will have your own module +process.heepIdExample = cms.EDAnalyzer("MakeZprimeMiniAodTreeMC", + eles=cms.InputTag("slimmedElectrons"), + passMInvCutTag = cms.InputTag("genweightfilter","passMassCut"), + passPreFSRMInvCutTag = cms.InputTag("genweightfilter","passPreFSRMassCut"), + passST1MInvCutTag = cms.InputTag("genweightfilter","passST1MassCut"), + passST23MInvCutTag = cms.InputTag("genweightfilter","passST23MassCut"), + passHSMInvCutTag = cms.InputTag("genweightfilter","passHSMassCut"), + xsWeightTag = cms.InputTag("genweightfilter","xsWeight"), + scProducer = cms.InputTag("reducedEgamma:reducedSuperClusters"), + vertices = cms.InputTag("offlineSlimmedPrimaryVertices"), + muons = cms.InputTag("slimmedMuons"), + electrons = cms.InputTag("slimmedElectrons"), + taus = cms.InputTag("slimmedTaus"), + photons = cms.InputTag("slimmedPhotons"), + #jets = cms.InputTag("slimmedJetsCMSTopTagCHSPacked:SubJets"), + jets = cms.InputTag("slimmedJets"), + #jets = cms.InputTag("slimmedJetsPuppi"), + mets = cms.InputTag("slimmedMETs"), + #mets = cms.InputTag("slimmedMETsNoHF"), + packed = cms.InputTag("packedGenParticles"), + pruned = cms.InputTag("prunedGenParticles"), + pfCands = cms.InputTag("packedPFCandidates"), + rhoIsoInputTag = cms.InputTag("fixedGridRhoFastjetCentralChargedPileUp"), + EBrecHitCollectionLabel = cms.InputTag("reducedEgamma","reducedEBRecHits"), + EErecHitCollectionLabel = cms.InputTag("reducedEgamma","reducedEERecHits"), + ecalRechitEB = cms.InputTag("reducedEgamma","reducedEBRecHits"), + ecalRechitEE = cms.InputTag("reducedEgamma","reducedEERecHits"), + JetSource = cms.InputTag('slimmedGenJets'), + PileupSrc = cms.InputTag("slimmedAddPileupInfo"), + #METSignificance = cms.InputTag("METSignificance","METSignificance"), + #generalTracksLabel = cms.InputTag("generalTracks"), + bits = cms.InputTag("TriggerResults","","HLT"), + prescales = cms.InputTag("patTrigger"), + objects = cms.InputTag("selectedPatTrigger"), + GenBosonID = cms.int32(1000000), + ParticleID1 = cms.int32(13), + ParticleID2 = cms.int32(11), + ParticleID3 = cms.int32(15), + ParticleStatus = cms.int32(25), + maxAbsZ = cms.double(24), + maxd0 = cms.double(2), + minndof = cms.int32(4), + NbGoodPv = cms.int32(1), + bDiscriminators = cms.vstring( # list of b-tag discriminators to access + #'pfTrackCountingHighEffBJetTags', + #'pfTtrackCountingHighPurBJetTags', + #'pfJetProbabilityBJetTags', + #'pfJetBProbabilityBJetTags', + #'pfSimpleSecondaryVertexHighEffBJetTags', + #'pfSimpleSecondaryVertexHighPurBJetTags', + #'pfCombinedSecondaryVertexV2BJetTags', + 'pfCombinedInclusiveSecondaryVertexV2BJetTags' + #'pfCombinedMVABJetTags' + ), + + outputFile = cms.string(outfile) + + ) + +process.p = cms.Path( + process.genweightfilter+ + (process.heepSequence* + process.heepIdExample)) #our analysing example module, replace with your module + diff --git a/scripts/setup.sh b/scripts/setup.sh index 009a11f..ef142d3 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -59,4 +59,13 @@ echo git clone git@github.com:cms-data/RecoEgamma-ElectronIdentification ../exte echo git clone -b HEEPV70 git@github.com:Sam-Harper/HEEP.git echo git cms-merge-topic Sam-Harper:NewEGModifiers_8010 # the zprime selection code -echo git clone https://github.com/cms-analysis/ZprimeDiLeptons +echo git clone -b generic-80x git@github.com:jsturdy/wsu-dilepton-analysis.git WSUDiLeptons +echo "#or git clone -b generic-80x https://github.com/jsturdy/wsu-dilepton-analysis WSUDiLeptons" +echo git clone -b release-80x git@github.com:cms-analysis/ZprimeDiLeptons.git +echo "#or git clone https://github.com/cms-analysis/ZprimeDiLeptons" + +echo cd ZprimeDiLeptons +echo git submodule init +echo git submodule update +echo cd '$CMSSW_BASE/src' +echo scram b -j8