6 #include <TClonesArray.h>
10 #include "EzEEsmdCal.h"
12 #include "StEEmcUtil/EEfeeRaw/EEfeeRawEvent.h"
13 #include "StEEmcUtil/EEfeeRaw/EEstarTrig.h"
14 #include "StEEmcUtil/EEfeeRaw/EEmcEventHeader.h"
16 #include "StEEmcUtil/EEfeeRaw/EEfeeDataBlock.h"
17 #include "StEEmcUtil/EEfeeRaw/EEname2Index.h"
19 #include "StEEmcUtil/database/EEmcDbItem.h"
21 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
24 #include "EEmcDb/EEmcDb.h"
26 #include "StEEmcUtil/database/StEEmcDb.h"
35 printf(
"EzEEsmdCal() constructed\n");
43 void EzEEsmdCal::init (){
49 EzEEsmdCal::~EzEEsmdCal() {}
54 void EzEEsmdCal::make(){
64 void EzEEsmdCal::unpackEzTree(){
75 void EzEEsmdCal:: unpackEzTail(){
80 for(ic=0;ic<eEve->block->GetEntries();ic++) {
82 if( !b->isValid() )
continue;
84 int crateID=b->getCrateID();
89 UShort_t*
data=b->getData();
90 int nd=b->getValidDataLen();
92 for(chan=0;chan<nd;chan++) {
93 const EEmcDbItem *x=eeDb->getByCrate(crateID,chan);
97 if(x->fail )
continue;
101 int iphi=(x->sec-1)*MaxSubSec+(x->sub-
'A');
103 assert(iphi>=0 && iphi<MaxPhiBins);
104 assert(ieta>=0 && ieta<MaxEtaBins);
112 assert(iT>=0 && iT<mxTile);
114 float rawAdc=data[chan];
115 float adc=rawAdc-x->ped;
117 tileThr[iT][ieta][iphi]=rawAdc>x->thr;
118 killT[iT][ieta][iphi]=
false;
119 if(x->gain<=0)
continue;
121 tileEne[iT][ieta][iphi]=adc/x->gain;
130 void EzEEsmdCal:: unpackEzSmd(){
134 for(ic=0;ic<eEve->block->GetEntries();ic++) {
136 if( !b->isValid() )
continue;
138 int crateID=b->getCrateID();
139 if(crateID<=MaxTwCrateID)
continue;
143 UShort_t* data=b->getData();
144 int nd=b->getValidDataLen();
146 for(chan=0;chan<nd;chan++) {
147 const EEmcDbItem *x=eeDb->getByCrate(crateID,chan);
150 if(!x->isSMD())
break;
153 if(x->fail )
continue;
155 if(x->sec!=
sectID )
continue;
157 float rawAdc=data[chan];
158 float adc=rawAdc-x->ped;
160 if(adc>maxStripAdc)
continue;
161 smdAdc[x->plane-
'U'][x->strip-1]=adc;
163 if(x->gain<=0)
continue;
164 smdEne[x->plane-
'U'][x->strip-1]=adc/x->gain;
int sectID
no. of input events
char name[StEEmcNameLen]
ASCII name of the channel, see Readme.
float smdAdc[MaxSmdPlains][MaxSmdStrips]
30 deg (only for this sector)
unsigned short killStat
DB access point.
float tileAdc[mxTile][MaxEtaBins][MaxPhiBins]