From 41dcbd21470b6ce769e00d14b7070ec1160ad424 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Tue, 14 Jul 2015 22:06:14 +0200 Subject: [PATCH 01/30] start new cfg file for 2015 monitoring --- ZFitter/data/validation/monitoring_2015.dat | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ZFitter/data/validation/monitoring_2015.dat diff --git a/ZFitter/data/validation/monitoring_2015.dat b/ZFitter/data/validation/monitoring_2015.dat new file mode 100644 index 00000000000..c7b3c671a82 --- /dev/null +++ b/ZFitter/data/validation/monitoring_2015.dat @@ -0,0 +1,33 @@ +# list of files to run on +# type treeName fileName +# files are added to the same chain if they have the same treeName and the same type +# chain with the same type are added as friends +# only three type are admitted: s (signal), b (bkg), d (data) +# all treeName are admitted, but some are mandatory: +# selected +# some are special: pileup, scaleEleHggRunEta, scaleEleHggRunEtaR9 +s1 selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARECOSIM/DYJetsToLL_M-50_13TeV-Asympt50ns-pythia8_16Jun15_v3/allRange/v3/DYJetsToLL_M-50_13TeV-Asympt50ns-pythia8_16Jun15_v3-allRange.root +s2 selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARECOSIM/DYJetsToLL_M-50_13TeV-StartupFlat10to50-pythia8_11Jun15_v1/allRange/v3/DYJetsToLL_M-50_13TeV-StartupFlat10to50-pythia8_11Jun15_v1-allRange.root +#s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARECOSIM/DYJetsToLL_M-50_13TeV-StartupFlat10to50-pythia8_11Jun15_v1/allRange/DYJetsToLL_M-50_13TeV-StartupFlat10to50-pythia8_11Jun15_v1-allRange.root + +d pileupHist /afs/cern.ch/cms/CAF/CMSALCA/ALCA_ECALCALIB/ECALELF/puFiles/190456-208686-13Julv2_Prompt_Moriond2013.69400.observed.root +s pileupHist /afs/cern.ch/cms/CAF/CMSALCA/ALCA_ECALCALIB/ECALELF/puFiles/nPU-Summer12_DD3.observed.root +d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/ntuple_DoubleElectron-ZSkim-RUN2015D-13Jul15-v1.root + +### OLD (2012) +#s pileupTree /afs/cern.ch/cms/CAF/CMSALCA/ALCA_ECALCALIB/ECALELF/puFiles/tree-nPU-Summer12_DD3-190456-203002-13Jul_PromptTS.69400.observed.root +#d corr DoubleElectron-ZSkim-RUN2012C-v3-201230-201678-JSON_201230-201678-Prompt.root +#s pileup mcPUtree.root +#s selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/ALCARECOSIM/DYJets-Summer12-START53-ZSkim/allRange/DYJets-Summer12-START53-ZSkim-allRange.root +#d pileupHist /afs/cern.ch/cms/CAF/CMSALCA/ALCA_ECALCALIB/ECALELF/puFiles/190456-204567-13Julv2_lastPrompt.69400.observed.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-RUN2012A-v1-06Aug-recover/190782-190949/190782-190949-06Aug/DoubleElectron-RUN2012A-v1-06Aug-recover-190782-190949.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012A-13Jul-v1/190456-193621/190456-203002-13Jul_PromptTS/DoubleElectron-ZSkim-RUN2012A-13Jul-v1-190456-193621.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012B-13Jul-v1/193834-196531/190456-204567-13Julv2_Prompt/DoubleElectron-ZSkim-RUN2012B-13Jul-v1-193834-196531.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-v2/198111-198913/190456-204567-13Julv2_Prompt/DoubleElectron-ZSkim-RUN2012C-v2-198111-198913.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-24Aug-v1/198022-198523/198022-198523-24Aug/DoubleElectron-ZSkim-RUN2012C-24Aug-v1-198022-198523.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-v3/198934-201678/190456-203002-13Jul_PromptTS/DoubleElectron-ZSkim-RUN2012C-v3-198934-201678.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-v3/201679-202016/190456-203002-13Jul_PromptTS/DoubleElectron-ZSkim-RUN2012C-v3-201679-202016.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-v3/202017-202305/190456-203002-13Jul_PromptTS/DoubleElectron-ZSkim-RUN2012C-v3-202017-202305.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-v3/202306-203002/190456-203002-13Jul_PromptTS/DoubleElectron-ZSkim-RUN2012C-v3-202306-203002.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/alcareco/DoubleElectron-ZSkim-RUN2012C-v3/203003-203755/190456-203853_13Jul_Prompt/DoubleElectron-ZSkim-RUN2012C-v3-203003-203755.root +#d selected root://eoscms//eos/cms/store/caf/user/shervin/calibration/8TeV/ZNtuples/officialAlcareco/DoubleElectron-ZAlcaSkim-RUN2012D-v1/203773-208686/190456-208686-13Julv2_Prompt/DoubleElectron-ZAlcaSkim-RUN2012D-v1-203773-208686.root From fe11397e44c0bf448e13d4976f2ca877a667f4b2 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Thu, 23 Jul 2015 11:23:15 +0200 Subject: [PATCH 02/30] new rereco tag: Run2015B_WF2_ICtransp2012_v5 --- .../reRecoTags/Run2015B_WF2_ICtransp2012_v5.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 EcalAlCaRecoProducers/config/reRecoTags/Run2015B_WF2_ICtransp2012_v5.py diff --git a/EcalAlCaRecoProducers/config/reRecoTags/Run2015B_WF2_ICtransp2012_v5.py b/EcalAlCaRecoProducers/config/reRecoTags/Run2015B_WF2_ICtransp2012_v5.py new file mode 100644 index 00000000000..0f607d5be42 --- /dev/null +++ b/EcalAlCaRecoProducers/config/reRecoTags/Run2015B_WF2_ICtransp2012_v5.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms +from CondCore.DBCommon.CondDBSetup_cfi import * + +# rereco of cycle Run2015B_WF2 +# other infos + +RerecoGlobalTag = cms.ESSource("PoolDBESSource", + CondDBSetup, + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), + globaltag = cms.string('74X_dataRun2_Prompt_v0'), + toGet = cms.VPSet( + cms.PSet(record = cms.string("EcalIntercalibConstantsRcd"), + tag = cms.string("EcalIntercalibConstants_transport2012to2015_V5"), + connect = cms.untracked.string("sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_ECALCALIB/RunII-IC/Run2015B_WF2/EcalIntercalibConstants_transport2012to2015_V5.db") + ) + ), + ) From e3b4abdaf3fc4d02a0e93f0dff604c0b4df72d24 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 4 Jul 2015 20:59:41 +0200 Subject: [PATCH 03/30] Selection in ZNtupleDumper for electron stream: - add calomet - add selection on calo met for wstream case - add nEle requirement for the electron stream --- ZNtupleDumper/plugins/ZNtupleDumper.cc | 50 +++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/ZNtupleDumper/plugins/ZNtupleDumper.cc b/ZNtupleDumper/plugins/ZNtupleDumper.cc index f558ea7d361..39a68abe286 100644 --- a/ZNtupleDumper/plugins/ZNtupleDumper.cc +++ b/ZNtupleDumper/plugins/ZNtupleDumper.cc @@ -120,7 +120,9 @@ #include "DataFormats/METReco/interface/PFMET.h" #include "DataFormats/METReco/interface/PFMETFwd.h" - +#include "DataFormats/METReco/interface/CaloMET.h" +#include "DataFormats/METReco/interface/CaloMETFwd.h" +#include "DataFormats/METReco/interface/CaloMETCollection.h" // HLT trigger #include "FWCore/Framework/interface/TriggerNamesService.h" #include @@ -149,7 +151,6 @@ class ZNtupleDumper : public edm::EDAnalyzer static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - private: virtual void beginJob() ; virtual void analyze(const edm::Event&, const edm::EventSetup&); @@ -184,6 +185,7 @@ class ZNtupleDumper : public edm::EDAnalyzer edm::Handle< GenEventInfoProduct > GenEventInfoHandle; edm::Handle conversionsHandle; edm::Handle< reco::PFMETCollection > metHandle; + edm::Handle< reco::CaloMETCollection > caloMetHandle; edm::Handle triggerResultsHandle; edm::Handle WZSkimResultsHandle; edm::Handle ESRechitsHandle; @@ -214,6 +216,7 @@ class ZNtupleDumper : public edm::EDAnalyzer edm::EDGetTokenT > pileupInfoToken_; edm::EDGetTokenT conversionsProducerToken_; edm::EDGetTokenT metToken_; + edm::EDGetTokenT caloMetToken_; edm::EDGetTokenT triggerResultsToken_; edm::EDGetTokenT WZSkimResultsToken_; edm::InputTag triggerResultsTAG, WZSkimResultsTAG; @@ -457,6 +460,8 @@ class ZNtupleDumper : public edm::EDAnalyzer ZSC, ZMMG, PARTGUN, + WSTREAM, + ZSTREAM, UNKNOWN, SINGLEELE, //no skim, no preselection and no selection are applied DEBUG_T @@ -492,6 +497,7 @@ ZNtupleDumper::ZNtupleDumper(const edm::ParameterSet& iConfig): pileupInfoToken_(consumes>(iConfig.getParameter("pileupInfo"))), conversionsProducerToken_(consumes(iConfig.getParameter("conversionCollection"))), metToken_(consumes(iConfig.getParameter("metCollection"))), + caloMetToken_(consumes(iConfig.getParameter("caloMetCollection"))), //for the stream triggerResultsToken_(consumes(iConfig.getParameter("triggerResultsCollection"))), WZSkimResultsToken_(consumes(iConfig.getParameter("WZSkimResultsCollection"))), triggerResultsTAG(iConfig.getParameter("triggerResultsCollection")), @@ -621,7 +627,11 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(WZSkimResultsHandle->accept(*alcaSkimPath_itr)) { skipEvent = false; std::string hltName_str(alcaSkimPathNames.triggerName(*alcaSkimPath_itr)); - if(hltName_str.find("WElectron") != std::string::npos) + if(hltName_str.find("WElectronStream")!=std::string::npos) + eventType=WENU; + else if(hltName_str.find("ZElectronStream")!=std::string::npos) + eventType=ZEE; + else if(hltName_str.find("WElectron") != std::string::npos) eventType = WENU; else if(hltName_str.find("ZSCElectron") != std::string::npos) eventType = ZSC; @@ -683,7 +693,12 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe iEvent.getByToken(recHitCollectionESToken_, ESRechitsHandle); //if(metHandle.isValid()==false) iEvent.getByType(metHandle); reco::PFMET met = metHandle.isValid() ? ((*metHandle))[0] : reco::PFMET(); /// \todo use corrected phi distribution + reco::CaloMET caloMet; + if (caloMetHandle.isValid()==true) { + iEvent.getByToken(caloMetToken_, caloMetHandle); + caloMet = ((*caloMetHandle))[0]; //get hlt met + } //Here the HLTBits are filled. TriggerResults TreeSetEventSummaryVar(iEvent); @@ -728,6 +743,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe int nTight = 0; //number of electrons passing only the tight ID for preselection int nMedium = 0; //number of electrons passing only the medium ID for preselection int nLoose = 0; //number of electrons passing only the loose ID for preselection + int nEle = 0; //number of electrons saved in the electron stream //if (eventType!=ZMMG) { // count the number of electrons passing the different IDs for preselection and event type determination if (eventType != UNKNOWN) { // count the number of electrons passing the different IDs for preselection and event type determination @@ -737,6 +753,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if( eleIter1->electronID(eleID_tight) ) ++nTight; else if( eleIter1->electronID(eleID_medium) ) ++nMedium; else if( eleIter1->electronID(eleID_loose) ) ++nLoose; + nEle++; } } @@ -774,7 +791,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(doEleIDTree) { TreeSetEleIDVar(*eleIter1, *eleIter2); } - } else if(eventType == ZEE || eventType == WENU || eventType == UNKNOWN) { + } else if(eventType==ZEE || eventType==WENU || eventType==UNKNOWN || eventType==WSTREAM || eventType==ZSTREAM){ #ifdef DEBUG std::cout << "[DEBUG] Electrons in the event: " << electronsHandle->size() << std::endl; #endif @@ -807,6 +824,31 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe TreeSetEleIDVar(*eleIter1, 0); TreeSetEleIDVar(*eleIter1, -1); } + } else if(eventType==WSTREAM) { + if(! eleIter1->electronID("tightElectronStream") ) continue; + if (nEle!=1) continue; + //if( nWP70 != 1 || nWP90 > 0 ) continue; //to be a Wenu event request only 1 ele WP70 in the event + + iEvent.getByToken(caloMetToken_, caloMetHandle); + if (caloMetHandle.isValid()==false) continue; + + // MET/MT selection + if( caloMetHandle->at(0).pt() < 25. ) continue; + if( sqrt( 2.*eleIter1->et()*caloMetHandle->at(0).pt()*(1 -cos(eleIter1->phi()-caloMetHandle->at(0).phi()))) < 50. ) continue; + if( eleIter1->et()<30) continue; + doFill = true; + if(eventType == UNKNOWN) eventType = WENU; + TreeSetSingleElectronVar(*eleIter1, 0); //fill first electron + TreeSetSingleElectronVar(*eleIter1, -1); // fill fake second electron + + if(doExtraCalibTree) { + TreeSetExtraCalibVar(*eleIter1, 0); + TreeSetExtraCalibVar(*eleIter1, -1); + } + if(doEleIDTree) { + TreeSetEleIDVar(*eleIter1, 0); + TreeSetEleIDVar(*eleIter1, -1); + } } else { //ZEE or UNKNOWN // take only the fist di-electron pair (highest pt) for(pat::ElectronCollection::const_iterator eleIter2 = eleIter1 + 1; From 6b98c8ff96d28132c4807b0feb8741d79dafc342 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 4 Jul 2015 21:16:10 +0200 Subject: [PATCH 04/30] add sequences for electron stream --- .../python/ALCARECOEcalCalIsolElectron_Output_cff.py | 7 +++++-- .../python/ALCARECOEcalCalIsolElectron_cff.py | 2 ++ .../python/ALCARECOEcalUncalIsolElectron_Output_cff.py | 4 +++- .../python/ALCARECOEcalUncalIsolElectron_cff.py | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py index e2ddf3be919..3d717a3cfe4 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py @@ -23,7 +23,7 @@ OutALCARECOEcalCalElectron_noDrop = cms.PSet( # put this if you have a filter SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalCalZSCElectron') + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalCalZSCElectron','pathALCARECOEcalCalZElectronStream', 'pathALCARECOEcalCalWElectronStream') ), outputCommands = cms.untracked.vstring( 'keep uint_bunchSpacingProducer_*_*', @@ -64,7 +64,10 @@ 'keep *EcalRecHit*_alCaIsolatedElectrons_*_*', 'keep EcalRecHitsSorted_reducedEcalRecHitsES_*_*', 'keep *EcalRecHit*_*ecalPreshowerRecHit*_*EcalRecHitsES*_*', - + 'keep *CaloCluster*_*particleFlowEGamma*_*EBEEClusters*_*', + 'keep *CaloCluster*_*particleFlowEGamma*_*ESClusters*_*', + 'keep *_hltFixedGridRhoFastjetAllCaloForMuons_*_*', #for electron stream + 'keep *_hltMet_*_*', #for electron stream ) ) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py index ead46c318a6..896940cb63e 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py @@ -62,6 +62,8 @@ seqALCARECOEcalCalZElectron = cms.Sequence(ZeeSkimFilterSeq * ALCARECOEcalCalElectronSeq) seqALCARECOEcalCalZSCElectron = cms.Sequence(ZSCSkimFilterSeq * ALCARECOEcalCalElectronSeq) seqALCARECOEcalCalWElectron = cms.Sequence(WenuSkimFilterSeq * ALCARECOEcalCalElectronSeq) +seqALCARECOEcalCalZElectronStream = cms.Sequence(ZeeSkimFilterSeqElectronStream * ALCARECOEcalCalElectronSeq) +seqALCARECOEcalCalWElectronStream = cms.Sequence(WenuSkimFilterSeqElectronStream * ALCARECOEcalCalElectronSeq) seqALCARECOEcalCalPhoton = cms.Sequence( alCaIsolatedElectrons + diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py index 4ee95ffca23..f431292192f 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py @@ -20,10 +20,12 @@ 'drop *EcalRecHit*_reducedEcalRecHitsES*_*_*', 'drop *EcalRecHit*_*_*_*', 'keep reco*Clusters_pfElectronTranslator_*_*' + 'keep *_hltFixedGridRhoFastjetAllCaloForMuons_*_*', + 'keep *_hltMet_*_*', ) OutALCARECOEcalUncalElectron.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron', 'pathALCARECOEcalUncalWElectron') + SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron', 'pathALCARECOEcalUncalWElectron', 'pathALCARECOEcalUncalWElectronStream', 'pathALCARECOEcalUncalZElectron') ) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py index 6824c237a8d..e4803000aef 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py @@ -19,3 +19,5 @@ seqALCARECOEcalUncalZSCElectron = cms.Sequence(ZSCSkimFilterSeq * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) seqALCARECOEcalUncalWElectron = cms.Sequence(WenuSkimFilterSeq * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) seqALCARECOEcalUncalElectron = cms.Sequence( ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) +seqALCARECOEcalUncalWElectronStream = cms.Sequence(WenuSkimFilterSeqElectronStream * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) +seqALCARECOEcalUncalZElectronStream = cms.Sequence(ZeeSkimFilterSeqElectronStream * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) From d64ef2347448f8f5012eb2576ec5138480d796ad Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 4 Jul 2015 21:19:42 +0200 Subject: [PATCH 05/30] add W and Z skim for electron stream --- .../python/WZElectronSkims_cff.py | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py b/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py index f1b2b6e6325..c049f88aa0b 100644 --- a/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py +++ b/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py @@ -139,6 +139,31 @@ ) ) + +# This are the cuts at trigger level except ecalIso +PassingVetoIdElectronStream = selectedECALElectrons.clone( + cut = cms.string( + selectedECALElectrons.cut.value() + + " && (gsfTrack.hitPattern().numberOfHits(\'MISSING_INNER_HITS\')<=2)" + " && ((isEB" + " && ( ((pfIsolationVariables().sumChargedHadronPt + max(0.0,pfIsolationVariables().sumNeutralHadronEt + pfIsolationVariables().sumPhotonEt - 0.5 * pfIsolationVariables().sumPUPt))/p4.pt)<0.164369)" + " && (sigmaIetaIeta<0.011100)" +# " && (full5x5_sigmaIetaIeta<0.011100)" #why this one cuts all the events? + " && ( - 0.252044 %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN)) ) +WenuSelectorElectronStream = cms.EDProducer("CandViewShallowCloneCombiner", + decay = cms.string("pfMet PassingVetoIdElectronStream"), # charge coniugate states are implied + checkCharge = cms.bool(False), +# cut = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN)) + cut = cms.string(("daughter(1).pt > %f") % (W_ELECTRON_ET_CUT_MIN)) +) + EleSCSelector = cms.EDProducer("CandViewShallowCloneCombiner", decay = cms.string("PassingVetoId eleSC"), @@ -224,11 +266,21 @@ cut = cms.string("40 < mass < 140") ) +EleSCSelectorElectronStream = cms.EDProducer("CandViewShallowCloneCombiner", + decay = cms.string("PassingVetoIdElectronStream eleSC"), + checkCharge = cms.bool(False), + cut = cms.string("40 < mass < 140") + ) + # for filtering events passing at least one of the filters WZSelector = cms.EDProducer("CandViewMerger", src = cms.VInputTag("WenuSelector", "ZeeSelector", "EleSCSelector") ) +WZSelectorElectronStream = cms.EDProducer("CandViewMerger", + src = cms.VInputTag("WenuSelectorElectronStream", "ZeeSelectorElectronStream", "EleSCSelectorElectronStream") + ) + ############################################################ # Filters ############################## @@ -247,6 +299,22 @@ minNumber = cms.uint32(1) ) +WenuFilterElectronStream = cms.EDFilter("CandViewCountFilter", + src = cms.InputTag("WenuSelectorElectronStream"), + minNumber = cms.uint32(1) + ) + +ZeeFilterElectronStream = cms.EDFilter("CandViewCountFilter", + src = cms.InputTag("ZeeSelectorElectronStream"), + minNumber = cms.uint32(1) + ) + +ZSCFilterElectronStream = cms.EDFilter("CandViewCountFilter", + src = cms.InputTag("EleSCSelectorElectronStream"), + minNumber = cms.uint32(1) + ) + + # filter for events passing at least one of the other filters WZFilter = cms.EDFilter("CandViewCountFilter", src = cms.InputTag("WZSelector"), @@ -270,8 +338,20 @@ WenuSkimFilterSeq = cms.Sequence(preFilterSeq * selectorProducerSeq * ~ZeeFilter * ~ZSCFilter * WenuFilter) +### sequences for the electron stream +selectorProducerSeqWElectronStream = cms.Sequence(eleSelSeqElectronStream * (ZeeSelectorElectronStream + WenuSelectorElectronStream + EleSCSelectorElectronStream) * WZSelectorElectronStream) + +selectorProducerSeqZElectronStream = cms.Sequence(eleSelSeqElectronStream * (ZeeSelectorElectronStream)) + +WenuSkimFilterSeqElectronStream = cms.Sequence(preFilterSeq * selectorProducerSeqWElectronStream * ~ZeeFilterElectronStream * ~ZSCFilterElectronStream * + WenuFilterElectronStream) + +ZeeSkimFilterSeqElectronStream = cms.Sequence(preFilterSeq * selectorProducerSeqZElectronStream * + ZeeFilterElectronStream) + checkMCZSeq = cms.Sequence(genEleFromZ * combZ * ZFilterMC) #sequence to check Zskim efficiency respect to the MC checkMCWSeq = cms.Sequence(genEleFromW * genNuFromW * combW * WFilterMC) #sequence to check Wskim efficiency respect to the MC FilterMuSeq = cms.Sequence(muSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector) + From 667e1d602f72e0fb92bd57734e05334ef4faf096 Mon Sep 17 00:00:00 2001 From: Shervin Nourbakhsh Date: Thu, 16 Jun 2016 09:05:49 +0200 Subject: [PATCH 06/30] witch to hltMet instead of pfmet --- EcalAlCaRecoProducers/python/WZElectronSkims_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py b/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py index c049f88aa0b..6a29838aca2 100644 --- a/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py +++ b/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py @@ -247,7 +247,7 @@ MT_CUT_MIN = 50. WenuSelector = cms.EDProducer("CandViewShallowCloneCombiner", - decay = cms.string("pfMet PassingVetoId"), # charge coniugate states are implied + decay = cms.string("hltMetClean PassingVetoId"), # charge coniugate states are implied checkCharge = cms.bool(False), cut = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN)) ) From 3fe429e12ee74880902d3226441d7ebe8bf7c4ac Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 4 Jul 2015 21:28:49 +0200 Subject: [PATCH 07/30] calomet and rho in input to dumper in case of electron stream --- ZNtupleDumper/python/zntupledumper_cfi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ZNtupleDumper/python/zntupledumper_cfi.py b/ZNtupleDumper/python/zntupledumper_cfi.py index ee1f76a8a67..d30cf627118 100644 --- a/ZNtupleDumper/python/zntupledumper_cfi.py +++ b/ZNtupleDumper/python/zntupledumper_cfi.py @@ -25,6 +25,7 @@ doStandardTree = cms.bool(True), doExtraCalibTree = cms.bool(False), doEleIDTree = cms.bool(False), + caloMetCollection = cms.InputTag('hltMet'), # pdfWeightCollections = cms.VInputTag(cms.InputTag('pdfWeights:cteq66'), cms.InputTag("pdfWeights:MRST2006nnlo"), cms.InputTag('pdfWeights:NNPDF10')), pdfWeightCollections = cms.VInputTag(), fsrWeightCollection = cms.InputTag("fsrWeight"), From be4a3f0407f630206edb18fdde730e35dbc18e9a Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 4 Jul 2015 21:29:34 +0200 Subject: [PATCH 08/30] add sequences for electron stream --- EcalAlCaRecoProducers/python/alcaSkimming.py | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index 0bdf5a89ffb..e116564679b 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -61,7 +61,12 @@ VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int, "50=50ns, 25=25ns,0=multifit auto,-1=weights") - +options.register('electronStream', + 0, #default value False + VarParsing.VarParsing.multiplicity.singleton, # singleton or list + VarParsing.VarParsing.varType.int, # string, int, or float + "bool: isElectronStream=1 true, isElectronStream=0 false") + ### setup any defaults you want options.output="alcaSkimALCARAW.root" options.secondaryOutput="ntuple.root" @@ -321,6 +326,8 @@ process.NtupleFilter.throw = cms.bool(False) process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalWElectron', 'pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalWElectron', + 'pathALCARECOEcalUncalZElectronStream', 'pathALCARECOEcalUncalWElectronStream', + 'pathALCARECOEcalCalZElectronStream', 'pathALCARECOEcalCalWElectronStream', 'pathALCARECOEcalUncalZSCElectron', 'pathALCARECOEcalCalZSCElectron', 'pathALCARECOEcalUncalSingleElectron', 'pathALCARECOEcalCalSingleElectron', ## in case of no skim ] @@ -337,11 +344,13 @@ # process.NtupleFilterSeq= cms.Sequence(process.NtupleFilter) process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalZElectron', 'pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalCalZSCElectron', 'pathALCARECOEcalUncalZSCElectron', + 'pathALCARECOEcalCalZElectronStream', 'pathALCARECOEcalUncalZElectronStream', ] elif(WSkim): process.NtupleFilterSeq = cms.Sequence(process.WZFilter) # process.NtupleFilterSeq= cms.Sequence(process.NtupleFilter) - process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalUncalWElectron' ] + process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalUncalWElectron', + 'pathALCARECOEcalCalWElectronStream', 'pathALCARECOEcalUncalWElectronStream'] elif(ZmmgSkim): process.NtupleFilterSeq = cms.Sequence(process.ZmmgSkimSeq) process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalZmmgPhoton', 'pathALCARECOEcalUncalZmmgPhoton' ] @@ -577,17 +586,17 @@ ############################## if(options.skim=='WSkim'): process.outputALCARAW.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalUncalWElectron') + SelectEvents = cms.vstring('pathALCARECOEcalUncalWElectron','pathALCARECOEcalUncalWElectronStream') ) process.outputALCARECO.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalCalWElectron') + SelectEvents = cms.vstring('pathALCARECOEcalCalWElectron','pathALCARECOEcalCalWElectronStream') ) elif(options.skim=='ZSkim'): process.outputALCARAW.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron') + SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron','pathALCARECOEcalUncalZElectronStream') ) process.outputALCARECO.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalZSCElectron') + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalZSCElectron','pathALCARECOEcalUncalZElectronStream') ) elif(options.skim=='ZmmgSkim'): process.outputALCARAW.SelectEvents = cms.untracked.PSet( @@ -768,6 +777,10 @@ #process.zNtupleDumper.recHitCollectionEB = process.eleNewEnergiesProducer.recHitCollectionEB #process.zNtupleDumper.recHitCollectionEE = process.eleNewEnergiesProducer.recHitCollectionEE +if (options.electronStream==1): + process.zNtupleDumper.caloMetCollection = cms.InputTag('hltMet') + process.zNtupleDumper.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') + if(options.type=="ALCARECOSIM"): process.zNtupleDumper.recHitCollectionES = cms.InputTag("reducedEcalRecHitsES") #process.zNtupleDumper.recHitCollectionES = cms.InputTag("reducedEcalRecHitsES") From 7816021b6171cbe80b21975fec0b2dc167e1a87e Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sun, 5 Jul 2015 11:07:52 +0200 Subject: [PATCH 09/30] New files in test/ directory for electron stream add: - calomet in rechitsvalitdation - python and crab cfg to run reco of electron stream - cfg file for crab for ntuples - run_reco_alcastreamElectron_crab.py --- .../test/recHitsValidation.py | 7 +- .../reco_RAW2DIGI_RECO_alcastreamElectron.py | 133 ++++++++++++++++++ .../test/run_alcareco_alcastreamElectron.py | 29 ++++ .../test/run_ntuple_alcastreamElectron.py | 27 ++++ .../test/run_reco_alcastreamElectron_crab.py | 25 ++++ 5 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py create mode 100644 EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py create mode 100644 EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py create mode 100644 EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py diff --git a/EcalAlCaRecoProducers/test/recHitsValidation.py b/EcalAlCaRecoProducers/test/recHitsValidation.py index fa7e03c978b..f84f8f21e43 100644 --- a/EcalAlCaRecoProducers/test/recHitsValidation.py +++ b/EcalAlCaRecoProducers/test/recHitsValidation.py @@ -163,6 +163,8 @@ handleRecHitsEB_ALCARECO = Handle('edm::SortedCollection >') handleRecHitsEE_ALCARECO = Handle('edm::SortedCollection >') +handleMET = Handle('std::vector') + if (file_format == 'ALCARECO'): processName="ALCASKIM" electronTAG = 'electronRecalibSCAssociator' @@ -193,7 +195,7 @@ electronTAG = 'electronRecalibSCAssociator' - +metTAG = 'hltMet' EErecHitmap_ele1 = TH2F("EErecHitmap_ele1", "EErecHitmap_ele1", 100,0,100, @@ -230,6 +232,9 @@ # print file_format, file, electronTAG electrons = handleElectrons.product() + event.getByLabel(metTAG, handleMET) + met = handleMET.product() + # event.getByLabel("reducedEcalRecHitsEB", "", processName, handleRecHitsEB) # event.getByLabel("reducedEcalRecHitsEE", "", processName, handleRecHitsEE) if(file_format=="sandbox"): diff --git a/EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py b/EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py new file mode 100644 index 00000000000..83c3b0f54f8 --- /dev/null +++ b/EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py @@ -0,0 +1,133 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: reco -s RAW2DIGI,RECO -n 100 --filein=/store/data/Run2012D/SingleElectron/RAW/v1/000/208/307/0085A34B-BD3A-E211-B6E9-003048D2BC4C.root --data --conditions=auto:run2_data --nThreads=4 --dirout=./ +import FWCore.ParameterSet.Config as cms +import os, sys, imp, re +import FWCore.ParameterSet.VarParsing as VarParsing +import subprocess +import copy + + +process = cms.Process('RECO') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.RawToDigi_Data_cff') +process.load('Configuration.StandardSequences.Reconstruction_Data_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') + +options = VarParsing.VarParsing('standard') + +options.register ('tagFile', + "", + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "path of the file with the reReco tags") + +options.parseArguments() + +print options + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(100) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('/store/data/Run2015D/AlCaElectron/RAW/v1/000/256/673/00000/5AD13995-DF5C-E511-8DDB-02163E013516.root'), +# fileNames = cms.untracked.vstring('root://xrootd.unl.edu//store/data/Run2015C/AlCaElectron/RAW/v1/000/254/313/00000/88935D49-C842-E511-BA1F-02163E014330.root'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('reco nevts:100'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string(''), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('./reco_RAW2DIGI_RECO.root'), + outputCommands = process.RECOSIMEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag + +if(len(options.tagFile)>0): + execfile(options.tagFile) # load the GT + process.GlobalTag = RerecoGlobalTag +else: + print "******************************" + print "[ERROR] no file with tags specified" + sys.exit(1) + +#process.GlobalTag = GlobalTag(process.GlobalTag, '74X_dataRun2_Prompt_v1', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.reconstruction_step = cms.Path(process.reconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +### some fix for the stream +process.csctfDigis.producer = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.dttfDigis.DTTF_FED_Source = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.ecalDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.ecalPreshowerDigis.sourceTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.castorDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.gctDigis.inputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.gtDigis.DaqGtInputTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.gtEvmDigis.EvmGtInputTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.hcalDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.muonCSCDigis.InputObjects = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.muonDTDigis.inputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.muonRPCDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.scalersRawToDigi.scalersInputTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.siPixelDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.siStripDigis.ProductLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.endjob_step,process.RECOSIMoutput_step) + +#Setup FWK for multithreaded +process.options.numberOfThreads=cms.untracked.uint32(4) +process.options.numberOfStreams=cms.untracked.uint32(0) + + diff --git a/EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py b/EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py new file mode 100644 index 00000000000..9b44ee59587 --- /dev/null +++ b/EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py @@ -0,0 +1,29 @@ +from WMCore.Configuration import Configuration +config = Configuration() +config.section_('General') +config.General.transferOutputs = True +config.General.requestName = 'AlCaElectron_alcareco_RUN2015D' +config.General.workArea = 'AlCaElectron_alcareco_RUN2015D' +config.section_('JobType') +config.JobType.psetName = 'reco_ALCA.py' +config.JobType.pluginName = 'Analysis' +#config.JobType.pyCfgParams = ['global_tag=74X_dataRun2_Prompt_v1', 'MC=False', 'isCrab=True'] +config.JobType.allowUndistributedCMSSW = True +#config.JobType.inputFiles = ['PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt' ] +config.section_('Data') +config.Data.inputDataset = '/AlCaElectron/lbrianza-crab_reco_stream_runD-00000000000000000000000000000000/USER' +config.Data.unitsPerJob = 1 +config.Data.lumiMask = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON_Silver.txt' +config.JobType.maxMemoryMB = 2500 # 2.5 GB +config.JobType.maxJobRuntimeMin = 1400 +#config.Data.lumiMask = 'Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v2.txt' +config.Data.inputDBS = 'phys03' #'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet' +config.Data.splitting = 'FileBased' +config.Data.outLFNDirBase = '/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/AlCaElectron_alcareco_RUN2015D/' +config.Data.useParent = True +config.Data.publication = True +#config.Data.ignoreLocality = True +config.section_('User') +config.section_('Site') +config.Site.storageSite = 'T2_CH_CERN' +#config.Site.whitelist = ['T2_US_Caltech', 'T2_US_Florida', 'T2_US_MIT', 'T2_US_Nebraska', 'T2_US_Purdue', 'T2_US_UCSD', 'T2_US_Vanderbilt'] diff --git a/EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py b/EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py new file mode 100644 index 00000000000..47f4a8049b6 --- /dev/null +++ b/EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py @@ -0,0 +1,27 @@ +from WMCore.Configuration import Configuration +config = Configuration() +config.section_('General') +config.General.transferOutputs = True +config.General.requestName = 'ntuple_AlCaElectron_RUN2015D' +config.General.workArea = 'ntuple_AlCaElectron_RUN2015D' +config.section_('JobType') +config.JobType.psetName = 'EcalAlCaRecoProducers/python/alcaSkimming.py' +#config.JobType.psetName = 'processDump.py' +config.JobType.pluginName = 'Analysis' +config.JobType.outputFiles= ['ntuple.root','extraCalibTree.root'] +config.JobType.pyCfgParams = ['isCrab=1', 'skim=WSkim', 'maxEvents=-1', 'type=ALCARECO', 'tagFile=EcalAlCaRecoProducers/config/reRecoTags/test75x.py','doTreeOnly=1', 'electronStream=1','doTree=3'] +config.JobType.allowUndistributedCMSSW = True +#config.JobType.inputFiles = ['PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt' ] +config.section_('Data') +#config.Data.inputDataset = '/AlCaElectron/lbrianza-crab_alcareco_stream_runC-e468ed1ee444b924f5c474c9b5bffcd2/USER' +config.Data.inputDataset = '/AlCaElectron/lbrianza-crab_AlCaElectron_alcareco_RUN2015D-c2f08da413a109f58849306beef921b4/USER' +config.Data.unitsPerJob = 10 +config.Data.lumiMask = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON_Silver.txt' +config.Data.inputDBS = 'phys03' #'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet' +config.Data.splitting = 'FileBased' +config.Data.outLFNDirBase = '/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/ntuple_AlCaElectron_RUN2015D/' +#config.Data.useParent = True +#config.Data.publication = True +config.section_('User') +config.section_('Site') +config.Site.storageSite = 'T2_CH_CERN' diff --git a/EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py b/EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py new file mode 100644 index 00000000000..3853e3988d7 --- /dev/null +++ b/EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py @@ -0,0 +1,25 @@ +from WMCore.Configuration import Configuration +config = Configuration() +config.section_('General') +config.General.transferOutputs = True +config.General.requestName = 'reco_stream_runD' +config.General.workArea = 'reco_stream_runD' +config.section_('JobType') +config.JobType.psetName = 'python/reco_RAW2DIGI_RECO_alcastreamElectron.py' +config.JobType.pluginName = 'Analysis' +#config.JobType.pyCfgParams = ['global_tag=74X_dataRun2_Prompt_v1', 'MC=False', 'isCrab=True'] +config.JobType.allowUndistributedCMSSW = True +#config.JobType.inputFiles = ['PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt' ] +config.section_('Data') +#config.Data.inputDataset = '/ElectronStream/Run2015B-v1/RAW' +config.Data.inputDataset = '/AlCaElectron/Run2015D-v1/RAW' +config.Data.unitsPerJob = 10 +#config.Data.lumiMask = 'json/Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v2.txt' +config.Data.inputDBS = 'global' #'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet' +config.Data.splitting = 'LumiBased' +config.Data.outLFNDirBase = '/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/AlCaElectron-Run2015D-v1-RECO/' +config.Data.publication = True +config.section_('User') +config.section_('Site') +config.Site.storageSite = 'T2_CH_CERN' +config.Site.whitelist = ['T2_CH_CERN'] From 95da33276d58d43423a5b54d7d77dcdeeef572e8 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sun, 5 Jul 2015 18:09:47 +0200 Subject: [PATCH 10/30] give in input to dumper hltRho (probably not useful) --- EcalAlCaRecoProducers/python/alcaSkimming.py | 1 + 1 file changed, 1 insertion(+) diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index e116564679b..7f7f3182a2a 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -780,6 +780,7 @@ if (options.electronStream==1): process.zNtupleDumper.caloMetCollection = cms.InputTag('hltMet') process.zNtupleDumper.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') + process.eleSelectionProducers.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') if(options.type=="ALCARECOSIM"): process.zNtupleDumper.recHitCollectionES = cms.InputTag("reducedEcalRecHitsES") From 38b4fb1ecc97a39103a218446ed10cf8b274fcce Mon Sep 17 00:00:00 2001 From: Shervin Nourbakhsh Date: Thu, 16 Jun 2016 09:17:19 +0200 Subject: [PATCH 11/30] New tight ele ID for electron stream --- ...SimpleCutBasedElectronIDSelectionFunctor.h | 96 ++++++++++++++++++- .../plugins/EleSelectionProducers.cc | 58 ++++++++++- 2 files changed, 149 insertions(+), 5 deletions(-) diff --git a/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h b/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h index 541bfa99c29..b9e856fdaa4 100644 --- a/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h +++ b/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h @@ -139,9 +139,7 @@ class SimpleCutBasedElectronIDSelectionFunctor : public Selector public: // interface - enum Version_t { NONE = 0, fiducial, WP80PU, WP90PU, WP70PU, loose, medium, tight, loose25nsRun2, medium25nsRun2, tight25nsRun2, loose50nsRun2, medium50nsRun2, tight50nsRun2, medium25nsRun2Boff}; - - // SimpleCutBasedElectronIDSelectionFunctor(): {} + enum Version_t { NONE = 0, fiducial, WP80PU, WP90PU, WP70PU, loose, medium, tight, loose25nsRun2, medium25nsRun2, tight25nsRun2, loose50nsRun2, medium50nsRun2, tight50nsRun2, medium25nsRun2Boff, looseElectronStream, mediumElectronStream, tightElectronStream}; #ifdef shervin // initialize it by inserting directly the cut values in a parameter set @@ -233,6 +231,9 @@ class SimpleCutBasedElectronIDSelectionFunctor : public Selector else if (versionStr.CompareTo("medium50nsRun2") == 0) version = medium50nsRun2; else if (versionStr.CompareTo("tight50nsRun2") == 0) version = tight50nsRun2; else if (versionStr.CompareTo("medium25nsRun2Boff") == 0) version = medium25nsRun2Boff; + else if (versionStr.CompareTo("looseElectronStream") == 0) version = loose25nsRun2; + else if (versionStr.CompareTo("mediumElectronStream") == 0) version = medium25nsRun2; + else if (versionStr.CompareTo("tightElectronStream") == 0) version = tight25nsRun2; else { std::cerr << "[ERROR] version type not defined" << std::endl; std::cerr << "[ERROR] using WP80PU" << std::endl; @@ -638,8 +639,95 @@ class SimpleCutBasedElectronIDSelectionFunctor : public Selector set("relEcalIso_EB", 100., false); set("relEcalIso_EE", 100., false); set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); + } else if (version_ == looseElectronStream) { //SPRING15. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2 + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.104); + set("hoe_EE", 0.0897); + set("deta_EB", 0.0105); + set("deta_EE", 0.00814); + set("dphi_EB", 0.115); + set("dphi_EE", 0.182); + set("sihih_EB", 0.0103); + set("sihih_EE", 0.0301); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100.,false);//0.0261); + set("d0vtx_EE", 100.,false);//0.118); + set("dzvtx_EB", 100.,false);//0.41); + set("dzvtx_EE", 100.,false);//0.822); + set("pfIso_EB", 0.0893); + set("pfIso_EE", 0.121); + set("pfIsoLowPt_EB", 0.0893); + set("pfIsoLowPt_EE", 0.121); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); set("relHcalIso_EE", 100., false); - } + } else if (version_ == mediumElectronStream) { //SPRING15. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2 + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.0876); + set("hoe_EE", 0.0678); + set("deta_EB", 0.0103); + set("deta_EE", 0.00733); + set("dphi_EB", 0.0336); + set("dphi_EE", 0.114); + set("sihih_EB", 0.0101); + set("sihih_EE", 0.0283); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100.,false);//0.0118 ); + set("d0vtx_EE", 100.,false);//0.0739); + set("dzvtx_EB", 100.,false);//0.373); + set("dzvtx_EE", 100.,false);//0.602); + set("pfIso_EB", 0.0766); + set("pfIso_EE", 0.0678); + set("pfIsoLowPt_EB", 0.0766); + set("pfIsoLowPt_EE", 0.0678); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); + } else if (version_ == tightElectronStream) { + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.0597); + set("hoe_EE", 0.0615); + set("deta_EB", 0.00926); + set("deta_EE", 0.00724); + set("dphi_EB", 0.0336); + set("dphi_EE", 0.0918); + set("sihih_EB", 0.0101); + set("sihih_EE", 0.0279); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100.,false); + set("d0vtx_EE", 100.,false); + set("dzvtx_EB", 100.,false); + set("dzvtx_EE", 100.,false); + set("pfIso_EB", 0.0354); + set("pfIso_EE", 0.0646); + set("pfIsoLowPt_EB", 0.0354); + set("pfIsoLowPt_EE", 0.0646); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); + } } diff --git a/ZNtupleDumper/plugins/EleSelectionProducers.cc b/ZNtupleDumper/plugins/EleSelectionProducers.cc index 1e8292e7441..e1c1c5fd863 100644 --- a/ZNtupleDumper/plugins/EleSelectionProducers.cc +++ b/ZNtupleDumper/plugins/EleSelectionProducers.cc @@ -106,6 +106,9 @@ class EleSelectionProducers : public edm::EDProducer SimpleCutBasedElectronIDSelectionFunctor medium50nsRun2_selector; SimpleCutBasedElectronIDSelectionFunctor tight50nsRun2_selector; SimpleCutBasedElectronIDSelectionFunctor medium25nsRun2Boff_selector; + SimpleCutBasedElectronIDSelectionFunctor looseElectronStream_selector; + SimpleCutBasedElectronIDSelectionFunctor mediumElectronStream_selector; + SimpleCutBasedElectronIDSelectionFunctor tightElectronStream_selector; }; @@ -147,7 +150,14 @@ EleSelectionProducers::EleSelectionProducers(const edm::ParameterSet& iConfig): tight50nsRun2_selector("tight50nsRun2", electronsHandle, conversionsHandle, bsHandle, vertexHandle, chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), medium25nsRun2Boff_selector("medium25nsRun2Boff", electronsHandle, conversionsHandle, bsHandle, vertexHandle, - chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle) + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), + looseElectronStream_selector("looseElectronStream", electronsHandle, conversionsHandle, bsHandle, vertexHandle, + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), + mediumElectronStream_selector("mediumElectronStream", electronsHandle, conversionsHandle, bsHandle, vertexHandle, + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), + tightElectronStream_selector("tightElectronStream", electronsHandle, conversionsHandle, bsHandle, vertexHandle, + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle) + { //register your products /* Examples @@ -173,6 +183,9 @@ EleSelectionProducers::EleSelectionProducers(const edm::ParameterSet& iConfig): produces< SelectionMap >("medium50nsRun2"); produces< SelectionMap >("tight50nsRun2"); produces< SelectionMap >("medium25nsRun2Boff"); + produces< SelectionMap >("looseElectronStream"); + produces< SelectionMap >("mediumElectronStream"); + produces< SelectionMap >("tightElectronStream"); //now do what ever other initialization is needed } @@ -226,6 +239,12 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i std::vector medium25nsRun2Boff_vec; std::auto_ptr mediumMap25nsRun2Boff(new SelectionMap()); + std::vector looseElectronStream_vec; + std::vector mediumElectronStream_vec; + std::vector tightElectronStream_vec; + std::auto_ptr looseElectronStreamMap(new SelectionMap()); + std::auto_ptr mediumElectronStreamMap(new SelectionMap()); + std::auto_ptr tightElectronStreamMap(new SelectionMap()); //------------------------------ ELECTRON iEvent.getByToken(electronsToken_, electronsHandle); @@ -279,6 +298,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i pat::strbitset medium50nsRun2_ret; pat::strbitset tight50nsRun2_ret; pat::strbitset medium25nsRun2Boff_ret; + pat::strbitset looseElectronStream_ret; + pat::strbitset mediumElectronStream_ret; + pat::strbitset tightElectronStream_ret; fiducial_selector(eleRef, fiducial_ret); @@ -320,6 +342,13 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i medium25nsRun2Boff_selector(eleRef, medium25nsRun2Boff_ret); medium25nsRun2Boff_vec.push_back(medium25nsRun2Boff_selector.result()); + looseElectronStream_selector(eleRef, looseElectronStream_ret); + mediumElectronStream_selector(eleRef, mediumElectronStream_ret); + tightElectronStream_selector(eleRef, tightElectronStream_ret); + looseElectronStream_vec.push_back(looseElectronStream_selector.result()); + mediumElectronStream_vec.push_back(mediumElectronStream_selector.result()); + tightElectronStream_vec.push_back(tightElectronStream_selector.result()); + if(((bool)tight_selector.result())) { if(!(bool) medium_selector.result() || !(bool) loose_selector.result()) { edm::LogError("Incoherent selection") << "passing tight but not medium or loose"; @@ -362,9 +391,23 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i } } + if(((bool)tightElectronStream_selector.result())) { + if(!(bool) mediumElectronStream_selector.result() || !(bool) looseElectronStream_selector.result()) { + edm::LogError("Incoherent selection") << "passing tight but not medium or loose for electron stream"; + exit (1); + } + } + + if(((bool)mediumElectronStream_selector.result())) { + if( !(bool) looseElectronStream_selector.result()) { + edm::LogError("Incoherent selection") << "passing medium but not loose for electron stream"; + exit (1); + } + } // WP80_PU_vec.push_back((SelectionValue_t)WP80_PU_selector.bitMask()); // WP90_PU_vec.push_back((SelectionValue_t)WP90_PU_selector.bitMask()); + #ifdef DEBUG std::cout << "[DEBUG] WP80 ret=" << WP80_PU_selector.bitMask() << std::endl; std::cout << "[DEBUG] WP80 ret= (float)" << (SelectionValue_t) WP80_PU_selector.bitMask() << std::endl; @@ -390,6 +433,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i SelectionMap::Filler medium50nsRun2_filler(*mediumMap50nsRun2); SelectionMap::Filler tight50nsRun2_filler(*tightMap50nsRun2); SelectionMap::Filler medium25nsRun2Boff_filler(*mediumMap25nsRun2Boff); + SelectionMap::Filler looseElectronStream_filler(*looseElectronStreamMap); + SelectionMap::Filler mediumElectronStream_filler(*mediumElectronStreamMap); + SelectionMap::Filler tightElectronStream_filler(*tightElectronStreamMap); //fill and insert valuemap fiducial_filler.insert(electronsHandle, fiducial_vec.begin(), fiducial_vec.end()); @@ -406,6 +452,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i medium50nsRun2_filler.insert(electronsHandle, medium50nsRun2_vec.begin(), medium50nsRun2_vec.end()); tight50nsRun2_filler.insert(electronsHandle, tight50nsRun2_vec.begin(), tight50nsRun2_vec.end()); medium25nsRun2Boff_filler.insert(electronsHandle, medium25nsRun2Boff_vec.begin(), medium25nsRun2Boff_vec.end()); + looseElectronStream_filler.insert(electronsHandle,looseElectronStream_vec.begin(),looseElectronStream_vec.end()); + mediumElectronStream_filler.insert(electronsHandle,mediumElectronStream_vec.begin(),mediumElectronStream_vec.end()); + tightElectronStream_filler.insert(electronsHandle,tightElectronStream_vec.begin(),tightElectronStream_vec.end()); fiducial_filler.fill(); @@ -422,6 +471,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i medium50nsRun2_filler.fill(); tight50nsRun2_filler.fill(); medium25nsRun2Boff_filler.fill(); + looseElectronStream_filler.fill(); + mediumElectronStream_filler.fill(); + tightElectronStream_filler.fill(); //------------------------------ @@ -440,6 +492,10 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i iEvent.put(mediumMap50nsRun2, "medium50nsRun2"); iEvent.put(tightMap50nsRun2, "tight50nsRun2"); iEvent.put(mediumMap25nsRun2Boff, "medium25nsRun2Boff"); + iEvent.put(looseElectronStreamMap, "looseElectronStream"); + iEvent.put(mediumElectronStreamMap, "mediumElectronStream"); + iEvent.put(tightElectronStreamMap, "tightElectronStream"); + } // ------------ method called once each job just before starting event loop ------------ From d5bdb3483c4ba8cf9072e42d0f4352a768f20551 Mon Sep 17 00:00:00 2001 From: Shervin Nourbakhsh Date: Thu, 16 Jun 2016 09:17:49 +0200 Subject: [PATCH 12/30] tightID for stream in patSequence (commented) --- ZNtupleDumper/python/patSequence_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ZNtupleDumper/python/patSequence_cff.py b/ZNtupleDumper/python/patSequence_cff.py index fcc8040cd3b..e5f7d9636aa 100644 --- a/ZNtupleDumper/python/patSequence_cff.py +++ b/ZNtupleDumper/python/patSequence_cff.py @@ -53,6 +53,7 @@ # loose50nsRun2 = cms.InputTag("eleSelectionProducers", "loose50nsRun2"), # medium50nsRun2 = cms.InputTag("eleSelectionProducers", "medium50nsRun2"), # tight50nsRun2 = cms.InputTag("eleSelectionProducers", "tight50nsRun2") +# tightElectronStream = cms.InputTag("eleSelectionProducers", "tightElectronStream") # ) electronMatch.src=cms.InputTag('gedGsfElectrons') From 7606f8f80a2a5c966a02387336b8441790fab9b0 Mon Sep 17 00:00:00 2001 From: Shervin Nourbakhsh Date: Thu, 16 Jun 2016 09:05:00 +0200 Subject: [PATCH 13/30] add ele stream paths to alcaSkimming --- EcalAlCaRecoProducers/python/alcaSkimming.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index 7f7f3182a2a..a963f11f58d 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -157,6 +157,9 @@ process.load('Calibration.EcalAlCaRecoProducers.ALCARECOEcalUncalIsolElectron_cff') # reduction of recHits process.load('Calibration.EcalAlCaRecoProducers.ALCARECOEcalUncalIsolElectron_Output_cff') +from Calibration.EcalAlCaRecoProducers.ALCARECOEcalCalIsolElectron_cff import * +from Calibration.EcalAlCaRecoProducers.ALCARECOEcalUncalIsolElectron_cff import * + # this module provides: # process.seqALCARECOEcalRecalElectron process.load('Calibration.EcalAlCaRecoProducers.ALCARECOEcalRecalIsolElectron_cff') @@ -321,6 +324,15 @@ process.ZEEHltFilter.HLTPaths = [ "HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_*"] process.filterSeq *= process.ZEEHltFilter + + +##for the stream +process.pathALCARECOEcalCalWElectronStream = cms.Path(seqALCARECOEcalCalWElectronStream) +process.pathALCARECOEcalUncalWElectronStream = cms.Path(seqALCARECOEcalUncalWElectronStream) +process.pathALCARECOEcalCalZElectronStream = cms.Path(seqALCARECOEcalCalZElectronStream) +process.pathALCARECOEcalUncalZElectronStream = cms.Path(seqALCARECOEcalUncalZElectronStream) + + from HLTrigger.HLTfilters.hltHighLevel_cfi import * process.NtupleFilter = copy.deepcopy(hltHighLevel) process.NtupleFilter.throw = cms.bool(False) From ec5b98c2bebcadb558abd5643182514a70556814 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Mon, 11 Apr 2016 13:34:47 +0200 Subject: [PATCH 14/30] add noDrop sequence for electron stream --- .../python/ALCARECOEcalCalIsolElectron_Output_cff.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py index 3d717a3cfe4..e47d73362a4 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py @@ -83,6 +83,12 @@ OutALCARECOEcalCalWElectron_noDrop.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('pathALCARECOEcalCalWElectron') ) +OutALCARECOEcalCalWElectronStream=copy.deepcopy(OutALCARECOEcalCalElectron) +OutALCARECOEcalCalWElectronStream_noDrop=copy.deepcopy(OutALCARECOEcalCalElectron_noDrop) +OutALCARECOEcalCalWElectronStream.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalWElectronStream') ) +OutALCARECOEcalCalWElectronStream_noDrop.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalWElectronStream') ) OutALCARECOEcalCalZElectron=copy.deepcopy(OutALCARECOEcalCalElectron) OutALCARECOEcalCalZElectron_noDrop=copy.deepcopy(OutALCARECOEcalCalElectron_noDrop) From 54edc26c725abf3ce9c1dd650ecfb6205055ed16 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Fri, 6 Nov 2015 12:21:15 +0100 Subject: [PATCH 15/30] update calibration cfg files --- ZFitter/data/validation/EoverPcalibration.dat | 36 +++++++++++++++++-- .../data/validation/MC_EoverPcalibration.dat | 16 +++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 ZFitter/data/validation/MC_EoverPcalibration.dat diff --git a/ZFitter/data/validation/EoverPcalibration.dat b/ZFitter/data/validation/EoverPcalibration.dat index e309dd86910..9062ab1897a 100644 --- a/ZFitter/data/validation/EoverPcalibration.dat +++ b/ZFitter/data/validation/EoverPcalibration.dat @@ -7,5 +7,37 @@ #d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit50ns.root #d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit25ns.root #d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit25ns.root -d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_oldweight.root -d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_oldweight.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_oldweight.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_oldweight.root + + +d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_256584-257611_extraCalibTree.root +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_256584-257611.root +d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_257612-258158_extraCalibTree.root +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_257612-258158.root +d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v4-25nsReco_258159-258959_extraCalibTree.root +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v4-25nsReco_258159-258959.root + +d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_256584-257611_extraCalibTree.root +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_256584-257611.root +d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_257612-258158_extraCalibTree.root +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_257612-258158.root +d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco_258159-258959_extraCalibTree.root +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco_258159-258959.root + + +s extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_256584-257611_extraCalibTree.root +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_256584-257611.root +s extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_257612-258158_extraCalibTree.root +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco_257612-258158.root +s extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v4-25nsReco_258159-258959_extraCalibTree.root +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/SingleElectron-WSkim-Run2015D-Prompt-v4-25nsReco_258159-258959.root + +s extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_256584-257611_extraCalibTree.root +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_256584-257611.root +s extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_257612-258158_extraCalibTree.root +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco_257612-258158.root +s extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco_258159-258959_extraCalibTree.root +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco_258159-258959.root + + diff --git a/ZFitter/data/validation/MC_EoverPcalibration.dat b/ZFitter/data/validation/MC_EoverPcalibration.dat new file mode 100644 index 00000000000..eee6da9d17f --- /dev/null +++ b/ZFitter/data/validation/MC_EoverPcalibration.dat @@ -0,0 +1,16 @@ +#################input list for the E/p calibration ############################ +#d selected /afs/cern.ch/user/l/lbrianza/work/public/ntuple_numEvent100.root +#d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/extraCalibTree.root +#d selected /afs/cern.ch/user/l/lbrianza/work/public/RUND_DoubleElectron.root + +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit50ns.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit50ns.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit25ns.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit25ns.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_oldweight.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_oldweight.root + +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DYJets_amctnlo-RunIISpring15DR74-Asym25ns-allRange.root + +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DYJets_amctnlo-RunIISpring15DR74-Asym25ns-allRange.root + From 2f743f755eae62c3c0c5ab6d3dcb944de566b32e Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 7 Nov 2015 16:31:10 +0100 Subject: [PATCH 16/30] script to do every calibration --- ZFitter/submit_on_lxbatch.py | 123 +++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 ZFitter/submit_on_lxbatch.py diff --git a/ZFitter/submit_on_lxbatch.py b/ZFitter/submit_on_lxbatch.py new file mode 100644 index 00000000000..d89308f2465 --- /dev/null +++ b/ZFitter/submit_on_lxbatch.py @@ -0,0 +1,123 @@ +#! /usr/bin/env python +import os +import glob +import math +from array import array +import sys +import time +import subprocess + +currentDir = os.getcwd(); +CMSSWDir = currentDir+"/../"; + +applyPcorr = ["False","True"]; +applyEcorr = ["False"]; +split = ["0","1"]; +cut = ["100.","0.05","0.10","0.15","0.20","0.30","0.50"]; +smoothCut = ["0","1"]; +energyType = ["0"]; + + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + fn = "Job/Job_"+"EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; + outScript = open(fn+".sh","w"); + command = "ZFitter.exe -f data/validation/EoverPcalibration.dat --EOverPCalib --outputPath output_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EB"+" --splitStat "+split[b]+" --nLoops 15 --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale momentumCalibration2015_EB_pTk.root --applyEcorr "+applyEcorr[f]+" --inputEnergyScale momentumCalibration2015_EB_rawE.root" + print command; + outScript.write('#!/bin/bash'); + outScript.write("\n"+'cd '+CMSSWDir); + outScript.write("\n"+'eval `scram runtime -sh`'); + outScript.write("\n"+'cd '+currentDir); + outScript.write("\n"+command); + outScript.close(); + os.system("chmod 777 "+currentDir+"/"+fn+".sh"); + command2 = "bsub -q cmscaf1nd -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; + os.system(command2); + print command2 + + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + fn = "Job/Job_"+"EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; + outScript = open(fn+".sh","w"); + command = "ZFitter.exe -f data/validation/EoverPcalibration.dat --EOverPCalib --outputPath output_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EE"+" --splitStat "+split[b]+" --nLoops 15 --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale momentumCalibration2015_EE_pTk.root --applyEcorr "+applyEcorr[f]+" --inputEnergyScale momentumCalibration2015_EE_rawE.root" + print command; + outScript.write('#!/bin/bash'); + outScript.write("\n"+'cd '+CMSSWDir); + outScript.write("\n"+'eval `scram runtime -sh`'); + outScript.write("\n"+'cd '+currentDir); + outScript.write("\n"+command); + outScript.close(); + os.system("chmod 777 "+currentDir+"/"+fn+".sh"); + command2 = "bsub -q cmscaf1nd -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; + os.system(command2); + print command2 + + +createAndPlotIC = "createAndPlotIC.sh" +out2 = open(createAndPlotIC,"w") + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + name = "EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] + fn = "cfg/calibrationPlots_"+name+".py"; + folder = "output_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + outScript = open(fn,"w"); + outScript.write("import FWCore.ParameterSet.Config as cms"); + outScript.write("\nprocess = cms.Process(\"calibrationPlotsEBparameters\")") + outScript.write("\nprocess.Options = cms.PSet(") + outScript.write("\ninFileName = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB.root\"),") + outScript.write("\ninFileNameEven = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_even.root\"),") + outScript.write("\ninFileNameOdd = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_odd.root\"),") + outScript.write("\nnEtaBinsEB = cms.int32(1),") + outScript.write("\nnEtaBinsEE = cms.int32(1),") + outScript.write("\nis2012Calib = cms.bool(False),") + outScript.write("\nisEB = cms.bool(True),") + outScript.write("\nevalStat = cms.int32(1),") + outScript.write("\noutputFolder = cms.string(\""+folder+"\"),") + outScript.write("\noutFileName = cms.string(\""+name+".root\"),") + outScript.write("\noutputTxt = cms.string(\"IC_"+name+"\"),") + outScript.write("\nfileType = cms.string(\"cxx\")") + outScript.write("\n)") + out2.write("\nCalibrationPlots "+fn) + + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + name = "EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] + fn = "cfg/calibrationPlots_"+name+".py"; + folder = "output_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + outScript = open(fn,"w"); + outScript.write("import FWCore.ParameterSet.Config as cms"); + outScript.write("\nprocess = cms.Process(\"calibrationPlotsEEparameters\")") + outScript.write("\nprocess.Options = cms.PSet(") + outScript.write("\ninFileName = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE.root\"),") + outScript.write("\ninFileNameEven = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_even.root\"),") + outScript.write("\ninFileNameOdd = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_odd.root\"),") + outScript.write("\nnEtaBinsEB = cms.int32(1),") + outScript.write("\nnEtaBinsEE = cms.int32(1),") + outScript.write("\nis2012Calib = cms.bool(False),") + outScript.write("\nisEB = cms.bool(False),") + outScript.write("\nevalStat = cms.int32(1),") + outScript.write("\noutputFolder = cms.string(\""+folder+"\"),") + outScript.write("\noutFileName = cms.string(\""+name+".root\"),") + outScript.write("\noutputTxt = cms.string(\"IC_"+name+"\"),") + outScript.write("\nfileType = cms.string(\"cxx\")") + outScript.write("\n)") + out2.write("\nCalibrationPlots "+fn) From cbc9a2f7c3d8e2d7c678d5bd86232e9e774650ee Mon Sep 17 00:00:00 2001 From: lbrianza Date: Mon, 21 Dec 2015 16:37:32 +0100 Subject: [PATCH 17/30] gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index d175ee75b4a..30937e3b9bb 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ prod_alcarereco *.png *.eps *.pdf + +LSF* +ZFitter/output* \ No newline at end of file From 5b62676a7b992989cbe5f0dbaafcd7cbba64a67f Mon Sep 17 00:00:00 2001 From: lbrianza Date: Tue, 22 Dec 2015 11:36:40 +0100 Subject: [PATCH 18/30] changes to allow running the code immediately --- .../validation/EoverPcalibration_test.dat | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ZFitter/data/validation/EoverPcalibration_test.dat diff --git a/ZFitter/data/validation/EoverPcalibration_test.dat b/ZFitter/data/validation/EoverPcalibration_test.dat new file mode 100644 index 00000000000..f061a15861d --- /dev/null +++ b/ZFitter/data/validation/EoverPcalibration_test.dat @@ -0,0 +1,36 @@ +#################input list for the E/p calibration ############################ +#d selected /afs/cern.ch/user/l/lbrianza/work/public/ntuple_numEvent100.root +#d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/extraCalibTree.root +#d selected /afs/cern.ch/user/l/lbrianza/work/public/RUND_DoubleElectron.root + +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit50ns.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit50ns.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit25ns.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit25ns.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_oldweight.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_oldweight.root + + +d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/256584-257611/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/256584-257611/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root +d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root +d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco/258159-260737/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco/258159-260737/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root + +d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root + + + + +s extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/256584-257611/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/256584-257611/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root +s extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root +s extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco/258159-260737/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/DoubleEG-ZSkim-Run2015D-Prompt-v4-25nsReco/258159-260737/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root + +s extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/extraCalibTree-unmerged-allRange.root +s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Nov2015_PS_v3/SingleElectron-WSkim-Run2015D-Prompt-v3-25nsReco/257612-258158/246908-260426-Prompt_25ns-v1-full5x5fix-golden_silver/eop/unmerged-allRange.root + From 213109af2e26d0f78d8b2b73797d4758eb0dafef Mon Sep 17 00:00:00 2001 From: lbrianza Date: Thu, 16 Jul 2015 22:33:04 +0200 Subject: [PATCH 19/30] add some library for laser monitoring with E/p --- .../interface/ConvoluteTemplate.h | 14 ++ EOverPCalibration/interface/histoFunc.h | 87 ++++++++++ EOverPCalibration/interface/ntpleUtils2.h | 79 +++++++++ EOverPCalibration/interface/stabilityUtils.h | 20 +++ EOverPCalibration/src/ConvoluteTemplate.cc | 157 ++++++++++++++++++ EOverPCalibration/src/ntpleUtils2.cc | 83 +++++++++ EOverPCalibration/src/stabilityUtils.cc | 98 +++++++++++ 7 files changed, 538 insertions(+) create mode 100644 EOverPCalibration/interface/ConvoluteTemplate.h create mode 100644 EOverPCalibration/interface/histoFunc.h create mode 100644 EOverPCalibration/interface/ntpleUtils2.h create mode 100644 EOverPCalibration/interface/stabilityUtils.h create mode 100644 EOverPCalibration/src/ConvoluteTemplate.cc create mode 100644 EOverPCalibration/src/ntpleUtils2.cc create mode 100644 EOverPCalibration/src/stabilityUtils.cc diff --git a/EOverPCalibration/interface/ConvoluteTemplate.h b/EOverPCalibration/interface/ConvoluteTemplate.h new file mode 100644 index 00000000000..745b2d8945a --- /dev/null +++ b/EOverPCalibration/interface/ConvoluteTemplate.h @@ -0,0 +1,14 @@ +#ifndef ConvoluteTemplate_h +#define ConvoluteTemplate_h + +#include "histoFunc.h" + +#include "TH1.h" +#include "TF1.h" +#include "TVirtualFFT.h" + + +TH1F* ConvoluteTemplate(const std::string& name, TH1F* h_template, TH1F* h_smearing, + int nPoints, double min, double max); + +#endif diff --git a/EOverPCalibration/interface/histoFunc.h b/EOverPCalibration/interface/histoFunc.h new file mode 100644 index 00000000000..956d87a6568 --- /dev/null +++ b/EOverPCalibration/interface/histoFunc.h @@ -0,0 +1,87 @@ +#ifndef histoFunc_h +#define histoFunc_h + +#include "TH1.h" + + + + + + +class histoFunc +{ + public: + + + //! ctor + histoFunc(TH1F* histo) + { + histo_p = histo; + }; + + + //! dtor + ~histoFunc() + {}; + + + //! operator() + double operator()(double* x, double* par) + { + double xx = par[1] * (x[0] - par[2]); + + double xMin = histo_p -> GetBinCenter(1); + double xMax = histo_p -> GetBinCenter(histo_p -> GetNbinsX()); + + + + if( (xx < xMin) || (xx >= xMax) ) + return 1.e-10; + + else + { + int bin = histo_p -> FindBin(xx); + int bin1 = 0; + int bin2 = 0; + + if(xx >= histo_p -> GetBinCenter(bin)) + { + bin1 = bin; + bin2 = bin+1; + } + + else + { + bin1 = bin-1; + bin2 = bin; + } + + + double x1 = histo_p -> GetBinCenter(bin1); + double y1 = histo_p -> GetBinContent(bin1); + + double x2 = histo_p -> GetBinCenter(bin2); + double y2 = histo_p -> GetBinContent(bin2); + + double m = 1. * (y2 - y1) / (x2 - x1); + + + + if( (y1 + m * (xx - x1)) < 1.e-10) + return 1.e-10; + + + return par[0] * par[1] * (y1 + m * (xx - x1)); + } + + return 1.e-10; + } + + + + private: + + TH1F* histo_p; +}; + +#endif diff --git a/EOverPCalibration/interface/ntpleUtils2.h b/EOverPCalibration/interface/ntpleUtils2.h new file mode 100644 index 00000000000..d88d3838133 --- /dev/null +++ b/EOverPCalibration/interface/ntpleUtils2.h @@ -0,0 +1,79 @@ +#ifndef ntupleUtils2_h +#define ntupleUtils2_h + +#include +#include +#include +#include + + +#include "TFile.h" +#include "TChain.h" +#include "TCanvas.h" +#include "TH1F.h" +#include "TF1.h" + +#ifdef _MAKECINT_ +#pragma link C++ class vector+; +#pragma link C++ class vector+; +#pragma link C++ class map+; +#pragma link C++ class map+; +#endif + + +extern TH1F* templateHisto; +extern TF1* templateFunc; + +extern std::vector* mydata; + +void FitTemplate(const bool& draw = false); + +/*** double crystall ball ***/ +double crystalBallLowHigh_v2(double* x, double* par); + +/*** time sort a tree ***/ +struct Sorter +{ + int time; + int entry; + + bool operator() (const Sorter& s1, const Sorter& s2) + { + return s1.time < s2.time; + } +}; + +/*** time sort a tree ***/ +struct myEvent +{ + int runId; + int timeStampHigh; + + int region; + + float scE; + float P; + + float scLaserCorr; + float seedLaserAlpha; + + bool operator() (const myEvent& s1, const myEvent& s2) + { + return s1.timeStampHigh < s2.timeStampHigh; + } +}; + +/*** time sort a tree ***/ +struct SorterLC +{ + float laserCorr; + int entry; + + bool operator() (const SorterLC& s1, const SorterLC& s2) + { + return s1.laserCorr < s2.laserCorr; + } +}; + + +#endif diff --git a/EOverPCalibration/interface/stabilityUtils.h b/EOverPCalibration/interface/stabilityUtils.h new file mode 100644 index 00000000000..e69c4d97885 --- /dev/null +++ b/EOverPCalibration/interface/stabilityUtils.h @@ -0,0 +1,20 @@ +#ifndef stabilityUtils_h +#define stabilityUtils_h + +#include "histoFunc.h" + +#include +#include + +#include "TH1F.h" +#include "TF1.h" + + + +int dateToInt(const std::string& date); + +void SetHistoStyle(TH1* h, const std::string& label = ""); + +TH1F* MellinConvolution(const std::string& name, TH1F* h_template, TH1F* h_Las); + +#endif diff --git a/EOverPCalibration/src/ConvoluteTemplate.cc b/EOverPCalibration/src/ConvoluteTemplate.cc new file mode 100644 index 00000000000..dce8053f1fb --- /dev/null +++ b/EOverPCalibration/src/ConvoluteTemplate.cc @@ -0,0 +1,157 @@ +#include "../interface/ConvoluteTemplate.h" + + + +TH1F* ConvoluteTemplate(const std::string& name, TH1F* h_template, TH1F* h_smearing, + int nPoints, double min, double max) +{ + double width = 1.*(max-min)/nPoints; + + double* FFT_re_func1 = new double[nPoints]; + double* FFT_im_func1 = new double[nPoints]; + double* FFT_re_func2 = new double[nPoints]; + double* FFT_im_func2 = new double[nPoints]; + double* FFT_re_convolution = new double[nPoints]; + double* FFT_im_convolution = new double[nPoints]; + + + + //----------------------------- + // define the initial functions + + char funcName[50]; + + + sprintf(funcName,"f_template_temp"); + histoFunc* hf_template = new histoFunc(h_template); + TF1* f_template = new TF1(funcName, hf_template, min, max, 3, "histoFunc"); + + f_template -> FixParameter(0,1.); + f_template -> FixParameter(1,1.); + f_template -> FixParameter(2,0.); + + + sprintf(funcName,"f_smearing_temp"); + histoFunc* hf_smearing = new histoFunc(h_smearing); + TF1* f_smearing = new TF1(funcName, hf_smearing, min, max, 3, "histoFunc"); + f_smearing -> FixParameter(0,1.); + f_smearing -> FixParameter(1,1.); + f_smearing -> FixParameter(2,-1.*h_smearing->GetMean()); + + + // use a gaussian as smearing function + //TF1* f_smearing = new TF1("f_smearing","1./([0]*sqrt(2.*3.14159))*exp(-1.*x*x/(2.*[0]*[0]))",min,max); + //f_smearing -> FixParameter(0,0.05); + + + + //----------------------------------------- + // define the histograms to contain the FFT + TH1D* h_func1 = new TH1D("h_func1", "",nPoints,min,max); + TH1D* h_func1_FFT = new TH1D("h_func1_FFT","",nPoints,min,max); + + TH1D* h_func2 = new TH1D("h_func2", "",nPoints,min,max); + TH1D* h_func2_FFT = new TH1D("h_func2_FFT","",nPoints,min,max); + + for(int bin = 1; bin <= nPoints; ++bin) + { + h_func1 -> SetBinContent(bin,f_template->Eval(min+width*(bin-1))); + h_func2 -> SetBinContent(bin,f_smearing->Eval(min+width*(bin-1))); + } + + //h_func1 -> Write(); + //h_func2 -> Write(); + + + + //----------- + // do the FFT + + h_func1 -> FFT(h_func1_FFT,"MAG R2C M"); + TVirtualFFT* FFT_func1 = TVirtualFFT::GetCurrentTransform(); + FFT_func1 -> GetPointsComplex(FFT_re_func1,FFT_im_func1); + FFT_func1 -> Delete(); + + h_func2 -> FFT(h_func2_FFT, "MAG R2C M"); + TVirtualFFT* FFT_func2 = TVirtualFFT::GetCurrentTransform(); + FFT_func2 -> GetPointsComplex(FFT_re_func2,FFT_im_func2); + FFT_func2 -> Delete(); + + + + //--------------------------------- + // convolution in the Fourier space + + for(int bin = 1; bin <= nPoints; ++bin) + { + FFT_re_convolution[bin-1] = FFT_re_func1[bin-1]*FFT_re_func2[bin-1] - FFT_im_func1[bin-1]*FFT_im_func2[bin-1]; + FFT_im_convolution[bin-1] = FFT_re_func1[bin-1]*FFT_im_func2[bin-1] + FFT_im_func1[bin-1]*FFT_re_func2[bin-1]; + } + + + + //---------------- + // do the anti FFT + + TVirtualFFT* AFFT_convolution = TVirtualFFT::FFT(1, &nPoints, "C2R M K"); + AFFT_convolution -> SetPointsComplex(FFT_re_convolution,FFT_im_convolution); + AFFT_convolution -> Transform(); + + TH1* h_convolution_temp = NULL; + h_convolution_temp = TH1::TransformHisto(AFFT_convolution,h_convolution_temp,"Re"); + h_convolution_temp -> SetName("h_convolution_temp"); + h_convolution_temp -> Scale((max-min)/nPoints/nPoints); + AFFT_convolution -> Delete(); + + TH1D* h_convolution = new TH1D("h_convolution","",nPoints,min,max); + for(int bin = 1; bin <= nPoints; ++bin) + { + h_convolution -> Fill((max-min)/nPoints*(bin-1),h_convolution_temp->GetBinContent(bin)); + } + + histoFunc* convolutionHistoFunc = new histoFunc((TH1F*)(h_convolution)); + TF1* f_convolution = new TF1("f_convolution", convolutionHistoFunc, min, max, 3, "histoFunc"); + f_convolution -> FixParameter(0, 1); + f_convolution -> FixParameter(1, 1); + f_convolution -> FixParameter(2, 0.); + + + + int nBins = h_template->GetNbinsX(); + float xMin = h_template->GetBinLowEdge(1); + float xMax = h_template->GetBinLowEdge(nBins) + h_template->GetBinWidth(nBins); + float xWidth = (xMax-xMin)/nBins; + TH1F* h_final = new TH1F(name.c_str(),"",nBins,xMin,xMax); + + for(int bin = 1; bin <=nBins; ++bin) + { + float xMinBin = h_final->GetBinLowEdge(bin); + float xMaxBin = h_final->GetBinLowEdge(bin) + xWidth; + + h_final -> SetBinContent(bin,f_convolution->Integral(xMinBin,xMaxBin)/xWidth); + } + + h_final -> Scale(h_template->Integral()/h_final->Integral()); + //h_final -> Write(); + + + + f_template -> Delete(); + f_smearing -> Delete(); + + h_func1_FFT -> Delete(); + h_func1 -> Delete(); + + h_func2_FFT -> Delete(); + h_func2 -> Delete(); + + h_convolution_temp -> Delete(); + h_convolution -> Delete(); + + f_convolution -> Delete(); + delete convolutionHistoFunc; + + + + return h_final; +} diff --git a/EOverPCalibration/src/ntpleUtils2.cc b/EOverPCalibration/src/ntpleUtils2.cc new file mode 100644 index 00000000000..486097c5d85 --- /dev/null +++ b/EOverPCalibration/src/ntpleUtils2.cc @@ -0,0 +1,83 @@ +#include "../interface/ntpleUtils2.h" + +TH1F* templateHisto; +TF1* templateFunc; + +std::vector* mydata; + +/*** fit the template ***/ +void FitTemplate(const bool& draw) +{ + TCanvas* c_template; + if( draw ) + { + c_template = new TCanvas("c_template","template"); + c_template -> cd(); + c_template -> SetGridx(); + c_template -> SetGridy(); + + templateHisto -> Scale(1./templateHisto->GetEntries()); + templateHisto -> SetFillColor(kCyan+2); + templateHisto -> Draw(); + } + + templateFunc = new TF1("templateFunc", crystalBallLowHigh_v2, 0., 10., 8); + templateFunc -> SetNpx(10000); + templateFunc -> SetLineWidth(2); + templateFunc -> SetLineColor(kRed); + + templateFunc -> SetParameters(templateHisto->GetMaximum(),1.,0.05,1.,2.,2.,1.,1.); + templateFunc -> FixParameter(7,1.); + templateFunc -> SetParLimits(3,0.,10.); + templateFunc -> SetParLimits(5,0.,10.); + + templateFunc -> SetParName(0,"N"); + templateFunc -> SetParName(1,"#mu"); + templateFunc -> SetParName(2,"#sigma"); + templateFunc -> SetParName(3,"#alpha_{high}"); + templateFunc -> SetParName(4,"n_{high}"); + templateFunc -> SetParName(5,"#alpha_{low}"); + templateFunc -> SetParName(6,"n_{low}"); + + templateHisto -> Fit("templateFunc","NQR+","",0.5,3.); + + if( draw ) + templateFunc -> Draw("same"); +} + + +/*** double crystall ball ***/ +double crystalBallLowHigh_v2(double* x, double* par) +{ + //[0] = N + //[1] = mean + //[2] = sigma + //[3] = alpha + //[4] = n + //[5] = alpha2 + //[6] = n2 + //[7] = scale + double xx = x[0] * par[7]; + double mean = par[1]; + double sigma = par[2]; + double alpha = par[3]; + double n = par[4]; + double alpha2 = par[5]; + double n2 = par[6]; + if( (xx-mean)/sigma > fabs(alpha) ) + { + double A = pow(n/fabs(alpha), n) * exp(-0.5 * alpha*alpha); + double B = n/fabs(alpha) - fabs(alpha); + return par[0] * par[7] * A * pow(B + (xx-mean)/sigma, -1.*n); + } + else if( (xx-mean)/sigma < -1.*fabs(alpha2) ) + { + double A = pow(n2/fabs(alpha2), n2) * exp(-0.5 * alpha2*alpha2); + double B = n2/fabs(alpha2) - fabs(alpha2); + return par[0] * par[7] * A * pow(B - (xx-mean)/sigma, -1.*n2); + } + else + { + return par[0] * par[7] * exp(-1. * (xx-mean)*(xx-mean) / (2*sigma*sigma) ); + } +} diff --git a/EOverPCalibration/src/stabilityUtils.cc b/EOverPCalibration/src/stabilityUtils.cc new file mode 100644 index 00000000000..93b7fa23797 --- /dev/null +++ b/EOverPCalibration/src/stabilityUtils.cc @@ -0,0 +1,98 @@ +#include "../interface/stabilityUtils.h" + + + +int dateToInt(const std::string& date) +{ + int day,month,year; + + std::stringstream ss(date); + ss >> day >> month >> year; + + tm time; + time.tm_sec = 0; + time.tm_min = 0; + time.tm_hour = 0; + time.tm_mday = day; + time.tm_mon = month-1; + time.tm_year = year-1900; + return timegm(&time); +} + + + + + + +void SetHistoStyle(TH1* h, const std::string& label) +{ + h -> SetLineWidth(2); + + h -> GetXaxis() -> SetTitleSize(0.04); + h -> GetXaxis() -> SetLabelSize(0.04); + + h -> GetYaxis() -> SetTitleSize(0.04); + h -> GetYaxis() -> SetLabelSize(0.04); + + h -> GetYaxis() -> SetTitleOffset(1.5); + + if( label == "EoP") + { + h -> SetMarkerColor(kRed+2); + h -> SetLineColor(kRed+2); + h -> SetFillColor(kRed+2); + h -> SetFillStyle(3004); + h -> SetMarkerStyle(7); + } + + if( label == "EoC") + { + h -> SetMarkerColor(kGreen+2); + h -> SetLineColor(kGreen+2); + h -> SetFillColor(kGreen+2); + h -> SetFillStyle(3004); + h -> SetMarkerStyle(7); + } +} + + + + + + +TH1F* MellinConvolution(const std::string& name, TH1F* h_template, TH1F* h_Las) +{ + histoFunc* templateHistoFunc = new histoFunc(h_template); + + TF1* f_template = new TF1("f_template", templateHistoFunc, 0.8*(h_Las->GetMean()), 1.4*(h_Las->GetMean()), 3, "histoFunc"); + + f_template -> SetNpx(10000); + f_template -> FixParameter(0, 1.); + f_template -> SetParameter(1, 1.); + f_template -> FixParameter(2, 0.); + + TH1F* h_convolutedTemplate = (TH1F*)( h_template->Clone(name.c_str()) ); + h_convolutedTemplate -> Reset(); + + for(int bin = 1; bin <= h_Las->GetNbinsX(); ++bin) + { + float scale = h_Las->GetBinCenter(bin); + float weight = h_Las->GetBinContent(bin); + + if( weight > 0. ) + { + f_template -> SetParameter(0,weight); + f_template -> SetParameter(1,1./scale); + + for(int bin2 = 1; bin2 <= h_convolutedTemplate->GetNbinsX(); ++bin2) + { + float binCenter = h_convolutedTemplate -> GetBinCenter(bin2); + h_convolutedTemplate -> Fill(binCenter,f_template->Eval(binCenter)); + } + } + } + + h_convolutedTemplate -> Scale(h_template->Integral()/h_convolutedTemplate->Integral()); + + return h_convolutedTemplate; +} From c1aae08f925e530d2c06f2b08a5fe3518f728455 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Thu, 16 Jul 2015 22:34:10 +0200 Subject: [PATCH 20/30] add cfg file for laser monitoring with EP --- ZFitter/data/validation/monitoring_LC_with_EP_2015.dat | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ZFitter/data/validation/monitoring_LC_with_EP_2015.dat diff --git a/ZFitter/data/validation/monitoring_LC_with_EP_2015.dat b/ZFitter/data/validation/monitoring_LC_with_EP_2015.dat new file mode 100644 index 00000000000..1195553a769 --- /dev/null +++ b/ZFitter/data/validation/monitoring_LC_with_EP_2015.dat @@ -0,0 +1,7 @@ +#s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARECOSIM/DYJetsToLL_M-50_13TeV-Asympt50ns-pythia8_16Jun15_v3/allRange/v3/DYJetsToLL_M-50_13TeV-Asympt50ns-pythia8_16Jun15_v3-allRange.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/ntuple_DoubleElectron-ZSkim-RUN2015D-13Jul15-v1.root +#s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/ntuple_DoubleElectron-ZSkim-RUN2015D-13Jul15-v1.root +d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/ntuple.root +d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/extraCalibTree.root +s selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/ntuple.root +s extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/Run2015B_TEMP/extraCalibTree.root From 147e3db47419258238844f27a2ee3f991d288251 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Fri, 10 Jun 2016 11:55:54 +0200 Subject: [PATCH 21/30] fix bug in sequences for ntuple production --- .../python/ALCARECOEcalCalIsolElectron_Output_cff.py | 1 + EcalAlCaRecoProducers/python/alcaSkimming.py | 2 ++ ZNtupleDumper/python/elenewenergiesproducer_cfi.py | 2 +- ZNtupleDumper/python/eleselectionproducers_cfi.py | 2 +- ZNtupleDumper/python/patSequence_cff.py | 6 +++--- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py index e47d73362a4..9970f70f227 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py @@ -68,6 +68,7 @@ 'keep *CaloCluster*_*particleFlowEGamma*_*ESClusters*_*', 'keep *_hltFixedGridRhoFastjetAllCaloForMuons_*_*', #for electron stream 'keep *_hltMet_*_*', #for electron stream + 'keep *_*ecalMultiFitUncalibRecHit*_*_*', ) ) diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index a963f11f58d..9d7f08afd1e 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -654,6 +654,8 @@ process.NtuplePath = cms.Path(process.ntupleSeq) process.schedule = cms.Schedule(process.NtuplePath, process.NtupleEndPath) process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::ALCARECO') + if (options.electronStream): + process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::RECO') else: if(options.doTree==0): process.schedule = cms.Schedule(process.pathALCARECOEcalCalZElectron, process.pathALCARECOEcalCalWElectron, diff --git a/ZNtupleDumper/python/elenewenergiesproducer_cfi.py b/ZNtupleDumper/python/elenewenergiesproducer_cfi.py index 9131f9740bb..6155ba003ab 100644 --- a/ZNtupleDumper/python/elenewenergiesproducer_cfi.py +++ b/ZNtupleDumper/python/elenewenergiesproducer_cfi.py @@ -10,7 +10,7 @@ vertexCollection = cms.InputTag("offlinePrimaryVertices"), isHLT = cms.bool(False), ), - electronCollection = cms.InputTag("gedGsfElectrons"), + electronCollection = cms.InputTag("patElectrons"), photonCollection = cms.InputTag("photons"), ) diff --git a/ZNtupleDumper/python/eleselectionproducers_cfi.py b/ZNtupleDumper/python/eleselectionproducers_cfi.py index 8368d48fbbe..91dcf0f169a 100644 --- a/ZNtupleDumper/python/eleselectionproducers_cfi.py +++ b/ZNtupleDumper/python/eleselectionproducers_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms eleSelectionProducers = cms.EDProducer('EleSelectionProducers', - electronCollection = cms.InputTag('gedGsfElectrons'), + electronCollection = cms.InputTag('patElectrons'), rhoFastJet = cms.InputTag('kt6PFJetsForRhoCorrection',"rho"), vertexCollection = cms.InputTag('offlinePrimaryVertices'), conversionCollection = cms.InputTag('allConversions'), diff --git a/ZNtupleDumper/python/patSequence_cff.py b/ZNtupleDumper/python/patSequence_cff.py index e5f7d9636aa..f10a2797920 100644 --- a/ZNtupleDumper/python/patSequence_cff.py +++ b/ZNtupleDumper/python/patSequence_cff.py @@ -110,7 +110,7 @@ modifications = cms.VPSet( modPSet, cms.PSet( modifierName = cms.string('EleIDModifierFromValueMaps'), - electron_config = modPSet, + electron_config = modPSet.electron_config, ) ) ) @@ -124,8 +124,8 @@ prePatSequence = cms.Sequence() #(eleSelectionProducers )) postPatSequence = cms.Sequence(eleSelectionProducers * eleNewEnergiesProducer * slimmedECALELFElectrons ) patTriggerMatchSeq = cms.Sequence( patTrigger * PatElectronTriggerMatchHLTEle_Ele20SC4Mass50v7 * PatElectronsTriggerMatch * patTriggerEvent ) -#patSequence=cms.Sequence( prePatSequence * patElectrons * postPatSequence) -patSequence=cms.Sequence( prePatSequence * postPatSequence) +patSequence=cms.Sequence( prePatSequence * patElectrons * postPatSequence) +#patSequence=cms.Sequence( prePatSequence * postPatSequence) patSequenceMC=cms.Sequence( electronMatch * prePatSequence * patElectrons * postPatSequence) From 78fa9551c598325e3a78b61341c0b4213ac7d55e Mon Sep 17 00:00:00 2001 From: lbrianza Date: Fri, 10 Jun 2016 12:46:05 +0200 Subject: [PATCH 22/30] switch from hltMet to hltMetClean --- EcalAlCaRecoProducers/python/alcaSkimming.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index 9d7f08afd1e..8c654e3f9db 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -792,7 +792,7 @@ #process.zNtupleDumper.recHitCollectionEE = process.eleNewEnergiesProducer.recHitCollectionEE if (options.electronStream==1): - process.zNtupleDumper.caloMetCollection = cms.InputTag('hltMet') + process.zNtupleDumper.caloMetCollection = cms.InputTag('hltMetClean') process.zNtupleDumper.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') process.eleSelectionProducers.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') From de04ac12bd3a75c6d49999b56063decafcb619b9 Mon Sep 17 00:00:00 2001 From: Shervin Nourbakhsh Date: Thu, 16 Jun 2016 09:07:27 +0200 Subject: [PATCH 23/30] add ele id for electron stream in sequence and dumper --- EcalAlCaRecoProducers/python/alcaSkimming.py | 3 +++ ZNtupleDumper/plugins/ZNtupleDumper.cc | 21 ++++++++++++++------ ZNtupleDumper/python/patSequence_cff.py | 3 +++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index 8c654e3f9db..b7ab07b8d85 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -794,6 +794,9 @@ if (options.electronStream==1): process.zNtupleDumper.caloMetCollection = cms.InputTag('hltMetClean') process.zNtupleDumper.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') + process.zNtupleDumper.eleID_loose = cms.string('looseElectronStream') + process.zNtupleDumper.eleID_medium = cms.string('mediumElectronStream') + process.zNtupleDumper.eleID_tight = cms.string('tightElectronStream') process.eleSelectionProducers.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') if(options.type=="ALCARECOSIM"): diff --git a/ZNtupleDumper/plugins/ZNtupleDumper.cc b/ZNtupleDumper/plugins/ZNtupleDumper.cc index 39a68abe286..5f240fe9970 100644 --- a/ZNtupleDumper/plugins/ZNtupleDumper.cc +++ b/ZNtupleDumper/plugins/ZNtupleDumper.cc @@ -628,7 +628,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe skipEvent = false; std::string hltName_str(alcaSkimPathNames.triggerName(*alcaSkimPath_itr)); if(hltName_str.find("WElectronStream")!=std::string::npos) - eventType=WENU; + eventType=WSTREAM; else if(hltName_str.find("ZElectronStream")!=std::string::npos) eventType=ZEE; else if(hltName_str.find("WElectron") != std::string::npos) @@ -802,13 +802,22 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(! elePreselection(*eleIter1)) continue; - if(eventType == WENU) { + if(eventType == WENU || eventType == WSTREAM) { if(! (eleIter1->electronID(eleID_tight)) ) continue; if( nTight != 1 || nLoose > 0 ) continue; //to be a Wenu event request only 1 ele WP70 in the event // MET/MT selection - if( met.et() < 25. ) continue; - if( sqrt( 2.*eleIter1->et()*met.et() * (1 - cos(eleIter1->phi() - met.phi()))) < 50. ) continue; + if (eventType == WSTREAM) { + iEvent.getByToken(caloMetToken_, caloMetHandle); + if (caloMetHandle.isValid()==false) continue; + + if( caloMetHandle->at(0).pt() < 25. ) continue; + if( sqrt( 2.*eleIter1->et()*caloMetHandle->at(0).pt()*(1 -cos(eleIter1->phi()-caloMetHandle->at(0).phi()))) < 50. ) continue; + } + else { + if( met.et() < 25. ) continue; + if( sqrt( 2.*eleIter1->et()*met.et() * (1 - cos(eleIter1->phi() - met.phi()))) < 50. ) continue; + } if( eleIter1->et() < 30) continue; doFill = true; @@ -824,7 +833,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe TreeSetEleIDVar(*eleIter1, 0); TreeSetEleIDVar(*eleIter1, -1); } - } else if(eventType==WSTREAM) { + /* } else if(eventType==WSTREAM) { if(! eleIter1->electronID("tightElectronStream") ) continue; if (nEle!=1) continue; //if( nWP70 != 1 || nWP90 > 0 ) continue; //to be a Wenu event request only 1 ele WP70 in the event @@ -848,7 +857,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(doEleIDTree) { TreeSetEleIDVar(*eleIter1, 0); TreeSetEleIDVar(*eleIter1, -1); - } + } */ } else { //ZEE or UNKNOWN // take only the fist di-electron pair (highest pt) for(pat::ElectronCollection::const_iterator eleIter2 = eleIter1 + 1; diff --git a/ZNtupleDumper/python/patSequence_cff.py b/ZNtupleDumper/python/patSequence_cff.py index f10a2797920..4fbf186c203 100644 --- a/ZNtupleDumper/python/patSequence_cff.py +++ b/ZNtupleDumper/python/patSequence_cff.py @@ -102,6 +102,9 @@ loose50nsRun2 = cms.InputTag("eleSelectionProducers", "loose50nsRun2"), medium50nsRun2 = cms.InputTag("eleSelectionProducers", "medium50nsRun2"), tight50nsRun2 = cms.InputTag("eleSelectionProducers", "tight50nsRun2"), + looseElectronStream = cms.InputTag("eleSelectionProducers", "looseElectronStream"), + mediumElectronStream = cms.InputTag("eleSelectionProducers", "mediumElectronStream"), + tightElectronStream = cms.InputTag("eleSelectionProducers", "tightElectronStream"), ), photon_config = cms.PSet( ) ) From 995c9334543f8ec435779573c2b5839b725c4aa3 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Fri, 10 Jun 2016 16:21:59 +0200 Subject: [PATCH 24/30] add nodrop sequence for electron stream --- .../python/ALCARECOEcalCalIsolElectron_Output_cff.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py index 9970f70f227..4855874a705 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py @@ -99,5 +99,11 @@ OutALCARECOEcalCalZElectron_noDrop.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalZSCElectron') ) +OutALCARECOEcalCalZElectronStream=copy.deepcopy(OutALCARECOEcalCalElectron) +OutALCARECOEcalCalZElectronStream_noDrop=copy.deepcopy(OutALCARECOEcalCalElectron_noDrop) +OutALCARECOEcalCalZElectronStream.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectronStream') ) +OutALCARECOEcalCalZElectronStream_noDrop.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectronStream') ) From c185ccedad7cce8d17baf984bc871e44845625d2 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Sat, 11 Jun 2016 16:39:46 +0200 Subject: [PATCH 25/30] kepp hltMetClean --- .../python/ALCARECOEcalCalIsolElectron_Output_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py index 4855874a705..6b1cd447c21 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py @@ -67,7 +67,7 @@ 'keep *CaloCluster*_*particleFlowEGamma*_*EBEEClusters*_*', 'keep *CaloCluster*_*particleFlowEGamma*_*ESClusters*_*', 'keep *_hltFixedGridRhoFastjetAllCaloForMuons_*_*', #for electron stream - 'keep *_hltMet_*_*', #for electron stream + 'keep *_hltMetClean_*_*', #for electron stream 'keep *_*ecalMultiFitUncalibRecHit*_*_*', ) ) From a93dc703c37e0108480c6cbfeb7c01c649ab9f5b Mon Sep 17 00:00:00 2001 From: Shervin Nourbakhsh Date: Thu, 16 Jun 2016 10:48:53 +0200 Subject: [PATCH 26/30] fixing MET --- ZNtupleDumper/plugins/ZNtupleDumper.cc | 55 +++++--------------------- 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/ZNtupleDumper/plugins/ZNtupleDumper.cc b/ZNtupleDumper/plugins/ZNtupleDumper.cc index 5f240fe9970..52dfb2f0591 100644 --- a/ZNtupleDumper/plugins/ZNtupleDumper.cc +++ b/ZNtupleDumper/plugins/ZNtupleDumper.cc @@ -630,7 +630,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(hltName_str.find("WElectronStream")!=std::string::npos) eventType=WSTREAM; else if(hltName_str.find("ZElectronStream")!=std::string::npos) - eventType=ZEE; + eventType=ZSTREAM; else if(hltName_str.find("WElectron") != std::string::npos) eventType = WENU; else if(hltName_str.find("ZSCElectron") != std::string::npos) @@ -689,16 +689,14 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe iEvent.getByToken(beamSpotToken_, bsHandle); iEvent.getByToken(rhoToken_, rhoHandle); - iEvent.getByToken(metToken_, metHandle); iEvent.getByToken(recHitCollectionESToken_, ESRechitsHandle); - //if(metHandle.isValid()==false) iEvent.getByType(metHandle); - reco::PFMET met = metHandle.isValid() ? ((*metHandle))[0] : reco::PFMET(); /// \todo use corrected phi distribution - reco::CaloMET caloMet; - if (caloMetHandle.isValid()==true) { - iEvent.getByToken(caloMetToken_, caloMetHandle); - caloMet = ((*caloMetHandle))[0]; //get hlt met + iEvent.getByToken(metToken_, metHandle); + if (caloMetHandle.isValid()) { + iEvent.getByToken(caloMetToken_, caloMetHandle); } + reco::MET& met = (eventType == WSTREAM) ? caloMetHandle->at(0) : ((*metHandle))[0]; + //Here the HLTBits are filled. TriggerResults TreeSetEventSummaryVar(iEvent); @@ -807,21 +805,13 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if( nTight != 1 || nLoose > 0 ) continue; //to be a Wenu event request only 1 ele WP70 in the event // MET/MT selection - if (eventType == WSTREAM) { - iEvent.getByToken(caloMetToken_, caloMetHandle); - if (caloMetHandle.isValid()==false) continue; - - if( caloMetHandle->at(0).pt() < 25. ) continue; - if( sqrt( 2.*eleIter1->et()*caloMetHandle->at(0).pt()*(1 -cos(eleIter1->phi()-caloMetHandle->at(0).phi()))) < 50. ) continue; - } - else { - if( met.et() < 25. ) continue; - if( sqrt( 2.*eleIter1->et()*met.et() * (1 - cos(eleIter1->phi() - met.phi()))) < 50. ) continue; - } + if( met.et() < 25. ) continue; + if( sqrt( 2.*eleIter1->et()*met.et() * (1 - cos(eleIter1->phi() - met.phi()))) < 50. ) continue; + if( eleIter1->et() < 30) continue; doFill = true; - if(eventType == UNKNOWN) eventType = WENU; + if(eventType == UNKNOWN) eventType = WENU; //after selection it's clear that it's WENU TreeSetSingleElectronVar(*eleIter1, 0); //fill first electron TreeSetSingleElectronVar(*eleIter1, -1); // fill fake second electron @@ -833,31 +823,6 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe TreeSetEleIDVar(*eleIter1, 0); TreeSetEleIDVar(*eleIter1, -1); } - /* } else if(eventType==WSTREAM) { - if(! eleIter1->electronID("tightElectronStream") ) continue; - if (nEle!=1) continue; - //if( nWP70 != 1 || nWP90 > 0 ) continue; //to be a Wenu event request only 1 ele WP70 in the event - - iEvent.getByToken(caloMetToken_, caloMetHandle); - if (caloMetHandle.isValid()==false) continue; - - // MET/MT selection - if( caloMetHandle->at(0).pt() < 25. ) continue; - if( sqrt( 2.*eleIter1->et()*caloMetHandle->at(0).pt()*(1 -cos(eleIter1->phi()-caloMetHandle->at(0).phi()))) < 50. ) continue; - if( eleIter1->et()<30) continue; - doFill = true; - if(eventType == UNKNOWN) eventType = WENU; - TreeSetSingleElectronVar(*eleIter1, 0); //fill first electron - TreeSetSingleElectronVar(*eleIter1, -1); // fill fake second electron - - if(doExtraCalibTree) { - TreeSetExtraCalibVar(*eleIter1, 0); - TreeSetExtraCalibVar(*eleIter1, -1); - } - if(doEleIDTree) { - TreeSetEleIDVar(*eleIter1, 0); - TreeSetEleIDVar(*eleIter1, -1); - } */ } else { //ZEE or UNKNOWN // take only the fist di-electron pair (highest pt) for(pat::ElectronCollection::const_iterator eleIter2 = eleIter1 + 1; From 13405350b0b2c7a42e3a8d6db85ec159a85116db Mon Sep 17 00:00:00 2001 From: lbrianza Date: Thu, 16 Jun 2016 11:33:38 +0200 Subject: [PATCH 27/30] fix pfmet/calomet choice --- ZNtupleDumper/plugins/ZNtupleDumper.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ZNtupleDumper/plugins/ZNtupleDumper.cc b/ZNtupleDumper/plugins/ZNtupleDumper.cc index 52dfb2f0591..8bd7f5455b8 100644 --- a/ZNtupleDumper/plugins/ZNtupleDumper.cc +++ b/ZNtupleDumper/plugins/ZNtupleDumper.cc @@ -692,11 +692,12 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe iEvent.getByToken(recHitCollectionESToken_, ESRechitsHandle); iEvent.getByToken(metToken_, metHandle); - if (caloMetHandle.isValid()) { - iEvent.getByToken(caloMetToken_, caloMetHandle); - } - reco::MET& met = (eventType == WSTREAM) ? caloMetHandle->at(0) : ((*metHandle))[0]; + iEvent.getByToken(caloMetToken_, caloMetHandle); + reco::MET met = ((*metHandle))[0]; + if (eventType == WSTREAM) { + met = (*caloMetHandle)[0]; + } //Here the HLTBits are filled. TriggerResults TreeSetEventSummaryVar(iEvent); From f5433da6fd1293da4d44a90dcd70fd3aa6846562 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Thu, 16 Jun 2016 16:23:53 +0200 Subject: [PATCH 28/30] update scripts to run electron stream --- EcalAlCaRecoProducers/alcareco_datasets.dat | 3 +++ EcalAlCaRecoProducers/python/alcaSkimming.py | 5 +++-- EcalAlCaRecoProducers/scripts/prodAlcareco.sh | 20 ++++++++++++++++++- EcalAlCaRecoProducers/scripts/prodNtuples.sh | 7 +++++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/EcalAlCaRecoProducers/alcareco_datasets.dat b/EcalAlCaRecoProducers/alcareco_datasets.dat index 7df8780ccc8..6bddf342705 100644 --- a/EcalAlCaRecoProducers/alcareco_datasets.dat +++ b/EcalAlCaRecoProducers/alcareco_datasets.dat @@ -234,3 +234,6 @@ allRange /DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISpring16M 273150-273730 /DoubleEG/Run2016B-PromptReco-v2/MINIAOD DoubleEG-Run2016B-PromptReco-v2-miniAOD caf database VALID RUN2016B 272023-273146 /DoubleEG/Run2016B-PromptReco-v1/AOD DoubleEG-Run2016B-PromptReco-v1 caf database VALID RUN2016B 273150-273730 /DoubleEG/Run2016B-PromptReco-v2/AOD DoubleEG-Run2016B-PromptReco-v2 caf database VALID RUN2016B +273157-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf database VALID RUN2016B +273157-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco VALID RUN2016B + diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index b7ab07b8d85..9a1fd88b768 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -654,8 +654,9 @@ process.NtuplePath = cms.Path(process.ntupleSeq) process.schedule = cms.Schedule(process.NtuplePath, process.NtupleEndPath) process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::ALCARECO') - if (options.electronStream): - process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::RECO') + if (options.electronStream): + if (options.isCrab==0): + process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::RECO') else: if(options.doTree==0): process.schedule = cms.Schedule(process.pathALCARECOEcalCalZElectron, process.pathALCARECOEcalCalWElectron, diff --git a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh index 0cb27abeb0e..f3a4aed171d 100755 --- a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh +++ b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh @@ -26,6 +26,7 @@ CRABVERSION=2 CMSSWCONFIG="reco_ALCA.py" DATA="--data" SPLITBYFILE=0 +USER_REMOTE_DIR_BASE=group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco usage(){ echo "`basename $0` options" echo "---------- provided by parseDatasetFile (all mandatory)" @@ -80,7 +81,8 @@ do -s|--skim) SKIM=$2 ; shift;; -r|--runrange) RUNRANGE=$2; shift;; --store) STORAGE_ELEMENT=$2; shift;; - --remote_dir) USER_REMOTE_DIR_BASE=$2; shift;; +# --remote_dir) USER_REMOTE_DIR_BASE=$2; shift;; + --remote_dir) USER_REMOTE_DIR_BASE=group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco; shift;; --dbs_url) DBS_URL=$2; shift;; --scheduler) SCHEDULER=$2; shift;; --isMC) echo "[OPTION] Input dataset is MC" ; ISMC="yes" ;; @@ -203,6 +205,7 @@ fi case $DATASETPATH in */RAW) ALCATYPE="RAW2DIGI,RECO," + let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/8 ;; *SingleElectron*USER) let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/4 @@ -267,6 +270,21 @@ case $TYPE in TYPE=ALCARECO subdir=prod_alcareco ;; + ElectronStream | ALCARECO) + case $SKIM in + ZSkim) + ALCATYPE="${ALCATYPE}ALCA:EcalCalZElectronStream" + ;; + WSkim) + ALCATYPE="${ALCATYPE}ALCA:EcalCalWElectronStream" + EVENTS_PER_JOB=20000; LUMIS_PER_JOB=25 + ;; + none) EVENTS_PER_JOB=20000;; + esac + CUSTOMISE="--process=ALCARECO --customise Calibration/EcalAlCaRecoProducers/customElectronStream.StreamReco" + TYPE=ALCARECO + subdir=prod_alcareco + ;; *) echo "[ERROR] No TYPE defined. If you want to use ALCARECOSIM, use ALCARECO and option --isMC" >> /dev/stderr exit 1 diff --git a/EcalAlCaRecoProducers/scripts/prodNtuples.sh b/EcalAlCaRecoProducers/scripts/prodNtuples.sh index d098429d305..c833bfbc4a5 100755 --- a/EcalAlCaRecoProducers/scripts/prodNtuples.sh +++ b/EcalAlCaRecoProducers/scripts/prodNtuples.sh @@ -22,6 +22,7 @@ CRABVERSION=2 FROMCRAB3=0 JOBINDEX="" ISPRIVATE=0 +ELECTRONSTREAM=0 usage(){ echo "`basename $0` {parseDatasetFile options} --type={type} [options]" @@ -44,6 +45,7 @@ usage(){ echo " *** for DATA ***" echo " --json_name jsonName: additional name in the folder structure to keep track of the used json" echo " --json jsonFile.root" + echo " --electronStream" echo "---------- optional common" echo " --doExtraCalibTree" @@ -77,7 +79,7 @@ expertUsage(){ #------------------------------ parsing # options may be followed by one colon to indicate they have a required argument -if ! options=$(getopt -u -o hHd:n:s:r:t:f: -l help,expertHelp,datasetpath:,datasetname:,skim:,runrange:,store:,remote_dir:,scheduler:,isMC,isParticleGun,ntuple_remote_dir:,json:,tag:,type:,json_name:,ui_working_dir:,extraName:,doExtraCalibTree,doEleIDTree,noStandardTree,createOnly,submitOnly,check,isPrivate,file_per_job:,develRelease -- "$@") +if ! options=$(getopt -u -o hHd:n:s:r:t:f: -l help,expertHelp,datasetpath:,datasetname:,skim:,runrange:,store:,remote_dir:,scheduler:,isMC,electronStream,isParticleGun,ntuple_remote_dir:,json:,tag:,type:,json_name:,ui_working_dir:,extraName:,doExtraCalibTree,doEleIDTree,noStandardTree,createOnly,submitOnly,check,isPrivate,file_per_job:,develRelease -- "$@") then # something went wrong, getopt will put out an error message for us exit 1 @@ -140,6 +142,7 @@ do ;; --isMC) isMC=1;; --isParticleGun) isPARTICLEGUN="y"; SKIM=partGun;; + --electronStream) echo "[OPTION] run for electron stream"; ELECTRONSTREAM=1;; --json) JSONFILE=$2; shift;; --json_name) JSONNAME=$2; shift;; @@ -433,7 +436,7 @@ runselection=${RUNRANGE} split_by_run=0 check_user_remote_dir=1 pset=python/alcaSkimming.py -pycfg_params=type=${TYPE} doTree=${DOTREE} doTreeOnly=1 jsonFile=${JSONFILE} isCrab=1 skim=${SKIM} tagFile=${TAGFILE} isPrivate=$ISPRIVATE +pycfg_params=type=${TYPE} doTree=${DOTREE} doTreeOnly=1 jsonFile=${JSONFILE} isCrab=1 skim=${SKIM} tagFile=${TAGFILE} isPrivate=$ISPRIVATE electronStream=$ELECTRONSTREAM get_edm_output=1 output_file=${OUTFILES} From 580154787a64f8e0a8ba05c261b67d25153ff9b8 Mon Sep 17 00:00:00 2001 From: lbrianza Date: Fri, 17 Jun 2016 10:34:08 +0200 Subject: [PATCH 29/30] revert modification of folder name --- EcalAlCaRecoProducers/scripts/prodAlcareco.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh index f3a4aed171d..d75a29b9df6 100755 --- a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh +++ b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh @@ -81,8 +81,7 @@ do -s|--skim) SKIM=$2 ; shift;; -r|--runrange) RUNRANGE=$2; shift;; --store) STORAGE_ELEMENT=$2; shift;; -# --remote_dir) USER_REMOTE_DIR_BASE=$2; shift;; - --remote_dir) USER_REMOTE_DIR_BASE=group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco; shift;; + --remote_dir) USER_REMOTE_DIR_BASE=$2; shift;; --dbs_url) DBS_URL=$2; shift;; --scheduler) SCHEDULER=$2; shift;; --isMC) echo "[OPTION] Input dataset is MC" ; ISMC="yes" ;; From c8918dc886b0308c309201d9d27929f40235b32e Mon Sep 17 00:00:00 2001 From: lbrianza Date: Fri, 17 Jun 2016 14:48:02 +0200 Subject: [PATCH 30/30] update --- EcalAlCaRecoProducers/alcareco_datasets.dat | 4 ++-- EcalAlCaRecoProducers/scripts/prodAlcareco.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EcalAlCaRecoProducers/alcareco_datasets.dat b/EcalAlCaRecoProducers/alcareco_datasets.dat index 6bddf342705..9e4b2aadea9 100644 --- a/EcalAlCaRecoProducers/alcareco_datasets.dat +++ b/EcalAlCaRecoProducers/alcareco_datasets.dat @@ -234,6 +234,6 @@ allRange /DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/RunIISpring16M 273150-273730 /DoubleEG/Run2016B-PromptReco-v2/MINIAOD DoubleEG-Run2016B-PromptReco-v2-miniAOD caf database VALID RUN2016B 272023-273146 /DoubleEG/Run2016B-PromptReco-v1/AOD DoubleEG-Run2016B-PromptReco-v1 caf database VALID RUN2016B 273150-273730 /DoubleEG/Run2016B-PromptReco-v2/AOD DoubleEG-Run2016B-PromptReco-v2 caf database VALID RUN2016B -273157-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf database VALID RUN2016B -273157-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco VALID RUN2016B +273149-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf database VALID RUN2016B +273149-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco VALID RUN2016B diff --git a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh index d75a29b9df6..dfc5e761d96 100755 --- a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh +++ b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh @@ -204,7 +204,7 @@ fi case $DATASETPATH in */RAW) ALCATYPE="RAW2DIGI,RECO," - let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/8 + let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/40 ;; *SingleElectron*USER) let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/4 @@ -276,7 +276,7 @@ case $TYPE in ;; WSkim) ALCATYPE="${ALCATYPE}ALCA:EcalCalWElectronStream" - EVENTS_PER_JOB=20000; LUMIS_PER_JOB=25 + EVENTS_PER_JOB=20000; LUMIS_PER_JOB=5 ;; none) EVENTS_PER_JOB=20000;; esac