ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.52
Committed: Thu Sep 17 14:58:11 2009 UTC (15 years, 7 months ago) by sixie
Content type: text/plain
Branch: MAIN
Changes since 1.51: +3 -2 lines
Log Message:
adding back the status==1 requirement for finding RadPhotons

File Contents

# User Rev Content
1 sixie 1.52 // $Id: GeneratorMod.cc,v 1.51 2009/09/08 08:30:21 ceballos Exp $
2 loizides 1.1
3     #include "MitPhysics/Mods/interface/GeneratorMod.h"
4     #include "MitCommon/MathTools/interface/MathUtils.h"
5 loizides 1.45 #include "MitAna/DataTree/interface/MetCol.h"
6     #include "MitAna/DataTree/interface/MCParticleCol.h"
7 loizides 1.8 #include "MitPhysics/Init/interface/ModNames.h"
8 loizides 1.1 #include <TH1D.h>
9     #include <TH2D.h>
10    
11     using namespace mithep;
12    
13     ClassImp(mithep::GeneratorMod)
14    
15     //--------------------------------------------------------------------------------------------------
16 loizides 1.8 GeneratorMod::GeneratorMod(const char *name, const char *title) :
17 loizides 1.1 BaseMod(name,title),
18 ceballos 1.32 fPrintDebug(kFALSE),
19 loizides 1.1 fMCPartName(Names::gkMCPartBrn),
20 ceballos 1.30 fMCMETName(ModNames::gkMCMETName),
21 loizides 1.8 fMCLeptonsName(ModNames::gkMCLeptonsName),
22     fMCAllLeptonsName(ModNames::gkMCAllLeptonsName),
23     fMCTausName(ModNames::gkMCTausName),
24     fMCNeutrinosName(ModNames::gkMCNeutrinosName),
25     fMCQuarksName(ModNames::gkMCQuarksName),
26     fMCqqHsName(ModNames::gkMCqqHsName),
27     fMCBosonsName(ModNames::gkMCBosonsName),
28 ceballos 1.10 fMCPhotonsName(ModNames::gkMCPhotonsName),
29 ceballos 1.32 fMCRadPhotonsName(ModNames::gkMCRadPhotonsName),
30     fMCISRPhotonsName(ModNames::gkMCISRPhotonsName),
31 ceballos 1.14 fPtLeptonMin(0.0),
32     fEtaLeptonMax(5.0),
33     fPtPhotonMin(0.0),
34 loizides 1.15 fEtaPhotonMax(5.0),
35 ceballos 1.32 fPtRadPhotonMin(0.0),
36     fEtaRadPhotonMax(5.0),
37 loizides 1.27 fPdgIdCut(0),
38     fMassMinCut(-FLT_MAX),
39     fMassMaxCut(FLT_MAX),
40 ceballos 1.34 fApplyISRFilter(kFALSE),
41 loizides 1.15 fParticles(0)
42 loizides 1.1 {
43 ceballos 1.42 // Constructor
44 sixie 1.48 fGenLeptons = new MCParticleArr();
45     fGenLeptons->SetName(("Pub" + string(ModNames::gkMCLeptonsName)).c_str());
46     fGenAllLeptons = new MCParticleArr();
47     fGenAllLeptons->SetName(("Pub" + string(ModNames::gkMCAllLeptonsName)).c_str());
48     fGenTaus = new MCParticleArr();
49     fGenTaus->SetName(("Pub" + string(ModNames::gkMCTausName)).c_str());
50     fGenNeutrinos = new MCParticleArr();
51     fGenNeutrinos->SetName(("Pub" + string(ModNames::gkMCNeutrinosName)).c_str());
52     fGenQuarks = new MCParticleArr();
53     fGenQuarks->SetName(("Pub" + string(ModNames::gkMCQuarksName)).c_str());
54     fGenqqHs = new MCParticleArr();
55     fGenqqHs->SetName(("Pub" + string(ModNames::gkMCqqHsName)).c_str());
56     fGenBosons = new MCParticleArr();
57     fGenBosons->SetName(("Pub" + string(ModNames::gkMCBosonsName)).c_str());
58     fGenPhotons = new MCParticleArr();
59     fGenPhotons->SetName(("Pub" + string(ModNames::gkMCPhotonsName)).c_str());
60     fGenRadPhotons = new MCParticleArr();
61     fGenRadPhotons->SetName(("Pub" + string(ModNames::gkMCRadPhotonsName)).c_str());
62     fGenISRPhotons = new MCParticleArr();
63     fGenISRPhotons->SetName(("Pub" + string(ModNames::gkMCISRPhotonsName)).c_str());
64    
65 loizides 1.1 }
66    
67 sixie 1.48
68     //--------------------------------------------------------------------------------------------------
69     GeneratorMod::~GeneratorMod()
70     {
71     // Destructor.
72    
73     delete fGenLeptons;
74     delete fGenAllLeptons;
75     delete fGenTaus;
76     delete fGenNeutrinos;
77     delete fGenQuarks;
78     delete fGenqqHs;
79     delete fGenBosons;
80     delete fGenPhotons;
81     delete fGenRadPhotons;
82     delete fGenISRPhotons;
83     }
84    
85    
86    
87 loizides 1.1 //--------------------------------------------------------------------------------------------------
88     void GeneratorMod::Process()
89     {
90 loizides 1.5 // Process entries of the tree.
91 loizides 1.1
92 loizides 1.5 // these arrays will be filled in the loop of particles
93 ceballos 1.30 MetOArr *GenMet = new MetOArr;
94     GenMet->SetName(fMCMETName);
95     GenMet->SetOwner(kTRUE);
96 loizides 1.9 MCParticleOArr *GenLeptons = new MCParticleOArr;
97 loizides 1.13 GenLeptons->SetName(fMCLeptonsName);
98 loizides 1.9 MCParticleOArr *GenAllLeptons = new MCParticleOArr;
99 loizides 1.13 GenAllLeptons->SetName(fMCAllLeptonsName);
100 loizides 1.9 MCParticleOArr *GenTaus = new MCParticleOArr;
101 loizides 1.13 GenTaus->SetName(fMCTausName);
102     GenTaus->SetOwner(kTRUE);
103 loizides 1.9 MCParticleOArr *GenNeutrinos = new MCParticleOArr;
104 loizides 1.13 GenNeutrinos->SetName(fMCNeutrinosName);
105 loizides 1.9 MCParticleOArr *GenQuarks = new MCParticleOArr;
106 loizides 1.13 GenQuarks->SetName(fMCQuarksName);
107 loizides 1.9 MCParticleOArr *GenqqHs = new MCParticleOArr;
108 loizides 1.13 GenqqHs->SetName(fMCqqHsName);
109 loizides 1.9 MCParticleOArr *GenBosons = new MCParticleOArr;
110 loizides 1.13 GenBosons->SetName(fMCBosonsName);
111 ceballos 1.10 MCParticleOArr *GenPhotons = new MCParticleOArr;
112 loizides 1.13 GenPhotons->SetName(fMCPhotonsName);
113 ceballos 1.32 MCParticleOArr *GenRadPhotons = new MCParticleOArr;
114     GenRadPhotons->SetName(fMCRadPhotonsName);
115     MCParticleOArr *GenISRPhotons = new MCParticleOArr;
116     GenISRPhotons->SetName(fMCISRPhotonsName);
117    
118 ceballos 1.42 MCParticleOArr *GenTempMG0 = new MCParticleOArr;
119    
120 loizides 1.46 if (fPrintDebug)
121 loizides 1.40 printf("\n************ Next Event ************\n\n");
122 loizides 1.1
123 loizides 1.5 // load MCParticle branch
124 loizides 1.41 LoadEventObject(fMCPartName, fParticles);
125 loizides 1.5
126 ceballos 1.42 Bool_t isOld = kFALSE;
127     Int_t sumV[2] = {0, 0}; // W, Z
128     Int_t sumVVFlavor[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
129 ceballos 1.30 Double_t totalMET[3] = {0.0, 0.0, 0.0};
130 loizides 1.6 Bool_t isqqH = kFALSE;
131 loizides 1.5 for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
132 loizides 1.7 const MCParticle *p = fParticles->At(i);
133 ceballos 1.32
134 loizides 1.40 if(fPrintDebug)
135     p->Print("l");
136 ceballos 1.32
137 ceballos 1.49 // rad photons, includes gamma from WWGamma vertex.
138 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     // muons/electrons from W/Z decays
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 sixie 1.48
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(),GenAllLeptons->At(i)->Status());
951     }
952     for (UInt_t i=0; i < GenTaus->GetEntries(); ++i) {
953     mithep::MCParticle *genParticle = fGenTaus->Allocate();
954     new (genParticle) mithep::MCParticle(GenTaus->At(i)->Px(),GenTaus->At(i)->Py(),
955     GenTaus->At(i)->Pz(),GenTaus->At(i)->E(),
956     GenTaus->At(i)->PdgId(),GenTaus->At(i)->Status());
957     }
958     for (UInt_t i=0; i < GenNeutrinos->GetEntries(); ++i) {
959     mithep::MCParticle *genParticle = fGenNeutrinos->Allocate();
960     new (genParticle) mithep::MCParticle(GenNeutrinos->At(i)->Px(),GenNeutrinos->At(i)->Py(),
961     GenNeutrinos->At(i)->Pz(),GenNeutrinos->At(i)->E(),
962     GenNeutrinos->At(i)->PdgId(),GenNeutrinos->At(i)->Status());
963     }
964     for (UInt_t i=0; i < GenQuarks->GetEntries(); ++i) {
965     mithep::MCParticle *genParticle = fGenQuarks->Allocate();
966     new (genParticle) mithep::MCParticle(GenQuarks->At(i)->Px(),GenQuarks->At(i)->Py(),
967     GenQuarks->At(i)->Pz(),GenQuarks->At(i)->E(),
968     GenQuarks->At(i)->PdgId(),GenQuarks->At(i)->Status());
969     }
970     for (UInt_t i=0; i < GenqqHs->GetEntries(); ++i) {
971     mithep::MCParticle *genParticle = fGenqqHs->Allocate();
972     new (genParticle) mithep::MCParticle(GenqqHs->At(i)->Px(),GenqqHs->At(i)->Py(),
973     GenqqHs->At(i)->Pz(),GenqqHs->At(i)->E(),
974     GenqqHs->At(i)->PdgId(),GenqqHs->At(i)->Status());
975     }
976     for (UInt_t i=0; i < GenBosons->GetEntries(); ++i) {
977     mithep::MCParticle *genParticle = fGenBosons->Allocate();
978     new (genParticle) mithep::MCParticle(GenBosons->At(i)->Px(),GenBosons->At(i)->Py(),
979     GenBosons->At(i)->Pz(),GenBosons->At(i)->E(),
980     GenBosons->At(i)->PdgId(),GenBosons->At(i)->Status());
981     }
982     for (UInt_t i=0; i < GenPhotons->GetEntries(); ++i) {
983     mithep::MCParticle *genParticle = fGenPhotons->Allocate();
984     new (genParticle) mithep::MCParticle(GenPhotons->At(i)->Px(),GenPhotons->At(i)->Py(),
985     GenPhotons->At(i)->Pz(),GenPhotons->At(i)->E(),
986     GenPhotons->At(i)->PdgId(),GenPhotons->At(i)->Status());
987     }
988     for (UInt_t i=0; i < GenRadPhotons->GetEntries(); ++i) {
989     mithep::MCParticle *genParticle = fGenRadPhotons->Allocate();
990     new (genParticle) mithep::MCParticle(GenRadPhotons->At(i)->Px(),GenRadPhotons->At(i)->Py(),
991     GenRadPhotons->At(i)->Pz(),GenRadPhotons->At(i)->E(),
992     GenRadPhotons->At(i)->PdgId(),GenRadPhotons->At(i)->Status());
993     }
994     for (UInt_t i=0; i < GenISRPhotons->GetEntries(); ++i) {
995     mithep::MCParticle *genParticle = fGenISRPhotons->Allocate();
996     new (genParticle) mithep::MCParticle(GenISRPhotons->At(i)->Px(),GenISRPhotons->At(i)->Py(),
997     GenISRPhotons->At(i)->Pz(),GenISRPhotons->At(i)->E(),
998     GenISRPhotons->At(i)->PdgId(),GenISRPhotons->At(i)->Status());
999     }
1000    
1001    
1002    
1003    
1004 loizides 1.5 // fill histograms if requested
1005 loizides 1.20 if (GetFillHist()) {
1006 loizides 1.5
1007 ceballos 1.30 // MET
1008     hDGenMet[0]->Fill(GenMet->At(0)->Pt());
1009     hDGenMet[1]->Fill(GenMet->At(0)->Px());
1010     hDGenMet[2]->Fill(GenMet->At(0)->Py());
1011     hDGenMet[3]->Fill(GenMet->At(0)->Elongitudinal());
1012    
1013 loizides 1.6 // leptons
1014 loizides 1.1 hDGenLeptons[0]->Fill(GenLeptons->GetEntries());
1015 loizides 1.5 for(UInt_t i=0; i<GenLeptons->GetEntries(); i++) {
1016 loizides 1.1 hDGenLeptons[1]->Fill(GenLeptons->At(i)->Pt());
1017 loizides 1.5 hDGenLeptons[2]->Fill(TMath::Abs(GenLeptons->At(i)->Eta()));
1018     hDGenLeptons[3]->Fill(GenLeptons->At(i)->PhiDeg());
1019     for(UInt_t j=i+1; j<GenLeptons->GetEntries(); j++) {
1020 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
1021     dilepton->AddDaughter(GenLeptons->At(i));
1022     dilepton->AddDaughter(GenLeptons->At(j));
1023     hDGenLeptons[4]->Fill(dilepton->Mass());
1024     delete dilepton;
1025     }
1026 ceballos 1.22 }
1027     // looking at events with two leptons
1028     if (GenLeptons->GetEntries() == 2) {
1029     hDGenLeptons[5]->Fill(TMath::Min(TMath::Max(TMath::Abs(GenLeptons->At(0)->Eta()),
1030     TMath::Abs(GenLeptons->At(1)->Eta())),
1031 loizides 1.5 4.999));
1032 ceballos 1.22 hDGenLeptons[6]->Fill(TMath::Min(TMath::Min(TMath::Abs(GenLeptons->At(0)->Eta()),
1033     TMath::Abs(GenLeptons->At(1)->Eta())),
1034 loizides 1.5 4.999));
1035 ceballos 1.22 if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1036     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
1037     hDGenLeptons[7]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
1038     if (GenLeptons->At(0)->Pt() > 20.0) {
1039     hDGenLeptons[8]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
1040     if (GenLeptons->At(1)->Pt() > 10.0) {
1041 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
1042 ceballos 1.22 dilepton->AddDaughter(GenLeptons->At(0));
1043     dilepton->AddDaughter(GenLeptons->At(1));
1044 loizides 1.1 hDGenLeptons[9]->Fill(TMath::Min(dilepton->Mass(),999.999));
1045 ceballos 1.22 if(dilepton->Mass() > 12.0){
1046     hDGenLeptons[10]->Fill(MathUtils::DeltaPhi(GenLeptons->At(0)->Phi(),
1047     GenLeptons->At(1)->Phi())
1048     * 180./ TMath::Pi());
1049 loizides 1.40 hDGenLeptons[11]->Fill(MathUtils::DeltaR(*GenLeptons->At(0),
1050     *GenLeptons->At(1)));
1051 ceballos 1.22 }
1052 loizides 1.1 delete dilepton;
1053     }
1054     }
1055     }
1056     }
1057 ceballos 1.22 // looking at events with three leptons
1058     if (GenLeptons->GetEntries() == 3) {
1059     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1060     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
1061     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5) {
1062     hDGenLeptons[12]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
1063     if (GenLeptons->At(0)->Pt() > 20.0) {
1064     hDGenLeptons[13]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
1065     hDGenLeptons[14]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
1066     if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0) {
1067     CompositeParticle *dilepton01 = new CompositeParticle();
1068     dilepton01->AddDaughter(GenLeptons->At(0));
1069     dilepton01->AddDaughter(GenLeptons->At(1));
1070     CompositeParticle *dilepton02 = new CompositeParticle();
1071     dilepton02->AddDaughter(GenLeptons->At(0));
1072     dilepton02->AddDaughter(GenLeptons->At(2));
1073     CompositeParticle *dilepton12 = new CompositeParticle();
1074     dilepton12->AddDaughter(GenLeptons->At(1));
1075     dilepton12->AddDaughter(GenLeptons->At(2));
1076     hDGenLeptons[15]->Fill(TMath::Min(dilepton01->Mass(),999.999));
1077     hDGenLeptons[15]->Fill(TMath::Min(dilepton02->Mass(),999.999));
1078     hDGenLeptons[15]->Fill(TMath::Min(dilepton12->Mass(),999.999));
1079     CompositeParticle *trilepton = new CompositeParticle();
1080     trilepton->AddDaughter(GenLeptons->At(0));
1081     trilepton->AddDaughter(GenLeptons->At(1));
1082     trilepton->AddDaughter(GenLeptons->At(2));
1083     hDGenLeptons[16]->Fill(TMath::Min(trilepton->Mass(),999.999));
1084 loizides 1.40 Double_t deltaR[3] = {MathUtils::DeltaR(*GenLeptons->At(0),
1085     *GenLeptons->At(1)),
1086     MathUtils::DeltaR(*GenLeptons->At(0),
1087     *GenLeptons->At(2)),
1088     MathUtils::DeltaR(*GenLeptons->At(1),
1089     *GenLeptons->At(2))};
1090 loizides 1.27 Double_t deltaRMin = deltaR[0];
1091 loizides 1.40 for(Int_t i=1; i<3; i++)
1092     if(deltaRMin > deltaR[i])
1093     deltaRMin = deltaR[i];
1094 ceballos 1.22 hDGenLeptons[17]->Fill(deltaRMin);
1095    
1096     delete dilepton01;
1097     delete dilepton02;
1098     delete dilepton12;
1099     delete trilepton;
1100     }
1101     }
1102     }
1103     }
1104     // looking at events with four leptons
1105     if (GenLeptons->GetEntries() == 4) {
1106     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1107     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
1108     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5 &&
1109     TMath::Abs(GenLeptons->At(3)->Eta()) < 2.5) {
1110     hDGenLeptons[18]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
1111     if (GenLeptons->At(0)->Pt() > 20.0) {
1112     hDGenLeptons[19]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
1113     hDGenLeptons[20]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
1114     hDGenLeptons[21]->Fill(TMath::Min(GenLeptons->At(3)->Pt(),199.999));
1115     if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0 &&
1116     GenLeptons->At(3)->Pt() > 10.0) {
1117     CompositeParticle *dilepton01 = new CompositeParticle();
1118     dilepton01->AddDaughter(GenLeptons->At(0));
1119     dilepton01->AddDaughter(GenLeptons->At(1));
1120     CompositeParticle *dilepton02 = new CompositeParticle();
1121     dilepton02->AddDaughter(GenLeptons->At(0));
1122     dilepton02->AddDaughter(GenLeptons->At(2));
1123     CompositeParticle *dilepton03 = new CompositeParticle();
1124     dilepton03->AddDaughter(GenLeptons->At(0));
1125     dilepton03->AddDaughter(GenLeptons->At(3));
1126     CompositeParticle *dilepton12 = new CompositeParticle();
1127     dilepton12->AddDaughter(GenLeptons->At(1));
1128     dilepton12->AddDaughter(GenLeptons->At(2));
1129     CompositeParticle *dilepton13 = new CompositeParticle();
1130     dilepton13->AddDaughter(GenLeptons->At(1));
1131     dilepton13->AddDaughter(GenLeptons->At(3));
1132     CompositeParticle *dilepton23 = new CompositeParticle();
1133     dilepton23->AddDaughter(GenLeptons->At(2));
1134     dilepton23->AddDaughter(GenLeptons->At(3));
1135     hDGenLeptons[22]->Fill(TMath::Min(dilepton01->Mass(),999.999));
1136     hDGenLeptons[22]->Fill(TMath::Min(dilepton02->Mass(),999.999));
1137     hDGenLeptons[22]->Fill(TMath::Min(dilepton03->Mass(),999.999));
1138     hDGenLeptons[22]->Fill(TMath::Min(dilepton12->Mass(),999.999));
1139     hDGenLeptons[22]->Fill(TMath::Min(dilepton13->Mass(),999.999));
1140     hDGenLeptons[22]->Fill(TMath::Min(dilepton23->Mass(),999.999));
1141     CompositeParticle *fourlepton = new CompositeParticle();
1142     fourlepton->AddDaughter(GenLeptons->At(0));
1143     fourlepton->AddDaughter(GenLeptons->At(1));
1144     fourlepton->AddDaughter(GenLeptons->At(2));
1145     fourlepton->AddDaughter(GenLeptons->At(3));
1146     hDGenLeptons[23]->Fill(TMath::Min(fourlepton->Mass(),999.999));
1147 loizides 1.40 Double_t deltaR[6] = {MathUtils::DeltaR(*GenLeptons->At(0),
1148     *GenLeptons->At(1)),
1149     MathUtils::DeltaR(*GenLeptons->At(0),
1150     *GenLeptons->At(2)),
1151     MathUtils::DeltaR(*GenLeptons->At(0),
1152     *GenLeptons->At(3)),
1153     MathUtils::DeltaR(*GenLeptons->At(1),
1154     *GenLeptons->At(2)),
1155     MathUtils::DeltaR(*GenLeptons->At(1),
1156     *GenLeptons->At(3)),
1157     MathUtils::DeltaR(*GenLeptons->At(2),
1158     *GenLeptons->At(3))};
1159 loizides 1.27 Double_t deltaRMin = deltaR[0];
1160 loizides 1.40 for(Int_t i=1; i<6; i++)
1161     if(deltaRMin > deltaR[i])
1162     deltaRMin = deltaR[i];
1163 ceballos 1.22 hDGenLeptons[24]->Fill(deltaRMin);
1164    
1165     delete dilepton01;
1166     delete dilepton02;
1167     delete dilepton03;
1168     delete dilepton12;
1169     delete dilepton13;
1170     delete dilepton23;
1171     delete fourlepton;
1172     }
1173     }
1174     }
1175     }
1176 loizides 1.1
1177 loizides 1.6 // all leptons
1178 ceballos 1.3 hDGenAllLeptons[0]->Fill(GenAllLeptons->GetEntries());
1179 loizides 1.5 for(UInt_t i=0; i<GenAllLeptons->GetEntries(); i++) {
1180 ceballos 1.3 hDGenAllLeptons[1]->Fill(GenAllLeptons->At(i)->Pt());
1181 ceballos 1.49 hDGenAllLeptons[2]->Fill(GenAllLeptons->At(i)->AbsEta());
1182 loizides 1.5 hDGenAllLeptons[3]->Fill(GenAllLeptons->At(i)->PhiDeg());
1183 ceballos 1.3 }
1184 ceballos 1.49 if(GenAllLeptons->GetEntries() >= 2) hDGenAllLeptons[4]->Fill(GenAllLeptons->At(1)->Pt());
1185 ceballos 1.3
1186 loizides 1.6 // taus
1187 loizides 1.1 hDGenTaus[0]->Fill(GenTaus->GetEntries());
1188 loizides 1.5 for(UInt_t i=0; i<GenTaus->GetEntries(); i++) {
1189 loizides 1.1 hDGenTaus[1]->Fill(GenTaus->At(i)->Pt());
1190 ceballos 1.49 hDGenTaus[2]->Fill(GenTaus->At(i)->AbsEta());
1191 loizides 1.5 hDGenTaus[3]->Fill(GenTaus->At(i)->PhiDeg());
1192 loizides 1.1 }
1193    
1194 loizides 1.6 // neutrinos
1195 loizides 1.1 hDGenNeutrinos[0]->Fill(GenNeutrinos->GetEntries());
1196     CompositeParticle *neutrinoTotal = new CompositeParticle();
1197 loizides 1.5 for(UInt_t i=0; i<GenNeutrinos->GetEntries(); i++) {
1198     if (GenNeutrinos->At(i)->HasMother())
1199 loizides 1.1 neutrinoTotal->AddDaughter(GenNeutrinos->At(i));
1200     }
1201 loizides 1.5 if (GenNeutrinos->GetEntries() > 0) {
1202 loizides 1.1 hDGenNeutrinos[1]->Fill(neutrinoTotal->Pt());
1203 ceballos 1.49 hDGenNeutrinos[2]->Fill(neutrinoTotal->AbsEta());
1204 loizides 1.5 hDGenNeutrinos[3]->Fill(neutrinoTotal->PhiDeg());
1205 loizides 1.1 }
1206     delete neutrinoTotal;
1207    
1208 loizides 1.6 // quarks
1209 loizides 1.1 hDGenQuarks[0]->Fill(GenQuarks->GetEntries());
1210 loizides 1.5 for(UInt_t i=0; i<GenQuarks->GetEntries(); i++) {
1211     for(UInt_t j=i+1; j<GenQuarks->GetEntries(); j++) {
1212 loizides 1.1 CompositeParticle *dijet = new CompositeParticle();
1213     dijet->AddDaughter(GenQuarks->At(i));
1214     dijet->AddDaughter(GenQuarks->At(j));
1215     hDGenQuarks[1]->Fill(dijet->Pt());
1216     hDGenQuarks[2]->Fill(dijet->Mass());
1217 loizides 1.5 if (TMath::Abs(GenQuarks->At(i)->Eta()) < 2.5 &&
1218     TMath::Abs(GenQuarks->At(j)->Eta()) < 2.5) {
1219 loizides 1.1 hDGenQuarks[3]->Fill(dijet->Pt());
1220     hDGenQuarks[4]->Fill(dijet->Mass());
1221     }
1222     delete dijet;
1223     }
1224 ceballos 1.2 // b quark info
1225 loizides 1.5 if (GenQuarks->At(i)->AbsPdgId() == 5) {
1226 ceballos 1.2 hDGenQuarks[5]->Fill(GenQuarks->At(i)->Pt());
1227     hDGenQuarks[6]->Fill(GenQuarks->At(i)->Eta());
1228     hDGenQuarks[7]->Fill(GenQuarks->At(i)->Phi());
1229 ceballos 1.22 if (GenLeptons->GetEntries() >= 2 &&
1230     GenLeptons->At(0)->Pt() > 20 &&
1231     GenLeptons->At(1)->Pt() > 15) {
1232     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1233     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
1234 ceballos 1.2 hDGenQuarks[8]->Fill(GenQuarks->At(i)->Pt());
1235     hDGenQuarks[9]->Fill(GenQuarks->At(i)->Eta());
1236     hDGenQuarks[10]->Fill(GenQuarks->At(i)->Phi());
1237     }
1238     }
1239     }
1240     // t quark info
1241 loizides 1.5 else if (GenQuarks->At(i)->AbsPdgId() == 6) {
1242 ceballos 1.2 hDGenQuarks[11]->Fill(GenQuarks->At(i)->Pt());
1243     hDGenQuarks[12]->Fill(GenQuarks->At(i)->Eta());
1244     hDGenQuarks[13]->Fill(GenQuarks->At(i)->Phi());
1245     }
1246     // light quark info
1247     else {
1248     hDGenQuarks[14]->Fill(GenQuarks->At(i)->Pt());
1249     hDGenQuarks[15]->Fill(GenQuarks->At(i)->Eta());
1250     hDGenQuarks[16]->Fill(GenQuarks->At(i)->Phi());
1251     }
1252 loizides 1.1 }
1253    
1254 loizides 1.6 // wbf
1255 loizides 1.5 if (GenqqHs->GetEntries() == 2) {
1256 loizides 1.1 hDGenWBF[0]->Fill(MathUtils::DeltaPhi(GenqqHs->At(0)->Phi(),
1257     GenqqHs->At(1)->Phi()) * 180./ TMath::Pi());
1258 loizides 1.5 hDGenWBF[1]->Fill(TMath::Abs(GenqqHs->At(0)->Eta()-GenqqHs->At(1)->Eta()));
1259 loizides 1.1 hDGenWBF[2]->Fill(TMath::Max(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
1260     hDGenWBF[3]->Fill(TMath::Min(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
1261     CompositeParticle *diqq = new CompositeParticle();
1262     diqq->AddDaughter(GenqqHs->At(0));
1263     diqq->AddDaughter(GenqqHs->At(1));
1264     hDGenWBF[4]->Fill(diqq->Mass());
1265     delete diqq;
1266     }
1267    
1268 loizides 1.6 // bosons
1269 loizides 1.1 hDGenBosons[0]->Fill(GenBosons->GetEntries());
1270 loizides 1.5 for(UInt_t i=0; i<GenBosons->GetEntries(); i++) {
1271 loizides 1.1 hDGenBosons[1]->Fill(GenBosons->At(i)->Pt());
1272     hDGenBosons[2]->Fill(GenBosons->At(i)->Eta());
1273 ceballos 1.42 hDGenBosons[3]->Fill(TMath::Min(GenBosons->At(i)->Mass(),1999.999));
1274     hDGenBosons[4]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1275     if(GenBosons->At(i)->Is(MCParticle::kW))
1276     hDGenBosons[5]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1277     if(GenBosons->At(i)->Is(MCParticle::kZ))
1278     hDGenBosons[6]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1279     }
1280 ceballos 1.51 //if(sumV[0] >= 4) printf("More than 3 W bosons (%d)\n",sumV[0]);
1281     //if(sumV[1] >= 4) printf("More than 3 Z bosons (%d)\n",sumV[1]);
1282 ceballos 1.42 hDGenBosons[7]->Fill(TMath::Min((double)(sumV[0] + 4*sumV[1]),12.4999));
1283 ceballos 1.10
1284     // photons
1285     hDGenPhotons[0]->Fill(GenPhotons->GetEntries());
1286     for(UInt_t i=0; i<GenPhotons->GetEntries(); i++) {
1287     hDGenPhotons[1]->Fill(GenPhotons->At(i)->Pt());
1288     hDGenPhotons[2]->Fill(GenPhotons->At(i)->Eta());
1289     }
1290 ceballos 1.32
1291     // Rad photons
1292     hDGenRadPhotons[0]->Fill(GenRadPhotons->GetEntries());
1293     for(UInt_t i=0; i<GenRadPhotons->GetEntries(); i++) {
1294     hDGenRadPhotons[1]->Fill(TMath::Min(GenRadPhotons->At(i)->Pt(),199.999));
1295     hDGenRadPhotons[2]->Fill(TMath::Min(GenRadPhotons->At(i)->AbsEta(),4.999));
1296 ceballos 1.51 hDGenRadPhotons[3]->Fill(TMath::Min((double)GenRadPhotons->At(i)->DistinctMother()->Status(),
1297 loizides 1.46 19.499));
1298 loizides 1.40 hDGenRadPhotons[4]->Fill(GenRadPhotons->At(i)->IsGenerated() +
1299     2*GenRadPhotons->At(i)->IsSimulated());
1300 ceballos 1.49 if(GenRadPhotons->At(i)->DistinctMother()){
1301     hDGenRadPhotons[5]->Fill(TMath::Min(
1302 loizides 1.40 MathUtils::DeltaR(*GenRadPhotons->At(i),
1303 ceballos 1.49 *GenRadPhotons->At(i)->DistinctMother()),
1304 loizides 1.40 4.999));
1305 ceballos 1.51 CompositeParticle *object = new CompositeParticle();
1306     object->AddDaughter(GenRadPhotons->At(i));
1307     object->AddDaughter(GenRadPhotons->At(i)->DistinctMother());
1308     hDGenRadPhotons[6]->Fill(TMath::Min(object->Mass(),99.999));
1309     delete object;
1310 ceballos 1.49 }
1311 ceballos 1.32 Int_t Mother = 0;
1312 ceballos 1.49 if(GenRadPhotons->At(i)->DistinctMother() &&
1313     GenRadPhotons->At(i)->DistinctMother()->Is(MCParticle::kMu)) Mother = 1;
1314 ceballos 1.51 hDGenRadPhotons[7]->Fill(Mother);
1315 ceballos 1.32 }
1316    
1317     // ISR photons
1318     hDGenISRPhotons[0]->Fill(GenISRPhotons->GetEntries());
1319     for(UInt_t i=0; i<GenISRPhotons->GetEntries(); i++) {
1320     hDGenISRPhotons[1]->Fill(TMath::Min(GenISRPhotons->At(i)->Pt(),199.999));
1321     hDGenISRPhotons[2]->Fill(TMath::Min(GenISRPhotons->At(i)->AbsEta(),4.999));
1322 ceballos 1.51 hDGenISRPhotons[3]->Fill(TMath::Min((Double_t)GenISRPhotons->At(i)->DistinctMother()->Status(),
1323 loizides 1.40 19.499));
1324     hDGenISRPhotons[4]->Fill(GenISRPhotons->At(i)->IsGenerated() +
1325     2*GenISRPhotons->At(i)->IsSimulated());
1326 ceballos 1.51 if(GenISRPhotons->At(i)->DistinctMother()){
1327     hDGenISRPhotons[5]->Fill(TMath::Min(
1328     MathUtils::DeltaR(*GenISRPhotons->At(i),
1329     *GenISRPhotons->At(i)->DistinctMother()),4.999));
1330     CompositeParticle *object = new CompositeParticle();
1331     object->AddDaughter(GenISRPhotons->At(i));
1332     object->AddDaughter(GenISRPhotons->At(i)->DistinctMother());
1333     hDGenISRPhotons[6]->Fill(TMath::Min(object->Mass(),99.999));
1334     delete object;
1335     }
1336 ceballos 1.32 }
1337 loizides 1.1 }
1338 ceballos 1.34
1339 ceballos 1.49 // Apply ISR+Rad filter (but filling all histograms)
1340     if(fApplyISRFilter == kTRUE &&
1341     (GenISRPhotons->GetEntries() > 0 || GenRadPhotons->GetEntries() > 0)){
1342 ceballos 1.34 SkipEvent();
1343     }
1344 loizides 1.1 }
1345    
1346     //--------------------------------------------------------------------------------------------------
1347     void GeneratorMod::SlaveBegin()
1348     {
1349 loizides 1.5 // Book branch and histograms if wanted.
1350    
1351 loizides 1.41 ReqEventObject(fMCPartName, fParticles, kTRUE);
1352 sixie 1.48
1353     // Publish Arrays For the Output Module
1354     PublishObj(fGenLeptons);
1355     PublishObj(fGenAllLeptons);
1356     PublishObj(fGenTaus);
1357     PublishObj(fGenNeutrinos);
1358     PublishObj(fGenQuarks);
1359     PublishObj(fGenqqHs);
1360     PublishObj(fGenBosons);
1361     PublishObj(fGenPhotons);
1362     PublishObj(fGenRadPhotons);
1363     PublishObj(fGenISRPhotons);
1364    
1365    
1366    
1367 loizides 1.1
1368 loizides 1.5 // fill histograms
1369 loizides 1.20 if (GetFillHist()) {
1370 ceballos 1.30 // MET
1371 loizides 1.46 AddTH1(hDGenMet[0],"hDGenMet_0","Gen MET Pt;p_{t} [GeV];#",200,0,200);
1372     AddTH1(hDGenMet[1],"hDGenMet_1","Gen MET Px;p_{x} [GeV];#",400,-200,200);
1373     AddTH1(hDGenMet[2],"hDGenMet_2","Gen MET Py;p_{y} [GeV];#",400,-200,200);
1374     AddTH1(hDGenMet[3],"hDGenMet_3","Gen MET Pz;p_{z} [GeV];#",400,-1000,1000);
1375 ceballos 1.30
1376 loizides 1.6 // leptons from W
1377 loizides 1.46 AddTH1(hDGenLeptons[0], "hDGenLeptons_0",
1378     "Number of leptons from W/Z;N_{leptons};#",10,-0.5,9.5);
1379     AddTH1(hDGenLeptons[1], "hDGenLeptons_1","Pt leptons from W/Z;p_{t} [GeV];#",100,0.0,200.0);
1380     AddTH1(hDGenLeptons[2], "hDGenLeptons_2","Eta leptons from W/Z;#eta;#",50,0.0,5.0);
1381     AddTH1(hDGenLeptons[3], "hDGenLeptons_3","Phi leptons from W/Z;#phi;#",90,0.0,180.0);
1382     AddTH1(hDGenLeptons[4], "hDGenLeptons_4","Dilepton mass from W/Z;m_{ll};#",1000,0.0,1000.0);
1383     AddTH1(hDGenLeptons[5], "hDGenLeptons_5","Eta Max for 2 lepton case;#eta;#",50,0.0,5.0);
1384     AddTH1(hDGenLeptons[6], "hDGenLeptons_6","Eta Min for 2 lepton case;#eta;#",50,0.0,5.0);
1385     AddTH1(hDGenLeptons[7], "hDGenLeptons_7",
1386     "Pt Max for 2 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1387     AddTH1(hDGenLeptons[8], "hDGenLeptons_8",
1388     "Pt Min for 2 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1389     AddTH1(hDGenLeptons[9], "hDGenLeptons_9",
1390     "DiLepton mass for 2 lepton case;p_{t} [GeV];#",1000,0.0,1000.0);
1391     AddTH1(hDGenLeptons[10],"hDGenLeptons_10",
1392     "Delta Phi ll for 2 lepton case;#Delta#phi_{ll};#",90,0.0,180.0);
1393 ceballos 1.44 AddTH1(hDGenLeptons[11],"hDGenLeptons_11","Delta R ll;#Delta R_{ll};#",100,0.0,5.0);
1394 loizides 1.46 AddTH1(hDGenLeptons[12],"hDGenLeptons_12",
1395     "Pt Max for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1396     AddTH1(hDGenLeptons[13],"hDGenLeptons_13",
1397     "Pt 2nd for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1398     AddTH1(hDGenLeptons[14],"hDGenLeptons_14",
1399     "Pt Min for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1400     AddTH1(hDGenLeptons[15],"hDGenLeptons_15",
1401     "Dilepton mass for 3 lepton case;m_{ll};#",1000,0.0,1000.0);
1402     AddTH1(hDGenLeptons[16],"hDGenLeptons_16",
1403     "Trilepton mass for 3 lepton case;m_{lll};#",1000,0.0,1000.0);
1404     AddTH1(hDGenLeptons[17],"hDGenLeptons_17",
1405     "Delta R Minimum between leptons for 3 lepton case;#Delta R_{ll};#",100,0.0,5.0);
1406     AddTH1(hDGenLeptons[18],"hDGenLeptons_18",
1407     "Pt Max for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1408     AddTH1(hDGenLeptons[19],"hDGenLeptons_19",
1409     "Pt 2nd for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1410     AddTH1(hDGenLeptons[20],"hDGenLeptons_20",
1411     "Pt 3rd for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1412     AddTH1(hDGenLeptons[21],"hDGenLeptons_21",
1413     "Pt 4th for 4 lepton case;#",100,0.0,200.0);
1414     AddTH1(hDGenLeptons[22],"hDGenLeptons_22",
1415     "Dilepton mass for 4 lepton case;m_{ll};#",1000,0.0,1000.0);
1416     AddTH1(hDGenLeptons[23],"hDGenLeptons_23",
1417     "Fourlepton mass for 3 lepton case;m_{llll};#",1000,0.0,1000.0);
1418     AddTH1(hDGenLeptons[24],"hDGenLeptons_24",
1419     "Delta R Minimum between leptons for 4 lepton case;#Delta R_{ll};#",100,0.0,5.0);
1420 loizides 1.1
1421 loizides 1.6 // all leptons
1422 loizides 1.46 AddTH1(hDGenAllLeptons[0], "hDGenAllLeptons_0",
1423     "Number of all leptons;N_{leptons};#",10,-0.5,9.5);
1424 ceballos 1.49 AddTH1(hDGenAllLeptons[1], "hDGenAllLeptons_1","Pt all leptons;p_{t} [GeV];#",400,0.0,200.0);
1425 loizides 1.46 AddTH1(hDGenAllLeptons[2], "hDGenAllLeptons_2","Eta all leptons;#eta;#",50,0.0,5.0);
1426     AddTH1(hDGenAllLeptons[3], "hDGenAllLeptons_3","Phi all leptons;#phi;#",90,0.0,180.0);
1427 ceballos 1.49 AddTH1(hDGenAllLeptons[4], "hDGenAllLeptons_4","Pt second lepton;p_{t} [GeV];#",400,0.0,200.0);
1428 ceballos 1.3
1429 loizides 1.6 // taus
1430 loizides 1.46 AddTH1(hDGenTaus[0], "hDGenTaus_0","Number of taus;N_{tau};#",10,-0.5,9.5);
1431     AddTH1(hDGenTaus[1], "hDGenTaus_1","Pt taus;p_{t} [GeV];#",100,0.0,200.0);
1432     AddTH1(hDGenTaus[2], "hDGenTaus_2","Eta taus;#eta;#",50,0.0,5.0);
1433     AddTH1(hDGenTaus[3], "hDGenTaus_3","Phi taus;#phi;#",90,0.0,180.0);
1434 loizides 1.1
1435 loizides 1.6 // neutrinos
1436 loizides 1.46 AddTH1(hDGenNeutrinos[0], "hDGenNeutrinos_0","Number of neutrinos;N_{#nu};#",10,-0.5,9.5);
1437     AddTH1(hDGenNeutrinos[1], "hDGenNeutrinos_1","Pt neutrinos;p_{t} [GeV];#",100,0.0,200.0);
1438 ceballos 1.49 AddTH1(hDGenNeutrinos[2], "hDGenNeutrinos_2","Eta neutrinos;#eta;#",50,0.0,5.0);
1439 loizides 1.46 AddTH1(hDGenNeutrinos[3], "hDGenNeutrinos_3","Phi neutrinos;#phi;#",90,0.0,180.0);
1440 loizides 1.1
1441 loizides 1.6 // quarks
1442 loizides 1.46 AddTH1(hDGenQuarks[0], "hDGenQuarks_0", "Number of quarks;N_{quarks};#",10,-0.5,9.5);
1443     AddTH1(hDGenQuarks[1], "hDGenQuarks_1", "dijet pt for quarks;p_{t} [GeV];#",200,0.0,400.);
1444     AddTH1(hDGenQuarks[2], "hDGenQuarks_2", "dijet mass for quarks;m_{jj};#",2000,0.0,2000.);
1445     AddTH1(hDGenQuarks[3], "hDGenQuarks_3",
1446     "dijet pt for quarks with |eta|<2.5;p_{t} [GeV];#",200,0.0,400.);
1447     AddTH1(hDGenQuarks[4], "hDGenQuarks_4",
1448     "dijet mass for quarks with |eta|<2.5;m_{jj};#",2000,0.0,2000.);
1449     AddTH1(hDGenQuarks[5], "hDGenQuarks_5", "Pt for b quarks;p_{t} [GeV];#",200,0.0,400.);
1450     AddTH1(hDGenQuarks[6], "hDGenQuarks_6", "Eta for b quarks;#eta;#",200,-10.0,10.);
1451     AddTH1(hDGenQuarks[7], "hDGenQuarks_7",
1452     "Phi for b quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1453     AddTH1(hDGenQuarks[8], "hDGenQuarks_8",
1454     "Pt for b quarks with |eta|<2.5;p_{t} [GeV];#",200,0.0,400.);
1455     AddTH1(hDGenQuarks[9], "hDGenQuarks_9",
1456     "Eta for b quarks with |eta|<2.5;#eta;#",200,-10.0,10.);
1457     AddTH1(hDGenQuarks[10],"hDGenQuarks_10",
1458     "Phi for b quarks with |eta|<2.5;#phi;#",200,-TMath::Pi(),TMath::Pi());
1459     AddTH1(hDGenQuarks[11],"hDGenQuarks_11","Pt for t quarks;p_{t} [GeV];#",200,0.0,400.);
1460 ceballos 1.44 AddTH1(hDGenQuarks[12],"hDGenQuarks_12","Eta for t quarks;#eta;#",200,-10.0,10.);
1461 loizides 1.46 AddTH1(hDGenQuarks[13],"hDGenQuarks_13",
1462     "Phi for t quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1463     AddTH1(hDGenQuarks[14],"hDGenQuarks_14","Pt for light quarks;p_{t} [GeV];#",200,0.0,400.);
1464 ceballos 1.44 AddTH1(hDGenQuarks[15],"hDGenQuarks_15","Eta for light quarks;#eta;#",200,-10.0,10.);
1465 loizides 1.46 AddTH1(hDGenQuarks[16],"hDGenQuarks_16",
1466     "Phi for light quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1467 loizides 1.1
1468     // qqH
1469 loizides 1.46 AddTH1(hDGenWBF[0], "hDGenWBF_0",
1470     "Delta Phi jj for WBF quarks;#Delta Phi_{jj};#",90,0.0,180.);
1471     AddTH1(hDGenWBF[1], "hDGenWBF_1",
1472     "Delta Eta jj for WBF quarks;#Delta #eta_{jj};#",100,0.0,10.);
1473     AddTH1(hDGenWBF[2], "hDGenWBF_2",
1474     "Pt max for WBF quarks;p_{t} [GeV];#",200,0.0,400.);
1475     AddTH1(hDGenWBF[3], "hDGenWBF_3",
1476     "Pt min for WBF quarks;p_{t} [GeV];#",200,0.0,400.);
1477     AddTH1(hDGenWBF[4], "hDGenWBF_4",
1478     "dijet mass for WBF quarks;m_{jj};#",200,0.0,4000.);
1479 loizides 1.1
1480 loizides 1.6 // bosons
1481 loizides 1.46 AddTH1(hDGenBosons[0], "hDGenBosons_0", "Number of bosons;N_{bosons};#",10,-0.5,9.5);
1482     AddTH1(hDGenBosons[1], "hDGenBosons_1", "Pt of bosons;p_{t} [GeV];#",200,0.0,400.0);
1483     AddTH1(hDGenBosons[2], "hDGenBosons_2", "Eta of bosons;#eta;#",100,-5.0,5.0);
1484 ceballos 1.49 AddTH1(hDGenBosons[3], "hDGenBosons_3", "Mass of bosons;Mass;#",2000,0.0,2000.0);
1485 loizides 1.46 AddTH1(hDGenBosons[4], "hDGenBosons_4", "Mass of bosons;m_{V};#",200,0.0,200.0);
1486     AddTH1(hDGenBosons[5], "hDGenBosons_5", "Mass of W bosons;m_{W};#",200,0.0,200.0);
1487     AddTH1(hDGenBosons[6], "hDGenBosons_6", "Mass of Z bosons;m_{Z};#",200,0.0,200.0);
1488     AddTH1(hDGenBosons[7], "hDGenBosons_7",
1489     "Number of W bosons + 4 * Z bosons;Number;#",13,-0.5,12.5);
1490 ceballos 1.10
1491     // photons
1492 loizides 1.46 AddTH1(hDGenPhotons[0], "hDGenPhotons_0", "Number of photons;N_{photons};#",10,-0.5,9.5);
1493     AddTH1(hDGenPhotons[1], "hDGenPhotons_1", "Pt of photons;p_{t} [GeV];#",200,0.0,400.0);
1494     AddTH1(hDGenPhotons[2], "hDGenPhotons_2", "Eta of photons;#eta;#",100,-5.0,5.0);
1495 ceballos 1.16
1496 loizides 1.40 // rad photons
1497 loizides 1.46 AddTH1(hDGenRadPhotons[0], "hDGenRadPhotons_0",
1498     "Number of radiative photons;N_{photons};#",10,-0.5,9.5);
1499     AddTH1(hDGenRadPhotons[1], "hDGenRadPhotons_1",
1500     "Pt of radiative photons;p_{t} [GeV];#",400,0.0,200.0);
1501     AddTH1(hDGenRadPhotons[2], "hDGenRadPhotons_2",
1502     "Eta of radiative photons;#eta;#",100,0.0,5.0);
1503     AddTH1(hDGenRadPhotons[3], "hDGenRadPhotons_3",
1504 ceballos 1.49 "Status of mother of radiative photons;Status;#",20,-0.5,19.5);
1505 loizides 1.46 AddTH1(hDGenRadPhotons[4], "hDGenRadPhotons_4",
1506     "IsGenerated+2*IsSimulated of radiative photons;IsGenerated+2*IsSimulated;#",
1507     4,-0.5,3.5);
1508     AddTH1(hDGenRadPhotons[5], "hDGenRadPhotons_5",
1509     "Delta R between photon and mother of radiative photons;#Delta R;#",500,0.0,5.0);
1510     AddTH1(hDGenRadPhotons[6], "hDGenRadPhotons_6",
1511 ceballos 1.51 "Mass photon-photon mother;Mass;#",500,0.0,100.0);
1512     AddTH1(hDGenRadPhotons[7], "hDGenRadPhotons_7",
1513 loizides 1.46 "Number of radiative photon with muon as a mother;Status;#",2,-0.5,1.5);
1514 ceballos 1.32
1515     // ISR photons
1516 loizides 1.46 AddTH1(hDGenISRPhotons[0], "hDGenISRPhotons_0",
1517     "Number of ISR photons;N_{photons};#",10,-0.5,9.5);
1518     AddTH1(hDGenISRPhotons[1], "hDGenISRPhotons_1",
1519     "Pt of ISR photons;p_{t} [GeV];#",400,0.0,200.0);
1520     AddTH1(hDGenISRPhotons[2], "hDGenISRPhotons_2",
1521     "Eta of ISR photons;#eta;#",100,0.0,5.0);
1522     AddTH1(hDGenISRPhotons[3], "hDGenISRPhotons_3",
1523     "Status of mother of radiative photons;#eta;#",20,-0.5,19.5);
1524     AddTH1(hDGenISRPhotons[4], "hDGenISRPhotons_4",
1525     "IsGenerated+2*IsSimulated of radiative photons;IsGenerated+2*IsSimulated;#",
1526     4,-0.5,3.5);
1527     AddTH1(hDGenISRPhotons[5], "hDGenISRPhotons_5",
1528     "Delta R between photon and mother of ISR photons;#Delta R;#",500,0.0,5.0);
1529 ceballos 1.51 AddTH1(hDGenISRPhotons[6], "hDGenISRPhotons_6",
1530     "Mass photon-photon mother;Mass;#",500,0.0,100.0);
1531 ceballos 1.32
1532 ceballos 1.42 // auxiliar for MG studies
1533 loizides 1.46 AddTH1(hDVMass[0], "hDVMass_0", "Mass of munu candidates ;Mass [GeV];#",200,0.,200.);
1534     AddTH1(hDVMass[1], "hDVMass_1", "Mass of elnu candidates ;Mass [GeV];#",200,0.,200.);
1535     AddTH1(hDVMass[2], "hDVMass_2", "Mass of taunu candidates ;Mass [GeV];#",200,0.,200.);
1536     AddTH1(hDVMass[3], "hDVMass_3", "Mass of mumu candidates ;Mass [GeV];#",200,0.,200.);
1537     AddTH1(hDVMass[4], "hDVMass_4", "Mass of ee candidates ;Mass [GeV];#",200,0.,200.);
1538     AddTH1(hDVMass[5], "hDVMass_5", "Mass of tautau candidates;Mass [GeV];#",200,0.,200.);
1539     AddTH1(hDVMass[6], "hDVMass_6", "Mass of numunumu candidates;Mass [GeV];#",200,0.,200.);
1540     AddTH1(hDVMass[7], "hDVMass_7", "Mass of nuenue candidates;Mass [GeV];#",200,0.,200.);
1541     AddTH1(hDVMass[8], "hDVMass_8", "Mass of nutaunutau candidates;Mass [GeV];#",200,0.,200.);
1542     AddTH1(hDVMass[9], "hDVMass_9",
1543     "Mass of munu candidates for t events ;Mass [GeV];#",200,0.,200.);
1544     AddTH1(hDVMass[10],"hDVMass_10",
1545     "Mass of elnu candidates for t events ;Mass [GeV];#",200,0.,200.);
1546     AddTH1(hDVMass[11],"hDVMass_11",
1547     "Mass of taunu candidates for t events;Mass [GeV];#",200,0.,200.);
1548     AddTH1(hDVMass[12],"hDVMass_12",
1549     "Mass of qq candidates for t events;Mass [GeV];#",200,0.,200.);
1550 ceballos 1.44
1551     // Special study about VVjets
1552 loizides 1.46 AddTH1(hDVVMass[0], "hDVVMass_0", "Mass of munu for WW events;Mass [GeV];#",200,0.,200.);
1553     AddTH1(hDVVMass[1], "hDVVMass_1", "Mass of munu WZ events;Mass [GeV];#",200,0.,200.);
1554     AddTH1(hDVVMass[2], "hDVVMass_2", "Mass of elnu WW events;Mass [GeV];#",200,0.,200.);
1555     AddTH1(hDVVMass[3], "hDVVMass_3", "Mass of elnu WZ events;Mass [GeV];#",200,0.,200.);
1556     AddTH1(hDVVMass[4], "hDVVMass_4", "Mass of taunu WW events;Mass [GeV];#",200,0.,200.);
1557     AddTH1(hDVVMass[5], "hDVVMass_5", "Mass of taunu WZ events;Mass [GeV];#",200,0.,200.);
1558     AddTH1(hDVVMass[6], "hDVVMass_6", "Mass of mumu WZ events;Mass [GeV];#",200,0.,200.);
1559     AddTH1(hDVVMass[7], "hDVVMass_7", "Mass of mumu ZZ events;Mass [GeV];#",200,0.,200.);
1560     AddTH1(hDVVMass[8], "hDVVMass_8", "Mass of ee WZ events;Mass [GeV];#",200,0.,200.);
1561     AddTH1(hDVVMass[9], "hDVVMass_9", "Mass of ee ZZ events;Mass [GeV];#",200,0.,200.);
1562     AddTH1(hDVVMass[10],"hDVVMass_10","Mass of tautau WZ events;Mass [GeV];#",200,0.,200.);
1563     AddTH1(hDVVMass[11],"hDVVMass_11","Mass of tautau ZZ events;Mass [GeV];#",200,0.,200.);
1564     AddTH1(hDVVMass[12],"hDVVMass_12","Mass of numunumu WZ events;Mass [GeV];#",200,0.,200.);
1565     AddTH1(hDVVMass[13],"hDVVMass_13","Mass of numunumu ZZ events;Mass [GeV];#",200,0.,200.);
1566     AddTH1(hDVVMass[14],"hDVVMass_14","Mass of nuenue WZ events;Mass [GeV];#",200,0.,200.);
1567     AddTH1(hDVVMass[15],"hDVVMass_15","Mass of nuenue ZZ events;Mass [GeV];#",200,0.,200.);
1568     AddTH1(hDVVMass[16],"hDVVMass_16","Mass of nutaunutau WZ events;Mass [GeV];#",200,0.,200.);
1569     AddTH1(hDVVMass[17],"hDVVMass_17","Mass of nutaunutau ZZ events;Mass [GeV];#",200,0.,200.);
1570 ceballos 1.44 AddTH1(hDVVMass[18],"hDVVMass_18","Ratios for WW events;Type;#",7,-0.5,6.5);
1571     AddTH1(hDVVMass[19],"hDVVMass_19","Ratios for WZ events;Type;#",10,-0.5,9.5);
1572     AddTH1(hDVVMass[20],"hDVVMass_20","Ratios for ZZ2l events;Type;#",7,-0.5,6.5);
1573     AddTH1(hDVVMass[21],"hDVVMass_21","Ratios for ZZ4l events;Type;#",16,-0.5,15.5);
1574 loizides 1.46 AddTH1(hDVVMass[22],"hDVVMass_22","Maximum mass for WW events;Mass [GeV];#",200,0.,200.);
1575     AddTH1(hDVVMass[23],"hDVVMass_23","Minimum mass for WW events;Mass [GeV];#",200,0.,200.);
1576     AddTH1(hDVVMass[24],"hDVVMass_24","Maximum mass for WZ events;Mass [GeV];#",200,0.,200.);
1577     AddTH1(hDVVMass[25],"hDVVMass_25","Minimum mass for WZ events;Mass [GeV];#",200,0.,200.);
1578     AddTH1(hDVVMass[26],"hDVVMass_26","Maximum mass for ZZ events;Mass [GeV];#",200,0.,200.);
1579     AddTH1(hDVVMass[27],"hDVVMass_27","Minimum mass for ZZ events;Mass [GeV];#",200,0.,200.);
1580 loizides 1.1 }
1581     }