10 #include <klm/dataobjects/KLMMuidLikelihood.h>
13 #include <analysis/dataobjects/Particle.h>
14 #include <analysis/VariableManager/Manager.h>
15 #include <mdst/dataobjects/Track.h>
25 KLMMuidLikelihood* getMuid(
const Particle* particle)
27 const Track* track = particle->getTrack();
30 return track->getRelatedTo<KLMMuidLikelihood>();
34 double muidMuonProbability(
const Particle* particle)
36 KLMMuidLikelihood* muid = getMuid(particle);
38 return std::numeric_limits<double>::quiet_NaN();
39 return muid->getMuonPDFValue();
43 double muidPionProbability(
const Particle* particle)
45 KLMMuidLikelihood* muid = getMuid(particle);
47 return std::numeric_limits<double>::quiet_NaN();
48 return muid->getPionPDFValue();
52 double muidKaonProbability(
const Particle* particle)
54 KLMMuidLikelihood* muid = getMuid(particle);
56 return std::numeric_limits<double>::quiet_NaN();
57 return muid->getKaonPDFValue();
61 double muidElectronProbability(
const Particle* particle)
63 KLMMuidLikelihood* muid = getMuid(particle);
65 return std::numeric_limits<double>::quiet_NaN();
66 return muid->getElectronPDFValue();
70 double muidProtonProbability(
const Particle* particle)
72 KLMMuidLikelihood* muid = getMuid(particle);
74 return std::numeric_limits<double>::quiet_NaN();
75 return muid->getProtonPDFValue();
79 double muidDeuteronProbability(
const Particle* particle)
81 KLMMuidLikelihood* muid = getMuid(particle);
83 return std::numeric_limits<double>::quiet_NaN();
84 return muid->getDeuteronPDFValue();
88 double muidMuonLogLikelihood(
const Particle* particle)
90 KLMMuidLikelihood* muid = getMuid(particle);
92 return std::numeric_limits<double>::quiet_NaN();
93 return muid->getLogL_mu();
97 double muidPionLogLikelihood(
const Particle* particle)
99 KLMMuidLikelihood* muid = getMuid(particle);
101 return std::numeric_limits<double>::quiet_NaN();
102 return muid->getLogL_pi();
106 double muidKaonLogLikelihood(
const Particle* particle)
108 KLMMuidLikelihood* muid = getMuid(particle);
110 return std::numeric_limits<double>::quiet_NaN();
111 return muid->getLogL_K();
115 double muidElectronLogLikelihood(
const Particle* particle)
117 KLMMuidLikelihood* muid = getMuid(particle);
119 return std::numeric_limits<double>::quiet_NaN();
120 return muid->getLogL_e();
124 double muidProtonLogLikelihood(
const Particle* particle)
126 KLMMuidLikelihood* muid = getMuid(particle);
128 return std::numeric_limits<double>::quiet_NaN();
129 return muid->getLogL_p();
133 double muidDeuteronLogLikelihood(
const Particle* particle)
135 KLMMuidLikelihood* muid = getMuid(particle);
137 return std::numeric_limits<double>::quiet_NaN();
138 return muid->getLogL_d();
142 double muidOutcomeExtTrack(
const Particle* particle)
144 KLMMuidLikelihood* muid = getMuid(particle);
146 return std::numeric_limits<double>::quiet_NaN();
147 return muid->getOutcome();
151 double muidChiSquared(
const Particle* particle)
153 KLMMuidLikelihood* muid = getMuid(particle);
155 return std::numeric_limits<double>::quiet_NaN();
156 return muid->getChiSquared();
160 double muidDegreesOfFreedom(
const Particle* particle)
162 KLMMuidLikelihood* muid = getMuid(particle);
164 return std::numeric_limits<double>::quiet_NaN();
165 return muid->getDegreesOfFreedom();
169 double muidEndcapExtLayer(
const Particle* particle)
171 KLMMuidLikelihood* muid = getMuid(particle);
173 return std::numeric_limits<double>::quiet_NaN();
174 return muid->getEndcapExtLayer();
178 double muidBarrelExtLayer(
const Particle* particle)
180 KLMMuidLikelihood* muid = getMuid(particle);
182 return std::numeric_limits<double>::quiet_NaN();
183 return muid->getBarrelExtLayer();
187 double muidExtLayer(
const Particle* particle)
189 KLMMuidLikelihood* muid = getMuid(particle);
191 return std::numeric_limits<double>::quiet_NaN();
192 return muid->getExtLayer();
196 double muidEndcapHitLayer(
const Particle* particle)
198 KLMMuidLikelihood* muid = getMuid(particle);
200 return std::numeric_limits<double>::quiet_NaN();
201 return muid->getEndcapHitLayer();
205 double muidBarrelHitLayer(
const Particle* particle)
207 KLMMuidLikelihood* muid = getMuid(particle);
209 return std::numeric_limits<double>::quiet_NaN();
210 return muid->getBarrelHitLayer();
214 double muidHitLayer(
const Particle* particle)
216 KLMMuidLikelihood* muid = getMuid(particle);
218 return std::numeric_limits<double>::quiet_NaN();
219 return muid->getHitLayer();
223 double muidExtLayerPattern(
const Particle* particle)
225 KLMMuidLikelihood* muid = getMuid(particle);
227 return std::numeric_limits<double>::quiet_NaN();
228 return muid->getExtLayerPattern();
232 double muidHitLayerPattern(
const Particle* particle)
234 KLMMuidLikelihood* muid = getMuid(particle);
236 return std::numeric_limits<double>::quiet_NaN();
237 return muid->getHitLayerPattern();
241 double muidTotalBarrelHits(
const Particle* particle)
243 KLMMuidLikelihood* muid = getMuid(particle);
245 return std::numeric_limits<double>::quiet_NaN();
246 return muid->getTotalBarrelHits();
250 double muidTotalEndcapHits(
const Particle* particle)
252 KLMMuidLikelihood* muid = getMuid(particle);
254 return std::numeric_limits<double>::quiet_NaN();
255 return muid->getTotalEndcapHits();
259 double muidTotalHits(
const Particle* particle)
261 return muidTotalBarrelHits(particle) + muidTotalEndcapHits(particle);
264 VARIABLE_GROUP(
"KLMMuidLikelihood calibration");
265 REGISTER_VARIABLE(
"muidMuonProbability", muidMuonProbability,
266 "[Calibration] Returns the muon probability stored in the KLMMuidLikelihood dataobject");
267 REGISTER_VARIABLE(
"muidPionProbability", muidPionProbability,
268 "[Calibration] Returns the pion probability stored in the KLMMuidLikelihood dataobject");
269 REGISTER_VARIABLE(
"muidKaonProbability", muidKaonProbability,
270 "[Calibration] Returns the kaon probability stored in the KLMMuidLikelihood dataobject");
271 REGISTER_VARIABLE(
"muidElectronProbability", muidElectronProbability,
272 "[Calibration] Returns the electron probability stored in the KLMMuidLikelihood dataobject");
273 REGISTER_VARIABLE(
"muidProtonProbability", muidProtonProbability,
274 "[Calibration] Returns the proton probability stored in the KLMMuidLikelihood dataobject");
275 REGISTER_VARIABLE(
"muidDeuteronProbability", muidDeuteronProbability,
276 "[Calibration] Returns the deuteron probability stored in the KLMMuidLikelihood dataobject");
277 REGISTER_VARIABLE(
"muidMuonLogLikelihood", muidMuonLogLikelihood,
278 "[Calibration] Returns the muon log-likelihood stored in the KLMMuidLikelihood dataobject");
279 REGISTER_VARIABLE(
"muidPionLogLikelihood", muidPionLogLikelihood,
280 "[Calibration] Returns the pion log-likelihood stored in the KLMMuidLikelihood dataobject");
281 REGISTER_VARIABLE(
"muidKaonLogLikelihood", muidKaonLogLikelihood,
282 "[Calibration] Returns the kaon log-likelihood stored in the KLMMuidLikelihood dataobject");
283 REGISTER_VARIABLE(
"muidElectronLogLikelihood", muidElectronLogLikelihood,
284 "[Calibration] Returns the electron log-likelihood stored in the KLMMuidLikelihood dataobject");
285 REGISTER_VARIABLE(
"muidProtonLogLikelihood", muidProtonLogLikelihood,
286 "[Calibration] Returns the proton log-likelihood stored in the KLMMuidLikelihood dataobject");
287 REGISTER_VARIABLE(
"muidDeuteronLogLikelihood", muidDeuteronLogLikelihood,
288 "[Calibration] Returns the deuteron log-likelihood stored in the KLMMuidLikelihood dataobject");
289 REGISTER_VARIABLE(
"muidOutcomeExtTrack", muidOutcomeExtTrack,
290 "[Calibration] Returns outcome of muon extrapolation (see MuidElementNumbers for the complete list of the outcome values)");
291 REGISTER_VARIABLE(
"muidChiSquared", muidChiSquared,
292 "[Calibration] Returns chi-squared for this extrapolation");
293 REGISTER_VARIABLE(
"muidDegreesOfFreedom", muidDegreesOfFreedom,
294 "[Calibration] Returns number of degrees of freedom in chi-squared calculation");
295 REGISTER_VARIABLE(
"muidEndcapExtLayer", muidEndcapExtLayer,
296 "[Calibration] Returns outermost EKLM layer crossed by track during extrapolation");
297 REGISTER_VARIABLE(
"muidBarrelExtLayer", muidBarrelExtLayer,
298 "[Calibration] Returns outermost BKLM layer crossed by track during extrapolation");
299 REGISTER_VARIABLE(
"muidExtLayer", muidExtLayer,
300 "[Calibration] Returns outermost BKLM or EKLM layer crossed by track during extrapolation");
301 REGISTER_VARIABLE(
"muidEndcapHitLayer", muidEndcapHitLayer,
"[Calibration] Returns outermost EKLM layer with a matching hit");
302 REGISTER_VARIABLE(
"muidBarrelHitLayer", muidBarrelHitLayer,
"[Calibration] Returns outermost BKLM layer with a matching hit");
303 REGISTER_VARIABLE(
"muidHitLayer", muidHitLayer,
"[Calibration] Return outermost BKLM or EKLM layer with a matching hit");
304 REGISTER_VARIABLE(
"muidExtLayerPattern", muidExtLayerPattern,
305 "[Calibration] Returns layer-crossing bit pattern during extrapolation");
306 REGISTER_VARIABLE(
"muidHitLayerPattern", muidHitLayerPattern,
"[Calibration] Returns matching-hit bit pattern");
307 REGISTER_VARIABLE(
"muidTotalBarrelHits", muidTotalBarrelHits,
"[Calibration] Returns total number of matching BKLM hits");
308 REGISTER_VARIABLE(
"muidTotalEndcapHits", muidTotalEndcapHits,
"[Calibration] Returns total number of matching EKLM hits");
309 REGISTER_VARIABLE(
"muidTotalHits", muidTotalHits,
"[Calibration] Returns total number of matching KLM hits");
Abstract base class for different kinds of events.