Measurement of the W+jets cross-section at 8 TeV

Documentation for the analysis of the differential cross-section of W+jets at 8 TeV

Introduction

  • Analysis Note AN2014_114_v7.pdf
  • Calculate cross-section of W+jets process as a function of jet multiplicity, and jet pt and η
  • Start with muon analysis for the full 2012 dataset
  • Crosscheck results with electron channel at reco-level
  • Use Bayesian unfolding with RooUnfold
  • Distributions compared with various generators predictions using RIVET
           Madgraph
           Sherpa2
           BlackHat
         

Overview

Analysis done with modified tools from:
 Z+jets 8TeV
 W+jets 7TeV

Instructions using Modified tools from Z+Jets 8TeV:

Datasets

/name nEvents nFiles cmsrel runrange
/SingleMu/Run2012A-22Jan2013-v1/AOD 19785316 817 CMSSW_5_3_7_patch5 190456-193621
/SingleMu/Run2012B-22Jan2013-v1/AOD 59538958 4252 CMSSW_5_3_7_patch5 193834-196531
/SingleMu/Run2012C-22Jan2013-v1/AOD 87683348 6171 CMSSW_5_3_7_patch5 198022-203742
/SingleMu/Run2012D-22Jan2013-v1/AOD 95078490 7566 CMSSW_5_3_7_patch6 203777-208686

JSON Files
  • Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txtlink here

Monte Carlo Samples (Summer 12)

/name nEvents nFiles cmsrel Xsec (pb)
/WJetsToLNu_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 18393090 1612 CMSSW_5_3_2_patch4 36864.3
/WJetsToLNu_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v2/AODSIM 57709905 4735 CMSSW_5_3_2_patch4 36864.3
/W1JetsToLNu_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 23141598 1994 CMSSW_5_3_2_patch4 6440.58
/W2JetsToLNu_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 34044921 3177 CMSSW_5_3_2_patch4 2087.225
/W3JetsToLNu_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 15539503 1813 CMSSW_5_3_2_patch4 619.0113
/W4JetsToLNu_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 13382803 1330 CMSSW_5_3_2_patch5 255.2378
/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 30459503 2577 CMSSW_5_3_2_patch4 3531.8
/DYJetsToLL_M-10To50_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 37835275 3276 CMSSW_5_3_2_patch5
/TTJets_MassiveBinDECAY_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 6923750 722 CMSSW_5_3_2_patch4 245
/WW_TuneZ2star_8TeV_pythia6_tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 10000431 896 CMSSW_5_3_2_patch4 56.0
/WZ_TuneZ2star_8TeV_pythia6_tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 10000283 924 CMSSW_5_3_2_patch4 33.6
/ZZ_TuneZ2star_8TeV_pythia6_tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 9799908 886 CMSSW_5_3_2_patch4 17.0
/Tbar_tW-channel-DR_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 493460 53 CMSSW_5_3_2_patch4 11.1
/Tbar_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 1935072 188 CMSSW_5_3_2_patch4 30.7
/Tbar_s-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 139974 18 CMSSW_5_3_2_patch4 1.76
/T_tW-channel-DR_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 497658 58 CMSSW_5_3_2_patch4 11.1
/T_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v3/AODSIM 99876 12 CMSSW_5_3_2_patch4 56.4
/T_s-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 259961 31 CMSSW_5_3_2_patch4 3.79

Global Tag

START53_V23

Trigger Selection

HLT_IsoMu24_eta2p1   

NTuple Production

  • Producing NTuples from AOD.
  • Ntuples are located here:
      # for single muon ntuples
      /eos/cms/store/group/phys_smp/WPlusJets/NtuplesTomislavNEW
      
      # for single electron ntuples
      eos/cms/store/group/phys_smp/WPlusJets/NtuplesTomislav
      

The NtuplesTomislavNEW is the new version with jet's parton flavor information used for btag-veto correction. Unfortunately, these new ntuples are only available for single muon for now.

For more details, see slides:

Making Trees from Ntuples

Set up CMSSW
cmsrel CMSSW_5_3_20
cd CMSSW_5_3_20/src
cmsenv

