5#ifndef TILERECUTILS_TILECELLBUILDERFROMHIT_H
6#define TILERECUTILS_TILECELLBUILDERFROMHIT_H
54#include "GaudiKernel/ToolHandle.h"
55#include "GaudiKernel/ServiceHandle.h"
56#include "CLHEP/Random/RandomEngine.h"
81 :
public extends<AthAlgTool, ICaloCellMakerTool>
90 virtual StatusCode
finalize()
override;
94 const EventContext& ctx)
const override;
107 "CaloNoise object to read"};
110 "Input Tile hit container key"};
119 "Output Tile MBTS container key"};
123 "Output Tile E4 prime container key"};
128 "TileSamplingFraction",
"TileSamplingFraction",
"Input Tile sampling fraction"};
149 {
this,
"RndmSvc",
"AthRNGSvc",
"Random Number Service used in TileCellBuildetFromHit" };
152 "TileBadChanTool",
"TileBadChanTool",
"Tile bad channel tool"};
158 "TileEMScale",
"TileEMScale",
"Input Tile EMS calibration constants"};
164 "TileCablingSvc",
"TileCablingSvc",
"The Tile cabling service"};
184 template<
class ITERATOR,
class COLLECTION>
187 const ITERATOR & begin,
188 const ITERATOR & end,
201 TileCell* pCell,
bool single_PMT_C10,
bool Ecell)
const;
203 void correctCell(
TileCell* pCell,
int correction,
int pmt,
int gain,
float ener,
float time,
204 unsigned char iqual,
unsigned char qbit)
const;
207 return std::min(255, abs((
int) qual));
211 int ros,
int drawer,
bool count_over,
bool good_time,
bool good_ener,
212 bool overflow,
bool underflow,
bool good_overflowfit)
const;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
object to store information about affected regions in calorimeter
defines and typedefs for IOVSvc
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
TileContainer< TileCell > TileCellContainer
Container class for CaloCell.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
const MbtsDetDescrManager * m_mbtsMgr
Pointer to MbtsDetDescrManager.
unsigned char iquality(float qual) const
int m_qualityCut
cut on channel quality (set energy to m_zeroEnergy for them)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
static const InterfaceID & interfaceID()
float m_zeroEnergy
energy to store in every PMT if both PMT are bad
bool maskBadChannel(TileDrawerEvtStatusArray &drawerEvtStatus, TileCell *pCell) const
method to check if channels are good or bad.
TileCellBuilderFromHit(const std::string &type, const std::string &name, const IInterface *parent)
Contructor.
virtual StatusCode initialize() override
Initializer.
TileDrawerEvtStatus TileDrawerEvtStatusArray[5][64]
status of every drawer
float m_maxTime
maximum time for the PMTs in the cels
const TileTBID * m_tileTBID
Pointer to TileTBID.
static const int NCELLMBTS
unsigned char qbits(TileDrawerEvtStatusArray &drawerEvtStatus, int ros, int drawer, bool count_over, bool good_time, bool good_ener, bool overflow, bool underflow, bool good_overflowfit) const
method to compute the cell quality bits
std::vector< CaloAffectedRegionInfo > m_affectedRegionInfo_current_run
method to process raw channels from a given vector and store them in collection
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
const TileDetDescrManager * m_tileMgr
Pointer to TileDetDescrManager.
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
void build(const CaloNoise *caloNoise, TileDrawerEvtStatusArray &drawerEvtStatus, const ITERATOR &begin, const ITERATOR &end, COLLECTION *coll, TileCellContainer *MBTSCells, TileCellContainer *E4prCells, const TileSamplingFraction *samplingFraction) const
static const int NCELLE4PR
const TileID * m_tileID
Pointer to TileID.
float m_minTime
minimum time for the PMTs in the cels
std::vector< CaloAffectedRegionInfo > m_affectedRegionInfo_global
TileDrawerRunStatus m_drawerRunStatus[5][64]; //!< overall status of drawer in whole run.
void correctCell(TileCell *pCell, int correction, int pmt, int gain, float ener, float time, unsigned char iqual, unsigned char qbit) const
Compute calibrated energy, time, etc.
virtual StatusCode finalize() override
const TileHWID * m_tileHWID
Pointer to TileHWID.
const TileCablingService * m_cabling
Pointer to TileCabling.
bool m_maskBadChannels
if true=> bad channels are masked
SG::WriteHandleKey< TileCellContainer > m_E4prContainerKey
virtual ~TileCellBuilderFromHit()
Destructor.
TileFragHash::TYPE m_RChType
Type of TileRawChannels (Fit, OF2, etc.)
float m_eneForTimeCutMBTS
similar cut for MBTS in pC
int e4pr_index(int phi) const
ToolHandle< ITileBadChanTool > m_tileBadChanTool
SG::ReadCondHandleKey< CaloNoise > m_caloNoiseKey
float m_noiseSigma
cell electronic noise if CaloNoise is switched off
bool maskBadChannels(TileDrawerEvtStatusArray &drawerEvtStatus, TileCell *pCell, bool single_PMT_C10, bool Ecell) const
int mbts_index(int side, int phi, int eta) const
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
ServiceHandle< IAthRNGSvc > m_rndmSvc
< Random number service to use
float m_eneForTimeCut
keep time for channels with energy above cut
SG::WriteHandleKey< TileCellContainer > m_MBTSContainerKey
This class keep detailed status info about one drawer in a given event.
Helper class for TileCal online (hardware) identifiers.
Helper class for TileCal offline identifiers.
Condition object to keep and provide Tile Calorimeter sampling fraction and number of photoelectrons.
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
const std::string process