42 #include "StFgtCosmicTrackMaker.h"
43 #include "StRoot/StEvent/StEvent.h"
44 #include "StRoot/StEvent/StFgtCollection.h"
45 #include "StRoot/StEvent/StFgtPoint.h"
47 #include "StFgtICosmicTrackAlgo.h"
50 StFgtCosmicTrackMaker::StFgtCosmicTrackMaker(
const Char_t* name ):
51 StMaker( name ), eventCounter(0) {
56 StFgtCosmicTrackMaker::~StFgtCosmicTrackMaker(){
62 mCosmicTrackAlgoPtr=algo;
67 Int_t StFgtCosmicTrackMaker::Init(){
70 if( !mCosmicTrackAlgoPtr ){
71 LOG_ERROR <<
"No algorithm yet set for StFgtCosmicTrackMaker" << endm;
76 mCosmicTrackAlgoPtr->Init();
85 LOG_DEBUG <<
"StFgtCosmicTrackMaker::Make()******************************************************************"<<endm;
87 if( !mCosmicTrackAlgoPtr ){
88 LOG_ERROR <<
"No algorithm set for StFgtCosmicTrackMaker" << endm;
93 eventPtr = (
StEvent*)GetInputDS(
"StEvent");
96 LOG_ERROR <<
"Error getting pointer to StEvent from '" << ClassName() <<
"'" << endm;
103 fgtCollectionPtr=eventPtr->fgtCollection();
106 if( !fgtCollectionPtr) {
107 LOG_ERROR <<
"Error getting pointer to StFgtCollection from '" << ClassName() <<
"'" << endm;
113 if( fgtCollectionPtr )
114 pointCollectionPtr = fgtCollectionPtr->getPointCollection();
116 if( !pointCollectionPtr && !ierr ){
117 LOG_ERROR <<
"Error getting pointer to StFgtPointCollection from StFgtCollection" << endm;
125 StSPtrVecFgtPoint &pointVec = pointCollectionPtr->getPointVec();
126 StSPtrVecFgtPointIterator iter;
137 for(Int_t j=0; j<3; j++) {
141 for( iter = pointVec.begin(); iter != pointVec.end(); ++iter ){
143 Int_t discId = hit->getDisc();
144 if(discId<3) {haveDisc[discId]=
true; count[discId]++;}
146 if(!haveDisc[0] || !haveDisc[1] || !haveDisc[2])
return ierr;
155 mCosmicTrackAlgoPtr->makeCosmicTracks(*pointCollectionPtr, mTrackVec, eventCounter);
165 cout <<
"StFgtCosmicTrackMaker::Finish()" << endl;
void Clear(Option_t *opt="")
User defined functions.
Represents a point in the FGT.