11#include <framework/datastore/StoreArray.h>
12#include <framework/datastore/RelationsObject.h>
13#include <framework/core/FrameworkExceptions.h>
14#include <framework/geometry/VectorUtil.h>
16#include <genfit/Track.h>
18#include <tracking/dataobjects/RecoHitInformation.h>
20#include <Math/Vector3D.h>
37 class RecoTrackGenfitAccess;
39 BELLE2_DEFINE_EXCEPTION(NoTrackFitResult,
"No track fit result available for this hit (e.g. DAF has removed it).")
108 c_matchedWrongCharge,
130 static void registerRequiredRelations(
132 std::string
const& pxdHitsStoreArrayName =
"",
133 std::string
const& svdHitsStoreArrayName =
"",
134 std::string
const& cdcHitsStoreArrayName =
"",
135 std::string
const& bklmHitsStoreArrayName =
"",
136 std::string
const& eklmHitsStoreArrayName =
"",
137 std::string
const& recoHitInformationStoreArrayName =
"");
155 RecoTrack(
const ROOT::Math::XYZVector& seedPosition,
const ROOT::Math::XYZVector& seedMomentum,
const short int seedCharge,
156 const std::string& storeArrayNameOfPXDHits =
"",
157 const std::string& storeArrayNameOfSVDHits =
"",
158 const std::string& storeArrayNameOfCDCHits =
"",
159 const std::string& storeArrayNameOfBKLMHits =
"",
160 const std::string& storeArrayNameOfEKLMHits =
"",
161 const std::string& storeArrayNameOfRecoHitInformation =
"");
183 static RecoTrack* createFromTrackCand(
const genfit::TrackCand& trackCand,
184 const std::string& storeArrayNameOfRecoTracks =
"",
185 const std::string& storeArrayNameOfPXDHits =
"",
186 const std::string& storeArrayNameOfSVDHits =
"",
187 const std::string& storeArrayNameOfCDCHits =
"",
188 const std::string& storeArrayNameOfBKLMHits =
"",
189 const std::string& storeArrayNameOfEKLMHits =
"",
190 const std::string& storeArrayNameOfRecoHitInformation =
"",
191 const bool recreateSortingParameters =
false
197 genfit::TrackCand createGenfitTrackCand()
const;
204 const ROOT::Math::XYZVector& momentum,
short charge,
205 const TMatrixDSym& covariance,
double timeSeed)
const;
231 size_t addHitsFromRecoTrack(
const RecoTrack* recoTrack,
unsigned int sortingParameterOffset = 0,
232 bool reversed =
false, std::optional<double> optionalMinimalWeight = std::nullopt);
244 RightLeftInformation rightLeftInformation = RightLeftInformation::c_undefinedRightLeftInformation,
245 OriginTrackFinder foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder)
247 return addHit(cdcHit, rightLeftInformation, foundByTrackFinder, sortingParameter);
259 OriginTrackFinder foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder)
261 return addHit(pxdHit, foundByTrackFinder, sortingParameter);
273 OriginTrackFinder foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder)
275 return addHit(svdHit, foundByTrackFinder, sortingParameter);
287 OriginTrackFinder foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder)
289 return addHit(bklmHit, foundByTrackFinder, sortingParameter);
301 OriginTrackFinder foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder)
303 return addHit(eklmHit, foundByTrackFinder, sortingParameter);
311 template<
class HitType>
315 (m_storeArrayNameOfRecoHitInformation);
319 if (recoHitInformation.getRelatedFrom<
RecoTrack>(this->getArrayName()) ==
this) {
321 return &recoHitInformation;
330 template <
class HitType>
338 template <
class HitType>
346 template <
class HitType>
354 template <
class HitType>
362 template <
class HitType>
371 template <
class HitType>
379 template <
class HitType>
391 const genfit::TrackPoint* getCreatedTrackPoint(
const RecoHitInformation* recoHitInformation)
const;
395 bool hasPXDHits()
const {
return getRelatedFrom<UsedPXDHit>(m_storeArrayNameOfPXDHits) !=
nullptr; }
398 bool hasSVDHits()
const {
return getRelatedFrom<UsedSVDHit>(m_storeArrayNameOfSVDHits) !=
nullptr; }
401 bool hasCDCHits()
const {
return getRelatedFrom<UsedCDCHit>(m_storeArrayNameOfCDCHits) !=
nullptr; }
404 bool hasBKLMHits()
const {
return getRelatedFrom<UsedBKLMHit>(m_storeArrayNameOfBKLMHits) !=
nullptr; }
407 bool hasEKLMHits()
const {
return getRelatedFrom<UsedEKLMHit>(m_storeArrayNameOfEKLMHits) !=
nullptr; }
410 template <
class HitType>
414 return std::find_if(relatedTracksToHit.
begin(), relatedTracksToHit.
end(), [
this](
const RecoTrack & recoTrack) {
415 return &recoTrack == this;
416 }) != relatedTracksToHit.
end();
421 unsigned int getNumberOfPXDHits()
const {
return getNumberOfHitsOfGivenType<UsedPXDHit>(m_storeArrayNameOfPXDHits); }
424 unsigned int getNumberOfSVDHits()
const {
return getNumberOfHitsOfGivenType<UsedSVDHit>(m_storeArrayNameOfSVDHits); }
427 unsigned int getNumberOfCDCHits()
const {
return getNumberOfHitsOfGivenType<UsedCDCHit>(m_storeArrayNameOfCDCHits); }
430 unsigned int getNumberOfBKLMHits()
const {
return getNumberOfHitsOfGivenType<UsedBKLMHit>(m_storeArrayNameOfBKLMHits); }
433 unsigned int getNumberOfEKLMHits()
const {
return getNumberOfHitsOfGivenType<UsedEKLMHit>(m_storeArrayNameOfEKLMHits); }
438 return getNumberOfPXDHits() + getNumberOfSVDHits() + getNumberOfCDCHits() +
439 getNumberOfBKLMHits() + getNumberOfEKLMHits();
445 return getNumberOfPXDHits() + getNumberOfSVDHits() + getNumberOfCDCHits();
449 std::vector<Belle2::RecoTrack::UsedPXDHit*>
getPXDHitList()
const {
return getHitList<UsedPXDHit>(m_storeArrayNameOfPXDHits); }
452 std::vector<Belle2::RecoTrack::UsedSVDHit*>
getSVDHitList()
const {
return getHitList<UsedSVDHit>(m_storeArrayNameOfSVDHits); }
455 std::vector<Belle2::RecoTrack::UsedCDCHit*>
getCDCHitList()
const {
return getHitList<UsedCDCHit>(m_storeArrayNameOfCDCHits); }
458 std::vector<Belle2::RecoTrack::UsedBKLMHit*>
getBKLMHitList()
const {
return getHitList<UsedBKLMHit>(m_storeArrayNameOfBKLMHits); }
461 std::vector<Belle2::RecoTrack::UsedEKLMHit*>
getEKLMHitList()
const {
return getHitList<UsedEKLMHit>(m_storeArrayNameOfEKLMHits); }
464 std::vector<Belle2::RecoTrack::UsedPXDHit*>
getSortedPXDHitList()
const {
return getSortedHitList<UsedPXDHit>(m_storeArrayNameOfPXDHits); }
467 std::vector<Belle2::RecoTrack::UsedSVDHit*>
getSortedSVDHitList()
const {
return getSortedHitList<UsedSVDHit>(m_storeArrayNameOfSVDHits); }
470 std::vector<Belle2::RecoTrack::UsedCDCHit*>
getSortedCDCHitList()
const {
return getSortedHitList<UsedCDCHit>(m_storeArrayNameOfCDCHits); }
473 std::vector<Belle2::RecoTrack::UsedBKLMHit*>
getSortedBKLMHitList()
const {
return getSortedHitList<UsedBKLMHit>(m_storeArrayNameOfBKLMHits); }
476 std::vector<Belle2::RecoTrack::UsedEKLMHit*>
getSortedEKLMHitList()
const {
return getSortedHitList<UsedEKLMHit>(m_storeArrayNameOfEKLMHits); }
482 const TVectorD& seed = m_genfitTrack.getStateSeed();
483 return ROOT::Math::XYZVector(seed(0), seed(1), seed(2));
489 const TVectorD& seed = m_genfitTrack.getStateSeed();
490 return ROOT::Math::XYZVector(seed(3), seed(4), seed(5));
496 return m_genfitTrack.getStateSeed();
511 double getTimeSeed()
const {
return m_genfitTrack.getTimeSeed(); }
516 if (!m_isArmTimeComputed) estimateArmTime();
517 return m_outgoingArmTime;
523 if (!m_isArmTimeComputed) estimateArmTime();
524 return m_outgoingArmTimeError;
530 if (!m_isArmTimeComputed) estimateArmTime();
531 return m_ingoingArmTime;
537 if (!m_isArmTimeComputed) estimateArmTime();
538 return m_ingoingArmTimeError;
544 if (!m_isArmTimeComputed) estimateArmTime();
545 return m_ingoingArmTime - m_outgoingArmTime;
551 if (!m_isArmTimeComputed) estimateArmTime();
552 return std::sqrt(m_ingoingArmTimeError * m_ingoingArmTimeError + m_outgoingArmTimeError *
553 m_outgoingArmTimeError);
559 return m_hasIngoingArmTime;
565 return m_hasOutgoingArmTime;
571 return m_nSVDHitsOfOutgoingArm;
577 return m_nSVDHitsOfIngoingArm;
584 void flipTrackDirectionAndCharge(
const genfit::AbsTrackRep* representation =
nullptr);
587 std::tuple<ROOT::Math::XYZVector, ROOT::Math::XYZVector, short> extractTrackState()
const;
593 deleteFittedInformation();
599 m_charge = chargeSeed;
600 deleteFittedInformation();
606 m_genfitTrack.setTimeSeed(timeSeed);
607 deleteFittedInformation();
614 void setSeedCovariance(
const TMatrixDSym& seedCovariance) { m_genfitTrack.setCovSeed(seedCovariance); }
618 bool wasFitSuccessful(
const genfit::AbsTrackRep* representation =
nullptr)
const;
621 const genfit::FitStatus*
getTrackFitStatus(
const genfit::AbsTrackRep* representation =
nullptr)
const
624 return m_genfitTrack.getFitStatus(representation);
628 bool hasTrackFitStatus(
const genfit::AbsTrackRep* representation =
nullptr)
const;
634 return m_genfitTrack.getCardinalRep();
641 return m_genfitTrack.getTrackReps();
650 genfit::AbsTrackRep* getTrackRepresentationForPDG(
int pdgCode)
const;
658 std::vector<RecoHitInformation*> getRecoHitInformations(
bool getSorted =
false)
const;
664 const genfit::MeasuredStateOnPlane& getMeasuredStateOnPlaneFromFirstHit(
const genfit::AbsTrackRep* representation =
nullptr)
const;
670 const genfit::MeasuredStateOnPlane& getMeasuredStateOnPlaneFromLastHit(
const genfit::AbsTrackRep* representation =
nullptr)
const;
676 const genfit::MeasuredStateOnPlane& getMeasuredStateOnPlaneFromRecoHit(
const RecoHitInformation* recoHitInfo,
677 const genfit::AbsTrackRep* representation =
nullptr)
const;
682 const genfit::MeasuredStateOnPlane& getMeasuredStateOnPlaneClosestTo(
const ROOT::Math::XYZVector& closestPoint,
683 const genfit::AbsTrackRep* representation =
nullptr);
694 void estimateArmTime();
711 return m_genfitTrack.getPointsWithMeasurement();
724 m_dirtyFlag = dirtyFlag;
726 deleteFittedInformation();
752 const uint recoHitInformationSize = getRecoHitInformations().size();
753 for (
auto RecoHitInfo : getRecoHitInformations()) {
755 RecoHitInfo->setSortingParameter(recoHitInformationSize - RecoHitInfo->getSortingParameter() - 1);
765 template<
class HitType>
771 (m_storeArrayNameOfRecoHitInformation);
774 HitType*
const hit = hitInformation.getRelatedTo<HitType>(storeArrayNameOfHits);
775 if (hit !=
nullptr && pickFunction(hitInformation, hit)) {
776 mapFunction(hitInformation, hit);
787 template<
class HitType>
790 std::function<
bool(
const RecoHitInformation&,
const HitType*)>
const& pickFunction)
const
793 (m_storeArrayNameOfRecoHitInformation);
796 const HitType*
const hit = hitInformation.getRelatedTo<HitType>(storeArrayNameOfHits);
797 if (hit !=
nullptr && pickFunction(hitInformation, hit)) {
798 mapFunction(hitInformation, hit);
808 template<
class HitType>
812 mapOnHits<HitType>(storeArrayNameOfHits, mapFunction, [](
const RecoHitInformation&,
const HitType*) ->
bool {
return true; });
820 template<
class HitType>
822 std::function<
void(
const RecoHitInformation&,
const HitType*)>
const& mapFunction)
const
824 mapOnHits<HitType>(storeArrayNameOfHits, mapFunction, [](
const RecoHitInformation&,
const HitType*) ->
bool {
return true; });
831 return m_matchingStatus;
837 m_matchingStatus = matchingStatus;
843 return m_qualityIndicator;
849 m_qualityIndicator = qualityIndicator;
855 return m_flipqualityIndicator;
861 m_flipqualityIndicator = qualityIndicator;
866 return m_2ndFlipqualityIndicator;
872 m_2ndFlipqualityIndicator = qualityIndicator;
881 void deleteFittedInformation();
890 void deleteFittedInformationForRepresentation(
const genfit::AbsTrackRep* rep);
893 std::string getInfoHTML()
const override;
899 short int m_charge = 1;
901 std::string m_storeArrayNameOfPXDHits =
"";
903 std::string m_storeArrayNameOfSVDHits =
"";
905 std::string m_storeArrayNameOfCDCHits =
"";
907 std::string m_storeArrayNameOfBKLMHits =
"";
909 std::string m_storeArrayNameOfEKLMHits =
"";
911 std::string m_storeArrayNameOfRecoHitInformation =
"";
914 bool m_dirtyFlag =
true;
918 float m_qualityIndicator = NAN;
920 float m_flipqualityIndicator = NAN;
922 float m_2ndFlipqualityIndicator = NAN;
924 float m_outgoingArmTime = NAN;
926 float m_outgoingArmTimeError = NAN;
928 float m_ingoingArmTime = NAN;
930 float m_ingoingArmTimeError = NAN;
932 bool m_isArmTimeComputed =
false;
934 bool m_hasIngoingArmTime =
false;
936 bool m_hasOutgoingArmTime =
false;
938 int m_nSVDHitsOfOutgoingArm = 0;
940 int m_nSVDHitsOfIngoingArm = 0;
948 template<
class HitType,
class ...Args>
949 bool addHit(
const HitType* hit, Args&& ... params)
958 addHitWithHitInformation(hit, newRecoHitInformation);
968 template <
class HitType>
971 hit->addRelationTo(
this);
972 addRelationTo(recoHitInformation);
974 m_isArmTimeComputed =
false;
975 m_hasIngoingArmTime =
false;
976 m_hasOutgoingArmTime =
false;
977 m_outgoingArmTime = NAN;
978 m_ingoingArmTime = NAN;
979 m_outgoingArmTimeError = NAN;
980 m_ingoingArmTimeError = NAN;
986 template <
class HitType>
990 if (recoHitInformation ==
nullptr) {
991 B2FATAL(
"Queried hit is not in the reco track! Did you prune it?");
993 return recoHitInformation;
1001 template <
class HitType>
1004 return getRelationsFrom<HitType>(storeArrayNameOfHits).size();
1011 template<
class HitType>
1015 (m_storeArrayNameOfRecoHitInformation);
1017 std::vector<const RecoHitInformation*> relatedHitInformationAsVector;
1018 relatedHitInformationAsVector.reserve(relatedHitInformation.
size());
1021 relatedHitInformationAsVector.push_back(&hitInformation);
1023 std::sort(relatedHitInformationAsVector.begin(), relatedHitInformationAsVector.end(), [](
const RecoHitInformation * a,
1025 return a->getSortingParameter() < b->getSortingParameter();
1028 std::vector<HitType*> hitList;
1029 hitList.reserve(relatedHitInformationAsVector.size());
1031 HitType* relatedHit = hitInformation->getRelatedTo<HitType>(storeArrayNameOfHits);
1032 if (relatedHit !=
nullptr) {
1033 hitList.push_back(relatedHit);
1043 template<
class HitType>
1044 std::vector<HitType*>
getHitList(
const std::string& storeArrayNameOfHits)
const
1047 std::vector<HitType*> hitList;
1048 hitList.reserve(relatedHits.
size());
1049 for (HitType& hit : relatedHits) {
1051 hitList.push_back(&hit);
1060 std::swap(m_outgoingArmTime, m_ingoingArmTime);
1061 std::swap(m_hasOutgoingArmTime, m_hasIngoingArmTime);
1062 std::swap(m_nSVDHitsOfOutgoingArm, m_nSVDHitsOfIngoingArm);
1069 B2DEBUG(100,
"Dirty flag is set. The result may not be in sync with the latest changes. Refit the track to be sure.");
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.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
This class allows access to the genfit::Track of the RecoTrack.
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.
void setChargeSeed(const short int chargeSeed)
Set the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
RecoTrack & operator=(RecoTrack const &)=delete
Delete the copy construtr.
TrackingDetector getTrackingDetector(const HitType *hit) const
Return the tracking detector of a given hit (every type) or throws an exception of the hit is not rel...
RecoHitInformation::UsedCDCHit UsedCDCHit
Copy the definitions from the RecoHitInformation to this class.
void mapOnHits(const std::string &storeArrayNameOfHits, std::function< void(RecoHitInformation &, HitType *)> const &mapFunction, std::function< bool(const RecoHitInformation &, const HitType *)> const &pickFunction)
Call a function on all hits of the given type in the store array, that are related to this track.
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.
std::vector< Belle2::RecoTrack::UsedSVDHit * > getSortedSVDHitList() const
Return a sorted list of svd hits. Sorted by the sortingParameter.
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.
void mapOnHits(const std::string &storeArrayNameOfHits, std::function< void(RecoHitInformation &, HitType *)> const &mapFunction)
Call a function on all hits of the given type in the store array, that are related to this track.
void mapOnHits(const std::string &storeArrayNameOfHits, std::function< void(const RecoHitInformation &, const HitType *)> const &mapFunction) const
Call a function on all hits of the given type in the store array, that are related to this 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.
float getInOutArmTimeDifference()
Return the difference between the track times of the ingoing and outgoing arms.
std::vector< Belle2::RecoTrack::UsedPXDHit * > getPXDHitList() const
Return an unsorted list of pxd hits.
float getOutgoingArmTime()
Return the track time of the outgoing arm.
bool hasCDCHits() const
Returns true if the track has cdc hits.
unsigned int getNumberOfBKLMHits() const
Return the number of bklm hits.
const std::string & getStoreArrayNameOfEKLMHits() const
Name of the store array of the eklm hits.
void mapOnHits(const std::string &storeArrayNameOfHits, std::function< void(const RecoHitInformation &, const HitType *)> const &mapFunction, std::function< bool(const RecoHitInformation &, const HitType *)> const &pickFunction) const
Call a function on all hits of the given type in the store array, that are related to this track.
std::vector< Belle2::RecoTrack::UsedSVDHit * > getSVDHitList() const
Return an unsorted list of svd hits.
RecoHitInformation::RecoHitDetector TrackingDetector
Copy the definitions from the RecoHitInformation to this class.
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...
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.
void setSortingParameter(const HitType *hit, unsigned int sortingParameter)
Set the sorting parameter or throws an exception of the hit is not related to the 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::UsedCDCHit * > getSortedCDCHitList() const
Return a sorted list of cdc hits. Sorted by the sortingParameter.
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.
ROOT::Math::XYZVector getPositionSeed() const
Return the position seed stored in the reco track. ATTENTION: This is not the fitted position.
RecoHitInformation::UsedEKLMHit UsedEKLMHit
Copy the definitions from the RecoHitInformation to this class.
MatchingStatus
Enum for the matching status of this reco track (set by the matching modules in the tracking package)...
genfit::AbsTrackRep * getCardinalRepresentation() const
Get a pointer to the cardinal track representation. You are not allowed to modify or delete it!
const std::string & getStoreArrayNameOfPXDHits() const
Name of the store array of the pxd hits.
void setRightLeftInformation(const HitType *hit, RightLeftInformation rightLeftInformation)
Set the right left information or throws an exception of the hit is not related to the track....
std::vector< HitType * > getSortedHitList(const std::string &storeArrayNameOfHits) const
Return a sorted list of hits of the given type in the store array that are related to this track.
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::vector< Belle2::RecoTrack::UsedEKLMHit * > getSortedEKLMHitList() const
Return a sorted list of eklm hits. Sorted by the sortingParameter.
unsigned int getNumberOfEKLMHits() const
Return the number of eklm hits.
RightLeftInformation getRightLeftInformation(const HitType *hit) const
Return the right left information of a given hit (every type) or throws an exception of the hit is no...
unsigned int getNumberOfSVDHits() const
Return the number of svd hits.
OriginTrackFinder getFoundByTrackFinder(const HitType *hit) const
Return the found by track finder flag for the given hit (every type) or throws an exception of the hi...
unsigned int getNumberOfCDCHits() const
Return the number of cdc hits.
int getNSVDHitsOfIngoingArm()
Return the number of clusters used to estimate the ingoing arm time.
bool addHit(const HitType *hit, Args &&... params)
Add a generic hit with the given parameters for the reco hit information.
unsigned int getNumberOfTrackingHits() const
Return the number of cdc + svd + pxd hits.
RecoHitInformation::UsedBKLMHit UsedBKLMHit
Copy the definitions from the RecoHitInformation to this class.
float getIngoingArmTimeError()
Return the error of the track time of the ingoing arm.
bool hasHit(const HitType *hit) const
Returns true if the given hit is in the track.
void setMatchingStatus(MatchingStatus matchingStatus)
Set the matching status (used by the TrackMatcher module)
std::vector< Belle2::RecoTrack::UsedEKLMHit * > getEKLMHitList() const
Return an unsorted list of eklm hits.
std::vector< HitType * > getHitList(const std::string &storeArrayNameOfHits) const
Return an unsorted list of hits of the given type in the store array that are related to this track.
RecoTrack(const RecoTrack &)=delete
Delete the copy construtr.
unsigned int getSortingParameter(const HitType *hit) const
Return the sorting parameter for a given hit (every type) or throws an exception of the hit is not re...
RecoHitInformation * getRecoHitInformationSafely(HitType *hit) const
Returns the reco hit information for a given hit or throws an exception if the hit is not related to ...
bool hasPXDHits() const
Returns true if the track has pxd hits.
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.
bool hasOutgoingArmTime()
Check if the outgoing arm time is set.
unsigned int getNumberOfHitsOfGivenType(const std::string &storeArrayNameOfHits) const
Get the number of hits for the given hit type in the store array that are related to this track.
float getOutgoingArmTimeError()
Return the error of the track time of the outgoing arm.
void setFoundByTrackFinder(const HitType *hit, OriginTrackFinder originTrackFinder)
Set the found by track finder flag or throws an exception of the hit is not related to the track.
float getIngoingArmTime()
Return the track time of the ingoing arm.
bool hasEKLMHits() const
Returns true if the track has eklm hits.
ClassDefOverride(RecoTrack, 14)
Making this class a ROOT class.
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
float getQualityIndicator() const
Get the quality index attached to this RecoTrack given by one of the reconstruction algorithms....
const std::string & getStoreArrayNameOfRecoHitInformation() const
Name of the store array of the reco hit information.
float get2ndFlipQualityIndicator() const
Get the 2nd flipping quality attached to this RecoTrack as a reference for flipping.
void set2ndFlipQualityIndicator(const float qualityIndicator)
Set the 2nd flipping quality attached to this RecoTrack.
RecoHitInformation * getRecoHitInformation(HitType *hit) const
Return the reco hit information for a generic hit from the storeArray.
void setFlipQualityIndicator(const float qualityIndicator)
Set the 1st flipping quality attached to this RecoTrack.
void addHitWithHitInformation(const HitType *hit, RecoHitInformation *recoHitInformation)
Add the needed relations for adding a generic hit with the given hit information and reset track time...
void setQualityIndicator(const float qualityIndicator)
Set the quality index attached to this RecoTrack. 0 means likely fake.
MatchingStatus getMatchingStatus() const
Return the matching status set by the TrackMatcher module.
std::vector< Belle2::RecoTrack::UsedBKLMHit * > getSortedBKLMHitList() const
Return a sorted list of bklm hits. Sorted by the sortingParameter.
const std::string & getStoreArrayNameOfCDCHits() const
Name of the store array of the cdc hits.
std::vector< Belle2::RecoTrack::UsedPXDHit * > getSortedPXDHitList() const
Return a sorted list of pxd hits. Sorted by the sortingParameter.
float getInOutArmTimeDifferenceError()
Return the error of the difference between the track times of the ingoing and outgoing arms.
bool getDirtyFlag() const
This returns true, if a hit was added after the last fit and measurement creation and a refit should ...
void revertRecoHitInformationSorting()
Revert the sorting order of the RecoHitInformation.
bool hasBKLMHits() const
Returns true if the track has bklm hits.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
bool hasIngoingArmTime()
Check if the ingoing arm time is set.
float getFlipQualityIndicator() const
Get the 1st flipping quality attached to this RecoTrack as a reference for flipping.
RecoHitInformation::RightLeftInformation RightLeftInformation
Copy the definitions from the RecoHitInformation to this class.
RecoHitInformation::OriginTrackFinder OriginTrackFinder
Copy the definitions from the RecoHitInformation to this class.
const TVectorD & getStateSeed() const
Return the state seed in the form posX, posY, posZ, momX, momY, momZ. ATTENTION: This is not the fitt...
ROOT::Math::XYZVector getMomentumSeed() const
Return the momentum seed stored in the reco track. ATTENTION: This is not the fitted momentum.
genfit::Track m_genfitTrack
Internal storage for the genfit track.
int getNSVDHitsOfOutgoingArm()
Return the number of clusters used to estimate the outgoing arm time.
RecoHitInformation::UsedSVDHit UsedSVDHit
Copy the definitions from the RecoHitInformation to this class.
RecoTrack()
Empty constructor for ROOT. Do not use!
unsigned int getNumberOfPXDHits() const
Return the number of 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.
const genfit::Track & getGenfitTrack() const
Returns genfit track.
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...
RecoHitInformation::UsedPXDHit UsedPXDHit
Copy the definitions from the RecoHitInformation to this class.
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....
bool hasSVDHits() const
Returns true if the track has svd hits.
void swapArmTimes()
Swap arm times, booleans and nSVDHits.
unsigned int getNumberOfTotalHits() const
Return the number of cdc + svd + pxd + bklm + eklm hits.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
iterator end()
Return iterator to last entry +1.
iterator begin()
Return iterator to first entry.
Defines interface for accessing relations of objects in StoreArray.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
static constexpr auto XYZToTVector
Helper function to convert XYZVector to TVector3.
#define BELLE2_DEFINE_EXCEPTION(ClassName, Message)
Macro that defines an exception with the given message template.
Abstract base class for different kinds of events.