28 declareInterface<IDataRetriever>(
this);
39 return StatusCode::SUCCESS;
48 if ( !DriftCircleContainer.
isValid() ) {
50 return StatusCode::RECOVERABLE;
57 if ( !TRTMultiTruthMap.
isValid() ){
64 unsigned long NDriftCircleTotal = 0;
66 for (
const auto DriftCircleColl : *DriftCircleContainer)
67 NDriftCircleTotal += DriftCircleColl->size();
70 ATH_MSG_VERBOSE(
"Reserving space for " << NDriftCircleTotal <<
" entries" );
73 DataVect rhoz; rhoz.reserve(NDriftCircleTotal);
75 DataVect driftR; driftR.reserve(NDriftCircleTotal);
77 DataVect ident; ident.reserve(NDriftCircleTotal);
78 DataVect sub; sub.reserve(NDriftCircleTotal);
79 DataVect noise; noise.reserve(NDriftCircleTotal);
81 DataVect bitPattern; bitPattern.reserve(NDriftCircleTotal);
82 DataVect numBarcodes; numBarcodes.reserve(NDriftCircleTotal);
83 DataVect barcodes; barcodes.reserve(NDriftCircleTotal);
86 for (
const auto DriftCircleColl : *DriftCircleContainer) {
89 for (
const auto driftcircle : *DriftCircleColl){
99 if (!
id.is_valid()) {
100 ATH_MSG_DEBUG(
"Ignoring TRT_DriftCircle with invalid identifier " <<
id );
105 ident.push_back(
DataType(
id.get_compact()));
117 phi.push_back(
DataType( (global.phi()<0) ? global.phi() + 2*
M_PI : global.phi()));
121 rhoz.push_back(
DataType(global.perp()*CLHEP::mm/CLHEP::cm));
123 rhoz.push_back(
DataType(global.z()*CLHEP::mm/CLHEP::cm));
131 switch (
m_geo->TRTIDHelper()->barrel_ec(
id) ) {
132 case -2 : sub.push_back(
DataType( 0 ));
break;
133 case -1 : sub.push_back(
DataType( 1 ));
break;
134 case 1 : sub.push_back(
DataType( 2 ));
break;
135 case 2 : sub.push_back(
DataType( 3 ));
break;
136 default : sub.push_back(
DataType(-1 ));
142 noise.push_back(
DataType(driftcircle->isNoise()));
143 bitPattern.push_back(
DataType(driftcircle->getWord()));
153 using iter = PRD_MultiTruthCollection::const_iterator;
154 std::pair<iter,iter> equalIDRange = TRTMultiTruthMap->equal_range(
id);
155 for ( iter TRTMultiTruthMapItr = equalIDRange.first; TRTMultiTruthMapItr != equalIDRange.second; ++TRTMultiTruthMapItr){
157 barcodes.push_back(
DataType(TRTMultiTruthMapItr->second.barcode()));
159 numBarcodes.push_back(
DataType(NBarcodes));
165 dataMap[
"rhoz"]=rhoz;
167 dataMap[
"driftR"]=driftR;
171 dataMap[
"noise"]=noise;
173 dataMap[
"bitPattern"]=bitPattern;
176 if ( numBarcodes.size() > 0 ){
178 dataMap[
"numBarcodes"]=numBarcodes;
180 std::string bctag =
"barcodes multiple=\""+
DataType(barcodes.size()/
double(numBarcodes.size())).toString()+
"\"";
181 dataMap[bctag]=barcodes;
188 return FormatTool->AddToEvent(
dataTypeName(),
"", &dataMap);
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
This is an Identifier helper class for the TRT subdetector.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Virtual base class of TRT readout elements.
virtual TRT_BaseElement::Type type() const =0
Type information: returns BARREL or ENDCAP.
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
bool m_useTRTTruthMap
The StoreGate key for the TRT MultiTruthMap with the track associations.
virtual StatusCode initialize()
initialize only geo model tool
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_TRTDriftCircleCollKey
The StoreGate key for the TRT Cluster collection to retrieve.
virtual std::string dataTypeName() const
Return the name of the data type.
const ToolHandle< IInDetGeoModelTool > m_geo
A tool handle to the geo model tool.
SG::ReadHandleKey< PRD_MultiTruthCollection > m_TRTTruthMapKey
TRTRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
double timeOverThreshold(unsigned int m_word)
Eigen::Matrix< double, 3, 1 > Vector3D
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())