Go to the documentation of this file.
36 using extends::extends;
45 construct<BoundInstance>(
this ) } {}
54 parent->always() <<
"BoundInstance - got: " << i <<
" from " << parent->inputLocation<
int>() <<
endmsg;
64 :
Consumer(
name, svcLoc, KeyValue{
"MyTool",
"MyExampleTool" } ) {}
77 always() <<
"CountingConsumer: incrementing \"This is not an error\" twice" <<
endmsg;
81 always() <<
"CountingConsumer: incrementing \"This is not a warning\" twice" <<
endmsg;
85 always() <<
"CountingConsumer: incrementing \"This is not info\" twice" <<
endmsg;
96 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyInt" ) ) {}
99 info() <<
"executing IntDataProducer, storing " << m_value.value() <<
" into " << outputLocation() <<
endmsg;
113 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVector" ) ) {}
116 info() <<
"executing VectorDataProducer, storing " << m_data.value() <<
" into " << outputLocation() <<
endmsg;
127 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyKeyed" ) ) {}
135 info() <<
"executing KeyedDataProducer, storing [4,5] into " << outputLocation() <<
endmsg;
145 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ) ) {}
148 info() <<
"executing IntDataConsumer, consuming " << input <<
" from " << inputLocation() <<
endmsg;
157 :
Transformer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ),
158 KeyValue(
"OutputLocation",
"/Event/MyFloat" ) ) {}
161 info() <<
"Converting: " << input <<
" from " << inputLocation() <<
" and storing it into " << outputLocation()
173 { KeyValue(
"InputLocation",
"/Event/MyInt" ), KeyValue{
"OtherInput",
"/Event/MyOtherFloat" } },
174 KeyValue(
"OutputLocation",
"/Event/OtherFloat" ) ) {}
176 float operator()(
const int& in1,
const float& in2 )
const override {
177 info() <<
"Converting: " << in1 <<
" from " << inputLocation<int>() <<
" and " << in2 <<
" from "
178 << inputLocation<float>() <<
" and storing it into " << outputLocation() <<
endmsg;
189 { KeyValue(
"InputLocation1", {
"/Event/MyInt" } ),
190 KeyValue(
"InputLocation2", {
"/Event/MyOtherInt" } ) },
191 { KeyValue(
"OutputLocation1", {
"/Event/MyMultiFloat1" } ),
192 KeyValue(
"OutputLocation2", {
"/Event/MyMultiFloat2" } ) } ) {}
195 info() <<
"Number of inputs : " << inputLocationSize() <<
", number of outputs : " << outputLocationSize()
197 info() <<
"Converting " << input1 <<
" from " << inputLocation<0>() <<
" and " << input2 <<
" from "
198 << inputLocation<1>() <<
endmsg;
199 info() <<
"Storing results into " << outputLocation<0>() <<
" and " << outputLocation<1>() <<
endmsg;
214 {
"OutputLocation",
"/Event/MyConcatenatedIntVector" } ) {}
219 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
220 [](
const auto a,
const auto b ) { return a + b.size(); } );
222 out.reserve( nelements );
224 for (
const auto& intVector : intVectors ) {
225 info() <<
"Concatening vector " << intVector <<
endmsg;
226 out.insert(
out.end(), intVector.begin(), intVector.end() );
228 info() <<
"Storing output vector " <<
out <<
" to " << outputLocation() <<
endmsg;
238 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyFloat" ) ) {}
241 info() <<
"executing FloatDataConsumer: " << input <<
endmsg;
252 info() <<
"executing ContextConsumer, got " <<
ctx <<
endmsg;
261 :
Transformer(
name, svcLoc, KeyValue{
"OutputLoc",
"/Event/SomeOtherInt" } ) {}
264 info() <<
"executing ContextConsumer, got " <<
ctx <<
endmsg;
274 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ) ) {}
277 info() <<
"executing ContextIntConsumer, got context = " <<
ctx <<
", int = " << i <<
endmsg;
286 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVectorOfDoubles" ) ) {}
289 info() <<
"storing vector<double> into " << outputLocation() <<
endmsg;
290 return { 12.34, 56.78, 90.12, 34.56, 78.90 };
297 :
Gaudi::Functional::MultiScalarTransformer<
301 : MultiScalarTransformer(
name, svcLoc, KeyValue{
"InputDoubles", {
"/Event/MyVectorOfDoubles" } },
302 { KeyValue{
"OutputFractions", {
"/Event/MyVectorOfFractions" } },
303 KeyValue{
"OutputIntegers", {
"/Event/MyVectorOfIntegers" } } } ) {}
305 using MultiScalarTransformer::operator();
310 info() <<
"Converting " << d <<
" -> " << frac <<
", " << i <<
endmsg;
317 :
Gaudi::Functional::MultiScalarTransformer<
321 : MultiScalarTransformer(
name, svcLoc, KeyValue{
"InputDoubles", {
"/Event/MyVectorOfDoubles" } },
322 { KeyValue{
"OutputFractions", {
"/Event/OptMyVectorOfFractions" } },
323 KeyValue{
"OutputIntegers", {
"/Event/OptMyVectorOfIntegers" } } } ) {}
325 using MultiScalarTransformer::operator();
327 std::optional<std::tuple<double, int>>
operator()(
const double& d )
const {
329 info() <<
"Skipping " << d <<
endmsg;
334 info() <<
"Converting " << d <<
" -> " << frac <<
", " << i <<
endmsg;
341 :
Gaudi::Functional::ScalarTransformer<
344 : ScalarTransformer(
name, svcLoc,
345 { KeyValue{
"InputFractions", {
"/Event/MyVectorOfFractions" } },
346 KeyValue{
"InputIntegers", {
"/Event/MyVectorOfIntegers" } } },
347 { KeyValue{
"OutputDoubles", {
"/Event/MyNewVectorOfDoubles" } } } ) {}
349 using ScalarTransformer::operator();
353 info() <<
"Converting " << i <<
", " << frac <<
" -> " << d <<
endmsg;
364 : ScalarTransformer(
name, svcLoc,
365 { KeyValue{
"InputFractions", {
"/Event/MyVectorOfFractions" } },
366 KeyValue{
"InputIntegers", {
"/Event/MyVectorOfIntegers" } } },
367 { KeyValue{
"OutputDoubles", {
"/Event/MyOptVectorOfDoubles" } } } ) {}
369 using ScalarTransformer::operator();
371 std::optional<double>
operator()(
const double& frac,
const int& i )
const {
374 info() <<
"Skipping " << d <<
endmsg;
377 info() <<
"Converting " << i <<
", " << frac <<
" -> " << d <<
endmsg;
403 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyS" ) ) {}
407 for (
int i = 0; i <
j; ++i )
out.insert(
new S{} );
408 info() <<
"storing KeyedContainer of size " <<
out.size() <<
" into " << outputLocation() <<
endmsg;
423 {
"OutputLocation",
"/Event/MyConcatenatedIntFromSVector" } ) {}
429 for (
const auto& SVector : SVectors ) {
430 info() <<
"Concatening range of size " << SVector.size() <<
endmsg;
431 for (
auto*
s : SVector ) {
out.push_back(
s->a ); }
433 info() <<
"Storing output vector " <<
out <<
" to " << outputLocation() <<
endmsg;
449 OptSVectors )
const override {
451 for (
const auto& OptSVector : OptSVectors ) {
452 if ( OptSVector.has_value() ) {
453 auto SVector = OptSVector.value();
454 info() <<
"Consuming vector of size: " << SVector.size() <<
endmsg;
456 info() <<
"Skipping empty optional range" <<
endmsg;
472 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
473 [](
const auto a,
const auto b ) { return a + b.size(); } );
474 info() <<
"sum of input sizes: " << nelements <<
endmsg;
476 for (
const auto& intVector : intVectors ) { info() <<
"Consuming vector " << intVector <<
endmsg; }
490 :
Base(
name, svcLoc, {
"InputLocations", {} } ) {}
494 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
495 [](
const auto a,
const auto b ) { return a + b.size(); } );
496 info() <<
"sum of input sizes: " << nelements <<
endmsg;
498 for (
const auto& intVector : intVectors ) { info() <<
"Consuming vector " << intVector <<
endmsg; }
512 :
Producer(
name, pSvcLocator, KeyValue{
"TrackLocation",
"" } ){};
523 const
Gaudi::Functional::vector_of_const_<
std::
vector<
double>>& ),
527 : MergingMultiTransformer{
name,
529 { KeyValues{
"InputInts", {} }, KeyValues{
"InputDoubles", {} } },
530 { KeyValue{
"OutputInts",
"/Event/MySummedInts" },
531 KeyValue{
"OutputDoubles",
"/Event/MySummedDoubles" } } } {}
540 always() <<
" accumulated: " << is <<
endmsg;
543 always() <<
" accumulated: " << ds <<
endmsg;
564 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MySharedFoo" ) ) {}
568 info() <<
"executing ShrdPtrProducer, storing shared_ptr<Foo> with payload at " << foo.get() <<
" and value "
569 << foo->i <<
" into " << outputLocation() <<
endmsg;
581 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MySharedFoo" ) ) {}
584 info() <<
"executing ShrdPtrConsumer, got shared_ptr<Foo> with payload at " << foo.
get() <<
" with value "
585 << foo->
i <<
" from " << inputLocation() <<
endmsg;
606 for (
const auto& iv : intVectors ) { info() <<
"loaded " << iv <<
" from " << inputLocation(
l++ ) <<
endmsg; }
608 for (
const auto& [
l, r] : m_mapping.value() ) {
612 for (
const auto& o :
out ) { info() <<
"storing " << o <<
" in " << outputLocation(
l++ ) <<
endmsg; }
625 : parent{ std::exchange( other.parent,
nullptr ) },
action{ std::exchange( other.action,
nullptr ) } {}
627 parent = std::exchange( other.parent,
nullptr );
628 action = std::exchange( other.action,
nullptr );
639 Gaudi::Functional::Traits::use_<BaseClass_t, Gaudi::Functional::Traits::WriteOpaqueFor<Eventually>>> {
642 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/Eventually" ) ) {}
645 always() <<
"creating Eventually" <<
endmsg;
647 me->always() <<
"My Eventually is about to be destroyed" <<
endmsg;
658 # define TestSuite Examples
RangeProducer(const std::string &name, ISvcLocator *pSvcLocator)
IntVectorsMergingConsumer(const std::string &name, ISvcLocator *svcLoc)
OpaqueProducer(const std::string &name, ISvcLocator *svcLoc)
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingTransformer
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
std::vector< int > operator()() const override
ContextTransformer(const std::string &name, ISvcLocator *svcLoc)
TwoDMerger(const std::string &name, ISvcLocator *svcLoc)
KeyedDataProducer(const std::string &name, ISvcLocator *svcLoc)
VectorDoubleProducer(const std::string &name, ISvcLocator *svcLoc)
IntToFloatData(const std::string &name, ISvcLocator *svcLoc)
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< Gaudi::Range_< std::vector< S const * >>> &SVectors) const override
IntDataProducer(const std::string &name, ISvcLocator *svcLoc)
KeyedObject()=default
Standard Constructor. The object key is preset to the invalid value.
std::tuple< std::vector< int >, std::vector< double > > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors, const Gaudi::Functional::vector_of_const_< std::vector< double >> &doubleVectors) const override
void operator()(const std::shared_ptr< Foo > &foo) const override
void operator()(Gaudi::Functional::vector_of_const_< std::vector< int >> const &intVectors) const override
transform a vector of vector of int to a vector of int, where the output vector of in is scattered in...
T back_inserter(T... args)
Eventually(Eventually const &)=delete
FloatDataConsumer(const std::string &name, ISvcLocator *svcLoc)
Foo & operator=(const Foo &)=delete
ShrdPtrConsumer(const std::string &name, ISvcLocator *svcLoc)
Eventually operator()() const override
void operator()() const override
Base class to be used to extend an interface.
Eventually(Gaudi::Algorithm const *p, void(*a)(Gaudi::Algorithm const *))
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingConsumer
void operator()(const Gaudi::Functional::vector_of_const_< std::optional< Gaudi::NamedRange_< std::vector< S const * >>>> &OptSVectors) const override
details::ToolBinder< Signature, Traits_ > ToolBinder
long add(ContainedObject *pObject) override
ObjectContainerBase overload: Add an object to the container.
VectorDataProducer(const std::string &name, ISvcLocator *svcLoc)
IntIntToFloatFloatData(const std::string &name, ISvcLocator *svcLoc)
AttribStringParser::Iterator begin(const AttribStringParser &parser)
void operator()(const int &input) const override
OptionalSRangesMerger(const std::string &name, ISvcLocator *svcLoc)
details::Producer< Signature, Traits_, details::isLegacy< Traits_ > > Producer
Eventually(Eventually &&other)
Base class from which all concrete algorithm classes should be derived.
Concatenates a list of input vectors into a single output vector.
Eventually & operator=(Eventually &&other)
int operator()(const EventContext &ctx) const override
const ValueType & value() const
void operator()(const float &input) const override
IntVectorsMerger(const std::string &name, ISvcLocator *svcLoc)
float operator()(const int &in1, const float &in2) const override
int operator()() const override
IntVectorsToInts(const std::string &name, ISvcLocator *svcLoc)
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
IntFloatToFloatData(const std::string &name, ISvcLocator *svcLoc)
std::shared_ptr< Foo > operator()() const override
template class KeyedContainer, KeyedContainer.h
Definition of the templated KeyedObject class.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Base class used to extend a class implementing other interfaces.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
IntDataConsumer(const std::string &name, ISvcLocator *svcLoc)
details::MultiTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MultiTransformer
Gaudi::Property< int > m_value
std::tuple< float, float > operator()(const int &input1, const int &input2) const override
Foo & operator=(Foo &&)=delete
struct GAUDI_API vector
Parametrisation class for vector-like implementation.
float operator()(const int &input) const override
#define DECLARE_COMPONENT(type)
details::SplittingMergingTransformer< Signature, Traits_, false > SplittingMergingTransformer
S::Container operator()() const override
SRangesToIntVector(const std::string &name, ISvcLocator *svcLoc)
void operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
IntVectorsToIntVector(const std::string &name, ISvcLocator *svcLoc)
std::vector< double > operator()() const override
details::Transformer< Signature, Traits_, details::isLegacy< Traits_ > > Transformer
ShrdPtrProducer(const std::string &name, ISvcLocator *svcLoc)
int_container operator()() const override
MyDataRange operator()() const override
SDataProducer(const std::string &name, ISvcLocator *svcLoc)
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
void operator()(const EventContext &ctx) const override
ContextIntConsumer(const std::string &name, ISvcLocator *svcLoc)
void operator()() const override
void operator()(const EventContext &ctx, const int &i) const override
Eventually & operator=(Eventually const &)=delete
Concatenates a list of input vectors into a single output vector.