ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.45
Committed: Wed Jun 17 20:27:44 2009 UTC (15 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.44: +3 -1 lines
Log Message:
Fix fwd def

File Contents

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