BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/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 <memory>
19#include "MdcRecoUtil/PdtPid.h"
20#include "TrkBase/TrkDirection.h"
21#include "TrkBase/TrkFitStatus.h"
22#include "TrkBase/TrkFit.h"
23#include "TrkBase/TrkHotList.h"
24#include "TrkBase/TrkHitOnTrkUpdater.h"
25// These 3 are needed for the OSF compiler:
26#include "MdcRecoUtil/BesVectorErr.h"
27#include "MdcRecoUtil/BesPointErr.h"
28#include "CLHEP/Vector/ThreeVector.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,
52 PdtPid::PidType hypo);
54 PdtPid::PidType hypo, bool stealHots=false);
55// construct from a hotlist -- The rep will always _TAKE OWNERSHIP_ of the hots
56// and if takeownership==true, ALSO of the list.
57 TrkRep(const TrkHotList* inHots, TrkRecoTrk* trk,
58 PdtPid::PidType hypo);
60 PdtPid::PidType hypo, bool takeownership=false);
61 // For reps w/o hits stored
62 TrkRep(TrkRecoTrk* trk, PdtPid::PidType hypo, int nAct, int nSvt,
63 int nMdc, double startFoundRange, double endFoundRange);
64// rep without explicit hotlist
65 TrkRep(TrkRecoTrk* trk, PdtPid::PidType hypo, bool createHotList=false);
66 // copy ctor
67 TrkRep(const TrkRep& oldRep, TrkRecoTrk* trk, PdtPid::PidType hypo);
68 virtual ~TrkRep();
69 // clone() used to copy tracks; cloneNewHypo() for new hypos within track
70 virtual TrkRep* clone(TrkRecoTrk* newTrack) const = 0;
72 bool operator== (const TrkRep&);
73
74 //******************************************
75 // Global quantities:
76 //******************************************
78 virtual int nActive() const;
79 virtual int nSvt() const;
80 virtual int nMdc() const;
82 TrkRecoTrk* parentTrack() {return _parentTrack;}
83 const TrkRecoTrk* parentTrack() const {return _parentTrack;}
84 double startValidRange() const;
85 double endValidRange() const;
86 virtual double startFoundRange() const;
87 virtual double endFoundRange() const;
88 virtual const IfdKey& myKey() const;
89 double trackT0() const;
90
91 //******************************************
92 // Information about track at a given position
93 //******************************************
94 virtual HepPoint3D position(double fltL) const;
95 virtual Hep3Vector direction(double fltL) const;
96 virtual double arrivalTime(double fltL) const;
97 virtual BesPointErr positionErr(double fltL) const;
98 virtual BesVectorErr directionErr(double fltL) const;
99
100 //******************************************
101 // Hit (list) handling
102 //******************************************
103 // Simple implementations of these are present in the base class;
104 // complicated reps (e.g. Kalman) may wish to override.
105 virtual void addHot(TrkHitOnTrk *theHot);
106 virtual void removeHot(TrkHitOnTrk *theHot);
107 virtual void activateHot(TrkHitOnTrk *theHot);
108 virtual void deactivateHot(TrkHitOnTrk *theHot);
109 virtual TrkHotList* hotList() {return _hotList.get();}
110 virtual const TrkHotList* hotList() const {return _hotList.get();}
111 virtual void updateHots();
112 virtual bool resid(const TrkHitOnTrk *theHot,
113 double &residual, double &residErr,
114 bool exclude=false) const;
115
116 // Distinguishes hotLists that actually hold hits from those that just hold
117 // info (e.g. nActive) about the hits used to create the fit
118 bool hitCapable() const {return hotList()->hitCapable();}
119
120
121 //******************************************
122 // Fitting stuff
123 //******************************************
124 virtual TrkErrCode fit() = 0;
125
126protected:
128 const TrkContext& trkContext() const;
129
130 //protected, not private, so derived classes can create in copy ctor
131 std::auto_ptr<TrkHotList> _hotList;
132
133private:
134 void init(TrkRecoTrk* trk, PdtPid::PidType hypo);
135
136 PdtPid::PidType _partHypo;
137 TrkRecoTrk* _parentTrack;
138 mutable double _betainv; // cache for arrivalTime
139};
140
141#endif
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:336
virtual void removeHot(TrkHitOnTrk *theHot)
virtual PdtPid::PidType particleType() const
virtual ChisqConsistency chisqConsistency() const
std::auto_ptr< TrkHotList > _hotList
virtual double arrivalTime(double fltL) const
virtual void updateHots()
virtual void activateHot(TrkHitOnTrk *theHot)
virtual double endFoundRange() const
Definition: TrkRep.cxx:302
virtual TrkErrCode fit()=0
TrkRep & operator=(const TrkRep &)
Definition: TrkRep.cxx:111
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 double startFoundRange() const
Definition: TrkRep.cxx:296
virtual int nSvt() const
virtual int nMdc() const
Definition: TrkRep.cxx:342
virtual void deactivateHot(TrkHitOnTrk *theHot)
bool operator==(const TrkRep &)
Definition: TrkRep.cxx:134