32 #include <TCollection.h>
35 #include <TLorentzVector.h>
36 #include <TMultiGraph.h>
104 virtual void Draw(Option_t* option =
"ac");
112 return 2. * std::atan(std::exp(-eta));
123 : mGraphDrawer(nullptr), mMultipleScattering(multipleScattering) {
137 const double eta[75] = {
138 -3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -2.0,
139 -1.9, -1.8, -1.7, -1.6, -1.5, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9,
140 -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3,
141 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.0, 1.1, 1.2, 1.3, 1.4,
142 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.5,
143 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7,
147 const double sigma[75] = {
148 0.010500, 0.009820, 0.009140, 0.008460, 0.007780, 0.007100, 0.006520,
149 0.005940, 0.005360, 0.004780, 0.004200, 0.009811, 0.008759, 0.007479,
150 0.006242, 0.005436, 0.004524, 0.006887, 0.005374, 0.004485, 0.003822,
151 0.003164, 0.002592, 0.002791, 0.002991, 0.003187, 0.003374, 0.003547,
152 0.003700, 0.003827, 0.003921, 0.003980, 0.004000, 0.003980, 0.003921,
153 0.003827, 0.003700, 0.003547, 0.003374, 0.003187, 0.002991, 0.002791,
154 0.002592, 0.001200, 0.001280, 0.001360, 0.001440, 0.001520, 0.001600,
155 0.001840, 0.002080, 0.002320, 0.002560, 0.002800, 0.003160, 0.003520,
156 0.003880, 0.004240, 0.004600, 0.002300, 0.002620, 0.002940, 0.003260,
157 0.003580, 0.003900, 0.004400, 0.004900, 0.005400, 0.005900, 0.006400,
158 0.007220, 0.008040, 0.008860, 0.009680, 0.010500
161 mGraphDrawer->SetTitle(
";#eta;Momentum Resolution, #delta(1/p) (1/GeV)");
164 int points[5] = {11, 6, 26, 16, 16};
165 int colours[5] = {kBlue, kMagenta, kRed, kGreen + 3, kGreen - 2};
167 for (
int i(0); i < 5; ++i) {
168 TGraph* graph =
new TGraph(points[i], eta + position, sigma + position);
169 TString
name(
"graph");
171 graph->SetName(name);
173 graph->SetLineWidth(3);
174 graph->SetLineColor(colours[i]);
175 graph->SetMarkerColor(colours[i]);
177 position += points[i];
199 TGraph* iterGraph(NULL);
200 TIter iter(
Graphs()->GetListOfGraphs());
203 while ((iterGraph = static_cast<TGraph*>(iter()))) {
205 double*
eta = iterGraph->GetX();
206 if (particle.
GetEta() > eta[0] &&
207 particle.
GetEta() < eta[iterGraph->GetN() - 1] ) {
215 double sigmaP = graph->Eval(particle.
GetEta())
216 * std::pow(particle.
GetP(), 2.);
219 sigmaP = std::sqrt(std::pow(sigmaP, 2.) +
222 double sigma = gRandom->Gaus(particle.
GetP(), sigmaP);
237 if (eta > 2. && eta <= 3.) {
238 return 0.03 * particle.
GetP();
239 }
else if (eta > 3. && eta <= 4.) {
242 double logSigmaP = std::log(0.03) +
243 (std::log(0.15) - std::log(0.03)) * (eta - 3);
246 return std::exp(logSigmaP) * particle.
GetP();
289 Smear::Device barrelAndHadronEcal(
"E",
"0.12*sqrt(E) + 0.02*E",
291 barrelAndHadronEcal.
Accept.
AddZone(barrelAndHadronDirection);
294 barrelAndHadronHcal.
Accept.
AddZone(barrelAndHadronDirection);