22 #include "StDAQReader.h"
23 #include "StPMDReader.h"
24 #include "StDaqLib/PMD/PMD_Reader.hh"
30 fPMDImpReader = ::getPMDReader(daqr->getEventReader());
37 StPMDReader::~StPMDReader() {
40 int StPMDReader::close() {
44 int StPMDReader::Update() {
46 fPMDImpReader = ::getPMDReader(fDAQReader->getEventReader());
59 int StPMDReader::NPMDHits()
61 return (fPMDImpReader) ? fPMDImpReader->NPMDHits():0;
64 void StPMDReader::getPMD_ADC()
66 if (fPMDImpReader) {mPmd = fPMDImpReader->getPMD_ADC();}
67 else {memset(&mPmd,0,
sizeof(mPmd)); }
70 int StPMDReader::getNoOfChannelsInCramBlock(
int sec,
int cram,
int blk)
72 return mPmd.no_of_channels_in_cram_blk[sec][cram][blk] ;
75 int StPMDReader::getAllPmdCpvData(
int *adc)
78 for(
int sec=0; sec<PMD_SECTOR; sec++){
79 for(
int cram=0; cram< PMD_CRAMS_MAX; cram++){
80 for(
int blk=0; blk <PMD_CRAMS_BLOCK; blk++ ){
81 for(
int ch=0; ch < PMD_CRAMS_CH_MAX; ch++, adc++){
82 *adc=mPmd.adc[sec][cram][blk][ch];
91 int StPMDReader::getAllPmdCpvDataChannelByChannel(
int sec,
int cram,
int blk,
int channel)
93 return mPmd.adc[sec][cram][blk][channel];
96 int StPMDReader::getNoOfChannelsInPmdChain(
int chain_no)
104 return mPmd.no_of_channels_in_cram_blk[sec][cram][blk] ;
107 int StPMDReader::getPmdChainData(
int chain_no,
int *
data)
109 int sec, cram, blk, channel;
110 cram=chain_no; blk=0;
115 for(channel=0; channel < PMD_CRAMS_CH_MAX; channel++ , data++){
116 *data= mPmd.adc[sec][cram][blk][channel];
119 return mPmd.no_of_channels_in_cram_blk[sec][cram][blk] ;
123 int StPMDReader::getNoOfChannelsInCpvChain(
int chain_no)
126 cram=chain_no; blk=1;
131 return mPmd.no_of_channels_in_cram_blk[sec][cram][blk] ;
134 int StPMDReader::getCpvChainData(
int chain_no,
int *data)
136 int sec, cram, blk, channel;
137 cram=chain_no; blk=1;
142 for(channel=0; channel <PMD_CRAMS_CH_MAX; channel++ , data++){
143 *data= mPmd.adc[sec][cram][blk][channel];
146 return mPmd.no_of_channels_in_cram_blk[sec][cram][blk] ;
149 int StPMDReader::getAllPmdCpvPed(
int *ped)
152 for(
int sec=0; sec<PMD_SECTOR; sec++){
153 for(
int cram=0; cram< PMD_CRAMS_MAX; cram++){
154 for(
int blk=0; blk <PMD_CRAMS_BLOCK; blk++ ){
155 for(
int ch=0; ch < PMD_CRAMS_CH_MAX; ch++, ped++){
156 *ped=mPmd.ped[sec][cram][blk][ch];
157 if(mPmd.ped[sec][cram][blk][ch]>0)no_ch++;
164 int StPMDReader::getAllPmdCpvRms(
int *rms)
167 for(
int sec=0; sec<PMD_SECTOR; sec++){
168 for(
int cram=0; cram< PMD_CRAMS_MAX; cram++){
169 for(
int blk=0; blk <PMD_CRAMS_BLOCK; blk++ ){
170 for(
int ch=0; ch < PMD_CRAMS_CH_MAX; ch++, rms++){
171 *rms=mPmd.rms[sec][cram][blk][ch];
172 if(mPmd.rms[sec][cram][blk][ch]>0)no_ch++;