ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/src/HwwEvtSelMod.cc
Revision: 1.1
Committed: Mon Oct 6 15:40:14 2008 UTC (16 years, 7 months ago) by sixie
Content type: text/plain
Branch: MAIN
Log Message:
Add new physics modules directory. This directory is intended for template-style analysis modules. individual users are meant to check these out and modify for their own purposes.

File Contents

# User Rev Content
1 sixie 1.1 // $Id: HwwEvtSelMod.cc,v 1.1 2008/09/30 19:24:22 sixie Exp $
2    
3     #include "MitAna/PhysicsMod/interface/HwwEvtSelMod.h"
4     #include <TH1D.h>
5     #include <TH2D.h>
6     #include "MitAna/DataTree/interface/Names.h"
7     #include "MitAna/DataCont/interface/ObjArray.h"
8     #include "MitCommon/MathTools/interface/MathUtils.h"
9    
10     using namespace mithep;
11     ClassImp(mithep::HwwEvtSelMod)
12    
13     //--------------------------------------------------------------------------------------------------
14     HwwEvtSelMod::HwwEvtSelMod(const char *name, const char *title) :
15     BaseMod(name,title),
16     fPrintDebug(false),
17     fPlotType("N-1"),
18     fMCPartName(Names::gkMCPartBrn),
19     fMetName(Names::gkCaloMetBrn),
20     fTrackName(Names::gkTrackBrn),
21     fJetName(Names::gkCaloJetBrn),
22     fCleanJetsName(Names::gkCleanJetsName),
23     fLoadGenParticles(false),
24     fParticles(0),
25     fMet(0),
26     fTracks(0),
27     fJets(0),
28     fNEventsProcessed(0),
29     fNEventsPassedSkim(0),
30     fNEventsPassedLeptonSelection(0),
31     fNEventsPassedKinematicPreselection(0),
32     fNEventsInsideAcceptance(0)
33     {
34     // Constructor.
35     }
36    
37     //--------------------------------------------------------------------------------------------------
38     void HwwEvtSelMod::Begin()
39     {
40     // Run startup code on the client machine. For this module, we dont do
41     // anything here.
42     }
43    
44     //--------------------------------------------------------------------------------------------------
45     void HwwEvtSelMod::Process()
46     {
47     // Process entries of the tree. For this module, we just load the branches and
48     fNEventsProcessed++;
49    
50     if (fNEventsProcessed % 1000 == 0 || fPrintDebug) {
51     time_t systime;
52     systime = time(NULL);
53     cerr << endl << "HwwEvtSelMod : Process Event " << fNEventsProcessed << " Time: " << ctime(&systime) << endl;
54     }
55    
56     //Get Generator Level information for matching
57     ObjArray<MCParticle> *GenLeptons = new ObjArray<MCParticle>;
58    
59    
60     if (fLoadGenParticles) {
61     LoadBranch(fMCPartName);
62    
63     for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
64     MCParticle* p = fParticles->At(i);
65    
66     if (p->IsGenerated() &&
67     (p-> HasMother() && p->Mother()->AbsPdgId() == 24) &&
68     (p->AbsPdgId() == 11 || p->AbsPdgId() == 13)
69     && p->Status() == 3
70     )
71     GenLeptons->Add(p);
72     }
73    
74     if (fPrintDebug) cerr << "check generator leptons\n";
75     for (UInt_t i=0; i<GenLeptons->GetEntries(); ++i) {
76     if (fPrintDebug) {
77     cerr << i << " " << GenLeptons->At(i)->PdgId() << " " << GenLeptons->At(i)->Status()
78     << " " << GenLeptons->At(i)->Pt() << " " << GenLeptons->At(i)->Eta() << " "
79     << GenLeptons->At(i)->Phi() << endl;
80     }
81     }
82    
83     int nGenLeptonsInsideAcceptance = 0;
84     for(UInt_t i=0; i<GenLeptons->GetEntries();i++) {
85     if (fabs(GenLeptons->At(i)->Eta()) < 2.5)
86     nGenLeptonsInsideAcceptance++;
87     }
88     if (nGenLeptonsInsideAcceptance == 2)
89     fNEventsInsideAcceptance++;
90     }
91    
92     //Obtain all the good objects from the event cleaning module
93     ObjArray<Electron> *CleanElectrons = dynamic_cast<ObjArray<Electron>* >
94     (FindObjThisEvt(Names::gkCleanElectronsName));
95     ObjArray<Muon> *CleanMuons = dynamic_cast<ObjArray<Muon>* >(FindObjThisEvt(Names::gkCleanMuonsName));
96     ObjArray<Jet> *CleanJets = dynamic_cast<ObjArray<Jet>* >
97     (FindObjThisEvt(fCleanJetsName.Data()));
98    
99     LoadBranch(fMetName);
100     Met *caloMet = fMet->At(0);
101    
102     vector<ChargedParticle*> leptons;
103     vector<string> leptonType;
104    
105     //make lepton vector from muons and electrons
106     for (UInt_t j=0; j<CleanMuons->GetEntries(); j++) {
107     leptons.push_back(CleanMuons->At(j));
108     leptonType.push_back("mu");
109     }
110     for (UInt_t j=0; j<CleanElectrons->GetEntries(); j++) {
111     leptons.push_back(CleanElectrons->At(j));
112     leptonType.push_back("e");
113     }
114    
115     //We should sort the Leptons by Pt
116     for(UInt_t i=0; i<leptons.size(); i++)
117     for(UInt_t j=i+1; j<leptons.size(); j++)
118     if(leptons[i]->Pt() < leptons[j]->Pt()) {
119     //swap i and j
120     ChargedParticle* templepton = leptons[i];
121     leptons[i] = leptons[j];
122     leptons[j] = templepton;
123     string templeptonType = leptonType[i];
124     leptonType[i] = leptonType[j];
125     leptonType[j] = templeptonType;
126     }
127    
128     if (fPrintDebug) {
129     cerr << "Check Lepton Sort\n";
130     for(UInt_t i=0; i<leptons.size(); i++)
131     cerr << leptons[i]->Pt() << endl;
132     }
133    
134     if (fPrintDebug)
135     cerr << "Analysis begins" << endl;
136    
137     //make sure 2nd highest pt lepton has Pt > 0
138     if (leptons.size() < 2 || leptons[1]->Pt() <= 0) return;
139    
140     //make sure the 3rd highest pt lepton has pt <= 10.
141     if (leptons.size() >= 3 && leptons[2]->Pt() > 10) return;
142    
143     //needs to pass HLT
144     fNEventsPassedLeptonSelection++;
145    
146     CompositeParticle *dilepton = new CompositeParticle();
147     dilepton->AddDaughter(leptons[0]);
148     dilepton->AddDaughter(leptons[1]);
149    
150     //charge of the leptons should be opposite
151     if (dilepton->Charge() != 0) return;
152    
153     fNEventsPassedKinematicPreselection++;
154    
155     if (fPrintDebug)
156     cerr << "Event Passes PreSelection" << endl;
157    
158     //delta phi between the 2 leptons in degrees
159     double deltaPhiLeptons = MathUtils::DeltaPhi(leptons[0]->Phi(),
160     leptons[1]->Phi())* 360.0 / 2 / TMath::Pi();
161    
162     double deltaEtaLeptons = abs(leptons[0]->Eta() - leptons[1]->Eta()) * 360.0 / 2 / TMath::Pi();
163    
164     double deltaPhiDileptonMet = MathUtils::DeltaPhi(caloMet->Phi(),
165     dilepton->Phi())*360.0 / 2 / TMath::Pi();
166    
167     double mtHiggs = TMath::Sqrt(2.0*dilepton->Pt() * caloMet->Pt()*
168     (1.0 - cos(deltaPhiDileptonMet * 2 * TMath::Pi() / 360.0)));
169    
170     //angle between MET and closest lepton
171     double deltaPhiMetLepton[2] = {MathUtils::DeltaPhi(caloMet->Phi(), leptons[0]->Phi()),
172     MathUtils::DeltaPhi(caloMet->Phi(), leptons[1]->Phi())};
173    
174     double mTW[2] = {TMath::Sqrt(2.0*leptons[0]->Pt()*caloMet->Pt()*
175     (1.0 - cos(deltaPhiMetLepton[0]))),
176     TMath::Sqrt(2.0*leptons[1]->Pt()*caloMet->Pt()*
177     (1.0 - cos(deltaPhiMetLepton[1])))};
178    
179     double minDeltaPhiMetLepton = (deltaPhiMetLepton[0] < deltaPhiMetLepton[1])?
180     deltaPhiMetLepton[0]:deltaPhiMetLepton[1];
181     minDeltaPhiMetLepton = minDeltaPhiMetLepton * 360.0 / 2 / TMath::Pi();
182    
183     //count the number of central Jets for vetoing
184     int nCentralJets = 0;
185     for (UInt_t j=0; j<CleanJets->GetEntries(); j++) {
186     if (fabs(CleanJets->At(j)->Eta()) < 2.5)
187     nCentralJets++;
188     }
189    
190     //study low energy jets + track
191     LoadBranch(fTrackName);
192     LoadBranch(fJetName);
193     int nCentralJetPlusOneTrack = 0;
194     int nCentralJetTrackSumPt = 0;
195     //Get all Tracks not corresponding to leptons
196     ObjArray<Track> *CleanTracks = new ObjArray<Track>;
197     for (UInt_t i=0; i<fTracks->GetEntries(); ++i) {
198     bool TrackIsLepton = false;
199     if (MathUtils::DeltaR(fTracks->At(i)->Eta(),fTracks->At(i)->Phi(),leptons[0]->Eta(),
200     leptons[0]->Phi()) > 0.01 &&
201     MathUtils::DeltaR(fTracks->At(i)->Eta(),fTracks->At(i)->Phi(),leptons[1]->Eta(),
202     leptons[1]->Phi()) > 0.01
203     ) {
204     } else {
205     TrackIsLepton = true;
206     }
207     if (fPrintDebug) {
208     cerr << "Track " << i << " : " << fTracks->At(i)->Pt() << " " << fTracks->At(i)->Eta()
209     << " " << fTracks->At(i)->Phi() << " islepton=" << TrackIsLepton << endl;
210     }
211     if (!TrackIsLepton && fTracks->At(i)->Pt() > 3.0 ) {
212     CleanTracks->Add(fTracks->At(i));
213     }
214     }
215     //Look for low energy jets + track confirmation
216     for (UInt_t i=0; i<fJets->GetEntries(); i++) {
217     if (fabs(fJets->At(i)->Eta()) < 2.5) {
218    
219     //remove overlaps with electrons
220     bool isElectronOverlap = false;
221     for (UInt_t j=0; j<CleanElectrons->GetEntries(); j++) {
222     double deltaR = MathUtils::DeltaR(CleanElectrons->At(j)->Mom(),fJets->At(i)->Mom());
223     if (deltaR < 0.3) {
224     isElectronOverlap = true;
225     break;
226     }
227     }
228     if (isElectronOverlap) continue; //skip if it overlaps with an electron
229     //remove overlap with clean jets
230     bool isCleanJet = false;
231     for(UInt_t j=0; j<CleanJets->GetEntries(); j++){
232     // double deltaR = MathUtils::DeltaR(CleanJets->At(j)->Mom(),fJets->At(i)->Mom());
233     //cerr << "CleanJets->At(j):" << CleanJets->At(j) << " fJets->At(i):" << fJets->At(i) << endl;
234     if (CleanJets->At(j) == fJets->At(i)) {
235     isCleanJet = true;
236     break;
237     }
238     }
239     if (isCleanJet) continue; //skip if it was already a clean jet
240     if (fJets->At(i)->Et() < 10) continue; //skip jets below 10 GeV
241    
242     //find high pt tracks inside these jets
243     double trackSumPt = 0;
244     int NHighPtTracksInsideJet = 0;
245     for (UInt_t j=0; j<CleanTracks->GetEntries(); ++j) {
246     double deltaR = MathUtils::DeltaR(CleanTracks->At(j)->Phi(),CleanTracks->At(j)->Eta(),
247     fJets->At(i)->Phi(),fJets->At(i)->Eta());
248    
249     if (deltaR < 0.5) {
250     trackSumPt += CleanTracks->At(j)->Pt();
251     if (CleanTracks->At(j)->Pt() > 3.0) {
252     NHighPtTracksInsideJet++;
253     if (fPrintDebug) cerr << "HighPtTrack " << j << " " << CleanTracks->At(j)->Pt() << " "
254     << CleanTracks->At(j)->Eta() << " " << CleanTracks->At(j)->Phi() << endl;
255     }
256     }
257     }
258     //at least one high pt track inside
259     if (NHighPtTracksInsideJet >= 1) {
260     nCentralJetPlusOneTrack++;
261     }
262     //track sumpt / jet et > 1.0
263     if (trackSumPt / fJets->At(i)->Et() > 1.0) {
264     nCentralJetTrackSumPt++;
265     }
266    
267     }
268     }
269    
270     const int nCuts = 8;
271     bool passCut[nCuts] = {false, false, false, false,
272     false, false, false, false};
273    
274     if(leptons[0]->Pt() > 7.0 &&
275     leptons[1]->Pt() > 7.0) passCut[0] = true;
276    
277     if(caloMet->Pt() > 30.0 &&
278     dilepton->Mass() > 12.0 &&
279     //nCleanJets < 3 &&
280     leptons[0]->Pt() > 20.0 &&
281     leptons[1]->Pt() > 10.0) passCut[1] = true;
282    
283     if(nCentralJets < 1) passCut[2] = true;
284    
285     if (leptonType[0] == "mu" && leptonType[1] == "mu" ){ // mumu
286     if(caloMet->Pt() > 50.0 &&
287     caloMet->Pt() < 200.0) passCut[3] = true;
288     if(deltaPhiLeptons < 45.0) passCut[4] = true;
289     if(dilepton->Mass() < 50.0) passCut[5] = true;
290     if(leptons[0]->Pt() > 35.0 &&
291     leptons[0]->Pt() < 55.0) passCut[6] = true;
292     if(leptons[1]->Pt() > 25.0) passCut[7] = true;
293     }
294     else if(leptonType[0] == "e" && leptonType[1] == "e"){ // ee
295     if(caloMet->Pt() > 51.0 &&
296     caloMet->Pt() < 200.0) passCut[3] = true;
297     if(deltaPhiLeptons < 45.0) passCut[4] = true;
298     if(dilepton->Mass() < 40.0) passCut[5] = true;
299     if(leptons[0]->Pt() > 25.0 &&
300     leptons[0]->Pt() < 49.0) passCut[6] = true;
301     if(leptons[1]->Pt() > 25.0) passCut[7] = true;
302     }
303     else if((leptonType[0] == "e" && leptonType[1] == "mu") ||
304     (leptonType[0] == "mu" && leptonType[1] == "e")
305     ){ //emu
306     if(caloMet->Pt() > 45.0 &&
307     caloMet->Pt() < 105.0) passCut[3] = true;
308     if(deltaPhiLeptons < 70.0) passCut[4] = true;
309     if(dilepton->Mass() < 45.0) passCut[5] = true;
310     if(leptons[0]->Pt() > 25.0 &&
311     leptons[0]->Pt() < 50.0) passCut[6] = true;
312     if(leptons[1]->Pt() > 25.0) passCut[7] = true;
313     }
314    
315     // Final decision
316     bool allCuts = true;
317     for(int i=0; i<nCuts; i++) allCuts = allCuts & passCut[i];
318    
319    
320     fHWWSelection->Fill(-1);
321     if (leptonType[0] == "mu" && leptonType[1] == "mu" )
322     fHWWToMuMuSelection->Fill(-1);
323     else if(leptonType[0] == "e" && leptonType[1] == "e")
324     fHWWToEESelection->Fill(-1);
325     else if((leptonType[0] == "e" && leptonType[1] == "mu") ||
326     (leptonType[0] == "mu" && leptonType[1] == "e"))
327     fHWWToEMuSelection->Fill(-1);
328    
329     if (fPlotType == "Sequential") {
330     for (int k=0;k<8;k++) {
331     bool pass = true;
332     for (int p=0;p<=k;p++)
333     pass = (pass && passCut[p]);
334    
335     if (pass) {
336     fHWWSelection->Fill(k);
337     if (leptonType[0] == "mu" && leptonType[1] == "mu" )
338     fHWWToMuMuSelection->Fill(k);
339     else if(leptonType[0] == "e" && leptonType[1] == "e")
340     fHWWToEESelection->Fill(k);
341     else if((leptonType[0] == "e" && leptonType[1] == "mu") ||
342     (leptonType[0] == "mu" && leptonType[1] == "e"))
343     fHWWToEMuSelection->Fill(k);
344     }
345    
346     if (k==0 && pass) {
347     fLeptonPtMax->Fill(leptons[0]->Pt());
348     fLeptonPtMin->Fill(leptons[1]->Pt());
349     fLeptonEta->Fill(leptons[0]->Eta());
350     fLeptonEta->Fill(leptons[1]->Eta());
351     }
352    
353     if (k==1 && pass) {
354     fNCentralJets->Fill(nCentralJets);
355     }
356     if (k==2 && pass) {
357     //fMetPtAfterSelectionHist->Fill(caloMet->Pt());
358     }
359     if (k==3 && pass) {
360     fDeltaPhiLeptons->Fill(deltaPhiLeptons);
361     }
362     if (k==4 && pass) {
363     fDileptonMass->Fill(dilepton->Mass());
364     }
365     if (k==5 && pass) {
366     fLepton1Pt_afterCuts->Fill(leptons[0]->Pt());
367     }
368     if (k==6 && pass) {
369     fLepton2Pt_afterCuts->Fill(leptons[1]->Pt());
370     }
371     if (k==7 && pass) {
372     fMetPtAfterSelectionHist->Fill(caloMet->Pt());
373     fMtHiggs->Fill(mtHiggs);
374     fDeltaEtaLeptons->Fill(deltaEtaLeptons);
375     fMinDeltaPhiLeptonMet->Fill(minDeltaPhiMetLepton);
376     fMetSignificanceAfterCuts->Fill(caloMet->MetSig());
377     fSumEtAfterCuts->Fill(caloMet->SumEt());
378     fMtLepton1->Fill(mTW[0]);
379     fMtLepton2->Fill(mTW[1]);
380     fLeptonPtPlusMet->Fill(leptons[0]->Pt()+leptons[1]->Pt()+caloMet->Pt());
381     }
382     }
383    
384     } else if (fPlotType = "N-1") {
385     for (int k=0;k<8;k++) {
386     bool pass = true;
387     for (int p=0;p<=k;p++)
388     pass = (pass && passCut[p]);
389    
390     if (pass) {
391     fHWWSelection->Fill(k);
392     if (leptonType[0] == "mu" && leptonType[1] == "mu" )
393     fHWWToMuMuSelection->Fill(k);
394     else if(leptonType[0] == "e" && leptonType[1] == "e")
395     fHWWToEESelection->Fill(k);
396     else if((leptonType[0] == "e" && leptonType[1] == "mu") ||
397     (leptonType[0] == "mu" && leptonType[1] == "e"))
398     fHWWToEMuSelection->Fill(k);
399     }
400    
401     if (k==0 && pass) {
402     fLeptonPtMax->Fill(leptons[0]->Pt());
403     fLeptonPtMin->Fill(leptons[1]->Pt());
404     fLeptonEta->Fill(leptons[0]->Eta());
405     fLeptonEta->Fill(leptons[1]->Eta());
406     }
407     }
408    
409     //N Jet Veto
410     bool pass = true;
411     for (int k=0;k<8;k++) {
412     if (k != 2) {
413     pass = (pass && passCut[k]);
414     }
415     }
416     if (pass) {
417     fNCentralJets->Fill(nCentralJets);
418     fNCentralJetsPlusOneTrack->Fill(nCentralJetPlusOneTrack);
419     fNCentralJetsTrackSumPt->Fill(nCentralJetTrackSumPt);
420     }
421    
422     // Delta Phi leptons
423     pass = true;
424     for (int k=0;k<8;k++) {
425     if (k != 3)
426     pass = (pass && passCut[k]);
427     }
428     if (pass) {
429     fMetPtHist->Fill(caloMet->Pt());
430     fMetPhiHist->Fill(caloMet->Phi());
431     }
432    
433    
434     // Delta Phi leptons
435     pass = true;
436     for (int k=0;k<8;k++) {
437     if (k != 4)
438     pass = (pass && passCut[k]);
439     }
440     if (pass) {
441     fDeltaPhiLeptons->Fill(deltaPhiLeptons);
442     }
443    
444     //dilepton mass
445     pass = true;
446     for (int k=0;k<8;k++) {
447     if (k != 5)
448     pass = (pass && passCut[k]);
449     }
450     if (pass) {
451     fDileptonMass->Fill(dilepton->Mass());
452     }
453    
454     //Lepton1Pt
455     pass = true;
456     for (int k=0;k<8;k++) {
457     if (k != 6)
458     pass = (pass && passCut[k]);
459     }
460     if (pass) {
461     fLepton1Pt_afterCuts->Fill(leptons[0]->Pt());
462     }
463    
464     //Lepton2Pt
465     pass = true;
466     for (int k=0;k<8;k++) {
467     if (k != 7)
468     pass = (pass && passCut[k]);
469     }
470     if (pass) {
471     fLepton2Pt_afterCuts->Fill(leptons[1]->Pt());
472     }
473    
474     pass = true;
475     for (int k=0;k<8;k++) {
476     pass = (pass && passCut[k]);
477     }
478     if (pass) {
479     fMetPtAfterSelectionHist->Fill(caloMet->Pt());
480     fMtHiggs->Fill(mtHiggs);
481     fDeltaEtaLeptons->Fill(deltaEtaLeptons);
482     fMinDeltaPhiLeptonMet->Fill(minDeltaPhiMetLepton);
483     fMetSignificanceAfterCuts->Fill(caloMet->MetSig());
484     fSumEtAfterCuts->Fill(caloMet->SumEt());
485     fMtLepton1->Fill(mTW[0]);
486     fMtLepton2->Fill(mTW[1]);
487     fLeptonPtPlusMet->Fill(leptons[0]->Pt()+leptons[1]->Pt()+caloMet->Pt());
488     }
489     }
490    
491     if(fPrintDebug)
492     {
493     //print out event content to text
494     cerr << "Electrons" << endl;
495     for (UInt_t i = 0; i < CleanElectrons->GetEntries(); i++) {
496     cerr << i << " " << CleanElectrons->At(i)->Pt() << " "
497     << CleanElectrons->At(i)->Eta() << " " << CleanElectrons->At(i)->Phi()
498     << " " << CleanElectrons->At(i)->ESuperClusterOverP() << endl;
499     }
500    
501     cerr << "Muons" << endl;
502     for (UInt_t i = 0; i < CleanMuons->GetEntries(); i++) {
503     cerr << i << " " << CleanMuons->At(i)->Pt() << " " << CleanMuons->At(i)->Eta()
504     << " " << CleanMuons->At(i)->Phi() << endl;
505     }
506    
507     cerr << "Jets" << endl;
508     for (UInt_t i = 0; i < CleanJets->GetEntries(); i++) {
509     cerr << i << " " << CleanJets->At(i)->Pt() << " "
510     << CleanJets->At(i)->Eta() << " " << CleanJets->At(i)->Phi() << endl;
511     }
512    
513     cerr << "CorrectedMET" << endl;
514     cerr << caloMet->Pt() << " " << caloMet->Eta() << " " << caloMet->Phi() << endl;
515     }
516    
517     }
518     //--------------------------------------------------------------------------------------------------
519     void HwwEvtSelMod::SlaveBegin()
520     {
521     // Run startup code on the computer (slave) doing the actual analysis. Here,
522     // we typically initialize histograms and other analysis objects and request
523     // branches. For this module, we request a branch of the MitTree.
524    
525     ReqBranch(fMetName, fMet);
526     ReqBranch(fMCPartName, fParticles);
527     ReqBranch(fTrackName, fTracks);
528     ReqBranch(fJetName, fJets);
529    
530     fMetPtHist = new TH1D("hMetPtHist",";Met;Number of Events",150,0.,300.);
531     fMetPhiHist = new TH1D("hMetPhiHist",";#phi;Number of Events",28,-3.5,3.5);
532     fMetPtAfterSelectionHist = new TH1D("hMetPtAfterSelectionHist",";p_{t};Number of Events",150,0.,300.);
533     fMetPhiAfterSelectionHist = new TH1D("hMetPhiAfterSelectionHist",";#phi;Number of Events",28,-3.5,3.5);
534     fMetSignificanceAfterCuts = new TH1D("hMetSignificanceAfterCuts",
535     ";MetSignificanceAfterCuts;Number of Events",100,0.,20.);
536     fSumEtAfterCuts = new TH1D("hSumEtAfterCuts",";SumEt;Number of Events",100,0.,500.);
537     AddOutput(fMetPhiHist);
538     AddOutput(fMetPtHist);
539     AddOutput(fMetPtAfterSelectionHist);
540     AddOutput(fMetPhiAfterSelectionHist);
541     AddOutput(fMetSignificanceAfterCuts);
542     AddOutput(fSumEtAfterCuts);
543    
544     fNCentralJets = new TH1D("hNCentralJets",";Number of Central Jets;Number of Events",6,-0.5,5.5);
545     fNForwardJets = new TH1D("hNForwardJets",";Number of Forward Jets;Number of Events",20,0,20);
546     fNCentralJetsPlusOneTrack = new TH1D("hNCentralJetsPlusOneTrack",";Number of Central Jets Plus One Track;Number of Events",6,-0.5,5.5);
547     fNCentralJetsTrackSumPt = new TH1D("hNCentralJetsTrackSumPt",";Number of Central Jets with TrackSumPt/Et > 1.0 ;Number of Events",6,-0.5,5.5);
548     fVBFJetPt = new TH1D("hVBFJetPt",";VBF Tagged Jet Pt;Number of Events",40,0,200);
549     fVBFJetEta = new TH1D("hVBFJetEta",";VBF Tagged Jet Eta;Number of Events",33,-8,8);
550     fDeltaEtaVBFJets = new TH1D("hDeltaEtaVBFJets",
551     ";#Delta#eta between the two VBF Tagged Jets;Number of Events",20,0,10);
552     AddOutput(fNCentralJets);
553     AddOutput(fNForwardJets);
554     AddOutput(fNCentralJetsPlusOneTrack);
555     AddOutput(fNCentralJetsTrackSumPt);
556     AddOutput(fVBFJetPt);
557     AddOutput(fVBFJetEta);
558     AddOutput(fDeltaEtaVBFJets);
559    
560     fDeltaPhiLeptons = new TH1D("hDeltaPhiLeptons",";#Delta#phi_{ll};Number of Events",90,0,180);
561     fDeltaEtaLeptons = new TH1D("hDeltaEtaLeptons",";#Delta#eta_{ll};Number of Events",90,0.,180);
562     fDileptonMass = new TH1D("hDileptonMass",";Mass_{ll};Number of Events",150,0.,300.);
563     fLeptonPtMax = new TH1D("hLeptonPtMax",";Lepton P_t Max;Number of Events",150,0.,150.);
564     fLeptonPtMin = new TH1D("hLeptonPtMin",";Lepton P_t Min;Number of Events",150,0.,150.);
565     fLeptonEta = new TH1D("hLeptonEta",";LeptonEta;Number of Events",100,-5.,5.0);
566     AddOutput(fDeltaPhiLeptons);
567     AddOutput(fDeltaEtaLeptons);
568     AddOutput(fDileptonMass);
569     AddOutput(fLeptonPtMax);
570     AddOutput(fLeptonPtMin);
571     AddOutput(fLeptonEta);
572    
573     fLepton1Pt_afterCuts = new TH1D("hLepton1Pt_afterCuts",";Lepton1Pt_afterCuts;Number of Events",150,0.,150.);
574     fLepton2Pt_afterCuts = new TH1D("hLepton2Pt_afterCuts",";Lepton2Pt_afterCuts;Number of Events",150,0.,150.);
575     fMinDeltaPhiLeptonMet = new TH1D("hMinDeltaPhiLeptonMet",
576     ";Min #Delta#phi_{l,Met};Number of Events",90,0.,180);
577     AddOutput(fLepton1Pt_afterCuts);
578     AddOutput(fLepton2Pt_afterCuts);
579     AddOutput(fMinDeltaPhiLeptonMet);
580    
581     fMtLepton1 = new TH1D("hMtLepton1",";M_t (Lepton1,Met);Number of Events",100,0.,200.);
582     AddOutput(fMtLepton1);
583     fMtLepton2 = new TH1D("hMtLepton2",";M_t (Lepton2,Met);Number of Events",100,0.,200.);
584     AddOutput(fMtLepton2);
585     fMtHiggs = new TH1D("hMtHiggs",";M_t (l1+l2+Met);Number of Events",150,0.,300.);
586     AddOutput(fMtHiggs);
587    
588     fpTTot = new TH1D("hpTTot",";p_T Total;Number of Events",20,0.,200.);
589     AddOutput(fpTTot);
590    
591     fLeptonPtPlusMet = new TH1D("hLeptonPtPlusMet",";LeptonPtPlusMet;Number of Events",150,0.,300.);
592     AddOutput(fLeptonPtPlusMet);
593    
594     fHWWSelection = new TH1D("hHWWSelection", ";Cut Number;Number of Events", 9, -1.5, 7.5);
595     fHWWToEESelection = new TH1D("hHWWToEESelection", ";Cut Number;Number of Events", 9, -1.5, 7.5);
596     fHWWToMuMuSelection = new TH1D("hHWWToMuMuSelection", ";Cut Number;Number of Events", 9, -1.5, 7.5);
597     fHWWToEMuSelection = new TH1D("hHWWToEMuSelection", ";Cut Number;Number of Events", 9, -1.5, 7.5);
598     AddOutput(fHWWSelection);
599     AddOutput(fHWWToEESelection);
600     AddOutput(fHWWToMuMuSelection);
601     AddOutput(fHWWToEMuSelection);
602     }
603    
604     //--------------------------------------------------------------------------------------------------
605     void HwwEvtSelMod::SlaveTerminate()
606     {
607     // Run finishing code on the computer (slave) that did the analysis. For this
608     // module, we dont do anything here.
609    
610     cerr << "Events Inside Acceptance: " << fNEventsInsideAcceptance << endl;
611     cerr << "Events Processed: " << fNEventsProcessed << endl;
612     cerr << "Events Passed Skim: " << fNEventsPassedSkim << endl;
613     cerr << "Events Passed LeptonSelection: " << fNEventsPassedLeptonSelection << endl;
614     cerr << "Events Passed KinematicPreselection: " << fNEventsPassedKinematicPreselection << endl;
615    
616     cerr << "For All" << endl;
617     for (int i=1;i<=9;i++) {
618     double CutEff = (i>1)?fHWWSelection->GetBinContent(i)/fHWWSelection->GetBinContent(i-1):1.0;
619     cerr << "After Cut" << i-2 << " : " << fHWWSelection->GetBinContent(i)
620     << " Efficiency of this Cut : " << CutEff << endl;
621     }
622    
623     cerr << "For ee" << endl;
624     for (int i=1;i<=9;i++) {
625     double CutEff = (i>1)?fHWWToEESelection->GetBinContent(i)/fHWWToEESelection->
626     GetBinContent(i-1):1.0;
627     cerr << "After Cut" << i-2 << " : " << fHWWToEESelection->GetBinContent(i)
628     << " Efficiency of this Cut : " << CutEff << endl;
629     }
630    
631     cerr << "For mumu" << endl;
632     for (int i=1;i<=9;i++) {
633     double CutEff = (i>1)?fHWWToMuMuSelection->GetBinContent(i)/fHWWToMuMuSelection->
634     GetBinContent(i-1):1.0;
635     cerr << "After Cut" << i-2 << " : " << fHWWToMuMuSelection->GetBinContent(i)
636     << " Efficiency of this Cut : " << CutEff << endl;
637     }
638    
639     cerr << "For emu" << endl;
640     for (int i=1;i<=9;i++) {
641     double CutEff = (i>1)?fHWWToEMuSelection->GetBinContent(i)/fHWWToEMuSelection->
642     GetBinContent(i-1):1.0;
643     cerr << "After Cut" << i-2 << " : " << fHWWToEMuSelection->GetBinContent(i)
644     << " Efficiency of this Cut : " << CutEff << endl;
645     }
646    
647     }
648    
649     //--------------------------------------------------------------------------------------------------
650     void HwwEvtSelMod::Terminate()
651     {
652     // Run finishing code on the client computer. For this module, we dont do
653     // anything here.
654     }