00001 #include "StEEmcTower.h"
00002 #include <iostream>
00003 ClassImp(StEEmcTower);
00004
00005
00006 StEEmcTower::StEEmcTower()
00007 {
00008 mIndex=-1;
00009 mLayer=-1;
00010 mSector=-1;
00011 mPhibin=-1;
00012 mSubsector=-1;
00013 mEtabin=-1;
00014 }
00015
00016
00017 StEEmcTower::StEEmcTower( const StEEmcTower &other )
00018 {
00019 mIndex=other.mIndex;
00020 mLayer=other.mLayer;
00021 mSector=other.mSector;
00022 mPhibin=other.mPhibin;
00023 mSubsector=other.mSubsector;
00024 mEtabin=other.mEtabin;
00025 mET=other.mET;
00026 mNeighbors=other.mNeighbors;
00027
00028 mRaw=other.mRaw;
00029 mAdc=other.mAdc;
00030 mEnergy=other.mEnergy;
00031 mStat=other.mStat;
00032 mFail=other.mFail;
00033 mName=other.mName;
00034 mstRawHit=other.mstRawHit;
00035 }
00036
00037
00038 void StEEmcTower::print()
00039 {
00040
00041 std::cout << "--------------------------- StEEmcTower::print()" << std::endl;
00042 std::cout << "name = " << mName << std::endl;
00043 std::cout << "index = " << mIndex << std::endl;
00044 std::cout << "energy = " << energy() << std::endl;
00045 std::cout << "raw = " << raw() << std::endl;
00046 std::cout << "adc = " << adc() << std::endl;
00047
00048 }
00049
00050 void StEEmcTower::printLine()
00051 {
00052 std::cout << mName << " ADC=" << raw() << " " << adc() << " E=" << energy();
00053 }
00054
00055
00056 void StEEmcTower::index( Int_t i )
00057 {
00058
00059 mIndex = i;
00060 mPhibin = i / 12;
00061 mEtabin = i % 12;
00062 mSector = mPhibin / 5;
00063 mSubsector = mPhibin % 5;
00064
00065 const Char_t *secs[]={"01","02","03","04","05","06","07","08","09","10","11","12"};
00066 const Char_t *subs[]={"A","B","C","D","E"};
00067 const Char_t *lays[]={"T","P","Q","R","S"};
00068
00069 mName="";
00070 mName += secs[mSector];
00071 mName += lays[mLayer];
00072 mName += subs[mSubsector];
00073 mName += secs[mEtabin];
00074
00075 }
00076
00077
00078 Bool_t StEEmcTower::isNeighbor( StEEmcTower t )
00079 {
00080
00082 if ( t.index() == index() ) return true;
00083
00085 if ( TMath::Abs(t.etabin()-etabin()) > 1 ) return false;
00086
00087 Int_t phi1 = t.phibin();
00088 Int_t phi2 = phibin();
00089
00090 Int_t dphi = phi1 - phi2;
00091
00093 if ( TMath::Abs(dphi) <= 1 ) return true;
00094
00096 if ( phi1==59 ) phi1=-1;
00097 if ( phi2==59 ) phi2=-1;
00098 dphi = phi1 - phi2;
00099
00101 if ( TMath::Abs(dphi) <= 1 ) return true;
00102
00103 return false;
00104
00105 }