Belle II Software  release-05-02-19
WireHit.h
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : WireHit.h
5 // Section : TRG CDC
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to represent a wire hit in CDC.
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #ifndef TRGCDCWireHit_FLAG_
15 #define TRGCDCWireHit_FLAG_
16 
17 #include <vector>
18 #include "trg/cdc/CellHit.h"
19 
20 #ifdef TRGCDC_SHORT_NAMES
21 #define TCWHit TRGCDCWireHit
22 #endif
23 
24 namespace Belle2 {
30  class TRGCDCWire;
31  class TRGCDCWireHitMC;
32 
34  class TRGCDCWireHit : public TRGCDCCellHit {
35 
36  public:
38  explicit TRGCDCWireHit(const TRGCDCWire&,
39  unsigned indexCDCHit = 0,
40  unsigned indexCDCSimHit = 0,
41  unsigned indexMCParticle = 0,
42  float driftLeft = 0,
43  float driftLeftError = 0,
44  float driftRight = 0,
45  float driftRightError = 0,
46  int mcLRflag = 1,
47  float fudgeFacgtor = 1);
48 
50  virtual ~TRGCDCWireHit();
51 
53  static void removeAll(void);
54 
56  static void* operator new(size_t);
57 
59  static void operator delete(void*);
60 
61  public:// Selectors
62 
64  const TRGCDCWire& wire(void) const;
65 
67  const TRGCDCWireHitMC* mc(void) const;
68 
71 
73  unsigned iCDCSimHit(void) const;
74 
75  public:// Static utility functions
76 
78  static int sortByWireId(const TRGCDCWireHit** a,
79  const TRGCDCWireHit** b);
80 
81  private:
82 
84  static std::vector<TRGCDCWireHit*> _all;
85 
88 
90  unsigned _iCDCSimHit;
91 
92  };
93 
94 //-----------------------------------------------------------------------------
95 
96  inline
97  const TRGCDCWireHitMC*
98  TRGCDCWireHit::mc(void) const
99  {
100  return _mc;
101  }
102 
103  inline
104  const TRGCDCWireHitMC*
106  {
107  return _mc = a;
108  }
109 
110  inline
111  unsigned
113  {
114  return _iCDCSimHit;
115  }
116 
118 } // namespace Belle2
119 
120 #endif /* TRGCDCWireHit_FLAG_ */
Belle2::TRGCDCWireHit::_all
static std::vector< TRGCDCWireHit * > _all
Keeps all TRGCDCWireHit created by new().
Definition: WireHit.h:84
Belle2::TRGCDCWireHit::mc
const TRGCDCWireHitMC * mc(void) const
This will be removed.
Definition: WireHit.h:98
Belle2::TRGCDCWireHit::sortByWireId
static int sortByWireId(const TRGCDCWireHit **a, const TRGCDCWireHit **b)
Sort function. This will be removed.
Definition: WireHit.cc:67
Belle2::TRGCDCWireHit::wire
const TRGCDCWire & wire(void) const
returns a pointer to a TRGCDCWire.
Definition: WireHit.cc:61
Belle2::TRGCDCWireHitMC
A class to represent a MC wire hit in CDC.
Definition: WireHitMC.h:35
Belle2::TRGCDCWire
A class to represent a wire in CDC.
Definition: Wire.h:57
Belle2::TRGCDCWireHit::_iCDCSimHit
unsigned _iCDCSimHit
index of CDCSimHit
Definition: WireHit.h:90
Belle2::TRGCDCWireHit::TRGCDCWireHit
TRGCDCWireHit(const TRGCDCWire &, unsigned indexCDCHit=0, unsigned indexCDCSimHit=0, unsigned indexMCParticle=0, float driftLeft=0, float driftLeftError=0, float driftRight=0, float driftRightError=0, int mcLRflag=1, float fudgeFacgtor=1)
Constructor.
Definition: WireHit.cc:31
Belle2::TRGCDCCellHit
A class to represent a wire hit in CDC.
Definition: CellHit.h:75
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGCDCWireHit
A class to represent a wire hit in CDC.
Definition: WireHit.h:34
Belle2::TRGCDCWireHit::~TRGCDCWireHit
virtual ~TRGCDCWireHit()
Destructor.
Definition: WireHit.cc:56
Belle2::TRGCDCWireHit::_mc
const TRGCDCWireHitMC * _mc
This will be removed.
Definition: WireHit.h:87
Belle2::TRGCDCWireHit::removeAll
static void removeAll(void)
destructs all TRGCDCCellHit objects. (Called by TRGCDC)
Definition: WireHit.cc:79
Belle2::TRGCDCWireHit::iCDCSimHit
unsigned iCDCSimHit(void) const
return index of CDCSimHit
Definition: WireHit.h:112