ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/SelMods/src/HwwExampleAnalysisMod.cc
(Generate patch)

Comparing UserCode/MitPhysics/SelMods/src/HwwExampleAnalysisMod.cc (file contents):
Revision 1.3 by ceballos, Tue Oct 5 06:42:48 2010 UTC vs.
Revision 1.21 by ceballos, Sat Oct 29 14:11:40 2011 UTC

# Line 9 | Line 9
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"
# Line 22 | Line 24 | HwwExampleAnalysisMod::HwwExampleAnalysi
24    fMuonBranchName(Names::gkMuonBrn),
25    fMetName("NoDefaultNameSet"),
26    fCleanJetsName("NoDefaultNameSet"),
27 <  fVertexName(string("PrimaryVertexes").c_str()),
27 >  fCleanJetsNoPtCutName("NoDefaultNameSet"),
28 >  fVertexName(ModNames::gkGoodVertexesName),
29 >  fPFCandidatesName(Names::gkPFCandidatesBrn),
30    fMuons(0),
31    fMet(0),
32 <  fVertices(0)
32 >  fVertices(0),
33 >  fPFCandidates(0),
34 >  fPFJetName0("AKt5PFJets"),
35 >  fPFJet0(0),
36 >  fNEventsSelected(0)
37   {
38    // Constructor.
39   }
# Line 46 | Line 54 | void HwwExampleAnalysisMod::SlaveBegin()
54  
55    // Load Branches
56    ReqBranch(fMuonBranchName,   fMuons);
57 <  ReqBranch(fVertexName,    fVertices);
57 >  ReqBranch(fPFCandidatesName, fPFCandidates);
58 >  ReqBranch(fPFJetName0,       fPFJet0);
59  
60    //Create your histograms here
61  
62    //*************************************************************************************************
63    // Selection Histograms
64    //*************************************************************************************************
65 <  AddTH1(fHWWSelection,"hHWWSelection", ";Cut Number;Number of Events", 8, -1.5, 6.5);
66 <  AddTH1(fHWWToEESelection,"hHWWToEESelection", ";Cut Number;Number of Events", 8, -1.5, 6.5);
67 <  AddTH1(fHWWToMuMuSelection,"hHWWToMuMuSelection", ";Cut Number;Number of Events", 8, -1.5, 6.5);
68 <  AddTH1(fHWWToEMuSelection,"hHWWToEMuSelection", ";Cut Number;Number of Events", 8, -1.5, 6.5);
65 >  AddTH1(fHWWSelection,"hHWWSelection", ";Cut Number;Number of Events",             17, -1.5, 15.5);
66 >  AddTH1(fHWWToEESelection,"hHWWToEESelection", ";Cut Number;Number of Events",     17, -1.5, 15.5);
67 >  AddTH1(fHWWToMuMuSelection,"hHWWToMuMuSelection", ";Cut Number;Number of Events", 17, -1.5, 15.5);
68 >  AddTH1(fHWWToEMuSelection,"hHWWToEMuSelection", ";Cut Number;Number of Events",   17, -1.5, 15.5);
69 >  AddTH1(fHWWToMuESelection,"hHWWToMuESelection", ";Cut Number;Number of Events",   17, -1.5, 15.5);
70  
71    //***********************************************************************************************
72    // Histograms after preselection
# Line 69 | Line 79 | void HwwExampleAnalysisMod::SlaveBegin()
79    AddTH1(fUncorrMetPtHist    ,"hUncorrMetPtHist",";Met;Number of Events",150,0.,300.);  
80    AddTH1(fUncorrMetPhiHist   ,"hUncorrMetPhiHist",";#phi;Number of Events",28,-3.5,3.5);
81    AddTH1(fDeltaPhiLeptons    ,"hDeltaPhiLeptons",";#Delta#phi_{ll};Number of Events",90,0,180);
82 <  AddTH1(fDeltaEtaLeptons    ,"hDeltaEtaLeptons",";#Delta#eta_{ll};Number of Events",100,-50.,5.0);
82 >  AddTH1(fDeltaEtaLeptons    ,"hDeltaEtaLeptons",";#Delta#eta_{ll};Number of Events",100,-5.,5.0);
83    AddTH1(fDileptonMass       ,"hDileptonMass",";Mass_{ll};Number of Events",150,0.,300.);
84  
85    //***********************************************************************************************
# Line 120 | Line 130 | void HwwExampleAnalysisMod::Process()
130   {
131    // Process entries of the tree. For this module, we just load the branches and  
132    LoadBranch(fMuonBranchName);
133 <  LoadBranch(fVertexName);
134 <  
133 >  LoadBranch(fPFCandidatesName);
134 >  LoadBranch(fPFJetName0);
135 >
136    //Obtain all the good objects from the event cleaning module
137 +  fVertices = GetObjThisEvt<VertexOArr>(fVertexName);
138    ObjArray<Muon> *CleanMuons = dynamic_cast<ObjArray<Muon>* >(FindObjThisEvt(ModNames::gkCleanMuonsName));
139 +  ObjArray<Electron> *CleanElectrons = dynamic_cast<ObjArray<Electron>* >(FindObjThisEvt(ModNames::gkCleanElectronsName));
140    ParticleOArr *CleanLeptons = dynamic_cast<mithep::ParticleOArr*>
141      (FindObjThisEvt(ModNames::gkMergedLeptonsName));
142    ObjArray<Jet> *CleanJets = dynamic_cast<ObjArray<Jet>* >
143      (FindObjThisEvt(fCleanJetsName.Data()));
144 +  ObjArray<Jet> *CleanJetsNoPtCut = dynamic_cast<ObjArray<Jet>* >
145 +    (FindObjThisEvt(fCleanJetsNoPtCutName.Data()));
146    TParameter<Double_t> *NNLOWeight = GetObjThisEvt<TParameter<Double_t> >("NNLOWeight");
147  
148    MetCol *met = dynamic_cast<ObjArray<Met>* >(FindObjThisEvt(fMetName));
149 <  const Met *caloMet = 0;
149 >  const Met *stdMet = 0;
150    if (met) {
151 <    caloMet = met->At(0);
151 >    stdMet = met->At(0);
152    } else {
153      cout << "Error: Met Collection " << fMetName << " could not be loaded.\n";
154      return;
# Line 145 | Line 160 | void HwwExampleAnalysisMod::Process()
160    // At least two leptons in the event
161    if (CleanLeptons->GetEntries() < 2) return;
162    // Pt1 > 20 && Pt2 > 10
163 <  if(CleanLeptons->At(0)->Pt() <= 20 || CleanLeptons->At(1)->Pt() <= 20) return;
163 >  if(CleanLeptons->At(0)->Pt() <= 20 || CleanLeptons->At(1)->Pt() <= 10) return;
164    // opposite charge leptons
165    if(CleanLeptons->At(0)->Charge() * CleanLeptons->At(1)->Charge() > 0) return;
166      
# Line 159 | Line 174 | void HwwExampleAnalysisMod::Process()
174    ObjArray<Muon> *SoftMuons = new ObjArray<Muon>;
175    for (UInt_t i=0; i<fMuons->GetEntries(); ++i) {
176      const Muon *mu = fMuons->At(i);
177 <    if(!MuonTools::PassSoftMuonCut(mu, fVertices)) continue;
177 >    if(!MuonTools::PassSoftMuonCut(mu, fVertices, 0.2)) continue;
178      
179      bool isCleanMuon = kFALSE;
180      for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) {
# Line 170 | Line 185 | void HwwExampleAnalysisMod::Process()
185    }
186  
187    //***********************************************************************************************
188 +  //|Z_vert-Z_l| maximum
189 +  //***********************************************************************************************
190 +  std::vector<double> leptonsDz;
191 +  double zDiffMax = 0.0;
192 +  if(fVertices->GetEntries() > 0) {
193 +    for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) {
194 +      double pDz = CleanMuons->At(j)->BestTrk()->DzCorrected(*fVertices->At(0));
195 +      leptonsDz.push_back(pDz);
196 +    }
197 +    for (UInt_t j=0; j<CleanElectrons->GetEntries(); j++) {  
198 +      double pDz = CleanElectrons->At(j)->GsfTrk()->DzCorrected(*fVertices->At(0));
199 +      leptonsDz.push_back(pDz);
200 +    }
201 +    for(UInt_t t=0; t<leptonsDz.size(); t++) {
202 +      for(UInt_t i=t+1; i<leptonsDz.size(); i++) {
203 +        if(TMath::Abs(leptonsDz[t]-leptonsDz[i]) > zDiffMax) zDiffMax = TMath::Abs(leptonsDz[t]-leptonsDz[i]);
204 +      }
205 +    }
206 +    leptonsDz.clear();
207 +  }
208 +
209 +  //***********************************************************************************************
210    //Define Event Variables
211    //***********************************************************************************************
212    //delta phi between the 2 leptons in degrees
213    double deltaPhiLeptons = MathUtils::DeltaPhi(CleanLeptons->At(0)->Phi(),
214                                                 CleanLeptons->At(1)->Phi())* 180.0 / TMath::Pi();
215  
216 <  double deltaEtaLeptons = abs(CleanLeptons->At(0)->Eta() - CleanLeptons->At(1)->Eta()) * 180.0 / TMath::Pi();
216 >  double deltaEtaLeptons = CleanLeptons->At(0)->Eta() - CleanLeptons->At(1)->Eta();
217  
218 <  double deltaPhiDileptonMet = MathUtils::DeltaPhi(caloMet->Phi(),
218 >  double deltaPhiDileptonMet = MathUtils::DeltaPhi(stdMet->Phi(),
219                                                     dilepton->Phi())*180.0 / TMath::Pi();
220  
221 <  double mtHiggs = TMath::Sqrt(2.0*dilepton->Pt() * caloMet->Pt()*
221 >  double mtHiggs = TMath::Sqrt(2.0*dilepton->Pt() * stdMet->Pt()*
222                                 (1.0 - cos(deltaPhiDileptonMet * TMath::Pi() / 180.0)));
223  
224    //angle between MET and closest lepton
225 <  double deltaPhiMetLepton[2] = {MathUtils::DeltaPhi(caloMet->Phi(), CleanLeptons->At(0)->Phi()),
226 <                                 MathUtils::DeltaPhi(caloMet->Phi(), CleanLeptons->At(1)->Phi())};
225 >  double deltaPhiMetLepton[2] = {MathUtils::DeltaPhi(stdMet->Phi(), CleanLeptons->At(0)->Phi()),
226 >                                 MathUtils::DeltaPhi(stdMet->Phi(), CleanLeptons->At(1)->Phi())};
227    
228 <  double mTW[2] = {TMath::Sqrt(2.0*CleanLeptons->At(0)->Pt()*caloMet->Pt()*
228 >  double mTW[2] = {TMath::Sqrt(2.0*CleanLeptons->At(0)->Pt()*stdMet->Pt()*
229                                 (1.0 - cos(deltaPhiMetLepton[0]))),
230 <                   TMath::Sqrt(2.0*CleanLeptons->At(1)->Pt()*caloMet->Pt()*
230 >                   TMath::Sqrt(2.0*CleanLeptons->At(1)->Pt()*stdMet->Pt()*
231                                 (1.0 - cos(deltaPhiMetLepton[1])))};
232  
233    double minDeltaPhiMetLepton = (deltaPhiMetLepton[0] < deltaPhiMetLepton[1])?
234      deltaPhiMetLepton[0]:deltaPhiMetLepton[1];
235  
236 <  double METdeltaPhilEt = caloMet->Pt();
237 <  if(minDeltaPhiMetLepton < TMath::Pi()/2.)
238 <      METdeltaPhilEt = METdeltaPhilEt * sin(minDeltaPhiMetLepton);
236 >  MetTools metTools(CleanMuons, CleanElectrons, fPFCandidates, fVertices->At(0), 0.1, 8.0, 5.0);
237 >  double pMET[2] = {metTools.GetProjectedMet(CleanLeptons,stdMet),
238 >                    metTools.GetProjectedTrackMet(CleanLeptons)};
239 >
240 >  double METdeltaPhilEt = TMath::Min(pMET[0],pMET[1]);
241 >
242 >  //count the number of central Jets for vetoing and b-tagging
243 >  vector<Jet*> sortedJetsAll;
244 >  vector<Jet*> sortedJets;
245 >  vector<Jet*> sortedJetsLowPt;
246 >  for(UInt_t i=0; i<CleanJetsNoPtCut->GetEntries(); i++){
247 >    if(CleanJetsNoPtCut->At(i)->RawMom().Pt() <= 7) continue;
248 >    Jet* jet_a = new Jet(CleanJetsNoPtCut->At(i)->Px(),
249 >                         CleanJetsNoPtCut->At(i)->Py(),
250 >                         CleanJetsNoPtCut->At(i)->Pz(),
251 >                         CleanJetsNoPtCut->At(i)->E() );
252 >    jet_a->SetMatchedMCFlavor(CleanJetsNoPtCut->At(i)->MatchedMCFlavor());
253 >    jet_a->SetCombinedSecondaryVertexBJetTagsDisc(CleanJetsNoPtCut->At(i)->CombinedSecondaryVertexBJetTagsDisc());
254 >    jet_a->SetCombinedSecondaryVertexMVABJetTagsDisc(CleanJetsNoPtCut->At(i)->CombinedSecondaryVertexMVABJetTagsDisc());
255 >    jet_a->SetJetProbabilityBJetTagsDisc(CleanJetsNoPtCut->At(i)->JetProbabilityBJetTagsDisc());
256 >    jet_a->SetJetBProbabilityBJetTagsDisc(CleanJetsNoPtCut->At(i)->JetBProbabilityBJetTagsDisc());
257 >    jet_a->SetTrackCountingHighEffBJetTagsDisc(CleanJetsNoPtCut->At(i)->TrackCountingHighEffBJetTagsDisc());
258 >    jet_a->SetTrackCountingHighPurBJetTagsDisc(CleanJetsNoPtCut->At(i)->TrackCountingHighPurBJetTagsDisc());
259 >    jet_a->SetSimpleSecondaryVertexBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexBJetTagsDisc());
260 >    jet_a->SetSimpleSecondaryVertexHighEffBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexHighEffBJetTagsDisc());
261 >    jet_a->SetSimpleSecondaryVertexHighPurBJetTagsDisc(CleanJetsNoPtCut->At(i)->SimpleSecondaryVertexHighPurBJetTagsDisc());
262 >    sortedJetsAll.push_back(jet_a);
263 >  }
264  
203  //count the number of central Jets for vetoing
204  int nCentralJets = 0;
265    for(UInt_t i=0; i<CleanJets->GetEntries(); i++){
266      if(TMath::Abs(CleanJets->At(i)->Eta()) < 5.0 &&
267 <       CleanJets->At(i)->Pt() > 25.0){
268 <      nCentralJets++;
267 >       CleanJets->At(i)->Pt() > 30.0){
268 >      Jet* jet_b = new Jet(CleanJets->At(i)->Px(),
269 >                           CleanJets->At(i)->Py(),
270 >                           CleanJets->At(i)->Pz(),
271 >                           CleanJets->At(i)->E() );
272 >      sortedJets.push_back(jet_b);
273 >    }
274 >  }
275 >
276 >  for(UInt_t i=0; i<sortedJetsAll.size(); i++){
277 >    bool overlap = kFALSE;
278 >    for(UInt_t j=0; j<sortedJets.size(); j++){
279 >      if(sortedJetsAll[i]->Pt() == sortedJets[j]->Pt() ||
280 >        (sortedJetsAll[i]->CombinedSecondaryVertexBJetTagsDisc() == sortedJets[j]->CombinedSecondaryVertexBJetTagsDisc() &&
281 >         sortedJetsAll[i]->JetBProbabilityBJetTagsDisc()         == sortedJets[j]->JetBProbabilityBJetTagsDisc() &&
282 >         sortedJetsAll[i]->TrackCountingHighPurBJetTagsDisc()    == sortedJets[j]->TrackCountingHighPurBJetTagsDisc())
283 >        ) {
284 >        sortedJets[j]->SetMatchedMCFlavor(sortedJetsAll[i]->MatchedMCFlavor());
285 >        sortedJets[j]->SetCombinedSecondaryVertexBJetTagsDisc(sortedJetsAll[i]->CombinedSecondaryVertexBJetTagsDisc());
286 >        sortedJets[j]->SetCombinedSecondaryVertexMVABJetTagsDisc(sortedJetsAll[i]->CombinedSecondaryVertexMVABJetTagsDisc());
287 >        sortedJets[j]->SetJetProbabilityBJetTagsDisc(sortedJetsAll[i]->JetProbabilityBJetTagsDisc());
288 >        sortedJets[j]->SetJetBProbabilityBJetTagsDisc(sortedJetsAll[i]->JetBProbabilityBJetTagsDisc());
289 >        sortedJets[j]->SetTrackCountingHighEffBJetTagsDisc(sortedJetsAll[i]->TrackCountingHighEffBJetTagsDisc());
290 >        sortedJets[j]->SetTrackCountingHighPurBJetTagsDisc(sortedJetsAll[i]->TrackCountingHighPurBJetTagsDisc());
291 >        sortedJets[j]->SetSimpleSecondaryVertexBJetTagsDisc(sortedJetsAll[i]->SimpleSecondaryVertexBJetTagsDisc());
292 >        sortedJets[j]->SetSimpleSecondaryVertexHighEffBJetTagsDisc(sortedJetsAll[i]->SimpleSecondaryVertexHighEffBJetTagsDisc());
293 >        sortedJets[j]->SetSimpleSecondaryVertexHighPurBJetTagsDisc(sortedJetsAll[i]->SimpleSecondaryVertexHighPurBJetTagsDisc());        
294 >        overlap = kTRUE;
295 >        break;
296 >      }
297 >    }
298 >    if(overlap == kFALSE){
299 >      sortedJetsLowPt.push_back(sortedJetsAll[i]);
300 >    }
301 >  }
302 >  double maxBtag = -99999.;
303 >  for(UInt_t i=0; i<sortedJetsLowPt.size(); i++){
304 >    if(sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc() > maxBtag){
305 >      double dZAverageJetPt = 0.0;
306 >      double sumJetPt = 0.0;
307 >      double jetPt = 0.0;
308 >      for(UInt_t iPF=0; iPF<fPFJet0->GetEntries(); iPF++){                                                            
309 >        const PFJet *jet = fPFJet0->At(iPF);                                                                    
310 >        if(MathUtils::DeltaR(jet->Mom(),sortedJetsLowPt[i]->Mom()) < 0.01){
311 >          jetPt = jet->Pt();
312 >          for (UInt_t npf=0; npf<jet->NPFCands();npf++) {
313 >            const PFCandidate *pf = jet->PFCand(npf);
314 >            if(pf->BestTrk()) {
315 >              dZAverageJetPt = dZAverageJetPt + pf->Pt()*pf->Pt()*pf->BestTrk()->DzCorrected(*fVertices->At(0));
316 >              sumJetPt = sumJetPt + pf->Pt()*pf->Pt();
317 >            }
318 >          }
319 >          if(sumJetPt > 0) dZAverageJetPt = TMath::Abs(dZAverageJetPt)/sumJetPt;
320 >          break;
321 >        }
322 >      } // loop over PF jets
323 >      if(dZAverageJetPt < 2.0 && jetPt > 10){
324 >        maxBtag  = sortedJetsLowPt[i]->TrackCountingHighEffBJetTagsDisc();
325 >      }
326      }
327    }
328  
# Line 215 | Line 332 | void HwwExampleAnalysisMod::Process()
332      finalstateType = 10;
333    } else if(CleanLeptons->At(0)->ObjType() == kElectron && CleanLeptons->At(1)->ObjType() == kElectron ){ // ee
334      finalstateType = 11;
335 <  } else if((CleanLeptons->At(0)->ObjType() == kElectron && CleanLeptons->At(1)->ObjType() == kMuon) ||
219 <            (CleanLeptons->At(1)->ObjType() == kElectron && CleanLeptons->At(0)->ObjType() == kMuon)) {
335 >  } else if(CleanLeptons->At(0)->ObjType() == kElectron && CleanLeptons->At(1)->ObjType() == kMuon) {
336      finalstateType = 12;
337 +  } else if(CleanLeptons->At(1)->ObjType() == kElectron && CleanLeptons->At(0)->ObjType() == kMuon) {
338 +    finalstateType = 13;
339    } else {
340      cerr << "Error: finalstate lepton type not supported\n";
341    }
342                          
343 +  double deltaPhiLLJet = 0.0;
344 +  if(sortedJetsAll.size() > 0 && sortedJetsAll[0]->Pt() > 15.0 && (finalstateType == 10 || finalstateType == 11)){
345 +    deltaPhiLLJet = MathUtils::DeltaPhi(dilepton->Phi(), sortedJetsAll[0]->Phi())*180.0/TMath::Pi();
346 +  }
347 +
348    //*********************************************************************************************
349    //Define Cuts
350    //*********************************************************************************************
351 <  const int nCuts = 7;
352 <  bool passCut[nCuts] = {false, false, false, false, false, false, false};
353 <  
354 <  if(CleanLeptons->At(0)->Pt() >  20.0 &&
355 <     CleanLeptons->At(1)->Pt() >= 20.0) passCut[0] = true;
351 >  const int nCuts = 16;
352 >  bool passCut[nCuts] = {false, false, false, false, false,
353 >                         false, false, false, false, false,
354 >                         false, false, false, false, false,
355 >                         false};
356 >  
357 >  Bool_t PreselPtCut = kTRUE;
358 >  if(CleanLeptons->At(0)->Pt() <= 20) PreselPtCut = kFALSE;
359 >  if(CleanLeptons->At(1)->Pt() <= 10) PreselPtCut = kFALSE;
360 >  //if(CleanLeptons->At(1)->ObjType() == kElectron && CleanLeptons->At(1)->Pt() <= 15) PreselPtCut = kFALSE;
361 >  if(PreselPtCut == kTRUE)              passCut[0] = true;
362    
363 <  if(caloMet->Pt()    > 20.0)           passCut[1] = true;
363 >  if(stdMet->Pt()    > 20.0)            passCut[1] = true;
364    
365    if(dilepton->Mass() > 12.0)           passCut[2] = true;
366    
367 <  if(nCentralJets     < 1)              passCut[5] = true;
367 >  if(sortedJets.size() < 1)             passCut[5] = true;
368 >
369 >  if(deltaPhiLLJet < 165.0)             passCut[6] = true;
370 >
371 >  if(SoftMuons->GetEntries() == 0)      passCut[7] = true;
372 >
373 >  if(CleanLeptons->GetEntries() == 2)   passCut[8] = true;
374  
375 <  if(CleanLeptons->GetEntries() == 2 &&
241 <     SoftMuons->GetEntries() == 0)      passCut[6] = true;
375 >  if(maxBtag < 2.1)                     passCut[9] = true;
376  
377    if (finalstateType == 10 || finalstateType == 11){ // mumu/ee
378      if(fabs(dilepton->Mass()-91.1876)   > 15.0)   passCut[3] = true;
379 <    if(METdeltaPhilEt > 35) passCut[4] = true;
379 >    if(METdeltaPhilEt > 37.0 + fVertices->GetEntries()/2.0) passCut[4] = true;
380    }
381 <  else if(finalstateType == 12) { // emu
381 >  else { // mue/emu
382      passCut[3] = true;
383      if(METdeltaPhilEt > 20) passCut[4] = true;
384    }
385 <  
385 >
386 >  if(CleanLeptons->At(0)->Pt() > 30)    passCut[10] = true;
387 >
388 >  if(CleanLeptons->At(1)->Pt() > 25)    passCut[11] = true;
389 >
390 >  if(dilepton->Mass() < 50)             passCut[12] = true;
391 >
392 >  if(mtHiggs > 90.0 && mtHiggs < 160.0) passCut[13] = true;
393 >
394 >  if(deltaPhiLeptons < 60.0)            passCut[14] = true;
395 >
396 >  if(dilepton->Pt() > 45.0)             passCut[15] = true;
397 >
398    //*********************************************************************************************
399    //Make Selection Histograms. Number of events passing each level of cut
400    //*********************************************************************************************  
401    bool passAllCuts = true;
402    for(int c=0; c<nCuts; c++) passAllCuts = passAllCuts & passCut[c];
403 <    
403 >  if(passAllCuts) fNEventsSelected++;
404 >
405    //Cut Selection Histograms
406    fHWWSelection->Fill(-1,NNLOWeight->GetVal());
407    if (finalstateType == 10 )
# Line 263 | Line 410 | void HwwExampleAnalysisMod::Process()
410      fHWWToEESelection->Fill(-1,NNLOWeight->GetVal());
411    else if(finalstateType == 12 )
412      fHWWToEMuSelection->Fill(-1,NNLOWeight->GetVal());
413 +  else if(finalstateType == 13 )
414 +    fHWWToMuESelection->Fill(-1,NNLOWeight->GetVal());
415  
416    for (int k=0;k<nCuts;k++) {
417      bool pass = true;
# Line 281 | Line 430 | void HwwExampleAnalysisMod::Process()
430          fHWWToEESelection->Fill(k,NNLOWeight->GetVal());
431        else if(finalstateType == 12)
432          fHWWToEMuSelection->Fill(k,NNLOWeight->GetVal());
433 +      else if(finalstateType == 13)
434 +        fHWWToMuESelection->Fill(k,NNLOWeight->GetVal());
435      }
436    }
437    
# Line 291 | Line 442 | void HwwExampleAnalysisMod::Process()
442    fLeptonEta->Fill(CleanLeptons->At(1)->Eta(),NNLOWeight->GetVal());
443    fLeptonPtMax->Fill(CleanLeptons->At(0)->Pt(),NNLOWeight->GetVal());
444    fLeptonPtMin->Fill(CleanLeptons->At(1)->Pt(),NNLOWeight->GetVal());
445 <  fMetPtHist->Fill(caloMet->Pt(),NNLOWeight->GetVal());                            
446 <  fMetPhiHist->Fill(caloMet->Phi(),NNLOWeight->GetVal());                            
445 >  fMetPtHist->Fill(stdMet->Pt(),NNLOWeight->GetVal());                            
446 >  fMetPhiHist->Fill(stdMet->Phi(),NNLOWeight->GetVal());                            
447    fDeltaPhiLeptons->Fill(deltaPhiLeptons,NNLOWeight->GetVal());
448    fDeltaEtaLeptons->Fill(deltaEtaLeptons,NNLOWeight->GetVal());
449    fDileptonMass->Fill(dilepton->Mass(),NNLOWeight->GetVal());    
# Line 305 | Line 456 | void HwwExampleAnalysisMod::Process()
456    //N Jet Veto  
457    pass = true;
458    for (int k=0;k<nCuts;k++) {
459 <    if (k != 5) {
309 <      pass = (pass && passCut[k]);      
310 <    }
459 >    if (k != 5) pass = (pass && passCut[k]);      
460    }
461    if (pass) {
462 <    fNCentralJets_NMinusOne->Fill(nCentralJets,NNLOWeight->GetVal());
462 >    fNCentralJets_NMinusOne->Fill(sortedJets.size(),NNLOWeight->GetVal());
463    }    
464    
465    // Final Met Cut
466    pass = true;
467    for (int k=0;k<nCuts;k++) {
468 <    if (k != 4) {
320 <      pass = (pass && passCut[k]);      
321 <    }
468 >    if (k != 4) pass = (pass && passCut[k]);      
469    }
470    if (pass) {
471 <    fMetPtHist_NMinusOne->Fill(caloMet->Pt(),NNLOWeight->GetVal());  
471 >    fMetPtHist_NMinusOne->Fill(stdMet->Pt(),NNLOWeight->GetVal());  
472    }
473  
474    // dilepton mass
475    pass = true;
476    for (int k=0;k<nCuts;k++) {
477 <    if (k != 2 && k !=  3)
331 <      pass = (pass && passCut[k]);    
477 >    if (k != 2 && k !=  3) pass = (pass && passCut[k]);    
478    }
479    if (pass) {
480      fDileptonMass_NMinusOne->Fill(dilepton->Mass(),NNLOWeight->GetVal());
# Line 337 | Line 483 | void HwwExampleAnalysisMod::Process()
483    // Lepton Pt Max, Lepton Pt Min, DeltaPhiLeptons
484    pass = true;
485    for (int k=0;k<nCuts;k++) {
486 <    pass = (pass && passCut[k]);      
486 >    if (k != 0)
487 >      pass = (pass && passCut[k]);
488    }
489    if (pass) {
490      fLeptonPtMax_NMinusOne->Fill(CleanLeptons->At(0)->Pt(),NNLOWeight->GetVal());
# Line 348 | Line 495 | void HwwExampleAnalysisMod::Process()
495    // NSoftMuons
496    pass = true;
497    for (int k=0;k<nCuts;k++) {
498 <    if (k != 6)
352 <      pass = (pass && passCut[k]);    
498 >    if (k != 7) pass = (pass && passCut[k]);    
499    }
500    if (pass) {
501      fNSoftMuonsHist_NMinusOne->Fill(SoftMuons->GetEntries(),NNLOWeight->GetVal());
# Line 363 | Line 509 | void HwwExampleAnalysisMod::Process()
509      fMtLepton1_afterCuts->Fill(mTW[0],NNLOWeight->GetVal());
510      fMtLepton2_afterCuts->Fill(mTW[1],NNLOWeight->GetVal());
511      fMtHiggs_afterCuts->Fill(mtHiggs,NNLOWeight->GetVal());
512 <    fLeptonPtPlusMet_afterCuts->Fill(CleanLeptons->At(0)->Pt()+CleanLeptons->At(1)->Pt()+caloMet->Pt(),NNLOWeight->GetVal());
512 >    fLeptonPtPlusMet_afterCuts->Fill(CleanLeptons->At(0)->Pt()+CleanLeptons->At(1)->Pt()+stdMet->Pt(),NNLOWeight->GetVal());
513    }
514    
515    delete dilepton;
516    delete SoftMuons;
517 +  for(UInt_t i=0; i<sortedJets.size();      i++) delete sortedJets[i];
518 +  for(UInt_t i=0; i<sortedJetsAll.size();   i++) delete sortedJetsAll[i];
519    return;
520   }
521  
# Line 377 | Line 525 | void HwwExampleAnalysisMod::SlaveTermina
525    
526    // Run finishing code on the computer (slave) that did the analysis. For this
527    // module, we dont do anything here.
528 +  cout << "selected events on HwwExampleAnalysisMod: " << fNEventsSelected << endl;
529  
530   }
531   //--------------------------------------------------------------------------------------------------

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines