eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
smearBeAST.cxx
Go to the documentation of this file.
2 
3  gSystem->Load("libeicsmear");
4 
5  // Calorimeter resolution usually given as sigma_E/E = const% + stocastic%/Sqrt{E}
6  // EIC Smear needs absolute sigma: sigma_E = Sqrt{const*const*E*E + stoc*stoc*E}
7 
8  // Create the EM Calorimeter
9  Smear::Device emcalBck(Smear::kE, "sqrt(0.01*0.01*E*E + 0.015*0.015*E)");
10  Smear::Device emcalMidBck(Smear::kE, "sqrt(0.01*0.01*E*E + 0.07*0.07*E)");
11  Smear::Device emcalMid(Smear::kE, "sqrt(0.01*0.01*E*E + 0.10*0.10*E)");
12  Smear::Device emcalFwd(Smear::kE, "sqrt(0.01*0.01*E*E + 0.07*0.07*E)");
13 
14 
15  // Create the Forward/Backward Hadron Calorimeter
16  Smear::Device hcalFwd(Smear::kE, "sqrt(0.015*0.015*E*E + 0.50*0.50*E)");
17  Smear::Device hcalBck(Smear::kE, "sqrt(0.015*0.015*E*E + 0.50*0.50*E)");
18 
19  // Create the Hypothetical Mid Rap Calorimeter
20  //Smear::Device hcalMid(Smear::kE, "sqrt(0.07*0.07*E*E + 0.85*0.85*E)"); // ~CMS
21  Smear::Device hcalMid(Smear::kE, "sqrt(0.02*0.02*E*E + 0.35*0.35*E)"); // ~Zeus
22 
23  // Create Forward/Backward Hadron Calorimeter to Measure Charged Hadrons after the Tracker
24  Smear::Device hcalTrkFwd(Smear::kE, "sqrt(0.015*0.015*E*E + 0.50*0.50*E)");
25  Smear::Device hcalTrkBck(Smear::kE, "sqrt(0.015*0.015*E*E + 0.50*0.50*E)");
26 
27 
28  // Create our tracking capabilities, by a combination of mometum, theta and phi Devices.
29  // The momentum parametrization (a*p + b) gives sigma_P/P in percent.
30  // So Multiply through by P and divide by 100 to get absolute sigma_P
31  // Theta and Phi parametrizations give absolute sigma in miliradians
32 
33  // Track Momentum
34  //Smear::Device momentum(Smear::kP, "(P*P*(0.0182031 + 0.00921047*pow((-log(tan(theta/2.0))), 2) - 0.00291243*pow((-log(tan(theta/2.0))), 4) + 0.000264353*pow((-log(tan(theta/2.0))), 6)) + (0.209681 + 0.275144*pow((-log(tan(theta/2.0))), 2) - 0.0436536*pow((-log(tan(theta/2.0))), 4) + 0.00367412*pow((-log(tan(theta/2.0))), 6)))*0.01");
35  Smear::Device momentum(Smear::kP, "(P*P*(0.0182031 + 0.00921047*pow((-log(tan(theta/2.0))), 2) - 0.00291243*pow((-log(tan(theta/2.0))), 4) + 0.000264353*pow((-log(tan(theta/2.0))), 6)) + P*(0.209681 + 0.275144*pow((-log(tan(theta/2.0))), 2) - 0.0436536*pow((-log(tan(theta/2.0))), 4) + 0.00367412*pow((-log(tan(theta/2.0))), 6)))*0.01");
36  Smear::Device trackTheta(Smear::kTheta, "((1.0/(1.0*P))*(0.752935 + 0.280370*pow((-log(tan(theta/2.0))), 2) - 0.0359713*pow((-log(tan(theta/2.0))), 4) + 0.00200623*pow((-log(tan(theta/2.0))), 6)) + 0.0282315 - 0.00998623*pow((-log(tan(theta/2.0))), 2) + 0.00117487*pow((-log(tan(theta/2.0))), 4) - 0.0000443918*pow((-log(tan(theta/2.0))), 6))*0.001");
37  Smear::Device trackPhi(Smear::kPhi, "((1.0/(1.0*P))*(0.743977 + 0.753393*pow((-log(tan(theta/2.0))), 2) + 0.0634184*pow((-log(tan(theta/2.0))), 4) + 0.0128001*pow((-log(tan(theta/2.0))), 6)) + 0.0308753 + 0.0480770*pow((-log(tan(theta/2.0))), 2) - 0.0129859*pow((-log(tan(theta/2.0))), 4) + 0.00109374*pow((-log(tan(theta/2.0))), 6))*0.001");
38 
39 
40  // Need these to keep the component not smeared
41 
42  // Momentum for EM
43  Smear::Device momentumEM(Smear::kP, "0");
44  Smear::Device trackThetaEM(Smear::kTheta, "0");
45  Smear::Device trackPhiEM(Smear::kPhi, "0");
46 
47  // Momentum for Neutral Hadrons
48  Smear::Device momentumHad(Smear::kP, "0");
49  Smear::Device trackThetaHad(Smear::kTheta, "0");
50  Smear::Device trackPhiHad(Smear::kPhi, "0");
51 
52  // Momentum for Charged Hadrons After the Tracker
53  Smear::Device momentumHadTrkBck(Smear::kP, "0");
54  Smear::Device trackThetaHadTrkBck(Smear::kTheta, "0");
55  Smear::Device trackPhiHadTrkBck(Smear::kPhi, "0");
56 
57  Smear::Device momentumHadTrkFwd(Smear::kP, "0");
58  Smear::Device trackThetaHadTrkFwd(Smear::kTheta, "0");
59  Smear::Device trackPhiHadTrkFwd(Smear::kPhi, "0");
60 
61  // Energy for Tracks
62  Smear::Device trackEnergy(Smear::kE, "0");
63 
64  // Create a smearer for momentum
65  //Smear::Device momentum(Smear::kP, "0.01 * P");
66  //Smear::Device theta(Smear::kTheta, "0.05 * P");
67  //Smear::Device phi(Smear::kPhi, "0"); // "0" indicates perf585ect performance i.e. sigma(phi) = 0
68 
69  // Create a based on Hermes RICH.
70  //Smear::ParticleID rich("PIDMatrix.dat");
71 
72 
73  // Set Spatial Extent of Devices (in radians)
74  // eta = -4.5 -> theta = 3.1194
75  // eta = -4.0 -> theta = 3.1050
76  // eta = -3.5 -> theta = 3.0812
77  // eta = -3.0 -> theta = 3.0421
78  // eta = -2.0 -> theta = 2.8726
79  // eta = -1.0 -> theta = 2.4366
80  // eta = +1.0 -> theta = 0.7050
81  // eta = +2.0 -> theta = 0.2690
82  // eta = +3.0 -> theta = 0.0995
83  // eta = +3.5 -> theta = 0.0604
84  // eta = +4.0 -> theta = 0.0366
85  // eta = +4.5 -> theta = 0.0222
86 
87  // The BeAST design has calorimetry extending to +-4, here extend to +-4.5 to match the extent of my particle level jets
88  // Can place a cut on jet thrust axis in the analysis if need be
89 
90  // Set Up EMCal Zones
91  Smear::Acceptance::Zone emBck(2.8726,3.1194,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
92  Smear::Acceptance::Zone emMidBck(2.4366,2.8726,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
93  Smear::Acceptance::Zone emMid(0.7050,2.4366,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
94  Smear::Acceptance::Zone emFwd(0.0222,0.7050,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
95  Smear::Acceptance::Zone emTot(0.0222,3.1194,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
96 
97  // Set Up HCal Zone
98  Smear::Acceptance::Zone hBck(2.4366,3.1194,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
99  Smear::Acceptance::Zone hFwd(0.0222,0.7050,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
100  Smear::Acceptance::Zone hMid(0.7050,2.4366,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
101  Smear::Acceptance::Zone hTot(0.0222,3.1194,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
102  // Do HCal Over Full Acceptance (-4,4) and just kill neutrals at midrapidity in the jet finder for standard BeAST
103 
104  // Set Up HCal After Tracker Zone
105  Smear::Acceptance::Zone hTrkBck(3.0812,3.1194,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
106  Smear::Acceptance::Zone hTrkFwd(0.0222,0.0604,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
107 
108  // Set Up Tracking Zone
109  Smear::Acceptance::Zone trk(0.0604,3.0812,0.,TMath::TwoPi(),0.,TMath::Infinity(),0.,TMath::Infinity(),0.,TMath::Infinity(),-TMath::Infinity(),TMath::Infinity());
110 
111 
112  // Assign acceptance to calorimeters
117 
118  emcalBck.Accept.AddZone(emBck);
119  emcalMidBck.Accept.AddZone(emMidBck);
120  emcalMid.Accept.AddZone(emMid);
121  emcalFwd.Accept.AddZone(emFwd);
122 
123  hcalBck.Accept.AddParticle(2112);
124  hcalBck.Accept.AddParticle(-2112);
125  hcalBck.Accept.AddParticle(130);
126  hcalFwd.Accept.AddParticle(2112);
127  hcalFwd.Accept.AddParticle(-2112);
128  hcalFwd.Accept.AddParticle(130);
129  hcalMid.Accept.AddParticle(2112);
130  hcalMid.Accept.AddParticle(-2112);
131  hcalMid.Accept.AddParticle(130);
132 
133  hcalBck.Accept.AddZone(hBck);
134  hcalFwd.Accept.AddZone(hFwd);
135  hcalMid.Accept.AddZone(hMid);
136 
137  // Assign acceptance to calorimeters for charged hadrons past tracker
138  hcalTrkBck.Accept.SetGenre(Smear::kHadronic);
139  hcalTrkFwd.Accept.SetGenre(Smear::kHadronic);
140 
141  hcalTrkBck.Accept.SetCharge(Smear::kCharged);
142  hcalTrkFwd.Accept.SetCharge(Smear::kCharged);
143 
144  hcalTrkBck.Accept.AddZone(hTrkBck);
145  hcalTrkFwd.Accept.AddZone(hTrkFwd);
146 
147  // Assign acceptance to tracker
148  momentum.Accept.SetGenre(Smear::kHadronic);
149  trackTheta.Accept.SetGenre(Smear::kHadronic);
150  trackPhi.Accept.SetGenre(Smear::kHadronic);
151 
152  momentum.Accept.SetCharge(Smear::kCharged);
153  trackTheta.Accept.SetCharge(Smear::kCharged);
154  trackPhi.Accept.SetCharge(Smear::kCharged);
155 
156  momentum.Accept.AddZone(trk);
157  trackTheta.Accept.AddZone(trk);
158  trackPhi.Accept.AddZone(trk);
159 
160  // Assign acceptance for calorimeter momentum
164 
165  momentumEM.Accept.AddZone(emTot);
166  trackThetaEM.Accept.AddZone(emTot);
167  trackPhiEM.Accept.AddZone(emTot);
168 
169  momentumHad.Accept.AddParticle(2112);
170  trackThetaHad.Accept.AddParticle(2112);
171  trackPhiHad.Accept.AddParticle(2112);
172 
173  momentumHad.Accept.AddParticle(-2112);
174  trackThetaHad.Accept.AddParticle(-2112);
175  trackPhiHad.Accept.AddParticle(-2112);
176 
177  momentumHad.Accept.AddParticle(130);
178  trackThetaHad.Accept.AddParticle(130);
179  trackPhiHad.Accept.AddParticle(130);
180 
181  momentumHad.Accept.AddZone(hTot);
182  trackThetaHad.Accept.AddZone(hTot);
183  trackPhiHad.Accept.AddZone(hTot);
184 
185  // Assign acceptance for calorimeter momentum for charged hadrons past tracker
186  momentumHadTrkBck.Accept.SetGenre(Smear::kHadronic);
187  trackThetaHadTrkBck.Accept.SetGenre(Smear::kHadronic);
188  trackPhiHadTrkBck.Accept.SetGenre(Smear::kHadronic);
189 
190  momentumHadTrkBck.Accept.SetCharge(Smear::kCharged);
191  trackThetaHadTrkBck.Accept.SetCharge(Smear::kCharged);
192  trackPhiHadTrkBck.Accept.SetCharge(Smear::kCharged);
193 
194  momentumHadTrkFwd.Accept.SetGenre(Smear::kHadronic);
195  trackThetaHadTrkFwd.Accept.SetGenre(Smear::kHadronic);
196  trackPhiHadTrkFwd.Accept.SetGenre(Smear::kHadronic);
197 
198  momentumHadTrkFwd.Accept.SetCharge(Smear::kCharged);
199  trackThetaHadTrkFwd.Accept.SetCharge(Smear::kCharged);
200  trackPhiHadTrkFwd.Accept.SetCharge(Smear::kCharged);
201 
202  momentumHadTrkBck.Accept.AddZone(hTrkBck);
203  trackThetaHadTrkBck.Accept.AddZone(hTrkBck);
204  trackPhiHadTrkBck.Accept.AddZone(hTrkBck);
205 
206  momentumHadTrkFwd.Accept.AddZone(hTrkFwd);
207  trackThetaHadTrkFwd.Accept.AddZone(hTrkFwd);
208  trackPhiHadTrkFwd.Accept.AddZone(hTrkFwd);
209 
210  // Assign acceptance for track energy
211  trackEnergy.Accept.SetGenre(Smear::kHadronic);
212 
213  trackEnergy.Accept.SetCharge(Smear::kCharged);
214 
215  trackEnergy.Accept.AddZone(trk);
216 
217 
218  //emcal.Accept.AddZone(central);
219  //momentum.Accept.AddZone(central);
220  //theta.Accept.AddZone(central);
221  //phi.Accept.AddZone(central);
223 
224  // Create a detector and add the devices
225  Smear::Detector det;
226  det.AddDevice(emcalBck);
227  det.AddDevice(emcalMidBck);
228  det.AddDevice(emcalMid);
229  det.AddDevice(emcalFwd);
230  det.AddDevice(hcalBck);
231  det.AddDevice(hcalFwd);
232  det.AddDevice(hcalMid);
233  det.AddDevice(hcalTrkBck);
234  det.AddDevice(hcalTrkFwd);
235  det.AddDevice(momentum);
236  det.AddDevice(trackTheta);
237  det.AddDevice(trackPhi);
238  det.AddDevice(momentumEM);
239  det.AddDevice(trackThetaEM);
240  det.AddDevice(trackPhiEM);
241  det.AddDevice(momentumHad);
242  det.AddDevice(trackThetaHad);
243  det.AddDevice(trackPhiHad);
244  det.AddDevice(momentumHadTrkBck);
245  det.AddDevice(trackThetaHadTrkBck);
246  det.AddDevice(trackPhiHadTrkBck);
247  det.AddDevice(momentumHadTrkFwd);
248  det.AddDevice(trackThetaHadTrkFwd);
249  det.AddDevice(trackPhiHadTrkFwd);
250  det.AddDevice(trackEnergy);
251  det.SetEventKinematicsCalculator("NM JB DA"); // The detector will calculate event kinematics from smeared values
252 
253  //det.AddDevice(emcal);
254  //det.AddDevice(momentum);
255  //det.AddDevice(theta);
256  //det.AddDevice(phi);
258 
259 
260 
261 
262  return det;
263 }
Smear::kE
@ kE
Definition: Smear.h:44
Smear::Smearer::Accept
Acceptance Accept
Definition: Smearer.h:50
Smear::kTheta
@ kTheta
Definition: Smear.h:44
Smear::Acceptance::AddParticle
void AddParticle(int particle)
Add a particle type to the list of particles to be smeared.
Definition: Acceptance.cxx:42
Smear::Acceptance::Zone
A single contiguous region of acceptance.
Definition: Acceptance.h:62
Smear::Acceptance::SetGenre
void SetGenre(int genre)
Select the class(es) of particles to accept.
Definition: Acceptance.cxx:30
Smear::Acceptance::SetCharge
void SetCharge(ECharge charge)
Select the charges of particles to accept.
Definition: Acceptance.cxx:38
Smear::Detector
The detector structure.
Definition: Detector.h:44
Smear::kCharged
@ kCharged
Definition: Smear.h:54
Smear::kPhi
@ kPhi
Definition: Smear.h:44
BuildBeAST
Smear::Detector BuildBeAST()
Definition: smearBeAST.cxx:1
Smear::kP
@ kP
Definition: Smear.h:44
Smear::Device
Performs smearing of a single kinematic variable according to a simple expression defined via a strin...
Definition: Device.h:44
Smear::Detector::SetEventKinematicsCalculator
void SetEventKinematicsCalculator(TString)
Set the method for calculating event kinematics if FillEventKinematics is used.
Definition: Detector.cxx:67
Smear::Detector::AddDevice
void AddDevice(Smearer &device)
Adds a copy of the smearing device to this detector.
Definition: Detector.cxx:63
Smear::Acceptance::AddZone
void AddZone(const Zone &)
Add a new zone with user-specified coverage.
Definition: Acceptance.cxx:26
Smear::kHadronic
@ kHadronic
Definition: Smear.h:49
Smear::kElectromagnetic
@ kElectromagnetic
Definition: Smear.h:49