-
Notifications
You must be signed in to change notification settings - Fork 21
/
analysis_steps_francesco.txt
191 lines (127 loc) · 11.6 KB
/
analysis_steps_francesco.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
B41;309;0c#######################################
0) Setup area
#######################################
cd /cmshome/santanas/CMS/Releases/
scram p -n CMSSW_7_4_3_DiJet CMSSW CMSSW_7_4_3
cd CMSSW_7_4_3_DiJet/src
git clone https://github.com/CMSDIJET/DijetRootTreeMaker.git CMSDIJET/DijetRootTreeMaker
git clone https://github.com/CMSDIJET/DijetRootTreeAnalyzer.git CMSDIJET/DijetRootTreeAnalyzer
git clone https://github.com/CMSDIJET/Utilities.git CMSDIJET/Utilities
setenv MYCMSSW "/cmshome/santanas/CMS/Releases/CMSSW_7_4_3"
#######################################
1) Create trees
#######################################
Follow instructions at
https://twiki.cern.ch/twiki/bin/view/CMS/ExoDijet13TeVSubmitJobsWithCrab2014
Copy files to your T2 if needed by using
https://github.com/CMSDIJET/Utilities/blob/master/scripts/copyWithLcg.py
The big root trees for data are here
high-mass: https://github.com/CMSDIJET/DijetRootTreeMaker/blob/master/data/json/README
#######################################
2) Create lists to produce reduced skims
#######################################
cd $MYCMSSW/src/CMSDIJET/Utilities/scripts/
python createList_T2.py -i /pnfs/roma1.infn.it/data/cms/store/user/santanas/rootTrees/Run2015B_JetHT17Jul_25July2015-CertJson-251244-251585_JEC-Summer15_50nsV2_501dfb2/JetHT/crab_JetHT__Run2015B-17Jul2015-v1__MINIAOD/150725_093350/0000/ /pnfs/roma1.infn.it/data/cms/store/user/santanas/rootTrees/Run2015B_JetHT_25July2015-CertJson-251586-251883_JEC-Summer15_50nsV2_501dfb2/JetHT/crab_JetHT__Run2015B-PromptReco-v1__MINIAOD/150725_093952/0000/ /pnfs/roma1.infn.it/data/cms/store/user/santanas/rootTrees/Dijet_Spring15_JECV5_09_07_2015/ -o $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/config/lists_40pb-1_30_07_2015/
note: you can specify more that one folder. All the samples with the dataset name will be merged in the corresponding list.
rm $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/config/lists_40pb-1_30_07_2015/inputListAllCurrent.txt
#######################################
3) Submit in batch the reduced skims
#######################################
cd $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/
### setup the analyzer
( following instructions at
https://twiki.cern.ch/twiki/bin/viewauth/CMS/ExoDijet13TeV#Basic_Working_example_analysisCl )
a) take one file from a random list
less test/santanas/config/lists_40pb-1_30_07_2015/QstarToJJ_M_4000_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM.txt | grep .root
--> dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/rootTrees/Dijet_Spring15_JECV5_09_07_2015/QstarToJJ_M_4000_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM_1.root
b) compile
./scripts/make_rootNtupleClass.sh -f dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/rootTrees/Dijet_Spring15_JECV5_09_07_2015/QstarToJJ_M_4000_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM_1.root -t dijets/events
ln -sf analysisClass_mainDijetSelection.C src/analysisClass.C
make clean
make
c) test code
./main test/santanas/config/lists_40pb-1_30_07_2015/QstarToJJ_M_4000_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM.txt config/cutFile_mainDijetSelection.txt dijets/events test/santanas/output/output_test test/santanas/output/output_test
### edit script
emacs $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/scripts/submit_batch_T2_split.py &
change line
command = "./main "+splittedlist[jj]+" batch/"+cutfileName+" dijets/events /tmp/rootfile_"+sample+"_"+newTag+"_"+str(jj)+" /tmp/cutEfficiencyFile_"+sample+"_"+newTag+"_"+str(jj)
if needed
### submit
For analysis:
python scripts/submit_batch_T2_split.py -i $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/config/lists_40pb-1_30_07_2015/ -o /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015 -q cmsan -m JetHT --split 5 --tag santanas__40pb-1_30_07_2015 -c config/cutFile_mainDijetSelection.txt
python scripts/submit_batch_T2_split.py -i $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/config/lists_40pb-1_30_07_2015/ -o /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015 -q cmsan -m RunIISpring15DR74 --split 5 --tag santanas__40pb-1_30_07_2015 -c config/cutFile_mainDijetSelection.txt
For trigger:
python scripts/submit_batch_T2_split.py -i $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/config/lists_65pb-1_11_09_2015_SingleMuon/ -o /pnfs/roma1.infn.it/data/cms/store/user/roma-group1/Dijet/reducedTrees/santanas__SingleMu__65pb-1_50ns_11_09_2015 -q cmsan -m SingleMuon --split 5 --tag santanas__SingleMu__65pb-1_50ns_11_09_2015 -c config/cutFile_mainDijetSelection.txt
note: you must specify the folder that contains all the lists you want to submit (the submit_batch_T2_split only works at the moment
for output directories in /pnfs/...)
note: you can use the option match to submit only a set of lists ( ex. -m ExpressPhysics__Run2015B-Express-v1__FEVT.txt )
note: you can use the option tag to identify the files better ( ex. --tag santanas__40pb-1_30_07_2015 )
note: you can use the option split to specify how many files per job ( ex. --split 5 )
### merge
emacs $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/scripts/mergeJobs.sh &
Change "DIR" with the output of the previous step
i.e.
DIR='/pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015/'
./scripts/mergeJobs.sh
and then
DIR='/pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/'
./scripts/mergeJobs.sh
--> the files merged will be in '/pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/
note:
For data you need to merge manually the files corresponding to different datasets:
dccp /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015/merged/rootfile_JetHT__Run2015B-PromptReco-v1__MINIAOD__reduced_skim.root /tmp/
dccp /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015/merged/rootfile_JetHT__Run2015B-17Jul2015-v1__MINIAOD__reduced_skim.root /tmp/
hadd /tmp/rootfile_JetHT__Run2015B-All-v1__MINIAOD__reduced_skim.root /tmp/rootfile_JetHT__Run2015B-17Jul2015-v1__MINIAOD__reduced_skim.root /tmp/rootfile_JetHT__Run2015B-PromptReco-v1__MINIAOD__reduced_skim.root
dccp /tmp/rootfile_JetHT__Run2015B-All-v1__MINIAOD__reduced_skim.root /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015/merged/
### check number of events processed (for data)
root -l /tmp/rootfile_SingleMuon__Run2015B-17Jul2015-v1__MINIAOD_santanas__SingleMu__65pb-1_50ns_11_09_2015_20150911_162134_reduced_skim.root
DijetFilter->cd()
EventCount->cd()
root [8] EventCounter->GetBinContent(2)
(Double_t) 9.029780e+05
Note: The number should match the number of events reported by crab report (and reported usually in the Twiki) for the entire dataset considered.
#######################################
4) Draw histograms from reduced trees
#######################################
####################
Trigger efficiency
####################
cd $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/scripts
root -l -b triggerEfficiency.C
Notes:
setting histoFromFile=1 you take histograms (numerator and denominator) directly from the root file.
setting histoFromFile=0 you create histograms from the flat root tree (here you need to edit the correspondent code part
below "//== creating histo from tree")
####################
Standard selection
####################
cd $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/
### create file with input reduced trees (one for each sample) and relative cross sections (in pb).
Example
ls /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/*.root | awk '{print "dcap://cmsrm-se01.roma1.infn.it/"$0}'
ls /pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015/merged/rootfile_JetHT__Run2015B-All-v1__MINIAOD__reduced_skim.root | awk '{print "dcap://cmsrm-se01.roma1.infn.it/"$0}'
Then, the file will be:
mkdir $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/plots/santanas__40pb-1_30_07_2015/
emacs $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/plots/santanas__40pb-1_30_07_2015/listForPlots_santanas__40pb-1_30_07_2015.txt
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_300to470_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM__reduced_skim.root 7475
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_470to600_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v2__MINIAODSIM__reduced_skim.root 587.1
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_600to800_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v2__MINIAODSIM__reduced_skim.root 167
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_800to1000_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v2__MINIAODSIM__reduced_skim.root 28.25
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_1000to1400_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v2__MINIAODSIM__reduced_skim.root 8.195
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_1400to1800_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM__reduced_skim.root 0.7346
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM__reduced_skim.root 0.102
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM__reduced_skim.root 0.00644
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/mc/santanas__40pb-1_30_07_2015/merged/rootfile_QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8__RunIISpring15DR74-Asympt50ns_MCRUN2_74_V9A-v1__MINIAODSIM__reduced_skim.root 0.000163
dcap://cmsrm-se01.roma1.infn.it//pnfs/roma1.infn.it/data/cms/store/user/santanas/Dijet/reducedTrees/data/santanas__40pb-1_30_07_2015/merged/rootfile_JetHT__Run2015B-All-v1__MINIAOD__reduced_skim.root -1
Note:
The last file must be a signal sample or a data sample.
### run the plotting macro (in this step we also apply the detaJJ<1.3 cut)
cd $MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/scripts
For data vs MC bkg:
emacs run_DrawFromTree_data4T.sh &
(change input list, output, and lumi)
outputdir="$MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/plots/santanas__40pb-1_30_07_2015/"
list="$MYCMSSW/src/CMSDIJET/DijetRootTreeAnalyzer/test/santanas/plots/santanas__40pb-1_30_07_2015/listForPlots_santanas__40pb-1_30_07_2015.txt"
lumi="40.2"
check the scale factor
./run_DrawFromTree_data4T.sh