StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcTower.h
1 // Hey Emacs this is -*-c++-*-
2 #ifndef STAR_EEmcTower_h
3 #define STAR_EEmcTower_h
4 // $Id: EEmcTower.h,v 1.5 2005/02/05 00:53:28 perev Exp $
5 
6 
7 #include <Stiostream.h>
8 
9 #include "TObject.h"
10 #include "TVector3.h"
11 
12 #if !defined(ST_NO_NAMESPACES)
13 using std::ostream;
14 #endif
15 
16 
17 class EEmcTower : public TObject {
18 public:
20  EEmcTower() { mSec=mSub=mEta=-1; mADC=mEdep=0.0; };
21 
23  EEmcTower(int s, int ss, int e, float adc=0.0, float ene=0.0) {
24  mSec = (char)s;
25  mSub = (char)ss;
26  mEta = (char)e;
27  mADC = adc;
28  mEdep = ene;
29  };
30 
32  EEmcTower(const char *label, float adc=0.0, float ene=0.0);
33 
35  EEmcTower(const EEmcTower& t) {
36  mSec = (char) t.Sec();
37  mSub = (char) t.SubSec();
38  mEta = (char) t.Eta();
39  mADC = t.ADC();
40  mEdep = t.dE();
41  }
42 
44  ~EEmcTower() { };
45 
47  float ADC() const { return mADC; }
49  float ADC(float d) { mADC=d; return mADC; }
50 
52  float dE() const { return mEdep; }
54  float dE(float e) { mEdep=e; return mEdep; }
55 
57  int Sec () const { return mSec; }
59  int Sec (int s) { mSec=(char)s; return s; }
60 
62  int SubSec() const { return mSub; }
64  int SubSec(int s) { mSub=(char)s; return s; }
65 
67  int Eta () const { return mEta; }
69  int Eta (int e) { mEta=(char)e; return e; }
70 
71 
73  int SecLabel () const { return mSec+1; }
75  int SecLabel (int s) { mSec=(char)(s-1 ); return s; }
76 
78  int SubSecLabel() const { return mSub+'A'; }
80  int SubSecLabel(int s) { mSub=(char)(s-'A'); return s; }
81 
83  int EtaLabel () const { return mEta+1; }
85  int EtaLabel (int e) { mEta=(char)(e-1 ); return e; }
86 
88  const char *TowerLabel() const;
89 
91  ostream& Out ( ostream &out ) const ;
92 
94  bool operator==(const EEmcTower &t) {
95  if(mSec!=t.Sec()) return false;
96  if(mSub!=t.SubSec()) return false;
97  if(mEta!=t.Eta()) return false;
98  return true;
99  }
100 
102  bool operator!=(const EEmcTower &t) {
103  if(mSec==t.Sec()) return false;
104  if(mSub==t.SubSec()) return false;
105  if(mEta==t.Eta()) return false;
106  return true;
107  }
108 
111 
112 private:
113  bool ParseLabel(const char* label);
114  //
115  char mSec; //
116  char mSub; //
117  char mEta; //
118  char mDummy; // byte align
119  float mADC; //
120  float mEdep; //
121 public:
122  ClassDef(EEmcTower, 3) //
123 };
124 
128 ostream& operator<<(ostream &out, const EEmcTower &t );
129 
130 #endif
float ADC() const
gets adc value associated with the tower (pedestal adjusted)
Definition: EEmcTower.h:47
bool operator==(const EEmcTower &t)
compare two towers
Definition: EEmcTower.h:94
EEmcTower()
the default constructor
Definition: EEmcTower.h:20
EEmcTower(const EEmcTower &t)
a copy constructor
Definition: EEmcTower.h:35
const char * TowerLabel() const
returns tower label, e.g. &quot;05TB09&quot;
Definition: EEmcTower.cxx:77
int Sec(int s)
sets tower sector index, computer offset [0,....)
Definition: EEmcTower.h:59
int SubSecLabel() const
gets tower subsector label, human offset [A..E]
Definition: EEmcTower.h:78
float ADC(float d)
sets adc value associated with the tower (pedestal adjusted)
Definition: EEmcTower.h:49
float dE() const
gets calibrated energy loss value associated with the tower
Definition: EEmcTower.h:52
~EEmcTower()
the destructor
Definition: EEmcTower.h:44
float dE(float e)
sets calibrated energy loss value associated with the tower
Definition: EEmcTower.h:54
int EtaLabel(int e)
sets tower eta label, human offset [1..12]
Definition: EEmcTower.h:85
int Eta(int e)
sets tower eta index, computer offset [0,....)
Definition: EEmcTower.h:69
int SubSec() const
gets tower subsector index, computer offset [0,....)
Definition: EEmcTower.h:62
ostream & Out(ostream &out) const
print tower hit info in xml-like style
Definition: EEmcTower.cxx:87
bool operator!=(const EEmcTower &t)
compare two towers
Definition: EEmcTower.h:102
int Sec() const
gets tower sector index, computer offset [0,....)
Definition: EEmcTower.h:57
int SubSec(int s)
sets tower subsector index, computer offset [0,....)
Definition: EEmcTower.h:64
int SecLabel(int s)
sets tower sector label, human offset [1..12]
Definition: EEmcTower.h:75
EEmcTower(int s, int ss, int e, float adc=0.0, float ene=0.0)
the explicit constructor
Definition: EEmcTower.h:23
int SecLabel() const
gets tower sector label, human offset [1..12]
Definition: EEmcTower.h:73
int SubSecLabel(int s)
sets tower subsector label, human offset [A..E]
Definition: EEmcTower.h:80
int EtaLabel() const
gets tower eta label, human offset [1..12]
Definition: EEmcTower.h:83
int Eta() const
gets tower eta index, computer offset [0,....)
Definition: EEmcTower.h:67
EEmcTower holds information about an EEMC tower &#39;hit&#39;.
Definition: EEmcTower.h:17