MarlinMT  0.1.0
DumpEventProcessor.cc
Go to the documentation of this file.
1 
2 // -- marlinmt headers
3 #include <marlinmt/Processor.h>
5 
6 // -- lcio headers
7 #include <UTIL/LCTOOLS.h>
8 
9 namespace marlinmt {
10 
22  class DumpEventProcessor : public Processor {
23  public:
28 
29  // from Processor
30  void init() ;
31  void processEvent( EventStore * evt ) ;
32 
33  protected:
34  BoolParameter _dumpDetailed {*this, "DumpDetailed",
35  "Whether to make a detailed dump of the event", true } ;
36  };
37 
38  //--------------------------------------------------------------------------
39  //--------------------------------------------------------------------------
40 
42  Processor("DumpEvent") {
43  // modify processor description
44  setDescription( "Simple processor to dump an event" ) ;
45  // duplicate and don't lock. Anyway, this processor in MT mode doesn't make sense...
48  }
49 
50  //--------------------------------------------------------------------------
51 
53  // Print the initial parameters
54  printParameters() ;
55  }
56 
57  //--------------------------------------------------------------------------
58 
60  auto lcevent = evt->event<EVENT::LCEvent>() ;
61  if( _dumpDetailed ) {
62  UTIL::LCTOOLS::dumpEventDetailed( lcevent.get() ) ;
63  }
64  else {
65  UTIL::LCTOOLS::dumpEvent( lcevent.get() ) ;
66  }
67  }
68 
69  // plugin declaration
71 }
std::shared_ptr< T > event() const
Get the underlying event to a specific type.
Definition: EventStore.h:130
void setRuntimeOption(ERuntimeOption option, bool value)
Force the runtime option to a given boolean value.
Definition: Processor.cc:37
void processEvent(EventStore *evt)
Process an input event.
DumpEventProcessor simply dumps an event in the console.
#define MARLINMT_DECLARE_PROCESSOR(Class)
Definition: PluginManager.h:34
void setDescription(const std::string &desc)
Set the component description.
Definition: Component.cc:41
void init()
Initialize the processor.
Whether the processor has to be executed in a critical section.
Processor class.
Definition: Processor.h:43
void printParameters() const
Print the component parameters.
Definition: Component.cc:118
EventStore class.
Definition: EventStore.h:17