The Gaudi Framework  v36r3 (83a1ddab)
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 
44  class BoundInstance final : public Gaudi::Interface::Bind::Stub<IMyTool> {
46  int i;
47 
48  public:
49  BoundInstance( MyConsumerTool const* parent, const int& i ) : parent{ parent }, i{ i } {}
50  void operator()() const override {
51  parent->always() << "BoundInstance - got: " << i << " from " << parent->inputLocation<int>() << endmsg;
52  }
53  };
54 
55  Gaudi::Interface::Bind::Box<IMyTool> operator()( const int& i ) const override {
56  return { std::in_place_type<BoundInstance>, this, i };
57  };
58  };
59  DECLARE_COMPONENT( MyConsumerTool )
60 
61  using BaseClass_t = Gaudi::Functional::Traits::BaseClass_t<Gaudi::Algorithm>;
62 
63  struct ToolConsumer final : Gaudi::Functional::Consumer<void( IMyTool const& ), BaseClass_t> {
65  : Consumer( name, svcLoc, KeyValue{ "MyTool", "MyExampleTool" } ) {}
66 
67  void operator()( IMyTool const& tool ) const override { tool(); }
68  };
69  DECLARE_COMPONENT( ToolConsumer )
70 
71  struct CountingConsumer final : Gaudi::Functional::Consumer<void(), BaseClass_t> {
73  mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_err{ this, "This is not an error...", 3 };
74  mutable Gaudi::Accumulators::MsgCounter<MSG::WARNING> m_warn{ this, "This is not a warning...", 2 };
75  mutable Gaudi::Accumulators::MsgCounter<MSG::INFO> m_info{ this, "This is not info...", 1 };
76 
77  void operator()() const override {
78  always() << "CountingConsumer: incrementing \"This is not an error\" twice" << endmsg;
79  ++m_err;
80  m_err += true;
81  m_err += false; // should do nothing...
82  always() << "CountingConsumer: incrementing \"This is not a warning\" twice" << endmsg;
83  ++m_warn;
84  m_warn += true;
85  m_warn += false; // should do nothing...
86  always() << "CountingConsumer: incrementing \"This is not info\" twice" << endmsg;
87  ++m_info;
88  m_info += true;
89  m_info += false; // should do nothing...
90  }
91  };
92  DECLARE_COMPONENT( CountingConsumer )
93 
94  struct IntDataProducer final : Gaudi::Functional::Producer<int(), BaseClass_t> {
95 
97  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyInt" ) ) {}
98 
99  int operator()() const override {
100  info() << "executing IntDataProducer, storing " << m_value.value() << " into " << outputLocation() << endmsg;
101  return m_value;
102  }
103 
104  Gaudi::Property<int> m_value{ this, "Value", 7, "The integer value to produce." };
105  };
106 
107  DECLARE_COMPONENT( IntDataProducer )
108 
109  struct VectorDataProducer final : Gaudi::Functional::Producer<std::vector<int>(), BaseClass_t> {
110 
112  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyVector" ) ) {}
113 
114  std::vector<int> operator()() const override {
115  info() << "executing VectorDataProducer, storing [3,3,3,3] into " << outputLocation() << endmsg;
116  return { 3, 3, 3, 3 };
117  }
118  };
119 
120  DECLARE_COMPONENT( VectorDataProducer )
121 
123  struct KeyedDataProducer final : Gaudi::Functional::Producer<int_container(), BaseClass_t> {
124 
126  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyKeyed" ) ) {}
127 
128  int_container operator()() const override {
129  int_container container;
130  auto a = new KeyedObject<int>{ 4 };
131  container.add( a );
132  auto b = new KeyedObject<int>{ 5 };
133  container.add( b );
134  info() << "executing KeyedDataProducer, storing [4,5] into " << outputLocation() << endmsg;
135  return container;
136  }
137  };
138 
139  DECLARE_COMPONENT( KeyedDataProducer )
140 
141  struct IntDataConsumer final : Gaudi::Functional::Consumer<void( const int& ), BaseClass_t> {
142 
144  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ) ) {}
145 
146  void operator()( const int& input ) const override {
147  info() << "executing IntDataConsumer, consuming " << input << " from " << inputLocation() << endmsg;
148  }
149  };
150 
151  DECLARE_COMPONENT( IntDataConsumer )
152 
153  struct IntToFloatData final : Gaudi::Functional::Transformer<float( const int& ), BaseClass_t> {
154 
156  : Transformer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ),
157  KeyValue( "OutputLocation", "/Event/MyFloat" ) ) {}
158 
159  float operator()( const int& input ) const override {
160  info() << "Converting: " << input << " from " << inputLocation() << " and storing it into " << outputLocation()
161  << endmsg;
162  return input;
163  }
164  };
165 
166  DECLARE_COMPONENT( IntToFloatData )
167 
168  struct IntFloatToFloatData final : Gaudi::Functional::Transformer<float( const int&, const float& ), BaseClass_t> {
169 
171  : Transformer( name, svcLoc,
172  { KeyValue( "InputLocation", "/Event/MyInt" ), KeyValue{ "OtherInput", "/Event/MyOtherFloat" } },
173  KeyValue( "OutputLocation", "/Event/OtherFloat" ) ) {}
174 
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;
178  return in1 + in2;
179  }
180  };
181 
182  DECLARE_COMPONENT( IntFloatToFloatData )
183 
185  : Gaudi::Functional::MultiTransformer<std::tuple<float, float>( const int&, const int& ), BaseClass_t> {
187  : MultiTransformer( name, svcLoc,
188  { KeyValue( "InputLocation1", { "/Event/MyInt" } ),
189  KeyValue( "InputLocation2", { "/Event/MyOtherInt" } ) },
190  { KeyValue( "OutputLocation1", { "/Event/MyMultiFloat1" } ),
191  KeyValue( "OutputLocation2", { "/Event/MyMultiFloat2" } ) } ) {}
192 
193  std::tuple<float, float> operator()( const int& input1, const int& input2 ) const override {
194  info() << "Number of inputs : " << inputLocationSize() << ", number of outputs : " << outputLocationSize()
195  << endmsg;
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;
199  return std::tuple<float, float>{ input1, input2 };
200  }
201  };
202 
203  DECLARE_COMPONENT( IntIntToFloatFloatData )
204 
205 
208  : public Gaudi::Functional::MergingTransformer<
209  std::vector<int>( const Gaudi::Functional::vector_of_const_<std::vector<int>>& ), BaseClass_t> {
210 
212  : MergingTransformer( name, svcLoc, { "InputLocations", {} },
213  { "OutputLocation", "/Event/MyConcatenatedIntVector" } ) {}
214 
216  operator()( const Gaudi::Functional::vector_of_const_<std::vector<int>>& intVectors ) const override {
217  // Create a vector and pre-allocate enough space for the number of integers we have
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 );
222  // Concatenate the input vectors to form the output
223  for ( const auto& intVector : intVectors ) {
224  info() << "Concatening vector " << intVector << endmsg;
225  out.insert( out.end(), intVector.begin(), intVector.end() );
226  }
227  info() << "Storing output vector " << out << " to " << outputLocation() << endmsg;
228  return out;
229  }
230  };
231 
232  DECLARE_COMPONENT( IntVectorsToIntVector )
233 
234  struct FloatDataConsumer final : Gaudi::Functional::Consumer<void( const float& ), BaseClass_t> {
235 
237  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyFloat" ) ) {}
238 
239  void operator()( const float& input ) const override {
240  info() << "executing FloatDataConsumer: " << input << endmsg;
241  }
242  };
243 
244  DECLARE_COMPONENT( FloatDataConsumer )
245 
246  struct ContextConsumer final : Gaudi::Functional::Consumer<void( const EventContext& ), BaseClass_t> {
247 
249 
250  void operator()( const EventContext& ctx ) const override {
251  info() << "executing ContextConsumer, got " << ctx << endmsg;
252  }
253  };
254 
255  DECLARE_COMPONENT( ContextConsumer )
256 
257  struct ContextTransformer final : Gaudi::Functional::Transformer<int( const EventContext& ), BaseClass_t> {
258 
260  : Transformer( name, svcLoc, KeyValue{ "OutputLoc", "/Event/SomeOtherInt" } ) {}
261 
262  int operator()( const EventContext& ctx ) const override {
263  info() << "executing ContextConsumer, got " << ctx << endmsg;
264  return 9;
265  }
266  };
267 
268  DECLARE_COMPONENT( ContextTransformer )
269 
270  struct ContextIntConsumer final : Gaudi::Functional::Consumer<void( const EventContext&, const int& ), BaseClass_t> {
271 
273  : Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ) ) {}
274 
275  void operator()( const EventContext& ctx, const int& i ) const override {
276  info() << "executing ContextIntConsumer, got context = " << ctx << ", int = " << i << endmsg;
277  }
278  };
279 
280  DECLARE_COMPONENT( ContextIntConsumer )
281 
282  struct VectorDoubleProducer final : Gaudi::Functional::Producer<std::vector<double>(), BaseClass_t> {
283 
285  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyVectorOfDoubles" ) ) {}
286 
287  std::vector<double> operator()() const override {
288  info() << "storing vector<double> into " << outputLocation() << endmsg;
289  return { 12.34, 56.78, 90.12, 34.56, 78.90 };
290  }
291  };
292 
293  DECLARE_COMPONENT( VectorDoubleProducer )
294 
295  struct FrExpTransformer final
296  : Gaudi::Functional::MultiScalarTransformer<
297  FrExpTransformer, std::tuple<std::vector<double>, std::vector<int>>( const std::vector<double>& ),
298  BaseClass_t> {
300  : MultiScalarTransformer( name, svcLoc, KeyValue{ "InputDoubles", { "/Event/MyVectorOfDoubles" } },
301  { KeyValue{ "OutputFractions", { "/Event/MyVectorOfFractions" } },
302  KeyValue{ "OutputIntegers", { "/Event/MyVectorOfIntegers" } } } ) {}
303 
304  using MultiScalarTransformer::operator();
305 
306  std::tuple<double, int> operator()( const double& d ) const {
307  int i;
308  double frac = std::frexp( d, &i );
309  info() << "Converting " << d << " -> " << frac << ", " << i << endmsg;
310  return { frac, i };
311  }
312  };
313  DECLARE_COMPONENT( FrExpTransformer )
314 
315  struct OptFrExpTransformer final
316  : Gaudi::Functional::MultiScalarTransformer<
317  OptFrExpTransformer, std::tuple<std::vector<double>, std::vector<int>>( const std::vector<double>& ),
318  BaseClass_t> {
320  : MultiScalarTransformer( name, svcLoc, KeyValue{ "InputDoubles", { "/Event/MyVectorOfDoubles" } },
321  { KeyValue{ "OutputFractions", { "/Event/OptMyVectorOfFractions" } },
322  KeyValue{ "OutputIntegers", { "/Event/OptMyVectorOfIntegers" } } } ) {}
323 
324  using MultiScalarTransformer::operator();
325 
326  std::optional<std::tuple<double, int>> operator()( const double& d ) const {
327  if ( d < 30. ) {
328  info() << "Skipping " << d << endmsg;
329  return {};
330  }
331  int i;
332  double frac = std::frexp( d, &i );
333  info() << "Converting " << d << " -> " << frac << ", " << i << endmsg;
334  return std::make_tuple( frac, i );
335  }
336  };
337  DECLARE_COMPONENT( OptFrExpTransformer )
338 
339  struct LdExpTransformer final
340  : Gaudi::Functional::ScalarTransformer<
341  LdExpTransformer, std::vector<double>( const std::vector<double>&, const std::vector<int>& ), BaseClass_t> {
343  : ScalarTransformer( name, svcLoc,
344  { KeyValue{ "InputFractions", { "/Event/MyVectorOfFractions" } },
345  KeyValue{ "InputIntegers", { "/Event/MyVectorOfIntegers" } } },
346  { KeyValue{ "OutputDoubles", { "/Event/MyNewVectorOfDoubles" } } } ) {}
347 
348  using ScalarTransformer::operator();
349 
350  double operator()( double frac, int i ) const {
351  double d = std::ldexp( frac, i );
352  info() << "Converting " << i << ", " << frac << " -> " << d << endmsg;
353  return d;
354  }
355  };
356  DECLARE_COMPONENT( LdExpTransformer )
357 
358  struct OptLdExpTransformer final
359  : Gaudi::Functional::ScalarTransformer<OptLdExpTransformer,
360  std::vector<double>( const std::vector<double>&, const std::vector<int>& ),
361  BaseClass_t> {
363  : ScalarTransformer( name, svcLoc,
364  { KeyValue{ "InputFractions", { "/Event/MyVectorOfFractions" } },
365  KeyValue{ "InputIntegers", { "/Event/MyVectorOfIntegers" } } },
366  { KeyValue{ "OutputDoubles", { "/Event/MyOptVectorOfDoubles" } } } ) {}
367 
368  using ScalarTransformer::operator();
369 
370  std::optional<double> operator()( const double& frac, const int& i ) const {
371  double d = std::ldexp( frac, i );
372  if ( i > 6 ) {
373  info() << "Skipping " << d << endmsg;
374  return {};
375  }
376  info() << "Converting " << i << ", " << frac << " -> " << d << endmsg;
377  return d;
378  }
379  };
380  DECLARE_COMPONENT( OptLdExpTransformer )
381 
382  struct VoidConsumer final : Gaudi::Functional::Consumer<void(), BaseClass_t> {
383 
384  using Consumer::Consumer;
385 
386  void operator()() const override { info() << "executing VoidConsumer" << endmsg; }
387  };
388 
389  DECLARE_COMPONENT( VoidConsumer )
390 
391  struct S : public KeyedObject<int> {
393  int a;
397  };
398 
399  struct SDataProducer final : Gaudi::Functional::Producer<S::Container(), BaseClass_t> {
400 
402  : Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyS" ) ) {}
403 
404  S::Container operator()() const override {
405  S::Container out{};
406  for ( int i = 0; i < j; ++i ) out.insert( new S{} );
407  info() << "storing KeyedContainer of size " << out.size() << " into " << outputLocation() << endmsg;
408  return out;
409  }
410  Gaudi::Property<int> j{ this, "j", 5 };
411  };
412 
413  DECLARE_COMPONENT( SDataProducer )
414 
415  struct SRangesToIntVector final
416  : public Gaudi::Functional::MergingTransformer<
417  std::vector<int>( const Gaudi::Functional::vector_of_const_<Gaudi::Range_<std::vector<S const*>>>& ),
418  BaseClass_t> {
419 
421  : MergingTransformer( name, svcLoc, { "InputRanges", {} },
422  { "OutputLocation", "/Event/MyConcatenatedIntFromSVector" } ) {}
423 
425  const Gaudi::Functional::vector_of_const_<Gaudi::Range_<std::vector<S const*>>>& SVectors ) const override {
427  // Concatenate the input vectors to form the output
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 ); }
431  }
432  info() << "Storing output vector " << out << " to " << outputLocation() << endmsg;
433  return out;
434  }
435  };
436  DECLARE_COMPONENT( SRangesToIntVector )
437 
438  struct IntVectorsMerger final
439  : public Gaudi::Functional::MergingTransformer<
440  void( const Gaudi::Functional::vector_of_const_<std::vector<int>>& ), BaseClass_t> {
441 
443  : MergingTransformer( name, svcLoc, { "InputLocations", {} } ) {}
444 
445  void operator()( const Gaudi::Functional::vector_of_const_<std::vector<int>>& intVectors ) const override {
446  // Create a vector and pre-allocate enough space for the number of integers we have
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;
450  // Concatenate the input vectors to form the output
451  for ( const auto& intVector : intVectors ) { info() << "Consuming vector " << intVector << endmsg; }
452  }
453  };
454 
455  DECLARE_COMPONENT( IntVectorsMerger )
456 
458  : public Gaudi::Functional::MergingConsumer<void( Gaudi::Functional::vector_of_const_<std::vector<int>> const& ),
459  BaseClass_t> {
460  using Base =
462  BaseClass_t>;
463 
465  : Base( name, svcLoc, { "InputLocations", {} } ) {}
466 
467  void operator()( Gaudi::Functional::vector_of_const_<std::vector<int>> const& intVectors ) const override {
468  // Create a vector and pre-allocate enough space for the number of integers we have
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;
472  // Concatenate the input vectors to form the output
473  for ( const auto& intVector : intVectors ) { info() << "Consuming vector " << intVector << endmsg; }
474  }
475  };
476 
477  DECLARE_COMPONENT( IntVectorsMergingConsumer )
478 
479  struct MyData {
481  };
483 
484  struct RangeProducer : Gaudi::Functional::Producer<MyDataRange()> {
485 
486  RangeProducer( const std::string& name, ISvcLocator* pSvcLocator )
487  : Producer( name, pSvcLocator, KeyValue{ "TrackLocation", "" } ){};
488 
489  MyDataRange operator()() const override { return {}; }
490  };
491  DECLARE_COMPONENT( RangeProducer )
492 
493 } // 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:424
Gaudi::Examples::IntVectorsMerger::operator()
void operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
Definition: MakeAndConsume.cpp:445
Gaudi::Examples::SRangesToIntVector::SRangesToIntVector
SRangesToIntVector(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:420
Gaudi::Examples::OptLdExpTransformer::OptLdExpTransformer
OptLdExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:362
Gaudi::Examples::ContextTransformer::operator()
int operator()(const EventContext &ctx) const override
Definition: MakeAndConsume.cpp:262
Gaudi::Examples::IntVectorsMergingConsumer::IntVectorsMergingConsumer
IntVectorsMergingConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:464
std::make_tuple
T make_tuple(T... args)
Gaudi::Functional::MergingTransformer
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingTransformer
Definition: MergingTransformer.h:199
Gaudi::Examples::LdExpTransformer
Definition: MakeAndConsume.cpp:341
Gaudi::Functional::Consumer
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition: Consumer.h:69
Gaudi::Examples::ToolConsumer
Definition: MakeAndConsume.cpp:63
Gaudi::Examples::IntIntToFloatFloatData
Definition: MakeAndConsume.cpp:185
Gaudi::Examples::MyConsumerTool::BoundInstance::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:50
std::string
STL class.
Gaudi::Examples::VoidConsumer
Definition: MakeAndConsume.cpp:382
Gaudi::Examples::OptFrExpTransformer::operator()
std::optional< std::tuple< double, int > > operator()(const double &d) const
Definition: MakeAndConsume.cpp:326
Gaudi::Examples::IntVectorsToIntVector::operator()
std::vector< int > operator()(const Gaudi::Functional::vector_of_const_< std::vector< int >> &intVectors) const override
Definition: MakeAndConsume.cpp:216
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:170
Gaudi::Examples::IntVectorsToIntVector::IntVectorsToIntVector
IntVectorsToIntVector(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:211
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:67
Gaudi::Examples::IntDataProducer
Definition: MakeAndConsume.cpp:94
Gaudi::Examples::MyConsumerTool::BoundInstance::parent
MyConsumerTool const * parent
Definition: MakeAndConsume.cpp:45
Gaudi::Examples::CountingConsumer
Definition: MakeAndConsume.cpp:71
Gaudi::Examples::IMyTool::DeclareInterfaceID
DeclareInterfaceID(IMyTool, 1, 0)
Gaudi::Examples::LdExpTransformer::operator()
double operator()(double frac, int i) const
Definition: MakeAndConsume.cpp:350
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Examples::SDataProducer::j
Gaudi::Property< int > j
Definition: MakeAndConsume.cpp:410
std::vector< int >
Gaudi::Examples::IMyTool::operator()
virtual void operator()() const =0
Gaudi::Examples::IMyTool
Definition: MakeAndConsume.cpp:28
ISvcLocator
Definition: ISvcLocator.h:46
Gaudi::Examples::OptFrExpTransformer
Definition: MakeAndConsume.cpp:318
Gaudi::Examples::LdExpTransformer::LdExpTransformer
LdExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:342
Gaudi::Interface::Bind::Box
Definition: IBinder.h:23
Gaudi::Examples::SDataProducer::operator()
S::Container operator()() const override
Definition: MakeAndConsume.cpp:404
Gaudi::Examples::IntVectorsMerger
Definition: MakeAndConsume.cpp:440
std::tuple
Containers
Containers namespace.
Definition: KeyedObjectManager.h:28
Gaudi::Functional::details::vector_of_const_
Definition: FunctionalDetails.h:283
Gaudi::Examples::VectorDataProducer::VectorDataProducer
VectorDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:111
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:204
Gaudi::Functional::details::Consumer
Definition: Consumer.h:24
Gaudi::Functional::ToolBinder
details::ToolBinder< Signature, Traits_ > ToolBinder
Definition: FunctionalTool.h:70
Gaudi::Examples::ToolConsumer::ToolConsumer
ToolConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:64
Gaudi::Examples::FloatDataConsumer::FloatDataConsumer
FloatDataConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:236
Gaudi::Examples::ContextTransformer
Definition: MakeAndConsume.cpp:257
Gaudi::Examples::SDataProducer::SDataProducer
SDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:401
Gaudi::Examples::VoidConsumer::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:386
Gaudi::Examples::IntDataConsumer::IntDataConsumer
IntDataConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:143
std::frexp
T frexp(T... args)
Gaudi::Examples::ContextIntConsumer
Definition: MakeAndConsume.cpp:270
KeyedContainer::add
long add(ContainedObject *pObject) override
ObjectContainerBase overload: Add an object to the container.
Definition: KeyedContainer.h:599
ScalarTransformer.h
Gaudi::Examples::FrExpTransformer::FrExpTransformer
FrExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:299
Gaudi::Examples::OptLdExpTransformer
Definition: MakeAndConsume.cpp:361
bug_34121.tool
tool
Definition: bug_34121.py:17
Gaudi::Examples::VectorDoubleProducer::operator()
std::vector< double > operator()() const override
Definition: MakeAndConsume.cpp:287
Gaudi::Examples::SRangesToIntVector
Definition: MakeAndConsume.cpp:418
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:37
FunctionalTool.h
Consumer.h
Gaudi::Examples::MyConsumerTool::BoundInstance
Definition: MakeAndConsume.cpp:44
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:250
Gaudi::Examples::CountingConsumer::operator()
void operator()() const override
Definition: MakeAndConsume.cpp:77
Gaudi::Examples::KeyedDataProducer::KeyedDataProducer
KeyedDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:125
Gaudi::Examples::IntIntToFloatFloatData::operator()
std::tuple< float, float > operator()(const int &input1, const int &input2) const override
Definition: MakeAndConsume.cpp:193
Gaudi::Examples::KeyedDataProducer
Definition: MakeAndConsume.cpp:123
Gaudi::Examples::VectorDataProducer::operator()
std::vector< int > operator()() const override
Definition: MakeAndConsume.cpp:114
IAlgTool.h
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:90
Producer.h
Gaudi::Examples::ContextIntConsumer::ContextIntConsumer
ContextIntConsumer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:272
Gaudi::Examples::S::a
int a
Definition: MakeAndConsume.cpp:393
Gaudi::Examples::IntToFloatData::operator()
float operator()(const int &input) const override
Definition: MakeAndConsume.cpp:159
Gaudi::Property::value
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:240
Gaudi::Examples::RangeProducer::operator()
MyDataRange operator()() const override
Definition: MakeAndConsume.cpp:489
Gaudi::Examples::FloatDataConsumer::operator()
void operator()(const float &input) const override
Definition: MakeAndConsume.cpp:239
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:275
Gaudi::Examples::ContextTransformer::ContextTransformer
ContextTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:259
Gaudi::Examples::ContextConsumer
Definition: MakeAndConsume.cpp:246
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:306
Transformer.h
Gaudi::Examples::S
Definition: MakeAndConsume.cpp:391
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:109
Gaudi::Examples::OptFrExpTransformer::OptFrExpTransformer
OptFrExpTransformer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:319
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:467
Gaudi::Examples::RangeProducer::RangeProducer
RangeProducer(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MakeAndConsume.cpp:486
Gaudi::Examples::VectorDoubleProducer
Definition: MakeAndConsume.cpp:282
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
Gaudi::Examples::MyConsumerTool::operator()
Gaudi::Interface::Bind::Box< IMyTool > operator()(const int &i) const override
Definition: MakeAndConsume.cpp:55
Gaudi::Interface::Bind::Stub
Definition: IBinder.h:95
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:155
Gaudi ::Functional::MultiTransformer
details::MultiTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MultiTransformer
Definition: Transformer.h:241
Gaudi::Examples::MyData
Definition: MakeAndConsume.cpp:479
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:459
Gaudi::Examples::FloatDataConsumer
Definition: MakeAndConsume.cpp:234
gaudirun.type
type
Definition: gaudirun.py:160
Gaudi::Examples::RangeProducer
Definition: MakeAndConsume.cpp:484
Gaudi::Examples::IntFloatToFloatData
Definition: MakeAndConsume.cpp:168
Gaudi::Examples::IntDataProducer::IntDataProducer
IntDataProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:96
Gaudi::Examples::MyExampleTool
Definition: MakeAndConsume.cpp:33
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:49
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:153
Gaudi::Examples::SDataProducer
Definition: MakeAndConsume.cpp:399
Gaudi::Examples::IntVectorsToIntVector
Concatenates a list of input vectors into a single output vector.
Definition: MakeAndConsume.cpp:209
Gaudi ::Functional::Transformer
details::Transformer< Signature, Traits_, details::isLegacy< Traits_ > > Transformer
Definition: Transformer.h:238
Gaudi::Examples::MyConsumerTool::BoundInstance::i
int i
Definition: MakeAndConsume.cpp:46
Gaudi::Examples::IntDataConsumer
Definition: MakeAndConsume.cpp:141
AlgTool.h
Gaudi::Examples::IntVectorsMerger::IntVectorsMerger
IntVectorsMerger(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:442
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:99
Gaudi::Examples::IntFloatToFloatData::operator()
float operator()(const int &in1, const float &in2) const override
Definition: MakeAndConsume.cpp:175
Gaudi::Examples::VectorDoubleProducer::VectorDoubleProducer
VectorDoubleProducer(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:284
Gaudi::Examples::FrExpTransformer
Definition: MakeAndConsume.cpp:298
Gaudi::Examples::IntDataConsumer::operator()
void operator()(const int &input) const override
Definition: MakeAndConsume.cpp:146
Gaudi::Examples::IntIntToFloatFloatData::IntIntToFloatFloatData
IntIntToFloatFloatData(const std::string &name, ISvcLocator *svcLoc)
Definition: MakeAndConsume.cpp:186
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:370
Gaudi::Examples::KeyedDataProducer::operator()
int_container operator()() const override
Definition: MakeAndConsume.cpp:128