ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.50
Committed: Mon Sep 7 13:23:04 2009 UTC (15 years, 8 months ago) by phedex
Content type: text/plain
Branch: MAIN
Changes since 1.49: +5 -3 lines
Log Message:
fix bug with finding ISR/FSR Photons. Require status=1 now.

File Contents

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