BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
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"
31
32#include <vector>
33#include <utility>
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 //**********************
50 TrkFundHit();
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
61 return std::pair<TrkFundHit::hot_iterator,TrkFundHit::hot_iterator >(begin(),end());
62 }
63 inline TrkFundHit::hot_iterator begin() const;
64 inline TrkFundHit::hot_iterator end() const;
65
66 // Is this hit used on track trk?
67 bool usedOnTrack(const TrkRecoTrk *t) const {return getHitOnTrack(t) != 0;}
68 // return HOT connecting this hit to track trk (return 0 if none)
69 // TrkHitOnTrk* getHitOnTrack(TrkRecoTrk *trk, PdtPid::PidType) const;
70 const TrkHitOnTrk* getHitOnTrack(const TrkRecoTrk *trk) const;
71
72 //**********************
73 // Modify list of HitOnTrack objects
74 //**********************
75 const TrkHitOnTrk* setUsedHit(const TrkHitOnTrk *hit); // return hit if OK, 0 if not
76 const TrkHitOnTrk* setUnusedHit(const TrkHitOnTrk *hit); // return hit if OK, 0 if not
77
78 //**********************
79 // Pattern-recognition functions
80 //**********************
81 virtual TrkEnums::TrkViewInfo whatView() const = 0;
82
83 // MC truth (this may not survive until data-taking)
84// virtual const GTrack* getGTrack() const = 0;
85
86 //**********************
87 // Dump list of HOTs (for debugging)
88 //**********************
89 virtual void printAll(std::ostream& os) const;
90
91protected:
92 friend class TrkHitOnTrkIter<TrkFundHit>;
93
94 typedef std::vector<const TrkHitOnTrk*>::iterator iterator_implementation;
96
97 std::vector<const TrkHitOnTrk*> _hitList;
98 // Operators
100
101private:
102 // Copy ctor
103 TrkFundHit(const TrkFundHit &);
104
105};
106
107// Might need this again someday:
108 // Create a HitOnTrk object of the correct type
109 // virtual TrkHitOnTrk* makeHot(TrkRecoTrk *) = 0;
110
111
114{
115 return TrkFundHit::hot_iterator(const_cast<std::vector<const TrkHitOnTrk*>&>(_hitList).begin());
116}
117
120{
121 return TrkFundHit::hot_iterator(const_cast<std::vector<const TrkHitOnTrk*>&>(_hitList).end());
122}
123
124#endif
TTree * t
Definition binning.cxx:23
bool usedOnTrack(const TrkRecoTrk *t) const
Definition TrkFundHit.h:67
std::vector< const TrkHitOnTrk * > _hitList
Definition TrkFundHit.h:97
const TrkHitOnTrk * getHitOnTrack(const TrkRecoTrk *trk) const
const TrkHitOnTrk * setUnusedHit(const TrkHitOnTrk *hit)
virtual TrkEnums::TrkViewInfo whatView() const =0
TrkFundHit::hot_iterator begin() const
Definition TrkFundHit.h:113
std::pair< TrkFundHit::hot_iterator, TrkFundHit::hot_iterator > getUsedHits() const
Definition TrkFundHit.h:60
bool usedHit(void) const
Definition TrkFundHit.h:57
virtual ~TrkFundHit()
TrkHitOnTrkIter< TrkFundHit > hot_iterator
Definition TrkFundHit.h:45
int nUsedHits() const
TrkFundHit & operator=(const TrkFundHit &)
const TrkHitOnTrk iterator_value_type
Definition TrkFundHit.h:95
std::vector< constTrkHitOnTrk * >::iterator iterator_implementation
Definition TrkFundHit.h:94
const TrkHitOnTrk * setUsedHit(const TrkHitOnTrk *hit)
TrkFundHit::hot_iterator end() const
Definition TrkFundHit.h:119
virtual void printAll(std::ostream &os) const