32 #include <TCollection.h>
35 #include <TLorentzVector.h>
36 #include <TMultiGraph.h>
103 virtual void Draw(Option_t* option =
"ac");
106 TMultiGraph* mGraphDrawer;
107 Bool_t mMultipleScattering;
112 : mGraphDrawer(NULL), mMultipleScattering(multipleScattering) {
126 const double eta[75] = {
127 -3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -2.0,
128 -1.9, -1.8, -1.7, -1.6, -1.5, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9,
129 -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3,
130 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.0, 1.1, 1.2, 1.3, 1.4,
131 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.5,
132 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7,
136 const double sigma[75] = {
137 0.010500, 0.009820, 0.009140, 0.008460, 0.007780, 0.007100, 0.006520,
138 0.005940, 0.005360, 0.004780, 0.004200, 0.009811, 0.008759, 0.007479,
139 0.006242, 0.005436, 0.004524, 0.006887, 0.005374, 0.004485, 0.003822,
140 0.003164, 0.002592, 0.002791, 0.002991, 0.003187, 0.003374, 0.003547,
141 0.003700, 0.003827, 0.003921, 0.003980, 0.004000, 0.003980, 0.003921,
142 0.003827, 0.003700, 0.003547, 0.003374, 0.003187, 0.002991, 0.002791,
143 0.002592, 0.001200, 0.001280, 0.001360, 0.001440, 0.001520, 0.001600,
144 0.001840, 0.002080, 0.002320, 0.002560, 0.002800, 0.003160, 0.003520,
145 0.003880, 0.004240, 0.004600, 0.002300, 0.002620, 0.002940, 0.003260,
146 0.003580, 0.003900, 0.004400, 0.004900, 0.005400, 0.005900, 0.006400,
147 0.007220, 0.008040, 0.008860, 0.009680, 0.010500
149 mGraphDrawer =
new TMultiGraph;
150 mGraphDrawer->SetTitle(
";#eta;Momentum Resolution, #delta(1/p) (1/GeV)");
153 int points[5] = {11, 6, 26, 16, 16};
154 int colours[5] = {kBlue, kMagenta, kRed, kGreen + 3, kGreen - 2};
156 for (
int i(0); i < 5; ++i) {
157 TGraph* graph =
new TGraph(points[i], eta + position, sigma + position);
158 TString name(
"graph");
160 graph->SetName(name);
162 graph->SetLineWidth(3);
163 graph->SetLineColor(colours[i]);
164 graph->SetMarkerColor(colours[i]);
165 mGraphDrawer->Add(graph);
166 position += points[i];
181 clone->mGraphDrawer = NULL;
188 TGraph* iterGraph(NULL);
189 TIter iter(
Graphs()->GetListOfGraphs());
192 while ((iterGraph =
static_cast<TGraph*
>(iter()))) {
194 double* eta = iterGraph->GetX();
195 if (particle.
GetEta() > eta[0] &&
196 particle.
GetEta() < eta[iterGraph->GetN() - 1] ) {
204 double sigmaP = graph->Eval(particle.
GetEta())
205 * std::pow(particle.
GetP(), 2.);
207 if (mMultipleScattering) {
208 sigmaP = std::sqrt(std::pow(sigmaP, 2.) +
211 double sigma = gRandom->Gaus(particle.
GetP(), sigmaP);
212 smeared.
SetP(std::max(sigma, 0.));
225 const double eta = particle.
GetEta();
226 if (eta > 2. && eta <= 3.) {
227 return 0.03 * particle.
GetP();
228 }
else if (eta > 3. && eta <= 4.) {
231 double logSigmaP = std::log(0.03) +
232 (std::log(0.15) - std::log(0.03)) * (eta - 3);
235 return std::exp(logSigmaP) * particle.
GetP();
253 return 2. * std::atan(std::exp(-eta));
287 Smear::Device barrelAndHadronEcal(
"E",
"0.12*sqrt(E) + 0.02*E",
289 barrelAndHadronEcal.
Accept.
AddZone(barrelAndHadronDirection);
292 barrelAndHadronHcal.
Accept.
AddZone(barrelAndHadronDirection);