49 #include "StDaqLib/GENERIC/EventReader.hh"
57 using namespace OLDEVP;
66 memset((
char *)banks, 0,
sizeof(banks));
69 int TPCV2P0_CPP_SR::initialize()
73 padkr = detector->getPADKReader(sector);
74 if (!padkr)
return FALSE;
78 for(
int rcb = 0; rcb < 6; rcb++)
80 for(
int mz = 0; mz < 3; mz++)
82 banks[rcb][mz] = detector->getBankTPCCPPR(sector,rcb,mz);
83 classname(Bank_TPCCPPR) *cpp = banks[rcb][mz];
85 if (detector->ercpy->verbose)
86 printf(
"ASIC params sec%d RB%d MZ %d:\
87 \nLow threshold: >%d ADC counts in >%d consecutive bins\
88 \nHigh threshold: >%d ADC counts in >%d of these bins\n",
89 sector+1, rcb+1, mz+1,
90 cpp->asic_params.thresh_lo,
91 cpp->asic_params.n_seq_lo,
92 cpp->asic_params.thresh_hi,
93 cpp->asic_params.n_seq_hi);
101 for(
int rcb = 0; rcb < 6; rcb++) {
102 for(
int mz = 0; mz < 3; mz++) {
103 classname(Bank_TPCCPPR) *cpp = banks[rcb][mz];
105 *params = cpp->asic_params;
113 TPCV2P0_CPP_SR::~TPCV2P0_CPP_SR()
118 int TPCV2P0_CPP_SR::getClusters(
int PadRow,
int Pad,
126 if (PadRow==0 || PadRow>TPC_PADROWS) {
127 if (detector->ercpy->verbose)
128 printf(
" %s %d padrow not a legal value: %d\n", __FILE__,__LINE__,PadRow);
131 padkr->get(PadRow, Pad, &ent);
132 if(((mz=ent.mz) == 0) || ((rb=ent.rb) == 0)) {
133 if (detector->ercpy->verbose)
134 printf(
" %s %d mz: %d rb: %d\n", __FILE__,__LINE__,rb,mz);
135 if (detector->ercpy->verbose)
136 printf(
" PadRow %d, Pad %d\n", PadRow, Pad);
139 if (!(
void *)banks[rb-1][mz-1]) {
140 if (detector->ercpy->verbose)
141 printf(
" %s %d no CPP bank for rb: %d mz: %d\n", __FILE__,__LINE__,rb,mz);
142 if (detector->ercpy->verbose) printf(
" PadRow %d, Pad %d\n", PadRow, Pad);
147 clusters[Pad-1] = (
ASIC_Cluster *)(banks[rb-1][mz-1]->entry + 32*ent.offset);
148 for (i=0; i<31; i++) {
149 if (clusters[Pad-1][i].start_time_bin < 0)
break;
157 int TPCV2P0_CPP_SR::MemUsed()