12 #include "StRoot/St_base/StMessMgr.h"
13 #include "StRoot/StEEmcPool/./EEmcTreeContainers/EEmcEnergy.h"
16 #include "StEEmcHitMakerSimple.h"
17 #include "StEEmcTowerClusterFinder.h"
18 #include "StEEmcStripClusterFinder.h"
19 #include "StEEmcPointFinder.h"
20 #include "StEEmcEnergyApportioner.h"
23 const Char_t *inputMakerName,
29 mTowerClusterFinder( towerClusterFinder ),
30 mStripClusterFinder( stripClusterFinder ),
31 mPointFinder( pointFinder ),
32 mEnergyApportioner( energyApportioner ),
33 mClusterStripsFirst( 0 ) {
50 LOG_FATAL <<
"StEEmcHitMakerSimple_t passed null pointer for TowerClusterFinder" << endm;
54 if( !ierr && !mStripClusterFinder && mDoClusterSMDStrips ){
55 LOG_FATAL <<
"StEEmcHitMakerSimple_t passed null pointer for StripClusterFinder" << endm;
59 if( !ierr && !mPointFinder ){
60 LOG_FATAL <<
"StEEmcHitMakerSimple_t passed null pointer for PointFinder" << endm;
64 if( !ierr && !mEnergyApportioner ){
65 LOG_FATAL <<
"StEEmcHitMakerSimple_t passed null pointer for EneryApportioner" << endm;
74 LOG_FATAL <<
"sub-system TowerClusterFinder is not ready" << endm;
78 if( mStripClusterFinder && !mStripClusterFinder->
isReady() ){
79 LOG_FATAL <<
"sub-system StripClusterFinder is not ready" << endm;
84 LOG_FATAL <<
"sub-system PointFinder is not ready" << endm;
88 if( !mEnergyApportioner->
isReady() ){
89 LOG_FATAL <<
"sub-system EnergyApportioner is not ready" << endm;
94 LOG_FATAL <<
"StEEmcHitMakerSimple_t cannot initialize" << endm;
97 StFinderAlg_t::setEventNum( -1 );
108 Int_t evNum = GetEventNumber();
110 evNum = StFinderAlg_t::getEventNum();
113 StFinderAlg_t::setEventNum( evNum );
123 if( mClusterStripsFirst ){
124 if( !ierr && mDoClusterSMDStrips )
125 ierr = clusterStrips();
128 ierr = clusterTowers();
131 ierr = clusterTowers();
133 if( !ierr && mDoClusterSMDStrips )
134 ierr = clusterStrips();
157 LOG_WARN <<
"StEEmcHitMakerSimple_t::find() returning error code of '" << ierr <<
"'" << endm;
174 if( mStripClusterFinder )
175 mStripClusterFinder->
clear();
177 mPointFinder->
clear();
178 if( mEnergyApportioner )
179 mEnergyApportioner->
clear();
185 Int_t StEEmcHitMakerSimple_t::clusterTowers(){
203 Int_t StEEmcHitMakerSimple_t::clusterStrips(){
207 for( Int_t sector = 0; sector < kEEmcNumSectors && !ierr; ++sector ){
212 mStripClusterFinder->setCurrentSector( sector );
216 mSmdEuEvRatio[sector] = 1;
219 if( mEEmcEnergy->nStrips ){
224 StSimpleClusterVec_t &uClusVec =
mESMDClusterVec.back().getClusterVecU();
225 StSimpleClusterVec_t &vClusVec =
mESMDClusterVec.back().getClusterVecV();
228 mStripClusterFinder->
setCurrentLayer( StEEmcStripClusterFinder_t::U_LAYER );
229 ierr = mStripClusterFinder->
find( eSMD.sec[sector].layer[0], uClusVec );
234 mStripClusterFinder->
clear();
235 mStripClusterFinder->
setCurrentLayer( StEEmcStripClusterFinder_t::V_LAYER );
236 ierr = mStripClusterFinder->
find( eSMD.sec[sector].layer[1], vClusVec );
241 if( uClusVec.empty() && vClusVec.empty() ){
246 Double_t E[2] = { 0, 0 };
249 for( Int_t layer = 0; layer < 2; ++layer ){
250 ESmdLayer_t &smdLayer = eSMD.sec[sector].layer[layer];
252 for( Int_t strip=0; strip<288; ++strip ){
256 E[layer] += elem.energy;
260 mSmdEuEvRatio[sector] = ( E[1] != 0 ? E[0] / E[1] : 1e50 );
virtual Int_t find(const EEmcEnergy_t &eemcEnergy, const StSimpleClusterVec_t &towerClusterVec, const StESMDClustersVec_t &smdClusterVec, const Double_t *smdEuEvRatio, StEEmcHitVec_t &hitVec)=0
find some some points
virtual Int_t find(ETowEnergy_t &towEnergy, StSimpleClusterVec_t &cluster)=0
find some clusters
void setCurrentLayer(LayerOfSMD_t layer)
Set current layer and sector.
StESMDClustersVec_t mESMDClusterVec
Int_t Make()
Make (loads data, for children classes to use)
StEEmcHitVec_t mHitVec
Container for hits.
virtual Int_t find(const ESmdLayer_t &smdLayer, StSimpleClusterVec_t &cluster)=0
find some clusters
Int_t Make()
Find all the hits.
void Clear(Option_t *opts="")
Clear for next event.
StEEmcHitMakerSimple_t(const Char_t *myName, const Char_t *inputMakerName, StEEmcTowerClusterFinder_t *towerClusterFinder, StEEmcStripClusterFinder_t *stripClusterFinder, StEEmcPointFinder_t *pointFinder, StEEmcEnergyApportioner_t *energyApportioner)
Construtor.
StSimpleClusterVec_t mTowerClusterVec[NUM_TOW_LAYERS]
Containers for cluster from each tower layer.
virtual void clear()
clear things before doing the finding for the next sector or layer
virtual void clear()=0
clear things before doing the finding for the next event
virtual void clear()=0
clear things before doing the finding for the next event
void resetClusterCount()
reset the count
void Clear(Option_t *opts="")
Clear for next event.
virtual Int_t find(EEmcEnergy_t *eemcEnergyPtr, const StSimpleClusterVec_t &towerClusterVec, const StESMDClustersVec_t &smdClusterVec, StEEmcHitVec_t &hitVec)=0
find some some points
Bool_t isReady() const
Check if status is ready for hit finding.
virtual void clear()=0
clear things before doing the finding for the next event
StEEmcTowerClusterFinder_t * mTowerClusterFinder
pointers to finders for subtasks
virtual ~StEEmcHitMakerSimple_t()
Deconstructor.
Bool_t mDoClusterTower[NUM_TOW_LAYERS]
boolean flags