This is a PAT configuration adapted for Top analysis, skimming events with an isolated electron/muon, 2 jets, and a non isolated muon.
Follow the dependencies instructions, handling carefully merging conflicts.
Be sure to be in the src
directory of the CMSSW release.
git clone https://github.com/IPNL-CMS/PatTopFilteredProduction.git
Follow the post-installation instructions.
In the src
directory of the CMSSW package, run
scram b -j8
Once Pat has been setup, you can start using the tool as indicated below.
Do not forget to source Crab3 (i.e. /cvmfs/cms.cern.ch/crab3/crab.sh)
For MC:
List the datasets and globalTags in createAndRunMCCrab.py. Adapt the number of events per job in crab_MC.cfg.template.ipnl.
For data:
List the primary dataset, the globalTag, the run range in createAndRunDataCrab.py, and the golden Json file. Adapt the number of lumi sections per job in crab_data.cfg.template.ipnl.
Create your crab configuration files and submit your jobs by running the following command:
for MC:
PatTopFilteredProduction> ./createAndRunMCCrab.py --run
for data:
PatTopFilteredProduction> ./createAndRunDataCrab.py --run
You can use getReportPublishPurge.py to handle your crab tasks.
Luminosity
You can compute the equivalent luminosity following these instructions in each crab task folder:
PatTopFilteredProduction> pixelLumiCalc.py -i result/lumiSummary.json overview >& pixelLumiCalc.log
Pileup profile
You can get the pileup profile from the data PAttuples as follows:
PatTopFilteredProduction> curl -O https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions12/8TeV/PileUp/pileup_latest.txt
PatTopFilteredProduction> pileupCalc.py -i myWorkingDir1/result/lumiSummary.json --inputLumiJSON pileup_latest.txt --calcMode true --minBiasXsec 69400 --maxPileupBin 80 --numPileupBins 80 MyDataPileupHistogram_1.root
If you have several datasets, repeat the command for the over working directories and merge all the final histogramms:
PatTopFilteredProduction> hadd MyFinalDataPileupHistogram MyDataPileupHistogram_1.root MyDataPileupHistogram_2.root
Remark:
Finally, you can merge all the json
files thus obtained using the mergeJSON.py
script:
Usage: mergeJSON.py alpha1.json [alpha2.json:142300-145900]
Options:
-h, --help show this help message and exit
--output=OUTPUT Save output to file OUTPUT
For example:
PatTopFilteredProduction> mergeJSON.py myWorkingDir1/result/lumiSummary.json myWorkingDir2/result/lumiSummary.json
You can then use the merged json file to compute the prescale factor of a given HLT trigger. For example, if you are interested in HLT_PFJet200 trigger, execute this command:
PatTopFilteredProduction> pixelLumiCalc.py recorded -i mergedLumiSummaryData.json --hltpath "HLT_PFJet200_*"