Go to the documentation of this file.
34 using extends::extends;
51 parent->always() <<
"BoundInstance - got: " << i <<
" from " << parent->inputLocation<
int>() <<
endmsg;
56 return { std::in_place_type<BoundInstance>,
this, i };
65 :
Consumer(
name, svcLoc, KeyValue{
"MyTool",
"MyExampleTool" } ) {}
78 always() <<
"CountingConsumer: incrementing \"This is not an error\" twice" <<
endmsg;
82 always() <<
"CountingConsumer: incrementing \"This is not a warning\" twice" <<
endmsg;
86 always() <<
"CountingConsumer: incrementing \"This is not info\" twice" <<
endmsg;
97 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyInt" ) ) {}
100 info() <<
"executing IntDataProducer, storing " << m_value.value() <<
" into " << outputLocation() <<
endmsg;
112 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVector" ) ) {}
115 info() <<
"executing VectorDataProducer, storing [3,3,3,3] into " << outputLocation() <<
endmsg;
116 return { 3, 3, 3, 3 };
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",
"" } ){};
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
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
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.
S::Container operator()() const override
VectorDataProducer(const std::string &name, ISvcLocator *svcLoc)
Base class to be used to extend an interface.
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingConsumer
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)
long add(ContainedObject *pObject) override
ObjectContainerBase overload: Add an object to the container.
std::vector< double > operator()() const override
details::Producer< Signature, Traits_, details::isLegacy< Traits_ > > Producer
void operator()(const EventContext &ctx) const override
void operator()() const override
KeyedDataProducer(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)
float operator()(const int &input) const override
const ValueType & value() const
Backward compatibility (.
MyDataRange operator()() const override
void operator()(const float &input) const override
void operator()(const EventContext &ctx, const int &i) const override
ContextTransformer(const std::string &name, ISvcLocator *svcLoc)
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.
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)
#define DECLARE_COMPONENT(type)
Concatenates a list of input vectors into a single output vector.
details::Transformer< Signature, Traits_, details::isLegacy< Traits_ > > Transformer
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)
int_container operator()() const override