 |
ATLAS Offline Software
|
Go to the documentation of this file.
42 #include <CLHEP/Random/Randomize.h>
45 using CLHEP::RandGaussQ;
74 for (; itr != last; ++itr) {
124 <<
", tileNoise=" << ((
m_tileNoise) ?
"true" :
"false")
125 <<
", tileThresh=" <<
"true, thresh_hi=" <<
m_threshHi );
128 <<
", tileNoise=" << ((
m_tileNoise) ?
"true" :
"false")
129 <<
", tileThresh=" <<
"false" );
139 for (
int dr = 0;
dr < ndrawers; ++
dr) {
146 for (
int ch = 0;
ch < nchannels; ++
ch) {
156 ATH_MSG_INFO(
"TileHitToRawChannel initialization completed" );
158 return StatusCode::SUCCESS;
168 const EventContext& ctx = Gaudi::Hive::currentContext();
193 const int nChMax = 48;
194 double random[nChMax];
195 memset(random, 0,
sizeof(random));
197 int adc_gain[nChMax];
198 double adc_ampl[nChMax];
199 double adc_time[nChMax];
200 double adc_qual[nChMax];
218 <<
" is connected" );
225 <<
"Collection = 0x" << hitCollection->identify() << MSG::dec
227 <<
", drawer=" <<
drawer );
236 RandGaussQ::shootArray(*rngWrapper, nChMax, random, 0.0, 1.0);
238 for (
ch = 0;
ch < nChMax; ++
ch) {
245 memset(adc_gain, -1,
sizeof(adc_gain));
246 memset(adc_ampl, 0,
sizeof(adc_ampl));
249 memset(adc_time, 0,
sizeof(adc_time));
250 memset(adc_qual, 0,
sizeof(adc_qual));
253 for (
const TileHit* tile_hit : *hitCollection) {
263 double e_hit = tile_hit->energy();
264 double time = tile_hit->time();
270 double etime = e_hit *
time;
271 for (
int i = tile_hit->size() - 1;
i > 0; --
i) {
272 double en = tile_hit->energy(
i);
273 double ti = tile_hit->time(
i);
280 time = etime / e_hit;
286 double e_ch = e_hit * hit_calib;
311 adc_ampl[
ch] += amp_ch;
316 <<
" noise=" <<
noise
318 <<
" tot=" << adc_ampl[
ch]);
327 for (
int ch = 0;
ch < nChMax; ++
ch) {
336 double amp = adc_ampl[
ch];
350 if (fabs(amp) < fabs(
thresh))
361 auto rawChannel = std::make_unique<TileRawChannel>(adc_id, amp, adc_time[
ch], adc_qual[
ch]);
374 <<
", amp=" << amp );
380 <<
", amp=" << amp );
391 <<
" eHitTot=" << eHitTot
393 <<
" nchLG=" << nChLG
394 <<
" eChLG=" << eChLG
395 <<
" nchHG=" << nChHG
396 <<
" eChHG=" << eChHG <<
endmsg;
403 return StatusCode::SUCCESS;
410 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)
TileHitToRawChannel(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
bool msgLvl(const MSG::Level lvl) const
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
std::string m_infoName
name of the TileInfo object
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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
size_type drawer_hash_max() const
drawer hash table max size
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.
IdContext drawer_context() const
idContext for drawers
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.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
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.