10 #include <analysis/variables/AcceptanceVariables.h>
13 #include <analysis/VariableManager/Manager.h>
15 #include <analysis/dataobjects/Particle.h>
28 bool thetaInCDCAcceptance(
const Particle* particle)
30 double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
31 if (theta > 17. && theta < 150.) {
36 bool thetaInTOPAcceptance(
const Particle* particle)
38 double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
39 if (theta > 32.20 && theta < 123.86) {
44 bool thetaInARICHAcceptance(
const Particle* particle)
46 double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
47 if (theta > 14. && theta < 30.) {
52 int thetaInECLAcceptance(
const Particle* particle)
54 double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
55 if (theta > 12.4 && theta < 31.4) {
57 }
else if (theta > 32.2 && theta < 128.7) {
59 }
else if (theta > 130.7 && theta < 155.1) {
64 bool thetaInBECLAcceptance(
const Particle* particle)
66 double acceptance = thetaInECLAcceptance(particle);
67 if (acceptance == 2) {
72 bool thetaInEECLAcceptance(
const Particle* particle)
74 double acceptance = thetaInECLAcceptance(particle);
75 if (acceptance == 1 || acceptance == 3) {
80 int thetaInKLMAcceptance(
const Particle* particle)
82 double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
83 if (theta < 18.)
return 0;
84 if (theta < 37.)
return 1;
85 if (theta < 47.)
return 2;
86 if (theta < 122.)
return 3;
87 if (theta < 130.)
return 4;
88 if (theta < 155.)
return 5;
92 bool thetaInBKLMAcceptance(
const Particle* particle)
94 double acceptance = thetaInKLMAcceptance(particle);
95 if (acceptance == 2 || acceptance == 3 || acceptance == 4) {
100 bool thetaInEKLMAcceptance(
const Particle* particle)
102 double acceptance = thetaInKLMAcceptance(particle);
103 if (acceptance != 0 && acceptance != 3) {
108 bool thetaInKLMOverlapAcceptance(
const Particle* particle)
110 double acceptance = thetaInKLMAcceptance(particle);
111 if (acceptance == 2 || acceptance == 4) {
118 bool ptInTOPAcceptance(
const Particle* particle)
120 if (particle->getCharge() == 0)
return 1;
121 double pt = particle->get4Vector().Pt();
122 if (pt > 0.27)
return true;
126 bool ptInBECLAcceptance(
const Particle* particle)
128 if (particle->getCharge() == 0)
return 1;
129 double pt = particle->get4Vector().Pt();
130 if (pt > 0.28)
return true;
134 bool ptInBKLMAcceptance(
const Particle* particle)
136 if (particle->getCharge() == 0)
return 1;
137 double pt = particle->get4Vector().Pt();
138 if (pt > 0.6)
return true;
144 bool inCDCAcceptance(
const Particle* particle)
146 return thetaInCDCAcceptance(particle);
149 bool inTOPAcceptance(
const Particle* particle)
151 return (thetaInTOPAcceptance(particle) && ptInTOPAcceptance(particle));
154 bool inARICHAcceptance(
const Particle* particle)
156 return thetaInARICHAcceptance(particle);
159 bool inECLAcceptance(
const Particle* particle)
161 return (thetaInEECLAcceptance(particle) || (thetaInBECLAcceptance(particle) && ptInBECLAcceptance(particle)));
164 bool inKLMAcceptance(
const Particle* particle)
166 return (thetaInEKLMAcceptance(particle) || (thetaInBKLMAcceptance(particle) && ptInBKLMAcceptance(particle)));
171 VARIABLE_GROUP(
"Acceptance");
173 REGISTER_VARIABLE(
"thetaInCDCAcceptance", thetaInCDCAcceptance, R
"DOC(
174 Returns true if particle is within CDC angular acceptance, false otherwise.
175 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`17^\circ < \theta < 150^\circ`.
176 The polar angle is computed using only the initial particle momentum.
178 REGISTER_VARIABLE("thetaInTOPAcceptance", thetaInTOPAcceptance, R
"DOC(
179 Returns true if particle is within TOP angular acceptance, false otherwise.
180 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`31^\circ < \theta < 128^\circ`.
181 The polar angle is computed using only the initial particle momentum.
183 REGISTER_VARIABLE("thetaInARICHAcceptance", thetaInARICHAcceptance, R
"DOC(
184 Returns true if particle is within ARICH angular acceptance, false otherwise.
185 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`14^\circ < \theta < 30^\circ`.
186 The polar angle is computed using only the initial particle momentum.
188 REGISTER_VARIABLE("thetaInECLAcceptance", thetaInECLAcceptance, R
"DOC(
189 Checks if particle is within ECL angular acceptance.
190 This variable checks if the particle polar angle :math:`\theta` is within certain ranges.
191 Return values and the corresponding :math:`\theta` ranges are the following:
193 * 0: Outside of ECL acceptance, :math:`\theta < 12.4^\circ` or :math:`\theta > 155.1^\circ`,
194 or in one of the acceptance gaps at :math:`31.4^{\circ} < \theta < 32.2^{\circ}`
195 or :math:`128.7^{\circ} < \theta < 130.7^{\circ}`;
196 * 1: Forward ECL, :math:`12.4^\circ < \theta < 31.4^\circ`;
197 * 2: Barrel ECL, :math:`32.2^\circ < \theta < 128.7^\circ`;
198 * 3: Backward ECL, :math:`130.7^\circ < \theta < 155.1^\circ`.
200 The polar angle is computed using only the initial particle momentum.
202 REGISTER_VARIABLE("thetaInBECLAcceptance", thetaInBECLAcceptance, R
"DOC(
203 Returns true if particle is within Barrel ECL angular acceptance, false otherwise.
204 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`32.2^\circ < \theta < 128.7^\circ`.
205 The polar angle is computed using only the initial particle momentum.
207 REGISTER_VARIABLE("thetaInEECLAcceptance", thetaInEECLAcceptance, R
"DOC(
208 Returns true if particle is within Endcap ECL angular acceptance, false otherwise.
209 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`12.4^\circ < \theta < 31.4^\circ`
210 or :math:`130.7^\circ < \theta < 155.1^\circ`.
211 The polar angle is computed using only the initial particle momentum.
213 REGISTER_VARIABLE("thetaInKLMAcceptance", thetaInKLMAcceptance, R
"DOC(
214 Checks if particle is within KLM angular acceptance.
215 This variable checks if the particle polar angle :math:`\theta` is within certain ranges.
216 Return values and the corresponding :math:`\theta` ranges are the following:
218 * 0: Outside of KLM acceptance, :math:`\theta < 18^\circ` or :math:`\theta < 155^\circ`.
219 * 1: Forward endcap, :math:`18^\circ < \theta < 37^\circ`;
220 * 2: Forward overlap, :math:`37^\circ < \theta < 47^\circ`;
221 * 3: Barrel, :math:`47^\circ < \theta < 122^\circ`;
222 * 4: Backward overlap, :math:`122^\circ < \theta < 130^\circ`;
223 * 5: Backward endcap, :math:`130^\circ < \theta < 155^\circ`.
225 The polar angle is computed using only the initial particle momentum.
228 REGISTER_VARIABLE("thetaInBKLMAcceptance", thetaInBKLMAcceptance, R
"DOC(
229 Returns true if particle is within Barrel KLM angular acceptance, false otherwise.
230 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`37^\circ < \theta < 130^\circ`.
231 The polar angle is computed using only the initial particle momentum.
233 REGISTER_VARIABLE("thetaInEKLMAcceptance", thetaInEKLMAcceptance, R
"DOC(
234 Returns true if particle is within Endcap KLM angular acceptance, false otherwise.
235 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`18^\circ < \theta < 47^\circ` or :math:`122^\circ < \theta < 155^\circ`.
236 The polar angle is computed using only the initial particle momentum.
238 REGISTER_VARIABLE("thetaInKLMOverlapAcceptance", thetaInKLMOverlapAcceptance, R
"DOC(
239 Returns true if particle is within the angular region where KLM barrel and endcaps overlap, false otherwise.
240 This variable checks if the particle polar angle :math:`\theta` is within the range :math:`37^\circ < \theta < 47^\circ` or :math:`122^\circ < \theta < 130^\circ`.
241 The polar angle is computed using only the initial particle momentum.
244 REGISTER_VARIABLE("ptInTOPAcceptance", ptInTOPAcceptance,
"Returns true if particle transverse momentum :math:`p_t` is within TOP acceptance, :math:`p_t > 0.27` GeV, false otherwise.");
245 REGISTER_VARIABLE(
"ptInBECLAcceptance", ptInBECLAcceptance,
"Returns true if particle transverse momentum :math:`p_t` is within Barrel ECL acceptance, :math:`p_t > 0.28` GeV, false otherwise.");
246 REGISTER_VARIABLE(
"ptInBKLMAcceptance", ptInBKLMAcceptance,
"Returns true if particle transverse momentum :math:`p_t` is within Barrel KLM acceptance, :math:`p_t > 0.6` GeV, false otherwise.");
248 REGISTER_VARIABLE(
"inCDCAcceptance", inCDCAcceptance, R
"DOC(
249 Returns true if particle is within CDC geometrical and kinematical acceptance, false otherwise.
250 This variable is an alias for :b2:var:`thetaInCDCAcceptance`.
252 REGISTER_VARIABLE("inTOPAcceptance", inTOPAcceptance, R
"DOC(
253 Returns true if particle is within TOP geometrical and kinematical acceptance, false otherwise.
254 This variable is a combination of :b2:var:`thetaInTOPAcceptance` and :b2:var:`ptInTOPAcceptance`.
256 REGISTER_VARIABLE("inARICHAcceptance", inARICHAcceptance, R
"DOC(
257 Returns true if particle is within ARICH geometrical and kinematical acceptance, false otherwise.
258 This variable is an alias for :b2:var:`thetaInARICHAcceptance`.
260 REGISTER_VARIABLE("inECLAcceptance", inECLAcceptance, R
"DOC(
261 Returns true if particle is within ECL geometrical and kinematical acceptance, false otherwise.");
262 This variable is a combination of :b2:var:`thetaInEECLAcceptance`, :b2:var:`thetaInBECLAcceptance` and :b2:var:`ptInBECLAcceptance`.
264 REGISTER_VARIABLE("inKLMAcceptance", inKLMAcceptance, R
"DOC(
265 Returns true if particle is within KLM geometrical and kinematical acceptance, false otherwise.
266 This variable is a combination of :b2:var:`thetaInEKLMAcceptance`, :b2:var:`thetaInBKLMAcceptance` and :b2:var:`ptInBKLMAcceptance`.
Abstract base class for different kinds of events.