Get Git Repository

Check out code:

#git clone git@github.com:bhawan/WJETS.git
git clone https://github.com/ahortian/WJETS.git

Go to directory

cd WJETS/TreeAnalysis2012/WJets

Compile RooUnfold (we are now using new version (unofficial) of RooUnfold).

cd RooUnfold-1.1.1
make clean
make
cd -

cd RooUnfold
make clean
make
cd -

Quick hacks for making LHAPDF work

sed -i 's#/user/aleonard/LHAPDF/lib/libLHAPDF.so#/afs/cern.ch/cms/slc5_amd64_gcc434/external/lhapdf/5.8.5/lib/libLHAPDF.so#g' runDYJets.cc
sed -i 's#/user/aleonard/lhapdf-5.9.1/include/#/afs/cern.ch/cms/slc5_amd64_gcc434/external/lhapdf/5.8.5/include/#g' rootlogon.C
sed -i 's#NNPDF23_nlo_as_0118#NNPDF20_as_0118_100#g' ComputePDFUncertainties.cc
sed -i 's#NNPDF23_nlo_as_0118#NNPDF20_as_0118_100#g' runDYJets.cc

Test code over a single ntuple file:

cmsStage /store/group/phys_smp/WPlusJets/NtuplesTomislavNEW/SMu_8TeV_T_s_channel_dR_5311.root DataW/SMu_8TeV_T_s_channel_dR_5311.root

If everything works fine, Run over complete set of ntuples:

cd ../   (you should be in TreeAnalysis2012 directory)
mkdir ~/eos
eosmount ~/eos
ln -s  ~/eos/cms/store/group/phys_smp/WPlusJets/NtuplesTomislavNEW  DataW

Ready to run the code!!!Before running it, change (line 27) int doQCD=0 in WJets/runDYJets.cc.

Run the code:

cd WJets
root -b runDYJets.cc  

For QCD Background:

# Go to WJets/runDYJets.cc change int doQCD = 1
root -b -q runDYJets.cc
# Change it 1-3 and run every time. 

Output root files are available in the directory HistoFiles.

Merge single top and DYJets root files:

root -b -q MergeTop_BVeto.cc++

Merge QCD Background:

root -b -q runQCD_BVeto.cc++

Plotting

root -b -q runTest_BVeto.cc

Output PDF files will be in the directory PNGFiles

Adding new distributions

To add new distributions, we need to modify our codes as follow
  1. Declare the names of the new histograms and set their bins in WJets/Includes/HistoSet.h and WJets/Sources/HistoSet.cc.
  2. Add new fuctions used for calculating new kinematic variables in WJets/Includes/functions.h and WJets/Sources/functions.cc.
  3. Add codes for calculating the kinematic variables and filling the histograms (gen and reco) as well as the response in WJets/Sources/ZJetsAndDPS.cc.
  4. Repeat the processes decribed in the previous section (from 'Run the code' to 'Plotting')

Unfolding

New scripts were written for unfolding. These are WJets/runMyFastPlots.cc, WJets/Sources/myFastPlots.cc, WJets/Includes/myFastPlots.h, (by modifying the original WJets/runFastPlots.cc). The name of the new distributions should be added in WJets/Includes/variablesOfInterestVarWidth.h

Run the code

root -b -q runMyFastPlots.cc++

Output PDF files will be in the directory PNGFiles.

To do closure test, change line 20th in runMyFastPlots.cc to be myFastPlots("SMu", "ZNGoodJets_Zexc", true);


Instructions for BlackHat:


Instructions using Modified tools from W+Jets 7TeV:

NTuple Production

Set up CMSSW release

cmsrel CMSSW_5_3_8
cd CMSSW_5_3_8/src/
cmsenv

Setup specific code:

