Repository for collecting recipes for standard physics objects for analysis of simulated events with the CMS phase 2 detector.
Contains (in the future)
a) scripts/recipes to set up the correct CMSSW environment
b) a collection of latest recipes and a CMSSW config to apply them to get collections of standard objects suitable for physics analysis as CMSSW producers (e.g. recommendedTightMuons = tightMuonProducer(slimmedMuons) etc.)
c) an ntuple production configuration file that produces an ntuple that can be analysed in a similar manner als Delphes samples (with the DAnalysis framework)
cmsrel CMSSW_9_1_1_patch3
cd CMSSW_9_1_1_patch3/src
cmsenv
git cms-addpkg RecoEgamma/EgammaIsolationAlgos
cd RecoEgamma
git clone git@github.com:nsmith-/Phase2InterimID.git
cd ..
git clone git@github.com:ResonantHbbHgg/PhaseTwoAnalysis.git
cp PhaseTwoAnalysis/RecoEgammaFix/* RecoEgamma/EgammaIsolationAlgos/plugins/
scram b -j8As the global tag contains Run-2 JEC, you might want to download an SQLite file to rerun JEC. See the TWiki for more details.
The PatProducer folder contains a configuration file to produce miniAOD files from RECO files. Interactively, after updating the list of input files, one can run
cmsRun miniAOD-prod_PAT.pyA skeleton of crab configuration file is also provided in this folder. The following fields need to be updated:
config.General.requestNameconfig.Data.inputDatasetconfig.Data.outLFNDirBase
before running
source /cvmfs/cms.cern.ch/crab3/crab.sh
crab submit crabConfig.pyA basic EDAnalyzer is available in the BasicRecoDistrib folder. Several private functions handle electron and forward muon ID. Lepton isolation is computed with a simple loop over neighbouring particles and there is no b-tagging information. Normalization to luminosity is not handled. More details are given in the implementation section of the .cc file.
After updating the list of input files, the analyzer can be run interactively from the test subfolder :
cmsRun ConfFile_cfg.pyIf you want to rerun JEC, you can use the updateJEC argument with the path to the SQLite file.
Befor the EDAnalyzer, PUPPI is run on the fly and jets are re-clustered. The MET is also recomputed but not exactly with the official recipe (that needs PAT collections).
Plots in a pdf format can be obtained by running:
root -l
.L plotIt.C++
plotIt()A skeleton of crab configuration file is also provided. The following fields need to be updated:
config.General.requestNameconfig.Data.inputDatasetconfig.Data.outLFNDirBase
before running
source /cvmfs/cms.cern.ch/crab3/crab.sh
crab submit crabConfig.pyA basic EDAnalyzer is available in the BasicPatDistrib folder. Several private functions handle central electron and forward muon ID. A flag (useDeepCSV) can be set to true in the configuration file to use deepCSV rather than MVAv2 as b-tagging discriminant. Normalization to luminosity is not handled. More details are given in the implementation section of the .cc file.
After updating the list of input files, the analyzer can be run interactively from the test subfolder :
cmsRun ConfFile_cfg.pyIf you want to rerun JEC, you can use the updateJEC argument with the path to the SQLite file.
Plots in a pdf format can be obtained by running:
root -l
.L plotIt.C++
plotIt()A skeleton of crab configuration file is also provided. The following fields need to be updated:
config.General.requestNameconfig.Data.inputDatasetconfig.Data.outLFNDirBase
before running
source /cvmfs/cms.cern.ch/crab3/crab.sh
crab submit crabConfig.pyFlat ntuples can be produced in the NTupler folder, either from PAT or RECO events, by running interactively:
cmsRun scripts/produceNtuples_cfg.py skim=False/True outFilename=MiniEvents.root inputFormat=RECO/PATIf you want to rerun JEC, you can use the updateJEC argument with the path to the SQLite file.
The skim flag can be used to reduce the size of the output files. A histogram containing the number of events before the skim is then stored in the output files. By default, events are required to contain at least 1 lepton and 2 jets, but this can be easily modified ll.71-97 of src/produceNtuples_cfg.py.
The structure of the output tree can be seen/modified in interface/MiniEvent.h and src/MiniEvent.cc.
The main analyzers are:
plugins/MiniFromPat.cc-- to run over PAT eventsplugins/MiniFromReco.cc-- to run over RECO events
Details on the object definitions are given in the implementation section.
A skeleton of crab configuration file is also provided. The following fields need to be updated:
config.General.requestNameconfig.Data.inputDatasetconfig.Data.outLFNDirBase
before running
source /cvmfs/cms.cern.ch/crab3/crab.sh
crab submit crabConfig.pyTo adjust the input parameters of scripts/produceNtuples_cfg.py, the three following fields need to be modified consistently:
config.JobType.pyCfgParamsconfig.JobType.inputFilesconfig.JobType.outputFiles
CMS edm ntuples can be produced in the NTupler folder too, either from PAT or RECO events, by running interactively:
cmsRun scripts/edmFilter_cfg.py outFilename=FilteredEvents.root inputFormat=RECO/PATwhether the input file format is RECO or miniAOD.
If you want to rerun JEC, you can use the updateJEC argument with the path to the SQLite file.
To run over PAT events, the main producers are:
../Electrons/plugins/PatElectronFilter.cc../Muons/plugins/PatMuonFilter.cc../Jets/plugins/PatJetFilter.cc
while for RECO events, they are:
../Electrons/plugins/RecoElectronFilter.cc../Muons/plugins/RecoMuonFilter.cc../Jets/plugins/RecoJetFilter.cc
Details on the object definitions are given in the implementation section, but, please, already note that no JEC is applied and ak4 and PUPPI algorithms are considered everywhere.
When running over PAT events, the following collections are produced:
doubles_electronfilter_LooseElectronRelIso_EDMFilterdoubles_electronfilter_MediumElectronRelIso_EDMFilterdoubles_electronfilter_TightElectronRelIso_EDMFilterpatElectrons_electronfilter_LooseElectrons_EDMFilterpatElectrons_electronfilter_MediumElectrons_EDMFilterpatElectrons_electronfilter_TightElectrons_EDMFilterdoubles_muonfilter_LooseMuonRelIso_EDMFilterdoubles_muonfilter_MediumMuonRelIso_EDMFilterdoubles_muonfilter_TightMuonRelIso_EDMFilterpatMuons_muonfilter_LooseMuons_EDMFilterpatMuons_muonfilter_MediumMuons_EDMFilterpatMuons_muonfilter_TightMuons_EDMFilterpatJets_jetfilter_Jets_EDMFilterpatJets_jetfilter_LooseMVAv2Jets_EDMFilterpatJets_jetfilter_MediumMVAv2Jets_EDMFilterpatJets_jetfilter_TightMVAv2Jets_EDMFilterpatJets_jetfilter_LooseDeepCSVJets_EDMFilterpatJets_jetfilter_MediumDeepCSVJets_EDMFilterpatJets_jetfilter_TightDeepCSVJets_EDMFilter
while for RECO events, they are:
doubles_electronfilter_LooseElectronRelIso_EDMFilterdoubles_electronfilter_MediumElectronRelIso_EDMFilterdoubles_electronfilter_TightElectronRelIso_EDMFilterrecoGsfElectrons_electronfilter_LooseElectrons_EDMFilterrecoGsfElectrons_electronfilter_MediumElectrons_EDMFilterrecoGsfElectrons_electronfilter_TightElectrons_EDMFilterdoubles_muonfilter_LooseMuonRelIso_EDMFilterdoubles_muonfilter_MediumMuonRelIso_EDMFilterdoubles_muonfilter_TightMuonRelIso_EDMFilterrecoMuons_muonfilter_LooseMuons_EDMFilterrecoMuons_muonfilter_MediumMuons_EDMFilterrecoMuons_muonfilter_TightMuons_EDMFilterrecoPFJets_jetfilter_Jets_EDMFilterrecoPFMETs_puppiMet__EDMFilter
The initial vectors of electrons, muons, jets (and PFMETs) are dropped to avoid any confusion.