ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.49
Committed: Thu Sep 3 07:05:52 2009 UTC (15 years, 8 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.48: +34 -24 lines
Log Message:
tighter electron id

File Contents

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