cvs co -d Leptoquarks/LeptonJetFilter UserCode/BhawanUppal/WJets_8TeV/NTupleMaker/Leptoquarks/LeptonJetFilter/
cvs co -d Leptoquarks/CosmicID UserCode/BhawanUppal/WJets_8TeV/NTupleMaker/Leptoquarks/CosmicID/
cvs co -d Leptoquarks/MetTools UserCode/BhawanUppal/WJets_8TeV/NTupleMaker/Leptoquarks/MetTools
cvs co -d Leptoquarks/LeptonJetGenTools UserCode/BhawanUppal/WJets_8TeV/NTupleMaker/Leptoquarks/LeptonJetGenTools
cvs co -d Leptoquarks/RootTupleMakerV2/ UserCode/BhawanUppal/WJets_8TeV/NTupleMaker/Leptoquarks/RootTupleMakerV2/

Use PAT V08_09_52 (or later) for 53X:

addpkg DataFormats/PatCandidates V06-05-06-06
addpkg PhysicsTools/PatAlgos     V08-09-52
addpkg DataFormats/StdDictionaries V00-02-14
addpkg FWCore/GuiBrowsers V00-00-70

Add new EGamma isolation definition.

addpkg RecoParticleFlow/PFProducer V15-02-06

Add latest Tau discriminators.

addpkg RecoTauTag/RecoTau V01-04-23
addpkg RecoTauTag/Configuration V01-04-10

The following code is needed for the MVA electron ID (used in H -> WW analyses):

cvs co -r CutBasedId_V00-00-05 -d EGamma/EGammaAnalysisTools UserCode/EGamma/EGammaAnalysisTools
cd EGamma/EGammaAnalysisTools/data
cat download.url | xargs wget 
cd -

The following code is needed to filter out events with bad/fake MET

cvs co -r V00-00-13 RecoMET/METFilters
cvs co -r V00-00-08 RecoMET/METAnalyzers
cvs co -r V00-11-17 DPGAnalysis/SiStripTools

Recompile the ElectroWeakAnalysis/Utilities package:

cvs co -r $CMSSW_VERSION ElectroWeakAnalysis/Utilities
scram setup lhapdffull
touch $CMSSW_BASE/src/ElectroWeakAnalysis/Utilities/BuildFile.xml

Compile!

scram b -j4

For local run:

cmsRun Leptoquarks/RootTupleMakerV2/test/rootTupleMaker_MC_2012_53X_cfg.py
cmsRun Leptoquarks/RootTupleMakerV2/test/rootTupleMaker_DATA_2012_53X_cfg.py

Datasets

/name nEvents nFiles cmsrel runrange
/SingleMu/Run2012A-22Jan2013-v1/AOD 19785316 817 CMSSW_5_3_7_patch5 190456-193621
/SingleMu/Run2012B-22Jan2013-v1/AOD 59538958 4252 CMSSW_5_3_7_patch5 193834-196531
/SingleMu/Run2012C-22Jan2013-v1/AOD 87683348 6171 CMSSW_5_3_7_patch5 198022-203742
/SingleMu/Run2012D-22Jan2013-v1/AOD 95078490 7566 CMSSW_5_3_7_patch6 203777-208686
/SingleElectron/Run2012A-22Jan2013-v1/AOD 21229150 1152 CMSSW_5_3_7_patch5 190456-193621
/SingleElectron/Run2012B-22Jan2013-v1/AOD 67940401 5298 CMSSW_5_3_7_patch5 193834-196531
/SingleElectron/Run2012C-22Jan2013-v1/AOD 101883743 7708 CMSSW_5_3_7_patch5 198022-203742
/SingleElectron/Run2012D-22Jan2013-v1/AOD 106555796 8010 CMSSW_5_3_7_patch6 203777-208686
/Photon/Run2012A-22Jan2013-v1/AOD 13031092 774 CMSSW_5_3_7_patch5 190456-193621
/SinglePhoton/Run2012B-22Jan2013-v1/AOD 12083866 900 CMSSW_5_3_7_patch5 193834-196531
/SinglePhoton/Run2012C-22Jan2013-v1/AOD 22336713 1618 CMSSW_5_3_7_patch5 198022-203742
/SinglePhotonParked/Run2012D-22Jan2013-v1/AOD 108032868 8028 CMSSW_5_3_7_patch6 203777-208686

JSON Files
  • Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txtlink here

Monte Carlo (Summer 12)

