41 return StatusCode::SUCCESS;
59 for (
const TileCell* mbtsCell : *mbtsContainer) {
64 const uint8_t qbit1 = mbtsCell->qbit1();
67 if (
msgLvl(MSG::VERBOSE)) {
68 msg(MSG::VERBOSE) <<
"Working on MBTS cell side=" <<
m_tileTBID->type(
id)
71 <<
" Energy=" << mbtsCell->energy()
72 <<
" Time=" << mbtsCell->time()
73 <<
" Qbit1=" << (int) qbit1
92 eneA += mbtsCell->energy();
93 timeA += mbtsCell->time();
95 }
else if (type_id == -1) {
96 eneC += mbtsCell->energy();
97 timeC += mbtsCell->time();
105 if (countA > 0) timeA /= countA;
106 if (countC > 0) timeC /= countC;
109 ATH_MSG_DEBUG(
"Got MBTS cells above threshold on both sides" );
110 const float timediff = fabs(timeA - timeC);
115 ATH_MSG_DEBUG(
"Event identified as background, set bit 'MBTSTimeDiffHalo' in EventInfo Background word" );
122 ATH_MSG_DEBUG(
"Event identified as collision, set bit 'MBTSTimeDiffCol' in EventInfo Background word" );
129 ATH_MSG_WARNING(
" cannot retrieve EventInfo, will not set Tile information " );
132 ATH_MSG_DEBUG(
"Not enough hits above threshold to distinguish halo from collision event");
137 if (mbtsTime.
record(std::make_unique<MBTSCollisionTime>(countA, countC, eneA, eneC, timeA, timeC)).isFailure()) {
140 ATH_MSG_DEBUG(
"MBTSCollisionTime recorded in event store" );
142 <<
" countC=" << countC
145 <<
" timeA=" << timeA
146 <<
" timeC=" << timeC );
149 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Gaudi::Property< float > m_mbts_threshold
const TileTBID * m_tileTBID
SG::WriteDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm execute once per event.
Gaudi::Property< float > m_timeDiffThreshold
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
virtual StatusCode initialize() override
Algorithm initialize at begin of job.
SG::WriteHandleKey< MBTSCollisionTime > m_mbtsCollisionTimeKey
SG::ReadHandleKey< TileCellContainer > m_mbtsContainerKey
Gaudi::Property< unsigned int > m_minHitsPerSide
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
@ Background
The beam background detectors.
EventInfo_v1 EventInfo
Definition of the latest event info version.