ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.46
Committed: Mon Jun 22 11:55:02 2009 UTC (15 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.45: +266 -167 lines
Log Message:
Cleanup

File Contents

# User Rev Content
1 loizides 1.46 // $Id: GeneratorMod.cc,v 1.45 2009/06/17 20:27:44 loizides Exp $
2 loizides 1.1
3     #include "MitPhysics/Mods/interface/GeneratorMod.h"
4     #include "MitCommon/MathTools/interface/MathUtils.h"
5 loizides 1.45 #include "MitAna/DataTree/interface/MetCol.h"
6     #include "MitAna/DataTree/interface/MCParticleCol.h"
7 loizides 1.8 #include "MitPhysics/Init/interface/ModNames.h"
8 loizides 1.1 #include <TH1D.h>
9     #include <TH2D.h>
10    
11     using namespace mithep;
12    
13     ClassImp(mithep::GeneratorMod)
14    
15     //--------------------------------------------------------------------------------------------------
16 loizides 1.8 GeneratorMod::GeneratorMod(const char *name, const char *title) :
17 loizides 1.1 BaseMod(name,title),
18 ceballos 1.32 fPrintDebug(kFALSE),
19 loizides 1.1 fMCPartName(Names::gkMCPartBrn),
20 ceballos 1.30 fMCMETName(ModNames::gkMCMETName),
21 loizides 1.8 fMCLeptonsName(ModNames::gkMCLeptonsName),
22     fMCAllLeptonsName(ModNames::gkMCAllLeptonsName),
23     fMCTausName(ModNames::gkMCTausName),
24     fMCNeutrinosName(ModNames::gkMCNeutrinosName),
25     fMCQuarksName(ModNames::gkMCQuarksName),
26     fMCqqHsName(ModNames::gkMCqqHsName),
27     fMCBosonsName(ModNames::gkMCBosonsName),
28 ceballos 1.10 fMCPhotonsName(ModNames::gkMCPhotonsName),
29 ceballos 1.32 fMCRadPhotonsName(ModNames::gkMCRadPhotonsName),
30     fMCISRPhotonsName(ModNames::gkMCISRPhotonsName),
31 ceballos 1.14 fPtLeptonMin(0.0),
32     fEtaLeptonMax(5.0),
33     fPtPhotonMin(0.0),
34 loizides 1.15 fEtaPhotonMax(5.0),
35 ceballos 1.32 fPtRadPhotonMin(0.0),
36     fEtaRadPhotonMax(5.0),
37 loizides 1.27 fPdgIdCut(0),
38     fMassMinCut(-FLT_MAX),
39     fMassMaxCut(FLT_MAX),
40 ceballos 1.34 fApplyISRFilter(kFALSE),
41 loizides 1.15 fParticles(0)
42 loizides 1.1 {
43 ceballos 1.42 // Constructor
44 loizides 1.1 }
45    
46     //--------------------------------------------------------------------------------------------------
47     void GeneratorMod::Process()
48     {
49 loizides 1.5 // Process entries of the tree.
50 loizides 1.1
51 loizides 1.5 // these arrays will be filled in the loop of particles
52 ceballos 1.30 MetOArr *GenMet = new MetOArr;
53     GenMet->SetName(fMCMETName);
54     GenMet->SetOwner(kTRUE);
55 loizides 1.9 MCParticleOArr *GenLeptons = new MCParticleOArr;
56 loizides 1.13 GenLeptons->SetName(fMCLeptonsName);
57 loizides 1.9 MCParticleOArr *GenAllLeptons = new MCParticleOArr;
58 loizides 1.13 GenAllLeptons->SetName(fMCAllLeptonsName);
59 loizides 1.9 MCParticleOArr *GenTaus = new MCParticleOArr;
60 loizides 1.13 GenTaus->SetName(fMCTausName);
61     GenTaus->SetOwner(kTRUE);
62 loizides 1.9 MCParticleOArr *GenNeutrinos = new MCParticleOArr;
63 loizides 1.13 GenNeutrinos->SetName(fMCNeutrinosName);
64 loizides 1.9 MCParticleOArr *GenQuarks = new MCParticleOArr;
65 loizides 1.13 GenQuarks->SetName(fMCQuarksName);
66 loizides 1.9 MCParticleOArr *GenqqHs = new MCParticleOArr;
67 loizides 1.13 GenqqHs->SetName(fMCqqHsName);
68 loizides 1.9 MCParticleOArr *GenBosons = new MCParticleOArr;
69 loizides 1.13 GenBosons->SetName(fMCBosonsName);
70 ceballos 1.10 MCParticleOArr *GenPhotons = new MCParticleOArr;
71 loizides 1.13 GenPhotons->SetName(fMCPhotonsName);
72 ceballos 1.32 MCParticleOArr *GenRadPhotons = new MCParticleOArr;
73     GenRadPhotons->SetName(fMCRadPhotonsName);
74     MCParticleOArr *GenISRPhotons = new MCParticleOArr;
75     GenISRPhotons->SetName(fMCISRPhotonsName);
76    
77 ceballos 1.42 MCParticleOArr *GenTempMG0 = new MCParticleOArr;
78    
79 loizides 1.46 if (fPrintDebug)
80 loizides 1.40 printf("\n************ Next Event ************\n\n");
81 loizides 1.1
82 loizides 1.5 // load MCParticle branch
83 loizides 1.41 LoadEventObject(fMCPartName, fParticles);
84 loizides 1.5
85 ceballos 1.42 Bool_t isOld = kFALSE;
86     Int_t sumV[2] = {0, 0}; // W, Z
87     Int_t sumVVFlavor[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
88 ceballos 1.30 Double_t totalMET[3] = {0.0, 0.0, 0.0};
89 loizides 1.6 Bool_t isqqH = kFALSE;
90 loizides 1.5 for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
91 loizides 1.7 const MCParticle *p = fParticles->At(i);
92 ceballos 1.32
93 loizides 1.40 if(fPrintDebug)
94     p->Print("l");
95 ceballos 1.32
96 loizides 1.40 // rad photons
97 ceballos 1.34 if(p->Is(MCParticle::kGamma) && p->HasMother() && p->Mother()->Status() == 3 &&
98 ceballos 1.33 (p->Mother()->Is(MCParticle::kEl) || p->Mother()->Is(MCParticle::kMu) ||
99 ceballos 1.34 p->Mother()->Is(MCParticle::kTau)) &&
100 ceballos 1.32 p->Pt() > fPtRadPhotonMin && p->AbsEta() < fEtaRadPhotonMax) {
101     GenRadPhotons->Add(p);
102     }
103    
104     // ISR photons
105     if(p->Is(MCParticle::kGamma) && p->HasMother() && p->Mother()->IsQuark()) {
106     GenISRPhotons->Add(p);
107     }
108    
109 ceballos 1.30 // MET computation at generation level
110     if (p->Status() == 1 && !p->IsNeutrino()) {
111     totalMET[0] = totalMET[0] + p->Px();
112     totalMET[1] = totalMET[1] + p->Py();
113     totalMET[2] = totalMET[2] + p->Pz();
114     }
115 loizides 1.5
116     if (!p->IsGenerated()) continue;
117    
118     // muons/electrons from W/Z decays
119 loizides 1.7 if ((p->Is(MCParticle::kEl) || p->Is(MCParticle::kMu)) && p->Status() == 1) {
120 ceballos 1.14 if (p->Pt() > fPtLeptonMin && p->AbsEta() < fEtaLeptonMax) {
121 loizides 1.5 GenAllLeptons->Add(p);
122     }
123 loizides 1.6 Bool_t isGoodLepton = kFALSE;
124 loizides 1.7 const MCParticle *pm = p;
125 loizides 1.5 while (pm->HasMother() && isGoodLepton == kFALSE) {
126 loizides 1.21 if (pm->PdgId() == 92) // string reached, terminate loop
127     break;
128 loizides 1.29 if (pm->Mother()->Is(MCParticle::kZ) || pm->Mother()->Is(MCParticle::kW) ||
129     pm->Mother()->Is(MCParticle::kZp) || pm->Mother()->Is(MCParticle::kWp) ||
130     pm->Mother()->Is(MCParticle::kH)) {
131 loizides 1.5 GenLeptons->Add(p);
132     isGoodLepton = kTRUE;
133 loizides 1.7 break;
134 loizides 1.8 } else if (pm->Mother()->Is(MCParticle::kPi0) || pm->Mother()->Is(MCParticle::kEta)) {
135 loizides 1.7 // this is fake, but it is a trick to get rid of these cases and abort the loop
136     break;
137     }
138     pm = pm->Mother();
139 loizides 1.1 }
140 loizides 1.5 }
141    
142 loizides 1.7 // hadronic taus
143     else if (p->Is(MCParticle::kTau) && p->Status() == 2) {
144     if (!p->HasDaughter(MCParticle::kEl) && !p->HasDaughter(MCParticle::kMu)) {
145     const MCParticle *tv = p->FindDaughter(MCParticle::kTauNu);
146     if (tv) {
147     MCParticle *pm_f = new MCParticle(*p);
148     pm_f->SetMom(p->Px()-tv->Px(), p->Py()-tv->Py(),
149     p->Pz()-tv->Pz(), p->E()-tv->E());
150     GenTaus->AddOwned(pm_f);
151     } else {
152 loizides 1.18 SendError(kWarning, "Process", "Could not find a tau neutrino!");
153 loizides 1.5 }
154 loizides 1.1 }
155 loizides 1.5 }
156 loizides 1.1
157 loizides 1.5 // neutrinos
158 loizides 1.7 else if (p->Status() == 1 && p->IsNeutrino()) {
159 loizides 1.5 GenNeutrinos->Add(p);
160     }
161 loizides 1.1
162 loizides 1.5 // quarks from W/Z decays or top particles
163 loizides 1.7 else if (p->IsQuark() && p->HasMother()) {
164     if (p->Mother()->Is(MCParticle::kZ) || p->Mother()->Is(MCParticle::kW) ||
165     p->Is(MCParticle::kTop) || p->Mother()->Is(MCParticle::kTop)) {
166 loizides 1.5 GenQuarks->Add(p);
167 loizides 1.1 }
168 loizides 1.5 }
169 loizides 1.1
170 loizides 1.5 // qqH, information about the forward jets
171 loizides 1.8 else if (isqqH == kFALSE && p->Is(MCParticle::kH)) {
172 loizides 1.5 isqqH = kTRUE;
173 loizides 1.17 const MCParticle *pq1 = fParticles->At(i-1);
174     const MCParticle *pq2 = fParticles->At(i-2);
175 loizides 1.7 if (!pq1 || !pq2) {
176     SendError(kWarning, "Process", "Could not find quark pair!");
177 loizides 1.8 } else if (pq1->IsQuark() && pq2->IsQuark() &&
178     pq1->HasMother() && pq2->HasMother() &&
179 ceballos 1.36 pq1->Mother() == pq2->Mother()) {
180 loizides 1.5 GenqqHs->Add(pq1);
181     GenqqHs->Add(pq2);
182 loizides 1.1 }
183 ceballos 1.23
184 loizides 1.7 if (p->Status() == 3)
185 loizides 1.24 GenBosons->Add(p); // take higgs boson in account here rather in next else if
186 loizides 1.5 }
187 loizides 1.1
188 loizides 1.5 // information about bosons: W, Z, h, Z', W', H0, A0, H+
189 loizides 1.7 else if (p->Status() == 3 &&
190     (p->Is(MCParticle::kZ) || p->Is(MCParticle::kW) || p->Is(MCParticle::kH) ||
191     p->Is(MCParticle::kZp) || p->Is(MCParticle::kZpp) ||
192     p->Is(MCParticle::kH0) || p->Is(MCParticle::kA0) || p->Is(MCParticle::kHp))) {
193 loizides 1.5 GenBosons->Add(p);
194 ceballos 1.42 if (p->Is(MCParticle::kW)) sumV[0]++;
195     else if(p->Is(MCParticle::kZ)) sumV[1]++;
196 loizides 1.46 if (p->Is(MCParticle::kW) && p->HasDaughter(MCParticle::kMu) &&
197     p->HasDaughter(MCParticle::kMuNu))
198 ceballos 1.42 sumVVFlavor[0]++;
199 loizides 1.46 else if(p->Is(MCParticle::kW) && p->HasDaughter(MCParticle::kEl) &&
200     p->HasDaughter(MCParticle::kElNu))
201 ceballos 1.42 sumVVFlavor[1]++;
202 loizides 1.46 else if(p->Is(MCParticle::kW) && p->HasDaughter(MCParticle::kTau) &&
203     p->HasDaughter(MCParticle::kTauNu))
204 ceballos 1.42 sumVVFlavor[2]++;
205 loizides 1.46 else if(p->Is(MCParticle::kZ) && p->HasDaughter(MCParticle::kMu,kTRUE) &&
206     p->HasDaughter(-1*MCParticle::kMu,kTRUE))
207 ceballos 1.42 sumVVFlavor[3]++;
208 loizides 1.46 else if(p->Is(MCParticle::kZ) && p->HasDaughter(MCParticle::kEl,kTRUE) &&
209     p->HasDaughter(-1*MCParticle::kEl,kTRUE))
210 ceballos 1.42 sumVVFlavor[4]++;
211 loizides 1.46 else if(p->Is(MCParticle::kZ) && p->HasDaughter(MCParticle::kTau,kTRUE) &&
212     p->HasDaughter(-1*MCParticle::kTau,kTRUE))
213 ceballos 1.42 sumVVFlavor[5]++;
214 loizides 1.46 else if(p->Is(MCParticle::kZ) && p->HasDaughter(MCParticle::kMuNu,kTRUE) &&
215     p->HasDaughter(-1*MCParticle::kMuNu,kTRUE))
216 ceballos 1.42 sumVVFlavor[6]++;
217 loizides 1.46 else if(p->Is(MCParticle::kZ) && p->HasDaughter(MCParticle::kElNu,kTRUE) &&
218     p->HasDaughter(-1*MCParticle::kElNu,kTRUE))
219 ceballos 1.42 sumVVFlavor[7]++;
220 loizides 1.46 else if(p->Is(MCParticle::kZ) && p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
221     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE))
222 ceballos 1.42 sumVVFlavor[8]++;
223 loizides 1.1 }
224 ceballos 1.10
225 ceballos 1.14 // photons
226 ceballos 1.10 else if (p->Status() == 1 && p->Is(MCParticle::kGamma) &&
227 ceballos 1.14 p->Pt() > fPtPhotonMin && p->AbsEta() < fEtaPhotonMax) {
228 ceballos 1.10 GenPhotons->Add(p);
229     }
230    
231 loizides 1.18 // W/Z -> lnu for Madgraph
232 loizides 1.28 if (p->IsParton() && p->NDaughters() >= 2) {
233 ceballos 1.16 CompositeParticle *diBoson = new CompositeParticle();
234 loizides 1.18 if (p->HasDaughter(MCParticle::kMu) && p->HasDaughter(MCParticle::kMuNu)) {
235 ceballos 1.42 isOld = kFALSE;
236     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
237     if(p->FindDaughter(MCParticle::kMu) == GenTempMG0->At(nl)) {
238     isOld = kTRUE;
239     break;
240     }
241     }
242     if(isOld == kFALSE){
243     GenTempMG0->Add(p->FindDaughter(MCParticle::kMu));
244     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu));
245     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu));
246     sumV[0]++;
247     sumVVFlavor[0]++;
248     if (GetFillHist())
249     hDVMass[0]->Fill(TMath::Min(diBoson->Mass(),199.999));
250     const MCParticle *tmp_mu = p->FindDaughter(MCParticle::kMu);
251     while (tmp_mu->HasDaughter(MCParticle::kMu) &&
252     tmp_mu->FindDaughter(MCParticle::kMu)->IsGenerated())
253     tmp_mu = tmp_mu->FindDaughter(MCParticle::kMu);
254    
255     GenLeptons->Add(tmp_mu);
256     }
257     }
258     if (p->HasDaughter(MCParticle::kEl) && p->HasDaughter(MCParticle::kElNu)) {
259     isOld = kFALSE;
260     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
261     if(p->FindDaughter(MCParticle::kEl) == GenTempMG0->At(nl)) {
262     isOld = kTRUE;
263     break;
264     }
265     }
266     if(isOld == kFALSE){
267     GenTempMG0->Add(p->FindDaughter(MCParticle::kEl));
268     diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl));
269     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu));
270     sumV[0]++;
271     sumVVFlavor[1]++;
272     if (GetFillHist())
273     hDVMass[1]->Fill(TMath::Min(diBoson->Mass(),199.999));
274     const MCParticle *tmp_e = p->FindDaughter(MCParticle::kEl);
275     while (tmp_e->HasDaughter(MCParticle::kEl) &&
276     tmp_e->FindDaughter(MCParticle::kEl)->IsGenerated())
277     tmp_e = tmp_e->FindDaughter(MCParticle::kEl);
278     GenLeptons->Add(tmp_e);
279     }
280     }
281     if (p->HasDaughter(MCParticle::kTau) && p->HasDaughter(MCParticle::kTauNu)) {
282     isOld = kFALSE;
283     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
284     if(p->FindDaughter(MCParticle::kTau) == GenTempMG0->At(nl)) {
285     isOld = kTRUE;
286     break;
287     }
288     }
289     if(isOld == kFALSE){
290     GenTempMG0->Add(p->FindDaughter(MCParticle::kTau));
291     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau));
292     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu));
293     sumV[0]++;
294     sumVVFlavor[2]++;
295     if (GetFillHist())
296     hDVMass[2]->Fill(TMath::Min(diBoson->Mass(),199.999));
297     const MCParticle *tau = p->FindDaughter(MCParticle::kTau);
298     if (tau->HasDaughter(MCParticle::kMu))
299     GenLeptons->Add(tau->FindDaughter(MCParticle::kMu));
300     if (tau->HasDaughter(MCParticle::kEl))
301     GenLeptons->Add(tau->FindDaughter(MCParticle::kEl));
302     if (tau->HasDaughter(MCParticle::kTau)) {
303     const MCParticle *tau_second = tau->FindDaughter(MCParticle::kTau);
304     if (tau_second->HasDaughter(MCParticle::kMu))
305     GenLeptons->Add(tau_second->FindDaughter(MCParticle::kMu));
306     if (tau_second->HasDaughter(MCParticle::kEl))
307     GenLeptons->Add(tau_second->FindDaughter(MCParticle::kEl));
308     }
309     }
310     }
311     if (p->HasDaughter(MCParticle::kMu,kTRUE) && p->HasDaughter(-1*MCParticle::kMu,kTRUE)) {
312     isOld = kFALSE;
313     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
314     if(p->FindDaughter(MCParticle::kMu,kTRUE) == GenTempMG0->At(nl)) {
315     isOld = kTRUE;
316     break;
317     }
318     }
319     if(isOld == kFALSE){
320     GenTempMG0->Add(p->FindDaughter(MCParticle::kMu,kTRUE));
321     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu,kTRUE));
322     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kMu,kTRUE));
323     sumV[1]++;
324     sumVVFlavor[3]++;
325     if (GetFillHist())
326     hDVMass[3]->Fill(TMath::Min(diBoson->Mass(),199.999));
327     const MCParticle *tmp_mu0 = p->FindDaughter(MCParticle::kMu,kTRUE);
328     while (tmp_mu0->HasDaughter(MCParticle::kMu) &&
329     tmp_mu0->FindDaughter(MCParticle::kMu)->IsGenerated())
330     tmp_mu0 = tmp_mu0->FindDaughter(MCParticle::kMu);
331     const MCParticle *tmp_mu1 = p->FindDaughter(-1*MCParticle::kMu,kTRUE);
332     while (tmp_mu1->HasDaughter(MCParticle::kMu) &&
333     tmp_mu1->FindDaughter(MCParticle::kMu)->IsGenerated())
334     tmp_mu1 = tmp_mu1->FindDaughter(MCParticle::kMu);
335     GenLeptons->Add(tmp_mu0);
336     GenLeptons->Add(tmp_mu1);
337     }
338     }
339     if (p->HasDaughter(MCParticle::kEl,kTRUE) && p->HasDaughter(-1*MCParticle::kEl,kTRUE)) {
340     isOld = kFALSE;
341     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
342     if(p->FindDaughter(MCParticle::kEl,kTRUE) == GenTempMG0->At(nl)) {
343     isOld = kTRUE;
344     break;
345     }
346     }
347     if(isOld == kFALSE){
348     GenTempMG0->Add(p->FindDaughter(MCParticle::kEl,kTRUE));
349     diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl,kTRUE));
350     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kEl,kTRUE));
351     sumV[1]++;
352     sumVVFlavor[4]++;
353     if (GetFillHist())
354     hDVMass[4]->Fill(TMath::Min(diBoson->Mass(),199.999));
355     const MCParticle *tmp_e0 = p->Daughter(0);
356     while (tmp_e0->HasDaughter(MCParticle::kEl) &&
357     tmp_e0->FindDaughter(MCParticle::kEl)->IsGenerated())
358     tmp_e0 = tmp_e0->FindDaughter(MCParticle::kEl);
359     const MCParticle *tmp_e1 = p->Daughter(1);
360     while (tmp_e1->HasDaughter(MCParticle::kEl) &&
361     tmp_e1->FindDaughter(MCParticle::kEl)->IsGenerated())
362     tmp_e1 = tmp_e1->FindDaughter(MCParticle::kEl);
363     GenLeptons->Add(tmp_e0);
364     GenLeptons->Add(tmp_e1);
365     }
366     }
367     if (p->HasDaughter(MCParticle::kTau,kTRUE) && p->HasDaughter(-1*MCParticle::kTau,kTRUE)) {
368     isOld = kFALSE;
369     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
370     if(p->FindDaughter(MCParticle::kTau,kTRUE) == GenTempMG0->At(nl)) {
371     isOld = kTRUE;
372     break;
373     }
374     }
375     if(isOld == kFALSE){
376     GenTempMG0->Add(p->FindDaughter(MCParticle::kTau,kTRUE));
377     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau,kTRUE));
378     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kTau,kTRUE));
379     sumV[1]++;
380     sumVVFlavor[5]++;
381     if (GetFillHist())
382     hDVMass[5]->Fill(TMath::Min(diBoson->Mass(),199.999));
383     const MCParticle *tau0 = p->Daughter(0);
384     if (tau0->HasDaughter(MCParticle::kMu))
385     GenLeptons->Add(tau0->FindDaughter(MCParticle::kMu));
386     if (tau0->HasDaughter(MCParticle::kEl))
387     GenLeptons->Add(tau0->FindDaughter(MCParticle::kEl));
388     const MCParticle *tau1 = p->Daughter(1);
389     if (tau1->HasDaughter(MCParticle::kMu))
390     GenLeptons->Add(tau1->FindDaughter(MCParticle::kMu));
391     if (tau1->HasDaughter(MCParticle::kEl))
392     GenLeptons->Add(tau1->FindDaughter(MCParticle::kEl));
393     if (tau0->HasDaughter(MCParticle::kTau)) {
394     const MCParticle *tau0_second = tau0->FindDaughter(MCParticle::kTau);
395     if (tau0_second->HasDaughter(MCParticle::kMu))
396     GenLeptons->Add(tau0_second->FindDaughter(MCParticle::kMu));
397     if (tau0_second->HasDaughter(MCParticle::kEl))
398     GenLeptons->Add(tau0_second->FindDaughter(MCParticle::kEl));
399     }
400     if (tau1->HasDaughter(MCParticle::kTau)) {
401     const MCParticle *tau1_second = tau1->FindDaughter(MCParticle::kTau);
402     if (tau1_second->HasDaughter(MCParticle::kMu))
403     GenLeptons->Add(tau1_second->FindDaughter(MCParticle::kMu));
404     if (tau1_second->HasDaughter(MCParticle::kEl))
405     GenLeptons->Add(tau1_second->FindDaughter(MCParticle::kEl));
406     }
407     }
408 ceballos 1.16 }
409 ceballos 1.42 if (p->HasDaughter(MCParticle::kMuNu,kTRUE) && p->HasDaughter(-1*MCParticle::kMuNu,kTRUE)) {
410     isOld = kFALSE;
411     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
412     if(p->FindDaughter(MCParticle::kMuNu,kTRUE) == GenTempMG0->At(nl)) {
413     isOld = kTRUE;
414     break;
415     }
416     }
417     if(isOld == kFALSE){
418     GenTempMG0->Add(p->FindDaughter(MCParticle::kMuNu,kTRUE));
419     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu,kTRUE));
420     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kMuNu,kTRUE));
421     sumV[1]++;
422     sumVVFlavor[6]++;
423     if (GetFillHist())
424     hDVMass[6]->Fill(TMath::Min(diBoson->Mass(),199.999));
425     }
426 ceballos 1.16 }
427 ceballos 1.42 if (p->HasDaughter(MCParticle::kElNu,kTRUE) && p->HasDaughter(-1*MCParticle::kElNu,kTRUE)) {
428     isOld = kFALSE;
429     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
430     if(p->FindDaughter(MCParticle::kElNu,kTRUE) == GenTempMG0->At(nl)) {
431     isOld = kTRUE;
432     break;
433     }
434     }
435     if(isOld == kFALSE){
436     GenTempMG0->Add(p->FindDaughter(MCParticle::kElNu,kTRUE));
437     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu,kTRUE));
438     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kElNu,kTRUE));
439     sumV[1]++;
440     sumVVFlavor[7]++;
441     if (GetFillHist())
442     hDVMass[7]->Fill(TMath::Min(diBoson->Mass(),199.999));
443     }
444 loizides 1.18 }
445 ceballos 1.42 if (p->HasDaughter(MCParticle::kTauNu,kTRUE) && p->HasDaughter(-1*MCParticle::kTauNu,kTRUE)) {
446     isOld = kFALSE;
447     for(UInt_t nl = 0; nl < GenTempMG0->GetEntries(); nl++){
448     if(p->FindDaughter(MCParticle::kTauNu,kTRUE) == GenTempMG0->At(nl)) {
449     isOld = kTRUE;
450     break;
451     }
452     }
453     if(isOld == kFALSE){
454     GenTempMG0->Add(p->FindDaughter(MCParticle::kTauNu,kTRUE));
455     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu,kTRUE));
456     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kTauNu,kTRUE));
457     sumV[1]++;
458     sumVVFlavor[8]++;
459     if (GetFillHist())
460     hDVMass[8]->Fill(TMath::Min(diBoson->Mass(),199.999));
461     }
462 ceballos 1.16 }
463     delete diBoson;
464     }
465    
466 loizides 1.18 // t -> lnu for Madgraph
467     if (p->Is(MCParticle::kTop)) {
468 ceballos 1.16 CompositeParticle *diBoson = new CompositeParticle();
469 loizides 1.18 if (p->HasDaughter(MCParticle::kMu) && p->HasDaughter(MCParticle::kMuNu)) {
470 ceballos 1.16 diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu));
471     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu));
472 loizides 1.20 if (GetFillHist())
473 ceballos 1.42 hDVMass[9]->Fill(TMath::Min(diBoson->Mass(),199.999));
474 ceballos 1.16 GenLeptons->Add(p->FindDaughter(MCParticle::kMu));
475     }
476 loizides 1.18 else if (p->HasDaughter(MCParticle::kEl) && p->HasDaughter(MCParticle::kElNu)) {
477 ceballos 1.16 diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl));
478     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu));
479 loizides 1.20 if (GetFillHist())
480 ceballos 1.42 hDVMass[10]->Fill(TMath::Min(diBoson->Mass(),199.999));
481 ceballos 1.16 GenLeptons->Add(p->FindDaughter(MCParticle::kEl));
482     }
483 loizides 1.18 else if (p->HasDaughter(MCParticle::kTau) && p->HasDaughter(MCParticle::kTauNu)) {
484 ceballos 1.16 diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau));
485     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu));
486 loizides 1.20 if (GetFillHist())
487 ceballos 1.42 hDVMass[11]->Fill(TMath::Min(diBoson->Mass(),199.999));
488 loizides 1.18 const MCParticle *tau = p->FindDaughter(MCParticle::kTau);
489     if (tau->HasDaughter(MCParticle::kMu))
490     GenLeptons->Add(tau->FindDaughter(MCParticle::kMu));
491     if (tau->HasDaughter(MCParticle::kEl))
492     GenLeptons->Add(tau->FindDaughter(MCParticle::kEl));
493     }
494     else if (!p->HasDaughter(MCParticle::kW)) {
495     for(UInt_t nd=0; nd<p->NDaughters(); ++nd)
496     if (p->Daughter(nd)->IsNot(MCParticle::kBottom) &&
497     p->Daughter(nd)->IsNot(MCParticle::kGamma))
498     diBoson->AddDaughter(p->Daughter(nd));
499 loizides 1.20 if (GetFillHist())
500 ceballos 1.42 hDVMass[12]->Fill(TMath::Min(diBoson->Mass(),199.999));
501 ceballos 1.16 }
502     delete diBoson;
503     }
504 ceballos 1.26
505 loizides 1.27 // mass cut for given pid
506     if(fPdgIdCut && p->Is(fPdgIdCut) &&
507 ceballos 1.26 (p->Mass() < fMassMinCut || p->Mass() > fMassMaxCut)) {
508     SkipEvent();
509     return;
510 sixie 1.35 }
511 loizides 1.27 } // end loop of particles
512 loizides 1.1
513 ceballos 1.42 delete GenTempMG0;
514    
515 ceballos 1.44 // --------------------------------
516     // Begin special study about VVjets
517     // --------------------------------
518     if(sumV[0] + 4*sumV[1] == 2 || sumV[0] + 4*sumV[1] == 5 || sumV[0] + 4*sumV[1] == 8){
519     MCParticleOArr *GenTempMG1 = new MCParticleOArr;
520     Double_t diBosonMass[2] = {0., 0.};
521     for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
522     const MCParticle *p = fParticles->At(i);
523    
524     if (p->IsParton() && p->NDaughters() >= 2) {
525     CompositeParticle *diBoson = new CompositeParticle();
526     if (p->HasDaughter(MCParticle::kMu) && p->HasDaughter(MCParticle::kMuNu)) {
527     isOld = kFALSE;
528     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
529     if(p->FindDaughter(MCParticle::kMu) == GenTempMG1->At(nl)) {
530     isOld = kTRUE;
531     break;
532     }
533     }
534     if(isOld == kFALSE){
535     GenTempMG1->Add(p->FindDaughter(MCParticle::kMu));
536     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu));
537     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu));
538     if (GetFillHist() && sumV[0] + 4*sumV[1] == 2)
539     hDVVMass[0]->Fill(TMath::Min(diBoson->Mass(),199.999));
540     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
541     hDVVMass[1]->Fill(TMath::Min(diBoson->Mass(),199.999));
542     }
543     }
544     if (p->HasDaughter(MCParticle::kEl) && p->HasDaughter(MCParticle::kElNu)) {
545     isOld = kFALSE;
546     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
547     if(p->FindDaughter(MCParticle::kEl) == GenTempMG1->At(nl)) {
548     isOld = kTRUE;
549     break;
550     }
551     }
552     if(isOld == kFALSE){
553     GenTempMG1->Add(p->FindDaughter(MCParticle::kEl));
554     diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl));
555     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu));
556     if (GetFillHist() && sumV[0] + 4*sumV[1] == 2)
557     hDVVMass[2]->Fill(TMath::Min(diBoson->Mass(),199.999));
558     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
559     hDVVMass[3]->Fill(TMath::Min(diBoson->Mass(),199.999));
560     }
561     }
562     if (p->HasDaughter(MCParticle::kTau) && p->HasDaughter(MCParticle::kTauNu)) {
563     isOld = kFALSE;
564     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
565     if(p->FindDaughter(MCParticle::kTau) == GenTempMG1->At(nl)) {
566     isOld = kTRUE;
567     break;
568     }
569     }
570     if(isOld == kFALSE){
571     GenTempMG1->Add(p->FindDaughter(MCParticle::kTau));
572     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau));
573     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu));
574     if (GetFillHist() && sumV[0] + 4*sumV[1] == 2)
575     hDVVMass[4]->Fill(TMath::Min(diBoson->Mass(),199.999));
576     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
577     hDVVMass[5]->Fill(TMath::Min(diBoson->Mass(),199.999));
578     }
579     }
580     if (p->HasDaughter(MCParticle::kMu,kTRUE) && p->HasDaughter(-1*MCParticle::kMu,kTRUE)) {
581     isOld = kFALSE;
582     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
583     if(p->FindDaughter(MCParticle::kMu,kTRUE) == GenTempMG1->At(nl)) {
584     isOld = kTRUE;
585     break;
586     }
587     }
588     if(isOld == kFALSE){
589     GenTempMG1->Add(p->FindDaughter(MCParticle::kMu,kTRUE));
590     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu,kTRUE));
591     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kMu,kTRUE));
592     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
593     hDVVMass[6]->Fill(TMath::Min(diBoson->Mass(),199.999));
594     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
595     hDVVMass[7]->Fill(TMath::Min(diBoson->Mass(),199.999));
596     }
597     }
598     if (p->HasDaughter(MCParticle::kEl,kTRUE) && p->HasDaughter(-1*MCParticle::kEl,kTRUE)) {
599     isOld = kFALSE;
600     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
601     if(p->FindDaughter(MCParticle::kEl,kTRUE) == GenTempMG1->At(nl)) {
602     isOld = kTRUE;
603     break;
604     }
605     }
606     if(isOld == kFALSE){
607     GenTempMG1->Add(p->FindDaughter(MCParticle::kEl,kTRUE));
608     diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl,kTRUE));
609     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kEl,kTRUE));
610     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
611     hDVVMass[8]->Fill(TMath::Min(diBoson->Mass(),199.999));
612     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
613     hDVVMass[9]->Fill(TMath::Min(diBoson->Mass(),199.999));
614     }
615     }
616     if (p->HasDaughter(MCParticle::kTau,kTRUE) && p->HasDaughter(-1*MCParticle::kTau,kTRUE)) {
617     isOld = kFALSE;
618     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
619     if(p->FindDaughter(MCParticle::kTau,kTRUE) == GenTempMG1->At(nl)) {
620     isOld = kTRUE;
621     break;
622     }
623     }
624     if(isOld == kFALSE){
625     GenTempMG1->Add(p->FindDaughter(MCParticle::kTau,kTRUE));
626     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau,kTRUE));
627     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kTau,kTRUE));
628     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
629     hDVVMass[10]->Fill(TMath::Min(diBoson->Mass(),199.999));
630     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
631     hDVVMass[11]->Fill(TMath::Min(diBoson->Mass(),199.999));
632     }
633     }
634     if (p->HasDaughter(MCParticle::kMuNu,kTRUE) && p->HasDaughter(-1*MCParticle::kMuNu,kTRUE)) {
635     isOld = kFALSE;
636     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
637     if(p->FindDaughter(MCParticle::kMuNu,kTRUE) == GenTempMG1->At(nl)) {
638     isOld = kTRUE;
639     break;
640     }
641     }
642     if(isOld == kFALSE){
643     GenTempMG1->Add(p->FindDaughter(MCParticle::kMuNu,kTRUE));
644     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu,kTRUE));
645     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kMuNu,kTRUE));
646     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
647     hDVVMass[12]->Fill(TMath::Min(diBoson->Mass(),199.999));
648     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
649     hDVVMass[13]->Fill(TMath::Min(diBoson->Mass(),199.999));
650     }
651     }
652     if (p->HasDaughter(MCParticle::kElNu,kTRUE) && p->HasDaughter(-1*MCParticle::kElNu,kTRUE)) {
653     isOld = kFALSE;
654     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
655     if(p->FindDaughter(MCParticle::kElNu,kTRUE) == GenTempMG1->At(nl)) {
656     isOld = kTRUE;
657     break;
658     }
659     }
660     if(isOld == kFALSE){
661     GenTempMG1->Add(p->FindDaughter(MCParticle::kElNu,kTRUE));
662     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu,kTRUE));
663     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kElNu,kTRUE));
664     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
665     hDVVMass[14]->Fill(TMath::Min(diBoson->Mass(),199.999));
666     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
667     hDVVMass[15]->Fill(TMath::Min(diBoson->Mass(),199.999));
668     }
669     }
670 loizides 1.46 if (p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
671     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE)) {
672 ceballos 1.44 isOld = kFALSE;
673     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
674     if(p->FindDaughter(MCParticle::kTauNu,kTRUE) == GenTempMG1->At(nl)) {
675     isOld = kTRUE;
676     break;
677     }
678     }
679     if(isOld == kFALSE){
680     GenTempMG1->Add(p->FindDaughter(MCParticle::kTauNu,kTRUE));
681     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu,kTRUE));
682     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kTauNu,kTRUE));
683     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
684     hDVVMass[16]->Fill(TMath::Min(diBoson->Mass(),199.999));
685     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
686     hDVVMass[17]->Fill(TMath::Min(diBoson->Mass(),199.999));
687     }
688     }
689     if (diBoson && diBosonMass[0] <= 0) diBosonMass[0] = diBoson->Mass();
690     else if(diBoson && diBosonMass[1] <= 0) diBosonMass[1] = diBoson->Mass();
691     delete diBoson;
692     }
693     else if (p->Status() == 3 && (p->Is(MCParticle::kZ) || p->Is(MCParticle::kW))) {
694     if (diBosonMass[0] <= 0) diBosonMass[0] = p->Mass();
695     else if(diBosonMass[1] <= 0) diBosonMass[1] = p->Mass();
696     if (GetFillHist()) {
697 loizides 1.46 if (sumV[0] + 4*sumV[1] == 2 && p->Is(MCParticle::kW) &&
698     p->HasDaughter(MCParticle::kMu) &&
699     p->HasDaughter(MCParticle::kMuNu))
700 ceballos 1.44 hDVVMass[0]->Fill(TMath::Min(p->Mass(),199.999));
701 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 2 && p->Is(MCParticle::kW) &&
702     p->HasDaughter(MCParticle::kEl) &&
703     p->HasDaughter(MCParticle::kElNu))
704 ceballos 1.44 hDVVMass[2]->Fill(TMath::Min(p->Mass(),199.999));
705 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 2 && p->Is(MCParticle::kW) &&
706     p->HasDaughter(MCParticle::kTau) &&
707     p->HasDaughter(MCParticle::kTauNu))
708 ceballos 1.44 hDVVMass[4]->Fill(TMath::Min(p->Mass(),199.999));
709 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kW) &&
710     p->HasDaughter(MCParticle::kMu) &&
711     p->HasDaughter(MCParticle::kMuNu))
712 ceballos 1.44 hDVVMass[1]->Fill(TMath::Min(p->Mass(),199.999));
713 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kW) &&
714     p->HasDaughter(MCParticle::kEl) &&
715     p->HasDaughter(MCParticle::kElNu))
716 ceballos 1.44 hDVVMass[3]->Fill(TMath::Min(p->Mass(),199.999));
717 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kW) &&
718     p->HasDaughter(MCParticle::kTau) &&
719     p->HasDaughter(MCParticle::kTauNu))
720 ceballos 1.44 hDVVMass[5]->Fill(TMath::Min(p->Mass(),199.999));
721 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
722     p->HasDaughter(MCParticle::kMu,kTRUE) &&
723     p->HasDaughter(-1*MCParticle::kMu,kTRUE))
724 ceballos 1.44 hDVVMass[6]->Fill(TMath::Min(p->Mass(),199.999));
725 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
726     p->HasDaughter(MCParticle::kEl,kTRUE) &&
727     p->HasDaughter(-1*MCParticle::kEl,kTRUE))
728 ceballos 1.44 hDVVMass[8]->Fill(TMath::Min(p->Mass(),199.999));
729 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
730     p->HasDaughter(MCParticle::kTau,kTRUE) &&
731     p->HasDaughter(-1*MCParticle::kTau,kTRUE))
732 ceballos 1.44 hDVVMass[10]->Fill(TMath::Min(p->Mass(),199.999));
733 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
734     p->HasDaughter(MCParticle::kMuNu,kTRUE) &&
735     p->HasDaughter(-1*MCParticle::kMuNu,kTRUE))
736 ceballos 1.44 hDVVMass[12]->Fill(TMath::Min(p->Mass(),199.999));
737 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
738     p->HasDaughter(MCParticle::kElNu,kTRUE) &&
739     p->HasDaughter(-1*MCParticle::kElNu,kTRUE))
740 ceballos 1.44 hDVVMass[14]->Fill(TMath::Min(p->Mass(),199.999));
741 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
742     p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
743     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE))
744 ceballos 1.44 hDVVMass[16]->Fill(TMath::Min(p->Mass(),199.999));
745 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
746     p->HasDaughter(MCParticle::kMu,kTRUE) &&
747     p->HasDaughter(-1*MCParticle::kMu,kTRUE))
748 ceballos 1.44 hDVVMass[7]->Fill(TMath::Min(p->Mass(),199.999));
749 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
750     p->HasDaughter(MCParticle::kEl,kTRUE) &&
751     p->HasDaughter(-1*MCParticle::kEl,kTRUE))
752 ceballos 1.44 hDVVMass[9]->Fill(TMath::Min(p->Mass(),199.999));
753 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
754     p->HasDaughter(MCParticle::kTau,kTRUE) &&
755     p->HasDaughter(-1*MCParticle::kTau,kTRUE))
756 ceballos 1.44 hDVVMass[11]->Fill(TMath::Min(p->Mass(),199.999));
757 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
758     p->HasDaughter(MCParticle::kMuNu,kTRUE) &&
759     p->HasDaughter(-1*MCParticle::kMuNu,kTRUE))
760 ceballos 1.44 hDVVMass[13]->Fill(TMath::Min(p->Mass(),199.999));
761 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
762     p->HasDaughter(MCParticle::kElNu,kTRUE) &&
763     p->HasDaughter(-1*MCParticle::kElNu,kTRUE))
764 ceballos 1.44 hDVVMass[15]->Fill(TMath::Min(p->Mass(),199.999));
765 loizides 1.46 else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
766     p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
767     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE))
768 ceballos 1.44 hDVVMass[17]->Fill(TMath::Min(p->Mass(),199.999));
769     }
770     }
771     } // end loop of particles
772 loizides 1.46 if(diBosonMass[0] > 70 && diBosonMass[0] < 110 &&
773     diBosonMass[1] > 70 && diBosonMass[1] < 110){
774 ceballos 1.44 if(sumV[0] + 4*sumV[1] == 2){
775     if (sumVVFlavor[0] == 2) hDVVMass[18]->Fill(0.);
776     else if(sumVVFlavor[1] == 2) hDVVMass[18]->Fill(1.);
777     else if(sumVVFlavor[2] == 2) hDVVMass[18]->Fill(2.);
778     else if(sumVVFlavor[0] == 1 && sumVVFlavor[1] == 1) hDVVMass[18]->Fill(3.);
779     else if(sumVVFlavor[0] == 1 && sumVVFlavor[2] == 1) hDVVMass[18]->Fill(4.);
780     else if(sumVVFlavor[1] == 1 && sumVVFlavor[2] == 1) hDVVMass[18]->Fill(5.);
781     else hDVVMass[18]->Fill(6.);
782     }
783     if(sumV[0] + 4*sumV[1] == 5){
784     if (sumVVFlavor[3] == 1 && sumVVFlavor[0] == 1) hDVVMass[19]->Fill(0.);
785     else if(sumVVFlavor[3] == 1 && sumVVFlavor[1] == 1) hDVVMass[19]->Fill(1.);
786     else if(sumVVFlavor[3] == 1 && sumVVFlavor[2] == 1) hDVVMass[19]->Fill(2.);
787     else if(sumVVFlavor[4] == 1 && sumVVFlavor[0] == 1) hDVVMass[19]->Fill(3.);
788     else if(sumVVFlavor[4] == 1 && sumVVFlavor[1] == 1) hDVVMass[19]->Fill(4.);
789     else if(sumVVFlavor[4] == 1 && sumVVFlavor[2] == 1) hDVVMass[19]->Fill(5.);
790     else if(sumVVFlavor[5] == 1 && sumVVFlavor[0] == 1) hDVVMass[19]->Fill(6.);
791     else if(sumVVFlavor[5] == 1 && sumVVFlavor[1] == 1) hDVVMass[19]->Fill(7.);
792     else if(sumVVFlavor[5] == 1 && sumVVFlavor[2] == 1) hDVVMass[19]->Fill(8.);
793     else hDVVMass[19]->Fill(9.);
794     }
795     if(sumV[0] + 4*sumV[1] == 8 &&
796     sumVVFlavor[3] + sumVVFlavor[4] +sumVVFlavor[5] == 2){
797     if (sumVVFlavor[3] == 2) hDVVMass[20]->Fill(0.);
798     else if(sumVVFlavor[4] == 2) hDVVMass[20]->Fill(1.);
799     else if(sumVVFlavor[5] == 2) hDVVMass[20]->Fill(2.);
800     else if(sumVVFlavor[3] == 1 && sumVVFlavor[4] == 1) hDVVMass[20]->Fill(3.);
801     else if(sumVVFlavor[3] == 1 && sumVVFlavor[5] == 1) hDVVMass[20]->Fill(4.);
802     else if(sumVVFlavor[4] == 1 && sumVVFlavor[5] == 1) hDVVMass[20]->Fill(5.);
803     else hDVVMass[20]->Fill(6.);
804     }
805     else if(sumV[0] + 4*sumV[1] == 8){
806     if (sumVVFlavor[6] == 2) hDVVMass[21]->Fill(0.);
807     else if(sumVVFlavor[7] == 2) hDVVMass[21]->Fill(1.);
808     else if(sumVVFlavor[8] == 2) hDVVMass[21]->Fill(2.);
809     else if(sumVVFlavor[3] == 1 && sumVVFlavor[6] == 1) hDVVMass[21]->Fill(3.);
810     else if(sumVVFlavor[3] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(4.);
811     else if(sumVVFlavor[3] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(5.);
812     else if(sumVVFlavor[4] == 1 && sumVVFlavor[6] == 1) hDVVMass[21]->Fill(6.);
813     else if(sumVVFlavor[4] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(7.);
814     else if(sumVVFlavor[4] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(8.);
815     else if(sumVVFlavor[5] == 1 && sumVVFlavor[6] == 1) hDVVMass[21]->Fill(9.);
816     else if(sumVVFlavor[5] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(10.);
817     else if(sumVVFlavor[5] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(11.);
818     else if(sumVVFlavor[6] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(12.);
819     else if(sumVVFlavor[6] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(13.);
820     else if(sumVVFlavor[7] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(14.);
821     else hDVVMass[21]->Fill(15.);
822     }
823     } // 60<mV1/2<120
824 loizides 1.46 if(sumV[0] + 4*sumV[1] == 2)
825     hDVVMass[22]->Fill(TMath::Min(TMath::Min(diBosonMass[0],diBosonMass[1]),199.999));
826     if(sumV[0] + 4*sumV[1] == 2)
827     hDVVMass[23]->Fill(TMath::Min(TMath::Max(diBosonMass[0],diBosonMass[1]),199.999));
828     if(sumV[0] + 4*sumV[1] == 5)
829     hDVVMass[24]->Fill(TMath::Min(TMath::Min(diBosonMass[0],diBosonMass[1]),199.999));
830     if(sumV[0] + 4*sumV[1] == 5)
831     hDVVMass[25]->Fill(TMath::Min(TMath::Max(diBosonMass[0],diBosonMass[1]),199.999));
832     if(sumV[0] + 4*sumV[1] == 8)
833     hDVVMass[26]->Fill(TMath::Min(TMath::Min(diBosonMass[0],diBosonMass[1]),199.999));
834     if(sumV[0] + 4*sumV[1] == 8)
835     hDVVMass[27]->Fill(TMath::Min(TMath::Max(diBosonMass[0],diBosonMass[1]),199.999));
836 ceballos 1.44 delete GenTempMG1;
837     } // WW, WZ or ZZ
838     // --------------------------------
839     // End special study about VVjets
840     // --------------------------------
841    
842 ceballos 1.30 Met *theMET = new Met(totalMET[0], totalMET[1]);
843     theMET->SetElongitudinal(totalMET[2]);
844     GenMet->AddOwned(theMET);
845    
846 loizides 1.19 // sort according to pt
847     GenLeptons->Sort();
848     GenAllLeptons->Sort();
849     GenTaus->Sort();
850     GenNeutrinos->Sort();
851     GenQuarks->Sort();
852     GenqqHs->Sort();
853     GenBosons->Sort();
854     GenPhotons->Sort();
855 ceballos 1.32 GenRadPhotons->Sort();
856     GenISRPhotons->Sort();
857 loizides 1.19
858 loizides 1.8 // add objects to this event for other modules to use
859 ceballos 1.30 AddObjThisEvt(GenMet);
860 loizides 1.13 AddObjThisEvt(GenLeptons);
861     AddObjThisEvt(GenAllLeptons);
862     AddObjThisEvt(GenTaus);
863     AddObjThisEvt(GenNeutrinos);
864     AddObjThisEvt(GenQuarks);
865     AddObjThisEvt(GenqqHs);
866     AddObjThisEvt(GenBosons);
867     AddObjThisEvt(GenPhotons);
868 ceballos 1.32 AddObjThisEvt(GenRadPhotons);
869     AddObjThisEvt(GenISRPhotons);
870    
871 loizides 1.5 // fill histograms if requested
872 loizides 1.20 if (GetFillHist()) {
873 loizides 1.5
874 ceballos 1.30 // MET
875     hDGenMet[0]->Fill(GenMet->At(0)->Pt());
876     hDGenMet[1]->Fill(GenMet->At(0)->Px());
877     hDGenMet[2]->Fill(GenMet->At(0)->Py());
878     hDGenMet[3]->Fill(GenMet->At(0)->Elongitudinal());
879    
880 loizides 1.6 // leptons
881 loizides 1.1 hDGenLeptons[0]->Fill(GenLeptons->GetEntries());
882 loizides 1.5 for(UInt_t i=0; i<GenLeptons->GetEntries(); i++) {
883 loizides 1.1 hDGenLeptons[1]->Fill(GenLeptons->At(i)->Pt());
884 loizides 1.5 hDGenLeptons[2]->Fill(TMath::Abs(GenLeptons->At(i)->Eta()));
885     hDGenLeptons[3]->Fill(GenLeptons->At(i)->PhiDeg());
886     for(UInt_t j=i+1; j<GenLeptons->GetEntries(); j++) {
887 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
888     dilepton->AddDaughter(GenLeptons->At(i));
889     dilepton->AddDaughter(GenLeptons->At(j));
890     hDGenLeptons[4]->Fill(dilepton->Mass());
891     delete dilepton;
892     }
893 ceballos 1.22 }
894     // looking at events with two leptons
895     if (GenLeptons->GetEntries() == 2) {
896     hDGenLeptons[5]->Fill(TMath::Min(TMath::Max(TMath::Abs(GenLeptons->At(0)->Eta()),
897     TMath::Abs(GenLeptons->At(1)->Eta())),
898 loizides 1.5 4.999));
899 ceballos 1.22 hDGenLeptons[6]->Fill(TMath::Min(TMath::Min(TMath::Abs(GenLeptons->At(0)->Eta()),
900     TMath::Abs(GenLeptons->At(1)->Eta())),
901 loizides 1.5 4.999));
902 ceballos 1.22 if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
903     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
904     hDGenLeptons[7]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
905     if (GenLeptons->At(0)->Pt() > 20.0) {
906     hDGenLeptons[8]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
907     if (GenLeptons->At(1)->Pt() > 10.0) {
908 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
909 ceballos 1.22 dilepton->AddDaughter(GenLeptons->At(0));
910     dilepton->AddDaughter(GenLeptons->At(1));
911 loizides 1.1 hDGenLeptons[9]->Fill(TMath::Min(dilepton->Mass(),999.999));
912 ceballos 1.22 if(dilepton->Mass() > 12.0){
913     hDGenLeptons[10]->Fill(MathUtils::DeltaPhi(GenLeptons->At(0)->Phi(),
914     GenLeptons->At(1)->Phi())
915     * 180./ TMath::Pi());
916 loizides 1.40 hDGenLeptons[11]->Fill(MathUtils::DeltaR(*GenLeptons->At(0),
917     *GenLeptons->At(1)));
918 ceballos 1.22 }
919 loizides 1.1 delete dilepton;
920     }
921     }
922     }
923     }
924 ceballos 1.22 // looking at events with three leptons
925     if (GenLeptons->GetEntries() == 3) {
926     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
927     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
928     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5) {
929     hDGenLeptons[12]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
930     if (GenLeptons->At(0)->Pt() > 20.0) {
931     hDGenLeptons[13]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
932     hDGenLeptons[14]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
933     if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0) {
934     CompositeParticle *dilepton01 = new CompositeParticle();
935     dilepton01->AddDaughter(GenLeptons->At(0));
936     dilepton01->AddDaughter(GenLeptons->At(1));
937     CompositeParticle *dilepton02 = new CompositeParticle();
938     dilepton02->AddDaughter(GenLeptons->At(0));
939     dilepton02->AddDaughter(GenLeptons->At(2));
940     CompositeParticle *dilepton12 = new CompositeParticle();
941     dilepton12->AddDaughter(GenLeptons->At(1));
942     dilepton12->AddDaughter(GenLeptons->At(2));
943     hDGenLeptons[15]->Fill(TMath::Min(dilepton01->Mass(),999.999));
944     hDGenLeptons[15]->Fill(TMath::Min(dilepton02->Mass(),999.999));
945     hDGenLeptons[15]->Fill(TMath::Min(dilepton12->Mass(),999.999));
946     CompositeParticle *trilepton = new CompositeParticle();
947     trilepton->AddDaughter(GenLeptons->At(0));
948     trilepton->AddDaughter(GenLeptons->At(1));
949     trilepton->AddDaughter(GenLeptons->At(2));
950     hDGenLeptons[16]->Fill(TMath::Min(trilepton->Mass(),999.999));
951 loizides 1.40 Double_t deltaR[3] = {MathUtils::DeltaR(*GenLeptons->At(0),
952     *GenLeptons->At(1)),
953     MathUtils::DeltaR(*GenLeptons->At(0),
954     *GenLeptons->At(2)),
955     MathUtils::DeltaR(*GenLeptons->At(1),
956     *GenLeptons->At(2))};
957 loizides 1.27 Double_t deltaRMin = deltaR[0];
958 loizides 1.40 for(Int_t i=1; i<3; i++)
959     if(deltaRMin > deltaR[i])
960     deltaRMin = deltaR[i];
961 ceballos 1.22 hDGenLeptons[17]->Fill(deltaRMin);
962    
963     delete dilepton01;
964     delete dilepton02;
965     delete dilepton12;
966     delete trilepton;
967     }
968     }
969     }
970     }
971     // looking at events with four leptons
972     if (GenLeptons->GetEntries() == 4) {
973     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
974     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
975     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5 &&
976     TMath::Abs(GenLeptons->At(3)->Eta()) < 2.5) {
977     hDGenLeptons[18]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
978     if (GenLeptons->At(0)->Pt() > 20.0) {
979     hDGenLeptons[19]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
980     hDGenLeptons[20]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
981     hDGenLeptons[21]->Fill(TMath::Min(GenLeptons->At(3)->Pt(),199.999));
982     if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0 &&
983     GenLeptons->At(3)->Pt() > 10.0) {
984     CompositeParticle *dilepton01 = new CompositeParticle();
985     dilepton01->AddDaughter(GenLeptons->At(0));
986     dilepton01->AddDaughter(GenLeptons->At(1));
987     CompositeParticle *dilepton02 = new CompositeParticle();
988     dilepton02->AddDaughter(GenLeptons->At(0));
989     dilepton02->AddDaughter(GenLeptons->At(2));
990     CompositeParticle *dilepton03 = new CompositeParticle();
991     dilepton03->AddDaughter(GenLeptons->At(0));
992     dilepton03->AddDaughter(GenLeptons->At(3));
993     CompositeParticle *dilepton12 = new CompositeParticle();
994     dilepton12->AddDaughter(GenLeptons->At(1));
995     dilepton12->AddDaughter(GenLeptons->At(2));
996     CompositeParticle *dilepton13 = new CompositeParticle();
997     dilepton13->AddDaughter(GenLeptons->At(1));
998     dilepton13->AddDaughter(GenLeptons->At(3));
999     CompositeParticle *dilepton23 = new CompositeParticle();
1000     dilepton23->AddDaughter(GenLeptons->At(2));
1001     dilepton23->AddDaughter(GenLeptons->At(3));
1002     hDGenLeptons[22]->Fill(TMath::Min(dilepton01->Mass(),999.999));
1003     hDGenLeptons[22]->Fill(TMath::Min(dilepton02->Mass(),999.999));
1004     hDGenLeptons[22]->Fill(TMath::Min(dilepton03->Mass(),999.999));
1005     hDGenLeptons[22]->Fill(TMath::Min(dilepton12->Mass(),999.999));
1006     hDGenLeptons[22]->Fill(TMath::Min(dilepton13->Mass(),999.999));
1007     hDGenLeptons[22]->Fill(TMath::Min(dilepton23->Mass(),999.999));
1008     CompositeParticle *fourlepton = new CompositeParticle();
1009     fourlepton->AddDaughter(GenLeptons->At(0));
1010     fourlepton->AddDaughter(GenLeptons->At(1));
1011     fourlepton->AddDaughter(GenLeptons->At(2));
1012     fourlepton->AddDaughter(GenLeptons->At(3));
1013     hDGenLeptons[23]->Fill(TMath::Min(fourlepton->Mass(),999.999));
1014 loizides 1.40 Double_t deltaR[6] = {MathUtils::DeltaR(*GenLeptons->At(0),
1015     *GenLeptons->At(1)),
1016     MathUtils::DeltaR(*GenLeptons->At(0),
1017     *GenLeptons->At(2)),
1018     MathUtils::DeltaR(*GenLeptons->At(0),
1019     *GenLeptons->At(3)),
1020     MathUtils::DeltaR(*GenLeptons->At(1),
1021     *GenLeptons->At(2)),
1022     MathUtils::DeltaR(*GenLeptons->At(1),
1023     *GenLeptons->At(3)),
1024     MathUtils::DeltaR(*GenLeptons->At(2),
1025     *GenLeptons->At(3))};
1026 loizides 1.27 Double_t deltaRMin = deltaR[0];
1027 loizides 1.40 for(Int_t i=1; i<6; i++)
1028     if(deltaRMin > deltaR[i])
1029     deltaRMin = deltaR[i];
1030 ceballos 1.22 hDGenLeptons[24]->Fill(deltaRMin);
1031    
1032     delete dilepton01;
1033     delete dilepton02;
1034     delete dilepton03;
1035     delete dilepton12;
1036     delete dilepton13;
1037     delete dilepton23;
1038     delete fourlepton;
1039     }
1040     }
1041     }
1042     }
1043 loizides 1.1
1044 loizides 1.6 // all leptons
1045 ceballos 1.3 hDGenAllLeptons[0]->Fill(GenAllLeptons->GetEntries());
1046 loizides 1.5 for(UInt_t i=0; i<GenAllLeptons->GetEntries(); i++) {
1047 ceballos 1.3 hDGenAllLeptons[1]->Fill(GenAllLeptons->At(i)->Pt());
1048     hDGenAllLeptons[2]->Fill(GenAllLeptons->At(i)->Eta());
1049 loizides 1.5 hDGenAllLeptons[3]->Fill(GenAllLeptons->At(i)->PhiDeg());
1050 ceballos 1.3 }
1051    
1052 loizides 1.6 // taus
1053 loizides 1.1 hDGenTaus[0]->Fill(GenTaus->GetEntries());
1054 loizides 1.5 for(UInt_t i=0; i<GenTaus->GetEntries(); i++) {
1055 loizides 1.1 hDGenTaus[1]->Fill(GenTaus->At(i)->Pt());
1056     hDGenTaus[2]->Fill(GenTaus->At(i)->Eta());
1057 loizides 1.5 hDGenTaus[3]->Fill(GenTaus->At(i)->PhiDeg());
1058 loizides 1.1 }
1059    
1060 loizides 1.6 // neutrinos
1061 loizides 1.1 hDGenNeutrinos[0]->Fill(GenNeutrinos->GetEntries());
1062     CompositeParticle *neutrinoTotal = new CompositeParticle();
1063 loizides 1.5 for(UInt_t i=0; i<GenNeutrinos->GetEntries(); i++) {
1064     if (GenNeutrinos->At(i)->HasMother())
1065 loizides 1.1 neutrinoTotal->AddDaughter(GenNeutrinos->At(i));
1066     }
1067 loizides 1.5 if (GenNeutrinos->GetEntries() > 0) {
1068 loizides 1.1 hDGenNeutrinos[1]->Fill(neutrinoTotal->Pt());
1069     hDGenNeutrinos[2]->Fill(neutrinoTotal->Eta());
1070 loizides 1.5 hDGenNeutrinos[3]->Fill(neutrinoTotal->PhiDeg());
1071 loizides 1.1 }
1072     delete neutrinoTotal;
1073    
1074 loizides 1.6 // quarks
1075 loizides 1.1 hDGenQuarks[0]->Fill(GenQuarks->GetEntries());
1076 loizides 1.5 for(UInt_t i=0; i<GenQuarks->GetEntries(); i++) {
1077     for(UInt_t j=i+1; j<GenQuarks->GetEntries(); j++) {
1078 loizides 1.1 CompositeParticle *dijet = new CompositeParticle();
1079     dijet->AddDaughter(GenQuarks->At(i));
1080     dijet->AddDaughter(GenQuarks->At(j));
1081     hDGenQuarks[1]->Fill(dijet->Pt());
1082     hDGenQuarks[2]->Fill(dijet->Mass());
1083 loizides 1.5 if (TMath::Abs(GenQuarks->At(i)->Eta()) < 2.5 &&
1084     TMath::Abs(GenQuarks->At(j)->Eta()) < 2.5) {
1085 loizides 1.1 hDGenQuarks[3]->Fill(dijet->Pt());
1086     hDGenQuarks[4]->Fill(dijet->Mass());
1087     }
1088     delete dijet;
1089     }
1090 ceballos 1.2 // b quark info
1091 loizides 1.5 if (GenQuarks->At(i)->AbsPdgId() == 5) {
1092 ceballos 1.2 hDGenQuarks[5]->Fill(GenQuarks->At(i)->Pt());
1093     hDGenQuarks[6]->Fill(GenQuarks->At(i)->Eta());
1094     hDGenQuarks[7]->Fill(GenQuarks->At(i)->Phi());
1095 ceballos 1.22 if (GenLeptons->GetEntries() >= 2 &&
1096     GenLeptons->At(0)->Pt() > 20 &&
1097     GenLeptons->At(1)->Pt() > 15) {
1098     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1099     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
1100 ceballos 1.2 hDGenQuarks[8]->Fill(GenQuarks->At(i)->Pt());
1101     hDGenQuarks[9]->Fill(GenQuarks->At(i)->Eta());
1102     hDGenQuarks[10]->Fill(GenQuarks->At(i)->Phi());
1103     }
1104     }
1105     }
1106     // t quark info
1107 loizides 1.5 else if (GenQuarks->At(i)->AbsPdgId() == 6) {
1108 ceballos 1.2 hDGenQuarks[11]->Fill(GenQuarks->At(i)->Pt());
1109     hDGenQuarks[12]->Fill(GenQuarks->At(i)->Eta());
1110     hDGenQuarks[13]->Fill(GenQuarks->At(i)->Phi());
1111     }
1112     // light quark info
1113     else {
1114     hDGenQuarks[14]->Fill(GenQuarks->At(i)->Pt());
1115     hDGenQuarks[15]->Fill(GenQuarks->At(i)->Eta());
1116     hDGenQuarks[16]->Fill(GenQuarks->At(i)->Phi());
1117     }
1118 loizides 1.1 }
1119    
1120 loizides 1.6 // wbf
1121 loizides 1.5 if (GenqqHs->GetEntries() == 2) {
1122 loizides 1.1 hDGenWBF[0]->Fill(MathUtils::DeltaPhi(GenqqHs->At(0)->Phi(),
1123     GenqqHs->At(1)->Phi()) * 180./ TMath::Pi());
1124 loizides 1.5 hDGenWBF[1]->Fill(TMath::Abs(GenqqHs->At(0)->Eta()-GenqqHs->At(1)->Eta()));
1125 loizides 1.1 hDGenWBF[2]->Fill(TMath::Max(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
1126     hDGenWBF[3]->Fill(TMath::Min(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
1127     CompositeParticle *diqq = new CompositeParticle();
1128     diqq->AddDaughter(GenqqHs->At(0));
1129     diqq->AddDaughter(GenqqHs->At(1));
1130     hDGenWBF[4]->Fill(diqq->Mass());
1131     delete diqq;
1132     }
1133    
1134 loizides 1.6 // bosons
1135 loizides 1.1 hDGenBosons[0]->Fill(GenBosons->GetEntries());
1136 loizides 1.5 for(UInt_t i=0; i<GenBosons->GetEntries(); i++) {
1137 loizides 1.1 hDGenBosons[1]->Fill(GenBosons->At(i)->Pt());
1138     hDGenBosons[2]->Fill(GenBosons->At(i)->Eta());
1139 ceballos 1.42 hDGenBosons[3]->Fill(TMath::Min(GenBosons->At(i)->Mass(),1999.999));
1140     hDGenBosons[4]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1141     if(GenBosons->At(i)->Is(MCParticle::kW))
1142     hDGenBosons[5]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1143     if(GenBosons->At(i)->Is(MCParticle::kZ))
1144     hDGenBosons[6]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1145     }
1146     if(sumV[0] >= 4) printf("More than 3 W bosons (%d)\n",sumV[0]);
1147     if(sumV[1] >= 4) printf("More than 3 Z bosons (%d)\n",sumV[1]);
1148     hDGenBosons[7]->Fill(TMath::Min((double)(sumV[0] + 4*sumV[1]),12.4999));
1149 ceballos 1.10
1150     // photons
1151     hDGenPhotons[0]->Fill(GenPhotons->GetEntries());
1152     for(UInt_t i=0; i<GenPhotons->GetEntries(); i++) {
1153     hDGenPhotons[1]->Fill(GenPhotons->At(i)->Pt());
1154     hDGenPhotons[2]->Fill(GenPhotons->At(i)->Eta());
1155     }
1156 ceballos 1.32
1157     // Rad photons
1158     hDGenRadPhotons[0]->Fill(GenRadPhotons->GetEntries());
1159     for(UInt_t i=0; i<GenRadPhotons->GetEntries(); i++) {
1160     hDGenRadPhotons[1]->Fill(TMath::Min(GenRadPhotons->At(i)->Pt(),199.999));
1161     hDGenRadPhotons[2]->Fill(TMath::Min(GenRadPhotons->At(i)->AbsEta(),4.999));
1162 loizides 1.46 hDGenRadPhotons[3]->Fill(TMath::Min((double)GenRadPhotons->At(i)->Mother()->Status(),
1163     19.499));
1164 loizides 1.40 hDGenRadPhotons[4]->Fill(GenRadPhotons->At(i)->IsGenerated() +
1165     2*GenRadPhotons->At(i)->IsSimulated());
1166 ceballos 1.32 hDGenRadPhotons[5]->Fill(TMath::Min(
1167 loizides 1.40 MathUtils::DeltaR(*GenRadPhotons->At(i),
1168     *GenRadPhotons->At(i)->Mother()),
1169     4.999));
1170 ceballos 1.32 Int_t Mother = 0;
1171     if(GenRadPhotons->At(i)->Mother()->Is(MCParticle::kMu)) Mother = 1;
1172     hDGenRadPhotons[6]->Fill(Mother);
1173     }
1174    
1175     // ISR photons
1176     hDGenISRPhotons[0]->Fill(GenISRPhotons->GetEntries());
1177     for(UInt_t i=0; i<GenISRPhotons->GetEntries(); i++) {
1178     hDGenISRPhotons[1]->Fill(TMath::Min(GenISRPhotons->At(i)->Pt(),199.999));
1179     hDGenISRPhotons[2]->Fill(TMath::Min(GenISRPhotons->At(i)->AbsEta(),4.999));
1180 loizides 1.40 hDGenISRPhotons[3]->Fill(TMath::Min((Double_t)GenISRPhotons->At(i)->Mother()->Status(),
1181     19.499));
1182     hDGenISRPhotons[4]->Fill(GenISRPhotons->At(i)->IsGenerated() +
1183     2*GenISRPhotons->At(i)->IsSimulated());
1184 ceballos 1.32 hDGenISRPhotons[5]->Fill(TMath::Min(
1185 loizides 1.40 MathUtils::DeltaR(*GenISRPhotons->At(i),
1186 loizides 1.46 *GenISRPhotons->At(i)->Mother()),4.999));
1187 ceballos 1.32 }
1188 loizides 1.1 }
1189 ceballos 1.34
1190     // Apply ISR filter (but filling all histograms)
1191 ceballos 1.37 if(fApplyISRFilter == kTRUE && GenISRPhotons->GetEntries() > 0 &&
1192 ceballos 1.38 GenISRPhotons->At(0)->Pt() > 15.0){
1193 ceballos 1.34 SkipEvent();
1194     }
1195 loizides 1.1 }
1196    
1197     //--------------------------------------------------------------------------------------------------
1198     void GeneratorMod::SlaveBegin()
1199     {
1200 loizides 1.5 // Book branch and histograms if wanted.
1201    
1202 loizides 1.41 ReqEventObject(fMCPartName, fParticles, kTRUE);
1203 loizides 1.1
1204 loizides 1.5 // fill histograms
1205 loizides 1.20 if (GetFillHist()) {
1206 ceballos 1.30 // MET
1207 loizides 1.46 AddTH1(hDGenMet[0],"hDGenMet_0","Gen MET Pt;p_{t} [GeV];#",200,0,200);
1208     AddTH1(hDGenMet[1],"hDGenMet_1","Gen MET Px;p_{x} [GeV];#",400,-200,200);
1209     AddTH1(hDGenMet[2],"hDGenMet_2","Gen MET Py;p_{y} [GeV];#",400,-200,200);
1210     AddTH1(hDGenMet[3],"hDGenMet_3","Gen MET Pz;p_{z} [GeV];#",400,-1000,1000);
1211 ceballos 1.30
1212 loizides 1.6 // leptons from W
1213 loizides 1.46 AddTH1(hDGenLeptons[0], "hDGenLeptons_0",
1214     "Number of leptons from W/Z;N_{leptons};#",10,-0.5,9.5);
1215     AddTH1(hDGenLeptons[1], "hDGenLeptons_1","Pt leptons from W/Z;p_{t} [GeV];#",100,0.0,200.0);
1216     AddTH1(hDGenLeptons[2], "hDGenLeptons_2","Eta leptons from W/Z;#eta;#",50,0.0,5.0);
1217     AddTH1(hDGenLeptons[3], "hDGenLeptons_3","Phi leptons from W/Z;#phi;#",90,0.0,180.0);
1218     AddTH1(hDGenLeptons[4], "hDGenLeptons_4","Dilepton mass from W/Z;m_{ll};#",1000,0.0,1000.0);
1219     AddTH1(hDGenLeptons[5], "hDGenLeptons_5","Eta Max for 2 lepton case;#eta;#",50,0.0,5.0);
1220     AddTH1(hDGenLeptons[6], "hDGenLeptons_6","Eta Min for 2 lepton case;#eta;#",50,0.0,5.0);
1221     AddTH1(hDGenLeptons[7], "hDGenLeptons_7",
1222     "Pt Max for 2 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1223     AddTH1(hDGenLeptons[8], "hDGenLeptons_8",
1224     "Pt Min for 2 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1225     AddTH1(hDGenLeptons[9], "hDGenLeptons_9",
1226     "DiLepton mass for 2 lepton case;p_{t} [GeV];#",1000,0.0,1000.0);
1227     AddTH1(hDGenLeptons[10],"hDGenLeptons_10",
1228     "Delta Phi ll for 2 lepton case;#Delta#phi_{ll};#",90,0.0,180.0);
1229 ceballos 1.44 AddTH1(hDGenLeptons[11],"hDGenLeptons_11","Delta R ll;#Delta R_{ll};#",100,0.0,5.0);
1230 loizides 1.46 AddTH1(hDGenLeptons[12],"hDGenLeptons_12",
1231     "Pt Max for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1232     AddTH1(hDGenLeptons[13],"hDGenLeptons_13",
1233     "Pt 2nd for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1234     AddTH1(hDGenLeptons[14],"hDGenLeptons_14",
1235     "Pt Min for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1236     AddTH1(hDGenLeptons[15],"hDGenLeptons_15",
1237     "Dilepton mass for 3 lepton case;m_{ll};#",1000,0.0,1000.0);
1238     AddTH1(hDGenLeptons[16],"hDGenLeptons_16",
1239     "Trilepton mass for 3 lepton case;m_{lll};#",1000,0.0,1000.0);
1240     AddTH1(hDGenLeptons[17],"hDGenLeptons_17",
1241     "Delta R Minimum between leptons for 3 lepton case;#Delta R_{ll};#",100,0.0,5.0);
1242     AddTH1(hDGenLeptons[18],"hDGenLeptons_18",
1243     "Pt Max for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1244     AddTH1(hDGenLeptons[19],"hDGenLeptons_19",
1245     "Pt 2nd for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1246     AddTH1(hDGenLeptons[20],"hDGenLeptons_20",
1247     "Pt 3rd for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1248     AddTH1(hDGenLeptons[21],"hDGenLeptons_21",
1249     "Pt 4th for 4 lepton case;#",100,0.0,200.0);
1250     AddTH1(hDGenLeptons[22],"hDGenLeptons_22",
1251     "Dilepton mass for 4 lepton case;m_{ll};#",1000,0.0,1000.0);
1252     AddTH1(hDGenLeptons[23],"hDGenLeptons_23",
1253     "Fourlepton mass for 3 lepton case;m_{llll};#",1000,0.0,1000.0);
1254     AddTH1(hDGenLeptons[24],"hDGenLeptons_24",
1255     "Delta R Minimum between leptons for 4 lepton case;#Delta R_{ll};#",100,0.0,5.0);
1256 loizides 1.1
1257 loizides 1.6 // all leptons
1258 loizides 1.46 AddTH1(hDGenAllLeptons[0], "hDGenAllLeptons_0",
1259     "Number of all leptons;N_{leptons};#",10,-0.5,9.5);
1260     AddTH1(hDGenAllLeptons[1], "hDGenAllLeptons_1","Pt all leptons;p_{t} [GeV];#",100,0.0,200.0);
1261     AddTH1(hDGenAllLeptons[2], "hDGenAllLeptons_2","Eta all leptons;#eta;#",50,0.0,5.0);
1262     AddTH1(hDGenAllLeptons[3], "hDGenAllLeptons_3","Phi all leptons;#phi;#",90,0.0,180.0);
1263 ceballos 1.3
1264 loizides 1.6 // taus
1265 loizides 1.46 AddTH1(hDGenTaus[0], "hDGenTaus_0","Number of taus;N_{tau};#",10,-0.5,9.5);
1266     AddTH1(hDGenTaus[1], "hDGenTaus_1","Pt taus;p_{t} [GeV];#",100,0.0,200.0);
1267     AddTH1(hDGenTaus[2], "hDGenTaus_2","Eta taus;#eta;#",50,0.0,5.0);
1268     AddTH1(hDGenTaus[3], "hDGenTaus_3","Phi taus;#phi;#",90,0.0,180.0);
1269 loizides 1.1
1270 loizides 1.6 // neutrinos
1271 loizides 1.46 AddTH1(hDGenNeutrinos[0], "hDGenNeutrinos_0","Number of neutrinos;N_{#nu};#",10,-0.5,9.5);
1272     AddTH1(hDGenNeutrinos[1], "hDGenNeutrinos_1","Pt neutrinos;p_{t} [GeV];#",100,0.0,200.0);
1273     AddTH1(hDGenNeutrinos[2], "hDGenNeutrinos_2","Eta neutrinos;#eta;#",100,-5.0,5.0);
1274     AddTH1(hDGenNeutrinos[3], "hDGenNeutrinos_3","Phi neutrinos;#phi;#",90,0.0,180.0);
1275 loizides 1.1
1276 loizides 1.6 // quarks
1277 loizides 1.46 AddTH1(hDGenQuarks[0], "hDGenQuarks_0", "Number of quarks;N_{quarks};#",10,-0.5,9.5);
1278     AddTH1(hDGenQuarks[1], "hDGenQuarks_1", "dijet pt for quarks;p_{t} [GeV];#",200,0.0,400.);
1279     AddTH1(hDGenQuarks[2], "hDGenQuarks_2", "dijet mass for quarks;m_{jj};#",2000,0.0,2000.);
1280     AddTH1(hDGenQuarks[3], "hDGenQuarks_3",
1281     "dijet pt for quarks with |eta|<2.5;p_{t} [GeV];#",200,0.0,400.);
1282     AddTH1(hDGenQuarks[4], "hDGenQuarks_4",
1283     "dijet mass for quarks with |eta|<2.5;m_{jj};#",2000,0.0,2000.);
1284     AddTH1(hDGenQuarks[5], "hDGenQuarks_5", "Pt for b quarks;p_{t} [GeV];#",200,0.0,400.);
1285     AddTH1(hDGenQuarks[6], "hDGenQuarks_6", "Eta for b quarks;#eta;#",200,-10.0,10.);
1286     AddTH1(hDGenQuarks[7], "hDGenQuarks_7",
1287     "Phi for b quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1288     AddTH1(hDGenQuarks[8], "hDGenQuarks_8",
1289     "Pt for b quarks with |eta|<2.5;p_{t} [GeV];#",200,0.0,400.);
1290     AddTH1(hDGenQuarks[9], "hDGenQuarks_9",
1291     "Eta for b quarks with |eta|<2.5;#eta;#",200,-10.0,10.);
1292     AddTH1(hDGenQuarks[10],"hDGenQuarks_10",
1293     "Phi for b quarks with |eta|<2.5;#phi;#",200,-TMath::Pi(),TMath::Pi());
1294     AddTH1(hDGenQuarks[11],"hDGenQuarks_11","Pt for t quarks;p_{t} [GeV];#",200,0.0,400.);
1295 ceballos 1.44 AddTH1(hDGenQuarks[12],"hDGenQuarks_12","Eta for t quarks;#eta;#",200,-10.0,10.);
1296 loizides 1.46 AddTH1(hDGenQuarks[13],"hDGenQuarks_13",
1297     "Phi for t quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1298     AddTH1(hDGenQuarks[14],"hDGenQuarks_14","Pt for light quarks;p_{t} [GeV];#",200,0.0,400.);
1299 ceballos 1.44 AddTH1(hDGenQuarks[15],"hDGenQuarks_15","Eta for light quarks;#eta;#",200,-10.0,10.);
1300 loizides 1.46 AddTH1(hDGenQuarks[16],"hDGenQuarks_16",
1301     "Phi for light quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1302 loizides 1.1
1303     // qqH
1304 loizides 1.46 AddTH1(hDGenWBF[0], "hDGenWBF_0",
1305     "Delta Phi jj for WBF quarks;#Delta Phi_{jj};#",90,0.0,180.);
1306     AddTH1(hDGenWBF[1], "hDGenWBF_1",
1307     "Delta Eta jj for WBF quarks;#Delta #eta_{jj};#",100,0.0,10.);
1308     AddTH1(hDGenWBF[2], "hDGenWBF_2",
1309     "Pt max for WBF quarks;p_{t} [GeV];#",200,0.0,400.);
1310     AddTH1(hDGenWBF[3], "hDGenWBF_3",
1311     "Pt min for WBF quarks;p_{t} [GeV];#",200,0.0,400.);
1312     AddTH1(hDGenWBF[4], "hDGenWBF_4",
1313     "dijet mass for WBF quarks;m_{jj};#",200,0.0,4000.);
1314 loizides 1.1
1315 loizides 1.6 // bosons
1316 loizides 1.46 AddTH1(hDGenBosons[0], "hDGenBosons_0", "Number of bosons;N_{bosons};#",10,-0.5,9.5);
1317     AddTH1(hDGenBosons[1], "hDGenBosons_1", "Pt of bosons;p_{t} [GeV];#",200,0.0,400.0);
1318     AddTH1(hDGenBosons[2], "hDGenBosons_2", "Eta of bosons;#eta;#",100,-5.0,5.0);
1319     AddTH1(hDGenBosons[3], "hDGenBosons_3", "Phi of bosons;#phi;#",2000,0.0,2000.0);
1320     AddTH1(hDGenBosons[4], "hDGenBosons_4", "Mass of bosons;m_{V};#",200,0.0,200.0);
1321     AddTH1(hDGenBosons[5], "hDGenBosons_5", "Mass of W bosons;m_{W};#",200,0.0,200.0);
1322     AddTH1(hDGenBosons[6], "hDGenBosons_6", "Mass of Z bosons;m_{Z};#",200,0.0,200.0);
1323     AddTH1(hDGenBosons[7], "hDGenBosons_7",
1324     "Number of W bosons + 4 * Z bosons;Number;#",13,-0.5,12.5);
1325 ceballos 1.10
1326     // photons
1327 loizides 1.46 AddTH1(hDGenPhotons[0], "hDGenPhotons_0", "Number of photons;N_{photons};#",10,-0.5,9.5);
1328     AddTH1(hDGenPhotons[1], "hDGenPhotons_1", "Pt of photons;p_{t} [GeV];#",200,0.0,400.0);
1329     AddTH1(hDGenPhotons[2], "hDGenPhotons_2", "Eta of photons;#eta;#",100,-5.0,5.0);
1330 ceballos 1.16
1331 loizides 1.40 // rad photons
1332 loizides 1.46 AddTH1(hDGenRadPhotons[0], "hDGenRadPhotons_0",
1333     "Number of radiative photons;N_{photons};#",10,-0.5,9.5);
1334     AddTH1(hDGenRadPhotons[1], "hDGenRadPhotons_1",
1335     "Pt of radiative photons;p_{t} [GeV];#",400,0.0,200.0);
1336     AddTH1(hDGenRadPhotons[2], "hDGenRadPhotons_2",
1337     "Eta of radiative photons;#eta;#",100,0.0,5.0);
1338     AddTH1(hDGenRadPhotons[3], "hDGenRadPhotons_3",
1339     "Status of mother of radiative photons;#eta;#",20,-0.5,19.5);
1340     AddTH1(hDGenRadPhotons[4], "hDGenRadPhotons_4",
1341     "IsGenerated+2*IsSimulated of radiative photons;IsGenerated+2*IsSimulated;#",
1342     4,-0.5,3.5);
1343     AddTH1(hDGenRadPhotons[5], "hDGenRadPhotons_5",
1344     "Delta R between photon and mother of radiative photons;#Delta R;#",500,0.0,5.0);
1345     AddTH1(hDGenRadPhotons[6], "hDGenRadPhotons_6",
1346     "Number of radiative photon with muon as a mother;Status;#",2,-0.5,1.5);
1347 ceballos 1.32
1348     // ISR photons
1349 loizides 1.46 AddTH1(hDGenISRPhotons[0], "hDGenISRPhotons_0",
1350     "Number of ISR photons;N_{photons};#",10,-0.5,9.5);
1351     AddTH1(hDGenISRPhotons[1], "hDGenISRPhotons_1",
1352     "Pt of ISR photons;p_{t} [GeV];#",400,0.0,200.0);
1353     AddTH1(hDGenISRPhotons[2], "hDGenISRPhotons_2",
1354     "Eta of ISR photons;#eta;#",100,0.0,5.0);
1355     AddTH1(hDGenISRPhotons[3], "hDGenISRPhotons_3",
1356     "Status of mother of radiative photons;#eta;#",20,-0.5,19.5);
1357     AddTH1(hDGenISRPhotons[4], "hDGenISRPhotons_4",
1358     "IsGenerated+2*IsSimulated of radiative photons;IsGenerated+2*IsSimulated;#",
1359     4,-0.5,3.5);
1360     AddTH1(hDGenISRPhotons[5], "hDGenISRPhotons_5",
1361     "Delta R between photon and mother of ISR photons;#Delta R;#",500,0.0,5.0);
1362 ceballos 1.32
1363 ceballos 1.42 // auxiliar for MG studies
1364 loizides 1.46 AddTH1(hDVMass[0], "hDVMass_0", "Mass of munu candidates ;Mass [GeV];#",200,0.,200.);
1365     AddTH1(hDVMass[1], "hDVMass_1", "Mass of elnu candidates ;Mass [GeV];#",200,0.,200.);
1366     AddTH1(hDVMass[2], "hDVMass_2", "Mass of taunu candidates ;Mass [GeV];#",200,0.,200.);
1367     AddTH1(hDVMass[3], "hDVMass_3", "Mass of mumu candidates ;Mass [GeV];#",200,0.,200.);
1368     AddTH1(hDVMass[4], "hDVMass_4", "Mass of ee candidates ;Mass [GeV];#",200,0.,200.);
1369     AddTH1(hDVMass[5], "hDVMass_5", "Mass of tautau candidates;Mass [GeV];#",200,0.,200.);
1370     AddTH1(hDVMass[6], "hDVMass_6", "Mass of numunumu candidates;Mass [GeV];#",200,0.,200.);
1371     AddTH1(hDVMass[7], "hDVMass_7", "Mass of nuenue candidates;Mass [GeV];#",200,0.,200.);
1372     AddTH1(hDVMass[8], "hDVMass_8", "Mass of nutaunutau candidates;Mass [GeV];#",200,0.,200.);
1373     AddTH1(hDVMass[9], "hDVMass_9",
1374     "Mass of munu candidates for t events ;Mass [GeV];#",200,0.,200.);
1375     AddTH1(hDVMass[10],"hDVMass_10",
1376     "Mass of elnu candidates for t events ;Mass [GeV];#",200,0.,200.);
1377     AddTH1(hDVMass[11],"hDVMass_11",
1378     "Mass of taunu candidates for t events;Mass [GeV];#",200,0.,200.);
1379     AddTH1(hDVMass[12],"hDVMass_12",
1380     "Mass of qq candidates for t events;Mass [GeV];#",200,0.,200.);
1381 ceballos 1.44
1382     // Special study about VVjets
1383 loizides 1.46 AddTH1(hDVVMass[0], "hDVVMass_0", "Mass of munu for WW events;Mass [GeV];#",200,0.,200.);
1384     AddTH1(hDVVMass[1], "hDVVMass_1", "Mass of munu WZ events;Mass [GeV];#",200,0.,200.);
1385     AddTH1(hDVVMass[2], "hDVVMass_2", "Mass of elnu WW events;Mass [GeV];#",200,0.,200.);
1386     AddTH1(hDVVMass[3], "hDVVMass_3", "Mass of elnu WZ events;Mass [GeV];#",200,0.,200.);
1387     AddTH1(hDVVMass[4], "hDVVMass_4", "Mass of taunu WW events;Mass [GeV];#",200,0.,200.);
1388     AddTH1(hDVVMass[5], "hDVVMass_5", "Mass of taunu WZ events;Mass [GeV];#",200,0.,200.);
1389     AddTH1(hDVVMass[6], "hDVVMass_6", "Mass of mumu WZ events;Mass [GeV];#",200,0.,200.);
1390     AddTH1(hDVVMass[7], "hDVVMass_7", "Mass of mumu ZZ events;Mass [GeV];#",200,0.,200.);
1391     AddTH1(hDVVMass[8], "hDVVMass_8", "Mass of ee WZ events;Mass [GeV];#",200,0.,200.);
1392     AddTH1(hDVVMass[9], "hDVVMass_9", "Mass of ee ZZ events;Mass [GeV];#",200,0.,200.);
1393     AddTH1(hDVVMass[10],"hDVVMass_10","Mass of tautau WZ events;Mass [GeV];#",200,0.,200.);
1394     AddTH1(hDVVMass[11],"hDVVMass_11","Mass of tautau ZZ events;Mass [GeV];#",200,0.,200.);
1395     AddTH1(hDVVMass[12],"hDVVMass_12","Mass of numunumu WZ events;Mass [GeV];#",200,0.,200.);
1396     AddTH1(hDVVMass[13],"hDVVMass_13","Mass of numunumu ZZ events;Mass [GeV];#",200,0.,200.);
1397     AddTH1(hDVVMass[14],"hDVVMass_14","Mass of nuenue WZ events;Mass [GeV];#",200,0.,200.);
1398     AddTH1(hDVVMass[15],"hDVVMass_15","Mass of nuenue ZZ events;Mass [GeV];#",200,0.,200.);
1399     AddTH1(hDVVMass[16],"hDVVMass_16","Mass of nutaunutau WZ events;Mass [GeV];#",200,0.,200.);
1400     AddTH1(hDVVMass[17],"hDVVMass_17","Mass of nutaunutau ZZ events;Mass [GeV];#",200,0.,200.);
1401 ceballos 1.44 AddTH1(hDVVMass[18],"hDVVMass_18","Ratios for WW events;Type;#",7,-0.5,6.5);
1402     AddTH1(hDVVMass[19],"hDVVMass_19","Ratios for WZ events;Type;#",10,-0.5,9.5);
1403     AddTH1(hDVVMass[20],"hDVVMass_20","Ratios for ZZ2l events;Type;#",7,-0.5,6.5);
1404     AddTH1(hDVVMass[21],"hDVVMass_21","Ratios for ZZ4l events;Type;#",16,-0.5,15.5);
1405 loizides 1.46 AddTH1(hDVVMass[22],"hDVVMass_22","Maximum mass for WW events;Mass [GeV];#",200,0.,200.);
1406     AddTH1(hDVVMass[23],"hDVVMass_23","Minimum mass for WW events;Mass [GeV];#",200,0.,200.);
1407     AddTH1(hDVVMass[24],"hDVVMass_24","Maximum mass for WZ events;Mass [GeV];#",200,0.,200.);
1408     AddTH1(hDVVMass[25],"hDVVMass_25","Minimum mass for WZ events;Mass [GeV];#",200,0.,200.);
1409     AddTH1(hDVVMass[26],"hDVVMass_26","Maximum mass for ZZ events;Mass [GeV];#",200,0.,200.);
1410     AddTH1(hDVVMass[27],"hDVVMass_27","Minimum mass for ZZ events;Mass [GeV];#",200,0.,200.);
1411 loizides 1.1 }
1412     }