|
ATLAS Offline Software
|
Go to the documentation of this file.
42 #include <CLHEP/Random/Randomize.h>
45 using CLHEP::RandGaussQ;
77 for (; itr != last; ++itr) {
127 <<
", tileNoise=" << ((
m_tileNoise) ?
"true" :
"false")
128 <<
", tileThresh=" <<
"true, thresh_hi=" <<
m_threshHi );
131 <<
", tileNoise=" << ((
m_tileNoise) ?
"true" :
"false")
132 <<
", tileThresh=" <<
"false" );
142 for (
int dr = 0;
dr < ndrawers; ++
dr) {
149 for (
int ch = 0;
ch < nchannels; ++
ch) {
159 ATH_MSG_INFO(
"TileHitToRawChannel initialization completed" );
161 return StatusCode::SUCCESS;
171 const EventContext& ctx = Gaudi::Hive::currentContext();
196 const int nChMax = 48;
197 double random[nChMax];
198 memset(random, 0,
sizeof(random));
200 int adc_gain[nChMax];
201 double adc_ampl[nChMax];
202 double adc_time[nChMax];
203 double adc_qual[nChMax];
221 <<
" is connected" );
228 <<
"Collection = 0x" << hitCollection->identify() << MSG::dec
230 <<
", drawer=" <<
drawer );
239 RandGaussQ::shootArray(*rngWrapper, nChMax, random, 0.0, 1.0);
241 for (
ch = 0;
ch < nChMax; ++
ch) {
248 memset(adc_gain, -1,
sizeof(adc_gain));
249 memset(adc_ampl, 0,
sizeof(adc_ampl));
252 memset(adc_time, 0,
sizeof(adc_time));
253 memset(adc_qual, 0,
sizeof(adc_qual));
256 for (
const TileHit* tile_hit : *hitCollection) {
266 double e_hit = tile_hit->energy();
267 double time = tile_hit->time();
273 double etime = e_hit *
time;
274 for (
int i = tile_hit->size() - 1;
i > 0; --
i) {
275 double en = tile_hit->energy(
i);
276 double ti = tile_hit->time(
i);
283 time = etime / e_hit;
289 double e_ch = e_hit * hit_calib;
314 adc_ampl[
ch] += amp_ch;
319 <<
" noise=" <<
noise
321 <<
" tot=" << adc_ampl[
ch]);
330 for (
int ch = 0;
ch < nChMax; ++
ch) {
339 double amp = adc_ampl[
ch];
353 if (fabs(amp) < fabs(
thresh))
364 auto rawChannel = std::make_unique<TileRawChannel>(adc_id, amp, adc_time[
ch], adc_qual[
ch]);
377 <<
", amp=" << amp );
383 <<
", amp=" << amp );
394 <<
" eHitTot=" << eHitTot
396 <<
" nchLG=" << nChLG
397 <<
" eChLG=" << eChLG
398 <<
" nchHG=" << nChHG
399 <<
" eChHG=" << eChHG <<
endmsg;
406 return StatusCode::SUCCESS;
413 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
float getSamplingFraction(unsigned int drawerIdx, unsigned int channel) const
Return Tile Calorimeter sampling fraction.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
bool m_calibrateEnergy
if true, amplitude is converted to pCb
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
TileFragHash::TYPE m_rChType
Type of TileRawChannels (Digitizar, OF1, OF2, Fit, etc.)(see TileFragHash.h)
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
virtual int get_id(const IdentifierHash &hash_id, HWIdentifier &id, const IdContext *context=0) const
create compact HW ID from hash id (return == 0 for OK)
const TileID * m_tileID
Pointer to TileID helper.
TileRawChannelUnit::UNIT m_rChUnit
Units used for the TileRawChannels (ADC, pCb, etc.)(see TileInfo.h)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
TileHitToRawChannel(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
bool msgLvl(const MSG::Level lvl) const
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
size_type drawer_hash_max(void) const
drawer hash table max size
std::string m_infoName
name of the TileInfo object
IdContext drawer_context(void) const
idContext for drawers
virtual StatusCode execute() override
execute method
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
#define ATH_MSG_VERBOSE(x)
Hash table for Tile fragments (==drawers ==collections in StoreGate)
const TileHWID * m_tileHWID
Pointer to TileHWID helper.
double m_threshHi
Value of the mimimal amplitude required to do the conversion to raw channel in high gain (not used fo...
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
double ThresholdRawChannel(int) const
Return the threshold value for good (filtered) TileRawChannels.
ServiceHandle< IAthRNGSvc > m_atRndmGenSvc
Random number generator engine to use.
float calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const
Calibrate a Tile channel.
Handle class for recording to StoreGate.
double m_deltaT
if true, keep only hits in deltaT range
virtual IdentifierHash get_hash(const HWIdentifier &id) const
create hash id from compact ADC id without error checking
::StatusCode StatusCode
StatusCode definition for legacy code.
bool m_tileThresh
If true => apply threshold on the conversion to raw channels.
float getNoiseScaleFactor(void) const
Conversion from ADC sigma noise to OF sigma noise.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const TileTBID * m_tileTBID
Pointer to TileID helper.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual ~TileHitToRawChannel()
Destructor
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
A wrapper class for event-slot-local random engines.
HWIdentifier channel_id(int ros, int drawer, int channel) const
channel HWIdentifer
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(bool used=true)
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
std::vector< HWIdentifier * > m_all_ids
Vector to store all the drawer ids.
bool TileNoise() const
Noise switched on/off?
const TileCablingService * m_cabling
Pointer to the TileCablingService instance.
HWIdentifier adc_id(int ros, int drawer, int channel, int adc) const
adc HWIdentifer
Helper for holding non-const raw data prior to recording in SG.
bool TileZeroSuppress() const
Zero suppression switched on/off?
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
def time(flags, cells_name, *args, **kw)
std::string to_string(const Identifier &id, int level=0) const
const TileInfo * m_tileInfo
Pointer to TileInfo.
bool connected(int ros, int drawer) const
virtual StatusCode initialize() override
initialize method
double m_ampMaxHi
Value of the maximum amplitude to be stored as a high gain channel.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
Handle class for reading from StoreGate.
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
virtual StatusCode finalize() override
finalize method
int ADCmax() const
Returns the maximum ADC output (10 bits --> 1023)
bool m_tileNoise
If true => generate noise for the TileRawChannel creation.