BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/include/TrkBase/TrkFundHit.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkFundHit.h,v 1.4 2011/02/17 11:53:41 zhangy Exp $
4//
5// Description: Abstract base class. Derived classes describe detector
6// (Svt & Mdc) hits, used as input to tracking routines. All
7// the base class does is provide list of pointers to HitOnTrack objects
8// that are currently pointing at the underlying hit.
9// Note: if you copy the contents
10// of a FundHit into another (with either the copy ctor or operator=),
11// the list of HOT pointers does not get copied (since the HOT points
12// back to the original, not the copy).
13//
14// Environment:
15// Software developed for the BaBar Detector at the SLAC B-Factory.
16//
17// Authors: Steve Schaffner
18//
19// Revision History:
20// 20000523 M. Kelsey -- Add concrete printAll() implementation which
21// calls through to subclass print(), then dumps HOT list.
22//------------------------------------------------------------------------
23
24#ifndef TRKFUNDHIT_HH
25#define TRKFUNDHIT_HH
26
27#include "GaudiKernel/ContainedObject.h"
28
29#include "TrkBase/TrkEnums.h"
30#include "TrkBase/TrkHitOnTrkIter.h"
31
32#include <utility>
33#include <vector>
34class TrkRecoTrk;
35class TrkHitOnTrk;
36#include <iosfwd>
37
38// Class interface //
39// class TrkFundHit : public AbsEvtObj {//yzhang temp
40// class TrkFundHit {//yzhang delete
41
42class TrkFundHit : public ContainedObject {
43
44public:
46
47 //**********************
48 // Constructors and such
49 //**********************
51 virtual ~TrkFundHit();
52
53 //**********************
54 // Access list of HitOnTrack objects this hit is associated with
55 //**********************
56 int nUsedHits() const;
57 bool usedHit( void ) const { return !_hitList.empty(); }
58
59 std::pair<TrkFundHit::hot_iterator, TrkFundHit::hot_iterator> getUsedHits() const {
60 return std::pair<TrkFundHit::hot_iterator, TrkFundHit::hot_iterator>( begin(), end() );
61 }
64
65 // Is this hit used on track trk?
66 bool usedOnTrack( const TrkRecoTrk* t ) const { return getHitOnTrack( t ) != 0; }
67 // return HOT connecting this hit to track trk (return 0 if none)
68 // TrkHitOnTrk* getHitOnTrack(TrkRecoTrk *trk, PdtPid::PidType) const;
69 const TrkHitOnTrk* getHitOnTrack( const TrkRecoTrk* trk ) const;
70
71 //**********************
72 // Modify list of HitOnTrack objects
73 //**********************
74 const TrkHitOnTrk* setUsedHit( const TrkHitOnTrk* hit ); // return hit if OK, 0 if not
75 const TrkHitOnTrk* setUnusedHit( const TrkHitOnTrk* hit ); // return hit if OK, 0 if not
76
77 //**********************
78 // Pattern-recognition functions
79 //**********************
80 virtual TrkEnums::TrkViewInfo whatView() const = 0;
81
82 // MC truth (this may not survive until data-taking)
83 // virtual const GTrack* getGTrack() const = 0;
84
85 //**********************
86 // Dump list of HOTs (for debugging)
87 //**********************
88 virtual void printAll( std::ostream& os ) const;
89
90protected:
91 friend class TrkHitOnTrkIter<TrkFundHit>;
92
93 typedef std::vector<const TrkHitOnTrk*>::iterator iterator_implementation;
95
96 std::vector<const TrkHitOnTrk*> _hitList;
97 // Operators
99
100private:
101 // Copy ctor
102 TrkFundHit( const TrkFundHit& );
103};
104
105// Might need this again someday:
106// Create a HitOnTrk object of the correct type
107// virtual TrkHitOnTrk* makeHot(TrkRecoTrk *) = 0;
108
111 const_cast<std::vector<const TrkHitOnTrk*>&>( _hitList ).begin() );
112}
113
116 const_cast<std::vector<const TrkHitOnTrk*>&>( _hitList ).end() );
117}
118
119#endif
const TrkHitOnTrk * getHitOnTrack(const TrkRecoTrk *trk) const
std::vector< constTrkHitOnTrk * >::iterator iterator_implementation
const TrkHitOnTrk * setUnusedHit(const TrkHitOnTrk *hit)
virtual void printAll(std::ostream &os) const
virtual TrkEnums::TrkViewInfo whatView() const =0
std::pair< TrkFundHit::hot_iterator, TrkFundHit::hot_iterator > getUsedHits() const
int nUsedHits() const
virtual ~TrkFundHit()
TrkFundHit & operator=(const TrkFundHit &)
const TrkHitOnTrk * setUsedHit(const TrkHitOnTrk *hit)
int t()
Definition t.c:1