ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.51
Committed: Tue Sep 8 08:30:21 2009 UTC (15 years, 7 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.50: +32 -13 lines
Log Message:
changes in generator modes related to Rad photons

File Contents

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