/name nEvents nFiles cmsrel Xsec (pb)
/WJetsToLNu_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 18393090 1612 CMSSW_5_3_2_patch4 36864.3
/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 30459503 2577 CMSSW_5_3_2_patch4 3531.9
/TTJets_SemiLeptMGDecays_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A_ext-v1/AODSIM 25424818 2617 CMSSW_5_3_2_patch5 103.71
/TTJets_HadronicMGDecays_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 10537444 1151 CMSSW_5_3_2_patch5 104.10
/TTJets_FullLeptMGDecays_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v2/AODSIM 12119013 1254 CMSSW_5_3_2_patch5 26.18

/WW_TuneZ2star_8TeV_pythia6_tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 10000431 896 CMSSW_5_3_2_patch4 26.18
/WZ_TuneZ2star_8TeV_pythia6_tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 10000283 824 CMSSW_5_3_2_patch4 26.18
/ZZ_TuneZ2star_8TeV_pythia6_tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 9799908 886 CMSSW_5_3_2_patch4 26.18

/WWJetsTo2L2Nu_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 1933235 174 CMSSW_5_3_2_patch4 54.838
/WZJetsTo3LNu_TuneZ2_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 2017979 183 CMSSW_5_3_2_patch4 33.21
/WZJetsTo2L2Q_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 3215990 306 CMSSW_5_3_2_patch4 33.21
/WZJetsTo2Q2Nu_TuneZ2star_8TeV-madgraph-tauloa/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 942547 92 CMSSW_5_3_2_patch4 33.21
/ZZJetsTo2L2Nu_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v3/AODSIM 954911 91 CMSSW_5_3_2_patch4 17.654
/ZZJetsTo2L2Q_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 1936727 184 CMSSW_5_3_2_patch4 17.654
/ZZJetsTo2Q2Nu_TuneZ2star_8TeV-madgraph-tauloa/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 800047 81 CMSSW_5_3_2_patch4 17.654
/ZZJetsTo4L_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 4807893 446 CMSSW_5_3_2_patch4 17.654
/Tbar_tW-channel-DR_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 493460 53 CMSSW_5_3_2_patch4 11.1
/Tbar_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 1935072 188 CMSSW_5_3_2_patch4 30.7
/Tbar_s-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 139974 18 CMSSW_5_3_2_patch4 1.76
/T_tW-channel-DR_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 497658 58 CMSSW_5_3_2_patch4 11.1
/T_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v3/AODSIM 99876 12 CMSSW_5_3_2_patch4 56.4
/T_s-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 259961 31 CMSSW_5_3_2_patch4 3.79

Triggers

HLT_Ele27_WP80_v8
HLT_IsoMu24_eta2p1_v11   

Creating Ntuples with CRAB

*For MC samples
[CMSSW]
datasetpath             =  None
pset                    =  rootTupleMaker_MC_2012_53X_cfg.py
output_file             =  rootTupleMaker_MC.root
#total_number_of_events  = -1
#number_of_jobs         = 450

[USER]
return_data             = 0
copy_data               = 1
storage_element = srm-eoscms.cern.ch
storage_path=/srm/v2/server?SFN=/eos/cms
user_remote_dir=/store/group/phys_smp/WPlusJets/ntuples
check_user_remote_dir  = 0

[CRAB]
scheduler               = remoteGlidein
jobtype                 = cmssw
use_server              = 0

[GRID]
rb = CERN
proxy_server=myproxy.cern.ch
virtual_organization  = cms
retry_count = 0

*To submit multiple jobs, set multicrab as:

[MULTICRAB]
cfg=crab.cfg

[WJETS_MG]
CMSSW.datasetpath=/WJetsToLNu_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM  
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 450

[DYJets_MG]
CMSSW.datasetpath=/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 450

[TTJETS_SemiLepMG]
CMSSW.datasetpath=/TTJets_SemiLeptMGDecays_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A_ext-v1/AODSIM  
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 450

[TTJETS_HadMG]
CMSSW.datasetpath=/TTJets_HadronicMGDecays_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM 
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 450

[TTJETS_FullLeptMG]
CMSSW.datasetpath=/TTJets_FullLeptMGDecays_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v2/AODSIM  
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 450

