ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.47
Committed: Wed Jul 15 06:42:01 2009 UTC (15 years, 9 months ago) by phedex
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_011, Mit_010a, Mit_010
Changes since 1.46: +67 -65 lines
Log Message:
fix a small bug. there was one section where we fill histograms but was not checking if GetFillHist is true.

File Contents

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