9 |
|
#include "MitPhysics/Init/interface/ModNames.h" |
10 |
|
#include "MitAna/DataCont/interface/ObjArray.h" |
11 |
|
#include "MitCommon/MathTools/interface/MathUtils.h" |
12 |
+ |
#include "MitPhysics/Utils/interface/JetTools.h" |
13 |
+ |
#include "MitPhysics/Utils/interface/MetTools.h" |
14 |
|
#include "MitAna/DataTree/interface/ParticleCol.h" |
15 |
|
#include "TFile.h" |
16 |
|
#include "TTree.h" |
23 |
|
BaseMod(name,title), |
24 |
|
fMuonBranchName(Names::gkMuonBrn), |
25 |
|
fMetName("NoDefaultNameSet"), |
24 |
– |
fCleanJetsName("NoDefaultNameSet"), |
26 |
|
fCleanJetsNoPtCutName("NoDefaultNameSet"), |
26 |
– |
fCaloJetName0("AKt5Jets"), |
27 |
|
fVertexName(ModNames::gkGoodVertexesName), |
28 |
+ |
fPFCandidatesName(Names::gkPFCandidatesBrn), |
29 |
|
fMuons(0), |
30 |
|
fMet(0), |
31 |
|
fVertices(0), |
32 |
< |
fCaloJet0(0) |
32 |
> |
fPFCandidates(0), |
33 |
> |
fPFJetName0("AKt5PFJets"), |
34 |
> |
fPFJet0(0), |
35 |
> |
fNEventsSelected(0) |
36 |
|
{ |
37 |
|
// Constructor. |
38 |
|
} |
52 |
|
// branches. For this module, we request a branch of the MitTree. |
53 |
|
|
54 |
|
// Load Branches |
55 |
< |
ReqBranch(fMuonBranchName, fMuons); |
56 |
< |
ReqBranch(fCaloJetName0, fCaloJet0); |
55 |
> |
ReqBranch(fMuonBranchName, fMuons); |
56 |
> |
ReqBranch(fPFCandidatesName, fPFCandidates); |
57 |
> |
ReqBranch(fPFJetName0, fPFJet0); |
58 |
|
|
59 |
|
//Create your histograms here |
60 |
|
|
61 |
|
//************************************************************************************************* |
62 |
|
// Selection Histograms |
63 |
|
//************************************************************************************************* |
64 |
< |
AddTH1(fHWWSelection,"hHWWSelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
65 |
< |
AddTH1(fHWWToEESelection,"hHWWToEESelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
66 |
< |
AddTH1(fHWWToMuMuSelection,"hHWWToMuMuSelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
67 |
< |
AddTH1(fHWWToEMuSelection,"hHWWToEMuSelection", ";Cut Number;Number of Events", 11, -1.5, 9.5); |
64 |
> |
AddTH1(fHWWSelection,"hHWWSelection", ";Cut Number;Number of Events", 17, -1.5, 15.5); |
65 |
> |
AddTH1(fHWWToEESelection,"hHWWToEESelection", ";Cut Number;Number of Events", 17, -1.5, 15.5); |
66 |
> |
AddTH1(fHWWToMuMuSelection,"hHWWToMuMuSelection", ";Cut Number;Number of Events", 17, -1.5, 15.5); |
67 |
> |
AddTH1(fHWWToEMuSelection,"hHWWToEMuSelection", ";Cut Number;Number of Events", 17, -1.5, 15.5); |
68 |
> |
AddTH1(fHWWToMuESelection,"hHWWToMuESelection", ";Cut Number;Number of Events", 17, -1.5, 15.5); |
69 |
|
|
70 |
|
//*********************************************************************************************** |
71 |
|
// Histograms after preselection |
129 |
|
{ |
130 |
|
// Process entries of the tree. For this module, we just load the branches and |
131 |
|
LoadBranch(fMuonBranchName); |
132 |
< |
LoadBranch(fCaloJetName0); |
133 |
< |
|
132 |
> |
LoadBranch(fPFCandidatesName); |
133 |
> |
LoadBranch(fPFJetName0); |
134 |
> |
|
135 |
|
//Obtain all the good objects from the event cleaning module |
136 |
|
fVertices = GetObjThisEvt<VertexOArr>(fVertexName); |
137 |
|
ObjArray<Muon> *CleanMuons = dynamic_cast<ObjArray<Muon>* >(FindObjThisEvt(ModNames::gkCleanMuonsName)); |
138 |
|
ObjArray<Electron> *CleanElectrons = dynamic_cast<ObjArray<Electron>* >(FindObjThisEvt(ModNames::gkCleanElectronsName)); |
139 |
|
ParticleOArr *CleanLeptons = dynamic_cast<mithep::ParticleOArr*> |
140 |
|
(FindObjThisEvt(ModNames::gkMergedLeptonsName)); |
134 |
– |
ObjArray<Jet> *CleanJets = dynamic_cast<ObjArray<Jet>* > |
135 |
– |
(FindObjThisEvt(fCleanJetsName.Data())); |
141 |
|
ObjArray<Jet> *CleanJetsNoPtCut = dynamic_cast<ObjArray<Jet>* > |
142 |
|
(FindObjThisEvt(fCleanJetsNoPtCutName.Data())); |
143 |
|
TParameter<Double_t> *NNLOWeight = GetObjThisEvt<TParameter<Double_t> >("NNLOWeight"); |
144 |
|
|
145 |
|
MetCol *met = dynamic_cast<ObjArray<Met>* >(FindObjThisEvt(fMetName)); |
146 |
< |
const Met *caloMet = 0; |
146 |
> |
const Met *stdMet = 0; |
147 |
|
if (met) { |
148 |
< |
caloMet = met->At(0); |
148 |
> |
stdMet = met->At(0); |
149 |
|
} else { |
150 |
|
cout << "Error: Met Collection " << fMetName << " could not be loaded.\n"; |
151 |
|
return; |
171 |
|
ObjArray<Muon> *SoftMuons = new ObjArray<Muon>; |
172 |
|
for (UInt_t i=0; i<fMuons->GetEntries(); ++i) { |
173 |
|
const Muon *mu = fMuons->At(i); |
174 |
< |
if(!MuonTools::PassSoftMuonCut(mu, fVertices)) continue; |
174 |
> |
if(!MuonTools::PassSoftMuonCut(mu, fVertices, 0.2)) continue; |
175 |
|
|
176 |
|
bool isCleanMuon = kFALSE; |
177 |
|
for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) { |
184 |
|
//*********************************************************************************************** |
185 |
|
//|Z_vert-Z_l| maximum |
186 |
|
//*********************************************************************************************** |
187 |
+ |
std::vector<double> leptonsDz; |
188 |
|
double zDiffMax = 0.0; |
189 |
|
if(fVertices->GetEntries() > 0) { |
190 |
|
for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) { |
191 |
< |
double pDz = 0.0; |
192 |
< |
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) pDz = zDiffMax; |
191 |
> |
double pDz = CleanMuons->At(j)->BestTrk()->DzCorrected(*fVertices->At(0)); |
192 |
> |
leptonsDz.push_back(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 |
< |
} |
195 |
> |
double pDz = CleanElectrons->At(j)->GsfTrk()->DzCorrected(*fVertices->At(0)); |
196 |
> |
leptonsDz.push_back(pDz); |
197 |
> |
} |
198 |
> |
for(UInt_t t=0; t<leptonsDz.size(); t++) { |
199 |
> |
for(UInt_t i=t+1; i<leptonsDz.size(); i++) { |
200 |
> |
if(TMath::Abs(leptonsDz[t]-leptonsDz[i]) > zDiffMax) zDiffMax = TMath::Abs(leptonsDz[t]-leptonsDz[i]); |
201 |
|
} |
202 |
– |
if(pDz > zDiffMax) pDz = zDiffMax; |
202 |
|
} |
203 |
+ |
leptonsDz.clear(); |
204 |
|
} |
205 |
|
|
206 |
|
//*********************************************************************************************** |
212 |
|
|
213 |
|
double deltaEtaLeptons = CleanLeptons->At(0)->Eta() - CleanLeptons->At(1)->Eta(); |
214 |
|
|
215 |
< |
double deltaPhiDileptonMet = MathUtils::DeltaPhi(caloMet->Phi(), |
215 |
> |
double deltaPhiDileptonMet = MathUtils::DeltaPhi(stdMet->Phi(), |
216 |
|
dilepton->Phi())*180.0 / TMath::Pi(); |
217 |
|
|
218 |
< |
double mtHiggs = TMath::Sqrt(2.0*dilepton->Pt() * caloMet->Pt()* |
218 |
> |
double mtHiggs = TMath::Sqrt(2.0*dilepton->Pt() * stdMet->Pt()* |
219 |
|
(1.0 - cos(deltaPhiDileptonMet * TMath::Pi() / 180.0))); |
220 |
|
|
221 |
|
//angle between MET and closest lepton |
222 |
< |
double deltaPhiMetLepton[2] = {MathUtils::DeltaPhi(caloMet->Phi(), CleanLeptons->At(0)->Phi()), |
223 |
< |
MathUtils::DeltaPhi(caloMet->Phi(), CleanLeptons->At(1)->Phi())}; |
222 |
> |
double deltaPhiMetLepton[2] = {MathUtils::DeltaPhi(stdMet->Phi(), CleanLeptons->At(0)->Phi()), |
223 |
> |
MathUtils::DeltaPhi(stdMet->Phi(), CleanLeptons->At(1)->Phi())}; |
224 |
|
|
225 |
< |
double mTW[2] = {TMath::Sqrt(2.0*CleanLeptons->At(0)->Pt()*caloMet->Pt()* |
225 |
> |
double mTW[2] = {TMath::Sqrt(2.0*CleanLeptons->At(0)->Pt()*stdMet->Pt()* |
226 |
|
(1.0 - cos(deltaPhiMetLepton[0]))), |
227 |
< |
TMath::Sqrt(2.0*CleanLeptons->At(1)->Pt()*caloMet->Pt()* |
227 |
> |
TMath::Sqrt(2.0*CleanLeptons->At(1)->Pt()*stdMet->Pt()* |
228 |
|
(1.0 - cos(deltaPhiMetLepton[1])))}; |
229 |
|
|
230 |
|
double minDeltaPhiMetLepton = (deltaPhiMetLepton[0] < deltaPhiMetLepton[1])? |
231 |
|
deltaPhiMetLepton[0]:deltaPhiMetLepton[1]; |
232 |
|
|
233 |
< |
double METdeltaPhilEt = caloMet->Pt(); |
234 |
< |
if(minDeltaPhiMetLepton < TMath::Pi()/2.) |
235 |
< |
METdeltaPhilEt = METdeltaPhilEt * sin(minDeltaPhiMetLepton); |
233 |
> |
MetTools metTools(CleanMuons, CleanElectrons, fPFCandidates, fVertices->At(0), 0.1, 8.0, 5.0); |
234 |
> |
double pMET[2] = {metTools.GetProjectedMet(CleanLeptons,stdMet), |
235 |
> |
metTools.GetProjectedTrackMet(CleanLeptons)}; |
236 |
> |
|
237 |
> |
double METdeltaPhilEt = TMath::Min(pMET[0],pMET[1]); |
238 |
|
|
239 |
|
//count the number of central Jets for vetoing and b-tagging |
240 |
|
vector<Jet*> sortedJetsAll; |
241 |
|
vector<Jet*> sortedJets; |
242 |
|
vector<Jet*> sortedJetsLowPt; |
243 |
|
for(UInt_t i=0; i<CleanJetsNoPtCut->GetEntries(); i++){ |
244 |
+ |
if(CleanJetsNoPtCut->At(i)->RawMom().Pt() <= 7) continue; |
245 |
|
Jet* jet_a = new Jet(CleanJetsNoPtCut->At(i)->Px(), |
246 |
|
CleanJetsNoPtCut->At(i)->Py(), |
247 |
|
CleanJetsNoPtCut->At(i)->Pz(), |
248 |
|
CleanJetsNoPtCut->At(i)->E() ); |
249 |
< |
|
250 |
< |
int nCloseStdJet = -1; |
251 |
< |
double deltaRMin = 999.; |
252 |
< |
for(UInt_t nj=0; nj<fCaloJet0->GetEntries(); nj++){ |
253 |
< |
const CaloJet *jet = fCaloJet0->At(nj); |
254 |
< |
Double_t deltaR = MathUtils::DeltaR(jet_a->Mom(),jet->Mom()); |
255 |
< |
if(deltaR < deltaRMin) { |
256 |
< |
nCloseStdJet = nj; |
257 |
< |
deltaRMin = deltaR; |
258 |
< |
} |
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 |
< |
} |
249 |
> |
jet_a->SetMatchedMCFlavor(CleanJetsNoPtCut->At(i)->MatchedMCFlavor()); |
250 |
> |
jet_a->SetCombinedSecondaryVertexBJetTagsDisc(CleanJetsNoPtCut->At(i)->CombinedSecondaryVertexBJetTagsDisc()); |
251 |
> |
jet_a->SetCombinedSecondaryVertexMVABJetTagsDisc(CleanJetsNoPtCut->At(i)->CombinedSecondaryVertexMVABJetTagsDisc()); |
252 |
> |
jet_a->SetJetProbabilityBJetTagsDisc(CleanJetsNoPtCut->At(i)->JetProbabilityBJetTagsDisc()); |
253 |
> |
jet_a->SetJetBProbabilityBJetTagsDisc(CleanJetsNoPtCut->At(i)->JetBProbabilityBJetTagsDisc()); |
254 |
> |
jet_a->SetTrackCountingHighEffBJetTagsDisc(CleanJetsNoPtCut->At(i)->TrackCountingHighEffBJetTagsDisc()); |
255 |
> |
jet_a->SetTrackCountingHighPurBJetTagsDisc(CleanJetsNoPtCut->At(i)->TrackCountingHighPurBJetTagsDisc()); |
256 |
> |
jet_a->SetSimpleSecondaryVertexBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexBJetTagsDisc()); |
257 |
> |
jet_a->SetSimpleSecondaryVertexHighEffBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexHighEffBJetTagsDisc()); |
258 |
> |
jet_a->SetSimpleSecondaryVertexHighPurBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexHighPurBJetTagsDisc()); |
259 |
|
sortedJetsAll.push_back(jet_a); |
260 |
|
} |
261 |
|
|
262 |
< |
for(UInt_t i=0; i<CleanJets->GetEntries(); i++){ |
263 |
< |
if(TMath::Abs(CleanJets->At(i)->Eta()) < 5.0 && |
264 |
< |
CleanJets->At(i)->Pt() > 25.0){ |
265 |
< |
Jet* jet_b = new Jet(CleanJets->At(i)->Px(), |
266 |
< |
CleanJets->At(i)->Py(), |
267 |
< |
CleanJets->At(i)->Pz(), |
268 |
< |
CleanJets->At(i)->E() ); |
262 |
> |
for(UInt_t i=0; i<CleanJetsNoPtCut->GetEntries(); i++){ |
263 |
> |
if(TMath::Abs(CleanJetsNoPtCut->At(i)->Eta()) < 5.0 && |
264 |
> |
CleanJetsNoPtCut->At(i)->Pt() > 30.0){ |
265 |
> |
Jet* jet_b = new Jet(CleanJetsNoPtCut->At(i)->Px(), |
266 |
> |
CleanJetsNoPtCut->At(i)->Py(), |
267 |
> |
CleanJetsNoPtCut->At(i)->Pz(), |
268 |
> |
CleanJetsNoPtCut->At(i)->E() ); |
269 |
|
sortedJets.push_back(jet_b); |
270 |
|
} |
271 |
|
} |
297 |
|
} |
298 |
|
} |
299 |
|
double maxBtag = -99999.; |
322 |
– |
double imaxBtag = -1; |
300 |
|
for(UInt_t i=0; i<sortedJetsLowPt.size(); i++){ |
301 |
|
if(sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc() > maxBtag){ |
302 |
< |
maxBtag = sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc(); |
303 |
< |
imaxBtag = i; |
302 |
> |
double dZAverageJetPt = 0.0; |
303 |
> |
double sumJetPt = 0.0; |
304 |
> |
double jetPt = 0.0; |
305 |
> |
for(UInt_t iPF=0; iPF<fPFJet0->GetEntries(); iPF++){ |
306 |
> |
const PFJet *jet = fPFJet0->At(iPF); |
307 |
> |
if(MathUtils::DeltaR(jet->Mom(),sortedJetsLowPt[i]->Mom()) < 0.01){ |
308 |
> |
jetPt = jet->Pt(); |
309 |
> |
for (UInt_t npf=0; npf<jet->NPFCands();npf++) { |
310 |
> |
const PFCandidate *pf = jet->PFCand(npf); |
311 |
> |
if(pf->BestTrk()) { |
312 |
> |
dZAverageJetPt = dZAverageJetPt + pf->Pt()*pf->Pt()*pf->BestTrk()->DzCorrected(*fVertices->At(0)); |
313 |
> |
sumJetPt = sumJetPt + pf->Pt()*pf->Pt(); |
314 |
> |
} |
315 |
> |
} |
316 |
> |
if(sumJetPt > 0) dZAverageJetPt = TMath::Abs(dZAverageJetPt)/sumJetPt; |
317 |
> |
break; |
318 |
> |
} |
319 |
> |
} // loop over PF jets |
320 |
> |
if(dZAverageJetPt < 2.0 && jetPt > 10){ |
321 |
> |
maxBtag = sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc(); |
322 |
> |
} |
323 |
|
} |
324 |
|
} |
325 |
|
|
329 |
|
finalstateType = 10; |
330 |
|
} else if(CleanLeptons->At(0)->ObjType() == kElectron && CleanLeptons->At(1)->ObjType() == kElectron ){ // ee |
331 |
|
finalstateType = 11; |
332 |
< |
} else if((CleanLeptons->At(0)->ObjType() == kElectron && CleanLeptons->At(1)->ObjType() == kMuon) || |
337 |
< |
(CleanLeptons->At(1)->ObjType() == kElectron && CleanLeptons->At(0)->ObjType() == kMuon)) { |
332 |
> |
} else if(CleanLeptons->At(0)->ObjType() == kElectron && CleanLeptons->At(1)->ObjType() == kMuon) { |
333 |
|
finalstateType = 12; |
334 |
+ |
} else if(CleanLeptons->At(1)->ObjType() == kElectron && CleanLeptons->At(0)->ObjType() == kMuon) { |
335 |
+ |
finalstateType = 13; |
336 |
|
} else { |
337 |
|
cerr << "Error: finalstate lepton type not supported\n"; |
338 |
|
} |
339 |
|
|
340 |
+ |
double deltaPhiLLJet = 0.0; |
341 |
+ |
if(sortedJetsAll.size() > 0 && sortedJetsAll[0]->Pt() > 15.0 && (finalstateType == 10 || finalstateType == 11)){ |
342 |
+ |
deltaPhiLLJet = MathUtils::DeltaPhi(dilepton->Phi(), sortedJetsAll[0]->Phi())*180.0/TMath::Pi(); |
343 |
+ |
} |
344 |
+ |
|
345 |
|
//********************************************************************************************* |
346 |
|
//Define Cuts |
347 |
|
//********************************************************************************************* |
348 |
< |
const int nCuts = 10; |
348 |
> |
const int nCuts = 16; |
349 |
|
bool passCut[nCuts] = {false, false, false, false, false, |
350 |
< |
false, false, false, false, false}; |
350 |
> |
false, false, false, false, false, |
351 |
> |
false, false, false, false, false, |
352 |
> |
false}; |
353 |
|
|
354 |
< |
if(CleanLeptons->At(0)->Pt() > 20.0 && |
355 |
< |
CleanLeptons->At(1)->Pt() >= 20.0) passCut[0] = true; |
354 |
> |
Bool_t PreselPtCut = kTRUE; |
355 |
> |
if(CleanLeptons->At(0)->Pt() <= 20) PreselPtCut = kFALSE; |
356 |
> |
if(CleanLeptons->At(1)->Pt() <= 10) PreselPtCut = kFALSE; |
357 |
> |
//if(CleanLeptons->At(1)->ObjType() == kElectron && CleanLeptons->At(1)->Pt() <= 15) PreselPtCut = kFALSE; |
358 |
> |
if(PreselPtCut == kTRUE) passCut[0] = true; |
359 |
|
|
360 |
< |
if(zDiffMax < 1.0) passCut[1] = true; |
360 |
> |
if(stdMet->Pt() > 20.0) passCut[1] = true; |
361 |
|
|
362 |
< |
if(caloMet->Pt() > 20.0) passCut[2] = true; |
362 |
> |
if(dilepton->Mass() > 12.0) passCut[2] = true; |
363 |
|
|
364 |
< |
if(dilepton->Mass() > 12.0) passCut[3] = true; |
365 |
< |
|
366 |
< |
if(sortedJets.size() < 1) passCut[6] = true; |
364 |
> |
if(sortedJets.size() < 1) passCut[5] = true; |
365 |
> |
|
366 |
> |
if(deltaPhiLLJet < 165.0) passCut[6] = true; |
367 |
|
|
368 |
|
if(SoftMuons->GetEntries() == 0) passCut[7] = true; |
369 |
|
|
372 |
|
if(maxBtag < 2.1) passCut[9] = true; |
373 |
|
|
374 |
|
if (finalstateType == 10 || finalstateType == 11){ // mumu/ee |
375 |
< |
if(fabs(dilepton->Mass()-91.1876) > 15.0) passCut[4] = true; |
376 |
< |
if(METdeltaPhilEt > 35) passCut[5] = true; |
375 |
> |
if(fabs(dilepton->Mass()-91.1876) > 15.0) passCut[3] = true; |
376 |
> |
if(METdeltaPhilEt > 37.0 + fVertices->GetEntries()/2.0) passCut[4] = true; |
377 |
|
} |
378 |
< |
else if(finalstateType == 12) { // emu |
379 |
< |
passCut[4] = true; |
380 |
< |
if(METdeltaPhilEt > 20) passCut[5] = true; |
378 |
> |
else { // mue/emu |
379 |
> |
passCut[3] = true; |
380 |
> |
if(METdeltaPhilEt > 20) passCut[4] = true; |
381 |
|
} |
382 |
< |
|
382 |
> |
|
383 |
> |
if(CleanLeptons->At(0)->Pt() > 30) passCut[10] = true; |
384 |
> |
|
385 |
> |
if(CleanLeptons->At(1)->Pt() > 25) passCut[11] = true; |
386 |
> |
|
387 |
> |
if(dilepton->Mass() < 50) passCut[12] = true; |
388 |
> |
|
389 |
> |
if(mtHiggs > 90.0 && mtHiggs < 160.0) passCut[13] = true; |
390 |
> |
|
391 |
> |
if(deltaPhiLeptons < 60.0) passCut[14] = true; |
392 |
> |
|
393 |
> |
if(dilepton->Pt() > 45.0) passCut[15] = true; |
394 |
> |
|
395 |
|
//********************************************************************************************* |
396 |
|
//Make Selection Histograms. Number of events passing each level of cut |
397 |
|
//********************************************************************************************* |
398 |
|
bool passAllCuts = true; |
399 |
|
for(int c=0; c<nCuts; c++) passAllCuts = passAllCuts & passCut[c]; |
400 |
< |
|
400 |
> |
if(passAllCuts) fNEventsSelected++; |
401 |
> |
|
402 |
|
//Cut Selection Histograms |
403 |
|
fHWWSelection->Fill(-1,NNLOWeight->GetVal()); |
404 |
|
if (finalstateType == 10 ) |
407 |
|
fHWWToEESelection->Fill(-1,NNLOWeight->GetVal()); |
408 |
|
else if(finalstateType == 12 ) |
409 |
|
fHWWToEMuSelection->Fill(-1,NNLOWeight->GetVal()); |
410 |
+ |
else if(finalstateType == 13 ) |
411 |
+ |
fHWWToMuESelection->Fill(-1,NNLOWeight->GetVal()); |
412 |
|
|
413 |
|
for (int k=0;k<nCuts;k++) { |
414 |
|
bool pass = true; |
427 |
|
fHWWToEESelection->Fill(k,NNLOWeight->GetVal()); |
428 |
|
else if(finalstateType == 12) |
429 |
|
fHWWToEMuSelection->Fill(k,NNLOWeight->GetVal()); |
430 |
+ |
else if(finalstateType == 13) |
431 |
+ |
fHWWToMuESelection->Fill(k,NNLOWeight->GetVal()); |
432 |
|
} |
433 |
|
} |
434 |
|
|
439 |
|
fLeptonEta->Fill(CleanLeptons->At(1)->Eta(),NNLOWeight->GetVal()); |
440 |
|
fLeptonPtMax->Fill(CleanLeptons->At(0)->Pt(),NNLOWeight->GetVal()); |
441 |
|
fLeptonPtMin->Fill(CleanLeptons->At(1)->Pt(),NNLOWeight->GetVal()); |
442 |
< |
fMetPtHist->Fill(caloMet->Pt(),NNLOWeight->GetVal()); |
443 |
< |
fMetPhiHist->Fill(caloMet->Phi(),NNLOWeight->GetVal()); |
442 |
> |
fMetPtHist->Fill(stdMet->Pt(),NNLOWeight->GetVal()); |
443 |
> |
fMetPhiHist->Fill(stdMet->Phi(),NNLOWeight->GetVal()); |
444 |
|
fDeltaPhiLeptons->Fill(deltaPhiLeptons,NNLOWeight->GetVal()); |
445 |
|
fDeltaEtaLeptons->Fill(deltaEtaLeptons,NNLOWeight->GetVal()); |
446 |
|
fDileptonMass->Fill(dilepton->Mass(),NNLOWeight->GetVal()); |
453 |
|
//N Jet Veto |
454 |
|
pass = true; |
455 |
|
for (int k=0;k<nCuts;k++) { |
456 |
< |
if (k != 5) { |
433 |
< |
pass = (pass && passCut[k]); |
434 |
< |
} |
456 |
> |
if (k != 5) pass = (pass && passCut[k]); |
457 |
|
} |
458 |
|
if (pass) { |
459 |
|
fNCentralJets_NMinusOne->Fill(sortedJets.size(),NNLOWeight->GetVal()); |
462 |
|
// Final Met Cut |
463 |
|
pass = true; |
464 |
|
for (int k=0;k<nCuts;k++) { |
465 |
< |
if (k != 4) { |
444 |
< |
pass = (pass && passCut[k]); |
445 |
< |
} |
465 |
> |
if (k != 4) pass = (pass && passCut[k]); |
466 |
|
} |
467 |
|
if (pass) { |
468 |
< |
fMetPtHist_NMinusOne->Fill(caloMet->Pt(),NNLOWeight->GetVal()); |
468 |
> |
fMetPtHist_NMinusOne->Fill(stdMet->Pt(),NNLOWeight->GetVal()); |
469 |
|
} |
470 |
|
|
471 |
|
// dilepton mass |
472 |
|
pass = true; |
473 |
|
for (int k=0;k<nCuts;k++) { |
474 |
< |
if (k != 2 && k != 3) |
455 |
< |
pass = (pass && passCut[k]); |
474 |
> |
if (k != 2 && k != 3) pass = (pass && passCut[k]); |
475 |
|
} |
476 |
|
if (pass) { |
477 |
|
fDileptonMass_NMinusOne->Fill(dilepton->Mass(),NNLOWeight->GetVal()); |
480 |
|
// Lepton Pt Max, Lepton Pt Min, DeltaPhiLeptons |
481 |
|
pass = true; |
482 |
|
for (int k=0;k<nCuts;k++) { |
483 |
< |
pass = (pass && passCut[k]); |
483 |
> |
if (k != 0) |
484 |
> |
pass = (pass && passCut[k]); |
485 |
|
} |
486 |
|
if (pass) { |
487 |
|
fLeptonPtMax_NMinusOne->Fill(CleanLeptons->At(0)->Pt(),NNLOWeight->GetVal()); |
492 |
|
// NSoftMuons |
493 |
|
pass = true; |
494 |
|
for (int k=0;k<nCuts;k++) { |
495 |
< |
if (k != 6) |
476 |
< |
pass = (pass && passCut[k]); |
495 |
> |
if (k != 7) pass = (pass && passCut[k]); |
496 |
|
} |
497 |
|
if (pass) { |
498 |
|
fNSoftMuonsHist_NMinusOne->Fill(SoftMuons->GetEntries(),NNLOWeight->GetVal()); |
506 |
|
fMtLepton1_afterCuts->Fill(mTW[0],NNLOWeight->GetVal()); |
507 |
|
fMtLepton2_afterCuts->Fill(mTW[1],NNLOWeight->GetVal()); |
508 |
|
fMtHiggs_afterCuts->Fill(mtHiggs,NNLOWeight->GetVal()); |
509 |
< |
fLeptonPtPlusMet_afterCuts->Fill(CleanLeptons->At(0)->Pt()+CleanLeptons->At(1)->Pt()+caloMet->Pt(),NNLOWeight->GetVal()); |
509 |
> |
fLeptonPtPlusMet_afterCuts->Fill(CleanLeptons->At(0)->Pt()+CleanLeptons->At(1)->Pt()+stdMet->Pt(),NNLOWeight->GetVal()); |
510 |
|
} |
511 |
|
|
512 |
|
delete dilepton; |
522 |
|
|
523 |
|
// Run finishing code on the computer (slave) that did the analysis. For this |
524 |
|
// module, we dont do anything here. |
525 |
+ |
cout << "selected events on HwwExampleAnalysisMod: " << fNEventsSelected << endl; |
526 |
|
|
527 |
|
} |
528 |
|
//-------------------------------------------------------------------------------------------------- |