29 declareInterface<IDataRetriever>(
this);
40 return StatusCode::SUCCESS;
49 if ( !DriftCircleContainer.
isValid() ) {
51 return StatusCode::RECOVERABLE;
58 if ( !TRTMultiTruthMap.
isValid() ){
65 unsigned long NDriftCircleTotal = 0;
67 for (
const auto DriftCircleColl : *DriftCircleContainer)
68 NDriftCircleTotal += DriftCircleColl->size();
71 ATH_MSG_VERBOSE(
"Reserving space for " << NDriftCircleTotal <<
" entries" );
74 DataVect rhoz; rhoz.reserve(NDriftCircleTotal);
76 DataVect driftR; driftR.reserve(NDriftCircleTotal);
78 DataVect ident; ident.reserve(NDriftCircleTotal);
79 DataVect sub; sub.reserve(NDriftCircleTotal);
80 DataVect noise; noise.reserve(NDriftCircleTotal);
82 DataVect bitPattern; bitPattern.reserve(NDriftCircleTotal);
83 DataVect numBarcodes; numBarcodes.reserve(NDriftCircleTotal);
84 DataVect barcodes; barcodes.reserve(NDriftCircleTotal);
87 for (
const auto DriftCircleColl : *DriftCircleContainer) {
90 for (
const auto driftcircle : *DriftCircleColl){
100 if (!
id.is_valid()) {
101 ATH_MSG_DEBUG(
"Ignoring TRT_DriftCircle with invalid identifier " <<
id );
106 ident.push_back(
DataType(
id.get_compact()));
118 phi.push_back(
DataType( (global.phi()<0) ? global.phi() + 2*
M_PI : global.phi()));
122 rhoz.push_back(
DataType(global.perp()*CLHEP::mm/CLHEP::cm));
124 rhoz.push_back(
DataType(global.z()*CLHEP::mm/CLHEP::cm));
132 switch (
m_geo->TRTIDHelper()->barrel_ec(
id) ) {
133 case -2 : sub.push_back(
DataType( 0 ));
break;
134 case -1 : sub.push_back(
DataType( 1 ));
break;
135 case 1 : sub.push_back(
DataType( 2 ));
break;
136 case 2 : sub.push_back(
DataType( 3 ));
break;
137 default : sub.push_back(
DataType(-1 ));
143 noise.push_back(
DataType(driftcircle->isNoise()));
144 bitPattern.push_back(
DataType(driftcircle->getWord()));
154 using iter = PRD_MultiTruthCollection::const_iterator;
155 std::pair<iter,iter> equalIDRange = TRTMultiTruthMap->equal_range(
id);
156 for ( iter TRTMultiTruthMapItr = equalIDRange.first; TRTMultiTruthMapItr != equalIDRange.second; ++TRTMultiTruthMapItr){
158 barcodes.push_back(
DataType(TRTMultiTruthMapItr->second.barcode()));
160 numBarcodes.push_back(
DataType(NBarcodes));
166 dataMap[
"rhoz"]=rhoz;
168 dataMap[
"driftR"]=driftR;
172 dataMap[
"noise"]=noise;
174 dataMap[
"bitPattern"]=bitPattern;
177 if ( numBarcodes.size() > 0 ){
179 dataMap[
"numBarcodes"]=numBarcodes;
181 std::string bctag =
"barcodes multiple=\""+
DataType(barcodes.size()/
double(numBarcodes.size())).toString()+
"\"";
182 dataMap[bctag]=barcodes;
189 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)
defines an "iterator" over instances of a given type in StoreGateSvc
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())