Fork me on GitHub

WorkBook/Tutorials/Pisa: tutorial_solution

File tutorial_solution, 4.6 KB (added by Michele Selvaggi, 6 years ago)
Line 
1I.1)
2
3- number fo events:
4
5Main:numberOfEvents = 1000
6
7- beam type:
8
9Beams:idA = 2212 ! first beam, p = 2212, pbar = -2212
10Beams:idB = 2212 ! second beam, p = 2212, pbar = -2212
11
12- center of mass energy:
13
14Beams:eCM = 14000.
15
16- physics process
17
18Top:gg2ttbar = on ! g g -> t tbar
19Top:qqbar2ttbar = on ! q qbar -> t tbar
20
21
22I.2)
23
24Pythia8 card: examples/Pythia8/config_ee_zh_zmumu.cmd
25
26!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
28Main:numberOfEvents = 10000 ! number of events to generate
29
30Beams:idA = 11 ! first beam, e- = -11
31Beams:idB = -11 ! second beam, e+ = 11
32Beams:eCM = 240. ! CM energy of collision
33
34! Higgsstrahlung process
35HiggsSM:ffbar2HZ = on
36
37! 5) Force the Z decays to muons
3823:onMode = off
3923:onIfAny = 13 -13
40
41!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
42
43I.3)
44
45./DelphesPythia8 cards/delphes_card_CEPC.tcl examples/Pythia8/config_ee_zh_zmumu.cmd delphes_ee_zh_zmumu.root
46
47
48II.2)
49
50Delphes->Draw("Muon_size");
51Delphes->Draw("Jet_size");
52
53III.1)
54
55m_recoil = sqrt( (sqrt(s) - E_ll)^2 - p_ll^2 )
56
57III.2)
58
59# Recoil Mass macro
60#!/usr/bin/env python
61
62import sys
63import ROOT
64
65if len(sys.argv) < 2:
66 print " Usage: python examples/MissingMass.py delphes_ee_zh_zmumu.root hist_mrec.root"
67 sys.exit(1)
68
69ROOT.gSystem.Load("libDelphes")
70
71try:
72 ROOT.gInterpreter.Declare('#include "classes/SortableObject.h"')
73 ROOT.gInterpreter.Declare('#include "classes/DelphesClasses.h"')
74 ROOT.gInterpreter.Declare('#include "external/ExRootAnalysis/ExRootTreeReader.h"')
75except:
76 pass
77
78inputFile = sys.argv[1]
79outputFile = sys.argv[2]
80
81# Create chain of root trees
82chain = ROOT.TChain("Delphes")
83chain.Add(inputFile)
84
85# Create object of class ExRootTreeReader
86treeReader = ROOT.ExRootTreeReader(chain)
87numberOfEntries = treeReader.GetEntries()
88
89# Get pointers to branches used in this analysis
90branchMuon = treeReader.UseBranch("Muon")
91
92# Book histograms
93histMass = ROOT.TH1F("mass", "M_{recoil} [GeV]", 60, 100.0, 160.0)
94
95ptot = ROOT.TLorentzVector(0.,0.,0.,240.)
96# Loop over all events
97for entry in range(0, numberOfEntries):
98 # Load selected branches with data from specified event
99 treeReader.ReadEntry(entry)
100
101 # If event contains at least 2 muons
102 if branchMuon.GetEntries() > 1:
103
104 mu1 = branchMuon.At(0)
105 mu2 = branchMuon.At(1)
106
107 pll = mu1.P4() + mu2.P4()
108 ph = ptot - pll
109
110 histMass.Fill(ph.M())
111
112out_root = ROOT.TFile(outputFile,"RECREATE")
113histMass.Write()
114
115
116IV.1)
117
118The two parameters are the muon momentum resolution and the reconstruction efficiency.
119One can for instance worsen both of them by replacing the existing parameterisations by:
120
121IV.2)
122
123The relevant modules are called "MuonMomentumSmearing" and "MuonTrackingEfficiency"
124
125IV.3)
126
127
128###############################
129# Momentum resolution for muons
130###############################
131
132module MomentumSmearing MuonMomentumSmearing {
133 set InputArray MuonTrackingEfficiency/muons
134 set OutputArray muons
135
136 # set ResolutionFormula {resolution formula as a function of eta and pt}
137
138 # resolution formula for charged hadrons
139 set ResolutionFormula { (abs(eta) <= 1.0) * 10 * sqrt(0.001^2 + pt^2*1.e-5^2) +
140 (abs(eta) > 1.0 && abs(eta) <= 3.0) * 10 * sqrt(0.01^2 + pt^2*1.e-4^2)}
141
142}
143
144##########################
145# Muon tracking efficiency
146##########################
147
148module Efficiency MuonTrackingEfficiency {
149 set InputArray ParticlePropagator/muons
150 set OutputArray muons
151
152 # set EfficiencyFormula {efficiency formula as a function of eta and pt}
153
154 # tracking efficiency formula for muons
155 set EfficiencyFormula { (pt <= 0.1) * (0.00) +
156 (abs(eta) <= 3.0) * (pt > 0.1) * (0.80) +
157 (abs(eta) > 3.0) * (0.00)}
158}
159
160
161IV.4)
162
163./DelphesPythia8 cards/delphes_card_CEPC_mod.tcl examples/Pythia8/config_ee_zh_zmumu.cmd delphes_ee_zh_zmumu_mod.root
164./DelphesPythia8 cards/delphes_card_CEPC_mod2.tcl examples/Pythia8/config_ee_zh_zmumu.cmd delphes_ee_zh_zmumu_mod2.root
165
166
167root -l hist_mrec.root hist_mrec_mod.root hist_mrec_mod2.root
168
169((TH1F *)_file0->Get("mass"))->SetLineColor(kGreen+1);
170((TH1F *)_file1->Get("mass"))->SetLineColor(kBlue);
171((TH1F *)_file2->Get("mass"))->SetLineColor(kRed);
172
173((TH1F *)_file0->Get("mass"))->SetLineWidth(3);
174((TH1F *)_file1->Get("mass"))->SetLineWidth(3);
175((TH1F *)_file2->Get("mass"))->SetLineWidth(3);
176
177_file0->Get("mass")->Draw();
178_file1->Get("mass")->Draw("SAME");
179_file2->Get("mass")->Draw("SAME");