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>
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 if (beamSpotDB.isValid()) {
104 mumvtxX = (beamSpotDB->getIPPosition()).X();
105 mumvtxY = (beamSpotDB->getIPPosition()).Y();
106 mumvtxZ = (beamSpotDB->getIPPosition()).Z();
111 double vtxX = daughter->getX();
112 double vtxY = daughter->getY();
113 double vtxZ = daughter->getZ();
115 double p = daughter->getP();
116 double pX = daughter->getPx();
117 double pY = daughter->getPy();
118 double pZ = daughter->getPz();
125 double lX = vtxX - mumvtxX;
126 double lY = vtxY - mumvtxY;
127 double lZ = vtxZ - mumvtxZ;
130 double fD = lX * nX + lY * nY + lZ * nZ;
136 TMatrixFSym dauCov = daughter->getMomentumVertexErrorMatrix();
137 TMatrixFSym mumCov = particle->getVertexErrorMatrix();
138 if (particle == daughter) {
139 if (hasRAVEBeamConstrainedProductionVertex(particle)) {
140 std::vector<std::string> directions = {
"x",
"y",
"z"};
141 for (
unsigned int i = 0; i < directions.size(); i++) {
142 for (
unsigned int j = 0; j < directions.size(); j++) {
143 mumCov[i][j] = particle->getExtraInfo(boost::str(boost::format(
"prodVertS%s%s") % directions[i] % directions[j]));
147 static DBObjPtr<BeamSpot> beamSpotDB;
148 if (beamSpotDB.isValid())
149 mumCov = beamSpotDB->getCovVertex();
156 for (
int i = 0; i < 10; i++)
157 for (
int j = 0; j < 10; j++)
159 Cov[i][j] = dauCov[i][j];
160 else if (i > 6 && j > 6)
161 Cov[i][j] = mumCov[i - 7][j - 7];
165 if (mode ==
"distance") {
166 TMatrixF deriv(10, 1);
167 deriv[0][0] = (lX - nX * fD) / p;
168 deriv[1][0] = (lY - nY * fD) / p;
169 deriv[2][0] = (lZ - nZ * fD) / p;
180 tmp.Mult(Cov, deriv);
182 TMatrixF result(1, 1);
183 result.Mult(deriv.T(), tmp);
185 outErr =
sqrt(result[0][0]);
188 if (mode ==
"time") {
189 TMatrixF deriv(10, 1);
203 tmp.Mult(Cov, deriv);
205 TMatrixF result(1, 1);
206 result.Mult(deriv.T(), tmp);
207 outErr =
sqrt(result[0][0]);
215 inline double getMCFlightInfoBtw(
const MCParticle* mcparticle,
const std::string& mode)
218 if (mcparticle ==
nullptr)
222 if (mode ==
"distance") {
223 ROOT::Math::XYZVector deltaVtx = mcparticle->getDecayVertex() - mcparticle->getProductionVertex();
224 double distance = deltaVtx.R();
226 B2WARNING(
"Negative true flight distance, it's forbidden -> something went wrong.");
231 if (mode ==
"time") {
232 double lifetime = mcparticle->getLifetime();
233 double mass = mcparticle->getMass();
236 B2WARNING(
"you are asking for the proper time of a massless particle which is not allowed, returning -99.");
238 double energy = mcparticle->getEnergy();
239 time = lifetime / energy * mass;
243 B2WARNING(
"Negative true proper time, it's forbidden -> something went wrong.");
248 B2WARNING(
"MCFlightInfo helper function called with mode '" << mode
249 <<
"'. Only 'distance' and 'time' are available.");
254 double flightDistance(
const Particle* part)
257 return getFlightInfoBtw(part, part, flightDistanceError,
"distance");
260 double flightTime(
const Particle* part)
263 return getFlightInfoBtw(part, part, flightTimeError,
"time");
266 double flightDistanceErr(
const Particle* part)
269 getFlightInfoBtw(part, part, flightDistanceError,
"distance");
270 return flightDistanceError;
273 double flightTimeErr(
const Particle* part)
276 getFlightInfoBtw(part, part, flightTimeError,
"time");
277 return flightTimeError;
280 inline double getVertexDistance(
const Particle* particle,
const Particle* daughter,
double& vertexDistanceErr,
281 bool prodVertIsIP =
false)
283 if (!particle || !daughter) {
289 double prodVtxX = particle->getX();
290 double prodVtxY = particle->getY();
291 double prodVtxZ = particle->getZ();
292 if (particle == daughter || prodVertIsIP) {
293 if (particle->hasExtraInfo(
"prodVertX")) prodVtxX = particle->getExtraInfo(
"prodVertX");
294 if (particle->hasExtraInfo(
"prodVertY")) prodVtxY = particle->getExtraInfo(
"prodVertY");
295 if (particle->hasExtraInfo(
"prodVertZ")) prodVtxZ = particle->getExtraInfo(
"prodVertZ");
299 double vtxX = daughter->getX();
300 double vtxY = daughter->getY();
301 double vtxZ = daughter->getZ();
304 double lX = vtxX - prodVtxX;
305 double lY = vtxY - prodVtxY;
306 double lZ = vtxZ - prodVtxZ;
309 double lD =
sqrt(lX * lX + lY * lY + lZ * lZ);
312 TMatrixFSym decCov = daughter->getVertexErrorMatrix();
313 TMatrixFSym prodCov = particle->getVertexErrorMatrix();
314 if (particle == daughter || prodVertIsIP) {
315 if (particle->hasExtraInfo(
"prodVertSxx")) prodCov[0][0] = particle->getExtraInfo(
"prodVertSxx");
316 if (particle->hasExtraInfo(
"prodVertSxy")) prodCov[0][1] = particle->getExtraInfo(
"prodVertSxy");
317 if (particle->hasExtraInfo(
"prodVertSxz")) prodCov[0][2] = particle->getExtraInfo(
"prodVertSxz");
318 if (particle->hasExtraInfo(
"prodVertSyx")) prodCov[1][0] = particle->getExtraInfo(
"prodVertSyx");
319 if (particle->hasExtraInfo(
"prodVertSyy")) prodCov[1][1] = particle->getExtraInfo(
"prodVertSyy");
320 if (particle->hasExtraInfo(
"prodVertSyz")) prodCov[1][2] = particle->getExtraInfo(
"prodVertSyz");
321 if (particle->hasExtraInfo(
"prodVertSzx")) prodCov[2][0] = particle->getExtraInfo(
"prodVertSzx");
322 if (particle->hasExtraInfo(
"prodVertSzy")) prodCov[2][1] = particle->getExtraInfo(
"prodVertSzy");
323 if (particle->hasExtraInfo(
"prodVertSzz")) prodCov[2][2] = particle->getExtraInfo(
"prodVertSzz");
330 for (
int i = 0; i < 6; i++)
331 for (
int j = 0; j < 6; j++)
333 Cov[i][j] = prodCov[i][j];
334 else if (i > 2 && j > 2)
335 Cov[i][j] = decCov[i - 3][j - 3];
339 TMatrixF deriv(6, 1);
340 deriv[0][0] = - lX / lD;
341 deriv[1][0] = - lY / lD;
342 deriv[2][0] = - lZ / lD;
343 deriv[3][0] = lX / lD;
344 deriv[4][0] = lY / lD;
345 deriv[5][0] = lZ / lD;
349 tmp.Mult(Cov, deriv);
351 TMatrixF result(1, 1);
352 result.Mult(deriv.T(), tmp);
354 vertexDistanceErr =
sqrt(result[0][0]);
358 double vertexDistance(
const Particle* part)
361 if (!part->hasExtraInfo(
"prodVertX") || !part->hasExtraInfo(
"prodVertY") || !part->hasExtraInfo(
"prodVertZ")) {
364 return getVertexDistance(part, part, vertexDistanceError);
367 double vertexDistanceErr(
const Particle* part)
370 if (!part->hasExtraInfo(
"prodVertX") || !part->hasExtraInfo(
"prodVertY") || !part->hasExtraInfo(
"prodVertZ")) {
373 getVertexDistance(part, part, vertexDistanceError);
374 return vertexDistanceError;
377 double vertexDistanceSignificance(
const Particle* part)
380 if (!part->hasExtraInfo(
"prodVertX") || !part->hasExtraInfo(
"prodVertY") || !part->hasExtraInfo(
"prodVertZ")) {
383 return getVertexDistance(part, part, vertexDistanceError) / vertexDistanceError;
386 double flightTimeOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
391 long daughterNumber = -1;
392 if (daughters.size() > 0) {
393 daughterNumber = std::lround(daughters[0]);
395 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightTimeOfDaughter!");
398 int nDaughters =
static_cast<int>(particle->getNDaughters());
399 if (daughterNumber >= nDaughters) {
400 B2ERROR(
"The daughter index provided to flightTimeOfDaughter is larger than the number of daughters of this particle!");
404 long grandDaughterNumber = -1;
405 if (daughters.size() == 2) {
406 grandDaughterNumber = std::lround(daughters[1]);
409 const Particle* daughter = particle->getDaughter(daughterNumber);
410 double flightTimeError;
411 if (grandDaughterNumber > -1) {
412 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
413 return getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightTimeError,
"time",
true);
415 B2ERROR(
"The granddaughter index provided to flightTimeOfDaughter is too large!");
419 return getFlightInfoBtw(particle, daughter, flightTimeError,
"time");
424 double flightTimeOfDaughterErr(
const Particle* particle,
const std::vector<double>& daughters)
429 long daughterNumber = -1;
430 if (daughters.size() > 0) {
431 daughterNumber = std::lround(daughters[0]);
433 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightTimeOfDaughterErr!");
436 int nDaughters =
static_cast<int>(particle->getNDaughters());
437 if (daughterNumber >= nDaughters) {
438 B2ERROR(
"The daughter index provided to flightTimeOfDaughterErr is larger than the number of daughters of this particle!");
442 long grandDaughterNumber = -1;
443 if (daughters.size() == 2) {
444 grandDaughterNumber = std::lround(daughters[1]);
447 const Particle* daughter = particle->getDaughter(daughterNumber);
449 if (grandDaughterNumber > -1) {
450 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
451 getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightTimeError,
"time",
true);
453 B2ERROR(
"The granddaughter index provided to flightTimeOfDaughterErr is too large!");
456 getFlightInfoBtw(particle, daughter, flightTimeError,
"time");
458 return flightTimeError;
461 double flightDistanceOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
466 long daughterNumber = -1;
467 if (daughters.size() > 0) {
468 daughterNumber = std::lround(daughters[0]);
470 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightDistanceOfDaughter!");
473 int nDaughters =
static_cast<int>(particle->getNDaughters());
474 if (daughterNumber >= nDaughters) {
475 B2ERROR(
"The daughter index provided to flightDistanceOfDaughter is larger than the number of daughters of this particle!");
479 long grandDaughterNumber = -1;
480 if (daughters.size() == 2) {
481 grandDaughterNumber = std::lround(daughters[1]);
484 const Particle* daughter = particle->getDaughter(daughterNumber);
485 double flightDistanceError;
486 if (grandDaughterNumber > -1) {
487 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
488 return getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightDistanceError,
"distance",
true);
490 B2ERROR(
"The granddaughter index provided to flightDistanceOfDaughter is too large!");
494 return getFlightInfoBtw(particle, daughter, flightDistanceError,
"distance");
499 double flightDistanceOfDaughterErr(
const Particle* particle,
const std::vector<double>& daughters)
504 long daughterNumber = -1;
505 if (daughters.size() > 0) {
506 daughterNumber = std::lround(daughters[0]);
508 B2ERROR(
"At least one integer, the index of the daughter, must be provided to flightDistanceOfDaughterErr!");
511 int nDaughters =
static_cast<int>(particle->getNDaughters());
512 if (daughterNumber >= nDaughters) {
513 B2ERROR(
"The daughter index provided to flightDistanceOfDaughterErr is larger than the number of daughters of this particle!");
517 long grandDaughterNumber = -1;
518 if (daughters.size() == 2) {
519 grandDaughterNumber = std::lround(daughters[1]);
522 const Particle* daughter = particle->getDaughter(daughterNumber);
524 if (grandDaughterNumber > -1) {
525 if (grandDaughterNumber < (
int)daughter->getNDaughters()) {
526 getFlightInfoBtw(particle, daughter->getDaughter(grandDaughterNumber), flightDistanceError,
"distance",
true);
528 B2ERROR(
"The granddaughter index provided to flightDistanceOfDaughterErr is too large!");
531 getFlightInfoBtw(particle, daughter, flightDistanceError,
"distance");
533 return flightDistanceError;
537 double vertexDistanceOfDaughter(
const Particle* particle,
const std::vector<double>& arguments)
541 long daughterNumber = -1;
542 if (arguments.size() > 0) {
543 daughterNumber = std::lround(arguments[0]);
545 B2ERROR(
"At least one integer, the index of the daughter, must be provided to vertexDistanceOfDaughter!");
548 int nDaughters =
static_cast<int>(particle->getNDaughters());
549 if (daughterNumber >= nDaughters) {
550 B2ERROR(
"The daughter index provided to vertexDistanceOfDaughter is larger than the number of daughters of this particle!");
554 bool prodVertIsIP =
true;
555 if (arguments.size() == 2) {
556 prodVertIsIP =
false;
559 const Particle* daughter = particle->getDaughter(daughterNumber);
560 double vertexDistanceError;
561 return getVertexDistance(particle, daughter, vertexDistanceError, prodVertIsIP);
565 double vertexDistanceOfDaughterErr(
const Particle* particle,
const std::vector<double>& arguments)
569 long daughterNumber = -1;
570 if (arguments.size() > 0) {
571 daughterNumber = std::lround(arguments[0]);
573 B2ERROR(
"At least one integer, the index of the daughter, must be provided to vertexDistanceOfDaughterErr!");
576 int nDaughters =
static_cast<int>(particle->getNDaughters());
577 if (daughterNumber >= nDaughters) {
578 B2ERROR(
"The daughter index provided to vertexDistanceOfDaughterErr is larger than the number of daughters of this particle!");
582 bool prodVertIsIP =
true;
583 if (arguments.size() == 2) {
584 prodVertIsIP =
false;
587 const Particle* daughter = particle->getDaughter(daughterNumber);
588 double vertexDistanceError;
589 getVertexDistance(particle, daughter, vertexDistanceError, prodVertIsIP);
590 return vertexDistanceError;
594 double vertexDistanceOfDaughterSignificance(
const Particle* particle,
const std::vector<double>& arguments)
598 long daughterNumber = -1;
599 if (arguments.size() > 0) {
600 daughterNumber = std::lround(arguments[0]);
602 B2ERROR(
"At least one integer, the index of the daughter, must be provided to vertexDistanceOfDaughterSignificance!");
605 int nDaughters =
static_cast<int>(particle->getNDaughters());
606 if (daughterNumber >= nDaughters) {
607 B2ERROR(
"The daughter index provided to vertexDistanceOfDaughterSignificance is larger than the number of daughters of this particle!");
611 bool prodVertIsIP =
true;
612 if (arguments.size() == 2) {
613 prodVertIsIP =
false;
616 const Particle* daughter = particle->getDaughter(daughterNumber);
617 double vertexDistanceError;
618 return getVertexDistance(particle, daughter, vertexDistanceError, prodVertIsIP) / vertexDistanceError;
623 double mcFlightDistance(
const Particle* particle)
625 if (particle ==
nullptr)
628 const MCParticle* mcparticle = particle->getMCParticle();
630 if (mcparticle ==
nullptr)
633 return getMCFlightInfoBtw(mcparticle,
"distance");
636 double mcFlightTime(
const Particle* particle)
638 if (particle ==
nullptr)
641 const MCParticle* mcparticle = particle->getMCParticle();
643 if (mcparticle ==
nullptr)
647 return getMCFlightInfoBtw(mcparticle,
"time");
650 double mcFlightDistanceOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
655 long daughterNumber = -1;
656 if (daughters.size() > 0) {
657 daughterNumber = std::lround(daughters[0]);
659 B2ERROR(
"At least one integer, the index of the daughter, must be provided to mcFlightDistanceOfDaughter!");
662 int nDaughters =
static_cast<int>(particle->getNDaughters());
663 if (daughterNumber >= nDaughters) {
664 B2ERROR(
"The daughter index provided to mcFlightDistanceOfDaughter is larger than the number of daughters of this particle!");
668 long grandDaughterNumber = -1;
669 if (daughters.size() == 2) {
670 grandDaughterNumber = std::lround(daughters[1]);
673 const Particle* daughterReco = particle->getDaughter(daughterNumber);
675 const MCParticle* daughter = daughterReco->getMCParticle();
677 double flightDistanceMC;
678 if (grandDaughterNumber > -1 && grandDaughterNumber < (
int)daughterReco->getNDaughters()) {
680 const MCParticle* gdaughter = daughterReco->getDaughter(grandDaughterNumber)->getMCParticle();
681 flightDistanceMC = getMCFlightInfoBtw(gdaughter,
"distance");
684 flightDistanceMC = getMCFlightInfoBtw(daughter,
"distance");
686 return flightDistanceMC;
689 double mcFlightTimeOfDaughter(
const Particle* particle,
const std::vector<double>& daughters)
694 long daughterNumber = -1;
695 if (daughters.size() > 0) {
696 daughterNumber = std::lround(daughters[0]);
698 B2ERROR(
"At least one integer, the index of the daughter, must be provided to mcFlightTimeOfDaughter!");
701 int nDaughters =
static_cast<int>(particle->getNDaughters());
702 if (daughterNumber >= nDaughters) {
703 B2ERROR(
"The daughter index provided to mcFlightTimeOfDaughter is larger than the number of daughters of this particle!");
707 long grandDaughterNumber = -1;
708 if (daughters.size() == 2) {
709 grandDaughterNumber = std::lround(daughters[1]);
712 const Particle* daughterReco = particle->getDaughter(daughterNumber);
714 const MCParticle* daughter = daughterReco->getMCParticle();
717 if (grandDaughterNumber > -1 && grandDaughterNumber < (
int)daughterReco->getNDaughters()) {
719 const MCParticle* gdaughter = daughterReco->getDaughter(grandDaughterNumber)->getMCParticle();
720 flightTimeMC = getMCFlightInfoBtw(gdaughter,
"time");
722 flightTimeMC = getMCFlightInfoBtw(daughter,
"time");
728 VARIABLE_GROUP(
"Flight Information");
729 REGISTER_VARIABLE(
"flightTime", flightTime,
730 "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",
732 REGISTER_VARIABLE(
"flightDistance", flightDistance,
733 "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",
735 REGISTER_VARIABLE(
"flightTimeErr", flightTimeErr,
736 "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",
738 REGISTER_VARIABLE(
"flightDistanceErr", flightDistanceErr,
739 "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",
742 REGISTER_VARIABLE(
"flightTimeOfDaughter(daughterN, gdaughterN = -1)", flightTimeOfDaughter,
743 "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",
745 REGISTER_VARIABLE(
"flightTimeOfDaughterErr(daughterN, gdaughterN = -1)", flightTimeOfDaughterErr,
746 "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",
748 REGISTER_VARIABLE(
"flightDistanceOfDaughter(daughterN, gdaughterN = -1)", flightDistanceOfDaughter,
749 "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",
751 REGISTER_VARIABLE(
"flightDistanceOfDaughterErr(daughterN, gdaughterN = -1)", flightDistanceOfDaughterErr,
752 "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",
755 REGISTER_VARIABLE(
"mcFlightDistance", mcFlightDistance,
756 "Returns the MC flight distance of the particle\n\n",
"cm");
757 REGISTER_VARIABLE(
"mcFlightTime", mcFlightTime,
758 "Returns the MC flight time of the particle\n\n",
"ns");
759 REGISTER_VARIABLE(
"mcFlightDistanceOfDaughter(daughterN, gdaughterN = -1)", mcFlightDistanceOfDaughter,
760 "Returns the MC flight distance between mother and daughter particle using generated info\n\n",
"cm");
761 REGISTER_VARIABLE(
"mcFlightTimeOfDaughter(daughterN, gdaughterN = -1)", mcFlightTimeOfDaughter,
762 "Returns the MC flight time between mother and daughter particle using generated info\n\n",
"ns");
764 REGISTER_VARIABLE(
"vertexDistance", vertexDistance,
765 "Returns 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(
"vertexDistanceErr", vertexDistanceErr,
768 "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",
770 REGISTER_VARIABLE(
"vertexDistanceSignificance", vertexDistanceSignificance,
771 "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.");
772 REGISTER_VARIABLE(
"vertexDistanceOfDaughter(daughterN[, option])", vertexDistanceOfDaughter,
773 "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"
774 "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"
775 "Returns NaN in case anything goes wrong.\n\n",
"cm");
776 REGISTER_VARIABLE(
"vertexDistanceOfDaughterErr(daughterN[, option])", vertexDistanceOfDaughterErr,
777 "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"
778 "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"
779 "Returns NaN in case anything goes wrong.\n\n",
"cm");
780 REGISTER_VARIABLE(
"vertexDistanceOfDaughterSignificance(daughterN[, option)", vertexDistanceOfDaughterSignificance,
781 "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"
782 "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
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.