StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSstHit.h
1 
5 /***************************************************************************
6  *
7  * $Id: StSstHit.h,v 2.3 2016/02/25 17:10:20 ullrich Exp $
8  *
9  * Author: Jonathan Bouchet, Thomas Ullrich, May 2015
10  ***************************************************************************
11  *
12  * Description:
13  *
14  ***************************************************************************
15  *
16  * $Log: StSstHit.h,v $
17  * Revision 2.3 2016/02/25 17:10:20 ullrich
18  * Implemented detector() which is now a pure abstract method in StHit.
19  *
20  * Revision 2.2 2015/05/21 14:11:43 ullrich
21  * Changed mADC from int to unsigned short.
22  *
23  * Revision 2.1 2015/05/13 16:50:59 ullrich
24  * Initial Revision.
25  *
26  *
27  **************************************************************************/
28 #ifndef StSstHit_hh
29 #define StSstHit_hh
30 
31 #include "StHit.h"
32 #include "StMemoryPool.hh"
33 
34 class StSstHit : public StHit {
35 public:
36  StSstHit();
37  StSstHit(const StThreeVectorF&,
38  const StThreeVectorF&,
39  unsigned int, float, unsigned char = 0);
40  // StSstHit(const StSstHit&); use default
41  // StSstHit& operator=(const StSstHit&); use default
42  ~StSstHit();
43 
44  void* operator new(size_t sz,void *p) { return p;}
45  void* operator new(size_t) { return mPool.alloc(); }
46  void operator delete(void* p) { mPool.free(p); }
47 
48  unsigned int ladder() const; // ladder=[1-20]
49  unsigned int wafer() const; // wafer=[1-16]
50  unsigned int centralStripNSide() const;
51  unsigned int centralStripPSide() const;
52  unsigned int clusterSizeNSide() const;
53  unsigned int clusterSizePSide() const;
54  float localPosition(unsigned int) const;
55  static unsigned int sector(unsigned int);
56  unsigned int sector() const;
57  void setLocalPosition(float, float, float);
58  void setADC(unsigned short, unsigned short);
59  int getADC(unsigned int) const;
60  virtual int volumeID() const;
61  void Print(const Option_t *option="") const;
62 
63  StDetectorId detector() const;
64 
65 protected:
66  static StMemoryPool mPool;
67  Float_t mLocalPosition[3];
68  UShort_t mADC[2];
69 
70 private:
71  enum {mWaferPerLadder=16};
72 
73  ClassDef(StSstHit,2)
74 };
75 
76 inline StDetectorId StSstHit::detector() const {return kSstId;}
77 
78 inline unsigned int
79 StSstHit::sector(unsigned int ladder) {
80  if (ladder <= 2 || ladder == 20) return 1;
81  if (ladder >= 3 && ladder <= 9) return 2;
82  if (ladder >= 10 && ladder <= 12) return 3;
83  if (ladder >= 13 && ladder <= 19) return 4;
84  return 0;
85 }
86 
87 inline unsigned int
88 StSstHit::sector() const {return sector(ladder()); }
89 
90 ostream& operator<<(ostream& os, StSstHit const & v);
91 
92 #endif
Definition: StHit.h:125