diff --git a/README.md b/README.md index 657bc223..09e95ec4 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,26 @@ export CMSSW_GIT_REFERENCE=/storage/.cmsgit-cache #change CMSSW installation paths export SCRAM_ARCH=slc5_amd64_gcc462 -scram p -n CMSSW_5_3_16_patch1_nTuple_v10 CMSSW_5_3_16_patch1 -cd CMSSW_5_3_16_patch1_nTuple_v10/src +scram p -n CMSSW_5_3_18_nTuple_v10 CMSSW_5_3_18 +cd CMSSW_5_3_18_nTuple_v10/src cmsenv # Latest PAT recipe -# https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuidePATReleaseNotes52X#Add_CSCTightHaloFilter_CMSSW_5_3 +# https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuidePATReleaseNotes52X#Add_new_jet_flavour + git cms-addpkg PhysicsTools/PatAlgos +git cms-addpkg CommonTools/Utils +git cms-addpkg PhysicsTools/Configuration +git cms-addpkg PhysicsTools/PatExamples +git cms-addpkg PhysicsTools/PatUtils +git cms-addpkg PhysicsTools/SelectorUtils +git cms-addpkg PhysicsTools/UtilAlgos +git cms-addpkg RecoBTag/SoftLepton +git cms-addpkg RecoMET/METFilters +git cms-merge-topic -u cms-analysis-tools:5_3_13-newJetFlavour +git cms-merge-topic -u cms-analysis-tools:5_3_13-updatedPATConfigs git cms-addpkg EgammaAnalysis/ElectronTools -git cms-addpkg PhysicsTools/PatUtils # ElectroWeakAnalysis needed for full LHAPDF libraries to work git cms-addpkg ElectroWeakAnalysis/Utilities diff --git a/plugins/EventWeight_Producer_PU.cc b/plugins/EventWeight_Producer_PU.cc index a0c0a82e..e624176a 100644 --- a/plugins/EventWeight_Producer_PU.cc +++ b/plugins/EventWeight_Producer_PU.cc @@ -18,7 +18,7 @@ EventWeight_Producer_PU::EventWeight_Producer_PU(const edm::ParameterSet& cfg) : error_code = 0; - if (inTag_MCSampleTag == "Fall11" || inTag_MCSampleTag == "Summer12") { + if (inTag_MCSampleTag == "Fall11" || inTag_MCSampleTag == "Summer12" || inTag_MCSampleTag == "Summer11Leg") { LumiWeights_ = edm::LumiReWeighting(inTag_MCSampleFile.fullPath(), inTag_DataFile.fullPath(), inTag_MCSampleHistoName, inTag_DataHistoName); @@ -65,13 +65,13 @@ void EventWeight_Producer_PU::produce(edm::Event& evt, const edm::EventSetup& se { int BX = iterPU->getBunchCrossing(); // -1: previous BX, 0: current BX, 1: next BX - if (inTag_MCSampleTag == "Fall11" || inTag_MCSampleTag == "Summer12") { + if (inTag_MCSampleTag == "Fall11" || inTag_MCSampleTag == "Summer12" || inTag_MCSampleTag == "Summer11Leg") { if (BX == 0) nvtx = iterPU->getTrueNumInteractions(); } } - if (inTag_MCSampleTag == "Fall11" || inTag_MCSampleTag == "Summer12") + if (inTag_MCSampleTag == "Fall11" || inTag_MCSampleTag == "Summer12" || inTag_MCSampleTag == "Summer11Leg") wght_ = LumiWeights_.weight(nvtx); } std::auto_ptr eventWeightPUProduct(new double(wght_)); diff --git a/plugins/TopPairElectronPlusJetsSelectionFilter.cc b/plugins/TopPairElectronPlusJetsSelectionFilter.cc index 14651724..da6be363 100644 --- a/plugins/TopPairElectronPlusJetsSelectionFilter.cc +++ b/plugins/TopPairElectronPlusJetsSelectionFilter.cc @@ -468,6 +468,8 @@ bool TopPairElectronPlusJetsSelectionFilter::passesTriggerSelection() const { return triggerFired("HLT_Ele25_CaloIdVT_CaloIsoT_TrkIdT_TrkIsoT_TriCentralJet30", hltConfig_, triggerResults_); } else if (MCSampleTag_ == "Summer12") { //Summer12 MC return triggerFired("HLT_Ele27_WP80_v", hltConfig_, triggerResults_); + } else if (MCSampleTag_ == "Summer11Leg") { //7TeV legacy MC + return true; // to be updated once we have trigger efficiencies } else return false; } diff --git a/plugins/TopPairMuonPlusJetsSelectionFilter.cc b/plugins/TopPairMuonPlusJetsSelectionFilter.cc index 179998e4..78a566cd 100644 --- a/plugins/TopPairMuonPlusJetsSelectionFilter.cc +++ b/plugins/TopPairMuonPlusJetsSelectionFilter.cc @@ -491,12 +491,12 @@ bool TopPairMuonPlusJetsSelectionFilter::passesTriggerSelection() const { else //2012 Data return triggerFired("HLT_IsoMu24_eta2p1_v", hltConfig_, triggerResults_); } else { - if (MCSampleTag_ == "Fall11") { - //Fall11 MC + if (MCSampleTag_ == "Fall11") {//Fall11 MC return triggerFired("HLT_IsoMu24", hltConfig_, triggerResults_); - } else {//Summer12 MC - + } else if (MCSampleTag_ == "Summer12") {//Summer12 MC return triggerFired("HLT_IsoMu24_eta2p1_v", hltConfig_, triggerResults_); + } else if (MCSampleTag_ == "Summer11Leg") {//Summer11Leg + return true; // to be updated once we have trigger efficiencies } } return false; diff --git a/python/EventFilter_cfi.py b/python/EventFilter_cfi.py index 010e5f25..035dacdc 100644 --- a/python/EventFilter_cfi.py +++ b/python/EventFilter_cfi.py @@ -24,9 +24,9 @@ TracksInput=cms.InputTag('generalTracks'), # Specify input collections - electronInput=cms.InputTag("gsfElectrons"), - muonInput=cms.InputTag("cleanPatMuons"), - jetInput=cms.InputTag("ak5CaloJets"), + electronInput=cms.InputTag("selectedPatElectronsLoosePFlow"), + muonInput=cms.InputTag("selectedPatMuonsLoosePFlow"), + jetInput=cms.InputTag("selectedPatJetsPFlow"), # Specifiy number of jets minNJets=cms.int32(-1), diff --git a/python/EventWeight_Producer_PU_cfi.py b/python/EventWeight_Producer_PU_cfi.py index c84fe2b5..720e62e5 100644 --- a/python/EventWeight_Producer_PU_cfi.py +++ b/python/EventWeight_Producer_PU_cfi.py @@ -5,7 +5,7 @@ PUSource = cms.InputTag("addPileupInfo"), WeightName = cms.string("eventWeightPU"), - MCSampleTag = cms.string("Summer12"), # valid identifier: Fall11, Summer12 + MCSampleTag = cms.string("Summer12"), # valid identifier: Fall11, Summer12 or Summer11Leg MCSampleFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/MC_PUDist_Default2012.root"), MCSampleHistoName = cms.string("puhisto"), diff --git a/python/Jets_Setup_cff.py b/python/Jets_Setup_cff.py index 7fe93d81..6af48cea 100644 --- a/python/Jets_Setup_cff.py +++ b/python/Jets_Setup_cff.py @@ -14,15 +14,11 @@ def setup_jets(process, cms, options, postfix="PFlow"): print '=' * 60 #MC setup inputJetCorrLabel = ('AK5PFchs', ['L1FastJet', 'L2Relative', 'L3Absolute']) - caloJetCorrection = ('AK5Calo', ['L1Offset' , 'L2Relative', 'L3Absolute']) if options.useData :#data set up inputJetCorrLabel = ('AK5PFchs', ['L1FastJet', 'L2Relative', 'L3Absolute', 'L2L3Residual']) - caloJetCorrection = ('AK5Calo', ['L1Offset' , 'L2Relative', 'L3Absolute', 'L2L3Residual']) print 'Using jet energy corrections: ' - print 'Calo Jets' - print caloJetCorrection print 'PF Jets' print inputJetCorrLabel @@ -37,21 +33,6 @@ def setup_jets(process, cms, options, postfix="PFlow"): from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters - - ############################### - #### Calo Jet Setup ######## - ############################### - #this has to run after PF2PAT and before removeMCMatching - #see https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookPAT38xChanges#Details_with_PF2PAT - from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection, addJetCollection -# print 'adding calo jets' - switchJetCollection(process, - jetCollection=cms.InputTag('ak5CaloJets'), - jetCorrLabel=caloJetCorrection, - doBTagging=True, - doType1MET=False,) - - ############################### ###### Bare KT 0.6 jets ####### ############################### @@ -97,3 +78,4 @@ def setup_jets(process, cms, options, postfix="PFlow"): pfNoElectron = getattr(process, "pfNoElectron" + postfix) for module in additionalJets : getattr(process, "patPF2PATSequence" + postfix).replace(pfNoElectron, pfNoElectron * module) + diff --git a/python/MET_Setup_cff.py b/python/MET_Setup_cff.py index 30d93f68..c59b275e 100644 --- a/python/MET_Setup_cff.py +++ b/python/MET_Setup_cff.py @@ -97,17 +97,27 @@ def setup_MET_uncertainties(process, cms, options, postfix="PFlow"): #runMEtUncertainties(process, doSmearJets=not options.useData, jetCollection='goodPatJetsPFlow', addToPatDefaultSequence=False) if options.useData: inputJetCorrLabelForMETuncertainties = 'L2L3Residual' - metSysShiftCorrParameter = process.pfMEtSysShiftCorrParameters_2012runAvsNvtx_data + if options.centreOfMassEnergy == 8: + metSysShiftCorrParameter = process.pfMEtSysShiftCorrParameters_2012runABCDvsNvtx_data + print "using pfMEtSysShiftCorrParameters_2012runABCDvsNvtx_data" + elif options.centreOfMassEnergy == 7: + metSysShiftCorrParameter = process.pfMEtSysShiftCorrParameters_2011runAplusBvsNvtx_data + print "using pfMEtSysShiftCorrParameters_2011runAplusBvsNvtx_data" else: inputJetCorrLabelForMETuncertainties = 'L3Absolute' - metSysShiftCorrParameter = process.pfMEtSysShiftCorrParameters_2012runAvsNvtx_mc + if options.centreOfMassEnergy == 8: + metSysShiftCorrParameter = process.pfMEtSysShiftCorrParameters_2012runABCDvsNvtx_mc + print "using pfMEtSysShiftCorrParameters_2012runABCDvsNvtx_mc" + elif options.centreOfMassEnergy == 7: + metSysShiftCorrParameter = process.pfMEtSysShiftCorrParameters_2011runAplusBvsNvtx_mc + print "using pfMEtSysShiftCorrParameters_2011runAplusBvsNvtx_mc" process.pfMEtSysShiftCorr.parameter = metSysShiftCorrParameter runMEtUncertainties(process, - electronCollection = cms.InputTag('cleanPatElectrons'), - muonCollection = 'cleanPatMuons', - tauCollection = 'cleanPatTaus', + electronCollection = cms.InputTag('patElectronsPFlow'), + muonCollection = 'patMuonsPFlow', + tauCollection = 'patTausPFlow', jetCollection = cms.InputTag('goodPatJetsPFlow'), jetCorrLabel = inputJetCorrLabelForMETuncertainties, doSmearJets = not options.useData, diff --git a/python/NTupleTools_cff.py b/python/NTupleTools_cff.py index 334652c9..5fc14e12 100644 --- a/python/NTupleTools_cff.py +++ b/python/NTupleTools_cff.py @@ -176,20 +176,20 @@ if options.CMSSW == "53X" and options.centreOfMassEnergy == 8: #Data Global Tag - GLOBALTAG_DATA = 'FT_53_V21_AN3::All' # Used for 2012 A, B, C and D: 22Jan2013 re-reco + GLOBALTAG_DATA = 'FT53_V21A_AN6::All' # Used for 2012 A, B, C and D: 22Jan2013 re-reco: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrontierConditions#Winter13_2012_A_B_C_D_datasets_r #Monte Carlo Global Tag - GLOBALTAG_MC = 'START53_V21::All' #TO BE UPDATED TO RELEVANT 5_3_X 2011 7TEV PRODUCTION GLOBAL TAGS + GLOBALTAG_MC = 'START53_V27::All' #https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrontierConditions#Winter13_2012_A_B_C_D_datasets_r FILETAG = '53X' TEST_DATA_FILE = 'file:///storage/TopQuarkGroup/test/SingleElectron_Run2012B_13Jul2012_ReReco_AOD.root' TEST_MC_FILE = 'file:///storage/TopQuarkGroup/mc/8TeV/SynchEx/Summer12_DR53X_TTJets_MassiveBinDECAY_TuneZ2star_8TeV-madgraph-tauola_AODSIM_PU_S10_START53_V7A-v1.root' elif options.CMSSW == "53X" and options.centreOfMassEnergy == 7: #Data Global Tag - GLOBALTAG_DATA = 'FT_R_53_LV5::All' #Winter 2013 2011A&B Legacy re-reco in CMSSW_5_3_X + GLOBALTAG_DATA = 'FT_53_LV5_AN1::All' #2011 7TeV 53X legacy data re-reco: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrontierConditions#2011AB_Legacy_re_reco_CMSSW_5_3 #Monte Carlo Global Tag - GLOBALTAG_MC = 'START53_V21::All' #TO BE UPDATED TO RELEVANT 5_3_X 2011 7TEV PRODUCTION GLOBAL TAGS WHEN AVAILABLE + GLOBALTAG_MC = 'START53_LV6A1::All' #2011 7TeV 53X legaco MC: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrontierConditions#7_TeV_MC_Legacy_reprocessing_in FILETAG = '53X' - TEST_DATA_FILE = 'file:///storage/TopQuarkGroup/test/ElectronHad_Run2011A-12Oct2013-v1_AOD.root' #test file for 2011 7TEV RunA Oct2013 re-reco - TEST_MC_FILE = 'file:///storage/TopQuarkGroup/test/TTJets_TuneZ2_7TeV-madgraph-tauola_Summer11LegDR_53X_AODSIM.root' + TEST_DATA_FILE = 'file:///storage/TopQuarkGroup/test/ElectronHad_Run2011A-12Oct2013-v1_AOD.root' #test file for 2011 7TeV 53X RunA Oct2013 re-reco + TEST_MC_FILE = 'file:///storage/TopQuarkGroup/test/TTJets_TuneZ2_7TeV-madgraph-tauola_Summer11LegDR_53X_AODSIM.root' #test file for 2011 7TeV 53X TTJets Monte Carlo elif options.CMSSW == '44X': GLOBALTAG_DATA = 'GR_R_44_V15::All' GLOBALTAG_MC = 'START44_V13::All' @@ -313,8 +313,8 @@ process.genParticlesForJetsNoNu * getattr(process, "patPF2PATSequence" + postfix) * process.looseLeptonSequence * - process.patDefaultSequence * - process.goodPatJets * + #process.patDefaultSequence * + #process.goodPatJets * process.goodPatJetsPFlow * process.metUncertaintySequence * process.EventFilters * @@ -352,11 +352,17 @@ process.eventWeightPU.MCSampleHistoName = cms.string("histo_Fall11_true") process.eventWeightPU.DataFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/Data_PUDist_2011Full.root") process.eventWeightPU.DataHistoName = cms.string("histoData_true") -else: +elif options.CMSSW == '53X' and options.centreOfMassEnergy == 7: + process.eventWeightPU.MCSampleTag = cms.string("Summer11Leg") + process.eventWeightPU.MCSampleFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/MC_PUDist_Default2011.root") + process.eventWeightPU.MCSampleHistoName = cms.string("histo_Fall11_true") + process.eventWeightPU.DataFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/Data_PUDist_2011Full.root") + process.eventWeightPU.DataHistoName = cms.string("histoData_true") +elif options.CMSSW == '53X' and options.centreOfMassEnergy == 8: process.eventWeightPU.MCSampleTag = cms.string("Summer12") - #process.eventWeightPU.MCSampleFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/MC_PUDist_Summer2012.root") + # process.eventWeightPU.MCSampleFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/MC_PUDist_Summer2012.root") process.eventWeightPU.MCSampleFile = cms.FileInPath("BristolAnalysis/NTupleTools/data/PileUp/MC_PUDist_Default2012.root") - process.eventWeightPU.MCSampleHistoName = cms.string("puhisto") + process.eventWeightPU.MCSampleHistoName = cms.string("puhisto") process.TFileService = cms.Service("TFileService", fileName=cms.string('ntuple.root') diff --git a/python/NTupler_cff.py b/python/NTupler_cff.py index b3fe8222..6d02278f 100644 --- a/python/NTupler_cff.py +++ b/python/NTupler_cff.py @@ -221,6 +221,7 @@ def setup_ntupler(process, cms, options): process.rootNTuples.remove(process.rootTupleCaloMET) process.rootNTuples.remove(process.rootTupleElectrons) process.rootNTuples.remove(process.nTupleMuons) + process.rootNTuples.remove(process.rootTuplePhotons) if not options.writeFat and not options.writeIsolatedPFLeptons:#write only PF particles #isolated leptons diff --git a/python/TopPairElectronPlusJetsSelectionFilter_cfi.py b/python/TopPairElectronPlusJetsSelectionFilter_cfi.py index ae8ade39..c79c474d 100644 --- a/python/TopPairElectronPlusJetsSelectionFilter_cfi.py +++ b/python/TopPairElectronPlusJetsSelectionFilter_cfi.py @@ -38,7 +38,8 @@ dropTriggerSelection = cms.bool(False), prefix=cms.untracked.string('TopPairElectronPlusJetsSelection.'), - MCSampleTag = cms.string('Summer12'),#Fall11 or Summer12 + MCSampleTag = cms.string('Summer12'),#Fall11 or Summer12 or Summer11Leg + #flags debug=cms.untracked.bool(False), taggingMode=cms.untracked.bool(False), diff --git a/python/TopPairMuonPlusJetsSelectionFilter_cfi.py b/python/TopPairMuonPlusJetsSelectionFilter_cfi.py index 5c52a311..c57f6efb 100644 --- a/python/TopPairMuonPlusJetsSelectionFilter_cfi.py +++ b/python/TopPairMuonPlusJetsSelectionFilter_cfi.py @@ -38,7 +38,8 @@ dropTriggerSelection = cms.bool(False), prefix=cms.untracked.string('TopPairMuonPlusJetsSelection.'), - MCSampleTag = cms.string('Summer12'),#Fall11 or Summer12 + MCSampleTag = cms.string('Summer12'),#Fall11 or Summer12 or Summer11Leg + #flags debug=cms.untracked.bool(False), taggingMode=cms.untracked.bool(False), diff --git a/test/unfoldingAndCutflow_cfg.py b/test/unfoldingAndCutflow_cfg.py index e86d2985..45a81662 100644 --- a/test/unfoldingAndCutflow_cfg.py +++ b/test/unfoldingAndCutflow_cfg.py @@ -55,10 +55,13 @@ if options.CMSSW == '44X': process.topPairEPlusJetsSelection.MCSampleTag = cms.string( 'Fall11' ) - process.topPairMuPlusJetsSelection.MCSampleTag = cms.string( 'Fall11' ) -else: + process.topPairMuPlusJetsSelection.MCSampleTag = cms.string( 'Fall11' ) +elif options.CMSSW == '53X' and options.centreOfMassEnergy == 8: process.topPairEPlusJetsSelection.MCSampleTag = cms.string( 'Summer12' ) process.topPairMuPlusJetsSelection.MCSampleTag = cms.string( 'Summer12' ) +elif options.CMSSW == '53X' and options.centreOfMassEnergy == 7: + process.topPairEPlusJetsSelection.MCSampleTag = cms.string( 'Summer11Leg' ) + process.topPairMuPlusJetsSelection.MCSampleTag = cms.string( 'Summer11Leg' ) if options.applyZselection: process.topPairEPlusJetsSelection.tagAndProbeStudies = cms.bool( True ) @@ -70,6 +73,7 @@ electronselectionPrefix = 'TopPairElectronPlusJetsSelection.' muonselectionPrefix = 'TopPairMuonPlusJetsSelection.' + process.topPairEPlusJetsSelection.prefix = cms.untracked.string( electronselectionPrefix ) process.topPairMuPlusJetsSelection.prefix = cms.untracked.string( muonselectionPrefix )