The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::TestSuite::IntVectorsToIntsWithContextAndScale Struct Referencefinal
Inheritance diagram for Gaudi::TestSuite::IntVectorsToIntsWithContextAndScale:
Collaboration diagram for Gaudi::TestSuite::IntVectorsToIntsWithContextAndScale:

Public Member Functions

 IntVectorsToIntsWithContextAndScale (const std::string &name, ISvcLocator *svcLoc)
std::vector< int > operator() (const EventContext &ctx, const Gaudi::Functional::vector_of_const_< std::vector< int > > &intVectors, const int &scale) const override

Public Attributes

Gaudi::Property< std::vector< std::pair< int, int > > > m_mapping { this, "Mapping", {} }

Detailed Description

Definition at line 676 of file MakeAndConsume.cpp.

Constructor & Destructor Documentation

◆ IntVectorsToIntsWithContextAndScale()

Gaudi::TestSuite::IntVectorsToIntsWithContextAndScale::IntVectorsToIntsWithContextAndScale ( const std::string & name,
ISvcLocator * svcLoc )
inline

Definition at line 684 of file MakeAndConsume.cpp.

685 : SplittingMergingTransformer( name, svcLoc, { { "InputLocations", {} }, { "Scale", "/Event/MyInt" } },
686 { "OutputLocations", {} } ) {}
details::SplittingMergingTransformer< Signature, Traits_ > SplittingMergingTransformer

Member Function Documentation

◆ operator()()

std::vector< int > Gaudi::TestSuite::IntVectorsToIntsWithContextAndScale::operator() ( const EventContext & ctx,
const Gaudi::Functional::vector_of_const_< std::vector< int > > & intVectors,
const int & scale ) const
inlineoverride

Definition at line 688 of file MakeAndConsume.cpp.

690 {
691 info() << "executing with context " << ctx << ", scale " << scale << " from " << inputLocation<1>() << endmsg;
692 std::vector<int> out( outputLocationSize(), 0 );
693 for ( const auto& [l, r] : m_mapping.value() ) {
694 out[l] = std::accumulate( intVectors.at( r ).begin(), intVectors.at( r ).end(), out[l] );
695 }
696 for ( auto& value : out ) { value *= scale; }
697 return out;
698 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
decltype(auto) at(size_type i) const
Definition details.h:356
dict l
Definition gaudirun.py:591
Gaudi::Property< std::vector< std::pair< int, int > > > m_mapping

Member Data Documentation

◆ m_mapping

Gaudi::Property<std::vector<std::pair<int, int> > > Gaudi::TestSuite::IntVectorsToIntsWithContextAndScale::m_mapping { this, "Mapping", {} }

Definition at line 682 of file MakeAndConsume.cpp.

682{ this, "Mapping", {} };

The documentation for this struct was generated from the following file: