ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/GeneratorMod.cc
Revision: 1.77
Committed: Wed Aug 14 20:22:23 2013 UTC (11 years, 8 months ago) by mdecross
Content type: text/plain
Branch: MAIN
Changes since 1.76: +38 -5 lines
Log Message:
Generator-level lepton info and tight muon tagging added for monojets 8TeV

File Contents

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