1 |
// $Id: runHgg.C,v 1.4 2011/12/19 21:56:23 bendavid Exp $
|
2 |
#if !defined(__CINT__) || defined(__MAKECINT__)
|
3 |
#include <TSystem.h>
|
4 |
#include <TProfile.h>
|
5 |
#include "MitAna/DataUtil/interface/Debug.h"
|
6 |
#include "MitAna/Catalog/interface/Catalog.h"
|
7 |
#include "MitAna/TreeMod/interface/Analysis.h"
|
8 |
#include "MitAna/TreeMod/interface/HLTMod.h"
|
9 |
#include "MitAna/PhysicsMod/interface/RunLumiSelectionMod.h"
|
10 |
#include "MitAna/PhysicsMod/interface/MCProcessSelectionMod.h"
|
11 |
#include "MitAna/PhysicsMod/interface/PublisherMod.h"
|
12 |
#include "MitAna/DataTree/interface/JetCol.h"
|
13 |
#include "MitAna/DataTree/interface/PFJetCol.h"
|
14 |
#include "MitPhysics/Init/interface/ModNames.h"
|
15 |
#include "MitPhysics/Mods/interface/GoodPVFilterMod.h"
|
16 |
#include "MitPhysics/Mods/interface/MuonIDMod.h"
|
17 |
#include "MitPhysics/Mods/interface/ElectronIDMod.h"
|
18 |
#include "MitPhysics/Mods/interface/ElectronCleaningMod.h"
|
19 |
#include "MitPhysics/Mods/interface/PhotonIDMod.h"
|
20 |
#include "MitPhysics/Mods/interface/PhotonPairSelector.h"
|
21 |
#include "MitPhysics/Mods/interface/PhotonTreeWriter.h"
|
22 |
#include "MitPhysics/Mods/interface/PhotonCleaningMod.h"
|
23 |
#include "MitPhysics/Mods/interface/MergeLeptonsMod.h"
|
24 |
#include "MitPhysics/Mods/interface/JetCorrectionMod.h"
|
25 |
#include "MitPhysics/Mods/interface/PhotonMvaMod.h"
|
26 |
#include "MitPhysics/Mods/interface/MVASystematicsMod.h"
|
27 |
|
28 |
#endif
|
29 |
|
30 |
//--------------------------------------------------------------------------------------------------
|
31 |
void runHgg(const char *fileset = "",
|
32 |
const char *skim = "noskim",
|
33 |
//const char *dataset = "w10-h120gg-gf-v8-pu",
|
34 |
// const char *dataset = "w10-qcd2em40-v8-pu",
|
35 |
//const char *dataset = "s11-qcd2em40-v11-pu",
|
36 |
//const char *dataset = "r11b-pho-n30-v1",
|
37 |
//const char *dataset = "s11-h120gg-gf-v11-pu",
|
38 |
//const char *dataset = "s11-pj-2em20-v11-pu",
|
39 |
//const char *dataset = "s11-h130gg-gf-v11-pu",
|
40 |
//const char *dataset = "f11-pj-2em20-v14b-pu",
|
41 |
//const char *dataset = "f11--qcd-2em40-v14b-pu",
|
42 |
//const char *dataset = "f11--h120gg-gf-v14b-pu",
|
43 |
const char *dataset = "f11--h135gg-vh-v14b-pu",
|
44 |
//const char *dataset = "f11--2pibx10_25-v14b-pu",
|
45 |
//const char *dataset = "s11-zeem20-powheg-v11-pu",
|
46 |
//const char *dataset = "s11-wjets-v11-pu",
|
47 |
//const char *dataset = "p11-zll50-v1g1-pu",
|
48 |
const char *book = "local/filefi/025",
|
49 |
const char *catalogDir = "/home/cmsprod/catalog",
|
50 |
const char *outputName = "hgg",
|
51 |
int nEvents = -1)
|
52 |
{
|
53 |
//------------------------------------------------------------------------------------------------
|
54 |
// some parameters get passed through the environment
|
55 |
//------------------------------------------------------------------------------------------------
|
56 |
char json[1024], overlap[1024];
|
57 |
float overlapCut = -1;
|
58 |
|
59 |
if (gSystem->Getenv("MIT_PROD_JSON"))
|
60 |
sprintf(json, "%s",gSystem->Getenv("MIT_PROD_JSON"));
|
61 |
else {
|
62 |
sprintf(json, "%s", "~");
|
63 |
//printf(" JSON file was not properly defined. EXIT!\n");
|
64 |
//return;
|
65 |
}
|
66 |
|
67 |
TString jsonFile = TString("/home/bendavid/json/") + TString(json);
|
68 |
//TString jsonFile = TString("/home/bendavid/json/") + TString("Cert_136033-149442_7TeV_Dec22ReReco_Collisions10_JSON_v4.txt");
|
69 |
Bool_t isData = ( (jsonFile.CompareTo("/home/bendavid/json/~") != 0) );
|
70 |
|
71 |
if (gSystem->Getenv("MIT_PROD_OVERLAP")) {
|
72 |
sprintf(overlap,"%s",gSystem->Getenv("MIT_PROD_OVERLAP"));
|
73 |
if (EOF == sscanf(overlap,"%f",&overlapCut)) {
|
74 |
printf(" Overlap was not properly defined. EXIT!\n");
|
75 |
return;
|
76 |
}
|
77 |
}
|
78 |
else {
|
79 |
sprintf(overlap,"%s", "-1.0");
|
80 |
//printf(" OVERLAP file was not properly defined. EXIT!\n");
|
81 |
//return;
|
82 |
}
|
83 |
|
84 |
printf("\n Initialization worked. \n\n");
|
85 |
|
86 |
//------------------------------------------------------------------------------------------------
|
87 |
// some global setups
|
88 |
//------------------------------------------------------------------------------------------------
|
89 |
using namespace mithep;
|
90 |
gDebugMask = Debug::kGeneral;
|
91 |
gDebugLevel = 3;
|
92 |
|
93 |
//------------------------------------------------------------------------------------------------
|
94 |
// set up information
|
95 |
//------------------------------------------------------------------------------------------------
|
96 |
RunLumiSelectionMod *runLumiSel = new RunLumiSelectionMod;
|
97 |
runLumiSel->SetAcceptMC(kTRUE); // Monte Carlo events are always accepted
|
98 |
|
99 |
MCProcessSelectionMod *mcselmod = new MCProcessSelectionMod;
|
100 |
|
101 |
MVASystematicsMod *sysMod = new MVASystematicsMod;
|
102 |
sysMod->SetMCR9Scale(1.0035, 1.0035);
|
103 |
sysMod->SetIsData(isData);
|
104 |
|
105 |
// only select on run- and lumisection numbers when valid json file present
|
106 |
if ((jsonFile.CompareTo("/home/bendavid/json/~") != 0) &&
|
107 |
(jsonFile.CompareTo("/home/bendavid/json/-") != 0) ) {
|
108 |
runLumiSel->AddJSONFile(jsonFile.Data());
|
109 |
}
|
110 |
if ((jsonFile.CompareTo("/home/bendavid/json/-") == 0) ) {
|
111 |
printf("\n WARNING -- Looking at data without JSON file: always accept.\n\n");
|
112 |
runLumiSel->SetAbortIfNotAccepted(kFALSE); // accept all events if there is no valid JSON file
|
113 |
}
|
114 |
|
115 |
printf("\n Run lumi worked. \n\n");
|
116 |
|
117 |
//------------------------------------------------------------------------------------------------
|
118 |
// HLT information
|
119 |
//------------------------------------------------------------------------------------------------
|
120 |
HLTMod *hltModM = new HLTMod("HLTModM");
|
121 |
hltModM->AddTrigger("HLT_Mu9");
|
122 |
hltModM->AddTrigger("HLT_Mu11");
|
123 |
hltModM->AddTrigger("HLT_Mu15_v1");
|
124 |
hltModM->SetTrigObjsName("MyHltMuonObjs");
|
125 |
hltModM->SetAbortIfNotAccepted(kFALSE);
|
126 |
|
127 |
HLTMod *hltModE = new HLTMod("HLTModE");
|
128 |
// hltModE->AddTrigger("HLT_Photon10_L1R",132440,137028);
|
129 |
// hltModE->AddTrigger("HLT_Photon15_Cleaned_L1R",138564,140401);
|
130 |
// hltModE->AddTrigger("HLT_Ele15_SW_CaloEleId_L1R",141956,144114);
|
131 |
// hltModE->AddTrigger("HLT_Ele17_SW_CaloEleId_L1R",144115,147145);
|
132 |
// hltModE->AddTrigger("HLT_Ele17_SW_TightEleId_L1R",147146,148102);
|
133 |
// hltModE->AddTrigger("HLT_Ele27_SW_TightCaloEleIdTrack_L1R_v1",147146,148102);
|
134 |
// hltModE->AddTrigger("HLT_Ele22_SW_TighterCaloIdIsol_L1R_v1",148103,159999);
|
135 |
// hltModE->AddTrigger("HLT_Ele22_SW_TighterCaloIdIsol_L1R_v2",148103,159999);
|
136 |
// hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v1",160000,999999);
|
137 |
// hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v2",160000,999999);
|
138 |
// hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v3",160000,999999);
|
139 |
// hltModE->AddTrigger("HLT_Ele15_LW_L1R",1,1);
|
140 |
// hltModE->AddTrigger("HLT_Ele17_SW_CaloEleId_L1R",1,1);
|
141 |
// hltModE->AddTrigger("HLT_Ele22_SW_TighterCaloIdIsol_L1R_v2",1,1);
|
142 |
|
143 |
|
144 |
hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v1",150000,161176);
|
145 |
hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v2",161179,163261);
|
146 |
hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v3",163262,164237);
|
147 |
hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v4",165085,165888);
|
148 |
hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v5",165900,166967);
|
149 |
hltModE->AddTrigger("HLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL_v6",166968,170053);
|
150 |
hltModE->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v6",170054,170759);
|
151 |
hltModE->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v7",170760,173198);
|
152 |
hltModE->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v8",173199,178380);
|
153 |
hltModE->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v9",178381,179889);
|
154 |
hltModE->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v10",179890,999999);
|
155 |
hltModE->SetTrigObjsName("MyHltElecObjs");
|
156 |
hltModE->SetAbortIfNotAccepted(isData);
|
157 |
|
158 |
HLTMod *hltModES = new HLTMod("HLTModES");
|
159 |
hltModES->AddTrigger("HLT_Ele27_CaloIdVT_CaloIsoT_TrkIdT_TrkIsoT_v*",160000,999999);
|
160 |
hltModES->AddTrigger("HLT_Ele27_CaloIdVT_CaloIsoT_TrkIdT_TrkIsoT_v2",160000,999999);
|
161 |
hltModES->AddTrigger("HLT_Ele27_CaloIdVT_CaloIsoT_TrkIdT_TrkIsoT_v3",160000,999999);
|
162 |
hltModES->AddTrigger("HLT_Ele25_WP80_PFMT40_v*",160000,999999);
|
163 |
hltModES->AddTrigger("HLT_Ele27_WP80_PFMT50_v*",160000,999999);
|
164 |
hltModES->SetTrigObjsName("MyHltElecSObjs");
|
165 |
hltModES->SetAbortIfNotAccepted(isData);
|
166 |
|
167 |
HLTMod *hltModP = new HLTMod("HLTModP");
|
168 |
|
169 |
hltModP->AddTrigger("HLT_Photon26_CaloIdL_IsoVL_Photon18_CaloIdL_IsoVL_v*",160000,161176);
|
170 |
|
171 |
hltModP->AddTrigger("HLT_Photon26_CaloIdL_IsoVL_Photon18_CaloIdL_IsoVL_v*",161216,165633);
|
172 |
hltModP->AddTrigger("HLT_Photon26_CaloIdL_IsoVL_Photon18_R9Id_v*",161216,165633);
|
173 |
hltModP->AddTrigger("HLT_Photon26_R9Id_Photon18_CaloIdL_IsoVL_v*",161216,165633);
|
174 |
hltModP->AddTrigger("HLT_Photon20_R9Id_Photon18_R9Id_v*",161216,165633);
|
175 |
|
176 |
hltModP->AddTrigger("HLT_Photon26_CaloIdL_IsoVL_Photon18_CaloIdL_IsoVL_v*",165970,173198);
|
177 |
hltModP->AddTrigger("HLT_Photon26_CaloIdL_IsoVL_Photon18_R9Id_v*",165970,173198);
|
178 |
hltModP->AddTrigger("HLT_Photon26_R9Id_Photon18_CaloIdL_IsoVL_v*",165970,173198);
|
179 |
hltModP->AddTrigger("HLT_Photon26_R9Id_Photon18_R9Id_v*",165970,173198);
|
180 |
hltModP->AddTrigger("HLT_Photon36_CaloIdL_IsoVL_Photon22_CaloIdL_IsoVL_v*",165970,173198);
|
181 |
hltModP->AddTrigger("HLT_Photon36_R9Id_Photon22_CaloIdL_IsoVL_v*",165970,173198);
|
182 |
hltModP->AddTrigger("HLT_Photon36_R9Id_Photon22_R9Id_v*",165970,173198);
|
183 |
|
184 |
hltModP->AddTrigger("HLT_Photon36_CaloId_IsoVL_Photon22_R9Id_v*",165970,166967);
|
185 |
hltModP->AddTrigger("HLT_Photon36_CaloIdL_IsoVL_Photon22_R9Id_v*",167039,173198);
|
186 |
|
187 |
hltModP->AddTrigger("HLT_Photon26_CaloIdXL_IsoXL_Photon18_CaloIdXL_IsoXL_v*",173236,178380);
|
188 |
hltModP->AddTrigger("HLT_Photon26_CaloIdXL_IsoXL_Photon18_R9Id_v*",173236,178380);
|
189 |
hltModP->AddTrigger("HLT_Photon26_R9Id_Photon18_CaloIdXL_IsoXL_v*",173236,178380);
|
190 |
hltModP->AddTrigger("HLT_Photon26_R9Id_Photon18_R9Id_v*",173236,178380);
|
191 |
hltModP->AddTrigger("HLT_Photon36_CaloIdL_IsoVL_Photon22_CaloIdL_IsoVL_v*",173236,178380);
|
192 |
hltModP->AddTrigger("HLT_Photon36_CaloIdL_IsoVL_Photon22_R9Id_v*",173236,178380);
|
193 |
hltModP->AddTrigger("HLT_Photon36_R9Id_Photon22_CaloIdL_IsoVL_v*",173236,178380);
|
194 |
hltModP->AddTrigger("HLT_Photon36_R9Id_Photon22_R9Id_v*",173236,178380);
|
195 |
|
196 |
hltModP->AddTrigger("HLT_Photon26_CaloIdXL_IsoXL_Photon18_CaloIdXL_IsoXL_Mass60_v*",178420,999999);
|
197 |
hltModP->AddTrigger("HLT_Photon26_CaloIdXL_IsoXL_Photon18_R9IdT_Mass60_v*",178420,999999);
|
198 |
hltModP->AddTrigger("HLT_Photon26_R9IdT_Photon18_CaloIdXL_IsoXL_Mass60_v*",178420,999999);
|
199 |
hltModP->AddTrigger("HLT_Photon26_R9IdT_Photon18_R9IdT_Mass60_v*",178420,999999);
|
200 |
hltModP->AddTrigger("HLT_Photon36_CaloIdL_IsoVL_Photon22_CaloIdL_IsoVL_v*",178420,999999);
|
201 |
hltModP->AddTrigger("HLT_Photon36_CaloIdL_IsoVL_Photon22_R9Id_v*",178420,999999);
|
202 |
hltModP->AddTrigger("HLT_Photon36_R9Id_Photon22_CaloIdL_IsoVL_v*",178420,999999);
|
203 |
hltModP->AddTrigger("HLT_Photon36_R9Id_Photon22_R9Id_v*",178420,999999);
|
204 |
|
205 |
hltModP->SetTrigObjsName("MyHltPhotObjs");
|
206 |
hltModP->SetAbortIfNotAccepted(isData);
|
207 |
|
208 |
//------------------------------------------------------------------------------------------------
|
209 |
// select events with a good primary vertex
|
210 |
//------------------------------------------------------------------------------------------------
|
211 |
GoodPVFilterMod *goodPVFilterMod = new GoodPVFilterMod;
|
212 |
goodPVFilterMod->SetMinVertexNTracks(0);
|
213 |
goodPVFilterMod->SetMinNDof (4.0);
|
214 |
goodPVFilterMod->SetMaxAbsZ (24.0);
|
215 |
goodPVFilterMod->SetMaxRho (2.0);
|
216 |
goodPVFilterMod->SetAbortIfNotAccepted(kFALSE);
|
217 |
goodPVFilterMod->SetIsMC(!isData);
|
218 |
|
219 |
GoodPVFilterMod *goodPVFilterModE = new GoodPVFilterMod("GoodPVFilterModE");
|
220 |
goodPVFilterModE->SetOutputName("GoodVertexesE");
|
221 |
goodPVFilterModE->SetMinVertexNTracks(0);
|
222 |
goodPVFilterModE->SetMinNDof (4.0);
|
223 |
goodPVFilterModE->SetMaxAbsZ (24.0);
|
224 |
goodPVFilterModE->SetMaxRho (2.0);
|
225 |
goodPVFilterModE->SetIsMC(!isData);
|
226 |
|
227 |
GoodPVFilterMod *goodPVFilterModES = new GoodPVFilterMod("GoodPVFilterModES");
|
228 |
goodPVFilterModES->SetOutputName("GoodVertexesES");
|
229 |
goodPVFilterModES->SetMinVertexNTracks(0);
|
230 |
goodPVFilterModES->SetMinNDof (4.0);
|
231 |
goodPVFilterModES->SetMaxAbsZ (24.0);
|
232 |
goodPVFilterModES->SetMaxRho (2.0);
|
233 |
|
234 |
|
235 |
//------------------------------------------------------------------------------------------------
|
236 |
// object id and cleaning sequence
|
237 |
//------------------------------------------------------------------------------------------------
|
238 |
MuonIDMod *muonId = new MuonIDMod;
|
239 |
muonId->SetClassType ("Global");
|
240 |
muonId->SetIDType ("ZMuId");
|
241 |
muonId->SetIsoType ("TrackCaloSliding");
|
242 |
muonId->SetApplyD0Cut(kTRUE);
|
243 |
|
244 |
ElectronIDMod *elecId = new ElectronIDMod;
|
245 |
elecId->SetVertexName(goodPVFilterModE->GetOutputName());
|
246 |
elecId->SetIDType ("VBTFWorkingPointLowPtId");
|
247 |
elecId->SetIsoType ("PFIso");
|
248 |
elecId->SetNExpectedHitsInnerCut (0);
|
249 |
elecId->SetEtaMax(999.);
|
250 |
elecId->SetChargeFilter(kFALSE);
|
251 |
elecId->SetApplySpikeRemoval(kFALSE);
|
252 |
elecId->SetApplyEcalFiducial(kTRUE);
|
253 |
elecId->SetApplyEcalSeeded(kTRUE);
|
254 |
elecId->SetPtMin(20.0);
|
255 |
|
256 |
ElectronIDMod *elecIdS = new ElectronIDMod("ElectronIDModS");
|
257 |
elecIdS->SetVertexName(goodPVFilterModES->GetOutputName());
|
258 |
elecIdS->SetIDType ("VBTFWorkingPoint70Id");
|
259 |
elecIdS->SetIsoType ("VBTFWorkingPoint70Iso");
|
260 |
elecIdS->SetNExpectedHitsInnerCut (0);
|
261 |
elecIdS->SetEtaMax(999.);
|
262 |
elecIdS->SetChargeFilter(kFALSE);
|
263 |
elecIdS->SetApplySpikeRemoval(kFALSE);
|
264 |
elecIdS->SetApplyEcalFiducial(kTRUE);
|
265 |
elecIdS->SetApplyEcalSeeded(kTRUE);
|
266 |
elecIdS->SetPtMin(20.0);
|
267 |
elecIdS->SetOutputName("GoodElectronsS");
|
268 |
|
269 |
PublisherMod<PFJet,Jet> *pubJet = new PublisherMod<PFJet,Jet>("JetPub");
|
270 |
pubJet->SetInputName("AKt5PFJets");
|
271 |
pubJet->SetOutputName("PubAKt5PFJets");
|
272 |
|
273 |
PublisherMod<PFJet,Jet> *pubJetOpen = new PublisherMod<PFJet,Jet>("JetPubOpen");
|
274 |
pubJetOpen->SetInputName("AKt5PFJets");
|
275 |
pubJetOpen->SetOutputName("PubAKt5PFJetsOpen");
|
276 |
|
277 |
JetCorrectionMod *jetCorr = new JetCorrectionMod;
|
278 |
jetCorr->AddCorrectionFromFile(std::string((gSystem->Getenv("CMSSW_BASE") + TString("/src/MitPhysics/data/START42_V12_AK5PF_L1FastJet.txt")).Data()));
|
279 |
jetCorr->AddCorrectionFromFile(std::string((gSystem->Getenv("CMSSW_BASE") + TString("/src/MitPhysics/data/START42_V12_AK5PF_L2Relative.txt")).Data()));
|
280 |
jetCorr->AddCorrectionFromFile(std::string((gSystem->Getenv("CMSSW_BASE") + TString("/src/MitPhysics/data/START42_V12_AK5PF_L3Absolute.txt")).Data()));
|
281 |
if(isData){
|
282 |
jetCorr->AddCorrectionFromFile(std::string((gSystem->Getenv("CMSSW_BASE") + TString("/src/MitPhysics/data/START42_V12_AK5PF_L2L3Residual.txt")).Data()));
|
283 |
}
|
284 |
jetCorr->SetInputName(pubJet->GetOutputName());
|
285 |
jetCorr->SetCorrectedName("CorrectedJets");
|
286 |
|
287 |
Bool_t excludedoubleprompt = kFALSE;
|
288 |
if (TString(dataset).Contains("-pj")) {
|
289 |
mcselmod->ExcludeProcess(18);
|
290 |
mcselmod->ExcludeProcess(114);
|
291 |
excludedoubleprompt = kTRUE;
|
292 |
}
|
293 |
|
294 |
if (TString(dataset).Contains("-qcd2em") || TString(dataset).Contains("-qcd-2em")) {
|
295 |
excludedoubleprompt = kTRUE;
|
296 |
}
|
297 |
|
298 |
PhotonMvaMod *photreg = new PhotonMvaMod;
|
299 |
photreg->SetOutputName("GoodPhotonsRegr");
|
300 |
photreg->SetIsData(isData);
|
301 |
|
302 |
|
303 |
PhotonPairSelector *photcic = new PhotonPairSelector("PhotonPairSelectorCiC");
|
304 |
photcic->SetOutputName("GoodPhotonsCIC");
|
305 |
photcic->SetPhotonSelType("CiCSelection");
|
306 |
photcic->SetVertexSelType("CiCMVASelection");
|
307 |
photcic->DoMCSmear(kTRUE);
|
308 |
photcic->DoDataEneCorr(kTRUE);
|
309 |
photcic->SetPhotonsFromBranch(kFALSE);
|
310 |
photcic->SetInputPhotonsName(photreg->GetOutputName());
|
311 |
photcic->SetMCSmearFactors(0.0089, 0.0089, 0.0109, 0.0156, 0.0203,0.0303,0.0326,0.0318,0.0331);
|
312 |
photcic->AddEnCorrPerRun(160000,167913,0.9905,0.9905,0.9971,0.9976,1.0094,0.9994,1.0044,0.9968,1.0079);
|
313 |
photcic->AddEnCorrPerRun(170249,172619,0.9909,0.9909,0.9975,0.9994,1.0112,0.9962,1.0012,0.9962,1.0072);
|
314 |
photcic->AddEnCorrPerRun(172620,173692,0.9909,0.9909,0.9975,0.9977,1.0096,0.9963,1.0013,0.9947,1.0057);
|
315 |
photcic->AddEnCorrPerRun(175860,177139,0.9911,0.9911,0.9977,0.9990,1.0109,0.9922,0.9973,0.9967,1.0077);
|
316 |
photcic->AddEnCorrPerRun(177140,178421,0.9910,0.9910,0.9975,0.9987,1.0105,0.9921,0.9972,0.9975,1.0085);
|
317 |
photcic->AddEnCorrPerRun(178424,999999,0.9903,0.9903,0.9969,0.9976,1.0095,0.9889,0.9940,0.9976,1.0086);
|
318 |
photcic->SetDoMCR9Scaling(kTRUE);
|
319 |
photcic->SetMCR9Scale(1.0048, 1.00492);
|
320 |
photcic->SetDoMCErrScaling(kTRUE);
|
321 |
photcic->SetMCErrScale(1.07, 1.045);
|
322 |
photcic->SetIsData(isData);
|
323 |
|
324 |
PhotonPairSelector *photcicnoeleveto = new PhotonPairSelector("PhotonPairSelectorCiCNoEleVeto");
|
325 |
photcicnoeleveto->SetOutputName("GoodPhotonsCICNoEleVeto");
|
326 |
photcicnoeleveto->SetPhotonSelType("CiCSelection");
|
327 |
photcicnoeleveto->SetVertexSelType("CiCMVASelection");
|
328 |
photcicnoeleveto->DoMCSmear(kTRUE);
|
329 |
photcicnoeleveto->DoDataEneCorr(kTRUE);
|
330 |
photcicnoeleveto->SetPhotonsFromBranch(kFALSE);
|
331 |
photcicnoeleveto->SetInputPhotonsName(photreg->GetOutputName());
|
332 |
photcicnoeleveto->SetMCSmearFactors(0.0089, 0.0089, 0.0109, 0.0156, 0.0203,0.0303,0.0326,0.0318,0.0331);
|
333 |
photcicnoeleveto->AddEnCorrPerRun(160000,167913,0.9905,0.9905,0.9971,0.9976,1.0094,0.9994,1.0044,0.9968,1.0079);
|
334 |
photcicnoeleveto->AddEnCorrPerRun(170249,172619,0.9909,0.9909,0.9975,0.9994,1.0112,0.9962,1.0012,0.9962,1.0072);
|
335 |
photcicnoeleveto->AddEnCorrPerRun(172620,173692,0.9909,0.9909,0.9975,0.9977,1.0096,0.9963,1.0013,0.9947,1.0057);
|
336 |
photcicnoeleveto->AddEnCorrPerRun(175860,177139,0.9911,0.9911,0.9977,0.9990,1.0109,0.9922,0.9973,0.9967,1.0077);
|
337 |
photcicnoeleveto->AddEnCorrPerRun(177140,178421,0.9910,0.9910,0.9975,0.9987,1.0105,0.9921,0.9972,0.9975,1.0085);
|
338 |
photcicnoeleveto->AddEnCorrPerRun(178424,999999,0.9903,0.9903,0.9969,0.9976,1.0095,0.9889,0.9940,0.9976,1.0086);
|
339 |
photcicnoeleveto->SetDoMCR9Scaling(kTRUE);
|
340 |
photcicnoeleveto->SetMCR9Scale(1.0048, 1.00492);
|
341 |
photcicnoeleveto->SetDoMCErrScaling(kTRUE);
|
342 |
photcicnoeleveto->SetMCErrScale(1.07, 1.045);
|
343 |
photcicnoeleveto->SetApplyEleVeto(kFALSE);
|
344 |
photcicnoeleveto->SetIsData(isData);
|
345 |
|
346 |
|
347 |
PhotonPairSelector *photpresel = new PhotonPairSelector("PhotonPairSelectorPresel");
|
348 |
photpresel->SetOutputName("GoodPhotonsPresel");
|
349 |
photpresel->SetPhotonSelType("MITSelection");
|
350 |
photpresel->SetVertexSelType("CiCMVASelection");
|
351 |
photpresel->DoMCSmear(kTRUE);
|
352 |
photpresel->DoDataEneCorr(kTRUE);
|
353 |
photpresel->SetPhotonsFromBranch(kFALSE);
|
354 |
photpresel->SetInputPhotonsName(photreg->GetOutputName());
|
355 |
photpresel->SetMCSmearFactors(0.0045, 0.0084, 0.0109, 0.0156, 0.0203,0.0303,0.0326,0.0318,0.0331);
|
356 |
photpresel->AddEnCorrPerRun(160000,167913,0.9905,0.9905,0.9971,0.9976,1.0094,0.9994,1.0044,0.9968,1.0079);
|
357 |
photpresel->AddEnCorrPerRun(170249,172619,0.9909,0.9909,0.9975,0.9994,1.0112,0.9962,1.0012,0.9962,1.0072);
|
358 |
photpresel->AddEnCorrPerRun(172620,173692,0.9909,0.9909,0.9975,0.9977,1.0096,0.9963,1.0013,0.9947,1.0057);
|
359 |
photpresel->AddEnCorrPerRun(175860,177139,0.9911,0.9911,0.9977,0.9990,1.0109,0.9922,0.9973,0.9967,1.0077);
|
360 |
photpresel->AddEnCorrPerRun(177140,178421,0.9910,0.9910,0.9975,0.9987,1.0105,0.9921,0.9972,0.9975,1.0085);
|
361 |
photpresel->AddEnCorrPerRun(178424,999999,0.9903,0.9903,0.9969,0.9976,1.0095,0.9889,0.9940,0.9976,1.0086);
|
362 |
photpresel->SetDoMCR9Scaling(kTRUE);
|
363 |
photpresel->SetMCR9Scale(1.0035, 1.0035);
|
364 |
photpresel->SetDoMCSigIEtaIEtaScaling(kTRUE);
|
365 |
photpresel->SetDoMCWidthScaling(kTRUE);
|
366 |
photpresel->SetDoMCErrScaling(kTRUE);
|
367 |
photpresel->SetMCErrScale(1.07, 1.045);
|
368 |
photpresel->SetIsData(isData);
|
369 |
|
370 |
PhotonPairSelector *photpreselinverteleveto = new PhotonPairSelector("PhotonPairSelectorPreselInvertEleVeto");
|
371 |
photpreselinverteleveto->SetOutputName("GoodPhotonsPreselInvertEleVeto");
|
372 |
photpreselinverteleveto->SetPhotonSelType("MITSelection");
|
373 |
photpreselinverteleveto->SetVertexSelType("CiCMVASelection");
|
374 |
photpreselinverteleveto->DoMCSmear(kTRUE);
|
375 |
photpreselinverteleveto->DoDataEneCorr(kTRUE);
|
376 |
photpreselinverteleveto->SetPhotonsFromBranch(kFALSE);
|
377 |
photpreselinverteleveto->SetInputPhotonsName(photreg->GetOutputName());
|
378 |
photpreselinverteleveto->SetMCSmearFactors(0.0045, 0.0084, 0.0109, 0.0156, 0.0203,0.0303,0.0326,0.0318,0.0331);
|
379 |
photpreselinverteleveto->AddEnCorrPerRun(160000,167913,0.9905,0.9905,0.9971,0.9976,1.0094,0.9994,1.0044,0.9968,1.0079);
|
380 |
photpreselinverteleveto->AddEnCorrPerRun(170249,172619,0.9909,0.9909,0.9975,0.9994,1.0112,0.9962,1.0012,0.9962,1.0072);
|
381 |
photpreselinverteleveto->AddEnCorrPerRun(172620,173692,0.9909,0.9909,0.9975,0.9977,1.0096,0.9963,1.0013,0.9947,1.0057);
|
382 |
photpreselinverteleveto->AddEnCorrPerRun(175860,177139,0.9911,0.9911,0.9977,0.9990,1.0109,0.9922,0.9973,0.9967,1.0077);
|
383 |
photpreselinverteleveto->AddEnCorrPerRun(177140,178421,0.9910,0.9910,0.9975,0.9987,1.0105,0.9921,0.9972,0.9975,1.0085);
|
384 |
photpreselinverteleveto->AddEnCorrPerRun(178424,999999,0.9903,0.9903,0.9969,0.9976,1.0095,0.9889,0.9940,0.9976,1.0086);
|
385 |
photpreselinverteleveto->SetDoMCR9Scaling(kTRUE);
|
386 |
photpreselinverteleveto->SetMCR9Scale(1.0035, 1.0035);
|
387 |
photpreselinverteleveto->SetDoMCSigIEtaIEtaScaling(kTRUE);
|
388 |
photpreselinverteleveto->SetDoMCWidthScaling(kTRUE);
|
389 |
photpreselinverteleveto->SetDoMCErrScaling(kTRUE);
|
390 |
photpreselinverteleveto->SetMCErrScale(1.07, 1.045);
|
391 |
photpreselinverteleveto->SetApplyEleVeto(kFALSE);
|
392 |
photpreselinverteleveto->SetInvertElectronVeto(kTRUE);
|
393 |
photpreselinverteleveto->SetIsData(isData);
|
394 |
|
395 |
PhotonPairSelector *photpreselnosmear = new PhotonPairSelector("PhotonPairSelectorPreselNoSmear");
|
396 |
photpreselnosmear->SetOutputName("GoodPhotonsPreselNoSmear");
|
397 |
photpreselnosmear->SetPhotonSelType("MITSelection");
|
398 |
photpreselnosmear->SetVertexSelType("CiCMVASelection");
|
399 |
photpreselnosmear->SetPhotonsFromBranch(kFALSE);
|
400 |
photpreselnosmear->SetInputPhotonsName(photreg->GetOutputName());
|
401 |
photpreselnosmear->SetIsData(isData);
|
402 |
|
403 |
|
404 |
PhotonTreeWriter *phottreecic = new PhotonTreeWriter("PhotonTreeWriterCiC");
|
405 |
phottreecic->SetPhotonsFromBranch(kFALSE);
|
406 |
phottreecic->SetInputPhotonsName(photcic->GetOutputName());
|
407 |
phottreecic->SetEnableJets(kTRUE);
|
408 |
phottreecic->SetPFJetsFromBranch(kFALSE);
|
409 |
phottreecic->SetPFJetName(jetCorr->GetOutputName());
|
410 |
phottreecic->SetExcludeDoublePrompt(excludedoubleprompt);
|
411 |
phottreecic->SetIsData(isData);
|
412 |
|
413 |
PhotonTreeWriter *phottreecicnoeleveto = new PhotonTreeWriter("PhotonTreeWriterCiCNoEleVeto");
|
414 |
phottreecicnoeleveto->SetPhotonsFromBranch(kFALSE);
|
415 |
phottreecicnoeleveto->SetInputPhotonsName(photcicnoeleveto->GetOutputName());
|
416 |
phottreecicnoeleveto->SetEnableJets(kTRUE);
|
417 |
phottreecicnoeleveto->SetPFJetsFromBranch(kFALSE);
|
418 |
phottreecicnoeleveto->SetPFJetName(jetCorr->GetOutputName());
|
419 |
phottreecicnoeleveto->SetApplyElectronVeto(kFALSE);
|
420 |
phottreecicnoeleveto->SetExcludeDoublePrompt(excludedoubleprompt);
|
421 |
phottreecicnoeleveto->SetIsData(isData);
|
422 |
|
423 |
PhotonTreeWriter *phottreepresel = new PhotonTreeWriter("PhotonTreeWriterPresel");
|
424 |
phottreepresel->SetPhotonsFromBranch(kFALSE);
|
425 |
phottreepresel->SetInputPhotonsName(photpresel->GetOutputName());
|
426 |
phottreepresel->SetEnableJets(kTRUE);
|
427 |
phottreepresel->SetPFJetsFromBranch(kFALSE);
|
428 |
phottreepresel->SetPFJetName(jetCorr->GetOutputName());
|
429 |
phottreepresel->SetExcludeDoublePrompt(excludedoubleprompt);
|
430 |
phottreepresel->SetIsData(isData);
|
431 |
|
432 |
PhotonTreeWriter *phottreepreselinverteleveto = new PhotonTreeWriter("PhotonTreeWriterPreselInvertEleVeto");
|
433 |
phottreepreselinverteleveto->SetPhotonsFromBranch(kFALSE);
|
434 |
phottreepreselinverteleveto->SetInputPhotonsName(photpreselinverteleveto->GetOutputName());
|
435 |
phottreepreselinverteleveto->SetEnableJets(kTRUE);
|
436 |
phottreepreselinverteleveto->SetPFJetsFromBranch(kFALSE);
|
437 |
phottreepreselinverteleveto->SetPFJetName(jetCorr->GetOutputName());
|
438 |
phottreepreselinverteleveto->SetApplyElectronVeto(kFALSE);
|
439 |
phottreepreselinverteleveto->SetExcludeDoublePrompt(excludedoubleprompt);
|
440 |
phottreepreselinverteleveto->SetIsData(isData);
|
441 |
|
442 |
PhotonTreeWriter *phottreepreselnosmear = new PhotonTreeWriter("PhotonTreeWriterPreselNoSmear");
|
443 |
phottreepreselnosmear->SetPhotonsFromBranch(kFALSE);
|
444 |
phottreepreselnosmear->SetInputPhotonsName(photpreselnosmear->GetOutputName());
|
445 |
phottreepreselnosmear->SetEnableJets(kTRUE);
|
446 |
phottreepreselnosmear->SetPFJetsFromBranch(kFALSE);
|
447 |
phottreepreselnosmear->SetPFJetName(jetCorr->GetOutputName());
|
448 |
phottreepreselnosmear->SetExcludeDoublePrompt(excludedoubleprompt);
|
449 |
phottreepreselnosmear->SetIsData(isData);
|
450 |
|
451 |
|
452 |
PhotonIDMod *photidcic = new PhotonIDMod("PhotonIDModPresel");
|
453 |
photidcic->SetPtMin(25.0);
|
454 |
photidcic->SetOutputName("GoodPhotonsPreselid");
|
455 |
photidcic->SetOutputName("MITSelection");
|
456 |
photidcic->SetApplyElectronVeto(kTRUE);
|
457 |
photidcic->SetIsData(isData);
|
458 |
|
459 |
PhotonTreeWriter *phottreesingle = new PhotonTreeWriter("PhotonTreeWriterSingle");
|
460 |
phottreesingle->SetWriteDiphotonTree(kFALSE);
|
461 |
phottreesingle->SetPhotonsFromBranch(kFALSE);
|
462 |
phottreesingle->SetInputPhotonsName(photidcic->GetOutputName());
|
463 |
phottreesingle->SetIsData(isData);
|
464 |
|
465 |
PhotonTreeWriter *phottreeE = new PhotonTreeWriter("PhotonTreeWriterE");
|
466 |
phottreeE->SetGoodElectronsFromBranch(kFALSE);
|
467 |
phottreeE->SetGoodElectronName(elecId->GetOutputName());
|
468 |
phottreeE->SetLoopOnGoodElectrons(kTRUE);
|
469 |
phottreeE->SetApplyElectronVeto(kFALSE);
|
470 |
phottreeE->SetIsData(isData);
|
471 |
|
472 |
PhotonTreeWriter *phottreeES = new PhotonTreeWriter("PhotonTreeWriterES");
|
473 |
phottreeES->SetWriteDiphotonTree(kFALSE);
|
474 |
phottreeES->SetGoodElectronsFromBranch(kFALSE);
|
475 |
phottreeES->SetGoodElectronName(elecIdS->GetOutputName());
|
476 |
phottreeES->SetLoopOnGoodElectrons(kTRUE);
|
477 |
phottreeES->SetApplyElectronVeto(kFALSE);
|
478 |
phottreeES->SetIsData(isData);
|
479 |
|
480 |
|
481 |
//------------------------------------------------------------------------------------------------
|
482 |
// making analysis chain
|
483 |
//------------------------------------------------------------------------------------------------
|
484 |
// this is how it always starts
|
485 |
runLumiSel ->Add(mcselmod);
|
486 |
|
487 |
if (TString(dataset).Contains("-h")) {
|
488 |
mcselmod ->Add(sysMod);
|
489 |
}
|
490 |
|
491 |
// high level trigger is always first
|
492 |
mcselmod ->Add(hltModE);
|
493 |
mcselmod ->Add(hltModES);
|
494 |
mcselmod ->Add(hltModP);
|
495 |
|
496 |
hltModP ->Add(goodPVFilterMod);
|
497 |
hltModE ->Add(goodPVFilterModE);
|
498 |
//hltModES ->Add(goodPVFilterModES);
|
499 |
|
500 |
//goodPVFilterMod ->Add(muonId);
|
501 |
goodPVFilterMod->Add(photreg);
|
502 |
photreg->Add(pubJet);
|
503 |
pubJet->Add(jetCorr);
|
504 |
|
505 |
// simple object id modules
|
506 |
goodPVFilterModE ->Add(elecId);
|
507 |
//goodPVFilterModES ->Add(elecIdS);
|
508 |
|
509 |
|
510 |
jetCorr ->Add(photcic);
|
511 |
jetCorr ->Add(photcicnoeleveto);
|
512 |
jetCorr ->Add(photpresel);
|
513 |
jetCorr ->Add(photpreselinverteleveto);
|
514 |
jetCorr ->Add(photpreselnosmear);
|
515 |
|
516 |
photcic ->Add(phottreecic);
|
517 |
photcicnoeleveto ->Add(phottreecicnoeleveto);
|
518 |
photpresel ->Add(phottreepresel);
|
519 |
photpreselinverteleveto ->Add(phottreepreselinverteleveto);
|
520 |
photpreselnosmear ->Add(phottreepreselnosmear);
|
521 |
|
522 |
|
523 |
jetCorr ->Add(photidcic);
|
524 |
photidcic ->Add(phottreesingle);
|
525 |
|
526 |
elecId->Add(phottreeE);
|
527 |
//elecIdS->Add(phottreeES);
|
528 |
|
529 |
|
530 |
TFile::SetOpenTimeout(0);
|
531 |
TFile::SetCacheFileDir("./rootfilecache",kTRUE,kTRUE);
|
532 |
TFile::SetReadaheadSize(128*1024*1024);
|
533 |
|
534 |
//------------------------------------------------------------------------------------------------
|
535 |
// setup analysis
|
536 |
//------------------------------------------------------------------------------------------------
|
537 |
Analysis *ana = new Analysis;
|
538 |
ana->SetUseHLT(kTRUE);
|
539 |
ana->SetKeepHierarchy(kTRUE);
|
540 |
ana->SetSuperModule(runLumiSel);
|
541 |
ana->SetPrintScale(100);
|
542 |
if (nEvents >= 0)
|
543 |
ana->SetProcessNEvents(nEvents);
|
544 |
|
545 |
//------------------------------------------------------------------------------------------------
|
546 |
// organize input
|
547 |
//------------------------------------------------------------------------------------------------
|
548 |
Catalog *c = new Catalog(catalogDir);
|
549 |
TString skimdataset = TString(dataset)+TString("/") +TString(skim);
|
550 |
Dataset *d = NULL;
|
551 |
TString bookstr = book;
|
552 |
//if (TString(dataset).Contains("s11-h")) bookstr.ReplaceAll("local","t2mit");
|
553 |
if (TString(skim).CompareTo("noskim") == 0)
|
554 |
d = c->FindDataset(bookstr,dataset,fileset);
|
555 |
else
|
556 |
d = c->FindDataset(bookstr,skimdataset.Data(),fileset);
|
557 |
ana->AddDataset(d);
|
558 |
//ana->AddFile("/mnt/hadoop/cmsprod/filefi/025/r11b-pho-n30-v1/4863E9D1-BC1C-E111-99BA-001A92810AF4.root");
|
559 |
|
560 |
//------------------------------------------------------------------------------------------------
|
561 |
// organize output
|
562 |
//------------------------------------------------------------------------------------------------
|
563 |
TString rootFile = TString(outputName);
|
564 |
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
|
565 |
if (TString(fileset) != TString(""))
|
566 |
rootFile += TString("_") + TString(fileset);
|
567 |
rootFile += TString(".root");
|
568 |
ana->SetOutputName(rootFile.Data());
|
569 |
//ana->SetCacheSize(64*1024*1024);
|
570 |
ana->SetCacheSize(0);
|
571 |
|
572 |
//------------------------------------------------------------------------------------------------
|
573 |
// Say what we are doing
|
574 |
//------------------------------------------------------------------------------------------------
|
575 |
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
|
576 |
printf("\n JSON file: %s\n and overlap cut: %f (%s)\n",jsonFile.Data(),overlapCut,overlap);
|
577 |
printf("\n Rely on Catalog: %s\n",catalogDir);
|
578 |
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
|
579 |
printf("\n Root output: %s\n\n",rootFile.Data());
|
580 |
printf("\n========================================\n");
|
581 |
|
582 |
//------------------------------------------------------------------------------------------------
|
583 |
// run the analysis after successful initialisation
|
584 |
//------------------------------------------------------------------------------------------------
|
585 |
ana->Run(!gROOT->IsBatch());
|
586 |
|
587 |
return;
|
588 |
}
|