ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.54
Committed: Tue Oct 20 08:17:39 2009 UTC (15 years, 6 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.53: +76 -3 lines
Log Message:
remove empty spaces

File Contents

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