ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.73
Committed: Thu Nov 22 06:27:40 2012 UTC (12 years, 5 months ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.72: +3 -3 lines
Log Message:
fix

File Contents

# User Rev Content
1 ceballos 1.73 // $Id: GeneratorMod.cc,v 1.72 2012/11/22 06:26:41 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 ceballos 1.70
629 ceballos 1.72 /*GenTempLeptons->Sort();
630 ceballos 1.70 GenLeptons->Sort();
631     if(GenTempLeptons->GetEntries() == 3 &&
632     GenLeptons->GetEntries() == 3){
633     CompositeParticle dilepton01;
634     dilepton01.AddDaughter(GenLeptons->At(0));
635     dilepton01.AddDaughter(GenLeptons->At(1));
636     CompositeParticle dilepton02;
637     dilepton02.AddDaughter(GenLeptons->At(0));
638     dilepton02.AddDaughter(GenLeptons->At(2));
639     CompositeParticle dilepton12;
640     dilepton12.AddDaughter(GenLeptons->At(1));
641     dilepton12.AddDaughter(GenLeptons->At(2));
642     CompositeParticle trilepton;
643     trilepton.AddDaughter(GenLeptons->At(0));
644     trilepton.AddDaughter(GenLeptons->At(1));
645     trilepton.AddDaughter(GenLeptons->At(2));
646     CompositeParticle trileptonGen;
647     trileptonGen.AddDaughter(GenTempLeptons->At(0));
648     trileptonGen.AddDaughter(GenTempLeptons->At(1));
649     trileptonGen.AddDaughter(GenTempLeptons->At(2));
650     Double_t mass_4l = -1.0;
651     Double_t massW[3] = {-1.0, -1.0, -1.0};
652     if(GenNeutrinos->GetEntries() >= 1) {
653     Int_t theNeu = -1;
654     for(unsigned int neu=0; neu<GenNeutrinos->GetEntries(); neu++){
655     if(GenNeutrinos->At(neu)->DistinctMother()->AbsPdgId() == MCParticle::kW) {theNeu = neu; break;}
656     }
657     if(theNeu != -1){
658     CompositeParticle fourlepton;
659     fourlepton.AddDaughter(GenLeptons->At(0));
660     fourlepton.AddDaughter(GenLeptons->At(1));
661     fourlepton.AddDaughter(GenLeptons->At(2));
662     fourlepton.AddDaughter(GenNeutrinos->At(theNeu));
663     mass_4l = fourlepton.Mass();
664     CompositeParticle lepton0N;
665     lepton0N.AddDaughter(GenLeptons->At(0));
666     lepton0N.AddDaughter(GenNeutrinos->At(theNeu));
667     massW[0] = lepton0N.Mass();
668     CompositeParticle lepton1N;
669     lepton1N.AddDaughter(GenLeptons->At(1));
670     lepton1N.AddDaughter(GenNeutrinos->At(theNeu));
671     massW[1] = lepton1N.Mass();
672     CompositeParticle lepton2N;
673     lepton2N.AddDaughter(GenLeptons->At(2));
674     lepton2N.AddDaughter(GenNeutrinos->At(theNeu));
675     massW[2] = lepton2N.Mass();
676     }
677     }
678 ceballos 1.72 cout << "AAAAAAAAA "
679 ceballos 1.70 << GenLeptons->At(0)->PdgId() << " "
680     << GenLeptons->At(1)->PdgId() << " "
681     << GenLeptons->At(2)->PdgId() << " "
682     << GenLeptons->At(0)->Pt() << " "
683     << GenLeptons->At(1)->Pt() << " "
684     << GenLeptons->At(2)->Pt() << " "
685     << GenLeptons->At(0)->Eta() << " "
686     << GenLeptons->At(1)->Eta() << " "
687     << GenLeptons->At(2)->Eta() << " "
688     << GenLeptons->At(0)->Phi() << " "
689     << GenLeptons->At(1)->Phi() << " "
690     << GenLeptons->At(2)->Phi() << " "
691     << dilepton01.Mass() << " "
692     << dilepton02.Mass() << " "
693     << dilepton12.Mass() << " "
694     << trilepton.Mass() << " "
695     << mass_4l << " "
696     << massW[0] << " "
697     << massW[1] << " "
698     << massW[2] << " "
699     << trileptonGen.Mass() << " "
700 ceballos 1.71 << endl;
701 ceballos 1.70 if(dilepton01.Mass() > 62 && dilepton01.Mass() < 72 &&
702     dilepton02.Mass() > 52 && dilepton02.Mass() < 55 &&
703     dilepton12.Mass() > 7.2 && dilepton12.Mass() < 8.2 &&
704     GenLeptons->At(0)->AbsPdgId() == MCParticle::kEl &&
705     GenLeptons->At(1)->AbsPdgId() == MCParticle::kEl &&
706 ceballos 1.73 GenLeptons->At(2)->AbsPdgId() == MCParticle::kEl) {delete GenTempLeptons; SkipEvent(); return;}
707     }*/
708 ceballos 1.69 }
709     delete GenTempLeptons;
710 ceballos 1.57
711     // --------------------------------
712     // Begin special study about VVjets
713     // --------------------------------
714     if(sumV[0] + 4*sumV[1] == 2 || sumV[0] + 4*sumV[1] == 5 || sumV[0] + 4*sumV[1] == 8){
715     MCParticleOArr *GenTempMG1 = new MCParticleOArr;
716     Double_t diBosonMass[2] = {0., 0.};
717     for (UInt_t i=0; i<fParticles->GetEntries(); ++i) {
718     const MCParticle *p = fParticles->At(i);
719    
720     if (p->IsParton() && p->NDaughters() >= 2) {
721     CompositeParticle *diBoson = new CompositeParticle();
722     if (p->HasDaughter(MCParticle::kMu) && p->HasDaughter(MCParticle::kMuNu)) {
723     isOld = kFALSE;
724     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
725     if(p->FindDaughter(MCParticle::kMu) == GenTempMG1->At(nl)) {
726     isOld = kTRUE;
727     break;
728     }
729     }
730     if(isOld == kFALSE){
731     GenTempMG1->Add(p->FindDaughter(MCParticle::kMu));
732     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu));
733     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu));
734     if (GetFillHist() && sumV[0] + 4*sumV[1] == 2)
735     hDVVMass[0]->Fill(TMath::Min(diBoson->Mass(),199.999));
736     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
737     hDVVMass[1]->Fill(TMath::Min(diBoson->Mass(),199.999));
738     }
739     }
740     if (p->HasDaughter(MCParticle::kEl) && p->HasDaughter(MCParticle::kElNu)) {
741     isOld = kFALSE;
742     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
743     if(p->FindDaughter(MCParticle::kEl) == GenTempMG1->At(nl)) {
744     isOld = kTRUE;
745     break;
746     }
747     }
748     if(isOld == kFALSE){
749     GenTempMG1->Add(p->FindDaughter(MCParticle::kEl));
750     diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl));
751     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu));
752     if (GetFillHist() && sumV[0] + 4*sumV[1] == 2)
753     hDVVMass[2]->Fill(TMath::Min(diBoson->Mass(),199.999));
754     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
755     hDVVMass[3]->Fill(TMath::Min(diBoson->Mass(),199.999));
756     }
757     }
758     if (p->HasDaughter(MCParticle::kTau) && p->HasDaughter(MCParticle::kTauNu)) {
759     isOld = kFALSE;
760     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
761     if(p->FindDaughter(MCParticle::kTau) == GenTempMG1->At(nl)) {
762     isOld = kTRUE;
763     break;
764     }
765     }
766     if(isOld == kFALSE){
767     GenTempMG1->Add(p->FindDaughter(MCParticle::kTau));
768     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau));
769     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu));
770     if (GetFillHist() && sumV[0] + 4*sumV[1] == 2)
771     hDVVMass[4]->Fill(TMath::Min(diBoson->Mass(),199.999));
772     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
773     hDVVMass[5]->Fill(TMath::Min(diBoson->Mass(),199.999));
774     }
775     }
776     if (p->HasDaughter(MCParticle::kMu,kTRUE) && p->HasDaughter(-1*MCParticle::kMu,kTRUE)) {
777     isOld = kFALSE;
778     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
779     if(p->FindDaughter(MCParticle::kMu,kTRUE) == GenTempMG1->At(nl)) {
780     isOld = kTRUE;
781     break;
782     }
783     }
784     if(isOld == kFALSE){
785     GenTempMG1->Add(p->FindDaughter(MCParticle::kMu,kTRUE));
786     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMu,kTRUE));
787     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kMu,kTRUE));
788     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
789     hDVVMass[6]->Fill(TMath::Min(diBoson->Mass(),199.999));
790     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
791     hDVVMass[7]->Fill(TMath::Min(diBoson->Mass(),199.999));
792     }
793     }
794     if (p->HasDaughter(MCParticle::kEl,kTRUE) && p->HasDaughter(-1*MCParticle::kEl,kTRUE)) {
795     isOld = kFALSE;
796     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
797     if(p->FindDaughter(MCParticle::kEl,kTRUE) == GenTempMG1->At(nl)) {
798     isOld = kTRUE;
799     break;
800     }
801     }
802     if(isOld == kFALSE){
803     GenTempMG1->Add(p->FindDaughter(MCParticle::kEl,kTRUE));
804     diBoson->AddDaughter(p->FindDaughter(MCParticle::kEl,kTRUE));
805     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kEl,kTRUE));
806     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
807     hDVVMass[8]->Fill(TMath::Min(diBoson->Mass(),199.999));
808     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
809     hDVVMass[9]->Fill(TMath::Min(diBoson->Mass(),199.999));
810     }
811     }
812     if (p->HasDaughter(MCParticle::kTau,kTRUE) && p->HasDaughter(-1*MCParticle::kTau,kTRUE)) {
813     isOld = kFALSE;
814     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
815     if(p->FindDaughter(MCParticle::kTau,kTRUE) == GenTempMG1->At(nl)) {
816     isOld = kTRUE;
817     break;
818     }
819     }
820     if(isOld == kFALSE){
821     GenTempMG1->Add(p->FindDaughter(MCParticle::kTau,kTRUE));
822     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTau,kTRUE));
823     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kTau,kTRUE));
824     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
825     hDVVMass[10]->Fill(TMath::Min(diBoson->Mass(),199.999));
826     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
827     hDVVMass[11]->Fill(TMath::Min(diBoson->Mass(),199.999));
828     }
829     }
830     if (p->HasDaughter(MCParticle::kMuNu,kTRUE) && p->HasDaughter(-1*MCParticle::kMuNu,kTRUE)) {
831     isOld = kFALSE;
832     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
833     if(p->FindDaughter(MCParticle::kMuNu,kTRUE) == GenTempMG1->At(nl)) {
834     isOld = kTRUE;
835     break;
836     }
837     }
838     if(isOld == kFALSE){
839     GenTempMG1->Add(p->FindDaughter(MCParticle::kMuNu,kTRUE));
840     diBoson->AddDaughter(p->FindDaughter(MCParticle::kMuNu,kTRUE));
841     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kMuNu,kTRUE));
842     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
843     hDVVMass[12]->Fill(TMath::Min(diBoson->Mass(),199.999));
844     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
845     hDVVMass[13]->Fill(TMath::Min(diBoson->Mass(),199.999));
846     }
847     }
848     if (p->HasDaughter(MCParticle::kElNu,kTRUE) && p->HasDaughter(-1*MCParticle::kElNu,kTRUE)) {
849     isOld = kFALSE;
850     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
851     if(p->FindDaughter(MCParticle::kElNu,kTRUE) == GenTempMG1->At(nl)) {
852     isOld = kTRUE;
853     break;
854     }
855     }
856     if(isOld == kFALSE){
857     GenTempMG1->Add(p->FindDaughter(MCParticle::kElNu,kTRUE));
858     diBoson->AddDaughter(p->FindDaughter(MCParticle::kElNu,kTRUE));
859     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kElNu,kTRUE));
860     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
861     hDVVMass[14]->Fill(TMath::Min(diBoson->Mass(),199.999));
862     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
863     hDVVMass[15]->Fill(TMath::Min(diBoson->Mass(),199.999));
864     }
865     }
866     if (p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
867     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE)) {
868     isOld = kFALSE;
869     for(UInt_t nl = 0; nl < GenTempMG1->GetEntries(); nl++){
870     if(p->FindDaughter(MCParticle::kTauNu,kTRUE) == GenTempMG1->At(nl)) {
871     isOld = kTRUE;
872     break;
873     }
874     }
875     if(isOld == kFALSE){
876     GenTempMG1->Add(p->FindDaughter(MCParticle::kTauNu,kTRUE));
877     diBoson->AddDaughter(p->FindDaughter(MCParticle::kTauNu,kTRUE));
878     diBoson->AddDaughter(p->FindDaughter(-1*MCParticle::kTauNu,kTRUE));
879     if (GetFillHist() && sumV[0] + 4*sumV[1] == 5)
880     hDVVMass[16]->Fill(TMath::Min(diBoson->Mass(),199.999));
881     if (GetFillHist() && sumV[0] + 4*sumV[1] == 8)
882     hDVVMass[17]->Fill(TMath::Min(diBoson->Mass(),199.999));
883     }
884     }
885     if (diBoson && diBosonMass[0] <= 0) diBosonMass[0] = diBoson->Mass();
886     else if(diBoson && diBosonMass[1] <= 0) diBosonMass[1] = diBoson->Mass();
887     delete diBoson;
888     }
889     else if (p->Status() == 3 && (p->Is(MCParticle::kZ) || p->Is(MCParticle::kW))) {
890     if (diBosonMass[0] <= 0) diBosonMass[0] = p->Mass();
891     else if(diBosonMass[1] <= 0) diBosonMass[1] = p->Mass();
892     if (GetFillHist()) {
893     if (sumV[0] + 4*sumV[1] == 2 && p->Is(MCParticle::kW) &&
894     p->HasDaughter(MCParticle::kMu) &&
895     p->HasDaughter(MCParticle::kMuNu))
896     hDVVMass[0]->Fill(TMath::Min(p->Mass(),199.999));
897     else if(sumV[0] + 4*sumV[1] == 2 && p->Is(MCParticle::kW) &&
898     p->HasDaughter(MCParticle::kEl) &&
899     p->HasDaughter(MCParticle::kElNu))
900     hDVVMass[2]->Fill(TMath::Min(p->Mass(),199.999));
901     else if(sumV[0] + 4*sumV[1] == 2 && p->Is(MCParticle::kW) &&
902     p->HasDaughter(MCParticle::kTau) &&
903     p->HasDaughter(MCParticle::kTauNu))
904     hDVVMass[4]->Fill(TMath::Min(p->Mass(),199.999));
905     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kW) &&
906     p->HasDaughter(MCParticle::kMu) &&
907     p->HasDaughter(MCParticle::kMuNu))
908     hDVVMass[1]->Fill(TMath::Min(p->Mass(),199.999));
909     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kW) &&
910     p->HasDaughter(MCParticle::kEl) &&
911     p->HasDaughter(MCParticle::kElNu))
912     hDVVMass[3]->Fill(TMath::Min(p->Mass(),199.999));
913     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kW) &&
914     p->HasDaughter(MCParticle::kTau) &&
915     p->HasDaughter(MCParticle::kTauNu))
916     hDVVMass[5]->Fill(TMath::Min(p->Mass(),199.999));
917     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
918     p->HasDaughter(MCParticle::kMu,kTRUE) &&
919     p->HasDaughter(-1*MCParticle::kMu,kTRUE))
920     hDVVMass[6]->Fill(TMath::Min(p->Mass(),199.999));
921     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
922     p->HasDaughter(MCParticle::kEl,kTRUE) &&
923     p->HasDaughter(-1*MCParticle::kEl,kTRUE))
924     hDVVMass[8]->Fill(TMath::Min(p->Mass(),199.999));
925     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
926     p->HasDaughter(MCParticle::kTau,kTRUE) &&
927     p->HasDaughter(-1*MCParticle::kTau,kTRUE))
928     hDVVMass[10]->Fill(TMath::Min(p->Mass(),199.999));
929     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
930     p->HasDaughter(MCParticle::kMuNu,kTRUE) &&
931     p->HasDaughter(-1*MCParticle::kMuNu,kTRUE))
932     hDVVMass[12]->Fill(TMath::Min(p->Mass(),199.999));
933     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
934     p->HasDaughter(MCParticle::kElNu,kTRUE) &&
935     p->HasDaughter(-1*MCParticle::kElNu,kTRUE))
936     hDVVMass[14]->Fill(TMath::Min(p->Mass(),199.999));
937     else if(sumV[0] + 4*sumV[1] == 5 && p->Is(MCParticle::kZ) &&
938     p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
939     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE))
940     hDVVMass[16]->Fill(TMath::Min(p->Mass(),199.999));
941     else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
942     p->HasDaughter(MCParticle::kMu,kTRUE) &&
943     p->HasDaughter(-1*MCParticle::kMu,kTRUE))
944     hDVVMass[7]->Fill(TMath::Min(p->Mass(),199.999));
945     else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
946     p->HasDaughter(MCParticle::kEl,kTRUE) &&
947     p->HasDaughter(-1*MCParticle::kEl,kTRUE))
948     hDVVMass[9]->Fill(TMath::Min(p->Mass(),199.999));
949     else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
950     p->HasDaughter(MCParticle::kTau,kTRUE) &&
951     p->HasDaughter(-1*MCParticle::kTau,kTRUE))
952     hDVVMass[11]->Fill(TMath::Min(p->Mass(),199.999));
953     else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
954     p->HasDaughter(MCParticle::kMuNu,kTRUE) &&
955     p->HasDaughter(-1*MCParticle::kMuNu,kTRUE))
956     hDVVMass[13]->Fill(TMath::Min(p->Mass(),199.999));
957     else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
958     p->HasDaughter(MCParticle::kElNu,kTRUE) &&
959     p->HasDaughter(-1*MCParticle::kElNu,kTRUE))
960     hDVVMass[15]->Fill(TMath::Min(p->Mass(),199.999));
961     else if(sumV[0] + 4*sumV[1] == 8 && p->Is(MCParticle::kZ) &&
962     p->HasDaughter(MCParticle::kTauNu,kTRUE) &&
963     p->HasDaughter(-1*MCParticle::kTauNu,kTRUE))
964     hDVVMass[17]->Fill(TMath::Min(p->Mass(),199.999));
965     }
966     }
967     } // end loop of particles
968     if (GetFillHist()) {
969     if(diBosonMass[0] > 70 && diBosonMass[0] < 110 &&
970     diBosonMass[1] > 70 && diBosonMass[1] < 110){
971     if(sumV[0] + 4*sumV[1] == 2){
972 ceballos 1.58 if (sumVVFlavor[0] == 2) hDVVMass[18]->Fill(0.);
973     else if(sumVVFlavor[1] == 2) hDVVMass[18]->Fill(1.);
974 ceballos 1.57 else if(sumVVFlavor[2] == 2) hDVVMass[18]->Fill(2.);
975     else if(sumVVFlavor[0] == 1 && sumVVFlavor[1] == 1) hDVVMass[18]->Fill(3.);
976     else if(sumVVFlavor[0] == 1 && sumVVFlavor[2] == 1) hDVVMass[18]->Fill(4.);
977     else if(sumVVFlavor[1] == 1 && sumVVFlavor[2] == 1) hDVVMass[18]->Fill(5.);
978     else hDVVMass[18]->Fill(6.);
979     }
980     if(sumV[0] + 4*sumV[1] == 5){
981     if (sumVVFlavor[3] == 1 && sumVVFlavor[0] == 1) hDVVMass[19]->Fill(0.);
982     else if(sumVVFlavor[3] == 1 && sumVVFlavor[1] == 1) hDVVMass[19]->Fill(1.);
983     else if(sumVVFlavor[3] == 1 && sumVVFlavor[2] == 1) hDVVMass[19]->Fill(2.);
984     else if(sumVVFlavor[4] == 1 && sumVVFlavor[0] == 1) hDVVMass[19]->Fill(3.);
985     else if(sumVVFlavor[4] == 1 && sumVVFlavor[1] == 1) hDVVMass[19]->Fill(4.);
986     else if(sumVVFlavor[4] == 1 && sumVVFlavor[2] == 1) hDVVMass[19]->Fill(5.);
987     else if(sumVVFlavor[5] == 1 && sumVVFlavor[0] == 1) hDVVMass[19]->Fill(6.);
988     else if(sumVVFlavor[5] == 1 && sumVVFlavor[1] == 1) hDVVMass[19]->Fill(7.);
989     else if(sumVVFlavor[5] == 1 && sumVVFlavor[2] == 1) hDVVMass[19]->Fill(8.);
990 ceballos 1.58 else { hDVVMass[19]->Fill(9.);
991     /*for(int i=0; i<9; i++) cout << sumVVFlavor[i] << " " ;cout << endl;*/}
992 ceballos 1.57 }
993     if(sumV[0] + 4*sumV[1] == 8 &&
994 ceballos 1.58 sumVVFlavor[3] + sumVVFlavor[4] + sumVVFlavor[5] == 2){
995     if (sumVVFlavor[3] == 2) hDVVMass[20]->Fill(0.);
996     else if(sumVVFlavor[4] == 2) hDVVMass[20]->Fill(1.);
997     else if(sumVVFlavor[5] == 2) hDVVMass[20]->Fill(2.);
998 ceballos 1.57 else if(sumVVFlavor[3] == 1 && sumVVFlavor[4] == 1) hDVVMass[20]->Fill(3.);
999     else if(sumVVFlavor[3] == 1 && sumVVFlavor[5] == 1) hDVVMass[20]->Fill(4.);
1000     else if(sumVVFlavor[4] == 1 && sumVVFlavor[5] == 1) hDVVMass[20]->Fill(5.);
1001     else hDVVMass[20]->Fill(6.);
1002     }
1003     else if(sumV[0] + 4*sumV[1] == 8){
1004 ceballos 1.58 if (sumVVFlavor[6] == 2) hDVVMass[21]->Fill(0.);
1005     else if(sumVVFlavor[7] == 2) hDVVMass[21]->Fill(1.);
1006     else if(sumVVFlavor[8] == 2) hDVVMass[21]->Fill(2.);
1007 ceballos 1.57 else if(sumVVFlavor[3] == 1 && sumVVFlavor[6] == 1) hDVVMass[21]->Fill(3.);
1008     else if(sumVVFlavor[3] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(4.);
1009     else if(sumVVFlavor[3] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(5.);
1010     else if(sumVVFlavor[4] == 1 && sumVVFlavor[6] == 1) hDVVMass[21]->Fill(6.);
1011     else if(sumVVFlavor[4] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(7.);
1012     else if(sumVVFlavor[4] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(8.);
1013     else if(sumVVFlavor[5] == 1 && sumVVFlavor[6] == 1) hDVVMass[21]->Fill(9.);
1014     else if(sumVVFlavor[5] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(10.);
1015     else if(sumVVFlavor[5] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(11.);
1016     else if(sumVVFlavor[6] == 1 && sumVVFlavor[7] == 1) hDVVMass[21]->Fill(12.);
1017     else if(sumVVFlavor[6] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(13.);
1018     else if(sumVVFlavor[7] == 1 && sumVVFlavor[8] == 1) hDVVMass[21]->Fill(14.);
1019     else hDVVMass[21]->Fill(15.);
1020     }
1021     } // 60<mV1/2<120
1022     if(sumV[0] + 4*sumV[1] == 2)
1023     hDVVMass[22]->Fill(TMath::Min(TMath::Min(diBosonMass[0],diBosonMass[1]),199.999));
1024     if(sumV[0] + 4*sumV[1] == 2)
1025     hDVVMass[23]->Fill(TMath::Min(TMath::Max(diBosonMass[0],diBosonMass[1]),199.999));
1026     if(sumV[0] + 4*sumV[1] == 5)
1027     hDVVMass[24]->Fill(TMath::Min(TMath::Min(diBosonMass[0],diBosonMass[1]),199.999));
1028     if(sumV[0] + 4*sumV[1] == 5)
1029     hDVVMass[25]->Fill(TMath::Min(TMath::Max(diBosonMass[0],diBosonMass[1]),199.999));
1030     if(sumV[0] + 4*sumV[1] == 8)
1031     hDVVMass[26]->Fill(TMath::Min(TMath::Min(diBosonMass[0],diBosonMass[1]),199.999));
1032     if(sumV[0] + 4*sumV[1] == 8)
1033     hDVVMass[27]->Fill(TMath::Min(TMath::Max(diBosonMass[0],diBosonMass[1]),199.999));
1034     }
1035     delete GenTempMG1;
1036     } // WW, WZ or ZZ
1037     // --------------------------------
1038     // End special study about VVjets
1039     // --------------------------------
1040    
1041 ceballos 1.60 Met *theMET = new Met(-totalMET[0], -totalMET[1]);
1042     theMET->SetElongitudinal(-totalMET[2]);
1043 ceballos 1.57 GenMet->AddOwned(theMET);
1044    
1045     // sort according to pt
1046     GenLeptons->Sort();
1047     GenAllLeptons->Sort();
1048     GenTaus->Sort();
1049     GenNeutrinos->Sort();
1050     GenQuarks->Sort();
1051     GenqqHs->Sort();
1052     GenBosons->Sort();
1053     GenPhotons->Sort();
1054     GenRadPhotons->Sort();
1055     GenISRPhotons->Sort();
1056     } // Only for Monte Carlo
1057 loizides 1.19
1058 loizides 1.8 // add objects to this event for other modules to use
1059 ceballos 1.30 AddObjThisEvt(GenMet);
1060 loizides 1.13 AddObjThisEvt(GenLeptons);
1061     AddObjThisEvt(GenAllLeptons);
1062     AddObjThisEvt(GenTaus);
1063     AddObjThisEvt(GenNeutrinos);
1064     AddObjThisEvt(GenQuarks);
1065     AddObjThisEvt(GenqqHs);
1066     AddObjThisEvt(GenBosons);
1067     AddObjThisEvt(GenPhotons);
1068 ceballos 1.32 AddObjThisEvt(GenRadPhotons);
1069     AddObjThisEvt(GenISRPhotons);
1070    
1071 ceballos 1.54 // --------------------------------
1072     // Copy these Collections into the Arrays for Publication for Output Module
1073     // --------------------------------
1074     fGenLeptons->Delete();
1075     fGenAllLeptons->Delete();
1076     fGenTaus->Delete();
1077     fGenNeutrinos->Delete();
1078     fGenQuarks->Delete();
1079     fGenqqHs->Delete();
1080     fGenBosons->Delete();
1081     fGenPhotons->Delete();
1082     fGenRadPhotons->Delete();
1083     fGenISRPhotons->Delete();
1084    
1085     for (UInt_t i=0; i < GenLeptons->GetEntries(); ++i) {
1086     mithep::MCParticle *genParticle = fGenLeptons->Allocate();
1087     new (genParticle) mithep::MCParticle(GenLeptons->At(i)->Px(),GenLeptons->At(i)->Py(),
1088     GenLeptons->At(i)->Pz(),GenLeptons->At(i)->E(),
1089     GenLeptons->At(i)->PdgId(),GenLeptons->At(i)->Status());
1090     }
1091     for (UInt_t i=0; i < GenAllLeptons->GetEntries(); ++i) {
1092     mithep::MCParticle *genParticle = fGenAllLeptons->Allocate();
1093     new (genParticle) mithep::MCParticle(GenAllLeptons->At(i)->Px(),GenAllLeptons->At(i)->Py(),
1094     GenAllLeptons->At(i)->Pz(),GenAllLeptons->At(i)->E(),
1095     GenAllLeptons->At(i)->PdgId(),GenAllLeptons->At(i)->Status());
1096     }
1097     for (UInt_t i=0; i < GenTaus->GetEntries(); ++i) {
1098     mithep::MCParticle *genParticle = fGenTaus->Allocate();
1099     new (genParticle) mithep::MCParticle(GenTaus->At(i)->Px(),GenTaus->At(i)->Py(),
1100     GenTaus->At(i)->Pz(),GenTaus->At(i)->E(),
1101     GenTaus->At(i)->PdgId(),GenTaus->At(i)->Status());
1102     }
1103     for (UInt_t i=0; i < GenNeutrinos->GetEntries(); ++i) {
1104     mithep::MCParticle *genParticle = fGenNeutrinos->Allocate();
1105     new (genParticle) mithep::MCParticle(GenNeutrinos->At(i)->Px(),GenNeutrinos->At(i)->Py(),
1106     GenNeutrinos->At(i)->Pz(),GenNeutrinos->At(i)->E(),
1107     GenNeutrinos->At(i)->PdgId(),GenNeutrinos->At(i)->Status());
1108     }
1109     for (UInt_t i=0; i < GenQuarks->GetEntries(); ++i) {
1110     mithep::MCParticle *genParticle = fGenQuarks->Allocate();
1111     new (genParticle) mithep::MCParticle(GenQuarks->At(i)->Px(),GenQuarks->At(i)->Py(),
1112     GenQuarks->At(i)->Pz(),GenQuarks->At(i)->E(),
1113     GenQuarks->At(i)->PdgId(),GenQuarks->At(i)->Status());
1114     }
1115     for (UInt_t i=0; i < GenqqHs->GetEntries(); ++i) {
1116     mithep::MCParticle *genParticle = fGenqqHs->Allocate();
1117     new (genParticle) mithep::MCParticle(GenqqHs->At(i)->Px(),GenqqHs->At(i)->Py(),
1118     GenqqHs->At(i)->Pz(),GenqqHs->At(i)->E(),
1119     GenqqHs->At(i)->PdgId(),GenqqHs->At(i)->Status());
1120 loizides 1.55 }
1121 ceballos 1.54
1122 loizides 1.53 if (fCopyArrays) {
1123     // --------------------------------
1124     // Copy these Collections into the Arrays for Publication for Output Module
1125     // --------------------------------
1126     fGenLeptons->Delete();
1127     fGenAllLeptons->Delete();
1128     fGenTaus->Delete();
1129     fGenNeutrinos->Delete();
1130     fGenQuarks->Delete();
1131     fGenqqHs->Delete();
1132     fGenBosons->Delete();
1133     fGenPhotons->Delete();
1134     fGenRadPhotons->Delete();
1135     fGenISRPhotons->Delete();
1136    
1137     for (UInt_t i=0; i < GenLeptons->GetEntries(); ++i) {
1138     mithep::MCParticle *genParticle = fGenLeptons->Allocate();
1139     new (genParticle) mithep::MCParticle(GenLeptons->At(i)->Px(),GenLeptons->At(i)->Py(),
1140     GenLeptons->At(i)->Pz(),GenLeptons->At(i)->E(),
1141     GenLeptons->At(i)->PdgId(),GenLeptons->At(i)->Status());
1142     }
1143     for (UInt_t i=0; i < GenAllLeptons->GetEntries(); ++i) {
1144     mithep::MCParticle *genParticle = fGenAllLeptons->Allocate();
1145     new (genParticle) mithep::MCParticle(GenAllLeptons->At(i)->Px(),GenAllLeptons->At(i)->Py(),
1146     GenAllLeptons->At(i)->Pz(),GenAllLeptons->At(i)->E(),
1147     GenAllLeptons->At(i)->PdgId(),
1148     GenAllLeptons->At(i)->Status());
1149     }
1150     for (UInt_t i=0; i < GenTaus->GetEntries(); ++i) {
1151     mithep::MCParticle *genParticle = fGenTaus->Allocate();
1152     new (genParticle) mithep::MCParticle(GenTaus->At(i)->Px(),GenTaus->At(i)->Py(),
1153     GenTaus->At(i)->Pz(),GenTaus->At(i)->E(),
1154     GenTaus->At(i)->PdgId(),
1155     GenTaus->At(i)->Status());
1156     }
1157     for (UInt_t i=0; i < GenNeutrinos->GetEntries(); ++i) {
1158     mithep::MCParticle *genParticle = fGenNeutrinos->Allocate();
1159     new (genParticle) mithep::MCParticle(GenNeutrinos->At(i)->Px(),GenNeutrinos->At(i)->Py(),
1160     GenNeutrinos->At(i)->Pz(),GenNeutrinos->At(i)->E(),
1161     GenNeutrinos->At(i)->PdgId(),
1162     GenNeutrinos->At(i)->Status());
1163     }
1164     for (UInt_t i=0; i < GenQuarks->GetEntries(); ++i) {
1165     mithep::MCParticle *genParticle = fGenQuarks->Allocate();
1166     new (genParticle) mithep::MCParticle(GenQuarks->At(i)->Px(),GenQuarks->At(i)->Py(),
1167     GenQuarks->At(i)->Pz(),GenQuarks->At(i)->E(),
1168     GenQuarks->At(i)->PdgId(),
1169     GenQuarks->At(i)->Status());
1170     }
1171     for (UInt_t i=0; i < GenqqHs->GetEntries(); ++i) {
1172     mithep::MCParticle *genParticle = fGenqqHs->Allocate();
1173     new (genParticle) mithep::MCParticle(GenqqHs->At(i)->Px(),GenqqHs->At(i)->Py(),
1174     GenqqHs->At(i)->Pz(),GenqqHs->At(i)->E(),
1175     GenqqHs->At(i)->PdgId(),
1176     GenqqHs->At(i)->Status());
1177     }
1178     for (UInt_t i=0; i < GenBosons->GetEntries(); ++i) {
1179     mithep::MCParticle *genParticle = fGenBosons->Allocate();
1180     new (genParticle) mithep::MCParticle(GenBosons->At(i)->Px(),GenBosons->At(i)->Py(),
1181     GenBosons->At(i)->Pz(),GenBosons->At(i)->E(),
1182     GenBosons->At(i)->PdgId(),
1183     GenBosons->At(i)->Status());
1184     }
1185     for (UInt_t i=0; i < GenPhotons->GetEntries(); ++i) {
1186     mithep::MCParticle *genParticle = fGenPhotons->Allocate();
1187     new (genParticle) mithep::MCParticle(GenPhotons->At(i)->Px(),GenPhotons->At(i)->Py(),
1188     GenPhotons->At(i)->Pz(),GenPhotons->At(i)->E(),
1189     GenPhotons->At(i)->PdgId(),
1190     GenPhotons->At(i)->Status());
1191     }
1192     for (UInt_t i=0; i < GenRadPhotons->GetEntries(); ++i) {
1193     mithep::MCParticle *genParticle = fGenRadPhotons->Allocate();
1194     new (genParticle) mithep::MCParticle(GenRadPhotons->At(i)->Px(),GenRadPhotons->At(i)->Py(),
1195     GenRadPhotons->At(i)->Pz(),GenRadPhotons->At(i)->E(),
1196     GenRadPhotons->At(i)->PdgId(),
1197     GenRadPhotons->At(i)->Status());
1198     }
1199     for (UInt_t i=0; i < GenISRPhotons->GetEntries(); ++i) {
1200     mithep::MCParticle *genParticle = fGenISRPhotons->Allocate();
1201     new (genParticle) mithep::MCParticle(GenISRPhotons->At(i)->Px(),GenISRPhotons->At(i)->Py(),
1202     GenISRPhotons->At(i)->Pz(),GenISRPhotons->At(i)->E(),
1203     GenISRPhotons->At(i)->PdgId(),
1204     GenISRPhotons->At(i)->Status());
1205     }
1206 sixie 1.48 }
1207    
1208 ceballos 1.54 for (UInt_t i=0; i < GenBosons->GetEntries(); ++i) {
1209     mithep::MCParticle *genParticle = fGenBosons->Allocate();
1210     new (genParticle) mithep::MCParticle(GenBosons->At(i)->Px(),GenBosons->At(i)->Py(),
1211     GenBosons->At(i)->Pz(),GenBosons->At(i)->E(),
1212     GenBosons->At(i)->PdgId(),GenBosons->At(i)->Status());
1213     }
1214     for (UInt_t i=0; i < GenPhotons->GetEntries(); ++i) {
1215     mithep::MCParticle *genParticle = fGenPhotons->Allocate();
1216     new (genParticle) mithep::MCParticle(GenPhotons->At(i)->Px(),GenPhotons->At(i)->Py(),
1217     GenPhotons->At(i)->Pz(),GenPhotons->At(i)->E(),
1218     GenPhotons->At(i)->PdgId(),GenPhotons->At(i)->Status());
1219     }
1220     for (UInt_t i=0; i < GenRadPhotons->GetEntries(); ++i) {
1221     mithep::MCParticle *genParticle = fGenRadPhotons->Allocate();
1222     new (genParticle) mithep::MCParticle(GenRadPhotons->At(i)->Px(),GenRadPhotons->At(i)->Py(),
1223     GenRadPhotons->At(i)->Pz(),GenRadPhotons->At(i)->E(),
1224     GenRadPhotons->At(i)->PdgId(),GenRadPhotons->At(i)->Status());
1225     }
1226     for (UInt_t i=0; i < GenISRPhotons->GetEntries(); ++i) {
1227     mithep::MCParticle *genParticle = fGenISRPhotons->Allocate();
1228     new (genParticle) mithep::MCParticle(GenISRPhotons->At(i)->Px(),GenISRPhotons->At(i)->Py(),
1229     GenISRPhotons->At(i)->Pz(),GenISRPhotons->At(i)->E(),
1230     GenISRPhotons->At(i)->PdgId(),GenISRPhotons->At(i)->Status());
1231     }
1232    
1233 ceballos 1.63 // Apply WW filter (without filling all histograms)
1234 phedex 1.65 Bool_t passVVFilter = kFALSE;
1235 sixie 1.66 if ( (fAllowWWEvents == kTRUE && sumV[0] + 4*sumV[1] == 2 )
1236 phedex 1.65 ||
1237 sixie 1.66 (fAllowWZEvents == kTRUE && sumV[0] + 4*sumV[1] == 6 )
1238 phedex 1.65 ||
1239 sixie 1.66 (fAllowZZEvents == kTRUE && sumV[0] + 4*sumV[1] == 8 )
1240 phedex 1.65 ) passVVFilter = kTRUE;
1241 sixie 1.66 if (fApplyVVFilter && !passVVFilter) {
1242 ceballos 1.63 SkipEvent();
1243     return;
1244     }
1245 ceballos 1.58
1246 loizides 1.5 // fill histograms if requested
1247 loizides 1.20 if (GetFillHist()) {
1248 ceballos 1.30 // MET
1249     hDGenMet[0]->Fill(GenMet->At(0)->Pt());
1250     hDGenMet[1]->Fill(GenMet->At(0)->Px());
1251     hDGenMet[2]->Fill(GenMet->At(0)->Py());
1252     hDGenMet[3]->Fill(GenMet->At(0)->Elongitudinal());
1253    
1254 ceballos 1.58 // pt min for leptons from W/Z
1255     hDGenPtMin->Fill(TMath::Min(ptMin, 199.999));
1256     //if(ptMin < 10){
1257     // SkipEvent();
1258     // return;
1259     //}
1260    
1261 loizides 1.6 // leptons
1262 loizides 1.1 hDGenLeptons[0]->Fill(GenLeptons->GetEntries());
1263 loizides 1.5 for(UInt_t i=0; i<GenLeptons->GetEntries(); i++) {
1264 loizides 1.1 hDGenLeptons[1]->Fill(GenLeptons->At(i)->Pt());
1265 loizides 1.5 hDGenLeptons[2]->Fill(TMath::Abs(GenLeptons->At(i)->Eta()));
1266     hDGenLeptons[3]->Fill(GenLeptons->At(i)->PhiDeg());
1267     for(UInt_t j=i+1; j<GenLeptons->GetEntries(); j++) {
1268 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
1269     dilepton->AddDaughter(GenLeptons->At(i));
1270     dilepton->AddDaughter(GenLeptons->At(j));
1271     hDGenLeptons[4]->Fill(dilepton->Mass());
1272     delete dilepton;
1273     }
1274 ceballos 1.22 }
1275     // looking at events with two leptons
1276     if (GenLeptons->GetEntries() == 2) {
1277     hDGenLeptons[5]->Fill(TMath::Min(TMath::Max(TMath::Abs(GenLeptons->At(0)->Eta()),
1278     TMath::Abs(GenLeptons->At(1)->Eta())),
1279 loizides 1.5 4.999));
1280 ceballos 1.22 hDGenLeptons[6]->Fill(TMath::Min(TMath::Min(TMath::Abs(GenLeptons->At(0)->Eta()),
1281     TMath::Abs(GenLeptons->At(1)->Eta())),
1282 loizides 1.5 4.999));
1283 ceballos 1.22 if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1284     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
1285     hDGenLeptons[7]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
1286     if (GenLeptons->At(0)->Pt() > 20.0) {
1287     hDGenLeptons[8]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
1288     if (GenLeptons->At(1)->Pt() > 10.0) {
1289 loizides 1.1 CompositeParticle *dilepton = new CompositeParticle();
1290 ceballos 1.22 dilepton->AddDaughter(GenLeptons->At(0));
1291     dilepton->AddDaughter(GenLeptons->At(1));
1292 loizides 1.1 hDGenLeptons[9]->Fill(TMath::Min(dilepton->Mass(),999.999));
1293 ceballos 1.64 hDGenLeptons[10]->Fill(MathUtils::DeltaPhi(GenLeptons->At(0)->Phi(),
1294     GenLeptons->At(1)->Phi())
1295     * 180./ TMath::Pi());
1296     hDGenLeptons[11]->Fill(MathUtils::DeltaR(*GenLeptons->At(0),
1297     *GenLeptons->At(1)));
1298 ceballos 1.22 if(dilepton->Mass() > 12.0){
1299 ceballos 1.64 hDGenLeptons[12]->Fill(MathUtils::DeltaPhi(GenLeptons->At(0)->Phi(),
1300 ceballos 1.22 GenLeptons->At(1)->Phi())
1301     * 180./ TMath::Pi());
1302 ceballos 1.64 hDGenLeptons[13]->Fill(MathUtils::DeltaR(*GenLeptons->At(0),
1303 loizides 1.40 *GenLeptons->At(1)));
1304 ceballos 1.22 }
1305 loizides 1.1 delete dilepton;
1306     }
1307     }
1308     }
1309     }
1310 ceballos 1.22 // looking at events with three leptons
1311     if (GenLeptons->GetEntries() == 3) {
1312     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1313     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
1314     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5) {
1315 ceballos 1.64 hDGenLeptons[14]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
1316 ceballos 1.22 if (GenLeptons->At(0)->Pt() > 20.0) {
1317 ceballos 1.64 hDGenLeptons[15]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
1318     hDGenLeptons[16]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
1319 ceballos 1.22 if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0) {
1320     CompositeParticle *dilepton01 = new CompositeParticle();
1321     dilepton01->AddDaughter(GenLeptons->At(0));
1322     dilepton01->AddDaughter(GenLeptons->At(1));
1323     CompositeParticle *dilepton02 = new CompositeParticle();
1324     dilepton02->AddDaughter(GenLeptons->At(0));
1325     dilepton02->AddDaughter(GenLeptons->At(2));
1326     CompositeParticle *dilepton12 = new CompositeParticle();
1327     dilepton12->AddDaughter(GenLeptons->At(1));
1328     dilepton12->AddDaughter(GenLeptons->At(2));
1329 ceballos 1.64 hDGenLeptons[17]->Fill(TMath::Min(dilepton01->Mass(),999.999));
1330     hDGenLeptons[17]->Fill(TMath::Min(dilepton02->Mass(),999.999));
1331     hDGenLeptons[17]->Fill(TMath::Min(dilepton12->Mass(),999.999));
1332 ceballos 1.22 CompositeParticle *trilepton = new CompositeParticle();
1333     trilepton->AddDaughter(GenLeptons->At(0));
1334     trilepton->AddDaughter(GenLeptons->At(1));
1335     trilepton->AddDaughter(GenLeptons->At(2));
1336 ceballos 1.64 hDGenLeptons[18]->Fill(TMath::Min(trilepton->Mass(),999.999));
1337 loizides 1.40 Double_t deltaR[3] = {MathUtils::DeltaR(*GenLeptons->At(0),
1338     *GenLeptons->At(1)),
1339     MathUtils::DeltaR(*GenLeptons->At(0),
1340     *GenLeptons->At(2)),
1341     MathUtils::DeltaR(*GenLeptons->At(1),
1342     *GenLeptons->At(2))};
1343 loizides 1.27 Double_t deltaRMin = deltaR[0];
1344 loizides 1.40 for(Int_t i=1; i<3; i++)
1345     if(deltaRMin > deltaR[i])
1346     deltaRMin = deltaR[i];
1347 ceballos 1.64 hDGenLeptons[19]->Fill(deltaRMin);
1348 ceballos 1.22
1349     delete dilepton01;
1350     delete dilepton02;
1351     delete dilepton12;
1352     delete trilepton;
1353     }
1354     }
1355     }
1356     }
1357     // looking at events with four leptons
1358     if (GenLeptons->GetEntries() == 4) {
1359     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1360     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5 &&
1361     TMath::Abs(GenLeptons->At(2)->Eta()) < 2.5 &&
1362     TMath::Abs(GenLeptons->At(3)->Eta()) < 2.5) {
1363 ceballos 1.64 hDGenLeptons[20]->Fill(TMath::Min(GenLeptons->At(0)->Pt(),199.999));
1364 ceballos 1.22 if (GenLeptons->At(0)->Pt() > 20.0) {
1365 ceballos 1.64 hDGenLeptons[21]->Fill(TMath::Min(GenLeptons->At(1)->Pt(),199.999));
1366     hDGenLeptons[22]->Fill(TMath::Min(GenLeptons->At(2)->Pt(),199.999));
1367     hDGenLeptons[23]->Fill(TMath::Min(GenLeptons->At(3)->Pt(),199.999));
1368 ceballos 1.22 if (GenLeptons->At(1)->Pt() > 10.0 && GenLeptons->At(2)->Pt() > 10.0 &&
1369     GenLeptons->At(3)->Pt() > 10.0) {
1370     CompositeParticle *dilepton01 = new CompositeParticle();
1371     dilepton01->AddDaughter(GenLeptons->At(0));
1372     dilepton01->AddDaughter(GenLeptons->At(1));
1373     CompositeParticle *dilepton02 = new CompositeParticle();
1374     dilepton02->AddDaughter(GenLeptons->At(0));
1375     dilepton02->AddDaughter(GenLeptons->At(2));
1376     CompositeParticle *dilepton03 = new CompositeParticle();
1377     dilepton03->AddDaughter(GenLeptons->At(0));
1378     dilepton03->AddDaughter(GenLeptons->At(3));
1379     CompositeParticle *dilepton12 = new CompositeParticle();
1380     dilepton12->AddDaughter(GenLeptons->At(1));
1381     dilepton12->AddDaughter(GenLeptons->At(2));
1382     CompositeParticle *dilepton13 = new CompositeParticle();
1383     dilepton13->AddDaughter(GenLeptons->At(1));
1384     dilepton13->AddDaughter(GenLeptons->At(3));
1385     CompositeParticle *dilepton23 = new CompositeParticle();
1386     dilepton23->AddDaughter(GenLeptons->At(2));
1387     dilepton23->AddDaughter(GenLeptons->At(3));
1388 ceballos 1.64 hDGenLeptons[24]->Fill(TMath::Min(dilepton01->Mass(),999.999));
1389     hDGenLeptons[24]->Fill(TMath::Min(dilepton02->Mass(),999.999));
1390     hDGenLeptons[24]->Fill(TMath::Min(dilepton03->Mass(),999.999));
1391     hDGenLeptons[24]->Fill(TMath::Min(dilepton12->Mass(),999.999));
1392     hDGenLeptons[24]->Fill(TMath::Min(dilepton13->Mass(),999.999));
1393     hDGenLeptons[24]->Fill(TMath::Min(dilepton23->Mass(),999.999));
1394 ceballos 1.22 CompositeParticle *fourlepton = new CompositeParticle();
1395     fourlepton->AddDaughter(GenLeptons->At(0));
1396     fourlepton->AddDaughter(GenLeptons->At(1));
1397     fourlepton->AddDaughter(GenLeptons->At(2));
1398     fourlepton->AddDaughter(GenLeptons->At(3));
1399 ceballos 1.64 hDGenLeptons[25]->Fill(TMath::Min(fourlepton->Mass(),999.999));
1400 loizides 1.40 Double_t deltaR[6] = {MathUtils::DeltaR(*GenLeptons->At(0),
1401     *GenLeptons->At(1)),
1402     MathUtils::DeltaR(*GenLeptons->At(0),
1403     *GenLeptons->At(2)),
1404     MathUtils::DeltaR(*GenLeptons->At(0),
1405     *GenLeptons->At(3)),
1406     MathUtils::DeltaR(*GenLeptons->At(1),
1407     *GenLeptons->At(2)),
1408     MathUtils::DeltaR(*GenLeptons->At(1),
1409     *GenLeptons->At(3)),
1410     MathUtils::DeltaR(*GenLeptons->At(2),
1411     *GenLeptons->At(3))};
1412 loizides 1.27 Double_t deltaRMin = deltaR[0];
1413 loizides 1.40 for(Int_t i=1; i<6; i++)
1414     if(deltaRMin > deltaR[i])
1415     deltaRMin = deltaR[i];
1416 ceballos 1.64 hDGenLeptons[26]->Fill(deltaRMin);
1417 ceballos 1.22
1418     delete dilepton01;
1419     delete dilepton02;
1420     delete dilepton03;
1421     delete dilepton12;
1422     delete dilepton13;
1423     delete dilepton23;
1424     delete fourlepton;
1425     }
1426     }
1427     }
1428     }
1429 loizides 1.1
1430 loizides 1.6 // all leptons
1431 ceballos 1.3 hDGenAllLeptons[0]->Fill(GenAllLeptons->GetEntries());
1432 loizides 1.5 for(UInt_t i=0; i<GenAllLeptons->GetEntries(); i++) {
1433 ceballos 1.3 hDGenAllLeptons[1]->Fill(GenAllLeptons->At(i)->Pt());
1434 ceballos 1.49 hDGenAllLeptons[2]->Fill(GenAllLeptons->At(i)->AbsEta());
1435 loizides 1.5 hDGenAllLeptons[3]->Fill(GenAllLeptons->At(i)->PhiDeg());
1436 ceballos 1.3 }
1437 ceballos 1.49 if(GenAllLeptons->GetEntries() >= 2) hDGenAllLeptons[4]->Fill(GenAllLeptons->At(1)->Pt());
1438 ceballos 1.3
1439 loizides 1.6 // taus
1440 loizides 1.1 hDGenTaus[0]->Fill(GenTaus->GetEntries());
1441 loizides 1.5 for(UInt_t i=0; i<GenTaus->GetEntries(); i++) {
1442 loizides 1.1 hDGenTaus[1]->Fill(GenTaus->At(i)->Pt());
1443 ceballos 1.49 hDGenTaus[2]->Fill(GenTaus->At(i)->AbsEta());
1444 loizides 1.5 hDGenTaus[3]->Fill(GenTaus->At(i)->PhiDeg());
1445 loizides 1.1 }
1446    
1447 loizides 1.6 // neutrinos
1448 loizides 1.1 hDGenNeutrinos[0]->Fill(GenNeutrinos->GetEntries());
1449     CompositeParticle *neutrinoTotal = new CompositeParticle();
1450 loizides 1.5 for(UInt_t i=0; i<GenNeutrinos->GetEntries(); i++) {
1451     if (GenNeutrinos->At(i)->HasMother())
1452 loizides 1.1 neutrinoTotal->AddDaughter(GenNeutrinos->At(i));
1453     }
1454 loizides 1.5 if (GenNeutrinos->GetEntries() > 0) {
1455 loizides 1.1 hDGenNeutrinos[1]->Fill(neutrinoTotal->Pt());
1456 ceballos 1.49 hDGenNeutrinos[2]->Fill(neutrinoTotal->AbsEta());
1457 loizides 1.5 hDGenNeutrinos[3]->Fill(neutrinoTotal->PhiDeg());
1458 loizides 1.1 }
1459     delete neutrinoTotal;
1460    
1461 loizides 1.6 // quarks
1462 loizides 1.1 hDGenQuarks[0]->Fill(GenQuarks->GetEntries());
1463 loizides 1.5 for(UInt_t i=0; i<GenQuarks->GetEntries(); i++) {
1464     for(UInt_t j=i+1; j<GenQuarks->GetEntries(); j++) {
1465 loizides 1.1 CompositeParticle *dijet = new CompositeParticle();
1466     dijet->AddDaughter(GenQuarks->At(i));
1467     dijet->AddDaughter(GenQuarks->At(j));
1468     hDGenQuarks[1]->Fill(dijet->Pt());
1469     hDGenQuarks[2]->Fill(dijet->Mass());
1470 loizides 1.5 if (TMath::Abs(GenQuarks->At(i)->Eta()) < 2.5 &&
1471     TMath::Abs(GenQuarks->At(j)->Eta()) < 2.5) {
1472 loizides 1.1 hDGenQuarks[3]->Fill(dijet->Pt());
1473     hDGenQuarks[4]->Fill(dijet->Mass());
1474     }
1475     delete dijet;
1476     }
1477 ceballos 1.2 // b quark info
1478 loizides 1.5 if (GenQuarks->At(i)->AbsPdgId() == 5) {
1479 ceballos 1.2 hDGenQuarks[5]->Fill(GenQuarks->At(i)->Pt());
1480     hDGenQuarks[6]->Fill(GenQuarks->At(i)->Eta());
1481     hDGenQuarks[7]->Fill(GenQuarks->At(i)->Phi());
1482 ceballos 1.22 if (GenLeptons->GetEntries() >= 2 &&
1483     GenLeptons->At(0)->Pt() > 20 &&
1484     GenLeptons->At(1)->Pt() > 15) {
1485     if (TMath::Abs(GenLeptons->At(0)->Eta()) < 2.5 &&
1486     TMath::Abs(GenLeptons->At(1)->Eta()) < 2.5) {
1487 ceballos 1.2 hDGenQuarks[8]->Fill(GenQuarks->At(i)->Pt());
1488     hDGenQuarks[9]->Fill(GenQuarks->At(i)->Eta());
1489     hDGenQuarks[10]->Fill(GenQuarks->At(i)->Phi());
1490     }
1491     }
1492     }
1493     // t quark info
1494 loizides 1.5 else if (GenQuarks->At(i)->AbsPdgId() == 6) {
1495 ceballos 1.2 hDGenQuarks[11]->Fill(GenQuarks->At(i)->Pt());
1496     hDGenQuarks[12]->Fill(GenQuarks->At(i)->Eta());
1497     hDGenQuarks[13]->Fill(GenQuarks->At(i)->Phi());
1498     }
1499     // light quark info
1500     else {
1501     hDGenQuarks[14]->Fill(GenQuarks->At(i)->Pt());
1502     hDGenQuarks[15]->Fill(GenQuarks->At(i)->Eta());
1503     hDGenQuarks[16]->Fill(GenQuarks->At(i)->Phi());
1504     }
1505 loizides 1.1 }
1506    
1507 loizides 1.6 // wbf
1508 loizides 1.5 if (GenqqHs->GetEntries() == 2) {
1509 loizides 1.1 hDGenWBF[0]->Fill(MathUtils::DeltaPhi(GenqqHs->At(0)->Phi(),
1510     GenqqHs->At(1)->Phi()) * 180./ TMath::Pi());
1511 loizides 1.5 hDGenWBF[1]->Fill(TMath::Abs(GenqqHs->At(0)->Eta()-GenqqHs->At(1)->Eta()));
1512 loizides 1.1 hDGenWBF[2]->Fill(TMath::Max(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
1513     hDGenWBF[3]->Fill(TMath::Min(GenqqHs->At(0)->Pt(),GenqqHs->At(1)->Pt()));
1514     CompositeParticle *diqq = new CompositeParticle();
1515     diqq->AddDaughter(GenqqHs->At(0));
1516     diqq->AddDaughter(GenqqHs->At(1));
1517     hDGenWBF[4]->Fill(diqq->Mass());
1518     delete diqq;
1519     }
1520    
1521 loizides 1.6 // bosons
1522 loizides 1.1 hDGenBosons[0]->Fill(GenBosons->GetEntries());
1523 loizides 1.5 for(UInt_t i=0; i<GenBosons->GetEntries(); i++) {
1524 loizides 1.1 hDGenBosons[1]->Fill(GenBosons->At(i)->Pt());
1525     hDGenBosons[2]->Fill(GenBosons->At(i)->Eta());
1526 ceballos 1.42 hDGenBosons[3]->Fill(TMath::Min(GenBosons->At(i)->Mass(),1999.999));
1527     hDGenBosons[4]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1528     if(GenBosons->At(i)->Is(MCParticle::kW))
1529     hDGenBosons[5]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1530     if(GenBosons->At(i)->Is(MCParticle::kZ))
1531     hDGenBosons[6]->Fill(TMath::Min(GenBosons->At(i)->Mass(),199.999));
1532 ceballos 1.61 hDGenBosons[7]->Fill(GenBosons->At(i)->Rapidity());
1533 ceballos 1.62 if(GenBosons->At(i)->Mass() > 60 && GenBosons->At(i)->Mass() < 120){
1534     hDGenBosons[8] ->Fill(GenBosons->At(i)->Pt());
1535     hDGenBosons[9] ->Fill(GenBosons->At(i)->Eta());
1536     hDGenBosons[10]->Fill(GenBosons->At(i)->Rapidity());
1537     }
1538 ceballos 1.42 }
1539 ceballos 1.62 hDGenBosons[11]->Fill(TMath::Min((double)(sumV[0] + 4*sumV[1]),12.4999));
1540 ceballos 1.10
1541     // photons
1542     hDGenPhotons[0]->Fill(GenPhotons->GetEntries());
1543     for(UInt_t i=0; i<GenPhotons->GetEntries(); i++) {
1544     hDGenPhotons[1]->Fill(GenPhotons->At(i)->Pt());
1545     hDGenPhotons[2]->Fill(GenPhotons->At(i)->Eta());
1546     }
1547 ceballos 1.32
1548     // Rad photons
1549     hDGenRadPhotons[0]->Fill(GenRadPhotons->GetEntries());
1550     for(UInt_t i=0; i<GenRadPhotons->GetEntries(); i++) {
1551     hDGenRadPhotons[1]->Fill(TMath::Min(GenRadPhotons->At(i)->Pt(),199.999));
1552     hDGenRadPhotons[2]->Fill(TMath::Min(GenRadPhotons->At(i)->AbsEta(),4.999));
1553 ceballos 1.51 hDGenRadPhotons[3]->Fill(TMath::Min((double)GenRadPhotons->At(i)->DistinctMother()->Status(),
1554 loizides 1.46 19.499));
1555 loizides 1.40 hDGenRadPhotons[4]->Fill(GenRadPhotons->At(i)->IsGenerated() +
1556     2*GenRadPhotons->At(i)->IsSimulated());
1557 ceballos 1.49 if(GenRadPhotons->At(i)->DistinctMother()){
1558     hDGenRadPhotons[5]->Fill(TMath::Min(
1559 loizides 1.40 MathUtils::DeltaR(*GenRadPhotons->At(i),
1560 ceballos 1.49 *GenRadPhotons->At(i)->DistinctMother()),
1561 loizides 1.40 4.999));
1562 ceballos 1.51 CompositeParticle *object = new CompositeParticle();
1563     object->AddDaughter(GenRadPhotons->At(i));
1564     object->AddDaughter(GenRadPhotons->At(i)->DistinctMother());
1565     hDGenRadPhotons[6]->Fill(TMath::Min(object->Mass(),99.999));
1566     delete object;
1567 ceballos 1.49 }
1568 ceballos 1.32 Int_t Mother = 0;
1569 ceballos 1.49 if(GenRadPhotons->At(i)->DistinctMother() &&
1570     GenRadPhotons->At(i)->DistinctMother()->Is(MCParticle::kMu)) Mother = 1;
1571 ceballos 1.51 hDGenRadPhotons[7]->Fill(Mother);
1572 ceballos 1.32 }
1573    
1574     // ISR photons
1575     hDGenISRPhotons[0]->Fill(GenISRPhotons->GetEntries());
1576     for(UInt_t i=0; i<GenISRPhotons->GetEntries(); i++) {
1577     hDGenISRPhotons[1]->Fill(TMath::Min(GenISRPhotons->At(i)->Pt(),199.999));
1578     hDGenISRPhotons[2]->Fill(TMath::Min(GenISRPhotons->At(i)->AbsEta(),4.999));
1579 ceballos 1.51 hDGenISRPhotons[3]->Fill(TMath::Min((Double_t)GenISRPhotons->At(i)->DistinctMother()->Status(),
1580 loizides 1.40 19.499));
1581     hDGenISRPhotons[4]->Fill(GenISRPhotons->At(i)->IsGenerated() +
1582     2*GenISRPhotons->At(i)->IsSimulated());
1583 ceballos 1.51 if(GenISRPhotons->At(i)->DistinctMother()){
1584     hDGenISRPhotons[5]->Fill(TMath::Min(
1585     MathUtils::DeltaR(*GenISRPhotons->At(i),
1586     *GenISRPhotons->At(i)->DistinctMother()),4.999));
1587     CompositeParticle *object = new CompositeParticle();
1588     object->AddDaughter(GenISRPhotons->At(i));
1589     object->AddDaughter(GenISRPhotons->At(i)->DistinctMother());
1590     hDGenISRPhotons[6]->Fill(TMath::Min(object->Mass(),99.999));
1591     delete object;
1592     }
1593 ceballos 1.32 }
1594 ceballos 1.57 } // Fill histograms
1595 ceballos 1.34
1596 ceballos 1.49 // Apply ISR+Rad filter (but filling all histograms)
1597 loizides 1.55 if (fApplyISRFilter == kTRUE &&
1598     (GenISRPhotons->GetEntries() > 0 || GenRadPhotons->GetEntries() > 0)) {
1599 ceballos 1.34 SkipEvent();
1600     }
1601 ceballos 1.63
1602 loizides 1.1 }
1603    
1604     //--------------------------------------------------------------------------------------------------
1605     void GeneratorMod::SlaveBegin()
1606     {
1607 loizides 1.5 // Book branch and histograms if wanted.
1608    
1609 ceballos 1.57 if(fIsData == kFALSE){
1610     ReqEventObject(fMCPartName, fParticles, kTRUE);
1611     }
1612 sixie 1.48
1613     // Publish Arrays For the Output Module
1614     PublishObj(fGenLeptons);
1615     PublishObj(fGenAllLeptons);
1616     PublishObj(fGenTaus);
1617     PublishObj(fGenNeutrinos);
1618     PublishObj(fGenQuarks);
1619     PublishObj(fGenqqHs);
1620     PublishObj(fGenBosons);
1621     PublishObj(fGenPhotons);
1622     PublishObj(fGenRadPhotons);
1623     PublishObj(fGenISRPhotons);
1624    
1625 loizides 1.5 // fill histograms
1626 loizides 1.20 if (GetFillHist()) {
1627 ceballos 1.30 // MET
1628 loizides 1.46 AddTH1(hDGenMet[0],"hDGenMet_0","Gen MET Pt;p_{t} [GeV];#",200,0,200);
1629     AddTH1(hDGenMet[1],"hDGenMet_1","Gen MET Px;p_{x} [GeV];#",400,-200,200);
1630     AddTH1(hDGenMet[2],"hDGenMet_2","Gen MET Py;p_{y} [GeV];#",400,-200,200);
1631     AddTH1(hDGenMet[3],"hDGenMet_3","Gen MET Pz;p_{z} [GeV];#",400,-1000,1000);
1632 ceballos 1.30
1633 ceballos 1.58 // pt min for leptons from W/Z
1634     AddTH1(hDGenPtMin, "hDGenPtMin","Pt min leptons from W/Z;p_{t} [GeV];#",200,0.0,200.0);
1635    
1636 loizides 1.6 // leptons from W
1637 loizides 1.46 AddTH1(hDGenLeptons[0], "hDGenLeptons_0",
1638     "Number of leptons from W/Z;N_{leptons};#",10,-0.5,9.5);
1639     AddTH1(hDGenLeptons[1], "hDGenLeptons_1","Pt leptons from W/Z;p_{t} [GeV];#",100,0.0,200.0);
1640     AddTH1(hDGenLeptons[2], "hDGenLeptons_2","Eta leptons from W/Z;#eta;#",50,0.0,5.0);
1641     AddTH1(hDGenLeptons[3], "hDGenLeptons_3","Phi leptons from W/Z;#phi;#",90,0.0,180.0);
1642     AddTH1(hDGenLeptons[4], "hDGenLeptons_4","Dilepton mass from W/Z;m_{ll};#",1000,0.0,1000.0);
1643     AddTH1(hDGenLeptons[5], "hDGenLeptons_5","Eta Max for 2 lepton case;#eta;#",50,0.0,5.0);
1644     AddTH1(hDGenLeptons[6], "hDGenLeptons_6","Eta Min for 2 lepton case;#eta;#",50,0.0,5.0);
1645     AddTH1(hDGenLeptons[7], "hDGenLeptons_7",
1646     "Pt Max for 2 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1647     AddTH1(hDGenLeptons[8], "hDGenLeptons_8",
1648     "Pt Min for 2 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1649     AddTH1(hDGenLeptons[9], "hDGenLeptons_9",
1650     "DiLepton mass for 2 lepton case;p_{t} [GeV];#",1000,0.0,1000.0);
1651     AddTH1(hDGenLeptons[10],"hDGenLeptons_10",
1652     "Delta Phi ll for 2 lepton case;#Delta#phi_{ll};#",90,0.0,180.0);
1653 ceballos 1.44 AddTH1(hDGenLeptons[11],"hDGenLeptons_11","Delta R ll;#Delta R_{ll};#",100,0.0,5.0);
1654 loizides 1.46 AddTH1(hDGenLeptons[12],"hDGenLeptons_12",
1655 ceballos 1.64 "Delta Phi ll for 2 lepton case;#Delta#phi_{ll};#",90,0.0,180.0);
1656     AddTH1(hDGenLeptons[13],"hDGenLeptons_13","Delta R ll;#Delta R_{ll};#",100,0.0,5.0);
1657     AddTH1(hDGenLeptons[14],"hDGenLeptons_14",
1658 loizides 1.46 "Pt Max for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1659 ceballos 1.64 AddTH1(hDGenLeptons[15],"hDGenLeptons_15",
1660 loizides 1.46 "Pt 2nd for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1661 ceballos 1.64 AddTH1(hDGenLeptons[16],"hDGenLeptons_16",
1662 loizides 1.46 "Pt Min for 3 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1663 ceballos 1.64 AddTH1(hDGenLeptons[17],"hDGenLeptons_17",
1664 loizides 1.46 "Dilepton mass for 3 lepton case;m_{ll};#",1000,0.0,1000.0);
1665 ceballos 1.64 AddTH1(hDGenLeptons[18],"hDGenLeptons_18",
1666 loizides 1.46 "Trilepton mass for 3 lepton case;m_{lll};#",1000,0.0,1000.0);
1667 ceballos 1.64 AddTH1(hDGenLeptons[19],"hDGenLeptons_19",
1668 loizides 1.46 "Delta R Minimum between leptons for 3 lepton case;#Delta R_{ll};#",100,0.0,5.0);
1669 ceballos 1.64 AddTH1(hDGenLeptons[20],"hDGenLeptons_20",
1670 loizides 1.46 "Pt Max for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1671 ceballos 1.64 AddTH1(hDGenLeptons[21],"hDGenLeptons_21",
1672 loizides 1.46 "Pt 2nd for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1673 ceballos 1.64 AddTH1(hDGenLeptons[22],"hDGenLeptons_22",
1674 loizides 1.46 "Pt 3rd for 4 lepton case;p_{t} [GeV];#",100,0.0,200.0);
1675 ceballos 1.64 AddTH1(hDGenLeptons[23],"hDGenLeptons_23",
1676 loizides 1.46 "Pt 4th for 4 lepton case;#",100,0.0,200.0);
1677 ceballos 1.64 AddTH1(hDGenLeptons[24],"hDGenLeptons_24",
1678 loizides 1.46 "Dilepton mass for 4 lepton case;m_{ll};#",1000,0.0,1000.0);
1679 ceballos 1.64 AddTH1(hDGenLeptons[25],"hDGenLeptons_25",
1680 loizides 1.46 "Fourlepton mass for 3 lepton case;m_{llll};#",1000,0.0,1000.0);
1681 ceballos 1.64 AddTH1(hDGenLeptons[26],"hDGenLeptons_26",
1682 loizides 1.46 "Delta R Minimum between leptons for 4 lepton case;#Delta R_{ll};#",100,0.0,5.0);
1683 loizides 1.1
1684 loizides 1.6 // all leptons
1685 loizides 1.46 AddTH1(hDGenAllLeptons[0], "hDGenAllLeptons_0",
1686     "Number of all leptons;N_{leptons};#",10,-0.5,9.5);
1687 ceballos 1.49 AddTH1(hDGenAllLeptons[1], "hDGenAllLeptons_1","Pt all leptons;p_{t} [GeV];#",400,0.0,200.0);
1688 loizides 1.46 AddTH1(hDGenAllLeptons[2], "hDGenAllLeptons_2","Eta all leptons;#eta;#",50,0.0,5.0);
1689     AddTH1(hDGenAllLeptons[3], "hDGenAllLeptons_3","Phi all leptons;#phi;#",90,0.0,180.0);
1690 ceballos 1.49 AddTH1(hDGenAllLeptons[4], "hDGenAllLeptons_4","Pt second lepton;p_{t} [GeV];#",400,0.0,200.0);
1691 ceballos 1.69 AddTH1(hDGenAllLeptons[5], "hDGenAllLeptons_5",
1692     "Number of all leptons including taus;N_{leptons};#",10,-0.5,9.5);
1693     AddTH1(hDGenAllLeptons[6], "hDGenAllLeptons_6","MinMass; [GeV];#",100,0.0,100.0);
1694     AddTH1(hDGenAllLeptons[7], "hDGenAllLeptons_7","MaxMass; [GeV];#",100,0.0,100.0);
1695 ceballos 1.3
1696 loizides 1.6 // taus
1697 loizides 1.46 AddTH1(hDGenTaus[0], "hDGenTaus_0","Number of taus;N_{tau};#",10,-0.5,9.5);
1698     AddTH1(hDGenTaus[1], "hDGenTaus_1","Pt taus;p_{t} [GeV];#",100,0.0,200.0);
1699     AddTH1(hDGenTaus[2], "hDGenTaus_2","Eta taus;#eta;#",50,0.0,5.0);
1700     AddTH1(hDGenTaus[3], "hDGenTaus_3","Phi taus;#phi;#",90,0.0,180.0);
1701 loizides 1.1
1702 loizides 1.6 // neutrinos
1703 loizides 1.46 AddTH1(hDGenNeutrinos[0], "hDGenNeutrinos_0","Number of neutrinos;N_{#nu};#",10,-0.5,9.5);
1704     AddTH1(hDGenNeutrinos[1], "hDGenNeutrinos_1","Pt neutrinos;p_{t} [GeV];#",100,0.0,200.0);
1705 ceballos 1.49 AddTH1(hDGenNeutrinos[2], "hDGenNeutrinos_2","Eta neutrinos;#eta;#",50,0.0,5.0);
1706 loizides 1.46 AddTH1(hDGenNeutrinos[3], "hDGenNeutrinos_3","Phi neutrinos;#phi;#",90,0.0,180.0);
1707 loizides 1.1
1708 loizides 1.6 // quarks
1709 loizides 1.46 AddTH1(hDGenQuarks[0], "hDGenQuarks_0", "Number of quarks;N_{quarks};#",10,-0.5,9.5);
1710     AddTH1(hDGenQuarks[1], "hDGenQuarks_1", "dijet pt for quarks;p_{t} [GeV];#",200,0.0,400.);
1711     AddTH1(hDGenQuarks[2], "hDGenQuarks_2", "dijet mass for quarks;m_{jj};#",2000,0.0,2000.);
1712     AddTH1(hDGenQuarks[3], "hDGenQuarks_3",
1713     "dijet pt for quarks with |eta|<2.5;p_{t} [GeV];#",200,0.0,400.);
1714     AddTH1(hDGenQuarks[4], "hDGenQuarks_4",
1715     "dijet mass for quarks with |eta|<2.5;m_{jj};#",2000,0.0,2000.);
1716     AddTH1(hDGenQuarks[5], "hDGenQuarks_5", "Pt for b quarks;p_{t} [GeV];#",200,0.0,400.);
1717     AddTH1(hDGenQuarks[6], "hDGenQuarks_6", "Eta for b quarks;#eta;#",200,-10.0,10.);
1718     AddTH1(hDGenQuarks[7], "hDGenQuarks_7",
1719     "Phi for b quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1720     AddTH1(hDGenQuarks[8], "hDGenQuarks_8",
1721     "Pt for b quarks with |eta|<2.5;p_{t} [GeV];#",200,0.0,400.);
1722     AddTH1(hDGenQuarks[9], "hDGenQuarks_9",
1723     "Eta for b quarks with |eta|<2.5;#eta;#",200,-10.0,10.);
1724     AddTH1(hDGenQuarks[10],"hDGenQuarks_10",
1725     "Phi for b quarks with |eta|<2.5;#phi;#",200,-TMath::Pi(),TMath::Pi());
1726     AddTH1(hDGenQuarks[11],"hDGenQuarks_11","Pt for t quarks;p_{t} [GeV];#",200,0.0,400.);
1727 ceballos 1.44 AddTH1(hDGenQuarks[12],"hDGenQuarks_12","Eta for t quarks;#eta;#",200,-10.0,10.);
1728 loizides 1.46 AddTH1(hDGenQuarks[13],"hDGenQuarks_13",
1729     "Phi for t quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1730     AddTH1(hDGenQuarks[14],"hDGenQuarks_14","Pt for light quarks;p_{t} [GeV];#",200,0.0,400.);
1731 ceballos 1.44 AddTH1(hDGenQuarks[15],"hDGenQuarks_15","Eta for light quarks;#eta;#",200,-10.0,10.);
1732 loizides 1.46 AddTH1(hDGenQuarks[16],"hDGenQuarks_16",
1733     "Phi for light quarks;#phi;#",200,-TMath::Pi(),TMath::Pi());
1734 loizides 1.1
1735     // qqH
1736 loizides 1.46 AddTH1(hDGenWBF[0], "hDGenWBF_0",
1737     "Delta Phi jj for WBF quarks;#Delta Phi_{jj};#",90,0.0,180.);
1738     AddTH1(hDGenWBF[1], "hDGenWBF_1",
1739     "Delta Eta jj for WBF quarks;#Delta #eta_{jj};#",100,0.0,10.);
1740     AddTH1(hDGenWBF[2], "hDGenWBF_2",
1741     "Pt max for WBF quarks;p_{t} [GeV];#",200,0.0,400.);
1742     AddTH1(hDGenWBF[3], "hDGenWBF_3",
1743     "Pt min for WBF quarks;p_{t} [GeV];#",200,0.0,400.);
1744     AddTH1(hDGenWBF[4], "hDGenWBF_4",
1745     "dijet mass for WBF quarks;m_{jj};#",200,0.0,4000.);
1746 loizides 1.1
1747 loizides 1.6 // bosons
1748 loizides 1.46 AddTH1(hDGenBosons[0], "hDGenBosons_0", "Number of bosons;N_{bosons};#",10,-0.5,9.5);
1749     AddTH1(hDGenBosons[1], "hDGenBosons_1", "Pt of bosons;p_{t} [GeV];#",200,0.0,400.0);
1750 ceballos 1.62 AddTH1(hDGenBosons[2], "hDGenBosons_2", "Eta of bosons;#eta;#",100,-10.0,10.0);
1751 ceballos 1.49 AddTH1(hDGenBosons[3], "hDGenBosons_3", "Mass of bosons;Mass;#",2000,0.0,2000.0);
1752 loizides 1.46 AddTH1(hDGenBosons[4], "hDGenBosons_4", "Mass of bosons;m_{V};#",200,0.0,200.0);
1753     AddTH1(hDGenBosons[5], "hDGenBosons_5", "Mass of W bosons;m_{W};#",200,0.0,200.0);
1754     AddTH1(hDGenBosons[6], "hDGenBosons_6", "Mass of Z bosons;m_{Z};#",200,0.0,200.0);
1755 ceballos 1.62 AddTH1(hDGenBosons[7], "hDGenBosons_7", "Rapidity of bosons;rapidity;#",100,-10.0,10.0);
1756     AddTH1(hDGenBosons[8], "hDGenBosons_8", "Pt of bosons;p_{t} [GeV];#",200,0.0,400.0);
1757     AddTH1(hDGenBosons[9], "hDGenBosons_9", "Eta of bosons;#eta;#",100,-10.0,10.0);
1758     AddTH1(hDGenBosons[10],"hDGenBosons_10","Rapidity of bosons;rapidity;#",100,-10.0,10.0);
1759     AddTH1(hDGenBosons[11],"hDGenBosons_11","Number of W bosons + 4 * Z bosons;Number;#",13,-0.5,12.5);
1760 ceballos 1.10
1761     // photons
1762 loizides 1.46 AddTH1(hDGenPhotons[0], "hDGenPhotons_0", "Number of photons;N_{photons};#",10,-0.5,9.5);
1763     AddTH1(hDGenPhotons[1], "hDGenPhotons_1", "Pt of photons;p_{t} [GeV];#",200,0.0,400.0);
1764     AddTH1(hDGenPhotons[2], "hDGenPhotons_2", "Eta of photons;#eta;#",100,-5.0,5.0);
1765 ceballos 1.16
1766 loizides 1.40 // rad photons
1767 loizides 1.46 AddTH1(hDGenRadPhotons[0], "hDGenRadPhotons_0",
1768     "Number of radiative photons;N_{photons};#",10,-0.5,9.5);
1769     AddTH1(hDGenRadPhotons[1], "hDGenRadPhotons_1",
1770     "Pt of radiative photons;p_{t} [GeV];#",400,0.0,200.0);
1771     AddTH1(hDGenRadPhotons[2], "hDGenRadPhotons_2",
1772     "Eta of radiative photons;#eta;#",100,0.0,5.0);
1773     AddTH1(hDGenRadPhotons[3], "hDGenRadPhotons_3",
1774 ceballos 1.49 "Status of mother of radiative photons;Status;#",20,-0.5,19.5);
1775 loizides 1.46 AddTH1(hDGenRadPhotons[4], "hDGenRadPhotons_4",
1776     "IsGenerated+2*IsSimulated of radiative photons;IsGenerated+2*IsSimulated;#",
1777     4,-0.5,3.5);
1778     AddTH1(hDGenRadPhotons[5], "hDGenRadPhotons_5",
1779     "Delta R between photon and mother of radiative photons;#Delta R;#",500,0.0,5.0);
1780     AddTH1(hDGenRadPhotons[6], "hDGenRadPhotons_6",
1781 ceballos 1.51 "Mass photon-photon mother;Mass;#",500,0.0,100.0);
1782     AddTH1(hDGenRadPhotons[7], "hDGenRadPhotons_7",
1783 loizides 1.46 "Number of radiative photon with muon as a mother;Status;#",2,-0.5,1.5);
1784 ceballos 1.32
1785     // ISR photons
1786 loizides 1.46 AddTH1(hDGenISRPhotons[0], "hDGenISRPhotons_0",
1787     "Number of ISR photons;N_{photons};#",10,-0.5,9.5);
1788     AddTH1(hDGenISRPhotons[1], "hDGenISRPhotons_1",
1789     "Pt of ISR photons;p_{t} [GeV];#",400,0.0,200.0);
1790     AddTH1(hDGenISRPhotons[2], "hDGenISRPhotons_2",
1791     "Eta of ISR photons;#eta;#",100,0.0,5.0);
1792     AddTH1(hDGenISRPhotons[3], "hDGenISRPhotons_3",
1793     "Status of mother of radiative photons;#eta;#",20,-0.5,19.5);
1794     AddTH1(hDGenISRPhotons[4], "hDGenISRPhotons_4",
1795     "IsGenerated+2*IsSimulated of radiative photons;IsGenerated+2*IsSimulated;#",
1796     4,-0.5,3.5);
1797     AddTH1(hDGenISRPhotons[5], "hDGenISRPhotons_5",
1798     "Delta R between photon and mother of ISR photons;#Delta R;#",500,0.0,5.0);
1799 ceballos 1.51 AddTH1(hDGenISRPhotons[6], "hDGenISRPhotons_6",
1800     "Mass photon-photon mother;Mass;#",500,0.0,100.0);
1801 ceballos 1.32
1802 ceballos 1.42 // auxiliar for MG studies
1803 loizides 1.46 AddTH1(hDVMass[0], "hDVMass_0", "Mass of munu candidates ;Mass [GeV];#",200,0.,200.);
1804     AddTH1(hDVMass[1], "hDVMass_1", "Mass of elnu candidates ;Mass [GeV];#",200,0.,200.);
1805     AddTH1(hDVMass[2], "hDVMass_2", "Mass of taunu candidates ;Mass [GeV];#",200,0.,200.);
1806     AddTH1(hDVMass[3], "hDVMass_3", "Mass of mumu candidates ;Mass [GeV];#",200,0.,200.);
1807     AddTH1(hDVMass[4], "hDVMass_4", "Mass of ee candidates ;Mass [GeV];#",200,0.,200.);
1808     AddTH1(hDVMass[5], "hDVMass_5", "Mass of tautau candidates;Mass [GeV];#",200,0.,200.);
1809     AddTH1(hDVMass[6], "hDVMass_6", "Mass of numunumu candidates;Mass [GeV];#",200,0.,200.);
1810     AddTH1(hDVMass[7], "hDVMass_7", "Mass of nuenue candidates;Mass [GeV];#",200,0.,200.);
1811     AddTH1(hDVMass[8], "hDVMass_8", "Mass of nutaunutau candidates;Mass [GeV];#",200,0.,200.);
1812     AddTH1(hDVMass[9], "hDVMass_9",
1813     "Mass of munu candidates for t events ;Mass [GeV];#",200,0.,200.);
1814     AddTH1(hDVMass[10],"hDVMass_10",
1815     "Mass of elnu candidates for t events ;Mass [GeV];#",200,0.,200.);
1816     AddTH1(hDVMass[11],"hDVMass_11",
1817     "Mass of taunu candidates for t events;Mass [GeV];#",200,0.,200.);
1818     AddTH1(hDVMass[12],"hDVMass_12",
1819     "Mass of qq candidates for t events;Mass [GeV];#",200,0.,200.);
1820 ceballos 1.44
1821     // Special study about VVjets
1822 loizides 1.46 AddTH1(hDVVMass[0], "hDVVMass_0", "Mass of munu for WW events;Mass [GeV];#",200,0.,200.);
1823     AddTH1(hDVVMass[1], "hDVVMass_1", "Mass of munu WZ events;Mass [GeV];#",200,0.,200.);
1824     AddTH1(hDVVMass[2], "hDVVMass_2", "Mass of elnu WW events;Mass [GeV];#",200,0.,200.);
1825     AddTH1(hDVVMass[3], "hDVVMass_3", "Mass of elnu WZ events;Mass [GeV];#",200,0.,200.);
1826     AddTH1(hDVVMass[4], "hDVVMass_4", "Mass of taunu WW events;Mass [GeV];#",200,0.,200.);
1827     AddTH1(hDVVMass[5], "hDVVMass_5", "Mass of taunu WZ events;Mass [GeV];#",200,0.,200.);
1828     AddTH1(hDVVMass[6], "hDVVMass_6", "Mass of mumu WZ events;Mass [GeV];#",200,0.,200.);
1829     AddTH1(hDVVMass[7], "hDVVMass_7", "Mass of mumu ZZ events;Mass [GeV];#",200,0.,200.);
1830     AddTH1(hDVVMass[8], "hDVVMass_8", "Mass of ee WZ events;Mass [GeV];#",200,0.,200.);
1831     AddTH1(hDVVMass[9], "hDVVMass_9", "Mass of ee ZZ events;Mass [GeV];#",200,0.,200.);
1832     AddTH1(hDVVMass[10],"hDVVMass_10","Mass of tautau WZ events;Mass [GeV];#",200,0.,200.);
1833     AddTH1(hDVVMass[11],"hDVVMass_11","Mass of tautau ZZ events;Mass [GeV];#",200,0.,200.);
1834     AddTH1(hDVVMass[12],"hDVVMass_12","Mass of numunumu WZ events;Mass [GeV];#",200,0.,200.);
1835     AddTH1(hDVVMass[13],"hDVVMass_13","Mass of numunumu ZZ events;Mass [GeV];#",200,0.,200.);
1836     AddTH1(hDVVMass[14],"hDVVMass_14","Mass of nuenue WZ events;Mass [GeV];#",200,0.,200.);
1837     AddTH1(hDVVMass[15],"hDVVMass_15","Mass of nuenue ZZ events;Mass [GeV];#",200,0.,200.);
1838     AddTH1(hDVVMass[16],"hDVVMass_16","Mass of nutaunutau WZ events;Mass [GeV];#",200,0.,200.);
1839     AddTH1(hDVVMass[17],"hDVVMass_17","Mass of nutaunutau ZZ events;Mass [GeV];#",200,0.,200.);
1840 ceballos 1.44 AddTH1(hDVVMass[18],"hDVVMass_18","Ratios for WW events;Type;#",7,-0.5,6.5);
1841     AddTH1(hDVVMass[19],"hDVVMass_19","Ratios for WZ events;Type;#",10,-0.5,9.5);
1842     AddTH1(hDVVMass[20],"hDVVMass_20","Ratios for ZZ2l events;Type;#",7,-0.5,6.5);
1843     AddTH1(hDVVMass[21],"hDVVMass_21","Ratios for ZZ4l events;Type;#",16,-0.5,15.5);
1844 loizides 1.46 AddTH1(hDVVMass[22],"hDVVMass_22","Maximum mass for WW events;Mass [GeV];#",200,0.,200.);
1845     AddTH1(hDVVMass[23],"hDVVMass_23","Minimum mass for WW events;Mass [GeV];#",200,0.,200.);
1846     AddTH1(hDVVMass[24],"hDVVMass_24","Maximum mass for WZ events;Mass [GeV];#",200,0.,200.);
1847     AddTH1(hDVVMass[25],"hDVVMass_25","Minimum mass for WZ events;Mass [GeV];#",200,0.,200.);
1848     AddTH1(hDVVMass[26],"hDVVMass_26","Maximum mass for ZZ events;Mass [GeV];#",200,0.,200.);
1849     AddTH1(hDVVMass[27],"hDVVMass_27","Minimum mass for ZZ events;Mass [GeV];#",200,0.,200.);
1850 loizides 1.1 }
1851     }