10#include <analysis/variables/FlightInfoVariables.h>
13#include <analysis/VariableManager/Manager.h>
15#include <framework/database/DBObjPtr.h>
16#include <framework/logging/Logger.h>
18#include <analysis/dataobjects/Particle.h>
19#include <mdst/dataobjects/MCParticle.h>
20#include <mdst/dbobjects/BeamSpot.h>
22#include <TMatrixFSym.h>
24#include <boost/algorithm/string.hpp>
35 bool hasRAVEBeamConstrainedProductionVertex(
const Particle* particle)
37 bool hasRAVEProdVertex =
true;
38 std::vector<std::string> directions = {
"x",
"y",
"z"};
39 for (
auto ielement : directions) {
40 std::string prodVertPositionElement = boost::str(boost::format(
"prodVert%s") % boost::to_upper_copy(ielement));
41 hasRAVEProdVertex &= particle -> hasExtraInfo(prodVertPositionElement);
42 for (
auto jelement : directions) {
43 std::string prodVertCovarianceElement = boost::str(boost::format(
"prodVertS%s%s") % ielement % jelement);
44 hasRAVEProdVertex &= particle -> hasExtraInfo(prodVertCovarianceElement);
47 return hasRAVEProdVertex;
51 inline double getFlightInfoBtw(
const Particle* particle,
const Particle* daughter,
double& outErr,
const std::string& mode,
52 const bool motherToGranddaughter =
false)
54 if (!particle || !daughter) {
59 if ((particle->getParticleSource() != Particle::EParticleSourceObject::c_Composite and
60 particle->getParticleSource() != Particle::EParticleSourceObject::c_V0) or
61 (daughter->getParticleSource() != Particle::EParticleSourceObject::c_Composite and
62 daughter->getParticleSource() != Particle::EParticleSourceObject::c_V0)) {
63 B2WARNING(
"Attempting to calculate flight " << mode <<
" for neither composite particle nor V0");
67 if (!(mode ==
"distance") && !(mode ==
"time")) {
68 B2WARNING(
"FlightInfo helper function called with mode '" << mode
69 <<
"'. Only 'distance' and 'time' are available.");
76 if (!motherToGranddaughter) {
77 if (mode ==
"distance" &&
78 daughter->hasExtraInfo(
"decayLength") &&
79 daughter->hasExtraInfo(
"decayLengthErr")) {
80 outErr = daughter -> getExtraInfo(
"decayLengthErr");
81 return daughter -> getExtraInfo(
"decayLength");
84 daughter->hasExtraInfo(
"lifeTime") &&
85 daughter->hasExtraInfo(
"lifeTimeErr")) {
86 outErr = daughter -> getExtraInfo(
"lifeTimeErr");
87 return daughter -> getExtraInfo(
"lifeTime");
92 double mumvtxX = particle->getX();
93 double mumvtxY = particle->getY();
94 double mumvtxZ = particle->getZ();
95 if (particle == daughter) {
96 if (hasRAVEBeamConstrainedProductionVertex(particle)) {
97 mumvtxX = particle->getExtraInfo(
"prodVertX");
98 mumvtxY = particle->getExtraInfo(
"prodVertY");
99 mumvtxZ = particle->getExtraInfo(
"prodVertZ");
102 static DBObjPtr<BeamSpot> beamSpotDB;
103 mumvtxX = (beamSpotDB->getIPPosition()).X();
104 mumvtxY = (beamSpotDB->getIPPosition()).Y();
105 mumvtxZ = (beamSpotDB->getIPPosition()).Z();
109 double vtxX = daughter->getX();
110 double vtxY = daughter->getY();
111 double vtxZ = daughter->getZ();
113 double p = daughter->getP();
114 double pX = daughter->getPx();
115 double pY = daughter->getPy();
116 double pZ = daughter->getPz();
123 double lX = vtxX - mumvtxX;
124 double lY = vtxY - mumvtxY;
125 double lZ = vtxZ - mumvtxZ;
128 double fD = lX * nX + lY * nY + lZ * nZ;
134 TMatrixFSym dauCov = daughter->getMomentumVertexErrorMatrix();
135 TMatrixFSym mumCov = particle->getVertexErrorMatrix();
136 if (particle == daughter) {
137 if (hasRAVEBeamConstrainedProductionVertex(particle)) {
138 std::vector<std::string> directions = {
"x",
"y",
"z"};
139 for (
unsigned int i = 0; i < directions.size(); i++) {
140 for (
unsigned int j = 0; j < directions.size(); j++) {
141 mumCov[i][j] = particle->getExtraInfo(boost::str(boost::format(
"prodVertS%s%s") % directions[i] % directions[j]));
145 static DBObjPtr<BeamSpot> beamSpotDB;
146 mumCov = beamSpotDB->getCovVertex();
153 for (
int i = 0; i < 10; i++)
154 for (
int j = 0; j < 10; j++)
156 Cov[i][j] = dauCov[i][j];
157 else if (i > 6 && j > 6)
158 Cov[i][j] = mumCov[i - 7][j - 7];
162 if (mode ==
"distance") {
163 TMatrixF deriv(10, 1);
164 deriv[0][0] = (lX - nX * fD) / p;
165 deriv[1][0] = (lY - nY * fD) / p;
166 deriv[2][0] = (lZ - nZ * fD) / p;
177 tmp.Mult(Cov, deriv);
179 TMatrixF result(1, 1);
180 result.Mult(deriv.T(), tmp);
182 outErr =
sqrt(result[0][0]);
185 if (mode ==
"time") {
186 TMatrixF deriv(10, 1);
200 tmp.Mult(Cov, deriv);
202 TMatrixF result(1, 1);
203 result.Mult(deriv.T(), tmp);
204 outErr =
sqrt(result[0][0]);
212 inline double getMCFlightInfoBtw(
const MCParticle* mcparticle,
const std::string& mode)
215 if (mcparticle ==
nullptr)
219 if (mode ==
"distance") {
220 ROOT::Math::XYZVector deltaVtx = mcparticle->getDecayVertex() - mcparticle->getProductionVertex();
221 double distance = deltaVtx.R();
223 B2WARNING(
"Negative true flight distance, it's forbidden -> something went wrong.");
228 if (mode ==
"time") {
229 double lifetime = mcparticle->getLifetime();
230 double mass = mcparticle->getMass();
233 B2WARNING(
"you are asking for the proper time of a massless particle which is not allowed, returning -99.");
235 double energy = mcparticle->getEnergy();
236 time = lifetime / energy * mass;
240 B2WARNING(
"Negative true proper time, it's forbidden -> something went wrong.");
245 B2WARNING(
"MCFlightInfo helper function called with mode '" << mode
246 <<
"'. Only 'distance' and 'time' are available.");
251 double flightDistance(
const Particle* part)
254 return getFlightInfoBtw(part, part, flightDistanceError,
"distance");
257 double flightTime(
const Particle* part)
260 return getFlightInfoBtw(part, part, flightTimeError,
"time");
263 double flightDistanceErr(
const Particle* part)
266 getFlightInfoBtw(part, part, flightDistanceError,
"distance");
267 return flightDistanceError;
270 double flightTimeErr(
const Particle* part)
273 getFlightInfoBtw(part, part, flightTimeError,
"time");
274 return flightTimeError;
277 inline double getVertexDistance(
const Particle* particle,
const Particle* daughter,
double& vertexDistanceErr,
278 bool prodVertIsIP =
false)
280 if (!particle || !daughter) {
286 double prodVtxX = particle->getX();
287 double prodVtxY = particle->getY();
288 double prodVtxZ = particle->getZ();
289 if (particle == daughter || prodVertIsIP) {
290 if (particle->hasExtraInfo(
"prodVertX")) prodVtxX = particle->getExtraInfo(
"prodVertX");
291 if (particle->hasExtraInfo(
"prodVertY")) prodVtxY = particle->getExtraInfo(
"prodVertY");
292 if (particle->hasExtraInfo(
"prodVertZ")) prodVtxZ = particle->getExtraInfo(
"prodVertZ");
296 double vtxX = daughter->getX();
297 double vtxY = daughter->getY();
298 double vtxZ = daughter->getZ();
301 double lX = vtxX - prodVtxX;
302 double lY = vtxY - prodVtxY;
303 double lZ = vtxZ - prodVtxZ;
306 double lD =
sqrt(lX * lX + lY * lY + lZ * lZ);
309 TMatrixFSym decCov = daughter->getVertexErrorMatrix();
310 TMatrixFSym prodCov = particle->getVertexErrorMatrix();
311 if (particle == daughter || prodVertIsIP) {
312 if (particle->hasExtraInfo(
"prodVertSxx")) prodCov[0][0] = particle->getExtraInfo(
"prodVertSxx");
313 if (particle->hasExtraInfo(
"prodVertSxy")) prodCov[0][1] = particle->getExtraInfo(
"prodVertSxy");
314 if (particle->hasExtraInfo(
"prodVertSxz")) prodCov[0][2] = particle->getExtraInfo(
"prodVertSxz");
315 if (particle->hasExtraInfo(
"prodVertSyx")) prodCov[1][0] = particle->getExtraInfo(
"prodVertSyx");
316 if (particle->hasExtraInfo(
"prodVertSyy")) prodCov[1][1] = particle->getExtraInfo(
"prodVertSyy");
317 if (particle->hasExtraInfo(
"prodVertSyz")) prodCov[1][2] = particle->getExtraInfo(
"prodVertSyz");
318 if (particle->hasExtraInfo(
"prodVertSzx")) prodCov[2][0] = particle->getExtraInfo(
"prodVertSzx");
319 if (particle->hasExtraInfo(
"prodVertSzy")) prodCov[2][1] = particle->getExtraInfo(
"prodVertSzy");
320 if (particle->hasExtraInfo(
"prodVertSzz")) prodCov[2][2] = particle->getExtraInfo(
"prodVertSzz");
327 for (
int i = 0; i < 6; i++)
328 for (
int j = 0; j < 6; j++)
330 Cov[i][j] = prodCov[i][j];
331 else if (i > 2 && j > 2)
332 Cov[i][j] = decCov[i - 3][j - 3];
336 TMatrixF deriv(6, 1);
337 deriv[0][0] = - lX / lD;
338 deriv[1][0] = - lY / lD;
339 deriv[2][0] = - lZ / lD;
340 deriv[3][0] = lX / lD;
341 deriv[4][0] = lY / lD;
342 deriv[5][0] = lZ / lD;
346 tmp.Mult(Cov, deriv);
348 TMatrixF result(1, 1);
349 result.Mult(deriv.T(), tmp);
351 vertexDistanceErr =
sqrt(result[0][0]);
355 double vertexDistance(
const Particle* part)
358 if (!part->hasExtraInfo(
"prodVertX") || !part->hasExtraInfo(
"prodVertY") || !part->hasExtraInfo(
"prodVertZ")) {
361 return getVertexDistance(part, part, vertexDistanceError);
364 double vertexDistanceErr(
const Particle* part)
367 if (!part->hasExtraInfo(
"prodVertX") || !part->hasExtraInfo(
"prodVertY") || !part->hasExtraInfo(
"prodVertZ")) {
370 getVertexDistance(part, part, vertexDistanceError);
371 return vertexDistanceError;
374 double vertexDistanceSignificance(
const Particle* part)
377 if (!part->hasExtraInfo(
"prodVertX") || !part->hasExtraInfo(
"prodVertY") || !part->hasExtraInfo(
"prodVertZ")) {
380 return getVertexDistance(part, part, vertexDistanceError) / vertexDistanceError;
383 double flightTimeOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
388 long daughterNumber = -1;
389 if (daughters.size() > 0) {
390 daughterNumber = std::lround(daughters[0]);
392 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightTimeOfDaughter!");
395 int nDaughters =
static_cast<int>(particle->getNDaughters());
396 if (daughterNumber >= nDaughters) {
397 B2ERROR(
"The daughter index provided to flightTimeOfDaughter is larger than the number of daughters of this particle!");
401 long grandDaughterNumber = -1;
402 if (daughters.size() == 2) {
403 grandDaughterNumber = std::lround(daughters[1]);
406 const Particle* daughter = particle->getDaughter(daughterNumber);
407 double flightTimeError;
408 if (grandDaughterNumber > -1) {
409 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
410 return getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightTimeError,
"time",
true);
412 B2ERROR(
"The granddaughter index provided to flightTimeOfDaughter is too large!");
416 return getFlightInfoBtw(particle, daughter, flightTimeError,
"time");
421 double flightTimeOfDaughterErr(
const Particle* particle,
const std::vector<double>& daughters)
426 long daughterNumber = -1;
427 if (daughters.size() > 0) {
428 daughterNumber = std::lround(daughters[0]);
430 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightTimeOfDaughterErr!");
433 int nDaughters =
static_cast<int>(particle->getNDaughters());
434 if (daughterNumber >= nDaughters) {
435 B2ERROR(
"The daughter index provided to flightTimeOfDaughterErr is larger than the number of daughters of this particle!");
439 long grandDaughterNumber = -1;
440 if (daughters.size() == 2) {
441 grandDaughterNumber = std::lround(daughters[1]);
444 const Particle* daughter = particle->getDaughter(daughterNumber);
446 if (grandDaughterNumber > -1) {
447 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
448 getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightTimeError,
"time",
true);
450 B2ERROR(
"The granddaughter index provided to flightTimeOfDaughterErr is too large!");
453 getFlightInfoBtw(particle, daughter, flightTimeError,
"time");
455 return flightTimeError;
458 double flightDistanceOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
463 long daughterNumber = -1;
464 if (daughters.size() > 0) {
465 daughterNumber = std::lround(daughters[0]);
467 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightDistanceOfDaughter!");
470 int nDaughters =
static_cast<int>(particle->getNDaughters());
471 if (daughterNumber >= nDaughters) {
472 B2ERROR(
"The daughter index provided to flightDistanceOfDaughter is larger than the number of daughters of this particle!");
476 long grandDaughterNumber = -1;
477 if (daughters.size() == 2) {
478 grandDaughterNumber = std::lround(daughters[1]);
481 const Particle* daughter = particle->getDaughter(daughterNumber);
482 double flightDistanceError;
483 if (grandDaughterNumber > -1) {
484 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
485 return getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightDistanceError,
"distance",
true);
487 B2ERROR(
"The granddaughter index provided to flightDistanceOfDaughter is too large!");
491 return getFlightInfoBtw(particle, daughter, flightDistanceError,
"distance");
496 double flightDistanceOfDaughterErr(
const Particle* particle,
const std::vector<double>& daughters)
501 long daughterNumber = -1;
502 if (daughters.size() > 0) {
503 daughterNumber = std::lround(daughters[0]);
505 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightDistanceOfDaughterErr!");
508 int nDaughters =
static_cast<int>(particle->getNDaughters());
509 if (daughterNumber >= nDaughters) {
510 B2ERROR(
"The daughter index provided to flightDistanceOfDaughterErr is larger than the number of daughters of this particle!");
514 long grandDaughterNumber = -1;
515 if (daughters.size() == 2) {
516 grandDaughterNumber = std::lround(daughters[1]);
519 const Particle* daughter = particle->getDaughter(daughterNumber);
521 if (grandDaughterNumber > -1) {
522 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
523 getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightDistanceError,
"distance",
true);
525 B2ERROR(
"The granddaughter index provided to flightDistanceOfDaughterErr is too large!");
528 getFlightInfoBtw(particle, daughter, flightDistanceError,
"distance");
530 return flightDistanceError;
534 double vertexDistanceOfDaughter(
const Particle* particle,
const std::vector<double>& arguments)
538 long daughterNumber = -1;
539 if (arguments.size() > 0) {
540 daughterNumber = std::lround(arguments[0]);
542 B2ERROR(
"At least one integer, the index of the daughter, must be provided to vertexDistanceOfDaughter!");
545 int nDaughters =
static_cast<int>(particle->getNDaughters());
546 if (daughterNumber >= nDaughters) {
547 B2ERROR(
"The daughter index provided to vertexDistanceOfDaughter is larger than the number of daughters of this particle!");
551 bool prodVertIsIP =
true;
552 if (arguments.size() == 2) {
553 prodVertIsIP =
false;
556 const Particle* daughter = particle->getDaughter(daughterNumber);
557 double vertexDistanceError;
558 return getVertexDistance(particle, daughter, vertexDistanceError, prodVertIsIP);
562 double vertexDistanceOfDaughterErr(
const Particle* particle,
const std::vector<double>& arguments)
566 long daughterNumber = -1;
567 if (arguments.size() > 0) {
568 daughterNumber = std::lround(arguments[0]);
570 B2ERROR(
"At least one integer, the index of the daughter, must be provided to vertexDistanceOfDaughterErr!");
573 int nDaughters =
static_cast<int>(particle->getNDaughters());
574 if (daughterNumber >= nDaughters) {
575 B2ERROR(
"The daughter index provided to vertexDistanceOfDaughterErr is larger than the number of daughters of this particle!");
579 bool prodVertIsIP =
true;
580 if (arguments.size() == 2) {
581 prodVertIsIP =
false;
584 const Particle* daughter = particle->getDaughter(daughterNumber);
585 double vertexDistanceError;
586 getVertexDistance(particle, daughter, vertexDistanceError, prodVertIsIP);
587 return vertexDistanceError;
591 double vertexDistanceOfDaughterSignificance(
const Particle* particle,
const std::vector<double>& arguments)
595 long daughterNumber = -1;
596 if (arguments.size() > 0) {
597 daughterNumber = std::lround(arguments[0]);
599 B2ERROR(
"At least one integer, the index of the daughter, must be provided to vertexDistanceOfDaughterSignificance!");
602 int nDaughters =
static_cast<int>(particle->getNDaughters());
603 if (daughterNumber >= nDaughters) {
604 B2ERROR(
"The daughter index provided to vertexDistanceOfDaughterSignificance is larger than the number of daughters of this particle!");
608 bool prodVertIsIP =
true;
609 if (arguments.size() == 2) {
610 prodVertIsIP =
false;
613 const Particle* daughter = particle->getDaughter(daughterNumber);
614 double vertexDistanceError;
615 return getVertexDistance(particle, daughter, vertexDistanceError, prodVertIsIP) / vertexDistanceError;
620 double mcFlightDistance(
const Particle* particle)
622 if (particle ==
nullptr)
625 const MCParticle* mcparticle = particle->getMCParticle();
627 if (mcparticle ==
nullptr)
630 return getMCFlightInfoBtw(mcparticle,
"distance");
633 double mcFlightTime(
const Particle* particle)
635 if (particle ==
nullptr)
638 const MCParticle* mcparticle = particle->getMCParticle();
640 if (mcparticle ==
nullptr)
644 return getMCFlightInfoBtw(mcparticle,
"time");
647 double mcFlightDistanceOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
652 long daughterNumber = -1;
653 if (daughters.size() > 0) {
654 daughterNumber = std::lround(daughters[0]);
656 B2ERROR(
"At least one integer, the index of the daughter, must be provided to mcFlightDistanceOfDaughter!");
659 int nDaughters =
static_cast<int>(particle->getNDaughters());
660 if (daughterNumber >= nDaughters) {
661 B2ERROR(
"The daughter index provided to mcFlightDistanceOfDaughter is larger than the number of daughters of this particle!");
665 long grandDaughterNumber = -1;
666 if (daughters.size() == 2) {
667 grandDaughterNumber = std::lround(daughters[1]);
670 const Particle* daughterReco = particle->getDaughter(daughterNumber);
672 const MCParticle* daughter = daughterReco->getMCParticle();
674 double flightDistanceMC;
675 if (grandDaughterNumber > -1 && grandDaughterNumber < (
int)daughterReco->getNDaughters()) {
678 flightDistanceMC = getMCFlightInfoBtw(gdaughter,
"distance");
681 flightDistanceMC = getMCFlightInfoBtw(daughter,
"distance");
683 return flightDistanceMC;
686 double mcFlightTimeOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
691 long daughterNumber = -1;
692 if (daughters.size() > 0) {
693 daughterNumber = std::lround(daughters[0]);
695 B2ERROR(
"At least one integer, the index of the daughter, must be provided to mcFlightTimeOfDaughter!");
698 int nDaughters =
static_cast<int>(particle->getNDaughters());
699 if (daughterNumber >= nDaughters) {
700 B2ERROR(
"The daughter index provided to mcFlightTimeOfDaughter is larger than the number of daughters of this particle!");
704 long grandDaughterNumber = -1;
705 if (daughters.size() == 2) {
706 grandDaughterNumber = std::lround(daughters[1]);
709 const Particle* daughterReco = particle->getDaughter(daughterNumber);
711 const MCParticle* daughter = daughterReco->getMCParticle();
714 if (grandDaughterNumber > -1 && grandDaughterNumber < (
int)daughterReco->getNDaughters()) {
717 flightTimeMC = getMCFlightInfoBtw(gdaughter,
"time");
719 flightTimeMC = getMCFlightInfoBtw(daughter,
"time");
725 VARIABLE_GROUP(
"Flight Information");
726 REGISTER_VARIABLE(
"flightTime", flightTime,
727 "Returns the flight time of particle. If a treeFit has been performed the flight time calculated by TreeFitter is returned. Otherwise if a beam constrained rave fit has been performed the production vertex set by rave and the decay vertex are used to calculate the flight time. If neither fit has been performed the i.p. is taken to be the production vertex.\n\n",
729 REGISTER_VARIABLE(
"flightDistance", flightDistance,
730 "Returns the flight distance of particle. If a treeFit has been performed the flight distance calculated by TreeFitter is returned. Otherwise if a beam constrained rave fit has been performed the production vertex set by rave and the decay vertex are used to calculate the flight distance. If neither fit has been performed the i.p. is taken to be the production vertex.\n\n",
732 REGISTER_VARIABLE(
"flightTimeErr", flightTimeErr,
733 "Returns the flight time error of particle. If a treeFit has been performed the flight time error calculated by TreeFitter is returned. Otherwise if a beam constrained rave fit has been performed the production vertex set by rave and the decay vertex are used to calculate the flight time error. If neither fit has been performed the i.p. is taken to be the production vertex.\n\n",
735 REGISTER_VARIABLE(
"flightDistanceErr", flightDistanceErr,
736 "Returns the flight distance error of particle. If a treeFit has been performed the flight distance error calculated by TreeFitter is returned. Otherwise if a beam constrained rave fit has been performed the production vertex set by rave and the decay vertex are used to calculate the flight distance error. If neither fit has been performed the i.p. is taken to be the production vertex.\n\n",
739 REGISTER_VARIABLE(
"flightTimeOfDaughter(daughterN, gdaughterN = -1)", flightTimeOfDaughter,
740 "Returns the flight time between mother and daughter particle with daughterN index. If a treeFit has been performed the value calculated by treeFitter is returned. Otherwise the value is calculated using the decay vertices of the mother and daughter particle. If a second index granddaughterM is given the value is calculated between the mother and the Mth grandaughter (Mth daughter of Nth daughter).\n\n",
742 REGISTER_VARIABLE(
"flightTimeOfDaughterErr(daughterN, gdaughterN = -1)", flightTimeOfDaughterErr,
743 "Returns the flight time error between mother and daughter particle with daughterN index. If a treeFit has been performed the value calculated by treeFitter is returned. Otherwise the value is calculated using the decay vertices of the mother and daughter particle. If a second index granddaughterM is given the value is calculated between the mother and the Mth grandaughter (Mth daughter of Nth daughter).\n\n",
745 REGISTER_VARIABLE(
"flightDistanceOfDaughter(daughterN, gdaughterN = -1)", flightDistanceOfDaughter,
746 "Returns the flight distance between mother and daughter particle with daughterN index. If a treeFit has been performed the value calculated by treeFitter is returned. Otherwise the value is calculated using the decay vertices of the mother and daughter particle. If a second index granddaughterM is given the value is calculated between the mother and the Mth grandaughter (Mth daughter of Nth daughter).\n\n",
748 REGISTER_VARIABLE(
"flightDistanceOfDaughterErr(daughterN, gdaughterN = -1)", flightDistanceOfDaughterErr,
749 "Returns the flight distance error between mother and daughter particle with daughterN index. If a treeFit has been performed the value calculated by treeFitter is returned. Otherwise the value is calculated using the decay vertices of the mother and daughter particle. If a second index granddaughterM is given the value is calculated between the mother and the Mth grandaughter (Mth daughter of Nth daughter).\n\n",
752 REGISTER_VARIABLE(
"mcFlightDistance", mcFlightDistance,
753 "Returns the MC flight distance of the particle\n\n",
"cm");
754 REGISTER_VARIABLE(
"mcFlightTime", mcFlightTime,
755 "Returns the MC flight time of the particle\n\n",
"ns");
756 REGISTER_VARIABLE(
"mcFlightDistanceOfDaughter(daughterN, gdaughterN = -1)", mcFlightDistanceOfDaughter,
757 "Returns the MC flight distance between mother and daughter particle using generated info\n\n",
"cm");
758 REGISTER_VARIABLE(
"mcFlightTimeOfDaughter(daughterN, gdaughterN = -1)", mcFlightTimeOfDaughter,
759 "Returns the MC flight time between mother and daughter particle using generated info\n\n",
"ns");
761 REGISTER_VARIABLE(
"vertexDistance", vertexDistance,
762 "Returns the distance between the production and decay vertex of a particle. Returns NaN if particle has no production or decay vertex.\n\n",
764 REGISTER_VARIABLE(
"vertexDistanceErr", vertexDistanceErr,
765 "Returns the uncertainty on the distance between the production and decay vertex of a particle. Returns NaN if particle has no production or decay vertex.\n\n",
767 REGISTER_VARIABLE(
"vertexDistanceSignificance", vertexDistanceSignificance,
768 "Returns the distance between the production and decay vertex of a particle in units of the uncertainty on this value, i.e. the significance of the vertex separation.");
769 REGISTER_VARIABLE(
"vertexDistanceOfDaughter(daughterN[, option])", vertexDistanceOfDaughter,
770 "If any integer is provided as second argument it returns the distance between the decay vertices of the particle and of its daughter with index daughterN.\n"
771 "Otherwise, it is assumed that the particle has a production vertex (typically the IP) which is used to calculate the distance to the daughter's decay vertex.\n"
772 "Returns NaN in case anything goes wrong.\n\n",
"cm");
773 REGISTER_VARIABLE(
"vertexDistanceOfDaughterErr(daughterN[, option])", vertexDistanceOfDaughterErr,
774 "If any integer is provided as second argument it returns the uncertainty on the distance between the decay vertices of the particle and of its daughter with index daughterN.\n"
775 "Otherwise, it is assumed that the particle has a production vertex (typically the IP) with a corresponding covariance matrix to calculate the uncertainty on the distance to the daughter's decay vertex.\n"
776 "Returns NaN in case anything goes wrong.\n\n",
"cm");
777 REGISTER_VARIABLE(
"vertexDistanceOfDaughterSignificance(daughterN[, option)", vertexDistanceOfDaughterSignificance,
778 "If any integer is provided as second argument it returns the distance between the decay vertices of the particle and of its daughter with index daughterN in units of the uncertainty on this value.\n"
779 "Otherwise, it is assumed that the particle has a production vertex (typically the IP) with a corresponding covariance matrix and the significance of the separation to this vertex is calculated.");
static const double speedOfLight
[cm/ns]
static const double doubleNaN
quiet_NaN
const MCParticle * getMCParticle() const
Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c...
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.