[WWJetsTo2L2Nu]
CMSSW.datasetpath=/WWJetsTo2L2Nu_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM   
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 174

[WZJetsTo3LNu]
CMSSW.datasetpath=/WZJetsTo3LNu_TuneZ2_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM   
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 183

[WZJetsTo2L2Q]
CMSSW.datasetpath=/WZJetsTo2L2Q_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM   
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 306

[WZJetsTo2Q2Nu]
CMSSW.datasetpath=/WZJetsTo2Q2Nu_TuneZ2star_8TeV-madgraph-tauloa/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM   
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 92

[ZZJetsTo2L2Nu]
CMSSW.datasetpath=/ZZJetsTo2L2Nu_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v3/AODSIM   
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 91

[ZZJetsTo2L2Q]
CMSSW.datasetpath=/ZZJetsTo2L2Q_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM    
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 184

[ZZJetsTo2Q2Nu]
CMSSW.datasetpath=/ZZJetsTo2Q2Nu_TuneZ2star_8TeV-madgraph-tauloa/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM    
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 81

[ZZJetsTo4L]
CMSSW.datasetpath=/ZZJetsTo4L_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM    
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 446

[Tbar_tW-channel]
CMSSW.datasetpath=/Tbar_tW-channel-DR_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM    
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 53


[Tbar_t-channel]
CMSSW.datasetpath=/Tbar_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM     
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 188

[Tbar_s-channel]
CMSSW.datasetpath=/Tbar_s-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM     
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 18

[T_tW-channel]
CMSSW.datasetpath=/T_tW-channel-DR_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM      
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 58

[T_t-channel]
CMSSW.datasetpath=/T_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v3/AODSIM      
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 12

[T_s-channel]
CMSSW.datasetpath=/T_s-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM     
CMSSW.total_number_of_events=-1
CMSSW.number_of_jobs = 31

  • Submit jobs on crab:
multicrab -create
multicrab -submit
multicrab -status
multicrab -getoutput (after jobs are done)

Output root files will be at:

/eos/cms/store/group/phys_smp/WPlusJets/ntuples

  • For DataSets:
       Change: 
       CMSSW.total_number_of_lumis = -1 
       with
       CMSSW.total_number_of_events=-1 
       in multicrab.cfg 
       
  • And also set:
     
       lumi_mask = Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt
       in [CMSSW] section of crab.cfg
    

NOTE:
- CRAB cannot handle more than 500 jobs on a single dataset.
- So, set "number_of_jobs" equal to or less than the number of files in the dataset (as given in DBS).
However, since most datasets (DATA and MC) consist of more than 500 files, in practice it is recommended to:
__ Set "number_of_jobs" equal to 450 for datasets with >450 files
__ Set "number_of_jobs" equal to the number of files for datasets with <450 files

Making Trees with NTuple Analyzer

Check Out Code, CMSSW_4_2_8 is best for ROOT compatibility

cmsrel CMSSW_4_2_8
cd CMSSW_4_2_8/src
cmsenv
cvs co -d WJets8TeVTreeMaker UserCode/baumgartel/WPlusJets/8TeV/WJetsAnalysis/TreeMaker
cd WJets8TeVTreeMaker

Now you will want to make the CSV file which does the book-keeping of the ntuples, with cross-sections, event counts, etc.

  • Prepare the csv spreadsheet (comma-separated text file) which details the NTuples to run on, like 8TeV Example csv. Columns detail:
    • SignalType: The ntuple names should start with this. i.e. all the TTJets ntuples start with "TTJets_TuneZ2_7TeV-madgraph". The tool will sort the files into these groups.
    • XSections: The cross-sections. Usually using the best theory cross-sections from the best known standard-model cross-sections twiki, or the twiki for 8TeV
    • N_orig: The number of events in the (MC) sample. Can be taken from the LJFilter histograms in the ntuples, or if you ran on the whole set successfully you can get these numbers from DAS. Just set to "1" for real data.
    • Group: This is a group name. For eample, the WW, WZ, and ZZ could all belong to the group DiBoson, and they will be merged into a file "DiBoson.root" when the tool is done.
    • EOSDirectory: The directory on castor (these days on EOS), starting with 'store'...
    • CustomJson: The json file to apply (for data only).

