34 #include <TDatabasePDG.h>
46 cardinalRep_(0), fitStatuses_(), mcTrackId_(-1), timeSeed_(0), stateSeed_(6), covSeed_(6)
53 cardinalRep_(0), fitStatuses_(), stateSeed_(6), covSeed_(6)
79 std::vector <AbsMeasurement*> factoryHits = factory.
createMany(trackCand);
81 if (factoryHits.size() != trackCand.
getNHits()) {
82 Exception exc(
"Track::Track ==> factoryHits.size() != trackCand->getNHits()",__LINE__,__FILE__);
88 for (
unsigned int i=0; i<factoryHits.size(); ++i){
97 cardinalRep_(0), fitStatuses_(), mcTrackId_(-1), timeSeed_(0), stateSeed_(stateSeed),
98 covSeed_(TMatrixDSym::kUnit, TMatrixDSym(6))
105 cardinalRep_(0), fitStatuses_(), mcTrackId_(-1), timeSeed_(0), stateSeed_(6),
106 covSeed_(TMatrixDSym::kUnit, TMatrixDSym(6))
114 cardinalRep_(0), fitStatuses_(), mcTrackId_(-1), timeSeed_(0), stateSeed_(stateSeed),
123 cardinalRep_(rhs.cardinalRep_), mcTrackId_(rhs.mcTrackId_), timeSeed_(rhs.timeSeed_),
124 stateSeed_(rhs.stateSeed_), covSeed_(rhs.covSeed_)
128 std::map<const AbsTrackRep*, AbsTrackRep*> oldRepNewRep;
130 for (std::vector<AbsTrackRep*>::const_iterator it=rhs.
trackReps_.begin(); it!=rhs.
trackReps_.end(); ++it) {
133 oldRepNewRep[(*it)] = newRep;
142 for (std::map< const AbsTrackRep*, FitStatus* >::const_iterator it=rhs.
fitStatuses_.begin(); it!=rhs.
fitStatuses_.end(); ++it) {
143 setFitStatus(it->second->clone(), oldRepNewRep[it->first]);
198 for (
size_t i = 0; i <
trackReps_.size(); ++i)
235 if ((*it)->hasFitterInfo(rep)) {
245 if ((*it)->hasFitterInfo(rep)) {
265 if ((*it)->hasFitterInfo(rep)) {
274 for (std::vector<TrackPoint*>::const_reverse_iterator it =
trackPoints_.rbegin(); it !=
trackPoints_.rend(); ++it) {
275 if ((*it)->hasFitterInfo(rep)) {
294 Exception exc(
"Track::getFittedState ==> no trackPoint with fitterInfo for rep",__LINE__,__FILE__);
304 for (
size_t i = 0; i <
trackReps_.size(); ++i)
308 Exception exc(
"Track::getIdForRep ==> cannot find TrackRep in Track",__LINE__,__FILE__);
332 return (dynamic_cast<KalmanFitStatus*>(
fitStatuses_.at(rep)) != NULL);
368 debugOut <<
"Track::insertPoint at position " <<
id <<
"\n";
426 int n = points.size();
435 for (std::vector<TrackPoint*>::iterator p = points.begin(); p != points.end(); ++p)
436 (*p)->setTrack(
this);
476 debugOut <<
"Track::deletePoint at position " <<
id <<
"\n";
522 std::map<const AbsTrackRep*, AbsTrackRep*> otherRepThisRep;
523 std::vector<const AbsTrackRep*> otherRepsToRemove;
525 for (std::vector<AbsTrackRep*>::const_iterator otherRep=other->
trackReps_.begin(); otherRep!=other->
trackReps_.end(); ++otherRep) {
527 for (std::vector<AbsTrackRep*>::const_iterator thisRep=
trackReps_.begin(); thisRep!=
trackReps_.end(); ++thisRep) {
528 if ((*thisRep)->isSame(*otherRep)) {
529 otherRepThisRep[*otherRep] = *thisRep;
531 debugOut <<
" map other rep " << *otherRep <<
" to " << (*thisRep) <<
"\n";
534 Exception exc(
"Track::mergeTrack ==> more than one matching rep.",__LINE__,__FILE__);
543 otherRepsToRemove.push_back(*otherRep);
545 debugOut <<
" remove other rep " << *otherRep <<
"\n";
551 std::vector<TrackPoint*> points;
554 for (std::vector<TrackPoint*>::const_iterator otherTp=other->
trackPoints_.begin(); otherTp!=other->
trackPoints_.end(); ++otherTp) {
555 points.push_back(
new TrackPoint(**otherTp, otherRepThisRep, &otherRepsToRemove));
581 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin(); pointIt !=
trackPoints_.end(); ++pointIt) {
582 (*pointIt)->deleteFitterInfo(rep);
600 if (
id >= 0 && (
unsigned int)
id <
trackReps_.size())
604 errorOut <<
"Track::setCardinalRep: Attempted to set cardinalRep_ to a value out of bounds. Resetting cardinalRep_ to 0." << std::endl;
616 double minChi2(9.E99);
619 for (std::map< const AbsTrackRep*, FitStatus* >::const_iterator it =
fitStatuses_.begin(); it !=
fitStatuses_.end(); ++it) {
620 if (it->second->isFitConverged()) {
621 if (it->second->getChi2() < minChi2) {
622 minChi2 = it->second->getChi2();
628 if (bestRep != NULL) {
647 int equalUntil(-1), equalFrom(nPoints);
648 for (
int i = 0; i<nPoints; ++i) {
655 if (equalUntil == nPoints-1)
661 for (
int i = nPoints-1; i>equalUntil; --i) {
669 debugOut <<
"Track::sort. Equal up to (including) hit " << equalUntil <<
" and from (including) hit " << equalFrom <<
" \n";
690 double fittedCharge = fittedState.
getCharge();
692 for (
unsigned int i = 0; i<
trackReps_.size(); ++i) {
693 if (
trackReps_[i]->getPDGCharge() * fittedCharge < 0) {
724 for (
unsigned int i = 0; i<
trackReps_.size(); ++i) {
740 debugOut <<
"Track::deleteForwardInfo from position " << startId <<
" to " << endId <<
"\n";
751 assert (endId >= startId);
753 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin() + startId; pointIt !=
trackPoints_.begin() + endId; ++pointIt) {
755 if ((*pointIt)->hasFitterInfo(rep))
756 (*pointIt)->getFitterInfo(rep)->deleteForwardInfo();
759 const std::vector<AbsFitterInfo*> fitterInfos = (*pointIt)->getFitterInfos();
760 for (std::vector<AbsFitterInfo*>::const_iterator fitterInfoIt = fitterInfos.begin(); fitterInfoIt != fitterInfos.end(); ++fitterInfoIt) {
761 (*fitterInfoIt)->deleteForwardInfo();
770 debugOut <<
"Track::deleteBackwardInfo from position " << startId <<
" to " << endId <<
"\n";
781 assert (endId >= startId);
784 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin() + startId; pointIt !=
trackPoints_.begin() + endId; ++pointIt) {
786 if ((*pointIt)->hasFitterInfo(rep))
787 (*pointIt)->getFitterInfo(rep)->deleteBackwardInfo();
790 const std::vector<AbsFitterInfo*> fitterInfos = (*pointIt)->getFitterInfos();
791 for (std::vector<AbsFitterInfo*>::const_iterator fitterInfoIt = fitterInfos.begin(); fitterInfoIt != fitterInfos.end(); ++fitterInfoIt) {
792 (*fitterInfoIt)->deleteBackwardInfo();
801 debugOut <<
"Track::deleteReferenceInfo from position " << startId <<
" to " << endId <<
"\n";
812 assert (endId >= startId);
814 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin() + startId; pointIt !=
trackPoints_.begin() + endId; ++pointIt) {
816 if ((*pointIt)->hasFitterInfo(rep))
817 (*pointIt)->getFitterInfo(rep)->deleteReferenceInfo();
820 std::vector<AbsFitterInfo*> fitterInfos = (*pointIt)->getFitterInfos();
821 for (std::vector<AbsFitterInfo*>::const_iterator fitterInfoIt = fitterInfos.begin(); fitterInfoIt != fitterInfos.end(); ++fitterInfoIt) {
822 (*fitterInfoIt)->deleteReferenceInfo();
831 debugOut <<
"Track::deleteMeasurementInfo from position " << startId <<
" to " << endId <<
"\n";
842 assert (endId >= startId);
844 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin() + startId; pointIt !=
trackPoints_.begin() + endId; ++pointIt) {
846 if ((*pointIt)->hasFitterInfo(rep))
847 (*pointIt)->getFitterInfo(rep)->deleteMeasurementInfo();
850 std::vector<AbsFitterInfo*> fitterInfos = (*pointIt)->getFitterInfos();
851 for (std::vector<AbsFitterInfo*>::const_iterator fitterInfoIt = fitterInfos.begin(); fitterInfoIt != fitterInfos.end(); ++fitterInfoIt) {
852 (*fitterInfoIt)->deleteMeasurementInfo();
861 debugOut <<
"Track::deleteFitterInfo from position " << startId <<
" to " << endId <<
"\n";
872 assert (endId >= startId);
874 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin() + startId; pointIt !=
trackPoints_.begin() + endId; ++pointIt) {
876 if ((*pointIt)->hasFitterInfo(rep))
877 (*pointIt)->deleteFitterInfo(rep);
880 for (std::vector<AbsTrackRep*>::const_iterator repIt =
trackReps_.begin(); repIt !=
trackReps_.end(); ++repIt) {
881 if ((*pointIt)->hasFitterInfo(*repIt))
882 (*pointIt)->deleteFitterInfo(*repIt);
896 bool backwards(
false);
897 if (startId > endId) {
898 double temp = startId;
912 for (std::vector<TrackPoint*>::const_iterator pointIt =
trackPoints_.begin() + startId; pointIt !=
trackPoints_.begin() + endId; ++pointIt) {
913 if (! (*pointIt)->hasFitterInfo(rep)) {
914 Exception e(
"Track::getTracklength: trackPoint has no fitterInfo", __LINE__,__FILE__);
922 state = (*pointIt)->getFitterInfo(rep)->getFittedState();
943 for (
unsigned int j = 0; j < measurements.size(); ++j) {
948 if (dynamic_cast<const PlanarMeasurement*>(m)) {
975 if (startId > endId) {
976 std::swap(startId, endId);
991 Exception e(
"Track::getTOF: trackPoint has no fitterInfo", __LINE__,__FILE__);
1008 assert(startId >= 0);
1009 assert(startId <= endId);
1012 std::vector< AbsFitterInfo* > fis;
1014 for (std::vector<TrackPoint*>::iterator tp =
trackPoints_.begin() + startId; tp !=
trackPoints_.begin() + endId; ++tp) {
1017 fis = (*tp)->getFitterInfos();
1019 else if ((*tp)->hasFitterInfo(rep)) {
1020 fis.push_back((*tp)->getFitterInfo(rep));
1023 for (std::vector< AbsFitterInfo* >::iterator fi = fis.begin(); fi != fis.end(); ++fi) {
1039 for (std::map< const AbsTrackRep*, FitStatus* >::const_iterator it=
fitStatuses_.begin(); it!=
fitStatuses_.end(); ++it) {
1040 it->second->getPruneFlags().setFlags(option);
1062 for (
unsigned int i = 0; i <
trackReps_.size(); ++i) {
1076 std::vector< AbsFitterInfo* > fis =
trackPoints_[i]->getFitterInfos();
1077 for (
unsigned int j = 0; j<fis.size(); ++j) {
1110 TString opt = option;
1112 if (opt.Contains(
"C")) {
1170 printf(
"% -9.3g ",
trackPoints_[i]->getSortingParameter());
1173 for (std::vector<AbsTrackRep*>::const_iterator rep =
trackReps_.begin(); rep !=
trackReps_.end(); ++rep) {
1246 printOut <<
"=======================================================================================\n";
1250 for (
unsigned int i=0; i<
trackReps_.size(); ++i) {
1253 printOut <<
" (This is the cardinal rep)";
1258 printOut <<
"---------------------------------------------------------------------------------------\n";
1261 printOut <<
"TrackPoint Nr. " << i <<
"\n";
1263 printOut <<
"..........................................................................\n";
1266 for (std::map< const AbsTrackRep*, FitStatus* >::const_iterator it=
fitStatuses_.begin(); it!=
fitStatuses_.end(); ++it) {
1267 it->second->Print();
1270 printOut <<
"=======================================================================================\n";
1279 std::map<const AbsTrackRep*, const KalmanFitterInfo*> prevFis;
1283 errorOut <<
"Track::checkConsistency(): stateSeed_ dimension != 6" << std::endl;
1288 errorOut <<
"Track::checkConsistency(): covSeed_ dimension != 6" << std::endl;
1293 errorOut <<
"Track::checkConsistency(): Warning: covSeed_ is zero" << std::endl;
1299 errorOut <<
"Track::checkConsistency(): Number of fitStatuses is != number of TrackReps " << std::endl;
1305 errorOut <<
"Track::checkConsistency(): cardinalRep id " <<
cardinalRep_ <<
" out of bounds" << std::endl;
1309 for (std::vector<AbsTrackRep*>::const_iterator rep =
trackReps_.begin(); rep !=
trackReps_.end(); ++rep) {
1311 if ((*rep) == NULL) {
1312 errorOut <<
"Track::checkConsistency(): TrackRep is NULL" << std::endl;
1317 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle((*rep)->getPDG());
1318 if (particle == NULL) {
1319 errorOut <<
"Track::checkConsistency(): TrackRep pdg ID " << (*rep)->getPDG() <<
" is not valid" << std::endl;
1325 errorOut <<
"Track::checkConsistency(): No FitStatus for Rep or FitStatus is NULL" << std::endl;
1333 if ((*tp) == NULL) {
1334 errorOut <<
"Track::checkConsistency(): TrackPoint is NULL" << std::endl;
1338 if ((*tp)->getTrack() !=
this) {
1339 errorOut <<
"Track::checkConsistency(): TrackPoint does not point back to this track" << std::endl;
1344 const std::vector<AbsMeasurement*>& rawMeasurements = (*tp)->getRawMeasurements();
1345 for (std::vector<AbsMeasurement*>::const_iterator m = rawMeasurements.begin(); m != rawMeasurements.end(); ++m) {
1348 errorOut <<
"Track::checkConsistency(): Measurement is NULL" << std::endl;
1352 if ((*m)->getTrackPoint() != *tp) {
1353 errorOut <<
"Track::checkConsistency(): Measurement does not point back to correct TrackPoint" << std::endl;
1359 std::vector<AbsFitterInfo*> fitterInfos = (*tp)->getFitterInfos();
1360 for (std::vector<AbsFitterInfo*>::const_iterator fi = fitterInfos.begin(); fi != fitterInfos.end(); ++fi) {
1362 if ((*fi) == NULL) {
1363 errorOut <<
"Track::checkConsistency(): FitterInfo is NULL. TrackPoint: " << *tp << std::endl;
1369 for (std::vector<AbsTrackRep*>::const_iterator rep =
trackReps_.begin(); rep !=
trackReps_.end(); ++rep) {
1370 if ( (*rep) == (*fi)->getRep() ) {
1375 errorOut <<
"Track::checkConsistency(): fitterInfo points to TrackRep which is not in Track" << std::endl;
1379 if (!( (*fi)->checkConsistency(&(this->getFitStatus((*fi)->getRep())->getPruneFlags())) ) ) {
1380 errorOut <<
"Track::checkConsistency(): FitterInfo not consistent. TrackPoint: " << *tp << std::endl;
1384 if (dynamic_cast<KalmanFitterInfo*>(*fi) != NULL) {
1385 if (prevFis[(*fi)->getRep()] != NULL &&
1387 prevFis[(*fi)->getRep()]->hasReferenceState() ) {
1389 double prevLen = prevFis[(*fi)->getRep()]->getReferenceState()->getBackwardSegmentLength();
1390 if (fabs(prevLen + len) > 1E-10 ) {
1391 errorOut <<
"Track::checkConsistency(): segment lengths of reference states for rep " << (*fi)->getRep() <<
" (id " <<
getIdForRep((*fi)->getRep()) <<
") at TrackPoint " << (*tp) <<
" don't match" << std::endl;
1392 errorOut << prevLen <<
" + " << len <<
" = " << prevLen + len << std::endl;
1393 errorOut <<
"TrackPoint " << *tp <<
", FitterInfo " << *fi <<
", rep " <<
getIdForRep((*fi)->getRep()) << std::endl;
1401 prevFis[(*fi)->getRep()] = NULL;
1409 std::vector<TrackPoint*> trackPointsWithMeasurement;
1412 if ((*it)->hasRawMeasurements()) {
1413 trackPointsWithMeasurement.push_back(*it);
1418 errorOut <<
"Track::checkConsistency(): trackPointsWithMeasurement_ has incorrect size" << std::endl;
1422 for (
unsigned int i = 0; i < trackPointsWithMeasurement.size(); ++i) {
1424 errorOut <<
"Track::checkConsistency(): trackPointsWithMeasurement_ is not correct" << std::endl;
1426 errorOut <<
"should have id " << i <<
", address " << trackPointsWithMeasurement[i] << std::endl;
1438 debugOut <<
"Track::trackHasChanged \n";
1444 for (std::map< const AbsTrackRep*, FitStatus* >::const_iterator it=
fitStatuses_.begin(); it!=
fitStatuses_.end(); ++it) {
1445 it->second->setHasTrackChanged();
1455 if ((*it)->hasRawMeasurements()) {
1462 void Track::Streamer(TBuffer &R__b)
1465 const bool streamTrackPoints =
true;
1467 typedef ::genfit::Track thisClass;
1469 if (R__b.IsReading()) {
1471 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
if (R__v) { }
1472 TObject::Streamer(R__b);
1474 std::vector<AbsTrackRep*> &R__stl =
trackReps_;
1478 Error(
"trackReps_ streamer",
"Missing the TClass object for genfit::AbsTrackRep!");
1483 R__stl.reserve(R__n);
1484 for (R__i = 0; R__i < R__n; R__i++) {
1487 R__stl.push_back(R__t);
1491 if (streamTrackPoints)
1497 Error(
"trackPoints_ streamer",
"Missing the TClass object for genfit::TrackPoint!");
1502 R__stl.reserve(R__n);
1503 for (R__i = 0; R__i < R__n; R__i++) {
1508 R__stl.push_back(R__t);
1512 std::map<const AbsTrackRep*,FitStatus*> &R__stl =
fitStatuses_;
1516 Error(
"fitStatuses_ streamer",
"Missing the TClass object for genfit::AbsTrackRep!");
1521 Error(
"fitStatuses_ streamer",
"Missing the TClass object for genfit::FitStatus!");
1526 for (R__i = 0; R__i < R__n; R__i++) {
1544 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
1548 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
1549 TObject::Streamer(R__b);
1551 std::vector<AbsTrackRep*> &R__stl =
trackReps_;
1552 int R__n=int(R__stl.size());
1557 Error(
"trackReps_ streamer",
"Missing the TClass object for genfit::AbsTrackRep!");
1560 std::vector<AbsTrackRep*>::iterator R__k;
1561 for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
1567 if (streamTrackPoints)
1570 int R__n=int(R__stl.size());
1573 std::vector<TrackPoint*>::iterator R__k;
1574 for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
1580 std::map<const AbsTrackRep*,FitStatus*> &R__stl =
fitStatuses_;
1581 int R__n=int(R__stl.size());
1586 Error(
"fitStatuses_ streamer",
"Missing the TClass object for genfit::AbsTrackRep!");
1591 Error(
"fitStatuses_ streamer",
"Missing the TClass object for genfit::FitStatus!");
1594 std::map<const AbsTrackRep*,FitStatus*>::iterator R__k;
1595 for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
1598 R__b << ((*R__k).second);
1605 R__b.SetByteCount(R__c, kTRUE);
virtual void Clear(Option_t *="")
TrackPoint * getPointWithMeasurementAndFitterInfo(int id, const AbsTrackRep *rep=NULL) const
void insertPoints(std::vector< genfit::TrackPoint * > points, int id=-1)
Insert TrackPoints BEFORE TrackPoint with position id, if id >= 0.
Contains the measurement and covariance in raw detector coordinates.
const TMatrixDSym & getCovSeed() const
get the covariance matrix seed (6D).
void createMeasurements(const TrackCand &trackCand, const MeasurementFactory< genfit::AbsMeasurement > &factory)
TrackCand * constructTrackCand() const
Construct a new TrackCand containing the hit IDs of the measurements.
void setSortingParameter(double sortingParameter)
void deleteFitterInfo(int startId=0, int endId=-1, const AbsTrackRep *rep=NULL)
void deleteBackwardInfo(int startId=0, int endId=-1, const AbsTrackRep *rep=NULL)
double getSortingParameter() const
void deleteMeasurementInfo(int startId=0, int endId=-1, const AbsTrackRep *rep=NULL)
AbsTrackRep * getCardinalRep() const
Get cardinal track representation.
virtual AbsTrackRep * clone() const =0
Clone the trackRep.
virtual bool hasForwardUpdate() const =0
virtual bool hasBackwardUpdate() const =0
bool hasReferenceState() const
bool hasFitterInfo(const AbsTrackRep *rep) const
KalmanFitStatus * getKalmanFitStatus(const AbsTrackRep *rep=NULL) const
If FitStatus is a KalmanFitStatus, return it. Otherwise return NULL.
void reverseTrackPoints()
Flip the ordering of the TrackPoints.
std::vector< TrackPoint * > trackPoints_
virtual bool hasReferenceState() const =0
std::map< const AbsTrackRep *, FitStatus * > fitStatuses_
helper
const MeasuredStateOnPlane & getFittedState(int id=0, const AbsTrackRep *rep=NULL, bool biased=true) const
Shortcut to get FittedStates.
Hit object for use in TrackCand. Provides IDs and sorting parameters.
Info which information has been pruned from the Track.
void setTimeSeed(double time)
virtual double extrapolateToPlane(StateOnPlane &state, const genfit::SharedPlanePtr &plane, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to plane, and returns the extrapolation length and, via reference, the extrapolated state.
void prune(const Option_t *="CFLWRMIU")
Delete unneeded information from the Track.
void insertPoint(TrackPoint *point, int id=-1)
Insert TrackPoint BEFORE TrackPoint with position id, if id >= 0.
unsigned int getNumPoints() const
ReferenceStateOnPlane * getReferenceState() const
Track candidate – seed values and indices.
const std::vector< genfit::AbsMeasurement * > & getRawMeasurements() const
double getTOF(AbsTrackRep *rep=NULL, int startId=0, int endId=-1) const
get time of flight in ns between to trackPoints (if NULL, for cardinal rep)
unsigned int getNHits() const
virtual double getTime(const StateOnPlane &) const =0
Get the time corresponding to the StateOnPlane. Extrapolation.
void deleteForwardInfo(int startId=0, int endId=-1, const AbsTrackRep *rep=NULL)
int getMcTrackId() const
Get the MCT track id, for MC simulations - default value = -1.
void insertMeasurement(AbsMeasurement *measurement, int id=-1)
Creates a new TrackPoint containing the measurement, and adds it to the track.
virtual bool isLeftRightMeasurement() const
If the AbsMeasurement is a wire hit, the left/right resolution will be used.
int getIdForRep(const AbsTrackRep *rep) const
This is used when streaming TrackPoints.
bool hasFlags(Option_t *option="CFLWRMIU") const
check if all the given flags are set
virtual const MeasuredStateOnPlane & getFittedState(bool biased=true) const =0
const TVectorD & getStateSeed() const
Returns the 6D seed state; should be in global coordinates.
StateOnPlane with additional covariance matrix.
TrackPoint * getPointWithFitterInfo(int id, const AbsTrackRep *rep=NULL) const
unsigned int cardinalRep_
void setCardinalRep(int id)
std::vector< TrackPoint * > trackPointsWithMeasurement_
TrackPoint * getPoint(int id) const
bool sort()
Sort TrackPoint and according to their sorting parameters.
void fixWeights(AbsTrackRep *rep=NULL, int startId=0, int endId=-1)
bool checkConsistency() const
void setFatal(bool b=true)
Set fatal flag.
void deleteReferenceInfo(int startId=0, int endId=-1, const AbsTrackRep *rep=NULL)
void reverseMomSeed()
Flip direction of momentum seed.
void setTrack(Track *track)
Hit object for use in TrackCand. Provides additional left/right parameter.
AbsTrackRep * getTrackRep(int id) const
bool udpateSeed(int id=0, AbsTrackRep *rep=NULL, bool biased=true)
Abstract base class for a track representation.
void determineCardinalRep()
See with which AbsTrackRep the track was fitted best (converged fit w/ smallest chi2) and set the car...
virtual int getLeftRightResolution() const
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
void setCovSeed(const TMatrixDSym &cov6D)
set the covariance matrix seed (6D).
void reverseTrack()
Make track ready to be fitted in reverse direction.
void fixWeights(bool arg=true)
TVectorD get6DState() const
double getTimeSeed() const
Get the time at which the seed state is defined.
Class where important numbers and properties of a fit can be stored.
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
TrackCandHit * getHit(int i) const
double getSortingParameter() const
Object containing AbsMeasurement and AbsFitterInfo objects.
void mergeTrack(const Track *other, int id=-1)
Merge two tracks.
Helper class for TrackPoint sorting, used in Track::sort().
Measurement class implementing a planar hit geometry (1 or 2D).
void setMcTrackId(int i)
Set the MCT track id, for MC simulations.
double getTrackLen(AbsTrackRep *rep=NULL, int startId=0, int endId=-1) const
get TrackLength between to trackPoints (if NULL, for cardinal rep)
void fixupRepsForReading()
void setCovSeed(const TMatrixDSym &c)
std::vector< AbsTrackRep * > trackReps_
bool hasFitStatus(const AbsTrackRep *rep=NULL) const
Check if track has a FitStatus for given AbsTrackRep. Per default, check for cardinal rep...
bool switchPDGSign()
try to multiply pdg code with -1. (Switch from particle to anti-particle and vice versa)...
void fillPointsWithMeasurement()
void deleteTrackRep(int id)
Delete a AbsTrackRep and all corresponding AbsFitterInfo objects in every TrackPoint.
const SharedPlanePtr & getPlane() const
A state with arbitrary dimension defined in a DetPlane.
TMatrixDSym get6DCov() const
void setFlags(Option_t *option="")
does not reset! If a flag is already true and is not in opt, it will stay true.
TrackPoint * getPointWithMeasurement(int id) const
FitStatus for use with AbsKalmanFitter implementations.
bool hasRawMeasurements() const
void addHit(int detId, int hitId, int planeId=-1, double sortingParameter=0)
void addTrackRep(AbsTrackRep *trackRep)
void setTime6DSeedAndPdgCode(double time, const TVectorD &state6D, const int pdgCode)
This function works the same as set6DSeed but instead of a charge hypothesis you can set a pdg code w...
std::vector< measurement_T * > createMany(const TrackCand &cand) const
Create a collection of Measurements.
virtual bool hasForwardPrediction() const =0
virtual bool hasMeasurements() const =0
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
void switchPDGSigns(AbsTrackRep *rep=NULL)
Switch the pdg signs of specified rep (of all reps if rep == NULL).
bool hasKalmanFitStatus(const AbsTrackRep *rep=NULL) const
Check if track has a KalmanFitStatus for given AbsTrackRep. Per default, check for cardinal rep...
void setStateSeed(const TVectorD &s)
void Print(const Option_t *="") const
virtual bool hasBackwardPrediction() const =0
double getForwardSegmentLength() const
AbsFitterInfo * getFitterInfo(const AbsTrackRep *rep=NULL) const
Get fitterInfo for rep. Per default, use cardinal rep.
Factory object to create AbsMeasurement objects from digitized and clustered data.
Defines for I/O streams used for error and debug printing.
void setFitStatus(FitStatus *fitStatus, const AbsTrackRep *rep)
This class collects all information needed and produced by a specific AbsFitter and is specific to on...
FitStatus * getFitStatus(const AbsTrackRep *rep=NULL) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.