Marlin  1.17.1
 All Classes Namespaces Functions Variables Enumerations Friends Pages
ProcessorMgr.h
1 #ifndef ProcessorMgr_h
2 #define ProcessorMgr_h 1
3 
4 #include "lcio.h"
5 #include "Processor.h"
6 #include "LCIOOutputProcessor.h"
7 
8 #include "IO/LCRunListener.h"
9 #include "IO/LCEventListener.h"
10 
11 #include "EVENT/LCEvent.h"
12 #include "EVENT/LCRunHeader.h"
13 #include "LogicalExpressions.h"
14 
15 #include <map>
16 #include <set>
17 #include <list>
18 
19 using namespace lcio ;
20 
21 namespace marlin{
22 
23  class ProcessorEventSeeder;
24 
25 typedef std::map< const std::string , Processor* > ProcessorMap ;
26 typedef std::list< Processor* > ProcessorList ;
27 typedef std::map< const std::string , int > SkippedEventMap ;
28 
36 class ProcessorMgr : public LCRunListener, public LCEventListener {
37 
38 friend class Processor ;
39 friend class CMProcessor ;
40 friend class MarlinSteerCheck ;
41 
42 public:
43 
46  static ProcessorMgr* instance() ;
47 
50  virtual ~ProcessorMgr() ;
51 
55 // bool addActiveProcessor( const std::string& processorType , const std::string& processorName ,
56 // StringParameters* parameters=0 ) ;
57 
61  bool addActiveProcessor( const std::string& processorType , const std::string& processorName ,
62  std::shared_ptr<StringParameters> parameters , const std::string condition="true" ) ;
63 
66  void removeActiveProcessor( const std::string& name ) ;
67 
68 
72  Processor* getActiveProcessor( const std::string& name ) ;
73 
77  Processor* getProcessor( const std::string& type ) ;
78 
81  void dumpRegisteredProcessors() ;
82 
85  void dumpRegisteredProcessorsXML() ;
86 
87  virtual void init() ;
88  virtual void processRunHeader( LCRunHeader* ) ;
89  virtual void processEvent( LCEvent* ) ;
90  virtual void end() ;
91 
92 
93  virtual void modifyRunHeader( LCRunHeader*) ;
94  virtual void modifyEvent( LCEvent *) ;
95 
98  virtual void readDataSource( int numEvents ) ;
99 
100 
102  virtual void setProcessorReturnValue( Processor* proc, bool val ) ;
103 
105  virtual void setProcessorReturnValue( Processor* proc, bool val , const std::string& name) ;
106 
107 
108 protected:
111  void registerProcessor( Processor* processor ) ;
112 
114  std::set< std::string > getAvailableProcessorTypes() ;
115 
116 // ProcessorMgr() : _outputProcessor(0) {}
117 // ProcessorMgr() {}
118  ProcessorMgr() ;
119 
120 private:
121  static ProcessorMgr* _me ;
122  ProcessorMap _map{};
123  ProcessorMap _activeMap{};
124  ProcessorList _list{};
125  SkippedEventMap _skipMap{};
126 
127  ProcessorList _eventModifierList{};
128 
129  LogicalExpressions _conditions{};
130 // LCIOOutputProcessor* _outputProcessor ;
131 
132 };
133 
134 } // end namespace marlin
135 #endif
This singleton class contains an instance of every available marlin processor type.
Definition: CMProcessor.h:21
this class is a Marlin Steering File consistency check Tool.
Definition: MarlinSteerCheck.h:72
Helper class that holds named boolean values and named conditions that are expressions of these value...
Definition: LogicalExpressions.h:143
Processor manager singleton class.
Definition: ProcessorMgr.h:36
Base class for Marlin processors.
Definition: Processor.h:64