Go to the documentation of this file.
35 using extends::extends;
44 construct<BoundInstance>(
this ) } {}
53 parent->always() <<
"BoundInstance - got: " << i <<
" from " << parent->inputLocation<
int>() <<
endmsg;
63 :
Consumer(
name, svcLoc, KeyValue{
"MyTool",
"MyExampleTool" } ) {}
76 always() <<
"CountingConsumer: incrementing \"This is not an error\" twice" <<
endmsg;
80 always() <<
"CountingConsumer: incrementing \"This is not a warning\" twice" <<
endmsg;
84 always() <<
"CountingConsumer: incrementing \"This is not info\" twice" <<
endmsg;
95 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyInt" ) ) {}
98 info() <<
"executing IntDataProducer, storing " << m_value.value() <<
" into " << outputLocation() <<
endmsg;
112 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVector" ) ) {}
115 info() <<
"executing VectorDataProducer, storing " << m_data.value() <<
" into " << outputLocation() <<
endmsg;
126 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyKeyed" ) ) {}
134 info() <<
"executing KeyedDataProducer, storing [4,5] into " << outputLocation() <<
endmsg;
144 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ) ) {}
147 info() <<
"executing IntDataConsumer, consuming " << input <<
" from " << inputLocation() <<
endmsg;
156 :
Transformer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ),
157 KeyValue(
"OutputLocation",
"/Event/MyFloat" ) ) {}
160 info() <<
"Converting: " << input <<
" from " << inputLocation() <<
" and storing it into " << outputLocation()
172 { KeyValue(
"InputLocation",
"/Event/MyInt" ), KeyValue{
"OtherInput",
"/Event/MyOtherFloat" } },
173 KeyValue(
"OutputLocation",
"/Event/OtherFloat" ) ) {}
175 float operator()(
const int& in1,
const float& in2 )
const override {
176 info() <<
"Converting: " << in1 <<
" from " << inputLocation<int>() <<
" and " << in2 <<
" from "
177 << inputLocation<float>() <<
" and storing it into " << outputLocation() <<
endmsg;
188 { KeyValue(
"InputLocation1", {
"/Event/MyInt" } ),
189 KeyValue(
"InputLocation2", {
"/Event/MyOtherInt" } ) },
190 { KeyValue(
"OutputLocation1", {
"/Event/MyMultiFloat1" } ),
191 KeyValue(
"OutputLocation2", {
"/Event/MyMultiFloat2" } ) } ) {}
194 info() <<
"Number of inputs : " << inputLocationSize() <<
", number of outputs : " << outputLocationSize()
196 info() <<
"Converting " << input1 <<
" from " << inputLocation<0>() <<
" and " << input2 <<
" from "
197 << inputLocation<1>() <<
endmsg;
198 info() <<
"Storing results into " << outputLocation<0>() <<
" and " << outputLocation<1>() <<
endmsg;
213 {
"OutputLocation",
"/Event/MyConcatenatedIntVector" } ) {}
218 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
219 [](
const auto a,
const auto b ) { return a + b.size(); } );
221 out.reserve( nelements );
223 for (
const auto& intVector : intVectors ) {
224 info() <<
"Concatening vector " << intVector <<
endmsg;
225 out.insert(
out.end(), intVector.begin(), intVector.end() );
227 info() <<
"Storing output vector " <<
out <<
" to " << outputLocation() <<
endmsg;
237 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyFloat" ) ) {}
240 info() <<
"executing FloatDataConsumer: " << input <<
endmsg;
251 info() <<
"executing ContextConsumer, got " <<
ctx <<
endmsg;
260 :
Transformer(
name, svcLoc, KeyValue{
"OutputLoc",
"/Event/SomeOtherInt" } ) {}
263 info() <<
"executing ContextConsumer, got " <<
ctx <<
endmsg;
273 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ) ) {}
276 info() <<
"executing ContextIntConsumer, got context = " <<
ctx <<
", int = " << i <<
endmsg;
285 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVectorOfDoubles" ) ) {}
288 info() <<
"storing vector<double> into " << outputLocation() <<
endmsg;
289 return { 12.34, 56.78, 90.12, 34.56, 78.90 };
296 :
Gaudi::Functional::MultiScalarTransformer<
300 : MultiScalarTransformer(
name, svcLoc, KeyValue{
"InputDoubles", {
"/Event/MyVectorOfDoubles" } },
301 { KeyValue{
"OutputFractions", {
"/Event/MyVectorOfFractions" } },
302 KeyValue{
"OutputIntegers", {
"/Event/MyVectorOfIntegers" } } } ) {}
304 using MultiScalarTransformer::operator();
309 info() <<
"Converting " << d <<
" -> " << frac <<
", " << i <<
endmsg;
316 :
Gaudi::Functional::MultiScalarTransformer<
320 : MultiScalarTransformer(
name, svcLoc, KeyValue{
"InputDoubles", {
"/Event/MyVectorOfDoubles" } },
321 { KeyValue{
"OutputFractions", {
"/Event/OptMyVectorOfFractions" } },
322 KeyValue{
"OutputIntegers", {
"/Event/OptMyVectorOfIntegers" } } } ) {}
324 using MultiScalarTransformer::operator();
326 std::optional<std::tuple<double, int>>
operator()(
const double& d )
const {
328 info() <<
"Skipping " << d <<
endmsg;
333 info() <<
"Converting " << d <<
" -> " << frac <<
", " << i <<
endmsg;
340 :
Gaudi::Functional::ScalarTransformer<
343 : ScalarTransformer(
name, svcLoc,
344 { KeyValue{
"InputFractions", {
"/Event/MyVectorOfFractions" } },
345 KeyValue{
"InputIntegers", {
"/Event/MyVectorOfIntegers" } } },
346 { KeyValue{
"OutputDoubles", {
"/Event/MyNewVectorOfDoubles" } } } ) {}
348 using ScalarTransformer::operator();
352 info() <<
"Converting " << i <<
", " << frac <<
" -> " << d <<
endmsg;
363 : ScalarTransformer(
name, svcLoc,
364 { KeyValue{
"InputFractions", {
"/Event/MyVectorOfFractions" } },
365 KeyValue{
"InputIntegers", {
"/Event/MyVectorOfIntegers" } } },
366 { KeyValue{
"OutputDoubles", {
"/Event/MyOptVectorOfDoubles" } } } ) {}
368 using ScalarTransformer::operator();
370 std::optional<double>
operator()(
const double& frac,
const int& i )
const {
373 info() <<
"Skipping " << d <<
endmsg;
376 info() <<
"Converting " << i <<
", " << frac <<
" -> " << d <<
endmsg;
402 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyS" ) ) {}
406 for (
int i = 0; i <
j; ++i )
out.insert(
new S{} );
407 info() <<
"storing KeyedContainer of size " <<
out.size() <<
" into " << outputLocation() <<
endmsg;
422 {
"OutputLocation",
"/Event/MyConcatenatedIntFromSVector" } ) {}
428 for (
const auto& SVector : SVectors ) {
429 info() <<
"Concatening range of size " << SVector.size() <<
endmsg;
430 for (
auto*
s : SVector ) {
out.push_back(
s->a ); }
432 info() <<
"Storing output vector " <<
out <<
" to " << outputLocation() <<
endmsg;
447 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
448 [](
const auto a,
const auto b ) { return a + b.size(); } );
449 info() <<
"sum of input sizes: " << nelements <<
endmsg;
451 for (
const auto& intVector : intVectors ) { info() <<
"Consuming vector " << intVector <<
endmsg; }
465 :
Base(
name, svcLoc, {
"InputLocations", {} } ) {}
469 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
470 [](
const auto a,
const auto b ) { return a + b.size(); } );
471 info() <<
"sum of input sizes: " << nelements <<
endmsg;
473 for (
const auto& intVector : intVectors ) { info() <<
"Consuming vector " << intVector <<
endmsg; }
487 :
Producer(
name, pSvcLocator, KeyValue{
"TrackLocation",
"" } ){};
498 const
Gaudi::Functional::vector_of_const_<
std::
vector<
double>>& ),
502 : MergingMultiTransformer{
name,
504 { KeyValues{
"InputInts", {} }, KeyValues{
"InputDoubles", {} } },
505 { KeyValue{
"OutputInts",
"/Event/MySummedInts" },
506 KeyValue{
"OutputDoubles",
"/Event/MySummedDoubles" } } } {}
515 always() <<
" accumulated: " << is <<
endmsg;
518 always() <<
" accumulated: " << ds <<
endmsg;
539 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MySharedFoo" ) ) {}
543 info() <<
"executing ShrdPtrProducer, storing shared_ptr<Foo> with payload at " << foo.get() <<
" and value "
544 << foo->i <<
" into " << outputLocation() <<
endmsg;
556 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MySharedFoo" ) ) {}
559 info() <<
"executing ShrdPtrConsumer, got shared_ptr<Foo> with payload at " << foo.
get() <<
" with value "
560 << foo->
i <<
" from " << inputLocation() <<
endmsg;
581 for (
const auto& iv : intVectors ) { info() <<
"loaded " << iv <<
" from " << inputLocation(
l++ ) <<
endmsg; }
583 for (
const auto& [
l,
r] : m_mapping.value() ) {
587 for (
const auto& o :
out ) { info() <<
"storing " << o <<
" in " << outputLocation(
l++ ) <<
endmsg; }
600 : parent{ std::exchange( other.parent,
nullptr ) },
action{ std::exchange( other.action,
nullptr ) } {}
602 parent = std::exchange( other.parent,
nullptr );
603 action = std::exchange( other.action,
nullptr );
614 Gaudi::Functional::Traits::use_<BaseClass_t, Gaudi::Functional::Traits::WriteOpaqueFor<Eventually>>> {
617 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/Eventually" ) ) {}
620 always() <<
"creating Eventually" <<
endmsg;
622 me->always() <<
"My Eventually is about to be destroyed" <<
endmsg;
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< Gaudi::Range_< std::vector< S const * >>> &SVectors) const override
void operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
SRangesToIntVector(const std::string &name, ISvcLocator *svcLoc)
int operator()(const EventContext &ctx) const override
IntVectorsMergingConsumer(const std::string &name, ISvcLocator *svcLoc)
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingTransformer
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
OpaqueProducer(const std::string &name, ISvcLocator *svcLoc)
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
Foo & operator=(const Foo &)=delete
IntFloatToFloatData(const std::string &name, ISvcLocator *svcLoc)
IntVectorsToIntVector(const std::string &name, ISvcLocator *svcLoc)
KeyedObject()=default
Standard Constructor. The object key is preset to the invalid value.
T back_inserter(T... args)
Eventually & operator=(Eventually const &)=delete
S::Container operator()() const override
ShrdPtrProducer(const std::string &name, ISvcLocator *svcLoc)
VectorDataProducer(const std::string &name, ISvcLocator *svcLoc)
Base class to be used to extend an interface.
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingConsumer
Eventually & operator=(Eventually &&other)
Eventually(Eventually const &)=delete
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
details::ToolBinder< Signature, Traits_ > ToolBinder
FloatDataConsumer(const std::string &name, ISvcLocator *svcLoc)
SDataProducer(const std::string &name, ISvcLocator *svcLoc)
void operator()() const override
IntDataConsumer(const std::string &name, ISvcLocator *svcLoc)
std::shared_ptr< Foo > operator()() const override
Eventually(Eventually &&other)
long add(ContainedObject *pObject) override
ObjectContainerBase overload: Add an object to the container.
ShrdPtrConsumer(const std::string &name, ISvcLocator *svcLoc)
std::vector< double > operator()() const override
void operator()(const std::shared_ptr< Foo > &foo) const override
details::Producer< Signature, Traits_, details::isLegacy< Traits_ > > Producer
void operator()(const EventContext &ctx) const override
void operator()() const override
TwoDMerger(const std::string &name, ISvcLocator *svcLoc)
double * begin(CLHEP::HepVector &v)
KeyedDataProducer(const std::string &name, ISvcLocator *svcLoc)
IntVectorsToInts(const std::string &name, ISvcLocator *svcLoc)
std::tuple< float, float > operator()(const int &input1, const int &input2) const override
std::vector< int > operator()() const override
Base class from which all concrete algorithm classes should be derived.
ContextIntConsumer(const std::string &name, ISvcLocator *svcLoc)
transform a vector of vector of int to a vector of int, where the output vector of in is scattered in...
float operator()(const int &input) const override
const ValueType & value() const
MyDataRange operator()() const override
void operator()(const float &input) const override
Concatenates a list of input vectors into a single output vector.
void operator()(const EventContext &ctx, const int &i) const override
ContextTransformer(const std::string &name, ISvcLocator *svcLoc)
template class KeyedContainer, KeyedContainer.h
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
Definition of the templated KeyedObject class.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
void operator()(Gaudi::Functional::vector_of_const_< std::vector< int >> const &intVectors) const override
RangeProducer(const std::string &name, ISvcLocator *pSvcLocator)
Base class used to extend a class implementing other interfaces.
Header file for std:chrono::duration-based Counters.
IntToFloatData(const std::string &name, ISvcLocator *svcLoc)
details::MultiTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MultiTransformer
struct GAUDI_API vector
Parametrisation class for vector-like implementation.
IntDataProducer(const std::string &name, ISvcLocator *svcLoc)
Gaudi::Property< int > m_value
#define DECLARE_COMPONENT(type)
Eventually(Gaudi::Algorithm const *p, void(*a)(Gaudi::Algorithm const *))
details::SplittingMergingTransformer< Signature, Traits_, false > SplittingMergingTransformer
Concatenates a list of input vectors into a single output vector.
details::Transformer< Signature, Traits_, details::isLegacy< Traits_ > > Transformer
Foo & operator=(Foo &&)=delete
IntVectorsMerger(const std::string &name, ISvcLocator *svcLoc)
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
int operator()() const override
float operator()(const int &in1, const float &in2) const override
VectorDoubleProducer(const std::string &name, ISvcLocator *svcLoc)
void operator()(const int &input) const override
IntIntToFloatFloatData(const std::string &name, ISvcLocator *svcLoc)
Eventually operator()() const override
int_container operator()() const override