BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/include/TrkBase/TrkRep.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkRep.h,v 1.2 2006/03/28 01:02:36 zhangy Exp $
4//
5// Description: Base class for internal track representation classes -- e.g.
6// HelixRep, KalRep. Owns and maintains a TrkHotList; and keeps a
7// pointer to the track that owns the Rep.
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Authors: Steve Schaffner
13//
14//------------------------------------------------------------------------
15
16#ifndef TRKREP_HH
17#define TRKREP_HH
18#include "MdcRecoUtil/PdtPid.h"
19#include "TrkBase/TrkDirection.h"
20#include "TrkBase/TrkFit.h"
21#include "TrkBase/TrkFitStatus.h"
22#include "TrkBase/TrkHitOnTrkUpdater.h"
23#include "TrkBase/TrkHotList.h"
24#include <memory>
25// These 3 are needed for the OSF compiler:
26#include "CLHEP/Vector/ThreeVector.h"
27#include "MdcRecoUtil/BesPointErr.h"
28#include "MdcRecoUtil/BesVectorErr.h"
29// the following is needed by the Sun compiler
30#include "ProbTools/ChisqConsistency.h"
31
32class TrkHitOnTrk;
33#include <iosfwd>
34class TrkDifTraj;
35class TrkErrCode;
36class TrkExchangePar;
37class TrkRecoTrk;
38class TrkVolume;
39class IfdKey;
40class TrkContext;
41
42// Class interface //
43class TrkRep : public TrkFitStatus, public TrkFit, public TrkHitOnTrkUpdater {
44
45public:
46 //******************************************
47 // Constructors and such
48 //******************************************
49 // construct from a hotlist -- The rep will not take ownership of anything passed
50 // -- it will _clone_ the hots passed on inHots
51 TrkRep( const TrkHotList& inHots, TrkRecoTrk* trk, PdtPid::PidType hypo );
52 TrkRep( TrkHotList& inHots, TrkRecoTrk* trk, PdtPid::PidType hypo, bool stealHots = false );
53 // construct from a hotlist -- The rep will always _TAKE OWNERSHIP_ of the hots
54 // and if takeownership==true, ALSO of the list.
55 TrkRep( const TrkHotList* inHots, TrkRecoTrk* trk, PdtPid::PidType hypo );
57 bool takeownership = false );
58 // For reps w/o hits stored
59 TrkRep( TrkRecoTrk* trk, PdtPid::PidType hypo, int nAct, int nSvt, int nMdc,
60 double startFoundRange, double endFoundRange );
61 // rep without explicit hotlist
62 TrkRep( TrkRecoTrk* trk, PdtPid::PidType hypo, bool createHotList = false );
63 // copy ctor
64 TrkRep( const TrkRep& oldRep, TrkRecoTrk* trk, PdtPid::PidType hypo );
65 virtual ~TrkRep();
66 // clone() used to copy tracks; cloneNewHypo() for new hypos within track
67 virtual TrkRep* clone( TrkRecoTrk* newTrack ) const = 0;
68 virtual TrkRep* cloneNewHypo( PdtPid::PidType hypo ) = 0;
69 bool operator==( const TrkRep& );
70
71 //******************************************
72 // Global quantities:
73 //******************************************
75 virtual int nActive() const;
76 virtual int nSvt() const;
77 virtual int nMdc() const;
79 TrkRecoTrk* parentTrack() { return _parentTrack; }
80 const TrkRecoTrk* parentTrack() const { return _parentTrack; }
81 double startValidRange() const;
82 double endValidRange() const;
83 virtual double startFoundRange() const;
84 virtual double endFoundRange() const;
85 virtual const IfdKey& myKey() const;
86 double trackT0() const;
87
88 //******************************************
89 // Information about track at a given position
90 //******************************************
91 virtual HepPoint3D position( double fltL ) const;
92 virtual Hep3Vector direction( double fltL ) const;
93 virtual double arrivalTime( double fltL ) const;
94 virtual BesPointErr positionErr( double fltL ) const;
95 virtual BesVectorErr directionErr( double fltL ) const;
96
97 //******************************************
98 // Hit (list) handling
99 //******************************************
100 // Simple implementations of these are present in the base class;
101 // complicated reps (e.g. Kalman) may wish to override.
102 virtual void addHot( TrkHitOnTrk* theHot );
103 virtual void removeHot( TrkHitOnTrk* theHot );
104 virtual void activateHot( TrkHitOnTrk* theHot );
105 virtual void deactivateHot( TrkHitOnTrk* theHot );
106 virtual TrkHotList* hotList() { return _hotList.get(); }
107 virtual const TrkHotList* hotList() const { return _hotList.get(); }
108 virtual void updateHots();
109 virtual bool resid( const TrkHitOnTrk* theHot, double& residual, double& residErr,
110 bool exclude = false ) const;
111
112 // Distinguishes hotLists that actually hold hits from those that just hold
113 // info (e.g. nActive) about the hits used to create the fit
114 bool hitCapable() const { return hotList()->hitCapable(); }
115
116 //******************************************
117 // Fitting stuff
118 //******************************************
119 virtual TrkErrCode fit() = 0;
120
121protected:
123 const TrkContext& trkContext() const;
124
125 // protected, not private, so derived classes can create in copy ctor
126 std::auto_ptr<TrkHotList> _hotList;
127
128private:
129 void init( TrkRecoTrk* trk, PdtPid::PidType hypo );
130
131 PdtPid::PidType _partHypo;
132 TrkRecoTrk* _parentTrack;
133 mutable double _betainv; // cache for arrivalTime
134};
135
136#endif
HepGeom::Point3D< double > HepPoint3D
virtual bool hitCapable() const =0
virtual BesPointErr positionErr(double fltL) const
TrkRep(const TrkRep &oldRep, TrkRecoTrk *trk, PdtPid::PidType hypo)
TrkRep(TrkHotList *inHots, TrkRecoTrk *trk, PdtPid::PidType hypo, bool takeownership=false)
virtual void addHot(TrkHitOnTrk *theHot)
virtual const IfdKey & myKey() const
TrkRep(TrkRecoTrk *trk, PdtPid::PidType hypo, bool createHotList=false)
virtual TrkRep * cloneNewHypo(PdtPid::PidType hypo)=0
virtual int nActive() const
TrkRep(TrkHotList &inHots, TrkRecoTrk *trk, PdtPid::PidType hypo, bool stealHots=false)
double trackT0() const
virtual double endFoundRange() const
TrkRep(TrkRecoTrk *trk, PdtPid::PidType hypo, int nAct, int nSvt, int nMdc, double startFoundRange, double endFoundRange)
virtual int nSvt() const
Definition TrkRep.cxx:265
virtual void removeHot(TrkHitOnTrk *theHot)
virtual PdtPid::PidType particleType() const
virtual ChisqConsistency chisqConsistency() const
virtual double arrivalTime(double fltL) const
virtual void updateHots()
virtual void activateHot(TrkHitOnTrk *theHot)
virtual double endFoundRange() const
Definition TrkRep.cxx:247
virtual TrkErrCode fit()=0
TrkRep & operator=(const TrkRep &)
virtual TrkRep * clone(TrkRecoTrk *newTrack) const =0
virtual ~TrkRep()
TrkRep(const TrkHotList &inHots, TrkRecoTrk *trk, PdtPid::PidType hypo)
virtual Hep3Vector direction(double fltL) const
virtual bool resid(const TrkHitOnTrk *theHot, double &residual, double &residErr, bool exclude=false) const
virtual double startFoundRange() const
TrkRep(const TrkHotList *inHots, TrkRecoTrk *trk, PdtPid::PidType hypo)
double endValidRange() const
double startValidRange() const
virtual BesVectorErr directionErr(double fltL) const
const TrkContext & trkContext() const
virtual int nMdc() const
virtual HepPoint3D position(double fltL) const
virtual const TrkHotList * hotList() const
virtual double startFoundRange() const
Definition TrkRep.cxx:245
virtual int nSvt() const
virtual int nMdc() const
Definition TrkRep.cxx:267
virtual void deactivateHot(TrkHitOnTrk *theHot)
bool operator==(const TrkRep &)