ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.48
Committed: Mon Aug 31 06:40:15 2009 UTC (15 years, 8 months ago) by sixie
Content type: text/plain
Branch: MAIN
Changes since 1.47: +136 -1 lines
Log Message:
Add ability to publish MC particle collection to the output module

File Contents

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