22 |
|
fMuonBranchName(Names::gkMuonBrn), |
23 |
|
fMetName("NoDefaultNameSet"), |
24 |
|
fCleanJetsName("NoDefaultNameSet"), |
25 |
< |
fVertexName(string("PrimaryVertexes").c_str()), |
25 |
> |
fCleanJetsNoPtCutName("NoDefaultNameSet"), |
26 |
> |
fCaloJetName0("AKt5Jets"), |
27 |
> |
fVertexName(ModNames::gkGoodVertexesName), |
28 |
|
fMuons(0), |
29 |
|
fMet(0), |
30 |
< |
fVertices(0) |
30 |
> |
fVertices(0), |
31 |
> |
fCaloJet0(0) |
32 |
|
{ |
33 |
|
// Constructor. |
34 |
|
} |
48 |
|
// branches. For this module, we request a branch of the MitTree. |
49 |
|
|
50 |
|
// Load Branches |
51 |
< |
ReqBranch(fMuonBranchName, fMuons); |
52 |
< |
ReqBranch(fVertexName, fVertices); |
51 |
> |
ReqBranch(fMuonBranchName, fMuons); |
52 |
> |
ReqBranch(fCaloJetName0, fCaloJet0); |
53 |
|
|
54 |
|
//Create your histograms here |
55 |
|
|
56 |
|
//************************************************************************************************* |
57 |
|
// Selection Histograms |
58 |
|
//************************************************************************************************* |
59 |
< |
AddTH1(fHWWSelection,"hHWWSelection", ";Cut Number;Number of Events", 8, -1.5, 6.5); |
60 |
< |
AddTH1(fHWWToEESelection,"hHWWToEESelection", ";Cut Number;Number of Events", 8, -1.5, 6.5); |
61 |
< |
AddTH1(fHWWToMuMuSelection,"hHWWToMuMuSelection", ";Cut Number;Number of Events", 8, -1.5, 6.5); |
62 |
< |
AddTH1(fHWWToEMuSelection,"hHWWToEMuSelection", ";Cut Number;Number of Events", 8, -1.5, 6.5); |
59 |
> |
AddTH1(fHWWSelection,"hHWWSelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
60 |
> |
AddTH1(fHWWToEESelection,"hHWWToEESelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
61 |
> |
AddTH1(fHWWToMuMuSelection,"hHWWToMuMuSelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
62 |
> |
AddTH1(fHWWToEMuSelection,"hHWWToEMuSelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
63 |
|
|
64 |
|
//*********************************************************************************************** |
65 |
|
// Histograms after preselection |
72 |
|
AddTH1(fUncorrMetPtHist ,"hUncorrMetPtHist",";Met;Number of Events",150,0.,300.); |
73 |
|
AddTH1(fUncorrMetPhiHist ,"hUncorrMetPhiHist",";#phi;Number of Events",28,-3.5,3.5); |
74 |
|
AddTH1(fDeltaPhiLeptons ,"hDeltaPhiLeptons",";#Delta#phi_{ll};Number of Events",90,0,180); |
75 |
< |
AddTH1(fDeltaEtaLeptons ,"hDeltaEtaLeptons",";#Delta#eta_{ll};Number of Events",100,-50.,5.0); |
75 |
> |
AddTH1(fDeltaEtaLeptons ,"hDeltaEtaLeptons",";#Delta#eta_{ll};Number of Events",100,-5.,5.0); |
76 |
|
AddTH1(fDileptonMass ,"hDileptonMass",";Mass_{ll};Number of Events",150,0.,300.); |
77 |
|
|
78 |
|
//*********************************************************************************************** |
116 |
|
AddTH1(fLeptonPtPlusMet_afterCuts ,"hLeptonPtPlusMet_afterCuts", |
117 |
|
";LeptonPtPlusMet;Number of Events",150,0., 300.); |
118 |
|
|
116 |
– |
//********************* |
117 |
– |
//Added Test Histograms |
118 |
– |
//******************** |
119 |
|
} |
120 |
|
|
121 |
|
//-------------------------------------------------------------------------------------------------- |
123 |
|
{ |
124 |
|
// Process entries of the tree. For this module, we just load the branches and |
125 |
|
LoadBranch(fMuonBranchName); |
126 |
< |
LoadBranch(fVertexName); |
127 |
< |
|
126 |
> |
LoadBranch(fCaloJetName0); |
127 |
> |
|
128 |
|
//Obtain all the good objects from the event cleaning module |
129 |
+ |
fVertices = GetObjThisEvt<VertexOArr>(fVertexName); |
130 |
|
ObjArray<Muon> *CleanMuons = dynamic_cast<ObjArray<Muon>* >(FindObjThisEvt(ModNames::gkCleanMuonsName)); |
131 |
+ |
ObjArray<Electron> *CleanElectrons = dynamic_cast<ObjArray<Electron>* >(FindObjThisEvt(ModNames::gkCleanElectronsName)); |
132 |
|
ParticleOArr *CleanLeptons = dynamic_cast<mithep::ParticleOArr*> |
133 |
|
(FindObjThisEvt(ModNames::gkMergedLeptonsName)); |
134 |
|
ObjArray<Jet> *CleanJets = dynamic_cast<ObjArray<Jet>* > |
135 |
|
(FindObjThisEvt(fCleanJetsName.Data())); |
136 |
+ |
ObjArray<Jet> *CleanJetsNoPtCut = dynamic_cast<ObjArray<Jet>* > |
137 |
+ |
(FindObjThisEvt(fCleanJetsNoPtCutName.Data())); |
138 |
|
TParameter<Double_t> *NNLOWeight = GetObjThisEvt<TParameter<Double_t> >("NNLOWeight"); |
139 |
|
|
140 |
|
MetCol *met = dynamic_cast<ObjArray<Met>* >(FindObjThisEvt(fMetName)); |
152 |
|
// At least two leptons in the event |
153 |
|
if (CleanLeptons->GetEntries() < 2) return; |
154 |
|
// Pt1 > 20 && Pt2 > 10 |
155 |
< |
if(CleanLeptons->At(0)->Pt() <= 20 || CleanLeptons->At(1)->Pt() <= 20) return; |
155 |
> |
if(CleanLeptons->At(0)->Pt() <= 20 || CleanLeptons->At(1)->Pt() <= 10) return; |
156 |
|
// opposite charge leptons |
157 |
|
if(CleanLeptons->At(0)->Charge() * CleanLeptons->At(1)->Charge() > 0) return; |
158 |
|
|
177 |
|
} |
178 |
|
|
179 |
|
//*********************************************************************************************** |
180 |
+ |
//|Z_vert-Z_l| maximum |
181 |
+ |
//*********************************************************************************************** |
182 |
+ |
double zDiffMax = 0.0; |
183 |
+ |
if(fVertices->GetEntries() > 0) { |
184 |
+ |
for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) { |
185 |
+ |
double pDz = 0.0; |
186 |
+ |
for(uint i0 = 0; i0 < fVertices->GetEntries(); i0++) { |
187 |
+ |
if(fVertices->At(i0)->NTracks() > 0){ |
188 |
+ |
pDz = TMath::Abs(CleanMuons->At(j)->BestTrk()->DzCorrected(*fVertices->At(i0))); |
189 |
+ |
break; |
190 |
+ |
} |
191 |
+ |
} |
192 |
+ |
if(pDz > zDiffMax) zDiffMax = pDz; |
193 |
+ |
} |
194 |
+ |
for (UInt_t j=0; j<CleanElectrons->GetEntries(); j++) { |
195 |
+ |
double pDz = 0.0; |
196 |
+ |
for(uint i0 = 0; i0 < fVertices->GetEntries(); i0++) { |
197 |
+ |
if(fVertices->At(i0)->NTracks() > 0){ |
198 |
+ |
pDz = TMath::Abs(CleanElectrons->At(j)->GsfTrk()->DzCorrected(*fVertices->At(i0))); |
199 |
+ |
break; |
200 |
+ |
} |
201 |
+ |
} |
202 |
+ |
if(pDz > zDiffMax) zDiffMax = pDz; |
203 |
+ |
} |
204 |
+ |
} |
205 |
+ |
|
206 |
+ |
//*********************************************************************************************** |
207 |
|
//Define Event Variables |
208 |
|
//*********************************************************************************************** |
209 |
|
//delta phi between the 2 leptons in degrees |
210 |
|
double deltaPhiLeptons = MathUtils::DeltaPhi(CleanLeptons->At(0)->Phi(), |
211 |
|
CleanLeptons->At(1)->Phi())* 180.0 / TMath::Pi(); |
212 |
|
|
213 |
< |
double deltaEtaLeptons = abs(CleanLeptons->At(0)->Eta() - CleanLeptons->At(1)->Eta()) * 180.0 / TMath::Pi(); |
213 |
> |
double deltaEtaLeptons = CleanLeptons->At(0)->Eta() - CleanLeptons->At(1)->Eta(); |
214 |
|
|
215 |
|
double deltaPhiDileptonMet = MathUtils::DeltaPhi(caloMet->Phi(), |
216 |
|
dilepton->Phi())*180.0 / TMath::Pi(); |
234 |
|
if(minDeltaPhiMetLepton < TMath::Pi()/2.) |
235 |
|
METdeltaPhilEt = METdeltaPhilEt * sin(minDeltaPhiMetLepton); |
236 |
|
|
237 |
< |
//count the number of central Jets for vetoing |
238 |
< |
int nCentralJets = 0; |
237 |
> |
//count the number of central Jets for vetoing and b-tagging |
238 |
> |
vector<Jet*> sortedJetsAll; |
239 |
> |
vector<Jet*> sortedJets; |
240 |
> |
vector<Jet*> sortedJetsLowPt; |
241 |
> |
for(UInt_t i=0; i<CleanJetsNoPtCut->GetEntries(); i++){ |
242 |
> |
Jet* jet_a = new Jet(CleanJetsNoPtCut->At(i)->Px(), |
243 |
> |
CleanJetsNoPtCut->At(i)->Py(), |
244 |
> |
CleanJetsNoPtCut->At(i)->Pz(), |
245 |
> |
CleanJetsNoPtCut->At(i)->E() ); |
246 |
> |
|
247 |
> |
int nCloseStdJet = -1; |
248 |
> |
double deltaRMin = 999.; |
249 |
> |
for(UInt_t nj=0; nj<fCaloJet0->GetEntries(); nj++){ |
250 |
> |
const CaloJet *jet = fCaloJet0->At(nj); |
251 |
> |
Double_t deltaR = MathUtils::DeltaR(jet_a->Mom(),jet->Mom()); |
252 |
> |
if(deltaR < deltaRMin) { |
253 |
> |
nCloseStdJet = nj; |
254 |
> |
deltaRMin = deltaR; |
255 |
> |
} |
256 |
> |
} |
257 |
> |
if(nCloseStdJet >= 0 && deltaRMin < 0.5){ |
258 |
> |
jet_a->SetMatchedMCFlavor(fCaloJet0->At(nCloseStdJet)->MatchedMCFlavor()); |
259 |
> |
jet_a->SetCombinedSecondaryVertexBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->CombinedSecondaryVertexBJetTagsDisc()); |
260 |
> |
jet_a->SetCombinedSecondaryVertexMVABJetTagsDisc(fCaloJet0->At(nCloseStdJet)->CombinedSecondaryVertexMVABJetTagsDisc()); |
261 |
> |
jet_a->SetJetProbabilityBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->JetProbabilityBJetTagsDisc()); |
262 |
> |
jet_a->SetJetBProbabilityBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->JetBProbabilityBJetTagsDisc()); |
263 |
> |
jet_a->SetTrackCountingHighEffBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->TrackCountingHighEffBJetTagsDisc()); |
264 |
> |
jet_a->SetTrackCountingHighPurBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->TrackCountingHighPurBJetTagsDisc()); |
265 |
> |
jet_a->SetSimpleSecondaryVertexBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->SimpleSecondaryVertexBJetTagsDisc()); |
266 |
> |
jet_a->SetSimpleSecondaryVertexHighEffBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->SimpleSecondaryVertexHighEffBJetTagsDisc()); |
267 |
> |
jet_a->SetSimpleSecondaryVertexHighPurBJetTagsDisc(fCaloJet0->At(nCloseStdJet)->SimpleSecondaryVertexHighPurBJetTagsDisc()); |
268 |
> |
} |
269 |
> |
else { |
270 |
> |
jet_a->SetMatchedMCFlavor(CleanJetsNoPtCut->At(i)->MatchedMCFlavor()); |
271 |
> |
jet_a->SetCombinedSecondaryVertexBJetTagsDisc(CleanJetsNoPtCut->At(i)->CombinedSecondaryVertexBJetTagsDisc()); |
272 |
> |
jet_a->SetCombinedSecondaryVertexMVABJetTagsDisc(CleanJetsNoPtCut->At(i)->CombinedSecondaryVertexMVABJetTagsDisc()); |
273 |
> |
jet_a->SetJetProbabilityBJetTagsDisc(CleanJetsNoPtCut->At(i)->JetProbabilityBJetTagsDisc()); |
274 |
> |
jet_a->SetJetBProbabilityBJetTagsDisc(CleanJetsNoPtCut->At(i)->JetBProbabilityBJetTagsDisc()); |
275 |
> |
jet_a->SetTrackCountingHighEffBJetTagsDisc(CleanJetsNoPtCut->At(i)->TrackCountingHighEffBJetTagsDisc()); |
276 |
> |
jet_a->SetTrackCountingHighPurBJetTagsDisc(CleanJetsNoPtCut->At(i)->TrackCountingHighPurBJetTagsDisc()); |
277 |
> |
jet_a->SetSimpleSecondaryVertexBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexBJetTagsDisc()); |
278 |
> |
jet_a->SetSimpleSecondaryVertexHighEffBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexHighEffBJetTagsDisc()); |
279 |
> |
jet_a->SetSimpleSecondaryVertexHighPurBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexHighPurBJetTagsDisc()); |
280 |
> |
} |
281 |
> |
sortedJetsAll.push_back(jet_a); |
282 |
> |
} |
283 |
> |
|
284 |
|
for(UInt_t i=0; i<CleanJets->GetEntries(); i++){ |
285 |
|
if(TMath::Abs(CleanJets->At(i)->Eta()) < 5.0 && |
286 |
|
CleanJets->At(i)->Pt() > 25.0){ |
287 |
< |
nCentralJets++; |
287 |
> |
Jet* jet_b = new Jet(CleanJets->At(i)->Px(), |
288 |
> |
CleanJets->At(i)->Py(), |
289 |
> |
CleanJets->At(i)->Pz(), |
290 |
> |
CleanJets->At(i)->E() ); |
291 |
> |
sortedJets.push_back(jet_b); |
292 |
> |
} |
293 |
> |
} |
294 |
> |
|
295 |
> |
for(UInt_t i=0; i<sortedJetsAll.size(); i++){ |
296 |
> |
bool overlap = kFALSE; |
297 |
> |
for(UInt_t j=0; j<sortedJets.size(); j++){ |
298 |
> |
if(sortedJetsAll[i]->Pt() == sortedJets[j]->Pt() || |
299 |
> |
(sortedJetsAll[i]->CombinedSecondaryVertexBJetTagsDisc() == sortedJets[j]->CombinedSecondaryVertexBJetTagsDisc() && |
300 |
> |
sortedJetsAll[i]->JetBProbabilityBJetTagsDisc() == sortedJets[j]->JetBProbabilityBJetTagsDisc() && |
301 |
> |
sortedJetsAll[i]->TrackCountingHighPurBJetTagsDisc() == sortedJets[j]->TrackCountingHighPurBJetTagsDisc()) |
302 |
> |
) { |
303 |
> |
sortedJets[j]->SetMatchedMCFlavor(sortedJetsAll[i]->MatchedMCFlavor()); |
304 |
> |
sortedJets[j]->SetCombinedSecondaryVertexBJetTagsDisc(sortedJetsAll[i]->CombinedSecondaryVertexBJetTagsDisc()); |
305 |
> |
sortedJets[j]->SetCombinedSecondaryVertexMVABJetTagsDisc(sortedJetsAll[i]->CombinedSecondaryVertexMVABJetTagsDisc()); |
306 |
> |
sortedJets[j]->SetJetProbabilityBJetTagsDisc(sortedJetsAll[i]->JetProbabilityBJetTagsDisc()); |
307 |
> |
sortedJets[j]->SetJetBProbabilityBJetTagsDisc(sortedJetsAll[i]->JetBProbabilityBJetTagsDisc()); |
308 |
> |
sortedJets[j]->SetTrackCountingHighEffBJetTagsDisc(sortedJetsAll[i]->TrackCountingHighEffBJetTagsDisc()); |
309 |
> |
sortedJets[j]->SetTrackCountingHighPurBJetTagsDisc(sortedJetsAll[i]->TrackCountingHighPurBJetTagsDisc()); |
310 |
> |
sortedJets[j]->SetSimpleSecondaryVertexBJetTagsDisc(sortedJetsAll[i]->SimpleSecondaryVertexBJetTagsDisc()); |
311 |
> |
sortedJets[j]->SetSimpleSecondaryVertexHighEffBJetTagsDisc(sortedJetsAll[i]->SimpleSecondaryVertexHighEffBJetTagsDisc()); |
312 |
> |
sortedJets[j]->SetSimpleSecondaryVertexHighPurBJetTagsDisc(sortedJetsAll[i]->SimpleSecondaryVertexHighPurBJetTagsDisc()); |
313 |
> |
overlap = kTRUE; |
314 |
> |
break; |
315 |
> |
} |
316 |
> |
} |
317 |
> |
if(overlap == kFALSE){ |
318 |
> |
sortedJetsLowPt.push_back(sortedJetsAll[i]); |
319 |
> |
} |
320 |
> |
} |
321 |
> |
double maxBtag = -99999.; |
322 |
> |
double imaxBtag = -1; |
323 |
> |
for(UInt_t i=0; i<sortedJetsLowPt.size(); i++){ |
324 |
> |
if(sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc() > maxBtag){ |
325 |
> |
maxBtag = sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc(); |
326 |
> |
imaxBtag = i; |
327 |
|
} |
328 |
|
} |
329 |
|
|
343 |
|
//********************************************************************************************* |
344 |
|
//Define Cuts |
345 |
|
//********************************************************************************************* |
346 |
< |
const int nCuts = 7; |
347 |
< |
bool passCut[nCuts] = {false, false, false, false, false, false, false}; |
346 |
> |
const int nCuts = 10; |
347 |
> |
bool passCut[nCuts] = {false, false, false, false, false, |
348 |
> |
false, false, false, false, false}; |
349 |
|
|
350 |
|
if(CleanLeptons->At(0)->Pt() > 20.0 && |
351 |
|
CleanLeptons->At(1)->Pt() >= 20.0) passCut[0] = true; |
352 |
|
|
353 |
< |
if(caloMet->Pt() > 20.0) passCut[1] = true; |
353 |
> |
if(zDiffMax < 1.0) passCut[1] = true; |
354 |
> |
|
355 |
> |
if(caloMet->Pt() > 20.0) passCut[2] = true; |
356 |
|
|
357 |
< |
if(dilepton->Mass() > 12.0) passCut[2] = true; |
357 |
> |
if(dilepton->Mass() > 12.0) passCut[3] = true; |
358 |
|
|
359 |
< |
if(nCentralJets < 1) passCut[5] = true; |
359 |
> |
if(sortedJets.size() < 1) passCut[6] = true; |
360 |
> |
|
361 |
> |
if(SoftMuons->GetEntries() == 0) passCut[7] = true; |
362 |
> |
|
363 |
> |
if(CleanLeptons->GetEntries() == 2) passCut[8] = true; |
364 |
|
|
365 |
< |
if(CleanLeptons->GetEntries() == 2 && |
244 |
< |
SoftMuons->GetEntries() == 0) passCut[6] = true; |
365 |
> |
if(maxBtag < 2.1) passCut[9] = true; |
366 |
|
|
367 |
|
if (finalstateType == 10 || finalstateType == 11){ // mumu/ee |
368 |
< |
if(fabs(dilepton->Mass()-91.1876) > 15.0) passCut[3] = true; |
369 |
< |
if(METdeltaPhilEt > 35) passCut[4] = true; |
368 |
> |
if(fabs(dilepton->Mass()-91.1876) > 15.0) passCut[4] = true; |
369 |
> |
if(METdeltaPhilEt > 35) passCut[5] = true; |
370 |
|
} |
371 |
|
else if(finalstateType == 12) { // emu |
372 |
< |
passCut[3] = true; |
373 |
< |
if(METdeltaPhilEt > 20) passCut[4] = true; |
372 |
> |
passCut[4] = true; |
373 |
> |
if(METdeltaPhilEt > 20) passCut[5] = true; |
374 |
|
} |
375 |
|
|
376 |
|
//********************************************************************************************* |
434 |
|
} |
435 |
|
} |
436 |
|
if (pass) { |
437 |
< |
fNCentralJets_NMinusOne->Fill(nCentralJets,NNLOWeight->GetVal()); |
437 |
> |
fNCentralJets_NMinusOne->Fill(sortedJets.size(),NNLOWeight->GetVal()); |
438 |
|
} |
439 |
|
|
440 |
|
// Final Met Cut |
492 |
|
|
493 |
|
delete dilepton; |
494 |
|
delete SoftMuons; |
495 |
+ |
for(UInt_t i=0; i<sortedJets.size(); i++) delete sortedJets[i]; |
496 |
+ |
for(UInt_t i=0; i<sortedJetsAll.size(); i++) delete sortedJetsAll[i]; |
497 |
|
return; |
498 |
|
} |
499 |
|
|