15#include "GaudiKernel/ISvcLocator.h"
16#include "GaudiKernel/DataSvc.h"
17#include "GaudiKernel/SmartDataPtr.h"
36 const IInterface* p ):
39 declareInterface<ITRT_DriftCircleTool>(
this);
55 StatusCode
sc = AthAlgTool::initialize();
61 return StatusCode::FAILURE;
68 return StatusCode::FAILURE;
75 if (
sc.isFailure() ) {
82 ATH_MSG_DEBUG(
"Luminosity conditions data key not set. No mu correction." );
97 StatusCode
sc = AthAlgTool::finalize();
return sc;
105 bool foundInterval =
false;
106 unsigned mask = 0x02000000;
108 while ( !foundInterval && (i < 24) ) {
110 float thisTime = ((0.5+i)*3.125)-
t0;
111 if (thisTime >= lowGate && thisTime <= highGate) foundInterval =
true;
114 if (i == 7 || i == 15)
118 return foundInterval;
126InDet::TRT_DriftCircleCollection*
130 const EventContext& ctx,
132 const bool getTRTBadChannel)
const
136 InDet::TRT_DriftCircleCollection* rio =
nullptr;
145 if (not trtDetEleHandle.
isValid() or elements==
nullptr) {
153 mu = lumiData->lbAverageInteractionsPerCrossing();
161 rio =
new InDet::TRT_DriftCircleCollection(IHc);
162 rio->setIdentifier(rdo->
identify());
163 rio->reserve( std::distance(rb,
re) );
169 bool isArgonStraw =
false;
170 bool isGasSet =
false;
174 for(
r=rb;
r!=
re; ++
r) {
178 int LTbin = (*r)->driftTimeBin();
182 unsigned int word = (*r)->getWord();
196 rawTime -=
m_driftFunctionTool->driftTimeToTCorrection((*r)->timeOverThreshold(),
id, isArgonStraw);
204 double driftTime = 0.;
205 if( LTbin==0 || LTbin==24) {
210 driftTime = rawTime-
t0;
212 if(!isOK) word &= 0xF7FFFFFF;
213 else word |= 0x08000000;
216 rawTime = (0.5+LTbin)*3.125;
255 if (!isOK || Mode > 1) {
258 error = 4. / sqrt(12.);
284 <<
m_trtid->barrel_ec(
id) <<
" " <<
m_trtid->layer_or_wheel(
id) <<
" "
285 <<
m_trtid->phi_module(
id) <<
" " <<
m_trtid->straw_layer(
id) <<
" "
286 <<
m_trtid->straw(
id) <<
" data word " << MSG::hex << tdc->
getWord()
287 << MSG::dec <<
" data word raw " << MSG::hex << (*r)->getWord()
288 << MSG::dec <<
" radius " << radius <<
" err " <<
error);
291 <<
" raw time " << (0.5 + LTbin) * 3.125
293 <<
" OK? " << isOK <<
" Noise? "
294 << tdc->
isNoise() <<
" isArgon? "
297 ATH_MSG_ERROR(
"Could not create InDet::TRT_DriftCircle object !");
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
This is an Identifier helper class for the TRT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
a typed memory pool that saves time spent allocation small object.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This is a "hash" representation of an Identifier.
Virtual base class of TRT readout elements.
Class to hold collection of TRT detector elements.
const TRT_BaseElement * getDetectorElement(const IdentifierHash &hash) const
virtual Identifier identify() const override final
virtual IdentifierHash identifyHash() const override final
unsigned int getWord() const
returns the TRT dataword
bool isNoise() const
returns true if the hit is caused by noise with a high probability.
double rawDriftTime() const
returns the raw driftTime
double timeOverThreshold() const
returns Time over threshold in ns
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts