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;
166 dataMap[
"phi"]= std::move(
phi);
167 dataMap[
"driftR"]= std::move(driftR);
168 dataMap[
"threshold"]= std::move(
threshold);
169 dataMap[
"id"]= std::move(ident);
170 dataMap[
"sub"]= std::move(sub);
171 dataMap[
"noise"]= std::move(noise);
173 dataMap[
"bitPattern"]= std::move(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]= std::move(barcodes);
188 return FormatTool->AddToEvent(
dataTypeName(),
"", &dataMap);