ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.35
Committed: Sun Apr 19 15:57:26 2009 UTC (16 years ago) by sixie
Content type: text/plain
Branch: MAIN
Changes since 1.34: +36 -7 lines
Log Message:
Fix small bug with madgraph Z decay section

File Contents

# User Rev Content
1 sixie 1.35 // $Id: GeneratorMod.cc,v 1.34 2009/04/19 13:55:34 ceballos Exp $
2 loizides 1.1
3     #include "MitPhysics/Mods/interface/GeneratorMod.h"
4     #include "MitCommon/MathTools/interface/MathUtils.h"
5 loizides 1.8 #include "MitPhysics/Init/interface/ModNames.h"
6 loizides 1.1 #include <TH1D.h>
7     #include <TH2D.h>
8    
9     using namespace mithep;
10    
11     ClassImp(mithep::GeneratorMod)
12    
13     //--------------------------------------------------------------------------------------------------
14 loizides 1.8 GeneratorMod::GeneratorMod(const char *name, const char *title) :
15 loizides 1.1 BaseMod(name,title),
16 ceballos 1.32 fPrintDebug(kFALSE),
17 loizides 1.1 fMCPartName(Names::gkMCPartBrn),
18 ceballos 1.30 fMCMETName(ModNames::gkMCMETName),
19 loizides 1.8 fMCLeptonsName(ModNames::gkMCLeptonsName),
20     fMCAllLeptonsName(ModNames::gkMCAllLeptonsName),
21     fMCTausName(ModNames::gkMCTausName),
22     fMCNeutrinosName(ModNames::gkMCNeutrinosName),
23     fMCQuarksName(ModNames::gkMCQuarksName),
24     fMCqqHsName(ModNames::gkMCqqHsName),
25     fMCBosonsName(ModNames::gkMCBosonsName),
26 ceballos 1.10 fMCPhotonsName(ModNames::gkMCPhotonsName),
27 ceballos 1.32 fMCRadPhotonsName(ModNames::gkMCRadPhotonsName),
28     fMCISRPhotonsName(ModNames::gkMCISRPhotonsName),
29 ceballos 1.14 fPtLeptonMin(0.0),
30     fEtaLeptonMax(5.0),
31     fPtPhotonMin(0.0),
32 loizides 1.15 fEtaPhotonMax(5.0),
33 ceballos 1.32 fPtRadPhotonMin(0.0),
34     fEtaRadPhotonMax(5.0),
35 loizides 1.27 fPdgIdCut(0),
36     fMassMinCut(-FLT_MAX),
37     fMassMaxCut(FLT_MAX),
38 ceballos 1.34 fApplyISRFilter(kFALSE),
39 loizides 1.15 fParticles(0)
40 loizides 1.1 {
41     // Constructor.
42     }
43    
44     //--------------------------------------------------------------------------------------------------
45     void GeneratorMod::Process()
46     {
47 loizides 1.5 // Process entries of the tree.
48 loizides 1.1
49 loizides 1.5 // these arrays will be filled in the loop of particles
50 ceballos 1.30 MetOArr *GenMet = new MetOArr;
51     GenMet->SetName(fMCMETName);
52     GenMet->SetOwner(kTRUE);
53 loizides 1.9 MCParticleOArr *GenLeptons = new MCParticleOArr;
54 loizides 1.13 GenLeptons->SetName(fMCLeptonsName);
55 loizides 1.9 MCParticleOArr *GenAllLeptons = new MCParticleOArr;
56 loizides 1.13 GenAllLeptons->SetName(fMCAllLeptonsName);
57 loizides 1.9 MCParticleOArr *GenTaus = new MCParticleOArr;
58 loizides 1.13 GenTaus->SetName(fMCTausName);
59     GenTaus->SetOwner(kTRUE);
60 loizides 1.9 MCParticleOArr *GenNeutrinos = new MCParticleOArr;
61 loizides 1.13 GenNeutrinos->SetName(fMCNeutrinosName);
62 loizides 1.9 MCParticleOArr *GenQuarks = new MCParticleOArr;
63 loizides 1.13 GenQuarks->SetName(fMCQuarksName);
64 loizides 1.9 MCParticleOArr *GenqqHs = new MCParticleOArr;
65 loizides 1.13 GenqqHs->SetName(fMCqqHsName);
66 loizides 1.9 MCParticleOArr *GenBosons = new MCParticleOArr;
67 loizides 1.13 GenBosons->SetName(fMCBosonsName);
68 ceballos 1.10 MCParticleOArr *GenPhotons = new MCParticleOArr;
69 loizides 1.13 GenPhotons->SetName(fMCPhotonsName);
70 ceballos 1.32 MCParticleOArr *GenRadPhotons = new MCParticleOArr;
71     GenRadPhotons->SetName(fMCRadPhotonsName);
72     MCParticleOArr *GenISRPhotons = new MCParticleOArr;
73     GenISRPhotons->SetName(fMCISRPhotonsName);
74    
75     if(fPrintDebug) printf("\n************ Next Event ************\n\n");
76 loizides 1.1
77 loizides 1.5 // load MCParticle branch
78     LoadBranch(fMCPartName);
79    
80 ceballos 1.30 Double_t totalMET[3] = {0.0, 0.0, 0.0};
81 loizides 1.6 Bool_t isqqH = kFALSE;
82 loizides 1.5 for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
83 loizides 1.7 const MCParticle *p = fParticles->At(i);
84 ceballos 1.32
85     if(fPrintDebug) p->Print("l");
86    
87     // Rad photons
88 ceballos 1.34 if(p->Is(MCParticle::kGamma) && p->HasMother() && p->Mother()->Status() == 3 &&
89 ceballos 1.33 (p->Mother()->Is(MCParticle::kEl) || p->Mother()->Is(MCParticle::kMu) ||
90 ceballos 1.34 p->Mother()->Is(MCParticle::kTau)) &&
91 ceballos 1.32 p->Pt() > fPtRadPhotonMin && p->AbsEta() < fEtaRadPhotonMax) {
92     GenRadPhotons->Add(p);
93     }
94    
95     // ISR photons
96     if(p->Is(MCParticle::kGamma) && p->HasMother() && p->Mother()->IsQuark()) {
97     GenISRPhotons->Add(p);
98     }
99    
100 ceballos 1.30 // MET computation at generation level
101     if (p->Status() == 1 && !p->IsNeutrino()) {
102     totalMET[0] = totalMET[0] + p->Px();
103     totalMET[1] = totalMET[1] + p->Py();
104     totalMET[2] = totalMET[2] + p->Pz();
105     }
106 loizides 1.5
107     if (!p->IsGenerated()) continue;
108    
109     // muons/electrons from W/Z decays
110 loizides 1.7 if ((p->Is(MCParticle::kEl) || p->Is(MCParticle::kMu)) && p->Status() == 1) {
111 ceballos 1.14 if (p->Pt() > fPtLeptonMin && p->AbsEta() < fEtaLeptonMax) {
112 loizides 1.5 GenAllLeptons->Add(p);
113     }
114 loizides 1.6 Bool_t isGoodLepton = kFALSE;
115 loizides 1.7 const MCParticle *pm = p;
116 loizides 1.5 while (pm->HasMother() && isGoodLepton == kFALSE) {
117 loizides 1.21 if (pm->PdgId() == 92) // string reached, terminate loop
118     break;
119 loizides 1.29 if (pm->Mother()->Is(MCParticle::kZ) || pm->Mother()->Is(MCParticle::kW) ||
120     pm->Mother()->Is(MCParticle::kZp) || pm->Mother()->Is(MCParticle::kWp) ||
121     pm->Mother()->Is(MCParticle::kH)) {
122 loizides 1.5 GenLeptons->Add(p);
123     isGoodLepton = kTRUE;
124 loizides 1.7 break;
125 loizides 1.8 } else if (pm->Mother()->Is(MCParticle::kPi0) || pm->Mother()->Is(MCParticle::kEta)) {
126 loizides 1.7 // this is fake, but it is a trick to get rid of these cases and abort the loop
127     break;
128     }
129     pm = pm->Mother();
130 loizides 1.1 }
131 loizides 1.5 }
132    
133 loizides 1.7 // hadronic taus
134     else if (p->Is(MCParticle::kTau) && p->Status() == 2) {
135     if (!p->HasDaughter(MCParticle::kEl) && !p->HasDaughter(MCParticle::kMu)) {
136     const MCParticle *tv = p->FindDaughter(MCParticle::kTauNu);
137     if (tv) {
138     MCParticle *pm_f = new MCParticle(*p);
139     pm_f->SetMom(p->Px()-tv->Px(), p->Py()-tv->Py(),
140     p->Pz()-tv->Pz(), p->E()-tv->E());
141     GenTaus->AddOwned(pm_f);
142     } else {
143 loizides 1.18 SendError(kWarning, "Process", "Could not find a tau neutrino!");
144 loizides 1.5 }
145 loizides 1.1 }
146 loizides 1.5 }
147 loizides 1.1
148 loizides 1.5 // neutrinos
149 loizides 1.7 else if (p->Status() == 1 && p->IsNeutrino()) {
150 loizides 1.5 GenNeutrinos->Add(p);
151     }
152 loizides 1.1
153 loizides 1.5 // quarks from W/Z decays or top particles
154 loizides 1.7 else if (p->IsQuark() && p->HasMother()) {
155     if (p->Mother()->Is(MCParticle::kZ) || p->Mother()->Is(MCParticle::kW) ||
156     p->Is(MCParticle::kTop) || p->Mother()->Is(MCParticle::kTop)) {
157 loizides 1.5 GenQuarks->Add(p);
158 loizides 1.1 }
159 loizides 1.5 }
160 loizides 1.1
161 loizides 1.5 // qqH, information about the forward jets
162 loizides 1.8 else if (isqqH == kFALSE && p->Is(MCParticle::kH)) {
163 loizides 1.5 isqqH = kTRUE;
164 loizides 1.17 const MCParticle *pq1 = fParticles->At(i-1);
165     const MCParticle *pq2 = fParticles->At(i-2);
166 loizides 1.7 if (!pq1 || !pq2) {
167     SendError(kWarning, "Process", "Could not find quark pair!");
168 loizides 1.8 } else if (pq1->IsQuark() && pq2->IsQuark() &&
169     pq1->HasMother() && pq2->HasMother() &&
170 ceballos 1.25 pq1->Mother() == pq2->Mother() &&
171     pq1->Mother() != p->Mother() &&
172     pq1->Mother() != p->Mother()) {
173 loizides 1.5 GenqqHs->Add(pq1);
174     GenqqHs->Add(pq2);
175 loizides 1.1 }
176 ceballos 1.23
177 loizides 1.7 if (p->Status() == 3)
178 loizides 1.24 GenBosons->Add(p); // take higgs boson in account here rather in next else if
179 loizides 1.5 }
180 loizides 1.1
181 loizides 1.5 // information about bosons: W, Z, h, Z', W', H0, A0, H+
182 loizides 1.7 else if (p->Status() == 3 &&
183     (p->Is(MCParticle::kZ) || p->Is(MCParticle::kW) || p->Is(MCParticle::kH) ||
184     p->Is(MCParticle::kZp) || p->Is(MCParticle::kZpp) ||
185     p->Is(MCParticle::kH0) || p->Is(MCParticle::kA0) || p->Is(MCParticle::kHp))) {
186 loizides 1.5 GenBosons->Add(p);
187 loizides 1.1 }
188 ceballos 1.10
189 ceballos 1.14 // photons
190 ceballos 1.10 else if (p->Status() == 1 && p->Is(MCParticle::kGamma) &&
191 ceballos 1.14 p->Pt() > fPtPhotonMin && p->AbsEta() < fEtaPhotonMax) {
192 ceballos 1.10 GenPhotons->Add(p);
193     }
194    
195 loizides 1.18 // W/Z -> lnu for Madgraph
196 loizides 1.28 if (p->IsParton() && p->NDaughters() >= 2) {
197 ceballos 1.16 CompositeParticle *diBoson = new CompositeParticle();
198     diBoson->AddDaughter(p->Daughter(0));
199     diBoson->AddDaughter(p->Daughter(1));
200 loizides 1.18 if (p->HasDaughter(MCParticle::kMu) && p->HasDaughter(MCParticle::kMuNu)) {
201 loizides 1.20 if (GetFillHist())
202 loizides 1.18 hDVMass[0]->Fill(TMath::Min(diBoson->Mass(),199.999));
203 loizides 1.28 const MCParticle *tmp_mu = p->FindDaughter(MCParticle::kMu);
204     while (tmp_mu->HasDaughter(MCParticle::kMu) &&
205     tmp_mu->FindDaughter(MCParticle::kMu)->IsGenerated())
206     tmp_mu = tmp_mu->FindDaughter(MCParticle::kMu);
207     GenLeptons->Add(tmp_mu);
208 ceballos 1.16 }
209 loizides 1.18 else if (p->HasDaughter(MCParticle::kEl) && p->HasDaughter(MCParticle::kElNu)) {
210 loizides 1.20 if (GetFillHist())
211 loizides 1.18 hDVMass[1]->Fill(TMath::Min(diBoson->Mass(),199.999));
212 loizides 1.28 const MCParticle *tmp_e = p->FindDaughter(MCParticle::kEl);
213     while (tmp_e->HasDaughter(MCParticle::kEl) &&
214     tmp_e->FindDaughter(MCParticle::kEl)->IsGenerated())
215     tmp_e = tmp_e->FindDaughter(MCParticle::kEl);
216     GenLeptons->Add(tmp_e);
217 ceballos 1.16 }
218 loizides 1.18 else if (p->HasDaughter(MCParticle::kTau) && p->HasDaughter(MCParticle::kTauNu)) {
219 loizides 1.20 if (GetFillHist())
220 loizides 1.18 hDVMass[2]->Fill(TMath::Min(diBoson->Mass(),199.999));
221     const MCParticle *tau = p->FindDaughter(MCParticle::kTau);
222     if (tau->HasDaughter(MCParticle::kMu))
223     GenLeptons->Add(tau->FindDaughter(MCParticle::kMu));
224     if (tau->HasDaughter(MCParticle::kEl))
225     GenLeptons->Add(tau->FindDaughter(MCParticle::kEl));
226 loizides 1.28 if (tau->HasDaughter(MCParticle::kTau)) {
227     const MCParticle *tau_second = tau->FindDaughter(MCParticle::kTau);
228     if (tau_second->HasDaughter(MCParticle::kMu))
229     GenLeptons->Add(tau_second->FindDaughter(MCParticle::kMu));
230     if (tau_second->HasDaughter(MCParticle::kEl))
231     GenLeptons->Add(tau_second->FindDaughter(MCParticle::kEl));
232     }
233 loizides 1.18 }
234     else if (p->Daughter(0)->Is(MCParticle::kMu) && p->Daughter(1)->Is(MCParticle::kMu)) {
235 loizides 1.20 if (GetFillHist())
236 loizides 1.18 hDVMass[3]->Fill(TMath::Min(diBoson->Mass(),199.999));
237 sixie 1.35 const MCParticle *tmp_mu0 = p->Daughter(0);
238     while (tmp_mu0->HasDaughter(MCParticle::kMu) &&
239     tmp_mu0->FindDaughter(MCParticle::kMu)->IsGenerated())
240     tmp_mu0 = tmp_mu0->FindDaughter(MCParticle::kMu);
241     const MCParticle *tmp_mu1 = p->Daughter(1);
242     while (tmp_mu1->HasDaughter(MCParticle::kMu) &&
243     tmp_mu1->FindDaughter(MCParticle::kMu)->IsGenerated())
244     tmp_mu1 = tmp_mu1->FindDaughter(MCParticle::kMu);
245     GenLeptons->Add(tmp_mu0);
246     GenLeptons->Add(tmp_mu1);
247 ceballos 1.16 }
248 loizides 1.18 else if (p->Daughter(0)->Is(MCParticle::kEl) && p->Daughter(1)->Is(MCParticle::kEl)) {
249 loizides 1.20 if (GetFillHist())
250 loizides 1.18 hDVMass[4]->Fill(TMath::Min(diBoson->Mass(),199.999));
251 sixie 1.35 const MCParticle *tmp_e0 = p->Daughter(0);
252     while (tmp_e0->HasDaughter(MCParticle::kEl) &&
253     tmp_e0->FindDaughter(MCParticle::kEl)->IsGenerated())
254     tmp_e0 = tmp_e0->FindDaughter(MCParticle::kEl);
255     const MCParticle *tmp_e1 = p->Daughter(1);
256     while (tmp_e1->HasDaughter(MCParticle::kEl) &&
257     tmp_e1->FindDaughter(MCParticle::kEl)->IsGenerated())
258     tmp_e1 = tmp_e1->FindDaughter(MCParticle::kEl);
259     GenLeptons->Add(tmp_e0);
260     GenLeptons->Add(tmp_e1);
261 ceballos 1.16 }
262 loizides 1.18 else if (p->Daughter(0)->Is(MCParticle::kTau) && p->Daughter(1)->Is(MCParticle::kTau)) {
263 loizides 1.20 if (GetFillHist())
264 loizides 1.18 hDVMass[5]->Fill(TMath::Min(diBoson->Mass(),199.999));
265     const MCParticle *tau0 = p->Daughter(0);
266     if (tau0->HasDaughter(MCParticle::kMu))
267     GenLeptons->Add(tau0->FindDaughter(MCParticle::kMu));
268     if (tau0->HasDaughter(MCParticle::kEl))
269     GenLeptons->Add(tau0->FindDaughter(MCParticle::kEl));
270     const MCParticle *tau1 = p->Daughter(1);
271     if (tau1->HasDaughter(MCParticle::kMu))
272     GenLeptons->Add(tau1->FindDaughter(MCParticle::kMu));
273     if (tau1->HasDaughter(MCParticle::kEl))
274     GenLeptons->Add(tau1->FindDaughter(MCParticle::kEl));
275 sixie 1.35 if (tau0->HasDaughter(MCParticle::kTau)) {
276     const MCParticle *tau0_second = tau0->FindDaughter(MCParticle::kTau);
277     if (tau0_second->HasDaughter(MCParticle::kMu))
278     GenLeptons->Add(tau0_second->FindDaughter(MCParticle::kMu));
279     if (tau0_second->HasDaughter(MCParticle::kEl))
280     GenLeptons->Add(tau0_second->FindDaughter(MCParticle::kEl));
281     }
282     if (tau1->HasDaughter(MCParticle::kTau)) {
283     const MCParticle *tau1_second = tau1->FindDaughter(MCParticle::kTau);
284     if (tau1_second->HasDaughter(MCParticle::kMu))
285     GenLeptons->Add(tau1_second->FindDaughter(MCParticle::kMu));
286     if (tau1_second->HasDaughter(MCParticle::kEl))
287     GenLeptons->Add(tau1_second->FindDaughter(MCParticle::kEl));
288     }
289 ceballos 1.16 }
290     delete diBoson;
291     }
292    
293 loizides 1.18 // t -> lnu for Madgraph
294     if (p->Is(MCParticle::kTop)) {
295 ceballos 1.16 CompositeParticle *diBoson = new CompositeParticle();
296 loizides 1.18 if (p->HasDaughter(MCParticle::kMu) && p->HasDaughter(MCParticle::kMuNu)) {
297 ceballos 1.16 diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu));
298     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu));
299 loizides 1.20 if (GetFillHist())
300 loizides 1.18 hDVMass[6]->Fill(TMath::Min(diBoson->Mass(),199.999));
301 ceballos 1.16 GenLeptons->Add(p->FindDaughter(MCParticle::kMu));
302     }
303 loizides 1.18 else if (p->HasDaughter(MCParticle::kEl) && p->HasDaughter(MCParticle::kElNu)) {
304 ceballos 1.16 diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl));
305     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu));
306 loizides 1.20 if (GetFillHist())
307 loizides 1.18 hDVMass[7]->Fill(TMath::Min(diBoson->Mass(),199.999));
308 ceballos 1.16 GenLeptons->Add(p->FindDaughter(MCParticle::kEl));
309     }
310 loizides 1.18 else if (p->HasDaughter(MCParticle::kTau) && p->HasDaughter(MCParticle::kTauNu)) {
311 ceballos 1.16 diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau));
312     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu));
313 loizides 1.20 if (GetFillHist())
314 loizides 1.18 hDVMass[8]->Fill(TMath::Min(diBoson->Mass(),199.999));
315     const MCParticle *tau = p->FindDaughter(MCParticle::kTau);
316     if (tau->HasDaughter(MCParticle::kMu))
317     GenLeptons->Add(tau->FindDaughter(MCParticle::kMu));
318     if (tau->HasDaughter(MCParticle::kEl))
319     GenLeptons->Add(tau->FindDaughter(MCParticle::kEl));
320     }
321     else if (!p->HasDaughter(MCParticle::kW)) {
322     for(UInt_t nd=0; nd<p->NDaughters(); ++nd)
323     if (p->Daughter(nd)->IsNot(MCParticle::kBottom) &&
324     p->Daughter(nd)->IsNot(MCParticle::kGamma))
325     diBoson->AddDaughter(p->Daughter(nd));
326 loizides 1.20 if (GetFillHist())
327 loizides 1.18 hDVMass[9]->Fill(TMath::Min(diBoson->Mass(),199.999));
328 ceballos 1.16 }
329     delete diBoson;
330     }
331 ceballos 1.26
332 loizides 1.27 // mass cut for given pid
333     if(fPdgIdCut && p->Is(fPdgIdCut) &&
334 ceballos 1.26 (p->Mass() < fMassMinCut || p->Mass() > fMassMaxCut)) {
335     SkipEvent();
336     return;
337 sixie 1.35 }
338 loizides 1.27 } // end loop of particles
339 loizides 1.1
340 ceballos 1.30 Met *theMET = new Met(totalMET[0], totalMET[1]);
341     theMET->SetElongitudinal(totalMET[2]);
342     GenMet->AddOwned(theMET);
343    
344 loizides 1.19 // sort according to pt
345     GenLeptons->Sort();
346     GenAllLeptons->Sort();
347     GenTaus->Sort();
348     GenNeutrinos->Sort();
349     GenQuarks->Sort();
350     GenqqHs->Sort();
351     GenBosons->Sort();
352     GenPhotons->Sort();
353 ceballos 1.32 GenRadPhotons->Sort();
354     GenISRPhotons->Sort();
355 loizides 1.19
356 loizides 1.8 // add objects to this event for other modules to use
357 ceballos 1.30 AddObjThisEvt(GenMet);
358 loizides 1.13 AddObjThisEvt(GenLeptons);
359     AddObjThisEvt(GenAllLeptons);
360     AddObjThisEvt(GenTaus);
361     AddObjThisEvt(GenNeutrinos);
362     AddObjThisEvt(GenQuarks);
363     AddObjThisEvt(GenqqHs);
364     AddObjThisEvt(GenBosons);
365     AddObjThisEvt(GenPhotons);
366 ceballos 1.32 AddObjThisEvt(GenRadPhotons);
367     AddObjThisEvt(GenISRPhotons);
368    
369 loizides 1.5 // fill histograms if requested
370 loizides 1.20 if (GetFillHist()) {
371 loizides 1.5
372 ceballos 1.30 // MET
373     hDGenMet[0]->Fill(GenMet->At(0)->Pt());
374     hDGenMet[1]->Fill(GenMet->At(0)->Px());
375     hDGenMet[2]->Fill(GenMet->At(0)->Py());
376     hDGenMet[3]->Fill(GenMet->At(0)->Elongitudinal());
377    
378 loizides 1.6 // leptons
379 loizides 1.1 hDGenLeptons[0]->Fill(GenLeptons->GetEntries());
380 loizides 1.5 for(UInt_t i=0; i<GenLeptons->GetEntries(); i++) {
381 loizides 1.1 hDGenLeptons[1]->Fill(GenLeptons->At(i)->Pt());
382 loizides 1.5 hDGenLeptons[2]->Fill(TMath::Abs(GenLeptons->At(i)->Eta()));
383     hDGenLeptons[3]->Fill(GenLeptons->At(i)->PhiDeg());
384     for(UInt_t j=i+1; j<GenLeptons->GetEntries(); j++) {
385 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
386     dilepton->AddDaughter(GenLeptons->At(i));
387     dilepton->AddDaughter(GenLeptons->At(j));
388     hDGenLeptons[4]->Fill(dilepton->Mass());
389     delete dilepton;
390     }
391 ceballos 1.22 }
392     // looking at events with two leptons
393     if (GenLeptons->GetEntries() == 2) {
394     hDGenLeptons[5]->Fill(TMath::Min(TMath::Max(TMath::Abs(GenLeptons->At(0)->Eta()),
395     TMath::Abs(GenLeptons->At(1)->Eta())),
396 loizides 1.5 4.999));
397 ceballos 1.22 hDGenLeptons[6]->Fill(TMath::Min(TMath::Min(TMath::Abs(GenLeptons->At(0)->Eta()),
398     TMath::Abs(GenLeptons->At(1)->Eta())),
399 loizides 1.5 4.999));
400 ceballos 1.22 if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
401     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
402     hDGenLeptons[7]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
403     if (GenLeptons->At(0)->Pt() > 20.0) {
404     hDGenLeptons[8]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
405     if (GenLeptons->At(1)->Pt() > 10.0) {
406 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
407 ceballos 1.22 dilepton->AddDaughter(GenLeptons->At(0));
408     dilepton->AddDaughter(GenLeptons->At(1));
409 loizides 1.1 hDGenLeptons[9]->Fill(TMath::Min(dilepton->Mass(),999.999));
410 ceballos 1.22 if(dilepton->Mass() > 12.0){
411     hDGenLeptons[10]->Fill(MathUtils::DeltaPhi(GenLeptons->At(0)->Phi(),
412     GenLeptons->At(1)->Phi())
413     * 180./ TMath::Pi());
414     hDGenLeptons[11]->Fill(MathUtils::DeltaR(GenLeptons->At(0)->Eta(), GenLeptons->At(0)->Phi(),
415     GenLeptons->At(1)->Eta(), GenLeptons->At(1)->Phi()));
416     }
417 loizides 1.1 delete dilepton;
418     }
419     }
420     }
421     }
422 ceballos 1.22 // looking at events with three leptons
423     if (GenLeptons->GetEntries() == 3) {
424     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
425     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
426     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5) {
427     hDGenLeptons[12]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
428     if (GenLeptons->At(0)->Pt() > 20.0) {
429     hDGenLeptons[13]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
430     hDGenLeptons[14]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
431     if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0) {
432     CompositeParticle *dilepton01 = new CompositeParticle();
433     dilepton01->AddDaughter(GenLeptons->At(0));
434     dilepton01->AddDaughter(GenLeptons->At(1));
435     CompositeParticle *dilepton02 = new CompositeParticle();
436     dilepton02->AddDaughter(GenLeptons->At(0));
437     dilepton02->AddDaughter(GenLeptons->At(2));
438     CompositeParticle *dilepton12 = new CompositeParticle();
439     dilepton12->AddDaughter(GenLeptons->At(1));
440     dilepton12->AddDaughter(GenLeptons->At(2));
441     hDGenLeptons[15]->Fill(TMath::Min(dilepton01->Mass(),999.999));
442     hDGenLeptons[15]->Fill(TMath::Min(dilepton02->Mass(),999.999));
443     hDGenLeptons[15]->Fill(TMath::Min(dilepton12->Mass(),999.999));
444     CompositeParticle *trilepton = new CompositeParticle();
445     trilepton->AddDaughter(GenLeptons->At(0));
446     trilepton->AddDaughter(GenLeptons->At(1));
447     trilepton->AddDaughter(GenLeptons->At(2));
448     hDGenLeptons[16]->Fill(TMath::Min(trilepton->Mass(),999.999));
449 loizides 1.27 Double_t deltaR[3] = {MathUtils::DeltaR(GenLeptons->At(0)->Eta(),
450     GenLeptons->At(0)->Phi(),
451     GenLeptons->At(1)->Eta(),
452     GenLeptons->At(1)->Phi()),
453     MathUtils::DeltaR(GenLeptons->At(0)->Eta(),
454     GenLeptons->At(0)->Phi(),
455     GenLeptons->At(2)->Eta(),
456     GenLeptons->At(2)->Phi()),
457     MathUtils::DeltaR(GenLeptons->At(1)->Eta(),
458     GenLeptons->At(1)->Phi(),
459     GenLeptons->At(2)->Eta(),
460     GenLeptons->At(2)->Phi())};
461     Double_t deltaRMin = deltaR[0];
462     for(Int_t i=1; i<3; i++) if(deltaRMin > deltaR[i]) deltaRMin = deltaR[i];
463 ceballos 1.22 hDGenLeptons[17]->Fill(deltaRMin);
464    
465     delete dilepton01;
466     delete dilepton02;
467     delete dilepton12;
468     delete trilepton;
469     }
470     }
471     }
472     }
473     // looking at events with four leptons
474     if (GenLeptons->GetEntries() == 4) {
475     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
476     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
477     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5 &&
478     TMath::Abs(GenLeptons->At(3)->Eta()) < 2.5) {
479     hDGenLeptons[18]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
480     if (GenLeptons->At(0)->Pt() > 20.0) {
481     hDGenLeptons[19]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
482     hDGenLeptons[20]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
483     hDGenLeptons[21]->Fill(TMath::Min(GenLeptons->At(3)->Pt(),199.999));
484     if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0 &&
485     GenLeptons->At(3)->Pt() > 10.0) {
486     CompositeParticle *dilepton01 = new CompositeParticle();
487     dilepton01->AddDaughter(GenLeptons->At(0));
488     dilepton01->AddDaughter(GenLeptons->At(1));
489     CompositeParticle *dilepton02 = new CompositeParticle();
490     dilepton02->AddDaughter(GenLeptons->At(0));
491     dilepton02->AddDaughter(GenLeptons->At(2));
492     CompositeParticle *dilepton03 = new CompositeParticle();
493     dilepton03->AddDaughter(GenLeptons->At(0));
494     dilepton03->AddDaughter(GenLeptons->At(3));
495     CompositeParticle *dilepton12 = new CompositeParticle();
496     dilepton12->AddDaughter(GenLeptons->At(1));
497     dilepton12->AddDaughter(GenLeptons->At(2));
498     CompositeParticle *dilepton13 = new CompositeParticle();
499     dilepton13->AddDaughter(GenLeptons->At(1));
500     dilepton13->AddDaughter(GenLeptons->At(3));
501     CompositeParticle *dilepton23 = new CompositeParticle();
502     dilepton23->AddDaughter(GenLeptons->At(2));
503     dilepton23->AddDaughter(GenLeptons->At(3));
504     hDGenLeptons[22]->Fill(TMath::Min(dilepton01->Mass(),999.999));
505     hDGenLeptons[22]->Fill(TMath::Min(dilepton02->Mass(),999.999));
506     hDGenLeptons[22]->Fill(TMath::Min(dilepton03->Mass(),999.999));
507     hDGenLeptons[22]->Fill(TMath::Min(dilepton12->Mass(),999.999));
508     hDGenLeptons[22]->Fill(TMath::Min(dilepton13->Mass(),999.999));
509     hDGenLeptons[22]->Fill(TMath::Min(dilepton23->Mass(),999.999));
510     CompositeParticle *fourlepton = new CompositeParticle();
511     fourlepton->AddDaughter(GenLeptons->At(0));
512     fourlepton->AddDaughter(GenLeptons->At(1));
513     fourlepton->AddDaughter(GenLeptons->At(2));
514     fourlepton->AddDaughter(GenLeptons->At(3));
515     hDGenLeptons[23]->Fill(TMath::Min(fourlepton->Mass(),999.999));
516 loizides 1.27 Double_t deltaR[6] = {MathUtils::DeltaR(GenLeptons->At(0)->Eta(),
517     GenLeptons->At(0)->Phi(),
518     GenLeptons->At(1)->Eta(),
519     GenLeptons->At(1)->Phi()),
520     MathUtils::DeltaR(GenLeptons->At(0)->Eta(),
521     GenLeptons->At(0)->Phi(),
522     GenLeptons->At(2)->Eta(),
523     GenLeptons->At(2)->Phi()),
524     MathUtils::DeltaR(GenLeptons->At(0)->Eta(),
525     GenLeptons->At(0)->Phi(),
526     GenLeptons->At(3)->Eta(),
527     GenLeptons->At(3)->Phi()),
528     MathUtils::DeltaR(GenLeptons->At(1)->Eta(),
529     GenLeptons->At(1)->Phi(),
530     GenLeptons->At(2)->Eta(),
531     GenLeptons->At(2)->Phi()),
532     MathUtils::DeltaR(GenLeptons->At(1)->Eta(),
533     GenLeptons->At(1)->Phi(),
534     GenLeptons->At(3)->Eta(),
535     GenLeptons->At(3)->Phi()),
536     MathUtils::DeltaR(GenLeptons->At(2)->Eta(),
537     GenLeptons->At(2)->Phi(),
538     GenLeptons->At(3)->Eta(),
539     GenLeptons->At(3)->Phi())};
540     Double_t deltaRMin = deltaR[0];
541     for(Int_t i=1; i<6; i++) if(deltaRMin > deltaR[i]) deltaRMin = deltaR[i];
542 ceballos 1.22 hDGenLeptons[24]->Fill(deltaRMin);
543    
544     delete dilepton01;
545     delete dilepton02;
546     delete dilepton03;
547     delete dilepton12;
548     delete dilepton13;
549     delete dilepton23;
550     delete fourlepton;
551     }
552     }
553     }
554     }
555 loizides 1.1
556 loizides 1.6 // all leptons
557 ceballos 1.3 hDGenAllLeptons[0]->Fill(GenAllLeptons->GetEntries());
558 loizides 1.5 for(UInt_t i=0; i<GenAllLeptons->GetEntries(); i++) {
559 ceballos 1.3 hDGenAllLeptons[1]->Fill(GenAllLeptons->At(i)->Pt());
560     hDGenAllLeptons[2]->Fill(GenAllLeptons->At(i)->Eta());
561 loizides 1.5 hDGenAllLeptons[3]->Fill(GenAllLeptons->At(i)->PhiDeg());
562 ceballos 1.3 }
563    
564 loizides 1.6 // taus
565 loizides 1.1 hDGenTaus[0]->Fill(GenTaus->GetEntries());
566 loizides 1.5 for(UInt_t i=0; i<GenTaus->GetEntries(); i++) {
567 loizides 1.1 hDGenTaus[1]->Fill(GenTaus->At(i)->Pt());
568     hDGenTaus[2]->Fill(GenTaus->At(i)->Eta());
569 loizides 1.5 hDGenTaus[3]->Fill(GenTaus->At(i)->PhiDeg());
570 loizides 1.1 }
571    
572 loizides 1.6 // neutrinos
573 loizides 1.1 hDGenNeutrinos[0]->Fill(GenNeutrinos->GetEntries());
574     CompositeParticle *neutrinoTotal = new CompositeParticle();
575 loizides 1.5 for(UInt_t i=0; i<GenNeutrinos->GetEntries(); i++) {
576     if (GenNeutrinos->At(i)->HasMother())
577 loizides 1.1 neutrinoTotal->AddDaughter(GenNeutrinos->At(i));
578     }
579 loizides 1.5 if (GenNeutrinos->GetEntries() > 0) {
580 loizides 1.1 hDGenNeutrinos[1]->Fill(neutrinoTotal->Pt());
581     hDGenNeutrinos[2]->Fill(neutrinoTotal->Eta());
582 loizides 1.5 hDGenNeutrinos[3]->Fill(neutrinoTotal->PhiDeg());
583 loizides 1.1 }
584     delete neutrinoTotal;
585    
586 loizides 1.6 // quarks
587 loizides 1.1 hDGenQuarks[0]->Fill(GenQuarks->GetEntries());
588 loizides 1.5 for(UInt_t i=0; i<GenQuarks->GetEntries(); i++) {
589     for(UInt_t j=i+1; j<GenQuarks->GetEntries(); j++) {
590 loizides 1.1 CompositeParticle *dijet = new CompositeParticle();
591     dijet->AddDaughter(GenQuarks->At(i));
592     dijet->AddDaughter(GenQuarks->At(j));
593     hDGenQuarks[1]->Fill(dijet->Pt());
594     hDGenQuarks[2]->Fill(dijet->Mass());
595 loizides 1.5 if (TMath::Abs(GenQuarks->At(i)->Eta()) < 2.5 &&
596     TMath::Abs(GenQuarks->At(j)->Eta()) < 2.5) {
597 loizides 1.1 hDGenQuarks[3]->Fill(dijet->Pt());
598     hDGenQuarks[4]->Fill(dijet->Mass());
599     }
600     delete dijet;
601     }
602 ceballos 1.2 // b quark info
603 loizides 1.5 if (GenQuarks->At(i)->AbsPdgId() == 5) {
604 ceballos 1.2 hDGenQuarks[5]->Fill(GenQuarks->At(i)->Pt());
605     hDGenQuarks[6]->Fill(GenQuarks->At(i)->Eta());
606     hDGenQuarks[7]->Fill(GenQuarks->At(i)->Phi());
607 ceballos 1.22 if (GenLeptons->GetEntries() >= 2 &&
608     GenLeptons->At(0)->Pt() > 20 &&
609     GenLeptons->At(1)->Pt() > 15) {
610     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
611     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
612 ceballos 1.2 hDGenQuarks[8]->Fill(GenQuarks->At(i)->Pt());
613     hDGenQuarks[9]->Fill(GenQuarks->At(i)->Eta());
614     hDGenQuarks[10]->Fill(GenQuarks->At(i)->Phi());
615     }
616     }
617     }
618     // t quark info
619 loizides 1.5 else if (GenQuarks->At(i)->AbsPdgId() == 6) {
620 ceballos 1.2 hDGenQuarks[11]->Fill(GenQuarks->At(i)->Pt());
621     hDGenQuarks[12]->Fill(GenQuarks->At(i)->Eta());
622     hDGenQuarks[13]->Fill(GenQuarks->At(i)->Phi());
623     }
624     // light quark info
625     else {
626     hDGenQuarks[14]->Fill(GenQuarks->At(i)->Pt());
627     hDGenQuarks[15]->Fill(GenQuarks->At(i)->Eta());
628     hDGenQuarks[16]->Fill(GenQuarks->At(i)->Phi());
629     }
630 loizides 1.1 }
631    
632 loizides 1.6 // wbf
633 loizides 1.5 if (GenqqHs->GetEntries() == 2) {
634 loizides 1.1 hDGenWBF[0]->Fill(MathUtils::DeltaPhi(GenqqHs->At(0)->Phi(),
635     GenqqHs->At(1)->Phi()) * 180./ TMath::Pi());
636 loizides 1.5 hDGenWBF[1]->Fill(TMath::Abs(GenqqHs->At(0)->Eta()-GenqqHs->At(1)->Eta()));
637 loizides 1.1 hDGenWBF[2]->Fill(TMath::Max(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
638     hDGenWBF[3]->Fill(TMath::Min(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
639     CompositeParticle *diqq = new CompositeParticle();
640     diqq->AddDaughter(GenqqHs->At(0));
641     diqq->AddDaughter(GenqqHs->At(1));
642     hDGenWBF[4]->Fill(diqq->Mass());
643     delete diqq;
644     }
645    
646 loizides 1.6 // bosons
647 loizides 1.1 hDGenBosons[0]->Fill(GenBosons->GetEntries());
648 loizides 1.5 for(UInt_t i=0; i<GenBosons->GetEntries(); i++) {
649 loizides 1.1 hDGenBosons[1]->Fill(GenBosons->At(i)->Pt());
650     hDGenBosons[2]->Fill(GenBosons->At(i)->Eta());
651     hDGenBosons[3]->Fill(GenBosons->At(i)->Mass());
652     }
653 ceballos 1.10
654     // photons
655     hDGenPhotons[0]->Fill(GenPhotons->GetEntries());
656     for(UInt_t i=0; i<GenPhotons->GetEntries(); i++) {
657     hDGenPhotons[1]->Fill(GenPhotons->At(i)->Pt());
658     hDGenPhotons[2]->Fill(GenPhotons->At(i)->Eta());
659     }
660 ceballos 1.32
661     // Rad photons
662     hDGenRadPhotons[0]->Fill(GenRadPhotons->GetEntries());
663     for(UInt_t i=0; i<GenRadPhotons->GetEntries(); i++) {
664     hDGenRadPhotons[1]->Fill(TMath::Min(GenRadPhotons->At(i)->Pt(),199.999));
665     hDGenRadPhotons[2]->Fill(TMath::Min(GenRadPhotons->At(i)->AbsEta(),4.999));
666     hDGenRadPhotons[3]->Fill(TMath::Min((double)GenRadPhotons->At(i)->Mother()->Status(),19.499));
667     hDGenRadPhotons[4]->Fill(GenRadPhotons->At(i)->IsGenerated()+2*GenRadPhotons->At(i)->IsSimulated());
668     hDGenRadPhotons[5]->Fill(TMath::Min(
669     MathUtils::DeltaR(GenRadPhotons->At(i)->Eta(), GenRadPhotons->At(i)->Phi(),
670     GenRadPhotons->At(i)->Mother()->Eta(), GenRadPhotons->At(i)->Mother()->Phi()),4.999));
671     Int_t Mother = 0;
672     if(GenRadPhotons->At(i)->Mother()->Is(MCParticle::kMu)) Mother = 1;
673     hDGenRadPhotons[6]->Fill(Mother);
674     }
675    
676     // ISR photons
677     hDGenISRPhotons[0]->Fill(GenISRPhotons->GetEntries());
678     for(UInt_t i=0; i<GenISRPhotons->GetEntries(); i++) {
679     hDGenISRPhotons[1]->Fill(TMath::Min(GenISRPhotons->At(i)->Pt(),199.999));
680     hDGenISRPhotons[2]->Fill(TMath::Min(GenISRPhotons->At(i)->AbsEta(),4.999));
681     hDGenISRPhotons[3]->Fill(TMath::Min((double)GenISRPhotons->At(i)->Mother()->Status(),19.499));
682     hDGenISRPhotons[4]->Fill(GenISRPhotons->At(i)->IsGenerated()+2*GenISRPhotons->At(i)->IsSimulated());
683     hDGenISRPhotons[5]->Fill(TMath::Min(
684     MathUtils::DeltaR(GenISRPhotons->At(i)->Eta(), GenISRPhotons->At(i)->Phi(),
685     GenISRPhotons->At(i)->Mother()->Eta(), GenISRPhotons->At(i)->Mother()->Phi()),4.999));
686     }
687 loizides 1.1 }
688 ceballos 1.34
689     // Apply ISR filter (but filling all histograms)
690     if(fApplyISRFilter == kTRUE && GenISRPhotons->GetEntries() > 0){
691     SkipEvent();
692     }
693 loizides 1.1 }
694    
695     //--------------------------------------------------------------------------------------------------
696     void GeneratorMod::SlaveBegin()
697     {
698 loizides 1.5 // Book branch and histograms if wanted.
699    
700 loizides 1.1 ReqBranch(fMCPartName, fParticles);
701    
702 loizides 1.5 // fill histograms
703 loizides 1.20 if (GetFillHist()) {
704 loizides 1.5 char sb[1024];
705 ceballos 1.30 // MET
706     sprintf(sb,"hDGenMet_%d", 0); hDGenMet[0] = new TH1D(sb,sb,200,0,200);
707     sprintf(sb,"hDGenMet_%d", 1); hDGenMet[1] = new TH1D(sb,sb,400,-200,200);
708     sprintf(sb,"hDGenMet_%d", 2); hDGenMet[2] = new TH1D(sb,sb,400,-200,200);
709     sprintf(sb,"hDGenMet_%d", 3); hDGenMet[3] = new TH1D(sb,sb,400,-1000,1000);
710     for(Int_t i=0; i<4; i++) AddOutput(hDGenMet[i]);
711    
712 loizides 1.6 // leptons from W
713 loizides 1.1 sprintf(sb,"hDGenLeptons_%d", 0); hDGenLeptons[0] = new TH1D(sb,sb,10,-0.5,9.5);
714     sprintf(sb,"hDGenLeptons_%d", 1); hDGenLeptons[1] = new TH1D(sb,sb,100,0.0,200.0);
715     sprintf(sb,"hDGenLeptons_%d", 2); hDGenLeptons[2] = new TH1D(sb,sb,50,0.0,5.0);
716     sprintf(sb,"hDGenLeptons_%d", 3); hDGenLeptons[3] = new TH1D(sb,sb,90,0.0,180.0);
717     sprintf(sb,"hDGenLeptons_%d", 4); hDGenLeptons[4] = new TH1D(sb,sb,1000,0.0,1000.0);
718     sprintf(sb,"hDGenLeptons_%d", 5); hDGenLeptons[5] = new TH1D(sb,sb,50,0.0,5.0);
719     sprintf(sb,"hDGenLeptons_%d", 6); hDGenLeptons[6] = new TH1D(sb,sb,50,0.0,5.0);
720     sprintf(sb,"hDGenLeptons_%d", 7); hDGenLeptons[7] = new TH1D(sb,sb,100,0.0,200.0);
721     sprintf(sb,"hDGenLeptons_%d", 8); hDGenLeptons[8] = new TH1D(sb,sb,100,0.0,200.0);
722     sprintf(sb,"hDGenLeptons_%d", 9); hDGenLeptons[9] = new TH1D(sb,sb,1000,0.0,1000.0);
723     sprintf(sb,"hDGenLeptons_%d",10); hDGenLeptons[10] = new TH1D(sb,sb,90,0.0,180.0);
724 ceballos 1.22 sprintf(sb,"hDGenLeptons_%d",11); hDGenLeptons[11] = new TH1D(sb,sb,100,0.0,5.0);
725     sprintf(sb,"hDGenLeptons_%d",12); hDGenLeptons[12] = new TH1D(sb,sb,100,0.0,200.0);
726     sprintf(sb,"hDGenLeptons_%d",13); hDGenLeptons[13] = new TH1D(sb,sb,100,0.0,200.0);
727     sprintf(sb,"hDGenLeptons_%d",14); hDGenLeptons[14] = new TH1D(sb,sb,100,0.0,200.0);
728     sprintf(sb,"hDGenLeptons_%d",15); hDGenLeptons[15] = new TH1D(sb,sb,1000,0.0,1000.0);
729     sprintf(sb,"hDGenLeptons_%d",16); hDGenLeptons[16] = new TH1D(sb,sb,1000,0.0,1000.0);
730     sprintf(sb,"hDGenLeptons_%d",17); hDGenLeptons[17] = new TH1D(sb,sb,100,0.0,5.0);
731     sprintf(sb,"hDGenLeptons_%d",18); hDGenLeptons[18] = new TH1D(sb,sb,100,0.0,200.0);
732     sprintf(sb,"hDGenLeptons_%d",19); hDGenLeptons[19] = new TH1D(sb,sb,100,0.0,200.0);
733     sprintf(sb,"hDGenLeptons_%d",20); hDGenLeptons[20] = new TH1D(sb,sb,100,0.0,200.0);
734     sprintf(sb,"hDGenLeptons_%d",21); hDGenLeptons[21] = new TH1D(sb,sb,100,0.0,200.0);
735     sprintf(sb,"hDGenLeptons_%d",22); hDGenLeptons[22] = new TH1D(sb,sb,1000,0.0,1000.0);
736     sprintf(sb,"hDGenLeptons_%d",23); hDGenLeptons[23] = new TH1D(sb,sb,1000,0.0,1000.0);
737     sprintf(sb,"hDGenLeptons_%d",24); hDGenLeptons[24] = new TH1D(sb,sb,100,0.0,5.0);
738     for(Int_t i=0; i<25; i++) AddOutput(hDGenLeptons[i]);
739 loizides 1.1
740 loizides 1.6 // all leptons
741 ceballos 1.3 sprintf(sb,"hDGenAllLeptons_%d", 0); hDGenAllLeptons[0] = new TH1D(sb,sb,10,-0.5,9.5);
742     sprintf(sb,"hDGenAllLeptons_%d", 1); hDGenAllLeptons[1] = new TH1D(sb,sb,100,0.0,200.0);
743 ceballos 1.14 sprintf(sb,"hDGenAllLeptons_%d", 2); hDGenAllLeptons[2] = new TH1D(sb,sb,100,-5.0,5.0);
744 ceballos 1.3 sprintf(sb,"hDGenAllLeptons_%d", 3); hDGenAllLeptons[3] = new TH1D(sb,sb,90,0.0,180.0);
745 loizides 1.5 for(Int_t i=0; i<4; i++) AddOutput(hDGenAllLeptons[i]);
746 ceballos 1.3
747 loizides 1.6 // taus
748 loizides 1.1 sprintf(sb,"hDGenTaus_%d", 0); hDGenTaus[0] = new TH1D(sb,sb,10,-0.5,9.5);
749     sprintf(sb,"hDGenTaus_%d", 1); hDGenTaus[1] = new TH1D(sb,sb,100,0.0,200.0);
750     sprintf(sb,"hDGenTaus_%d", 2); hDGenTaus[2] = new TH1D(sb,sb,100,-5.0,5.0);
751     sprintf(sb,"hDGenTaus_%d", 3); hDGenTaus[3] = new TH1D(sb,sb,90,0.0,180.0);
752 loizides 1.5 for(Int_t i=0; i<4; i++) AddOutput(hDGenTaus[i]);
753 loizides 1.1
754 loizides 1.6 // neutrinos
755 loizides 1.1 sprintf(sb,"hDGenNeutrinos_%d", 0); hDGenNeutrinos[0] = new TH1D(sb,sb,10,-0.5,9.5);
756     sprintf(sb,"hDGenNeutrinos_%d", 1); hDGenNeutrinos[1] = new TH1D(sb,sb,100,0.0,200.0);
757     sprintf(sb,"hDGenNeutrinos_%d", 2); hDGenNeutrinos[2] = new TH1D(sb,sb,100,-5.0,5.0);
758     sprintf(sb,"hDGenNeutrinos_%d", 3); hDGenNeutrinos[3] = new TH1D(sb,sb,90,0.0,180.0);
759 loizides 1.5 for(Int_t i=0; i<4; i++) AddOutput(hDGenNeutrinos[i]);
760 loizides 1.1
761 loizides 1.6 // quarks
762 loizides 1.1 sprintf(sb,"hDGenQuarks_%d", 0); hDGenQuarks[0] = new TH1D(sb,sb,10,-0.5,9.5);
763     sprintf(sb,"hDGenQuarks_%d", 1); hDGenQuarks[1] = new TH1D(sb,sb,200,0.0,400.);
764     sprintf(sb,"hDGenQuarks_%d", 2); hDGenQuarks[2] = new TH1D(sb,sb,2000,0.0,2000.);
765     sprintf(sb,"hDGenQuarks_%d", 3); hDGenQuarks[3] = new TH1D(sb,sb,200,0.0,400.);
766     sprintf(sb,"hDGenQuarks_%d", 4); hDGenQuarks[4] = new TH1D(sb,sb,2000,0.0,2000.);
767 ceballos 1.2 sprintf(sb,"hDGenQuarks_%d", 5); hDGenQuarks[5] = new TH1D(sb,sb,200,0.0,400.);
768     sprintf(sb,"hDGenQuarks_%d", 6); hDGenQuarks[6] = new TH1D(sb,sb,200,-10.0,10.);
769 loizides 1.5 sprintf(sb,"hDGenQuarks_%d", 7); hDGenQuarks[7] = new TH1D(sb,sb,200,-TMath::Pi(),
770     TMath::Pi());
771 ceballos 1.2 sprintf(sb,"hDGenQuarks_%d", 8); hDGenQuarks[8] = new TH1D(sb,sb,200,0.0,400.);
772     sprintf(sb,"hDGenQuarks_%d", 9); hDGenQuarks[9] = new TH1D(sb,sb,200,-10.0,10.);
773 loizides 1.5 sprintf(sb,"hDGenQuarks_%d",10); hDGenQuarks[10] = new TH1D(sb,sb,200,-TMath::Pi(),
774     TMath::Pi());
775 ceballos 1.2 sprintf(sb,"hDGenQuarks_%d",11); hDGenQuarks[11] = new TH1D(sb,sb,200,0.0,400.);
776     sprintf(sb,"hDGenQuarks_%d",12); hDGenQuarks[12] = new TH1D(sb,sb,200,-10.0,10.);
777 loizides 1.5 sprintf(sb,"hDGenQuarks_%d",13); hDGenQuarks[13] = new TH1D(sb,sb,200,-TMath::Pi(),
778     TMath::Pi());
779 ceballos 1.2 sprintf(sb,"hDGenQuarks_%d",14); hDGenQuarks[14] = new TH1D(sb,sb,200,0.0,400.);
780     sprintf(sb,"hDGenQuarks_%d",15); hDGenQuarks[15] = new TH1D(sb,sb,200,-10.0,10.);
781 loizides 1.5 sprintf(sb,"hDGenQuarks_%d",16); hDGenQuarks[16] = new TH1D(sb,sb,200,-TMath::Pi(),
782     TMath::Pi());
783     for(Int_t i=0; i<17; i++) AddOutput(hDGenQuarks[i]);
784 loizides 1.1
785     // qqH
786     sprintf(sb,"hDGenWBF_%d", 0); hDGenWBF[0] = new TH1D(sb,sb,90,0.0,180.);
787     sprintf(sb,"hDGenWBF_%d", 1); hDGenWBF[1] = new TH1D(sb,sb,100,0.0,10.);
788     sprintf(sb,"hDGenWBF_%d", 2); hDGenWBF[2] = new TH1D(sb,sb,200,0.0,400.);
789     sprintf(sb,"hDGenWBF_%d", 3); hDGenWBF[3] = new TH1D(sb,sb,200,0.0,400.);
790     sprintf(sb,"hDGenWBF_%d", 4); hDGenWBF[4] = new TH1D(sb,sb,200,0.0,4000.);
791 loizides 1.5 for(Int_t i=0; i<5; i++) AddOutput(hDGenWBF[i]);
792 loizides 1.1
793 loizides 1.6 // bosons
794 loizides 1.1 sprintf(sb,"hDGenBosons_%d", 0); hDGenBosons[0] = new TH1D(sb,sb,10,-0.5,9.5);
795     sprintf(sb,"hDGenBosons_%d", 1); hDGenBosons[1] = new TH1D(sb,sb,200,0.0,400.0);
796     sprintf(sb,"hDGenBosons_%d", 2); hDGenBosons[2] = new TH1D(sb,sb,100,-5.0,5.0);
797     sprintf(sb,"hDGenBosons_%d", 3); hDGenBosons[3] = new TH1D(sb,sb,2000,0.0,2000.0);
798 loizides 1.5 for(Int_t i=0; i<4; i++) AddOutput(hDGenBosons[i]);
799 ceballos 1.10
800     // photons
801     sprintf(sb,"hDGenPhotons_%d", 0); hDGenPhotons[0] = new TH1D(sb,sb,10,-0.5,9.5);
802     sprintf(sb,"hDGenPhotons_%d", 1); hDGenPhotons[1] = new TH1D(sb,sb,200,0.0,400.0);
803 ceballos 1.14 sprintf(sb,"hDGenPhotons_%d", 2); hDGenPhotons[2] = new TH1D(sb,sb,100,-5.0,5.0);
804 ceballos 1.10 for(Int_t i=0; i<3; i++) AddOutput(hDGenPhotons[i]);
805 ceballos 1.16
806 ceballos 1.32 // Rad photons
807     sprintf(sb,"hDGenRadPhotons_%d", 0); hDGenRadPhotons[0] = new TH1D(sb,sb,10,-0.5,9.5);
808     sprintf(sb,"hDGenRadPhotons_%d", 1); hDGenRadPhotons[1] = new TH1D(sb,sb,400,0.0,200.0);
809     sprintf(sb,"hDGenRadPhotons_%d", 2); hDGenRadPhotons[2] = new TH1D(sb,sb,100,0.0,5.0);
810     sprintf(sb,"hDGenRadPhotons_%d", 3); hDGenRadPhotons[3] = new TH1D(sb,sb,20,-0.5,19.5);
811     sprintf(sb,"hDGenRadPhotons_%d", 4); hDGenRadPhotons[4] = new TH1D(sb,sb,4,-0.5,3.5);
812     sprintf(sb,"hDGenRadPhotons_%d", 5); hDGenRadPhotons[5] = new TH1D(sb,sb,500,0.0,5.0);
813     sprintf(sb,"hDGenRadPhotons_%d", 6); hDGenRadPhotons[6] = new TH1D(sb,sb,2,-0.5,1.5);
814     for(Int_t i=0; i<7; i++) AddOutput(hDGenRadPhotons[i]);
815    
816     // ISR photons
817     sprintf(sb,"hDGenISRPhotons_%d", 0); hDGenISRPhotons[0] = new TH1D(sb,sb,10,-0.5,9.5);
818     sprintf(sb,"hDGenISRPhotons_%d", 1); hDGenISRPhotons[1] = new TH1D(sb,sb,400,0.0,200.0);
819     sprintf(sb,"hDGenISRPhotons_%d", 2); hDGenISRPhotons[2] = new TH1D(sb,sb,100,0.0,5.0);
820     sprintf(sb,"hDGenISRPhotons_%d", 3); hDGenISRPhotons[3] = new TH1D(sb,sb,20,-0.5,19.5);
821     sprintf(sb,"hDGenISRPhotons_%d", 4); hDGenISRPhotons[4] = new TH1D(sb,sb,4,-0.5,3.5);
822     sprintf(sb,"hDGenISRPhotons_%d", 5); hDGenISRPhotons[5] = new TH1D(sb,sb,500,0.0,5.0);
823     for(Int_t i=0; i<6; i++) AddOutput(hDGenISRPhotons[i]);
824    
825 ceballos 1.16 // auxiliar
826     sprintf(sb,"hDVMass_%d", 0); hDVMass[0] = new TH1D(sb,sb,200,0.,200.);
827     sprintf(sb,"hDVMass_%d", 1); hDVMass[1] = new TH1D(sb,sb,200,0.,200.);
828     sprintf(sb,"hDVMass_%d", 2); hDVMass[2] = new TH1D(sb,sb,200,0.,200.);
829     sprintf(sb,"hDVMass_%d", 3); hDVMass[3] = new TH1D(sb,sb,200,0.,200.);
830     sprintf(sb,"hDVMass_%d", 4); hDVMass[4] = new TH1D(sb,sb,200,0.,200.);
831     sprintf(sb,"hDVMass_%d", 5); hDVMass[5] = new TH1D(sb,sb,200,0.,200.);
832     sprintf(sb,"hDVMass_%d", 6); hDVMass[6] = new TH1D(sb,sb,200,0.,200.);
833     sprintf(sb,"hDVMass_%d", 7); hDVMass[7] = new TH1D(sb,sb,200,0.,200.);
834     sprintf(sb,"hDVMass_%d", 8); hDVMass[8] = new TH1D(sb,sb,200,0.,200.);
835     sprintf(sb,"hDVMass_%d", 9); hDVMass[9] = new TH1D(sb,sb,200,0.,200.);
836     for(Int_t i=0; i<10; i++) AddOutput(hDVMass[i]);
837 loizides 1.1 }
838     }