StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcHitMaker.cxx
1 
9 #include "StEEmcHitMaker.h"
11 
13 #include "StRoot/St_base/StMessMgr.h"
14 #include "StRoot/St_base/Stypes.h"
15 #include "StRoot/StEEmcPool/./StEEmcTreeMaker/StEEmcTreeMaker.h"
16 #include "StRoot/StEEmcPool/./StEEmcTreeMaker/StEEmcEnergyMaker.h"
17 
18 const Int_t StEEmcHitMaker_t::kEEmcNumPhiBins = kEEmcNumSectors*kEEmcNumSubSectors;
19 
21 StEEmcHitMaker_t::StEEmcHitMaker_t( const Char_t *myName, const Char_t *inputMkrName )
22  : StMaker( myName ),
23  mInputMakerName( inputMkrName ),
24  mDoClusterSMDStrips(0),
25  mConstructedOK(1) // default is OK -- child class should reset
26 {
27  // default to doing nothing
28  for( Int_t i = 0; i < NUM_TOW_LAYERS; ++i )
29  mDoClusterTower[i] = 0;
30 };
31 
34  // nothing to do
35 };
36 
39  Int_t ierr = kStOK;
40 
41  // check if constructed OK
42  if( !mConstructedOK ){
43  LOG_FATAL << "StEEmcHitMaker had an error during construction phase. Init() returning kStFatal." << endm;
44  ierr = kStFatal;
45  };
46 
47  TObject *inputMaker = GetMaker( mInputMakerName.data() );
48  if( !inputMaker ){
49  LOG_FATAL << "::Init() could not get pointer to a maker with name '" << mInputMakerName << "'" << endm;
50  ierr = kStFatal;
51  };
52 
53  if( !ierr && !inputMaker->InheritsFrom( "StEEmcTreeMaker_t" ) && !inputMaker->InheritsFrom( "StEEmcEnergyMaker_t" ) ){
54  LOG_FATAL << "Input maker '" << mInputMakerName << "' does not inherit from "
55  << "StEEmcTreeMaker_t nor StEEmcEnergyMaker_t" << endm;
56  ierr = kStFatal;
57  };
58 
59  return ierr;
60 };
61 
64  Int_t ierr = kStOk;
65 
66  TObject *inputMaker = GetMaker( mInputMakerName.data() );
67  if( !inputMaker ){
68  LOG_FATAL << "::Init() could not get pointer to a maker with name '" << mInputMakerName << "'" << endm;
69  ierr = kStFatal;
70  };
71 
72  mEEmcEnergy = 0;
73  if( !ierr ){
74  if( inputMaker->InheritsFrom( "StEEmcTreeMaker_t" ) ){
75  StEEmcTreeMaker_t *treeMkr = static_cast< StEEmcTreeMaker_t* >( inputMaker );
76  mEEmcEnergy = treeMkr->getEEmcEnergy();
77  } else if ( inputMaker->InheritsFrom( "StEEmcEnergyMaker_t" ) ){
78  StEEmcEnergyMaker_t *energyMkr = static_cast< StEEmcEnergyMaker_t* >( inputMaker );
79  mEEmcEnergy = energyMkr->getEEmcEnergyPtr();
80  } else {
81  LOG_FATAL << "Input maker '" << mInputMakerName << "' does not inherit from "
82  << "StEEmcTreeMaker_t nor StEEmcEnergyMaker_t" << endm;
83  ierr = kStFatal;
84  };
85 
86  if( !mEEmcEnergy ){
87  LOG_ERROR << "Error getting EEmcEnergy_t pointer from '" << mInputMakerName << "'" << endm;
88  ierr = kStErr;
89  };
90  };
91 
92  return ierr;
93 };
94 
96 void StEEmcHitMaker_t::Clear(Option_t *){
97  clearData();
98 };
99 
101  Bool_t didIt = 0;
102 
103  if( layer < NUM_TOW_LAYERS )
104  didIt = mDoClusterTower[ layer ];
105 
106  return didIt;
107 };
108 
109 Int_t StEEmcHitMaker_t::getNumSMDClusters(){
110  Int_t n = 0;
111 
112  for( UInt_t i = 0; i<mESMDClusterVec.size(); ++i ){
113  n += mESMDClusterVec[i].getClusterVecU().size();
114  n += mESMDClusterVec[i].getClusterVecV().size();
115  };
116 
117  return n;
118 };
119 
120 ClassImp( StEEmcHitMaker_t );
121 
122 /*
123  * $Id: StEEmcHitMaker.cxx,v 1.1 2012/11/26 19:05:54 sgliske Exp $
124  * $Log: StEEmcHitMaker.cxx,v $
125  * Revision 1.1 2012/11/26 19:05:54 sgliske
126  * moved from offline/users/sgliske/StRoot/StEEmcPool/StEEmcHitMaker to StRoot/StEEmcPool/StEEmcHitMaker
127  *
128  *
129  */
StESMDClustersVec_t mESMDClusterVec
Int_t Make()
Make (loads data, for children classes to use)
StEEmcHitMaker_t(const Char_t *myName, const Char_t *inputMkrName)
Construtor.
virtual void clearData()
no copy constructor nor equals operator needed, since includes no dynamically allocated memory; ...
virtual ~StEEmcHitMaker_t()
Deconstructor.
Definition: Stypes.h:40
Int_t Init()
Initialize.
void Clear(Option_t *opts="")
Clear for next event.
static const Int_t kEEmcNumPhiBins
Include the header.
Bool_t mDoClusterTower[NUM_TOW_LAYERS]
boolean flags
Definition: Stypes.h:44
Definition: Stypes.h:41
Bool_t getIfClusteredTower(TowerLayer_t layer) const
accessors