ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.53
Committed: Mon Sep 28 14:32:28 2009 UTC (15 years, 7 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_011a
Changes since 1.52: +97 -93 lines
Log Message:
Only copy arrays when requested.

File Contents

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