StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSsdHit.h
1 
5 /***************************************************************************
6  *
7  * $Id: StSsdHit.h,v 2.13 2016/02/25 17:10:20 ullrich Exp $
8  *
9  * Author: Thomas Ullrich, Jan 1999
10  * Lilian Martin, Dec 1999
11  ***************************************************************************
12  *
13  * Description:
14  *
15  ***************************************************************************
16  *
17  * $Log: StSsdHit.h,v $
18  * Revision 2.13 2016/02/25 17:10:20 ullrich
19  * Implemented detector() which is now a pure abstract method in StHit.
20  *
21  * Revision 2.12 2009/11/23 22:20:51 ullrich
22  * Minor cleanup performed, fixed compiler warnings.
23  *
24  * Revision 2.11 2009/11/23 16:34:07 fisyak
25  * Cleanup, remove dependence on dst tables, clean up software monitors
26  *
27  * Revision 2.10 2006/04/27 21:58:53 ullrich
28  * Added data member and methods to deal with local positions.
29  *
30  * Revision 2.9 2004/07/15 16:36:25 ullrich
31  * Removed all clone() declerations and definitions. Use StObject::clone() only.
32  *
33  * Revision 2.8 2003/01/08 19:43:11 perev
34  * CleanUp
35  *
36  * Revision 2.7 2002/02/22 22:56:50 jeromel
37  * Doxygen basic documentation in all header files. None of this is required
38  * for QM production.
39  *
40  * Revision 2.6 2001/04/05 04:00:42 ullrich
41  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
42  *
43  * Revision 2.5 2001/03/24 03:34:58 perev
44  * clone() -> clone() const
45  *
46  * Revision 2.4 2000/01/05 16:05:39 ullrich
47  * Updated for actual use in StEvent. Unpacking changed.
48  *
49  * Revision 2.3 1999/11/09 19:35:17 ullrich
50  * Memory now allocated using StMemoryPool via overloaded new/delete
51  *
52  * Revision 2.2 1999/10/28 22:26:39 ullrich
53  * Adapted new StArray version. First version to compile on Linux and Sun.
54  *
55  * Revision 2.1 1999/10/13 19:43:42 ullrich
56  * Initial Revision
57  *
58  **************************************************************************/
59 #ifndef StSsdHit_hh
60 #define StSsdHit_hh
61 
62 #include "StHit.h"
63 #include "StMemoryPool.hh"
64 
65 class StSsdHit : public StHit {
66 public:
67  StSsdHit();
68  StSsdHit(const StThreeVectorF&,
69  const StThreeVectorF&,
70  unsigned int, float, unsigned char = 0);
71  // StSsdHit(const StSsdHit&); use default
72  // StSsdHit& operator=(const StSsdHit&); use default
73  ~StSsdHit();
74 
75  void* operator new(size_t sz,void *p) { return p;}
76  void* operator new(size_t) { return mPool.alloc(); }
77  void operator delete(void* p) { mPool.free(p); }
78 
79  unsigned int ladder() const; // ladder=[1-20]
80  unsigned int wafer() const; // wafer=[1-16]
81  unsigned int centralStripNSide() const;
82  unsigned int centralStripPSide() const;
83  unsigned int clusterSizeNSide() const;
84  unsigned int clusterSizePSide() const;
85  float localPosition(unsigned int) const;
86  static unsigned int sector(unsigned int);
87  unsigned int sector() const;
88  void setLocalPosition(float, float);
89  virtual int volumeID() const;
90 
91  StDetectorId detector() const;
92  void Print(const Option_t *option="") const;
93 
94 
95 
96 protected:
97  static StMemoryPool mPool;
98  Float_t mLocalPosition[2];
99 
100 private:
101  enum {mWaferPerLadder=16};
102  ClassDef(StSsdHit,2)
103 };
104 
105 inline unsigned int
106 StSsdHit::sector(unsigned int ladder) {
107  if (ladder <= 2 || ladder == 20) return 1;
108  if (ladder >= 3 && ladder <= 9) return 2;
109  if (ladder >= 10 && ladder <= 12) return 3;
110  if (ladder >= 13 && ladder <= 19) return 4;
111  return 0;
112 }
113 
114 inline unsigned int StSsdHit::sector() const {return sector(ladder()); }
115 inline StDetectorId StSsdHit::detector() const {return static_cast<StDetectorId>(StHit::bits(0, 4));}
116 
117 ostream& operator<<(ostream& os, StSsdHit const & v);
118 
119 #endif
Definition: StHit.h:125