8#include <tracking/dataobjects/RecoTrack.h>
9#include <mdst/dataobjects/MCParticle.h>
11#include <genfit/TrackCand.h>
12#include <genfit/AbsTrackRep.h>
13#include <genfit/KalmanFitterInfo.h>
14#include <genfit/KalmanFitStatus.h>
15#include <genfit/WireTrackCandHit.h>
16#include <genfit/RKTrackRep.h>
17#include <genfit/MplTrackRep.h>
18#include <simulation/monopoles/MonopoleConstants.h>
19#include <svd/dataobjects/SVDCluster.h>
26 const short int seedCharge,
27 const std::string& storeArrayNameOfPXDHits,
28 const std::string& storeArrayNameOfSVDHits,
29 const std::string& storeArrayNameOfCDCHits,
30 const std::string& storeArrayNameOfBKLMHits,
31 const std::string& storeArrayNameOfEKLMHits,
32 const std::string& storeArrayNameOfRecoHitInformation) :
34 m_storeArrayNameOfPXDHits(storeArrayNameOfPXDHits),
35 m_storeArrayNameOfSVDHits(storeArrayNameOfSVDHits),
36 m_storeArrayNameOfCDCHits(storeArrayNameOfCDCHits),
37 m_storeArrayNameOfBKLMHits(storeArrayNameOfBKLMHits),
38 m_storeArrayNameOfEKLMHits(storeArrayNameOfEKLMHits),
39 m_storeArrayNameOfRecoHitInformation(storeArrayNameOfRecoHitInformation)
43 TMatrixDSym covSeed(6);
47 covSeed(3, 3) = 0.01e-3;
48 covSeed(4, 4) = 0.01e-3;
49 covSeed(5, 5) = 0.04e-3;
55 std::string
const& pxdHitsStoreArrayName,
56 std::string
const& svdHitsStoreArrayName,
57 std::string
const& cdcHitsStoreArrayName,
58 std::string
const& bklmHitsStoreArrayName,
59 std::string
const& eklmHitsStoreArrayName,
60 std::string
const& recoHitInformationStoreArrayName)
98 const std::string& storeArrayNameOfRecoTracks,
99 const std::string& storeArrayNameOfPXDHits,
100 const std::string& storeArrayNameOfSVDHits,
101 const std::string& storeArrayNameOfCDCHits,
102 const std::string& storeArrayNameOfBKLMHits,
103 const std::string& storeArrayNameOfEKLMHits,
104 const std::string& storeArrayNameOfRecoHitInformation,
105 const bool recreateSortingParameters
118 const ROOT::Math::XYZVector& position = ROOT::Math::XYZVector(trackCand.getPosSeed());
119 const ROOT::Math::XYZVector& momentum = ROOT::Math::XYZVector(trackCand.getMomSeed());
120 const short int charge = trackCand.getChargeSeed();
121 const double time = trackCand.getTimeSeed();
126 recoHitInformations.
getName());
130 TMatrixDSym covSeed(6);
131 covSeed(0, 0) = 1e-3;
132 covSeed(1, 1) = 1e-3;
133 covSeed(2, 2) = 4e-3;
134 covSeed(3, 3) = 0.01e-3;
135 covSeed(4, 4) = 0.01e-3;
136 covSeed(5, 5) = 0.04e-3;
139 for (
unsigned int hitIndex = 0; hitIndex < trackCand.getNHits(); hitIndex++) {
140 genfit::TrackCandHit* trackCandHit = trackCand.getHit(hitIndex);
141 const int detID = trackCandHit->getDetId();
142 const int hitID = trackCandHit->getHitId();
143 const unsigned int sortingParameter = recreateSortingParameters ? hitIndex :
static_cast<unsigned int>
144 (trackCandHit->getSortingParameter());
145 if (detID == Const::CDC) {
148 const genfit::WireTrackCandHit* wireHit =
dynamic_cast<const genfit::WireTrackCandHit*
>(trackCandHit);
150 B2FATAL(
"CDC hit is not a wire hit. The RecoTrack can not handle such a case.");
152 if (wireHit->getLeftRightResolution() > 0) {
153 newRecoTrack->
addCDCHit(cdcHit, sortingParameter, RecoHitInformation::RightLeftInformation::c_right);
154 }
else if (wireHit->getLeftRightResolution() < 0) {
155 newRecoTrack->
addCDCHit(cdcHit, sortingParameter, RecoHitInformation::RightLeftInformation::c_left);
157 newRecoTrack->
addCDCHit(cdcHit, sortingParameter, RecoHitInformation::RightLeftInformation::c_undefinedRightLeftInformation);
160 }
else if (detID == Const::SVD) {
162 newRecoTrack->
addSVDHit(svdHit, sortingParameter);
163 }
else if (detID == Const::PXD) {
165 newRecoTrack->
addPXDHit(pxdHit, sortingParameter);
166 }
else if (detID == Const::BKLM) {
168 newRecoTrack->
addBKLMHit(bklmHit, sortingParameter);
169 }
else if (detID == Const::EKLM) {
171 newRecoTrack->
addEKLMHit(eklmHit, sortingParameter);
180 genfit::TrackCand createdTrackCand;
190 createdTrackCand.addHit(Const::PXD, hit->getArrayIndex(), -1, hitInformation.
getSortingParameter());
194 createdTrackCand.addHit(Const::SVD, hit->getArrayIndex(), -1, hitInformation.
getSortingParameter());
199 createdTrackCand.addHit(new genfit::WireTrackCandHit(Const::CDC, hit->getArrayIndex(), -1,
200 hitInformation.getSortingParameter(), -1));
202 createdTrackCand.addHit(new genfit::WireTrackCandHit(Const::CDC, hit->getArrayIndex(), -1,
203 hitInformation.getSortingParameter(), 1));
205 createdTrackCand.addHit(new genfit::WireTrackCandHit(Const::CDC, hit->getArrayIndex(), -1,
206 hitInformation.getSortingParameter(), 0));
211 createdTrackCand.addHit(Const::BKLM, hit->getArrayIndex(), -1, hitInformation.
getSortingParameter());
215 createdTrackCand.addHit(Const::EKLM, hit->getArrayIndex(), -1, hitInformation.
getSortingParameter());
218 createdTrackCand.sortHits();
221 const MCParticle* relatedMCParticle = getRelatedTo<MCParticle>();
222 if (relatedMCParticle) {
223 createdTrackCand.setMcTrackId(relatedMCParticle->
getArrayIndex());
227 return createdTrackCand;
233 if (createdTrackPointID == -1) {
241 std::optional<double> optionalMinimalWeight)
243 size_t hitsCopied = 0;
245 unsigned int maximalSortingParameter = 0;
252 const auto& maximalElement = std::max_element(recoHitInformations.begin(), recoHitInformations.end(), sortBySP);
253 if (maximalElement != recoHitInformations.end()) {
254 maximalSortingParameter = (*maximalElement)->getSortingParameter();
259 const auto calculateSortingParameter = [maximalSortingParameter, sortingParameterOffset](
unsigned int sortingParameters) {
260 if (maximalSortingParameter > 0) {
261 return maximalSortingParameter - sortingParameters + sortingParameterOffset;
263 return sortingParameters + sortingParameterOffset;
266 const auto testHitWeight = [recoTrack, optionalMinimalWeight](
const RecoHitInformation * recoHitInformation) {
267 if (not optionalMinimalWeight) {
270 double minimalWeight = *optionalMinimalWeight;
273 genfit::KalmanFitterInfo* kalmanFitterInfo = trackPoint->getKalmanFitterInfo();
274 if (not kalmanFitterInfo) {
277 const std::vector<double>& weights = kalmanFitterInfo->getWeights();
278 const auto checkWeight = [minimalWeight](
const double weight) {
279 return weight >= minimalWeight;
281 return std::any_of(weights.begin(), weights.end(), checkWeight);
289 if (testHitWeight(recoHitInfo)) {
290 hitsCopied +=
addPXDHit(pxdHit, calculateSortingParameter(recoHitInfo->getSortingParameter()),
291 recoHitInfo->getFoundByTrackFinder());
298 if (testHitWeight(recoHitInfo)) {
299 hitsCopied +=
addSVDHit(svdHit, calculateSortingParameter(recoHitInfo->getSortingParameter()),
300 recoHitInfo->getFoundByTrackFinder());
307 if (testHitWeight(recoHitInfo)) {
308 hitsCopied +=
addCDCHit(cdcHit, calculateSortingParameter(recoHitInfo->getSortingParameter()),
309 recoHitInfo->getRightLeftInformation(),
310 recoHitInfo->getFoundByTrackFinder());
317 if (testHitWeight(recoHitInfo)) {
318 hitsCopied +=
addBKLMHit(bklmHit, calculateSortingParameter(recoHitInfo->getSortingParameter()),
319 recoHitInfo->getFoundByTrackFinder());
326 if (testHitWeight(recoHitInfo)) {
327 hitsCopied +=
addEKLMHit(eklmHit, calculateSortingParameter(recoHitInfo->getSortingParameter()),
328 recoHitInfo->getFoundByTrackFinder());
352 if (not fs->isFitConverged()) {
357 if (not
dynamic_cast<const genfit::KalmanFitStatus*
>(fs)) {
363 for (
unsigned int i = 0; i < trackSize; i++) {
367 }
catch (
const genfit::Exception& exception) {
368 B2DEBUG(29,
"Can not get mSoP because of: " << exception.what());
379 std::vector<RelationEntry> relatedRecoHitInformations = getRelationsWith<RecoHitInformation>
381 std::sort(relatedRecoHitInformations.begin(), relatedRecoHitInformations.end(), [](
const RelationEntry & lhs,
383 return dynamic_cast<RecoHitInformation*>(lhs.object)->getSortingParameter() > dynamic_cast<RecoHitInformation*>
384 (rhs.object)->getSortingParameter();
388 for (
unsigned int i = 1; i < relatedRecoHitInformations.size() - 1; ++i) {
389 dynamic_cast<RecoHitInformation*
>(relatedRecoHitInformations[i].object)->setFlag(RecoHitInformation::RecoHitFlag::c_pruned);
390 dynamic_cast<RecoHitInformation*
>(relatedRecoHitInformations[i].object)->setCreatedTrackPointID(-1);
415 if (trackRepresentation ==
nullptr) {
416 if (PDGcode == Monopoles::c_monopolePDGCode) {
417 trackRepresentation =
new genfit::MplTrackRep(PDGcode, Monopoles::monopoleMagCharge);
419 trackRepresentation =
new genfit::RKTrackRep(PDGcode);
423 return trackRepresentation;
427 const genfit::AbsTrackRep* representation)
430 const unsigned int numberOfPoints =
m_genfitTrack.getNumPointsWithMeasurement();
432 assert(numberOfPoints > 0);
434 const genfit::MeasuredStateOnPlane* nearestStateOnPlane =
nullptr;
435 double minimalDistance2 = 0;
436 for (
unsigned int hitIndex = 0; hitIndex < numberOfPoints; hitIndex++) {
438 const genfit::MeasuredStateOnPlane& measuredStateOnPlane =
m_genfitTrack.getFittedState(hitIndex, representation);
440 const double currentDistance2 = (ROOT::Math::XYZVector(measuredStateOnPlane.getPos()) - closestPoint).Mag2();
442 if (not nearestStateOnPlane or currentDistance2 < minimalDistance2) {
443 nearestStateOnPlane = &measuredStateOnPlane;
444 minimalDistance2 = currentDistance2;
446 }
catch (
const genfit::Exception& exception) {
447 B2DEBUG(50,
"Can not get mSoP because of: " << exception.what());
453 if (not nearestStateOnPlane) {
454 B2WARNING(
"Non of the track hits had a MeasuredStateOnPlane! Exception thrown.");
455 throw NoStateOnPlaneFound();
458 return *nearestStateOnPlane;
478 B2FATAL(
"Only positive pdgCode is possible when calling getTrackRepresentationForPDG, got " << pdgCode);
483 for (genfit::AbsTrackRep* trackRepresentation : trackRepresentations) {
485 const genfit::RKTrackRep* rkTrackRepresenation =
dynamic_cast<const genfit::RKTrackRep*
>(trackRepresentation);
486 if (rkTrackRepresenation !=
nullptr) {
488 if (std::abs(rkTrackRepresenation->getPDG()) == pdgCode) {
489 return trackRepresentation;
505 return std::make_tuple(ROOT::Math::XYZVector(measuredStateOnPlane.getPos()), ROOT::Math::XYZVector(measuredStateOnPlane.getMom()),
506 measuredStateOnPlane.getCharge());
511 const ROOT::Math::XYZVector& position,
const ROOT::Math::XYZVector& momentum,
short charge,
512 const TMatrixDSym& covariance,
double timeSeed)
const
534 ROOT::Math::XYZVector(mSoP.getPos()),
535 ROOT::Math::XYZVector(mSoP.getMom()),
536 static_cast<short>(mSoP.getCharge()),
537 mSoP.get6DCov(), mSoP.getTime());
559 std::vector<RecoHitInformation*> hitList;
563 hitList.reserve(recoHitInformations.
size());
564 for (
auto& recoHit : recoHitInformations) {
565 hitList.push_back(&recoHit);
572 return a->getSortingParameter() < b->getSortingParameter();
580 const genfit::AbsTrackRep* representation)
const
585 B2FATAL(
"MeasuredStateOnPlane can not be retrieved for RecoTracks where no fit has been attempted.");
589 B2FATAL(
"MeasuredStateOnPlane cannot be provided for RecoHit which was not used in the fit.");
593 if (not hitTrackPoint) {
594 B2FATAL(
"TrackPoint was requested which has not been created");
597 const auto* fittedResult = hitTrackPoint->getFitterInfo(representation);
598 if (not fittedResult) {
599 throw NoTrackFitResult();
602 return fittedResult->getFittedState();
608 for (
unsigned int i = 0; i < trackSize; i++) {
611 }
catch (
const genfit::Exception& exception) {
612 B2DEBUG(28,
"Can not get mSoP because of: " << exception.what());
616 B2FATAL(
"There is no single hit with a valid mSoP in this track! Check if the fit failed with wasFitSuccessful before");
622 for (
int i = -1; i >= -trackSize; i--) {
625 }
catch (
const genfit::Exception& exception) {
626 B2DEBUG(28,
"Can not get mSoP because of: " << exception.what());
630 B2FATAL(
"There is no single hit with a valid mSoP in this track!");
637 bool svdDone =
false;
643 float clusterTimeSum = 0;
644 float clusterTimeSigma2Sum = 0;
645 bool trackArmTimeDone =
false;
648 for (
const auto& recoHit : recoHits) {
650 if (!svdDone && foundin != SVD) {
652 trackArmTimeDone =
false;
654 if (foundin == SVD) {
656 clusterTimeSum += svdClusters[0]->getClsTime();
657 clusterTimeSigma2Sum += svdClusters[0]->getClsTimeSigma() * svdClusters[0]->getClsTimeSigma();
662 if (svdDone && nSVDHits > 1) {
676 detIDpre = detIDpost;
680 trackArmTimeDone =
true;
687 if (!trackArmTimeDone && (recoHit == recoHits.back()) && nSVDHits > 1) {
708 bool isOutgoing =
true;
709 if (pre == PXD && post == CDC) isOutgoing =
true;
710 else if (pre == und && post == CDC) isOutgoing =
true;
711 else if (pre == PXD && post == und) isOutgoing =
true;
712 else if (pre == CDC && post == PXD) isOutgoing =
false;
713 else if (pre == und && post == PXD) isOutgoing =
false;
714 else if (pre == CDC && post == und) isOutgoing =
false;
718 "SVD-only? PXD-SVD-PXD??? --- use layer information to determine if the track arm is outgoing or ingoing! Considered --> 'OUT'");
727 const ROOT::Math::XYZVector& fittedPosition = ROOT::Math::XYZVector(measuredStateOnPlane.getPos());
728 const ROOT::Math::XYZVector& fittedMomentum = ROOT::Math::XYZVector(measuredStateOnPlane.getMom());
729 const double& fittedCharge = measuredStateOnPlane.getCharge();
741 std::stringstream out;
752 out <<
"<b>was fitted with " << rep->getPDG() <<
"</b>=" <<
wasFitSuccessful() <<
", ";
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
This dataobject is used only for EKLM alignment.
A Class to store the Monte Carlo particle information.
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
static genfit::Track & getGenfitTrack(RecoTrack &recoTrack)
Give access to the RecoTrack's genfit::Track.
static void swapGenfitTrack(RecoTrack &recoTrack, const genfit::Track *track)
Set the genfit track of a Recotrack copying the information from another genfit track.
static genfit::AbsTrackRep * createOrReturnRKTrackRep(RecoTrack &recoTrack, int PDGcode)
Checks if a TrackRap for the PDG id of the RecoTrack (and its charge conjugate) does already exit and...
This is the Reconstruction Event-Data Model Track.
size_t addHitsFromRecoTrack(const RecoTrack *recoTrack, unsigned int sortingParameterOffset=0, bool reversed=false, std::optional< double > optionalMinimalWeight=std::nullopt)
Add all hits from another RecoTrack to this RecoTrack.
void setChargeSeed(const short int chargeSeed)
Set the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
const std::vector< genfit::AbsTrackRep * > & getRepresentations() const
Return a list of track representations. You are not allowed to modify or delete them!
const TMatrixDSym & getSeedCovariance() const
Return the covariance matrix of the seed. ATTENTION: This is not the fitted covariance.
bool addBKLMHit(const UsedBKLMHit *bklmHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a bklm hit with the given information to the reco track.
bool addCDCHit(const UsedCDCHit *cdcHit, const unsigned int sortingParameter, RightLeftInformation rightLeftInformation=RightLeftInformation::c_undefinedRightLeftInformation, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a cdc hit with the given information to the reco track.
void deleteFittedInformation()
Delete all fitted information for all representations.
std::vector< Belle2::RecoTrack::UsedPXDHit * > getPXDHitList() const
Return an unsorted list of pxd hits.
float m_ingoingArmTimeError
Error of the track time of the ingoing arm.
const std::string & getStoreArrayNameOfEKLMHits() const
Name of the store array of the eklm hits.
bool wasFitSuccessful(const genfit::AbsTrackRep *representation=nullptr) const
Returns true if the last fit with the given representation was successful.
std::vector< Belle2::RecoTrack::UsedSVDHit * > getSVDHitList() const
Return an unsorted list of svd hits.
static RecoTrack * createFromTrackCand(const genfit::TrackCand &trackCand, const std::string &storeArrayNameOfRecoTracks="", const std::string &storeArrayNameOfPXDHits="", const std::string &storeArrayNameOfSVDHits="", const std::string &storeArrayNameOfCDCHits="", const std::string &storeArrayNameOfBKLMHits="", const std::string &storeArrayNameOfEKLMHits="", const std::string &storeArrayNameOfRecoHitInformation="", const bool recreateSortingParameters=false)
Create a reco track from a genfit::TrackCand and save it to the given store array.
void setPositionAndMomentum(const ROOT::Math::XYZVector &positionSeed, const ROOT::Math::XYZVector &momentumSeed)
Set the position and momentum seed of the reco track. ATTENTION: This is not the fitted position or m...
std::string m_storeArrayNameOfCDCHits
Store array name of added CDC hits.
bool addEKLMHit(const UsedEKLMHit *eklmHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds an eklm hit with the given information to the reco track.
bool addPXDHit(const UsedPXDHit *pxdHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a pxd hit with the given information to the reco track.
std::vector< Belle2::RecoTrack::UsedBKLMHit * > getBKLMHitList() const
Return an unsorted list of bklm hits.
std::vector< Belle2::RecoTrack::UsedCDCHit * > getCDCHitList() const
Return an unsorted list of cdc hits.
const std::string & getStoreArrayNameOfSVDHits() const
Name of the store array of the svd hits.
void estimateArmTime()
This function calculates the track time of the ingoing and outgoing arms and their difference.
ROOT::Math::XYZVector getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
bool m_hasIngoingArmTime
Internal storage of the final ingoing arm time is set.
std::tuple< ROOT::Math::XYZVector, ROOT::Math::XYZVector, short > extractTrackState() const
Return the position, the momentum and the charge of the first measured state on plane or - if unfitte...
int m_nSVDHitsOfOutgoingArm
Number of SVD clusters of the outgoing arm.
bool m_hasOutgoingArmTime
Internal storage of the final outgoing arm time is set.
const std::string & getStoreArrayNameOfPXDHits() const
Name of the store array of the pxd hits.
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlaneClosestTo(const ROOT::Math::XYZVector &closestPoint, const genfit::AbsTrackRep *representation=nullptr)
Return genfit's MasuredStateOnPlane, that is closest to the given point useful for extrapolation of m...
float m_outgoingArmTime
Track time of the outgoing arm.
void setDirtyFlag(const bool &dirtyFlag=true)
Set to true, if you want to rebuild the measurements and do the fit independent on changes of the hit...
std::string m_storeArrayNameOfBKLMHits
Store array name of added BKLM hits.
std::string getInfoHTML() const override
Get useful information on EventDisplay.
void prune()
Prune the genfit track, e.g.
std::vector< Belle2::RecoTrack::UsedEKLMHit * > getEKLMHitList() const
Return an unsorted list of eklm hits.
RecoTrack * copyToStoreArrayUsingSeeds(StoreArray< RecoTrack > &storeArray) const
Append a new RecoTrack to the given store array and copy its general properties, but not the hits the...
const std::string & getStoreArrayNameOfBKLMHits() const
Name of the store array of the bklm hits.
void setTimeSeed(const double timeSeed)
Set the time seed. ATTENTION: This is not the fitted time.
genfit::TrackCand createGenfitTrackCand() const
Create a genfit::TrackCand out of this reco track and copy all information to the track candidate.
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlaneFromLastHit(const genfit::AbsTrackRep *representation=nullptr) const
Return genfit's MeasuredStateOnPlane for the last hit in a fit useful for extrapolation of measuremen...
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
const std::string & getStoreArrayNameOfRecoHitInformation() const
Name of the store array of the reco hit information.
bool hasTrackFitStatus(const genfit::AbsTrackRep *representation=nullptr) const
Check, if there is a fit status for the given representation or for the cardinal one.
int m_nSVDHitsOfIngoingArm
Number of SVD clusters of the ingoing arm.
RecoHitInformation * getRecoHitInformation(HitType *hit) const
Return the reco hit information for a generic hit from the storeArray.
RecoTrack * copyToStoreArray(StoreArray< RecoTrack > &storeArray) const
Append a new RecoTrack to the given store array and copy its general properties, but not the hits the...
RecoTrack * copyToStoreArrayUsing(StoreArray< RecoTrack > &storeArray, const ROOT::Math::XYZVector &position, const ROOT::Math::XYZVector &momentum, short charge, const TMatrixDSym &covariance, double timeSeed) const
Append a new RecoTrack to the given store array and copy its general properties, but not the hits the...
const genfit::TrackPoint * getCreatedTrackPoint(const RecoHitInformation *recoHitInformation) const
Get a pointer to the TrackPoint that was created from this hit.
std::vector< RecoHitInformation * > getRecoHitInformations(bool getSorted=false) const
Return a list of all RecoHitInformations associated with the RecoTrack.
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
bool m_isArmTimeComputed
true if the arms times are already computed, false otherwise
std::string m_storeArrayNameOfSVDHits
Store array name of added SVD hits.
const std::string & getStoreArrayNameOfCDCHits() const
Name of the store array of the cdc hits.
float m_ingoingArmTime
Track time of the ingoing arm.
void flipTrackDirectionAndCharge(const genfit::AbsTrackRep *representation=nullptr)
Flip the direction of the RecoTrack by inverting the momentum vector and the charge.
void revertRecoHitInformationSorting()
Revert the sorting order of the RecoHitInformation.
void deleteFittedInformationForRepresentation(const genfit::AbsTrackRep *rep)
Delete all fitted information for the given representations.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
float m_outgoingArmTimeError
Error of the track time of the outgoing arm.
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlaneFromFirstHit(const genfit::AbsTrackRep *representation=nullptr) const
Return genfit's MeasuredStateOnPlane for the first hit in a fit useful for extrapolation of measureme...
ROOT::Math::XYZVector getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
genfit::AbsTrackRep * getTrackRepresentationForPDG(int pdgCode) const
Return an already created track representation of the given reco track for the PDG.
genfit::Track m_genfitTrack
Internal storage for the genfit track.
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlaneFromRecoHit(const RecoHitInformation *recoHitInfo, const genfit::AbsTrackRep *representation=nullptr) const
Return genfit's MeasuredStateOnPlane on plane for associated with one RecoHitInformation.
std::string m_storeArrayNameOfEKLMHits
Store array name of added EKLM hits.
RecoTrack()
Empty constructor for ROOT. Do not use!
std::string m_storeArrayNameOfPXDHits
Store array name of added PXD hits.
bool addSVDHit(const UsedSVDHit *svdHit, const unsigned int sortingParameter, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a svd hit with the given information to the reco track.
void checkDirtyFlag() const
Helper: Check the dirty flag and produce a warning, whenever a fit result is accessed.
bool isOutgoingArm(RecoHitInformation::RecoHitDetector pre=RecoHitInformation::RecoHitDetector::c_undefinedTrackingDetector, RecoHitInformation::RecoHitDetector post=RecoHitInformation::RecoHitDetector::c_undefinedTrackingDetector)
This function returns true if the arm direction is Outgoing and false if the arm direction is Ingoing...
const genfit::FitStatus * getTrackFitStatus(const genfit::AbsTrackRep *representation=nullptr) const
Return the track fit status for the given representation or for the cardinal one. You are not allowed...
double getTimeSeed() const
Return the time seed stored in the reco track. ATTENTION: This is not the fitted time.
const std::vector< genfit::TrackPoint * > & getHitPointsWithMeasurement() const
Return a list of measurements and track points, which can be used e.g. to extrapolate....
std::string m_storeArrayNameOfRecoHitInformation
Store array of added RecoHitInformation.
void swapArmTimes()
Swap arm times, booleans and nSVDHits.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
static constexpr auto XYZToTVector
Helper function to convert XYZVector to TVector3.
Abstract base class for different kinds of events.