ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.4
Committed: Tue Nov 11 21:22:54 2008 UTC (16 years, 5 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.3: +9 -3 lines
Log Message:
adding some plots, fixing details

File Contents

# User Rev Content
1 ceballos 1.4 // $Id: GeneratorMod.cc,v 1.3 2008/11/05 14:06:09 ceballos Exp $
2 loizides 1.1
3     #include "MitPhysics/Mods/interface/GeneratorMod.h"
4     #include "MitAna/DataTree/interface/Names.h"
5     #include "MitAna/DataCont/interface/ObjArray.h"
6     #include "MitCommon/MathTools/interface/MathUtils.h"
7     #include <TH1D.h>
8     #include <TH2D.h>
9    
10    
11     using namespace mithep;
12    
13     ClassImp(mithep::GeneratorMod)
14    
15     //--------------------------------------------------------------------------------------------------
16     GeneratorMod::GeneratorMod(const char *name, const char *title) :
17     BaseMod(name,title),
18     fPrintDebug(false),
19     fFillHist(false),
20     fIsMC(true),
21     fMCPartName(Names::gkMCPartBrn),
22     fMCLeptonsName(Names::gkMCLeptonsName),
23 ceballos 1.3 fMCAllLeptonsName(Names::gkMCAllLeptonsName),
24 loizides 1.1 fMCTausName(Names::gkMCTausName),
25     fMCNeutrinosName(Names::gkMCNeutrinosName),
26     fMCQuarksName(Names::gkMCQuarksName),
27     fMCqqHsName(Names::gkMCqqHsName),
28     fMCBosonsName(Names::gkMCBosonsName),
29     fParticles(0),
30     fNEventsProcessed(0)
31     {
32     // Constructor.
33     }
34    
35     //--------------------------------------------------------------------------------------------------
36     void GeneratorMod::Begin()
37     {
38     // Run startup code on the client machine. For this module, we dont do
39     // anything here.
40     }
41    
42     //--------------------------------------------------------------------------------------------------
43     void GeneratorMod::Process()
44     {
45     // Process entries of the tree
46     fNEventsProcessed++;
47    
48     if (fNEventsProcessed % 1000 == 0 || fPrintDebug) {
49     time_t systime;
50     systime = time(NULL);
51 ceballos 1.4 cout << "GeneratorMod : Process Event " << fNEventsProcessed << " Time: "
52 loizides 1.1 << ctime(&systime) << endl;
53     }
54    
55     // These arrays will be filled in the loop of particles
56 ceballos 1.3 ObjArray<MCParticle> *GenLeptons = new ObjArray<MCParticle>;
57     ObjArray<MCParticle> *GenAllLeptons = new ObjArray<MCParticle>;
58     ObjArray<MCParticle> *GenTaus = new ObjArray<MCParticle>; GenTaus->SetOwner(true);
59     ObjArray<MCParticle> *GenNeutrinos = new ObjArray<MCParticle>;
60     ObjArray<MCParticle> *GenQuarks = new ObjArray<MCParticle>;
61     ObjArray<MCParticle> *GenqqHs = new ObjArray<MCParticle>;
62     ObjArray<MCParticle> *GenBosons = new ObjArray<MCParticle>;
63 loizides 1.1
64 ceballos 1.4 // Counting events
65     hDEvents->Fill(0.0);
66    
67 loizides 1.1 if(fIsMC == true){
68     // Get Generator Level information branch
69     LoadBranch(fMCPartName);
70     bool isqqH = false;
71     for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
72     MCParticle* p = fParticles->At(i);
73    
74     if(!p->IsGenerated()) continue;
75    
76     // muons/electrons from W/Z decays
77     if((p->AbsPdgId() == 11 || p->AbsPdgId() == 13) && p->Status() == 1){
78 ceballos 1.3 if(p->Pt() > 3.0 && fabs(p->Eta()) < 3.0){
79     GenAllLeptons->Add(p);
80     }
81 loizides 1.1 bool isGoodLepton = false;
82     MCParticle* pm = p;
83     while (pm->HasMother() && isGoodLepton == false){
84     if (pm->Mother()->AbsPdgId() == 23 || pm->Mother()->AbsPdgId() == 24){
85     GenLeptons->Add(p);
86     isGoodLepton = true;
87     }
88     else if(pm->Mother()->AbsPdgId() == 111 || pm->Mother()->AbsPdgId() == 221){
89     // This is fake, but it is a trick to get rid of these cases
90     isGoodLepton = true;
91     }
92     else {
93     pm = (MCParticle *)pm->Mother();
94     }
95     }
96     }
97    
98     // taus
99     else if(p->AbsPdgId() == 16 && p->Status() == 1){
100     if(p->DistinctMother()){
101     MCParticle* pm = (mithep::MCParticle*)p->DistinctMother();
102     if(pm->AbsPdgId() == 15){
103     MCParticle* pm_f = new MCParticle(*pm);
104     pm_f->SetMom(pm->Px()-p->Px(), pm->Py()-p->Py(),
105     pm->Pz()-p->Pz(), pm->E()-p->E());
106     GenTaus->Add(pm_f);
107     }
108     }
109     }
110    
111     // neutrinos
112     else if(p->Status() == 1 &&
113     (p->AbsPdgId() == 12 || p->AbsPdgId() == 14 || p->AbsPdgId() == 16)){
114     GenNeutrinos->Add(p);
115     }
116    
117     // quarks from W/Z decays or top particles
118     else if(p->AbsPdgId() >=1 && p->AbsPdgId() <=6 && p->HasMother()){
119     if(p->Mother()->AbsPdgId() == 23 || p->Mother()->AbsPdgId() == 24 ||
120     p->AbsPdgId() == 6 || p->Mother()->AbsPdgId() == 6){
121     GenQuarks->Add(p);
122     }
123     }
124    
125     // qqH, information about the forward jets
126     else if(isqqH == false && p->AbsPdgId() == 25){
127     isqqH = true;
128     MCParticle* pq1 = fParticles->At(i-1);
129     MCParticle* pq2 = fParticles->At(i-2);
130    
131     if(pq1->HasMother() && pq2->HasMother() &&
132     pq1->Mother()->PdgId() == p->Mother()->PdgId() &&
133     pq2->Mother()->PdgId() == p->Mother()->PdgId() &&
134     pq1->AbsPdgId() < 7 && pq2->AbsPdgId() < 7 &&
135     pq1->AbsPdgId() > 0 && pq2->AbsPdgId() > 0){
136     GenqqHs->Add(pq1);
137     GenqqHs->Add(pq2);
138     }
139     }
140    
141     // information about bosons: W, Z, h, Z', W', H0, A0, H+
142     else if(p->Status() == 2 &&
143     (p->AbsPdgId() == 23 || p->AbsPdgId() == 24 || p->AbsPdgId() == 25 ||
144     p->AbsPdgId() == 32 || p->AbsPdgId() == 34 ||
145     p->AbsPdgId() == 35 || p->AbsPdgId() == 36 || p->AbsPdgId() == 37)){
146     GenBosons->Add(p);
147     }
148     }
149     } // IsMC?
150    
151     //Save Objects for Other Modules to use
152 ceballos 1.3 AddObjThisEvt(GenLeptons, fMCLeptonsName.Data());
153     AddObjThisEvt(GenAllLeptons,fMCAllLeptonsName.Data());
154     AddObjThisEvt(GenTaus, fMCTausName.Data());
155     AddObjThisEvt(GenNeutrinos, fMCNeutrinosName.Data());
156     AddObjThisEvt(GenQuarks, fMCQuarksName.Data());
157     AddObjThisEvt(GenqqHs, fMCqqHsName.Data());
158     AddObjThisEvt(GenBosons, fMCBosonsName.Data());
159 loizides 1.1
160     // Fill histograms
161     if(fFillHist == true){
162     // Leptons
163     hDGenLeptons[0]->Fill(GenLeptons->GetEntries());
164     int idxMaxLep[2] = {-1, -1};
165     double ptMaxLep[2] = {-1.0, -1.0};
166     for(UInt_t i=0; i<GenLeptons->GetEntries(); i++){
167     hDGenLeptons[1]->Fill(GenLeptons->At(i)->Pt());
168     hDGenLeptons[2]->Fill(fabs(GenLeptons->At(i)->Eta()));
169     hDGenLeptons[3]->Fill(GenLeptons->At(i)->Phi() * 180. / TMath::Pi());
170     for(UInt_t j=i+1; j<GenLeptons->GetEntries(); j++){
171     CompositeParticle *dilepton = new CompositeParticle();
172     dilepton->AddDaughter(GenLeptons->At(i));
173     dilepton->AddDaughter(GenLeptons->At(j));
174     hDGenLeptons[4]->Fill(dilepton->Mass());
175     delete dilepton;
176     }
177     // Selecting the two highest Pt leptons
178     if (GenLeptons->At(i)->Pt() > ptMaxLep[0]){
179     ptMaxLep[1] = ptMaxLep[0];
180     idxMaxLep[1] = idxMaxLep[0];
181     ptMaxLep[0] = GenLeptons->At(i)->Pt();
182     idxMaxLep[0] = i;
183     }
184     else if(GenLeptons->At(i)->Pt() > ptMaxLep[1]){
185     ptMaxLep[1] = GenLeptons->At(i)->Pt();
186     idxMaxLep[1] = i;
187     }
188     }
189     // Looking at events with at least two leptons
190     if(ptMaxLep[0] > 0 && ptMaxLep[1] > 0){
191     hDGenLeptons[5]->Fill(TMath::Min(TMath::Max(fabs(GenLeptons->At(idxMaxLep[0])->Eta()),
192     fabs(GenLeptons->At(idxMaxLep[1])->Eta())),4.999));
193     hDGenLeptons[6]->Fill(TMath::Min(TMath::Min(fabs(GenLeptons->At(idxMaxLep[0])->Eta()),
194     fabs(GenLeptons->At(idxMaxLep[1])->Eta())),4.999));
195     if(fabs(GenLeptons->At(idxMaxLep[0])->Eta()) < 2.5 &&
196     fabs(GenLeptons->At(idxMaxLep[1])->Eta()) < 2.5){
197     hDGenLeptons[7]->Fill(TMath::Min(GenLeptons->At(idxMaxLep[0])->Pt(),199.999));
198     if(GenLeptons->At(idxMaxLep[0])->Pt() > 20.0){
199     hDGenLeptons[8]->Fill(TMath::Min(GenLeptons->At(idxMaxLep[1])->Pt(),199.999));
200     if(GenLeptons->At(idxMaxLep[1])->Pt() > 10.0){
201     CompositeParticle *dilepton = new CompositeParticle();
202     dilepton->AddDaughter(GenLeptons->At(idxMaxLep[0]));
203     dilepton->AddDaughter(GenLeptons->At(idxMaxLep[1]));
204     hDGenLeptons[9]->Fill(TMath::Min(dilepton->Mass(),999.999));
205     hDGenLeptons[10]->Fill(MathUtils::DeltaPhi(GenLeptons->At(idxMaxLep[0])->Phi(),
206     GenLeptons->At(idxMaxLep[1])->Phi())
207     * 180./ TMath::Pi());
208     delete dilepton;
209     }
210     }
211     }
212     }
213    
214 ceballos 1.3 // All Leptons
215     hDGenAllLeptons[0]->Fill(GenAllLeptons->GetEntries());
216     for(UInt_t i=0; i<GenAllLeptons->GetEntries(); i++){
217     hDGenAllLeptons[1]->Fill(GenAllLeptons->At(i)->Pt());
218     hDGenAllLeptons[2]->Fill(GenAllLeptons->At(i)->Eta());
219     hDGenAllLeptons[3]->Fill(GenAllLeptons->At(i)->Phi() * 180. / TMath::Pi());
220     }
221    
222 loizides 1.1 // Taus
223     hDGenTaus[0]->Fill(GenTaus->GetEntries());
224     for(UInt_t i=0; i<GenTaus->GetEntries(); i++){
225     hDGenTaus[1]->Fill(GenTaus->At(i)->Pt());
226     hDGenTaus[2]->Fill(GenTaus->At(i)->Eta());
227     hDGenTaus[3]->Fill(GenTaus->At(i)->Phi() * 180. / TMath::Pi());
228     }
229    
230     // Neutrinos
231     hDGenNeutrinos[0]->Fill(GenNeutrinos->GetEntries());
232     CompositeParticle *neutrinoTotal = new CompositeParticle();
233     for(UInt_t i=0; i<GenNeutrinos->GetEntries(); i++){
234     if(GenNeutrinos->At(i)->HasMother())
235     neutrinoTotal->AddDaughter(GenNeutrinos->At(i));
236     }
237     if(GenNeutrinos->GetEntries() > 0){
238     hDGenNeutrinos[1]->Fill(neutrinoTotal->Pt());
239     hDGenNeutrinos[2]->Fill(neutrinoTotal->Eta());
240     hDGenNeutrinos[3]->Fill(neutrinoTotal->Phi() * 180./ TMath::Pi());
241     }
242     delete neutrinoTotal;
243    
244     // Quarks
245     hDGenQuarks[0]->Fill(GenQuarks->GetEntries());
246     for(UInt_t i=0; i<GenQuarks->GetEntries(); i++){
247     for(UInt_t j=i+1; j<GenQuarks->GetEntries(); j++){
248     CompositeParticle *dijet = new CompositeParticle();
249     dijet->AddDaughter(GenQuarks->At(i));
250     dijet->AddDaughter(GenQuarks->At(j));
251     hDGenQuarks[1]->Fill(dijet->Pt());
252     hDGenQuarks[2]->Fill(dijet->Mass());
253     if(fabs(GenQuarks->At(i)->Eta()) < 2.5 && fabs(GenQuarks->At(j)->Eta()) < 2.5){
254     hDGenQuarks[3]->Fill(dijet->Pt());
255     hDGenQuarks[4]->Fill(dijet->Mass());
256     }
257     delete dijet;
258     }
259 ceballos 1.2 // b quark info
260     if (GenQuarks->At(i)->AbsPdgId() == 5){
261     hDGenQuarks[5]->Fill(GenQuarks->At(i)->Pt());
262     hDGenQuarks[6]->Fill(GenQuarks->At(i)->Eta());
263     hDGenQuarks[7]->Fill(GenQuarks->At(i)->Phi());
264     if(ptMaxLep[0] > 20 && ptMaxLep[1] > 15){
265     if(fabs(GenLeptons->At(idxMaxLep[0])->Eta()) < 2.5 &&
266     fabs(GenLeptons->At(idxMaxLep[1])->Eta()) < 2.5){
267     hDGenQuarks[8]->Fill(GenQuarks->At(i)->Pt());
268     hDGenQuarks[9]->Fill(GenQuarks->At(i)->Eta());
269     hDGenQuarks[10]->Fill(GenQuarks->At(i)->Phi());
270     }
271     }
272     }
273     // t quark info
274     else if(GenQuarks->At(i)->AbsPdgId() == 6){
275     hDGenQuarks[11]->Fill(GenQuarks->At(i)->Pt());
276     hDGenQuarks[12]->Fill(GenQuarks->At(i)->Eta());
277     hDGenQuarks[13]->Fill(GenQuarks->At(i)->Phi());
278     }
279     // light quark info
280     else {
281     hDGenQuarks[14]->Fill(GenQuarks->At(i)->Pt());
282     hDGenQuarks[15]->Fill(GenQuarks->At(i)->Eta());
283     hDGenQuarks[16]->Fill(GenQuarks->At(i)->Phi());
284     }
285 loizides 1.1 }
286    
287     // WBF
288     if(GenqqHs->GetEntries() == 2){
289     hDGenWBF[0]->Fill(MathUtils::DeltaPhi(GenqqHs->At(0)->Phi(),
290     GenqqHs->At(1)->Phi()) * 180./ TMath::Pi());
291     hDGenWBF[1]->Fill(fabs(GenqqHs->At(0)->Eta()-GenqqHs->At(1)->Eta()));
292     hDGenWBF[2]->Fill(TMath::Max(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
293     hDGenWBF[3]->Fill(TMath::Min(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
294     CompositeParticle *diqq = new CompositeParticle();
295     diqq->AddDaughter(GenqqHs->At(0));
296     diqq->AddDaughter(GenqqHs->At(1));
297     hDGenWBF[4]->Fill(diqq->Mass());
298     delete diqq;
299     }
300    
301     // Bosons
302     hDGenBosons[0]->Fill(GenBosons->GetEntries());
303     for(UInt_t i=0; i<GenBosons->GetEntries(); i++){
304     hDGenBosons[1]->Fill(GenBosons->At(i)->Pt());
305     hDGenBosons[2]->Fill(GenBosons->At(i)->Eta());
306     hDGenBosons[3]->Fill(GenBosons->At(i)->Mass());
307     }
308     }
309    
310     }
311    
312     //--------------------------------------------------------------------------------------------------
313     void GeneratorMod::SlaveBegin()
314     {
315     // Run startup code on the computer (slave) doing the actual analysis. Here,
316     // we typically initialize histograms and other analysis objects and request
317     // branches. For this module, we request a branch of the MitTree.
318     ReqBranch(fMCPartName, fParticles);
319    
320     // Fill histograms
321 ceballos 1.4 // All events is always filled
322     char sb[200];
323     sprintf(sb,"hDEvents"); hDEvents = new TH1D(sb,sb,1,-0.5,0.5);
324     AddOutput(hDEvents);
325 loizides 1.1 if(fFillHist == true){
326 ceballos 1.3 // Leptons
327 loizides 1.1 sprintf(sb,"hDGenLeptons_%d", 0); hDGenLeptons[0] = new TH1D(sb,sb,10,-0.5,9.5);
328     sprintf(sb,"hDGenLeptons_%d", 1); hDGenLeptons[1] = new TH1D(sb,sb,100,0.0,200.0);
329     sprintf(sb,"hDGenLeptons_%d", 2); hDGenLeptons[2] = new TH1D(sb,sb,50,0.0,5.0);
330     sprintf(sb,"hDGenLeptons_%d", 3); hDGenLeptons[3] = new TH1D(sb,sb,90,0.0,180.0);
331     sprintf(sb,"hDGenLeptons_%d", 4); hDGenLeptons[4] = new TH1D(sb,sb,1000,0.0,1000.0);
332     sprintf(sb,"hDGenLeptons_%d", 5); hDGenLeptons[5] = new TH1D(sb,sb,50,0.0,5.0);
333     sprintf(sb,"hDGenLeptons_%d", 6); hDGenLeptons[6] = new TH1D(sb,sb,50,0.0,5.0);
334     sprintf(sb,"hDGenLeptons_%d", 7); hDGenLeptons[7] = new TH1D(sb,sb,100,0.0,200.0);
335     sprintf(sb,"hDGenLeptons_%d", 8); hDGenLeptons[8] = new TH1D(sb,sb,100,0.0,200.0);
336     sprintf(sb,"hDGenLeptons_%d", 9); hDGenLeptons[9] = new TH1D(sb,sb,1000,0.0,1000.0);
337     sprintf(sb,"hDGenLeptons_%d",10); hDGenLeptons[10] = new TH1D(sb,sb,90,0.0,180.0);
338     for(int i=0; i<11; i++) AddOutput(hDGenLeptons[i]);
339    
340 ceballos 1.3 // AllLeptons
341     sprintf(sb,"hDGenAllLeptons_%d", 0); hDGenAllLeptons[0] = new TH1D(sb,sb,10,-0.5,9.5);
342     sprintf(sb,"hDGenAllLeptons_%d", 1); hDGenAllLeptons[1] = new TH1D(sb,sb,100,0.0,200.0);
343     sprintf(sb,"hDGenAllLeptons_%d", 2); hDGenAllLeptons[2] = new TH1D(sb,sb,60,-3.0,3.0);
344     sprintf(sb,"hDGenAllLeptons_%d", 3); hDGenAllLeptons[3] = new TH1D(sb,sb,90,0.0,180.0);
345     for(int i=0; i<4; i++) AddOutput(hDGenAllLeptons[i]);
346    
347 loizides 1.1 // Taus
348     sprintf(sb,"hDGenTaus_%d", 0); hDGenTaus[0] = new TH1D(sb,sb,10,-0.5,9.5);
349     sprintf(sb,"hDGenTaus_%d", 1); hDGenTaus[1] = new TH1D(sb,sb,100,0.0,200.0);
350     sprintf(sb,"hDGenTaus_%d", 2); hDGenTaus[2] = new TH1D(sb,sb,100,-5.0,5.0);
351     sprintf(sb,"hDGenTaus_%d", 3); hDGenTaus[3] = new TH1D(sb,sb,90,0.0,180.0);
352     for(int i=0; i<4; i++) AddOutput(hDGenTaus[i]);
353    
354     // Neutrinos
355     sprintf(sb,"hDGenNeutrinos_%d", 0); hDGenNeutrinos[0] = new TH1D(sb,sb,10,-0.5,9.5);
356     sprintf(sb,"hDGenNeutrinos_%d", 1); hDGenNeutrinos[1] = new TH1D(sb,sb,100,0.0,200.0);
357     sprintf(sb,"hDGenNeutrinos_%d", 2); hDGenNeutrinos[2] = new TH1D(sb,sb,100,-5.0,5.0);
358     sprintf(sb,"hDGenNeutrinos_%d", 3); hDGenNeutrinos[3] = new TH1D(sb,sb,90,0.0,180.0);
359     for(int i=0; i<4; i++) AddOutput(hDGenNeutrinos[i]);
360    
361     // Quarks
362     sprintf(sb,"hDGenQuarks_%d", 0); hDGenQuarks[0] = new TH1D(sb,sb,10,-0.5,9.5);
363     sprintf(sb,"hDGenQuarks_%d", 1); hDGenQuarks[1] = new TH1D(sb,sb,200,0.0,400.);
364     sprintf(sb,"hDGenQuarks_%d", 2); hDGenQuarks[2] = new TH1D(sb,sb,2000,0.0,2000.);
365     sprintf(sb,"hDGenQuarks_%d", 3); hDGenQuarks[3] = new TH1D(sb,sb,200,0.0,400.);
366     sprintf(sb,"hDGenQuarks_%d", 4); hDGenQuarks[4] = new TH1D(sb,sb,2000,0.0,2000.);
367 ceballos 1.2 sprintf(sb,"hDGenQuarks_%d", 5); hDGenQuarks[5] = new TH1D(sb,sb,200,0.0,400.);
368     sprintf(sb,"hDGenQuarks_%d", 6); hDGenQuarks[6] = new TH1D(sb,sb,200,-10.0,10.);
369     sprintf(sb,"hDGenQuarks_%d", 7); hDGenQuarks[7] = new TH1D(sb,sb,200,-TMath::Pi(),TMath::Pi());
370     sprintf(sb,"hDGenQuarks_%d", 8); hDGenQuarks[8] = new TH1D(sb,sb,200,0.0,400.);
371     sprintf(sb,"hDGenQuarks_%d", 9); hDGenQuarks[9] = new TH1D(sb,sb,200,-10.0,10.);
372     sprintf(sb,"hDGenQuarks_%d",10); hDGenQuarks[10] = new TH1D(sb,sb,200,-TMath::Pi(),TMath::Pi());
373     sprintf(sb,"hDGenQuarks_%d",11); hDGenQuarks[11] = new TH1D(sb,sb,200,0.0,400.);
374     sprintf(sb,"hDGenQuarks_%d",12); hDGenQuarks[12] = new TH1D(sb,sb,200,-10.0,10.);
375     sprintf(sb,"hDGenQuarks_%d",13); hDGenQuarks[13] = new TH1D(sb,sb,200,-TMath::Pi(),TMath::Pi());
376     sprintf(sb,"hDGenQuarks_%d",14); hDGenQuarks[14] = new TH1D(sb,sb,200,0.0,400.);
377     sprintf(sb,"hDGenQuarks_%d",15); hDGenQuarks[15] = new TH1D(sb,sb,200,-10.0,10.);
378     sprintf(sb,"hDGenQuarks_%d",16); hDGenQuarks[16] = new TH1D(sb,sb,200,-TMath::Pi(),TMath::Pi());
379     for(int i=0; i<17; i++) AddOutput(hDGenQuarks[i]);
380 loizides 1.1
381     // qqH
382     sprintf(sb,"hDGenWBF_%d", 0); hDGenWBF[0] = new TH1D(sb,sb,90,0.0,180.);
383     sprintf(sb,"hDGenWBF_%d", 1); hDGenWBF[1] = new TH1D(sb,sb,100,0.0,10.);
384     sprintf(sb,"hDGenWBF_%d", 2); hDGenWBF[2] = new TH1D(sb,sb,200,0.0,400.);
385     sprintf(sb,"hDGenWBF_%d", 3); hDGenWBF[3] = new TH1D(sb,sb,200,0.0,400.);
386     sprintf(sb,"hDGenWBF_%d", 4); hDGenWBF[4] = new TH1D(sb,sb,200,0.0,4000.);
387     for(int i=0; i<5; i++) AddOutput(hDGenWBF[i]);
388    
389     // Bosons
390     sprintf(sb,"hDGenBosons_%d", 0); hDGenBosons[0] = new TH1D(sb,sb,10,-0.5,9.5);
391     sprintf(sb,"hDGenBosons_%d", 1); hDGenBosons[1] = new TH1D(sb,sb,200,0.0,400.0);
392     sprintf(sb,"hDGenBosons_%d", 2); hDGenBosons[2] = new TH1D(sb,sb,100,-5.0,5.0);
393     sprintf(sb,"hDGenBosons_%d", 3); hDGenBosons[3] = new TH1D(sb,sb,2000,0.0,2000.0);
394     for(int i=0; i<4; i++) AddOutput(hDGenBosons[i]);
395     }
396     }
397    
398     //--------------------------------------------------------------------------------------------------
399     void GeneratorMod::SlaveTerminate()
400     {
401     // Run finishing code on the computer (slave) that did the analysis. For this
402     // module, we dont do anything here.
403    
404 ceballos 1.2 cout << "Total Number of Processed Events: " << fNEventsProcessed << endl;
405    
406 loizides 1.1 }
407    
408     //--------------------------------------------------------------------------------------------------
409     void GeneratorMod::Terminate()
410     {
411     // Run finishing code on the client computer. For this module, we dont do
412     // anything here.
413     }