ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.33
Committed: Sun Apr 19 12:42:54 2009 UTC (16 years ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.32: +3 -2 lines
Log Message:
adding photons from taus in the Rad collection

File Contents

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