9#include "EmcRec/EmcRecDigit2Hit.h"
10#include "EmcRec/EmcRecParameter.h"
12#include "EmcCalibConstSvc/IEmcCalibConstSvc.h"
13#include "GaudiKernel/Bootstrap.h"
14#include "GaudiKernel/ISvcLocator.h"
15#include "RawDataProviderSvc/EmcRawDataProvider.h"
16#include "RawDataProviderSvc/IRawDataProviderSvc.h"
27 RecEmcDigitMap::const_iterator ciDigitMap;
35 sc = Gaudi::svcLocator()->service(
"EmcCalibConstSvc", emcCalibConstSvc );
36 if ( sc != StatusCode::SUCCESS )
44 std::string rawDataProviderSvc_name(
"RawDataProviderSvc" );
47 sc = Gaudi::svcLocator()->service( rawDataProviderSvc_name, rawDataProviderSvc );
48 if ( sc != StatusCode::SUCCESS )
53 for ( ciDigitMap = aDigitMap.begin(); ciDigitMap != aDigitMap.end(); ++ciDigitMap )
60 double ein, ecorr, eout;
71 int index = emcCalibConstSvc->
getIndex( partId, theta, phi );
85 adc2e = emaxData / 2.5;
103 aHit.
Energy( eout / GeV );
118 unsigned int module, theta, phi;
120 RecEmcHitMap::const_iterator ci_HitMap;
126 module = EmcID::EmcID::getBARREL();
137 ci_HitMap = aHitMap.find(
id );
138 if ( ci_HitMap != aHitMap.end() )
140 e = ci_HitMap->second.getEnergy();
141 ie = (int)( e * 10 );
142 if ( ie > 9 ) { ie = 9; }
154 module = EmcID::EmcID::getENDCAP_EAST();
156 module = EmcID::EmcID::getENDCAP_WEST();
161 const unsigned int module_ew )
const {
162 unsigned int module, theta, phi;
164 RecEmcHitMap::const_iterator ci_HitMap;
169 if ( module == EmcID::EmcID::getENDCAP_EAST() )
173 else if ( module == EmcID::EmcID::getENDCAP_WEST() )
187 ci_HitMap = aHitMap.find(
id );
188 if ( ci_HitMap != aHitMap.end() )
190 e = ci_HitMap->second.getEnergy();
191 ie = (int)( e * 10 );
192 if ( ie > 9 ) { ie = 9; }
199 if ( ( theta == 0 || theta == 1 ) &&
213 if ( ( theta == 0 || theta == 1 ) &&
240 ci_HitMap = aHitMap.find(
id );
241 if ( ci_HitMap != aHitMap.end() )
243 e = ci_HitMap->second.getEnergy();
244 ie = (int)( e * 10 );
245 if ( ie > 9 ) { ie = 9; }
246 if ( ( theta < 4 ) &&
252 if ( ( theta == 0 || theta == 1 ) &&
260 if ( ( theta < 4 ) &&
266 if ( ( theta == 0 || theta == 1 ) &&
map< RecEmcID, RecEmcDigit, less< RecEmcID > > RecEmcDigitMap
map< RecEmcID, RecEmcHit, less< RecEmcID > > RecEmcHitMap
static unsigned int getPHI_BARREL_MAX()
static Identifier crystal_id(const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
For a single crystal.
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
static unsigned int getTHETA_ENDCAP_MIN()
static unsigned int getTHETA_ENDCAP_MAX()
static unsigned int getTHETA_BARREL_MIN()
static unsigned int getTHETA_BARREL_MAX()
static unsigned int theta_module(const Identifier &id)
static unsigned int getPHI_ENDCAP_MAX(const unsigned int theta)
static unsigned int getPHI_ENDCAP_MIN()
static unsigned int getPHI_BARREL_MIN()
static unsigned int phi_module(const Identifier &id)
void Convert(const RecEmcDigitMap &aDigitMap, RecEmcHitMap &aHitMap)
void OutputEndcap(const RecEmcHitMap &aHitMap, const unsigned int module_ew) const
void Output(const RecEmcHitMap &aHitMap) const
static EmcRecParameter & GetInstance()
double ElectronicsNoiseLevel() const
double ElecBias(int n) const
int ElecSaturation() const
virtual double getDigiCalibConst(int No) const =0
virtual int getIndex(unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const =0
virtual double getCrystalEmaxData(int Index) const =0
virtual bool isOnlineMode()=0
RecEmcEnergy getEnergy() const
RecEmcEnergy Energy(const RecEmcEnergy &Energy)
RecEmcID CellId(const RecEmcID &CellId)
RecEmcID getCellId() const
RecEmcTime Time(const RecEmcTime &Time)