8 #include "StEEsmdCalMaker.h"
10 #include "StMuDSTMaker/COMMON/StMuEvent.h"
11 #include "StMuDSTMaker/COMMON/StMuDst.h"
12 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
14 #include <StMessMgr.h>
16 #include "StEEmcUtil/database/EEmcDbItem.h"
17 #include "StEEmcUtil/database/StEEmcDb.h"
36 const float feta[MaxEtaBins]= {1.95,1.855,1.765,1.675,1.59,1.51,1.435,1.365,1.3,1.235,1.17,1.115};
40 mfixEmTgain=
new float [MaxEtaBins];
41 for (i=0;i<MaxEtaBins;i++) {
42 mfixEmTgain[i]=maxAdc/maxEtot/cosh(feta[i]);
52 StEEsmdCalMaker::~StEEsmdCalMaker(){
57 void StEEsmdCalMaker::SetSector(
int sec){
69 Int_t StEEsmdCalMaker::Init(){
70 eeDb = (
StEEmcDb*)this->GetDataSet(
"StEEmcDb");
73 printf(
"%s has MCflag=%d\n",
GetName(),MCflag);
74 return StMaker::Init();
79 Int_t StEEsmdCalMaker::InitRun(
int runNo){
81 gMessMgr->Message(
"",
"W")<<
GetName()<<
"::InitRun("<<runNo<<
") ??? changed to 555, it s OK for M-C - perhaps, JB"<<endm;
104 if(unpackMuDst()<0)
return kStOK;
114 Int_t StEEsmdCalMaker::unpackMuDst(){
117 gMessMgr->Message(
"",
"D") <<
GetName()<<
"::::getAdc() is called "<<endm;
122 gMessMgr->Message(
"",
"W") <<
"No EMC data for this event"<<endm;
return kStOK;
126 int i, n1=0,n2=0,n3=0;
129 for (i=0; i< emc->getNEndcapTowerADC(); i++) {
132 emc->getEndcapTowerADC(i,val,sec,sub,eta);
133 assert(sec>0 && sec<=MaxSectors);
136 if(sec<eeDb->getFirstSector() || sec>eeDb->getLastSector())
continue;
138 const EEmcDbItem *x=eeDb->getTile(sec,
'A'+sub-1,eta,
'T');
140 if(x->fail )
continue;
142 int iphi=(x->sec-1)*MaxSubSec+(x->sub-
'A');
144 assert(iphi>=0 && iphi<MaxPhiBins);
145 assert(ieta>=0 && ieta<MaxEtaBins);
147 float adc=-100, rawAdc=-101, ene=-102;
152 ene=adc/ mfixEmTgain[ieta];
156 if(x->gain) ene=adc/x->gain;
164 tileThr[iT][ieta][iphi]=rawAdc>x->thr;
165 if(rawAdc>x->thr) n1++;
166 if(x->gain<=0)
continue;
167 tileEne[iT][ieta][iphi]=ene;
173 int pNh= emc->getNEndcapPrsHits();
174 for (i=0; i<pNh; i++) {
181 if(sec<eeDb->getFirstSector() || sec>eeDb->getLastSector())
continue;
185 const EEmcDbItem *x=eeDb-> getTile(sec,sub-1+
'A', eta, pre-1+
'P');
187 if(x->fail )
continue;
190 int iphi=(x->sec-1)*MaxSubSec+(x->sub-
'A');
192 assert(iphi>=0 && iphi<MaxPhiBins);
193 assert(ieta>=0 && ieta<MaxEtaBins);
195 assert(iT>0 && iT<mxTile);
198 float adc=-100, rawAdc=-101, ene=-102;
207 if(x->gain) ene=adc/x->gain;
209 if(rawAdc>x->thr) n2++;
213 tileThr[iT][ieta][iphi]=rawAdc>x->thr;
215 if(x->gain<=0)
continue;
216 tileEne[iT][ieta][iphi]=ene;
224 for(uv=
'U'; uv<=
'V'; uv++) {
226 int nh= emc->getNEndcapSmdHits(uv);
228 for (i=0; i<nh; i++) {
229 StMuEmcHit *hit=emc->getEndcapSmdHit(uv,i,sec,strip);
230 assert(sec>0 && sec<=MaxSectors);
233 if(sec<eeDb->getFirstSector() || sec>eeDb->getLastSector())
continue;
235 const EEmcDbItem *x=eeDb->getByStrip(sec,uv,strip);
237 if(x->fail )
continue;
240 float adc=-100, rawAdc=-101, ene=-102;
250 if(x->gain) ene=adc/x->gain;
252 if(rawAdc>x->thr) n3++;
255 smdAdc[x->plane-
'U'][x->strip-1]=adc;
256 if(x->gain<=0)
continue;
257 smdEne[x->plane-
'U'][x->strip-1]=ene;
float smdAdc[MaxSmdPlains][MaxSmdStrips]
30 deg (only for this sector)
int getAdc() const
Return ADC value.
void setSector(int x)
the same info, counted from 0
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
virtual const char * GetName() const
special overload
float tileAdc[mxTile][MaxEtaBins][MaxPhiBins]
Access EEMC data & DB from muDst in StRoot-framework Only muDst data are decoded by this class Uses E...