Go to the documentation of this file.
34 always() <<
"CountingConsumer: incrementing \"This is not an error\" twice" <<
endmsg;
38 always() <<
"CountingConsumer: incrementing \"This is not a warning\" twice" <<
endmsg;
42 always() <<
"CountingConsumer: incrementing \"This is not info\" twice" <<
endmsg;
53 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyInt" ) ) {}
56 info() <<
"executing IntDataProducer, storing " << m_value.value() <<
" into " << outputLocation() <<
endmsg;
68 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVector" ) ) {}
71 info() <<
"executing VectorDataProducer, storing [3,3,3,3] into " << outputLocation() <<
endmsg;
82 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyKeyed" ) ) {}
90 info() <<
"executing KeyedDataProducer, storing [4,5] into " << outputLocation() <<
endmsg;
100 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ) ) {}
103 info() <<
"executing IntDataConsumer, consuming " << input <<
" from " << inputLocation() <<
endmsg;
112 :
Transformer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ),
113 KeyValue(
"OutputLocation",
"/Event/MyFloat" ) ) {}
116 info() <<
"Converting: " << input <<
" from " << inputLocation() <<
" and storing it into " << outputLocation()
128 {KeyValue(
"InputLocation",
"/Event/MyInt" ), KeyValue{
"OtherInput",
"/Event/MyOtherFloat"}},
129 KeyValue(
"OutputLocation",
"/Event/OtherFloat" ) ) {}
131 float operator()(
const int& in1,
const float& in2 )
const override {
132 info() <<
"Converting: " << in1 <<
" from " << inputLocation<int>() <<
" and " << in2 <<
" from "
133 << inputLocation<float>() <<
" and storing it into " << outputLocation() <<
endmsg;
145 {KeyValue(
"InputLocation1", {
"/Event/MyInt"} ), KeyValue(
"InputLocation2", {
"/Event/MyOtherInt"} )},
146 {KeyValue(
"OutputLocation1", {
"/Event/MyMultiFloat1"} ),
147 KeyValue(
"OutputLocation2", {
"/Event/MyMultiFloat2"} )} ) {}
150 info() <<
"Number of inputs : " << inputLocationSize() <<
", number of outputs : " << outputLocationSize()
152 info() <<
"Converting " << input1 <<
" from " << inputLocation<0>() <<
" and " << input2 <<
" from "
153 << inputLocation<1>() <<
endmsg;
154 info() <<
"Storing results into " << outputLocation<0>() <<
" and " << outputLocation<1>() <<
endmsg;
169 {
"OutputLocation",
"/Event/MyConcatenatedIntVector"} ) {}
174 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
175 [](
const auto a,
const auto b ) { return a + b.size(); } );
177 out.reserve( nelements );
179 for (
const auto& intVector : intVectors ) {
180 info() <<
"Concatening vector " << intVector <<
endmsg;
181 out.insert(
out.end(), intVector.begin(), intVector.end() );
183 info() <<
"Storing output vector " <<
out <<
" to " << outputLocation() <<
endmsg;
193 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyFloat" ) ) {}
196 info() <<
"executing FloatDataConsumer: " << input <<
endmsg;
207 info() <<
"executing ContextConsumer, got " <<
ctx <<
endmsg;
216 :
Transformer(
name, svcLoc, KeyValue{
"OutputLoc",
"/Event/SomeOtherInt"} ) {}
219 info() <<
"executing ContextConsumer, got " <<
ctx <<
endmsg;
229 :
Consumer(
name, svcLoc, KeyValue(
"InputLocation",
"/Event/MyInt" ) ) {}
232 info() <<
"executing ContextIntConsumer, got context = " <<
ctx <<
", int = " << i <<
endmsg;
241 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyVectorOfDoubles" ) ) {}
244 info() <<
"storing vector<double> into " << outputLocation() <<
endmsg;
245 return {12.34, 56.78, 90.12, 34.56, 78.90};
252 :
Gaudi::Functional::MultiScalarTransformer<
256 : MultiScalarTransformer(
name, svcLoc, KeyValue{
"InputDoubles", {
"/Event/MyVectorOfDoubles"}},
257 {KeyValue{
"OutputFractions", {
"/Event/MyVectorOfFractions"}},
258 KeyValue{
"OutputIntegers", {
"/Event/MyVectorOfIntegers"}}} ) {}
260 using MultiScalarTransformer::operator();
265 info() <<
"Converting " << d <<
" -> " << frac <<
", " << i <<
endmsg;
272 :
Gaudi::Functional::MultiScalarTransformer<
276 : MultiScalarTransformer(
name, svcLoc, KeyValue{
"InputDoubles", {
"/Event/MyVectorOfDoubles"}},
277 {KeyValue{
"OutputFractions", {
"/Event/OptMyVectorOfFractions"}},
278 KeyValue{
"OutputIntegers", {
"/Event/OptMyVectorOfIntegers"}}} ) {}
280 using MultiScalarTransformer::operator();
282 std::optional<std::tuple<double, int>>
operator()(
const double& d )
const {
284 info() <<
"Skipping " << d <<
endmsg;
289 info() <<
"Converting " << d <<
" -> " << frac <<
", " << i <<
endmsg;
296 :
Gaudi::Functional::ScalarTransformer<
299 : ScalarTransformer(
name, svcLoc,
300 {KeyValue{
"InputFractions", {
"/Event/MyVectorOfFractions"}},
301 KeyValue{
"InputIntegers", {
"/Event/MyVectorOfIntegers"}}},
302 {KeyValue{
"OutputDoubles", {
"/Event/MyNewVectorOfDoubles"}}} ) {}
304 using ScalarTransformer::operator();
308 info() <<
"Converting " << i <<
", " << frac <<
" -> " << d <<
endmsg;
319 : ScalarTransformer(
name, svcLoc,
320 {KeyValue{
"InputFractions", {
"/Event/MyVectorOfFractions"}},
321 KeyValue{
"InputIntegers", {
"/Event/MyVectorOfIntegers"}}},
322 {KeyValue{
"OutputDoubles", {
"/Event/MyOptVectorOfDoubles"}}} ) {}
324 using ScalarTransformer::operator();
326 std::optional<double>
operator()(
const double& frac,
const int& i )
const {
329 info() <<
"Skipping " << d <<
endmsg;
332 info() <<
"Converting " << i <<
", " << frac <<
" -> " << d <<
endmsg;
358 :
Producer(
name, svcLoc, KeyValue(
"OutputLocation",
"/Event/MyS" ) ) {}
362 for (
int i = 0; i <
j; ++i )
out.insert(
new S{} );
363 info() <<
"storing KeyedContainer of size " <<
out.size() <<
" into " << outputLocation() <<
endmsg;
378 {
"OutputLocation",
"/Event/MyConcatenatedIntFromSVector"} ) {}
384 for (
const auto& SVector : SVectors ) {
385 info() <<
"Concatening range of size " << SVector.size() <<
endmsg;
386 for (
auto*
s : SVector ) {
out.push_back(
s->a ); }
388 info() <<
"Storing output vector " <<
out <<
" to " << outputLocation() <<
endmsg;
403 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
404 [](
const auto a,
const auto b ) { return a + b.size(); } );
405 info() <<
"sum of input sizes: " << nelements <<
endmsg;
407 for (
const auto& intVector : intVectors ) { info() <<
"Consuming vector " << intVector <<
endmsg; }
421 :
Base(
name, svcLoc, {
"InputLocations", {}} ) {}
425 auto nelements =
std::accumulate( intVectors.begin(), intVectors.end(), 0,
426 [](
const auto a,
const auto b ) { return a + b.size(); } );
427 info() <<
"sum of input sizes: " << nelements <<
endmsg;
429 for (
const auto& intVector : intVectors ) { info() <<
"Consuming vector " << intVector <<
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
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.
Gaudi::Accumulators::MsgCounter< MSG::INFO > m_info
S::Container operator()() const override
VectorDataProducer(const std::string &name, ISvcLocator *svcLoc)
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingConsumer
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
ContextIntConsumer(const std::string &name, ISvcLocator *svcLoc)
float operator()(const int &input) 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
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.
Gaudi::Accumulators::MsgCounter< MSG::ERROR > m_err
Gaudi::Accumulators::MsgCounter< MSG::WARNING > m_warn
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