17 ISvcLocator* pSvcLocator ) :
24 void split(
const std::string&
src,
char delim, std::vector<std::string>&
result) {
25 std::istringstream
i(
src);
27 while ( getline(
i, element, delim) ) {
31 std::string
trim(
const std::string&
str) {
32 size_t firstNonSpace =
str.find_first_not_of(
' ');
33 size_t lastNonSpace =
str.find_last_not_of(
' ');
34 return str.substr( firstNonSpace, lastNonSpace-firstNonSpace+1 );
45 typedef std::vector<std::string> Split_t;
48 if (
line[0] ==
'#' )
continue;
58 split( prop,
':', keyval );
59 if ( keyval.size() != 2 ) {
60 ATH_MSG_ERROR(
"Pnput format error, property specification invalid, should be a:b " << prop );
61 return StatusCode::FAILURE;
63 object.push_back( std::make_pair(
trim ( keyval[0] ), std::stof(keyval[1]) ) );
65 if (
object.
size() != 0 )
66 event.push_back(
object);
71 if (
m_data.size() == 0 ) {
73 return StatusCode::FAILURE;
75 return StatusCode::SUCCESS;
80 return StatusCode::SUCCESS;
87 const EventContext& context = Gaudi::Hive::currentContext();
88 const size_t eventNo = context.evt() %
m_data.size();
91 auto output = std::make_unique<xAOD::TrigCompositeContainer>();
92 auto aux = std::make_unique<xAOD::TrigCompositeAuxContainer>();
93 output->setStore( aux.get() );
97 ATH_MSG_DEBUG(
"Input " <<
m_input.key() <<
" has "<<inputHandle->size() <<
" elements, scanning it");
98 for (
auto i: *inputHandle.cptr() ) {
99 auto featureInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>(
i,
"initialRoI" );
100 auto roiLink = featureInfo.link;
101 CHECK( roiLink.isValid() );
102 if ( roiLink.isValid() ) {
103 auto roiPtr(roiLink.cptr());
109 output->push_back( xobj );
111 xobj->setObjectLink(
"initialRoI", roiLink );
114 for (
const auto& prop :
object ) {
115 xobj->setDetail( prop.first, prop.second );
120 ATH_MSG_DEBUG(
"No reco object created for this RoI because it's not found in the event");
131 CHECK( handle.record( std::move(
output), std::move(aux) ) );
133 return StatusCode::SUCCESS;