37 #include "StFgtQaRawOctAdc.h"
38 #include "StFgtDbMaker/StFgtDbMaker.h"
39 #include "StFgtDbMaker/StFgtDb.h"
44 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
46 #include "StRoot/StEvent/StEvent.h"
47 #include "StRoot/StEvent/StFgtCollection.h"
48 #include "StRoot/StEvent/StFgtStripCollection.h"
49 #include "StRoot/StEvent/StFgtStrip.h"
50 #include "StRoot/StFgtUtil/StFgtConsts.h"
53 StFgtQaRawOctAdc::StFgtQaRawOctAdc(
const Char_t* name, Int_t tb ) :
54 StMaker( name ), mHistVec( kFgtNumOctants, (TH2F*)0 ), mTimeBin( tb ), mAdcBins(256), mAdcMin(0), mAdcMax(6*mAdcBins) {
59 StFgtQaRawOctAdc::~StFgtQaRawOctAdc(){
60 HistVec_t::iterator iter;
61 for( iter = mHistVec.begin(); iter != mHistVec.end(); ++iter )
66 Int_t StFgtQaRawOctAdc::Init(){
71 Char_t octName[2] = {
'L',
'S' };
73 for( Int_t disc = 0; disc < kFgtNumDiscs; ++disc ){
74 for( Int_t quad = 0; quad < kFgtNumDiscs; ++quad ){
75 for( Int_t oct = 0; oct < 2; ++oct, ++histIdx ){
78 ss << disc+1 << (Char_t)(quad+
'A') << octName[oct];
79 std::string label = ss.str();
83 ss <<
"h" <<
GetName() <<
"_" << histIdx;
85 Int_t chanPerOct = kFgtNumChannels*kFgtApvsPerOct;
86 mHistVec[ histIdx ] =
new TH2F( ss.str().data(),
87 ( std::string(
"Octant " ) + label +
88 "; Number of Strips; Number of Events").
data(),
89 chanPerOct, 0, chanPerOct, mAdcBins, mAdcMin, mAdcMax );
102 LOG_FATAL <<
"Error finding StFgtDbMaker" << endm;
107 StFgtDb *fgtTables = fgtDbMkr->getDbTables();
110 LOG_FATAL <<
"Error finding StFgtDb" << endm;
118 eventPtr = (
StEvent*)GetInputDS(
"StEvent");
120 LOG_ERROR <<
"Error getting pointer to StEvent in '" << ClassName() <<
"'" << endm;
123 fgtCollectionPtr=eventPtr->fgtCollection();
125 if( !fgtCollectionPtr) {
126 LOG_ERROR <<
"Error getting pointer to StFgtCollection in '" << ClassName() <<
"'" << endm;
131 for( Int_t disc = 0; disc < kFgtNumDiscs; ++disc ){
135 stripCollectionPtr = fgtCollectionPtr->getStripCollection( disc );
138 if( stripCollectionPtr ){
139 const StSPtrVecFgtStrip &stripVec = stripCollectionPtr->getStripVec();
140 StSPtrVecFgtStripConstIterator stripIter;
142 for( stripIter = stripVec.begin(); stripIter != stripVec.end(); ++stripIter ){
143 Int_t rdo, arm, apv, channel;
144 (*stripIter)->getElecCoords( rdo, arm, apv, channel );
146 Char_t layer, oct = StFgtGeom::getOctant( apv );
147 Short_t disc2, quad, strip;
148 StFgtGeom::decodeGeoId( (*stripIter)->getGeoId(), disc2, quad, layer, strip );
150 int histIdx = disc2*kFgtNumQuads*2 + quad*2 + (oct==
'S');
152 mHistVec[ histIdx ]->Fill( ((apv%12)%5)*kFgtNumChannels + channel, (*stripIter)->getAdc( mTimeBin ) );
virtual const char * GetName() const
special overload