StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcTower.cxx
1 #include "StEEmcTower.h"
2 #include <iostream>
3 ClassImp(StEEmcTower);
4 
5 // ----------------------------------------------------------------------------
7 {
8  mIndex=-1;
9  mLayer=-1;
10  mSector=-1;
11  mPhibin=-1;
12  mSubsector=-1;
13  mEtabin=-1;
14 }
15 
16 // ----------------------------------------------------------------------------
18 {
19  mIndex=other.mIndex;
20  mLayer=other.mLayer;
21  mSector=other.mSector;
22  mPhibin=other.mPhibin;
23  mSubsector=other.mSubsector;
24  mEtabin=other.mEtabin;
25  mET=other.mET;
26  mNeighbors=other.mNeighbors;
27 
28  mRaw=other.mRaw;
29  mAdc=other.mAdc;
30  mEnergy=other.mEnergy;
31  mStat=other.mStat;
32  mFail=other.mFail;
33  mName=other.mName;
34  mstRawHit=other.mstRawHit;
35 }
36 
37 // ----------------------------------------------------------------------------
39 {
40 
41  std::cout << "--------------------------- StEEmcTower::print()" << std::endl;
42  std::cout << "name = " << mName << std::endl;
43  std::cout << "index = " << mIndex << std::endl;
44  std::cout << "energy = " << energy() << std::endl;
45  std::cout << "raw = " << raw() << std::endl;
46  std::cout << "adc = " << adc() << std::endl;
47 
48 }
49 
51 {
52  std::cout << mName << " ADC=" << raw() << " " << adc() << " E=" << energy();
53 }
54 
55 // ----------------------------------------------------------------------------
56 void StEEmcTower::index( Int_t i )
57 {
58 
59  mIndex = i;
60  mPhibin = i / 12;
61  mEtabin = i % 12;
62  mSector = mPhibin / 5;
63  mSubsector = mPhibin % 5;
64 
65  const Char_t *secs[]={"01","02","03","04","05","06","07","08","09","10","11","12"};
66  const Char_t *subs[]={"A","B","C","D","E"};
67  const Char_t *lays[]={"T","P","Q","R","S"};
68 
69  mName="";
70  mName += secs[mSector];
71  mName += lays[mLayer];
72  mName += subs[mSubsector];
73  mName += secs[mEtabin];
74 
75 }
76 
77 // ----------------------------------------------------------------------------
79 {
80 
82  if ( t.index() == index() ) return true;
83 
85  if ( TMath::Abs(t.etabin()-etabin()) > 1 ) return false;
86 
87  Int_t phi1 = t.phibin();
88  Int_t phi2 = phibin();
89 
90  Int_t dphi = phi1 - phi2;
91 
93  if ( TMath::Abs(dphi) <= 1 ) return true;
94 
96  if ( phi1==59 ) phi1=-1;
97  if ( phi2==59 ) phi2=-1;
98  dphi = phi1 - phi2;
99 
101  if ( TMath::Abs(dphi) <= 1 ) return true;
102 
103  return false;
104 
105 }
Bool_t isNeighbor(const StEEmcTower &t) const
Definition: StEEmcTower.cxx:98
Int_t index() const
Returns index of this tower, pre- or postshower element.
Definition: StEEmcTower.h:37
StEEmcTower()
Constructor.
Definition: StEEmcTower.cxx:24
StEEmcTowerPtrVec_t mNeighbors
Definition: StEEmcTower.h:88
Float_t raw() const
Return raw ADC for this element.
Definition: StEEmcElement.h:30
Int_t mEtabin
Definition: StEEmcTower.h:80
Float_t energy() const
Return the EM energy (towers) or energy deposit for this element (SMD,pre,post). If a fail bit is set...
Definition: StEEmcElement.h:34
Int_t etabin() const
Returns the etabin of this tower, pre- or postshower element.
Definition: StEEmcTower.h:45
Int_t mSector
Definition: StEEmcTower.h:78
void print() const
Print a summary of this tower.
Definition: StEEmcTower.cxx:58
void printLine() const
Print a one line summary of this tower.
Definition: StEEmcTower.cxx:70
Float_t mEnergy
Definition: StEEmcElement.h:54
void index(Int_t i)
Definition: StEEmcTower.cxx:76
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
unsigned mFail
Definition: StEEmcElement.h:56
Float_t adc() const
Return the pedestal-subtracted ADC for this element.
Definition: StEEmcElement.h:32
Float_t mET
Equivalent transverse energy, assuming a vertex of 0,0,0.
Definition: StEEmcTower.h:84
Int_t mLayer
Definition: StEEmcTower.h:77
Int_t mPhibin
Definition: StEEmcTower.h:81
Int_t phibin() const
Returns the phibin of this tower.
Definition: StEEmcTower.h:47
Int_t mSubsector
Definition: StEEmcTower.h:79
unsigned mStat
Definition: StEEmcElement.h:55
Int_t mIndex
Definition: StEEmcTower.h:76