ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.69
Committed: Thu Jun 28 22:44:37 2012 UTC (12 years, 10 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.68: +55 -23 lines
Log Message:
new

File Contents

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