Since crab-jobs some times have duplicates, a master list of files should be created. This can be done automatically with the "--FileRefresh" option. This procedure can be slow, but you don't need to do it every time, only after changing ntuples. This run would give you the total gen-level event counts. If you are unsure of these event counts, let it run. Or you can feel free to kill it when it starts submitting jobs.

python AnalyzerMakerFastLocal.py -i NTupleInfo2012Full.csv -py NTupleEvCounter.py -t PreFullLumiCountUpdate -j CustomJson2012ABCD.txt -p 0 -q 8nh -s 100 --FileRefresh

If you ran the event counter, you can now update your CSV file. You can proceed with producing NTuples. Make any physics changes you want to NTupleAnalyzer.py and then launch:

python AnalyzerMakerFastLocal.py -i NTupleInfo2012Full.csv -py NTupleAnalyzer.py -t FullRunTest -j CustomJson2012ABCD.txt -p 0 -q 1nd -s 15

Note: If you want to test locally a single job, kill it when it starts submitting jobs. Then you can try a single job as follows: A directory has already been made by the AnalyzerMakerFastLocal.py, called NTupleAnalyzer_(TagName)_(TimeAndDateStamp). Go into that directory and cat one of the "subber_*.tcsh" files. It will contain several python commands for running the NTupleAnalyzer on individual root files on eos. Try one command. It should look something like:

python NTupleAnalyzer.py -f /store/group/phys_exotica/leptonsPlusJets/RootNtuple/hsaka/RootNtuple-V00-03-09-Summer12MC_TTJets_SemiLeptMGDecays_20121022_221217/TTJets_SemiLeptMGDecays_8TeV-madgraph__Summer12_DR53X-PU_S10_START53_V7A-v1__AODSIM_154_2_uAx.root -s 103.71 -n 11229902 -j CustomJson2012ABCD.txt -l 1.0 -p 0 -d /afs/cern.ch/work/d/darinb/WJets8TeVPrep/WJets8TeVTreeMaker/NTupleAnalyzer_FullRunTest_2013_10_22_23_36_59

A note on the arguments:

  •  -i CSVFile.csv 
    - The CSV file you have created.
  •  -py file.py 
    - The NTupleAnalyzer (or event counter) you wish to run.
  •  -t AnalysisName 
    - The root files will be output in a local directory names with this tag name. It is totally up to the user.
  •  -j JsonFile.txt 
    - The JSON file. The version in CVS is just a clone of the Jan22ReReco Golden JSON file ( https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions12/8TeV/Reprocessing/Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt )
  •  -p <option> 
    - Store PDF variations Yes (1) or No (0)
  •  -q batchqueue 
    - The batch queue to use.
  •  -s <number> 
    - Number of files to run per job. Up to the user. Increasing this number decreases the amount of batch jobs, increasing the time to completion.
  •  -d directoryname 
    - The name of the directory.
    • This is especially useful if you have started a job submission, and either lost connection or lost afs token, and you have run many jobs with root file output, but not yet finished. You can restart where you left off by adding the -d Argument and your last working directory. For instance, if your last working directory was "NTupleAnalyzer_FullRunTest_2013_11_18_19_38_40":
    • python AnalyzerMakerFastLocal.py -i NTupleInfo2012Full.csv -py NTupleAnalyzer.py -t FullRunTest -j CustomJson2012ABCD.txt -p 0 -q 1nd -s 15 -d NTupleAnalyzer_FullRunTest_2013_11_18_19_38_40

Topic attachments
I Attachment History Action Size Date Who Comment
PDFpdf AN2014_114_v7.pdf r1 manage 9503.9 K 2015-05-24 - 15:55 ApichartHortiangtham  
PDFpdf VJets_Processing.pdf r1 manage 1476.4 K 2014-05-15 - 15:32 BhawandeepBhawandeep Ntuple Production
Edit | Attach | Watch | Print version | History: r49 < r48 < r47 < r46 < r45 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r49 - 2016-02-18 - ApichartHortiangtham
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback