10 #include "StMuEmcTowerData.h"
12 #include "StMuEmcUtil.h"
26 memcpy(mTowerADC,o.mTowerADC,
sizeof(mTowerADC));
27 memcpy(mEndcapTowerADC,o.mEndcapTowerADC,
sizeof(mEndcapTowerADC));
28 memcpy(mBTowCrateFlags,o.mBTowCrateFlags,
sizeof(mBTowCrateFlags));
29 memcpy(mBSmdCrateFlags,o.mBSmdCrateFlags,
sizeof(mBSmdCrateFlags));
30 memcpy(mBPrsCrateFlags,o.mBPrsCrateFlags,
sizeof(mBPrsCrateFlags));
31 memcpy(mETowCrateFlags,o.mETowCrateFlags,
sizeof(mETowCrateFlags));
32 memcpy(mESmdCrateFlags,o.mESmdCrateFlags,
sizeof(mESmdCrateFlags));
33 memcpy(mEPrsCrateFlags,o.mEPrsCrateFlags,
sizeof(mEPrsCrateFlags));
36 StMuEmcTowerData::~StMuEmcTowerData()
40 void StMuEmcTowerData::clearBemc() {
41 memset(mTowerADC,0,
sizeof(mTowerADC));
42 memset(mBTowCrateFlags,0,
sizeof(mBTowCrateFlags));
43 memset(mBSmdCrateFlags,0,
sizeof(mBSmdCrateFlags));
44 memset(mBPrsCrateFlags,0,
sizeof(mBPrsCrateFlags));
47 void StMuEmcTowerData::clearEemc() {
48 memset(mEndcapTowerADC,0,
sizeof(mEndcapTowerADC));
49 memset(mETowCrateFlags,0,
sizeof(mETowCrateFlags));
50 memset(mESmdCrateFlags,0,
sizeof(mESmdCrateFlags));
51 memset(mEPrsCrateFlags,0,
sizeof(mEPrsCrateFlags));
54 int StMuEmcTowerData::towerADC(
int id,
int detector)
const
58 if(id<1 || id>nEmcTowers)
return 0;
59 return (
int)mTowerADC[
id-1];
63 if(id<1 || id>nEndcapTowers)
return 0;
64 return (
int)mEndcapTowerADC[
id-1];
69 StEmcCrateStatus StMuEmcTowerData::crateStatus(
int crate,
int detector)
const {
72 if (crate>0 && crate<=nBTowCrates)
73 return (StEmcCrateStatus) mBTowCrateFlags[crate-1];
78 if (crate>0 && crate<=nBSmdCrates)
79 return (StEmcCrateStatus) mBSmdCrateFlags[crate-1];
83 if (crate>0 && crate<=nBPrsCrates)
84 return (StEmcCrateStatus) mBPrsCrateFlags[crate-1];
88 if (crate>0 && crate<=nETowCrates)
89 return (StEmcCrateStatus) mETowCrateFlags[crate-1];
94 if (crate>0 && crate<=nESmdCrates)
95 return (StEmcCrateStatus) mESmdCrateFlags[crate-1];
99 if (crate>0 && crate<=nEPrsCrates)
100 return (StEmcCrateStatus) mEPrsCrateFlags[crate-1];
106 void StMuEmcTowerData::setTowerADC(
int id,
int adc,
int detector)
110 if(id<1 || id>nEmcTowers)
return;
115 if(id<1 || id>nEndcapTowers)
return;
116 mEndcapTowerADC[
id-1]=adc;
121 void StMuEmcTowerData::setCrateStatus(StEmcCrateStatus status,
int crate,
int detector) {
124 if (crate>0 && crate<=nBTowCrates)
125 mBTowCrateFlags[crate-1] = (
unsigned char) status;
130 if (crate>0 && crate<=nBSmdCrates)
131 mBSmdCrateFlags[crate-1] = (
unsigned char) status;
135 if (crate>0 && crate<=nBPrsCrates)
136 mBPrsCrateFlags[crate-1] = (
unsigned char) status;
140 if (crate>0 && crate<=nETowCrates)
141 mETowCrateFlags[crate-1] = (
unsigned char) status;
146 if (crate>0 && crate<=nESmdCrates)
147 mESmdCrateFlags[crate-1] = (
unsigned char) status;
151 if (crate>0 && crate<=nEPrsCrates)
152 mEPrsCrateFlags[crate-1] = (
unsigned char) status;
158 void StMuEmcTowerData::getEndcapTowerADC(
int ihit1,
int &adc,
int &sec,
int &sub,
int & eta)
const
161 adc=towerADC(ihit,eemc);
162 if(! util.getEndcapBin(eemc,ihit,sec,eta,sub))
return ;