The Gaudi Framework  v36r4 (0a924e98)
MakeAndConsume.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #include "GaudiAlg/Consumer.h"
14 #include "GaudiAlg/Producer.h"
16 #include "GaudiAlg/Transformer.h"
17 #include "GaudiKernel/AlgTool.h"
18 #include "GaudiKernel/IAlgTool.h"
19 #include "GaudiKernel/IBinder.h"
22 #include <cmath>
23 #include <numeric>
24 #include <optional>
25 
26 namespace Gaudi::Examples {
27 
28  struct IMyTool : extend_interfaces<IAlgTool> {
30  virtual void operator()() const = 0;
31  };
32 
33  struct MyExampleTool : extends<AlgTool, IMyTool> {
34  using extends::extends;
35  void operator()() const override { always() << m_message.value() << endmsg; }
36  Gaudi::Property<std::string> m_message{ this, "Message", "Boring Default Message" };
37  };
38  DECLARE_COMPONENT( MyExampleTool )
39 
40  struct MyConsumerTool final : Gaudi::Functional::ToolBinder<Gaudi::Interface::Bind::Box<IMyTool>( const int& )> {
42  : ToolBinder{ std::move( type ), std::move( name ), parent, KeyValue{ "MyInt", "/Event/MyInt" },
43  construct<BoundInstance>( this ) } {}
44 
45  class BoundInstance final : public Gaudi::Interface::Bind::Stub<IMyTool> {
47  int i;
48 
49  public:
50  BoundInstance( MyConsumerTool const* parent, const int& i ) : parent{ parent }, i{ i } {}
51  void operator()() const override {
52  parent->always() << "BoundInstance - got: " << i << " from " << parent->inputLocation<int>() << endmsg;
53  }
54  };
55  };
56  DECLARE_COMPONENT( MyConsumerTool )
57 
58  using BaseClass_t = Gaudi::Functional::Traits::BaseClass_t<Gaudi::Algorithm>;
59 
60  struct ToolConsumer final : Gaudi::Functional::Consumer<void( IMyTool const& ), BaseClass_t> {
62  : Consumer( name, svcLoc, KeyValue{ "MyTool", "MyExampleTool" } ) {}
63 
64  void operator()( IMyTool const& tool ) const override { tool(); }
65  };
66  DECLARE_COMPONENT( ToolConsumer )
67 
68  struct CountingConsumer final : Gaudi::Functional::Consumer<void(), BaseClass_t> {
70  mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_err{ this, "This is not an error...", 3 };
71  mutable Gaudi::Accumulators::MsgCounter<MSG::WARNING> m_warn{ this, "This is not a warning...", 2 };
72  mutable Gaudi::Accumulators::MsgCounter<MSG::INFO> m_info{ this, "This is not info...", 1 };
73 
74  void operator()() const override {
75  always() << "CountingConsumer: incrementing \"This is not an error\" twice" << endmsg;
76  ++m_err;
77  m_err += true;
78  m_err += false; // should do nothing...
79  always() << "CountingConsumer: incrementing \"This is not a warning\" twice" << endmsg;
80  ++m_warn;
81  m_warn += true;
82  m_warn += false; // should do nothing...
83  always() << "CountingConsumer: incrementing \"This is not info\" twice" << endmsg;
84  ++m_info;
85  m_info += true;
86  m_info += false; // should do nothing...
87  }
88  };
89  DECLARE_COMPONENT( CountingConsumer )
90 
91  struct IntDataProducer final : Gaudi::Functional::Producer<int(), BaseClass_t> {
92 
94  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyInt" ) ) {}
95 
96  int operator()() const override {
97  info() << "executing IntDataProducer, storing " << m_value.value() << " into " << outputLocation() << endmsg;
98  return m_value;
99  }
100 
101  Gaudi::Property<int> m_value{ this, "Value", 7, "The integer value to produce." };
102  };
103 
104  DECLARE_COMPONENT( IntDataProducer )
105 
106  struct VectorDataProducer final : Gaudi::Functional::Producer<std::vector<int>(), BaseClass_t> {
107 
109  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyVector" ) ) {}
110 
111  std::vector<int> operator()() const override {
112  info() << "executing VectorDataProducer, storing [3,3,3,3] into " << outputLocation() << endmsg;
113  return { 3, 3, 3, 3 };
114  }
115  };
116 
117  DECLARE_COMPONENT( VectorDataProducer )
118 
120  struct KeyedDataProducer final : Gaudi::Functional::Producer<int_container(), BaseClass_t> {
121 
123  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyKeyed" ) ) {}
124 
125  int_container operator()() const override {
126  int_container container;
127  auto a = new KeyedObject<int>{ 4 };
128  container.add( a );
129  auto b = new KeyedObject<int>{ 5 };
130  container.add( b );
131  info() << "executing KeyedDataProducer, storing [4,5] into " << outputLocation() << endmsg;
132  return container;
133  }
134  };
135 
136  DECLARE_COMPONENT( KeyedDataProducer )
137 
138  struct IntDataConsumer final : Gaudi::Functional::Consumer<void( const int& ), BaseClass_t> {
139 
141  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ) ) {}
142 
143  void operator()( const int& input ) const override {
144  info() << "executing IntDataConsumer, consuming " << input << " from " << inputLocation() << endmsg;
145  }
146  };
147 
148  DECLARE_COMPONENT( IntDataConsumer )
149 
150  struct IntToFloatData final : Gaudi::Functional::Transformer<float( const int& ), BaseClass_t> {
151 
153  : Transformer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ),
154  KeyValue( "OutputLocation", "/Event/MyFloat" ) ) {}
155 
156  float operator()( const int& input ) const override {
157  info() << "Converting: " << input << " from " << inputLocation() << " and storing it into " << outputLocation()
158  << endmsg;
159  return input;
160  }
161  };
162 
163  DECLARE_COMPONENT( IntToFloatData )
164 
165  struct IntFloatToFloatData final : Gaudi::Functional::Transformer<float( const int&, const float& ), BaseClass_t> {
166 
168  : Transformer( name, svcLoc,
169  { KeyValue( "InputLocation", "/Event/MyInt" ), KeyValue{ "OtherInput", "/Event/MyOtherFloat" } },
170  KeyValue( "OutputLocation", "/Event/OtherFloat" ) ) {}
171 
172  float operator()( const int& in1, const float& in2 ) const override {
173  info() << "Converting: " << in1 << " from " << inputLocation<int>() << " and " << in2 << " from "
174  << inputLocation<float>() << " and storing it into " << outputLocation() << endmsg;
175  return in1 + in2;
176  }
177  };
178 
179  DECLARE_COMPONENT( IntFloatToFloatData )
180 
182  : Gaudi::Functional::MultiTransformer<std::tuple<float, float>( const int&, const int& ), BaseClass_t> {
184  : MultiTransformer( name, svcLoc,
185  { KeyValue( "InputLocation1", { "/Event/MyInt" } ),
186  KeyValue( "InputLocation2", { "/Event/MyOtherInt" } ) },
187  { KeyValue( "OutputLocation1", { "/Event/MyMultiFloat1" } ),
188  KeyValue( "OutputLocation2", { "/Event/MyMultiFloat2" } ) } ) {}
189 
190  std::tuple<float, float> operator()( const int& input1, const int& input2 ) const override {
191  info() << "Number of inputs : " << inputLocationSize() << ", number of outputs : " << outputLocationSize()
192  << endmsg;
193  info() << "Converting " << input1 << " from " << inputLocation<0>() << " and " << input2 << " from "
194  << inputLocation<1>() << endmsg;
195  info() << "Storing results into " << outputLocation<0>() << " and " << outputLocation<1>() << endmsg;
196  return std::tuple<float, float>{ input1, input2 };
197  }
198  };
199 
200  DECLARE_COMPONENT( IntIntToFloatFloatData )
201 
202 
205  : public Gaudi::Functional::MergingTransformer<
206  std::vector<int>( const Gaudi::Functional::vector_of_const_<std::vector<int>>& ), BaseClass_t> {
207 
209  : MergingTransformer( name, svcLoc, { "InputLocations", {} },
210  { "OutputLocation", "/Event/MyConcatenatedIntVector" } ) {}
211 
213  operator()( const Gaudi::Functional::vector_of_const_<std::vector<int>>& intVectors ) const override {
214  // Create a vector and pre-allocate enough space for the number of integers we have
215  auto nelements = std::accumulate( intVectors.begin(), intVectors.end(), 0,
216  []( const auto a, const auto b ) { return a + b.size(); } );
218  out.reserve( nelements );
219  // Concatenate the input vectors to form the output
220  for ( const auto& intVector : intVectors ) {
221  info() << "Concatening vector " << intVector << endmsg;
222  out.insert( out.end(), intVector.begin(), intVector.end() );
223  }
224  info() << "Storing output vector " << out << " to " << outputLocation() << endmsg;
225  return out;
226  }
227  };
228 
229  DECLARE_COMPONENT( IntVectorsToIntVector )
230 
231  struct FloatDataConsumer final : Gaudi::Functional::Consumer<void( const float& ), BaseClass_t> {
232 
234  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyFloat" ) ) {}
235 
236  void operator()( const float& input ) const override {
237  info() << "executing FloatDataConsumer: " << input << endmsg;
238  }
239  };
240 
241  DECLARE_COMPONENT( FloatDataConsumer )
242 
243  struct ContextConsumer final : Gaudi::Functional::Consumer<void( const EventContext& ), BaseClass_t> {
244 
246 
247  void operator()( const EventContext& ctx ) const override {
248  info() << "executing ContextConsumer, got " << ctx << endmsg;
249  }
250  };
251 
252  DECLARE_COMPONENT( ContextConsumer )
253 
254  struct ContextTransformer final : Gaudi::Functional::Transformer<int( const EventContext& ), BaseClass_t> {
255 
257  : Transformer( name, svcLoc, KeyValue{ "OutputLoc", "/Event/SomeOtherInt" } ) {}
258 
259  int operator()( const EventContext& ctx ) const override {
260  info() << "executing ContextConsumer, got " << ctx << endmsg;
261  return 9;
262  }
263  };
264 
265  DECLARE_COMPONENT( ContextTransformer )
266 
267  struct ContextIntConsumer final : Gaudi::Functional::Consumer<void( const EventContext&, const int& ), BaseClass_t> {
268 
270  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ) ) {}
271 
272  void operator()( const EventContext& ctx, const int& i ) const override {
273  info() << "executing ContextIntConsumer, got context = " << ctx << ", int = " << i << endmsg;
274  }
275  };
276 
277  DECLARE_COMPONENT( ContextIntConsumer )
278 
279  struct VectorDoubleProducer final : Gaudi::Functional::Producer<std::vector<double>(), BaseClass_t> {
280 
282  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyVectorOfDoubles" ) ) {}
283 
284  std::vector<double> operator()() const override {
285  info() << "storing vector<double> into " << outputLocation() << endmsg;
286  return { 12.34, 56.78, 90.12, 34.56, 78.90 };
287  }
288  };
289 
290  DECLARE_COMPONENT( VectorDoubleProducer )
291 
292  struct FrExpTransformer final
293  : Gaudi::Functional::MultiScalarTransformer<
294  FrExpTransformer, std::tuple<std::vector<double>, std::vector<int>>( const std::vector<double>& ),
295  BaseClass_t> {
297  : MultiScalarTransformer( name, svcLoc, KeyValue{ "InputDoubles", { "/Event/MyVectorOfDoubles" } },
298  { KeyValue{ "OutputFractions", { "/Event/MyVectorOfFractions" } },
299  KeyValue{ "OutputIntegers", { "/Event/MyVectorOfIntegers" } } } ) {}
300 
301  using MultiScalarTransformer::operator();
302 
303  std::tuple<double, int> operator()( const double& d ) const {
304  int i;
305  double frac = std::frexp( d, &i );
306  info() << "Converting " << d << " -> " << frac << ", " << i << endmsg;
307  return { frac, i };
308  }
309  };
310  DECLARE_COMPONENT( FrExpTransformer )
311 
312  struct OptFrExpTransformer final
313  : Gaudi::Functional::MultiScalarTransformer<
314  OptFrExpTransformer, std::tuple<std::vector<double>, std::vector<int>>( const std::vector<double>& ),
315  BaseClass_t> {
317  : MultiScalarTransformer( name, svcLoc, KeyValue{ "InputDoubles", { "/Event/MyVectorOfDoubles" } },
318  { KeyValue{ "OutputFractions", { "/Event/OptMyVectorOfFractions" } },
319  KeyValue{ "OutputIntegers", { "/Event/OptMyVectorOfIntegers" } } } ) {}
320 
321  using MultiScalarTransformer::operator();
322 
323  std::optional<std::tuple<double, int>> operator()( const double& d ) const {
324  if ( d < 30. ) {
325  info() << "Skipping " << d << endmsg;
326  return {};
327  }
328  int i;
329  double frac = std::frexp( d, &i );
330  info() << "Converting " << d << " -> " << frac << ", " << i << endmsg;
331  return std::make_tuple( frac, i );
332  }
333  };
334  DECLARE_COMPONENT( OptFrExpTransformer )
335 
336  struct LdExpTransformer final
337  : Gaudi::Functional::ScalarTransformer<
338  LdExpTransformer, std::vector<double>( const std::vector<double>&, const std::vector<int>& ), BaseClass_t> {
340  : ScalarTransformer( name, svcLoc,
341  { KeyValue{ "InputFractions", { "/Event/MyVectorOfFractions" } },
342  KeyValue{ "InputIntegers", { "/Event/MyVectorOfIntegers" } } },
343  { KeyValue{ "OutputDoubles", { "/Event/MyNewVectorOfDoubles" } } } ) {}
344 
345  using ScalarTransformer::operator();
346 
347  double operator()( double frac, int i ) const {
348  double d = std::ldexp( frac, i );
349  info() << "Converting " << i << ", " << frac << " -> " << d << endmsg;
350  return d;
351  }
352  };
353  DECLARE_COMPONENT( LdExpTransformer )
354 
355  struct OptLdExpTransformer final
356  : Gaudi::Functional::ScalarTransformer<OptLdExpTransformer,
357  std::vector<double>( const std::vector<double>&, const std::vector<int>& ),
358  BaseClass_t> {
360  : ScalarTransformer( name, svcLoc,
361  { KeyValue{ "InputFractions", { "/Event/MyVectorOfFractions" } },
362  KeyValue{ "InputIntegers", { "/Event/MyVectorOfIntegers" } } },
363  { KeyValue{ "OutputDoubles", { "/Event/MyOptVectorOfDoubles" } } } ) {}
364 
365  using ScalarTransformer::operator();
366 
367  std::optional<double> operator()( const double& frac, const int& i ) const {
368  double d = std::ldexp( frac, i );
369  if ( i > 6 ) {
370  info() << "Skipping " << d << endmsg;
371  return {};
372  }
373  info() << "Converting " << i << ", " << frac << " -> " << d << endmsg;
374  return d;
375  }
376  };
377  DECLARE_COMPONENT( OptLdExpTransformer )
378 
379  struct VoidConsumer final : Gaudi::Functional::Consumer<void(), BaseClass_t> {
380 
381  using Consumer::Consumer;
382 
383  void operator()() const override { info() << "executing VoidConsumer" << endmsg; }
384  };
385 
386  DECLARE_COMPONENT( VoidConsumer )
387 
388  struct S : public KeyedObject<int> {
390  int a;
394  };
395 
396  struct SDataProducer final : Gaudi::Functional::Producer<S::Container(), BaseClass_t> {
397 
399  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyS" ) ) {}
400 
401  S::Container operator()() const override {
402  S::Container out{};
403  for ( int i = 0; i < j; ++i ) out.insert( new S{} );
404  info() << "storing KeyedContainer of size " << out.size() << " into " << outputLocation() << endmsg;
405  return out;
406  }
407  Gaudi::Property<int> j{ this, "j", 5 };
408  };
409 
410  DECLARE_COMPONENT( SDataProducer )
411 
412  struct SRangesToIntVector final
413  : public Gaudi::Functional::MergingTransformer<
414  std::vector<int>( const Gaudi::Functional::vector_of_const_<Gaudi::Range_<std::vector<S const*>>>& ),
415  BaseClass_t> {
416 
418  : MergingTransformer( name, svcLoc, { "InputRanges", {} },
419  { "OutputLocation", "/Event/MyConcatenatedIntFromSVector" } ) {}
420 
422  const Gaudi::Functional::vector_of_const_<Gaudi::Range_<std::vector<S const*>>>& SVectors ) const override {
424  // Concatenate the input vectors to form the output
425  for ( const auto& SVector : SVectors ) {
426  info() << "Concatening range of size " << SVector.size() << endmsg;
427  for ( auto* s : SVector ) { out.push_back( s->a ); }
428  }
429  info() << "Storing output vector " << out << " to " << outputLocation() << endmsg;
430  return out;
431  }
432  };
433  DECLARE_COMPONENT( SRangesToIntVector )
434 
435  struct IntVectorsMerger final
436  : public Gaudi::Functional::MergingTransformer<
437  void( const Gaudi::Functional::vector_of_const_<std::vector<int>>& ), BaseClass_t> {
438 
440  : MergingTransformer( name, svcLoc, { "InputLocations", {} } ) {}
441 
442  void operator()( const Gaudi::Functional::vector_of_const_<std::vector<int>>& intVectors ) const override {
443  // Create a vector and pre-allocate enough space for the number of integers we have
444  auto nelements = std::accumulate( intVectors.begin(), intVectors.end(), 0,
445  []( const auto a, const auto b ) { return a + b.size(); } );
446  info() << "sum of input sizes: " << nelements << endmsg;
447  // Concatenate the input vectors to form the output
448  for ( const auto& intVector : intVectors ) { info() << "Consuming vector " << intVector << endmsg; }
449  }
450  };
451 
452  DECLARE_COMPONENT( IntVectorsMerger )
453 
455  : public Gaudi::Functional::MergingConsumer<void( Gaudi::Functional::vector_of_const_<std::vector<int>> const& ),
456  BaseClass_t> {
457  using Base =
459  BaseClass_t>;
460 
462  : Base( name, svcLoc, { "InputLocations", {} } ) {}
463 
464  void operator()( Gaudi::Functional::vector_of_const_<std::vector<int>> const& intVectors ) const override {
465  // Create a vector and pre-allocate enough space for the number of integers we have
466  auto nelements = std::accumulate( intVectors.begin(), intVectors.end(), 0,
467  []( const auto a, const auto b ) { return a + b.size(); } );
468  info() << "sum of input sizes: " << nelements << endmsg;
469  // Concatenate the input vectors to form the output
470  for ( const auto& intVector : intVectors ) { info() << "Consuming vector " << intVector << endmsg; }
471  }
472  };
473 
474  DECLARE_COMPONENT( IntVectorsMergingConsumer )
475 
476  struct MyData {
478  };
480 
481  struct RangeProducer : Gaudi::Functional::Producer<MyDataRange()> {
482 
483  RangeProducer( const std::string& name, ISvcLocator* pSvcLocator )
484  : Producer( name, pSvcLocator, KeyValue{ "TrackLocation", "" } ){};
485 
486  MyDataRange operator()() const override { return {}; }
487  };
488  DECLARE_COMPONENT( RangeProducer )
489 
490 
492  struct TwoDMerger final : public Gaudi::Functional::MergingMultiTransformer<
493  std::tuple<std::vector<int>, std::vector<double>>(
494  const Gaudi::Functional::vector_of_const_<std::vector<int>>&,
495  const Gaudi::Functional::vector_of_const_<std::vector<double>>& ),
496  BaseClass_t> {
497 
499  : MergingMultiTransformer{ name,
500  svcLoc,
501  { KeyValues{ "InputInts", {} }, KeyValues{ "InputDoubles", {} } },
502  { KeyValue{ "OutputInts", "/Event/MySummedInts" },
503  KeyValue{ "OutputDoubles", "/Event/MySummedDoubles" } } } {}
504 
507  const Gaudi::Functional::vector_of_const_<std::vector<double>>& doubleVectors ) const override {
509  auto& [is, ds] = r;
510  std::transform( begin( intVectors ), end( intVectors ), std::back_inserter( is ),
511  []( const std::vector<int>& vi ) { return std::accumulate( begin( vi ), end( vi ), 0 ); } );
512  always() << " accumulated: " << is << endmsg;
513  std::transform( begin( doubleVectors ), end( doubleVectors ), std::back_inserter( ds ),
514  []( const std::vector<double>& vd ) { return std::accumulate( begin( vd ), end( vd ), 0. ); } );
515  always() << " accumulated: " << ds << endmsg;
516  return r;
517  }
518  };
519 
520  DECLARE_COMPONENT( TwoDMerger )
521 
522  struct Foo {
523  int i;
524 
525  Foo( int i ) : i{ i } {}
526  Foo( Foo&& ) = delete;
527  Foo& operator=( Foo&& ) = delete;
528  Foo( const Foo& ) = delete;
529  Foo& operator=( const Foo& ) = delete;
530  ~Foo(){};
531  };
532 
533  struct ShrdPtrProducer final : Gaudi::Functional::Producer<std::shared_ptr<Foo>(), BaseClass_t> {
534 
536  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MySharedFoo" ) ) {}
537 
538  std::shared_ptr<Foo> operator()() const override {
539  auto foo = std::make_shared<Foo>( m_value.value() );
540  info() << "executing ShrdPtrProducer, storing shared_ptr<Foo> with payload at " << foo.get() << " and value "
541  << foo->i << " into " << outputLocation() << endmsg;
542  return foo;
543  }
544 
545  Gaudi::Property<int> m_value{ this, "Value", 7, "The integer value to produce." };
546  };
547 
548  DECLARE_COMPONENT( ShrdPtrProducer )
549 
550  struct ShrdPtrConsumer final : Gaudi::Functional::Consumer<void( std::shared_ptr<Foo> const& ), BaseClass_t> {
551 
553  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MySharedFoo" ) ) {}
554 
555  void operator()( const std::shared_ptr<Foo>& foo ) const override {
556  info() << "executing ShrdPtrConsumer, got shared_ptr<Foo> with payload at " << foo.get() << " with value "
557  << foo->i << " from " << inputLocation() << endmsg;
558  }
559  };
560 
561  DECLARE_COMPONENT( ShrdPtrConsumer )
562 
563 } // namespace Gaudi::Examples
Gaudi::Examples::SRangesToIntVector::operator()
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< Gaudi::Range_< std::vector< S const * >>> &SVectors) const override
Definition: MakeAndConsume.cpp:421
Gaudi::Examples::IntVectorsMerger::operator()
void operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
Definition: MakeAndConsume.cpp:442
Gaudi::Examples::SRangesToIntVector::SRangesToIntVector
SRangesToIntVector(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:417
Gaudi::Examples::OptLdExpTransformer::OptLdExpTransformer
OptLdExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:359
Gaudi::Examples::ContextTransformer::operator()
int operator()(const EventContext &ctx) const override
Definition: MakeAndConsume.cpp:259
Gaudi::Examples::IntVectorsMergingConsumer::IntVectorsMergingConsumer
IntVectorsMergingConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:461
std::make_tuple
T make_tuple(T... args)
Gaudi::Functional::MergingTransformer
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingTransformer
Definition: MergingTransformer.h:236
Gaudi::Examples::LdExpTransformer
Definition: MakeAndConsume.cpp:338
Gaudi::Functional::Consumer
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition: Consumer.h:69
Gaudi::Examples::ToolConsumer
Definition: MakeAndConsume.cpp:60
Gaudi::Examples::IntIntToFloatFloatData
Definition: MakeAndConsume.cpp:182
Gaudi::Examples::MyConsumerTool::BoundInstance::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:51
std::string
STL class.
std::shared_ptr
STL class.
Gaudi::Examples::VoidConsumer
Definition: MakeAndConsume.cpp:379
Gaudi::Examples::OptFrExpTransformer::operator()
std::optional< std::tuple< double, int > > operator()(const double &d) const
Definition: MakeAndConsume.cpp:323
Gaudi::Examples::IntVectorsToIntVector::operator()
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
Definition: MakeAndConsume.cpp:213
Gaudi::Examples::Foo::operator=
Foo & operator=(const Foo &)=delete
std::move
T move(T... args)
Gaudi::Examples::MyExampleTool::m_message
Gaudi::Property< std::string > m_message
Definition: MakeAndConsume.cpp:36
Gaudi::Examples::IntFloatToFloatData::IntFloatToFloatData
IntFloatToFloatData(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:167
Gaudi::Examples::IntVectorsToIntVector::IntVectorsToIntVector
IntVectorsToIntVector(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:208
KeyedObject::KeyedObject
KeyedObject()=default
Standard Constructor. The object key is preset to the invalid value.
Gaudi::Examples::ToolConsumer::operator()
void operator()(IMyTool const &tool) const override
Definition: MakeAndConsume.cpp:64
Gaudi::Examples::IntDataProducer
Definition: MakeAndConsume.cpp:91
Gaudi::Examples::MyConsumerTool::BoundInstance::parent
MyConsumerTool const * parent
Definition: MakeAndConsume.cpp:46
Gaudi::Examples::CountingConsumer
Definition: MakeAndConsume.cpp:68
Gaudi::Examples::IMyTool::DeclareInterfaceID
DeclareInterfaceID(IMyTool, 1, 0)
Gaudi::Examples::LdExpTransformer::operator()
double operator()(double frac, int i) const
Definition: MakeAndConsume.cpp:347
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Examples::SDataProducer::j
Gaudi::Property< int > j
Definition: MakeAndConsume.cpp:407
std::vector< int >
Gaudi::Examples::IMyTool::operator()
virtual void operator()() const =0
Gaudi::Examples::IMyTool
Definition: MakeAndConsume.cpp:28
ISvcLocator
Definition: ISvcLocator.h:46
std::back_inserter
T back_inserter(T... args)
Gaudi::Examples::OptFrExpTransformer
Definition: MakeAndConsume.cpp:315
Gaudi::Examples::LdExpTransformer::LdExpTransformer
LdExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:339
std::shared_ptr::get
T get(T... args)
Gaudi::Examples::SDataProducer::operator()
S::Container operator()() const override
Definition: MakeAndConsume.cpp:401
Gaudi::Examples::IntVectorsMerger
Definition: MakeAndConsume.cpp:437
Gaudi::Examples::ShrdPtrConsumer
Definition: MakeAndConsume.cpp:550
std::tuple
Gaudi::Examples::ShrdPtrProducer::ShrdPtrProducer
ShrdPtrProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:535
Containers
Containers namespace.
Definition: KeyedObjectManager.h:28
Gaudi::Functional::details::vector_of_const_
Definition: FunctionalDetails.h:291
Gaudi::Examples::VectorDataProducer::VectorDataProducer
VectorDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:108
extend_interfaces
Base class to be used to extend an interface.
Definition: extend_interfaces.h:15
KeyedContainer.h
Gaudi::Examples::MyConsumerTool::MyConsumerTool
MyConsumerTool(std::string type, std::string name, const IInterface *parent)
Definition: MakeAndConsume.cpp:41
Gaudi::Functional::MergingConsumer
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingConsumer
Definition: MergingTransformer.h:241
Gaudi::Examples::Foo::~Foo
~Foo()
Definition: MakeAndConsume.cpp:530
Gaudi::Functional::details::Consumer
Definition: Consumer.h:24
Gaudi::Functional::ToolBinder
details::ToolBinder< Signature, Traits_ > ToolBinder
Definition: FunctionalTool.h:85
Gaudi::Examples::ToolConsumer::ToolConsumer
ToolConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:61
Gaudi::Examples::FloatDataConsumer::FloatDataConsumer
FloatDataConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:233
Gaudi::Examples::ContextTransformer
Definition: MakeAndConsume.cpp:254
Gaudi::Examples::SDataProducer::SDataProducer
SDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:398
Gaudi::Examples::VoidConsumer::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:383
Gaudi::Examples::IntDataConsumer::IntDataConsumer
IntDataConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:140
std::frexp
T frexp(T... args)
Gaudi::Examples::ShrdPtrProducer::operator()
std::shared_ptr< Foo > operator()() const override
Definition: MakeAndConsume.cpp:538
Gaudi::Examples::ContextIntConsumer
Definition: MakeAndConsume.cpp:267
KeyedContainer::add
long add(ContainedObject *pObject) override
ObjectContainerBase overload: Add an object to the container.
Definition: KeyedContainer.h:599
ScalarTransformer.h
Gaudi::Examples::ShrdPtrConsumer::ShrdPtrConsumer
ShrdPtrConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:552
Gaudi::Examples::FrExpTransformer::FrExpTransformer
FrExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:296
Gaudi::Examples::OptLdExpTransformer
Definition: MakeAndConsume.cpp:358
bug_34121.tool
tool
Definition: bug_34121.py:17
Gaudi::Examples::VectorDoubleProducer::operator()
std::vector< double > operator()() const override
Definition: MakeAndConsume.cpp:284
Gaudi::Examples::ShrdPtrProducer
Definition: MakeAndConsume.cpp:533
Gaudi::Examples::SRangesToIntVector
Definition: MakeAndConsume.cpp:415
TimingHistograms.name
name
Definition: TimingHistograms.py:25
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:588
Gaudi::Examples
Definition: ConditionAccessorHolder.h:21
Gaudi::Functional::details::MergingTransformer
Definition: MergingTransformer.h:50
FunctionalTool.h
Gaudi::Examples::ShrdPtrConsumer::operator()
void operator()(const std::shared_ptr< Foo > &foo) const override
Definition: MakeAndConsume.cpp:555
Consumer.h
HistoDumpEx.r
r
Definition: HistoDumpEx.py:20
Gaudi::Examples::MyConsumerTool::BoundInstance
Definition: MakeAndConsume.cpp:45
Gaudi::Functional::Producer
details::Producer< Signature, Traits_, details::isLegacy< Traits_ > > Producer
Definition: Producer.h:37
Gaudi::Examples::ContextConsumer::operator()
void operator()(const EventContext &ctx) const override
Definition: MakeAndConsume.cpp:247
Gaudi::Examples::CountingConsumer::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:74
Gaudi::Examples::TwoDMerger::TwoDMerger
TwoDMerger(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:498
CLHEP::begin
double * begin(CLHEP::HepVector &v)
Definition: TupleAlg.cpp:45
Gaudi::Examples::KeyedDataProducer::KeyedDataProducer
KeyedDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:122
Gaudi::Examples::IntIntToFloatFloatData::operator()
std::tuple< float, float > operator()(const int &input1, const int &input2) const override
Definition: MakeAndConsume.cpp:190
Gaudi::Examples::KeyedDataProducer
Definition: MakeAndConsume.cpp:120
Gaudi::Examples::VectorDataProducer::operator()
std::vector< int > operator()() const override
Definition: MakeAndConsume.cpp:111
IAlgTool.h
Gaudi::Examples::Foo::Foo
Foo(Foo &&)=delete
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:90
Gaudi::Examples::Foo::i
int i
Definition: MakeAndConsume.cpp:523
Producer.h
Gaudi::Examples::ContextIntConsumer::ContextIntConsumer
ContextIntConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:269
Gaudi::Examples::S::a
int a
Definition: MakeAndConsume.cpp:390
Gaudi::Examples::IntToFloatData::operator()
float operator()(const int &input) const override
Definition: MakeAndConsume.cpp:156
Gaudi::Property::value
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:240
Gaudi::Examples::RangeProducer::operator()
MyDataRange operator()() const override
Definition: MakeAndConsume.cpp:486
Gaudi::Examples::FloatDataConsumer::operator()
void operator()(const float &input) const override
Definition: MakeAndConsume.cpp:236
Gaudi::Examples::TwoDMerger
Concatenates a list of input vectors into a single output vector.
Definition: MakeAndConsume.cpp:496
SharedObjectsContainer
Definition: SharedObjectsContainer.h:39
Gaudi::Examples::MyExampleTool::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:35
Gaudi::Examples::ContextIntConsumer::operator()
void operator()(const EventContext &ctx, const int &i) const override
Definition: MakeAndConsume.cpp:272
Gaudi::Examples::ContextTransformer::ContextTransformer
ContextTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:256
Gaudi::Examples::ContextConsumer
Definition: MakeAndConsume.cpp:243
KeyedContainer
template class KeyedContainer, KeyedContainer.h
Definition: KeyedContainer.h:74
std::accumulate
T accumulate(T... args)
Gaudi::Examples::FrExpTransformer::operator()
std::tuple< double, int > operator()(const double &d) const
Definition: MakeAndConsume.cpp:303
Gaudi::Examples::TwoDMerger::operator()
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: MakeAndConsume.cpp:506
Transformer.h
Gaudi::Examples::S
Definition: MakeAndConsume.cpp:388
Gaudi::Functional::details::Producer
Definition: Producer.h:22
KeyedObject
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:39
Gaudi::Examples::VectorDataProducer
Definition: MakeAndConsume.cpp:106
Gaudi::Examples::OptFrExpTransformer::OptFrExpTransformer
OptFrExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:316
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
Gaudi::Accumulators::MsgCounter< MSG::ERROR >
Gaudi::Examples::IntVectorsMergingConsumer::operator()
void operator()(Gaudi::Functional::vector_of_const_< std::vector< int >> const &intVectors) const override
Definition: MakeAndConsume.cpp:464
Gaudi::Examples::RangeProducer::RangeProducer
RangeProducer(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MakeAndConsume.cpp:483
Gaudi::Examples::VectorDoubleProducer
Definition: MakeAndConsume.cpp:279
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
std::transform
T transform(T... args)
Gaudi::Interface::Bind::Stub
Definition: IBinder.h:95
IOTest.end
def end
Definition: IOTest.py:128
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
SharedObjectsContainer.h
IBinder.h
Gaudi::Examples::IntToFloatData::IntToFloatData
IntToFloatData(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:152
Gaudi ::Functional::MultiTransformer
details::MultiTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MultiTransformer
Definition: Transformer.h:241
Gaudi::Examples::MyData
Definition: MakeAndConsume.cpp:476
Gaudi::Range_
Definition: Range.h:95
Containers::vector
struct GAUDI_API vector
Parametrisation class for vector-like implementation.
Definition: KeyedObjectManager.h:39
Gaudi::Examples::IntVectorsMergingConsumer
Definition: MakeAndConsume.cpp:456
Gaudi::Examples::FloatDataConsumer
Definition: MakeAndConsume.cpp:231
gaudirun.type
type
Definition: gaudirun.py:160
Gaudi::Examples::RangeProducer
Definition: MakeAndConsume.cpp:481
Gaudi::Examples::Foo::Foo
Foo(int i)
Definition: MakeAndConsume.cpp:525
Gaudi::Examples::IntFloatToFloatData
Definition: MakeAndConsume.cpp:165
Gaudi::Examples::IntDataProducer::IntDataProducer
IntDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:93
Gaudi::Examples::MyExampleTool
Definition: MakeAndConsume.cpp:33
Gaudi::Examples::ShrdPtrProducer::m_value
Gaudi::Property< int > m_value
Definition: MakeAndConsume.cpp:545
Gaudi::Examples::Foo
Definition: MakeAndConsume.cpp:522
MergingTransformer.h
std
STL namespace.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
IInterface
Definition: IInterface.h:237
Gaudi::Examples::MyConsumerTool::BoundInstance::BoundInstance
BoundInstance(MyConsumerTool const *parent, const int &i)
Definition: MakeAndConsume.cpp:50
EventContext
Definition: EventContext.h:34
Gaudi::Functional::Traits::BaseClass_t
Definition: FunctionalUtilities.h:72
Gaudi::Examples::MyConsumerTool
Definition: MakeAndConsume.cpp:40
Gaudi::Examples::IntToFloatData
Definition: MakeAndConsume.cpp:150
Gaudi::Examples::SDataProducer
Definition: MakeAndConsume.cpp:396
Gaudi::Examples::IntVectorsToIntVector
Concatenates a list of input vectors into a single output vector.
Definition: MakeAndConsume.cpp:206
Gaudi ::Functional::Transformer
details::Transformer< Signature, Traits_, details::isLegacy< Traits_ > > Transformer
Definition: Transformer.h:238
Gaudi::Examples::Foo::operator=
Foo & operator=(Foo &&)=delete
Gaudi::Examples::MyConsumerTool::BoundInstance::i
int i
Definition: MakeAndConsume.cpp:47
Gaudi::Examples::IntDataConsumer
Definition: MakeAndConsume.cpp:138
AlgTool.h
Gaudi::Examples::IntVectorsMerger::IntVectorsMerger
IntVectorsMerger(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:439
std::ldexp
T ldexp(T... args)
Containers::HashMap
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
Definition: KeyedObjectManager.h:107
Gaudi::Examples::IntDataProducer::operator()
int operator()() const override
Definition: MakeAndConsume.cpp:96
Gaudi::Examples::IntFloatToFloatData::operator()
float operator()(const int &in1, const float &in2) const override
Definition: MakeAndConsume.cpp:172
Gaudi::Examples::VectorDoubleProducer::VectorDoubleProducer
VectorDoubleProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:281
Gaudi::Examples::Foo::Foo
Foo(const Foo &)=delete
Gaudi::Examples::FrExpTransformer
Definition: MakeAndConsume.cpp:295
Gaudi::Examples::IntDataConsumer::operator()
void operator()(const int &input) const override
Definition: MakeAndConsume.cpp:143
Gaudi::Examples::IntIntToFloatFloatData::IntIntToFloatFloatData
IntIntToFloatFloatData(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:183
Gaudi::Property< std::string >
PrepareBase.out
out
Definition: PrepareBase.py:20
Gaudi::Examples::OptLdExpTransformer::operator()
std::optional< double > operator()(const double &frac, const int &i) const
Definition: MakeAndConsume.cpp:367
Gaudi::Examples::KeyedDataProducer::operator()
int_container operator()() const override
Definition: MakeAndConsume.cpp:125