StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtHit.h
1 
5 /***************************************************************************
6  *
7  * $Id: StSvtHit.h,v 2.18 2016/02/26 14:45:15 ullrich Exp $
8  *
9  * Author: Thomas Ullrich, Sep 1999
10  ***************************************************************************
11  *
12  * Description:
13  *
14  ***************************************************************************
15  *
16  * $Log: StSvtHit.h,v $
17  * Revision 2.18 2016/02/26 14:45:15 ullrich
18  * Implemented detector() which is abstract method inherited from StHit.
19  *
20  * Revision 2.17 2009/11/23 22:20:51 ullrich
21  * Minor cleanup performed, fixed compiler warnings.
22  *
23  * Revision 2.16 2009/11/23 16:34:07 fisyak
24  * Cleanup, remove dependence on dst tables, clean up software monitors
25  *
26  * Revision 2.15 2009/11/10 00:41:11 ullrich
27  * Changed print-out format and added new method shell().
28  *
29  * Revision 2.14 2007/09/20 20:02:47 ullrich
30  * Added new members to hold and access the number of anodes and of pixels.
31  *
32  * Revision 2.13 2006/04/27 21:59:00 ullrich
33  * Added data member and methods to deal with local positions.
34  *
35  * Revision 2.12 2005/07/19 21:38:56 perev
36  * Cleanup
37  *
38  * Revision 2.11 2004/07/15 16:36:25 ullrich
39  * Removed all clone() declerations and definitions. Use StObject::clone() only.
40  *
41  * Revision 2.10 2003/01/08 19:43:11 perev
42  * CleanUp
43  *
44  * Revision 2.9 2002/02/22 22:56:51 jeromel
45  * Doxygen basic documentation in all header files. None of this is required
46  * for QM production.
47  *
48  * Revision 2.8 2001/08/07 20:50:53 caines
49  * Implement better packing of hardware and charge values
50  *
51  * Revision 2.7 2001/04/05 04:00:43 ullrich
52  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
53  *
54  * Revision 2.6 2001/03/24 03:34:59 perev
55  * clone() -> clone() const
56  *
57  * Revision 2.5 1999/12/13 20:16:22 ullrich
58  * Changed numbering scheme for hw_position unpack methods (STAR conventions).
59  *
60  * Revision 2.4 1999/11/11 11:03:57 ullrich
61  * Inlined layer(), sector() and ladder().
62  *
63  * Revision 2.3 1999/11/09 19:35:22 ullrich
64  * Memory now allocated using StMemoryPool via overloaded new/delete
65  *
66  * Revision 2.2 1999/11/04 21:40:57 ullrich
67  * Added missing default constructor
68  *
69  * Revision 2.1 1999/10/28 22:26:44 ullrich
70  * Adapted new StArray version. First version to compile on Linux and Sun.
71  *
72  * Revision 2.0 1999/10/12 18:42:45 ullrich
73  * Completely Revised for New Version
74  *
75  **************************************************************************/
76 #ifndef StSvtHit_hh
77 #define StSvtHit_hh
78 
79 #include "StHit.h"
80 #include "StMemoryPool.hh"
81 
82 class StSvtHit : public StHit {
83 public:
84  StSvtHit();
85  StSvtHit(const StThreeVectorF&,
86  const StThreeVectorF&,
87  unsigned int, float, unsigned char = 0);
88  // StSvtHit(const StSvtHit&); use default
89  // StSvtHit& operator=(const StSvtHit&); use default
90  ~StSvtHit();
91 
92  void* operator new(size_t sz,void *p) { return p;}
93  void* operator new(size_t) { return mPool.alloc(); }
94  void operator delete(void* p) { mPool.free(p); }
95 
96  unsigned int layer() const; // layer=[1,6]
97  static unsigned int layer(unsigned int barrel, unsigned int ladder);
98  unsigned int ladder() const; // ladder=[1-8]
99  unsigned int wafer() const; // wafer=[1-7]
100  unsigned int barrel() const; // barrel=[1-3]
101  unsigned int hybrid() const; // hybrid=[1-2]
102  unsigned int index() const; // hybrid index
103  float anode() const; // anode of hit in 1/4 slices
104  float timebucket() const; // timebucket of hit in 1/4 slices
105  float peakADC() const; // Peak ADC value of hit
106  float localPosition(unsigned int) const;
107  int numberOfAnodes() const;
108  int numberOfPixels() const;
109 
110  static unsigned int shell(unsigned int barrel, unsigned int ladder);
111  unsigned int shell() const;
112 
113  void setPeak(float);
114  void setAnode(float);
115  void setTimebucket(float);
116  void setLocalPosition(float, float);
117  virtual int volumeID() const;
118  void setNumberOfAnodes(unsigned short);
119  void setNumberOfPixels(unsigned short);
120  void Print(Option_t *option="") const;
121 
122  StDetectorId detector() const;
123 
124 protected:
125  static StMemoryPool mPool;
126  Float_t mPeak;
127  Float_t mAnode;
128  Float_t mTimebucket;
129  Float_t mLocalPosition[2];
130  UShort_t mNumberOfAnodes;
131  UShort_t mNumberOfPixels;
132 
133 private:
134  enum {mNBarrel=3};
135  ClassDef(StSvtHit,3)
136 };
137 
138 inline unsigned int
139 StSvtHit::index() const
140 {
141  // bits 4-13: Hybrid index
142  return (mHardwarePosition>>4)&((1L<<9)-1);
143 }
144 
145 inline StDetectorId StSvtHit::detector() const {return kSvtId;}
146 inline float StSvtHit::timebucket() const { return mTimebucket; }
147 inline void StSvtHit::setPeak(float val) { mPeak = val; }
148 inline void StSvtHit::setAnode(float val) { mAnode = val; }
149 inline void StSvtHit::setTimebucket(float val) { mTimebucket = val; }
150 ostream& operator<<(ostream& os, StSvtHit const & v);
151 
152 #endif
Definition: StHit.h:125