StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcEnergy.h
1 /*
2  * Created by S. Gliske, May 2012
3  *
4  * Description: Containers used in the EEmcEnergyTree. Note: they do
5  * not explicitly depend on the STAR framework, and so the trees can
6  * be read outside of the STAR framework. Note: data members are all
7  * public, to allow a lighter weight implementation.
8  *
9  */
10 
11 #ifndef EEmcEnergy_H_
12 #define EEmcEnergy_H_
13 
14 #include <Rtypes.h>
15 #include <TObject.h>
16 
17 //
18 // TOWERS
19 //
20 
22  public:
23  EEmcElement_t();
24  virtual ~EEmcElement_t(){ /* */ };
25  void Clear();
26 
27  Int_t fail;
28  Float_t energy;
29 
30  private:
31  ClassDef( EEmcElement_t, 1 );
32 };
33 
34 inline void EEmcElement_t::Clear(){ fail = 0; energy = 0; };
35 
36 
37 class ETowEnergy_t {
38  public:
39  ETowEnergy_t(){ /* */ };
40  virtual ~ETowEnergy_t(){ /* */ };
41  void Clear();
42 
43  // methods to return elements.
44  // WARNING: no bounds checking!
45  EEmcElement_t& getByIdx( Int_t idx );
46  EEmcElement_t& getByBin( Int_t sec, Int_t sub, Int_t etabin );
47  EEmcElement_t& getByBin( Int_t phibin, Int_t etabin );
48  const EEmcElement_t& getByIdx( Int_t idx ) const;
49  const EEmcElement_t& getByBin( Int_t sec, Int_t sub, Int_t etabin ) const;
50  const EEmcElement_t& getByBin( Int_t phibin, Int_t etabin ) const;
51 
52  protected:
53  EEmcElement_t element[720];
54 
55  private:
56  ClassDef( ETowEnergy_t, 1 );
57 };
58 
59 inline EEmcElement_t& ETowEnergy_t::getByIdx( Int_t idx ){
60  return element[ idx ];
61 };
62 
63 inline const EEmcElement_t& ETowEnergy_t::getByIdx( Int_t idx ) const{
64  return element[ idx ];
65 };
66 
67 inline EEmcElement_t& ETowEnergy_t::getByBin( Int_t sec, Int_t sub, Int_t etabin ){
68  return element[ 12*( 5*sec + sub ) + etabin ];
69 };
70 
71 inline const EEmcElement_t& ETowEnergy_t::getByBin( Int_t sec, Int_t sub, Int_t etabin ) const {
72  return element[ 12*( 5*sec + sub ) + etabin ];
73 };
74 
75 inline EEmcElement_t& ETowEnergy_t::getByBin( Int_t phibin, Int_t etabin ){
76  return element[ 12*phibin + etabin ];
77 };
78 
79 inline const EEmcElement_t& ETowEnergy_t::getByBin( Int_t phibin, Int_t etabin ) const {
80  return element[ 12*phibin + etabin ];
81 };
82 
83 
84 //
85 // STRIPS
86 //
87 
88 class ESmdLayer_t {
89  public:
90  ESmdLayer_t(){ /* */ };
91  virtual ~ESmdLayer_t(){ /* */ };
92  void Clear();
93 
94  Int_t nStrips;
95  EEmcElement_t strip[288];
96 
97  private:
98  ClassDef( ESmdLayer_t, 1);
99 };
100 
102  public:
103  ESmdSector_t(){ /* */ };
104  virtual ~ESmdSector_t(){ /* */ };
105  void Clear();
106 
107  ESmdLayer_t layer[2];
108 
109  private:
110  ClassDef( ESmdSector_t, 1 );
111 };
112 
114  public:
115  ESmdEnergy_t(){ /* */ };
116  virtual ~ESmdEnergy_t(){ /* */ };
117  void Clear();
118 
119  ESmdSector_t sec[12];
120 
121  private:
122  ClassDef( ESmdEnergy_t, 1 );
123 };
124 
125 //
126 // TOTAL EEMC
127 //
128 
129 class EEmcEnergy_t : public TObject {
130  public:
131  EEmcEnergy_t() : nTowers(0), nStrips(0) { /* */ };
132  virtual ~EEmcEnergy_t(){ /* */ };
133  void Clear( const Option_t* opt = "" );
134 
135  ETowEnergy_t eTow;
136  ETowEnergy_t ePre1;
137  ETowEnergy_t ePre2;
138  ETowEnergy_t ePost;
139  ESmdEnergy_t eSmd;
140 
141  UInt_t nTowers, nStrips;
142 
143  private:
144  ClassDef( EEmcEnergy_t, 1 );
145 };
146 
147 #endif
148 
149 /*
150  * $Id: EEmcEnergy.h,v 1.1 2012/11/26 19:04:30 sgliske Exp $
151  * $Log: EEmcEnergy.h,v $
152  * Revision 1.1 2012/11/26 19:04:30 sgliske
153  * moved from offline/users/sgliske/StRoot/StEEmcPool/EEmcTreeContainers to StRoot/StEEmcPool/EEmcTreeContainers
154  *
155  *
156  */