Marlin  01.17.01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProcessorMgr.cc
Go to the documentation of this file.
1 #include "marlin/ProcessorMgr.h"
2 #include "marlin/Global.h"
3 #include "marlin/Exceptions.h"
4 
5 #include <sstream>
6 #include <iostream>
7 #include <iomanip>
8 #include <algorithm>
9 #include <set>
10 
12 #include "marlin/EventModifier.h"
14 #include "streamlog/streamlog.h"
15 #include "streamlog/logbuffer.h"
16 
17 #include <time.h>
18 
19 namespace marlin{
20 
21  ProcessorMgr* ProcessorMgr::_me = 0 ;
22 
23  static clock_t start_t , end_t ;
25  static TimeMap tMap ;
26 
27 
28 
29  // helper for sorting procs wrt to processing time
30  struct Cmp{
31  bool operator()(const TimeMap::value_type& v1, const TimeMap::value_type& v2 ) {
32  // inverse sort:
33  return v1.second.first > v2.second.first ;
34  }
35  } ;
36 
39  StopProcessingException::message = m ;
40  }
41  };
42 
43 
44 
45  // create a dummy streamlog stream for std::cout
46  streamlog::logstream my_cout ;
47 
49  if( Global::EVENTSEEDER == NULL ) {
51  }
52  else {
53  std::stringstream sstr ;
54  sstr << " ProcessorMgr::instance: Global::EVENTSEEDER pointer not NULL" << std::endl ;
55  throw Exception( sstr.str() );
56  }
57  }
58 
59 
61 
62  if( _me == 0 ) {
63  _me = new ProcessorMgr ;
64  }
65 
66  return _me ;
67  }
68 
69 
71  }
72 
74 
75  const std::string& name = processor->type() ;
76 
77  if( _map.find( name ) != _map.end() ){
78 
79  // std::cerr << " ProcessorMgr::registerProcessor: processor " << name
80  // << " already registered ! "
81  // << std::endl ;
82 
83  return ;
84  }
85  else
86 
87  _map[ name ] = processor ;
88 
89  }
90 
91  void ProcessorMgr::readDataSource( int numEvents ) {
92 
93  for( ProcessorList::iterator it = _list.begin() ;
94  it != _list.end() ; it++ ){
95 
96  DataSourceProcessor* dSP = dynamic_cast<DataSourceProcessor*>( *it ) ;
97 
98  if( dSP != 0 )
99  dSP->readDataSource( numEvents ) ;
100 
101  }
102  }
103 
104 
106 
107  typedef ProcessorMap::iterator MI ;
108 
109  std::cout << " ##########################################" << std::endl
110  << " # #" << std::endl
111  << " # Example steering file for marlin #" << std::endl
112  << " # #" << std::endl
113  << " ##########################################" << std::endl
114  << std::endl ;
115 
116  std::cout << ".begin Global ---------------------------------------" << std::endl
117  << " LCIOInputFiles simjob.slcio " << std::endl
118  << std::endl
119  << " # the active processors that are called in the given order" << std::endl
120  << " ActiveProcessors MyAIDAProcessor" << std::endl
121  << " ActiveProcessors MyTestProcessor" << std::endl
122  << " ActiveProcessors MyLCIOOutputProcessor" << std::endl
123  << std::endl
124  << " # limit the number of processed records (run+evt):" << std::endl
125  << " MaxRecordNumber 5001" << std::endl
126  << std::endl
127  << " # skip the first n events " << std::endl
128  << " SkipNEvents 0 " << std::endl
129  << " # don't call the check method of the processors if \"true\"" << std::endl
130  << " SupressCheck false" << std::endl
131  << ".end -----------------------------------------------" << std::endl
132  << std::endl
133  << std::endl ;
134 
135 
136  for(MI i=_map.begin() ; i!= _map.end() ; i++) {
137  i->second->printDescription() ;
138  }
139  }
141 
142  typedef ProcessorMap::iterator MI ;
143 
144  std::cout << "<!--##########################################" << std::endl
145  << " # #" << std::endl
146  << " # Example steering file for marlin #" << std::endl
147  << " # #" << std::endl
148  << " ##########################################-->" << std::endl
149  << std::endl ;
150 
151  std::cout << std::endl
152  << "<marlin xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
153  << "xsi:noNamespaceSchemaLocation=\"http://ilcsoft.desy.de/marlin/marlin.xsd\">"
154  << std::endl ;
155 
156  std::cout << " <constants>" << std::endl
157  << " <!-- define constants here - use in steering file as ${ConstantName} --> " << std::endl
158  << " <!--constant name=\"DetectorModel\" value=\"ILD_l5_o1_v02\" /-->" << std::endl
159  << " </constants>" << std::endl
160  << std::endl ;
161 
162  std::cout << " <execute>" << std::endl
163  << " <!--processor name=\"MyEventSelector\"/--> " << std::endl
164  << " <!--if condition=\"MyEventSelector\"--> " << std::endl
165  << " <processor name=\"MyAIDAProcessor\"/>" << std::endl
166  << " <processor name=\"MyTestProcessor\"/> " << std::endl
167  << " <processor name=\"MyLCIOOutputProcessor\"/> " << std::endl
168  << " <!--/if--> " << std::endl
169  << " </execute>" << std::endl
170  << std::endl ;
171 
172  std::cout << " <global>" << std::endl
173  << " <parameter name=\"LCIOInputFiles\"> simjob.slcio </parameter>" << std::endl
174  << " <!-- limit the number of processed records (run+evt): --> " << std::endl
175  << " <parameter name=\"MaxRecordNumber\" value=\"5001\" /> " << std::endl
176  << " <parameter name=\"SkipNEvents\" value=\"0\" /> " << std::endl
177  << " <parameter name=\"SupressCheck\" value=\"false\" /> " << std::endl
178  << " <parameter name=\"AllowToModifyEvent\" value=\"false\" /> " << std::endl
179  << " <parameter name=\"GearXMLFile\"></parameter> " << std::endl
180  << " <parameter name=\"Verbosity\" options=\"DEBUG0-4,MESSAGE0-4,WARNING0-4,ERROR0-4,SILENT\"> DEBUG </parameter> " << std::endl
181  << " <parameter name=\"RandomSeed\" value=\"1234567890\" />" << std::endl
182  << " <!-- optionally limit the collections that are read from the input file: --> " << std::endl
183  << " <!--parameter name=\"LCIOReadCollectionNames\">MCParticle PandoraPFOs</parameter-->" << std::endl
184  << " </global>" << std::endl
185  << std::endl ;
186 
187  for(MI i=_map.begin() ; i!= _map.end() ; i++) {
188  i->second->printDescriptionXML() ;
189  }
190 
191  std::cout << std::endl
192  << "</marlin>"
193  << std::endl ;
194 
195  }
196 
198 
200 
201  for(ProcessorMap::iterator i=_map.begin() ; i!= _map.end() ; i++) {
202  ptypes.insert(i->first);
203  }
204  return ptypes;
205  }
206 
208  return _map[ type ] ;
209  }
210 
212  return _activeMap[ name ] ;
213  }
214 
216 
217 
218  _list.remove( _activeMap[name] ) ;
219  _activeMap.erase( name ) ;
220 
221  }
222 
223 
224  bool ProcessorMgr::addActiveProcessor( const std::string& processorType ,
225  const std::string& processorName ,
227  const std::string condition) {
228 
229  Processor* processor = getProcessor( processorType ) ;
230 
231 
232 
233  if( processor == 0 ) {
234  std::stringstream sstr ;
235  sstr << " ProcessorMgr::registerProcessor: unknown processor with type " << processorType << " ! " << std::endl ;
236  throw Exception( sstr.str() );
237  }
238 
239 
240  if( _activeMap.find( processorName ) != _activeMap.end() ){
241 
242  std::cerr << " ProcessorMgr::addActiveProcessor: processor " << processorName
243  << " already registered ! "
244  << std::endl ;
245  return false ;
246 
247  } else {
248 
249  Processor* newProcessor = processor->newProcessor() ;
250  newProcessor->setName( processorName ) ;
251  _activeMap[ processorName ] = newProcessor ;
252  _list.push_back( newProcessor ) ;
253  _conditions.addCondition( processorName, condition ) ;
254 
255  if( parameters != 0 ){
256  newProcessor->setParameters( parameters ) ;
257  }
258  // // keep a copy of the output processor
259  // if( processorType == "LCIOOutputProcessor" ){
260  // _outputProcessor = dynamic_cast<LCIOOutputProcessor*>( newProcessor ) ;
261  // }
262  }
263 
264  return true ;
265  }
266 
267 
269 
270  streamlog::logbuffer* lb = new streamlog::logbuffer( std::cout.rdbuf() , &my_cout ) ;
271  std::cout.rdbuf( lb ) ;
272 
273  // for_each( _list.begin() , _list.end() , std::mem_fun( &Processor::baseInit ) ) ;
274 
275  for( ProcessorList::iterator it = _list.begin() ; it != _list.end() ; ++it ) {
276 
277  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
278  scope.setLevel( (*it)->logLevelName() ) ;
279 
280  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
281 
282  (*it)->baseInit() ;
283 
284  tMap[ *it ] = std::make_pair( 0 , 0 ) ;
285 
286 
287  EventModifier* em = dynamic_cast<EventModifier*>( *it ) ;
288 
289  if( em != 0 ) {
290 
291  _eventModifierList.push_back( *it ) ;
292 
293  streamlog_out( WARNING4 ) << " ----------- " << std::endl
294  << " the following processor will modify the LCIO event : "
295  << (*it)->name() << " !! " << std::endl
296  << " ------------ " << std::endl ;
297  }
298 
299  }
300  }
301 
302  void ProcessorMgr::processRunHeader( LCRunHeader* run){
303 
304 
305 //#ifdef USE_GEAR
306  // check if gear file is consistent with detector model in lcio run header
307  std::string lcioDetName = run->getDetectorName() ;
308 
309 
310  std::string gearDetName("unknwon_gear_detector") ;
311 
312  bool doConsistencyCheck = true ;
313 
314  try{
315 
316  gearDetName = Global::GEAR->getDetectorName() ;
317 
318  }
319  catch( gear::UnknownParameterException ){
320 
321  doConsistencyCheck = false ;
322  }
323 
324 
325 
326  if( doConsistencyCheck && lcioDetName != gearDetName ) {
327 
328  // std::stringstream sstr ;
329  //
330  // sstr << std::endl
331  // << " ============================================================= " << std::endl
332  // << " ProcessorMgr::processRunHeader : inconsistent detector models : " << std::endl
333  // << " in lcio : " << lcioDetName << " <=> in gear file : " << gearDetName << std::endl
334  // << " ============================================================= " << std::endl
335  // << std::endl ;
336 
337  //throw lcio::Exception( sstr.str() ) ;
338 
339  // throw ProcMgrStopProcessing( sstr.str() ) ;
340 
341  streamlog_out(WARNING) << " ============================================================= " << std::endl ;
342  streamlog_out(WARNING) << " ProcessorMgr::processRunHeader : inconsistent detector models : " << std::endl ;
343  streamlog_out(WARNING) << " in lcio : " << lcioDetName << " <=> in gear file : " << gearDetName << std::endl ;
344  streamlog_out(WARNING) << " ============================================================= " << std::endl ;
345  }
346 
347 
348 
349 //#endif
350 
351  // for_each( _list.begin() , _list.end() , std::bind2nd( std::mem_fun( &Processor::processRunHeader ) , run ) ) ;
352  for( ProcessorList::iterator it = _list.begin() ; it != _list.end() ; ++it ) {
353 
354  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
355  scope.setLevel( (*it)->logLevelName() ) ;
356 
357  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
358 
359  (*it)->processRunHeader( run ) ;
360  }
361  }
362 
363 
364  void ProcessorMgr::modifyRunHeader( LCRunHeader* rhd ){
365 
366  for( ProcessorList::iterator it = _eventModifierList.begin(); it != _eventModifierList.end() ; ++ it) {
367 
368  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
369 
370  scope.setLevel( (*it)->logLevelName() ) ;
371  // (*it)->logLevelName() ;
372 
373  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
374 
375  ( dynamic_cast<EventModifier*>( *it ) )->modifyRunHeader( rhd ) ;
376  }
377 
378  }
379 
380  void ProcessorMgr::modifyEvent( LCEvent* evt ){
381 
382  _conditions.clear() ;
383 
384  // refresh the seeds for this event
386 
387  for( ProcessorList::iterator it = _eventModifierList.begin(); it != _eventModifierList.end() ; ++ it) {
388 
389  if( not( _conditions.conditionIsTrue( (*it)->name() ) )) {
390  continue;
391  }
392 
393  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
394 
395  scope.setLevel( (*it)->logLevelName() ) ;
396  // (*it)->logLevelName() ;
397 
398  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
399 
400  start_t = clock(); // start timer
401 
402  ( dynamic_cast<EventModifier*>( *it ) )->modifyEvent( evt ) ;
403 
404  end_t = clock(); // stop timer
405 
406  TimeMap::iterator itT = tMap.find( *it );
407 
408  itT->second.first += double( end_t - start_t );
409  //do not increase event count, because this is done after processEvent again
410  //itT->second.second++;
411 
412  }
413 
414 
415  bool check = ( Global::parameters->getStringVal("SupressCheck") != "true" ) ;
416 
417  bool modify = ( Global::parameters->getStringVal("AllowToModifyEvent") == "true" ) ;
418 
419  if( modify ) {
420 
421  // refresh the seeds for this event
423 
424  try{
425 
426  for( ProcessorList::iterator it = _list.begin() ; it != _list.end() ; ++it ) {
427 
428  if( _conditions.conditionIsTrue( (*it)->name() ) ) {
429 
430  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
431  //if( (*it)->logLevelName().size() > 0 )
432  scope.setLevel( (*it)->logLevelName() ) ;
433 
434  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
435 
436  start_t = clock () ; // start timer
437 
438  (*it)->processEvent( evt ) ;
439 
440  if( check ) (*it)->check( evt ) ;
441 
442  end_t = clock () ; // stop timer
443 
444 
445  TimeMap::iterator itT = tMap.find( *it ) ;
446 
447  itT->second.first += double( end_t - start_t ) ;
448  itT->second.second ++ ;
449 
450 
451  (*it)->setFirstEvent( false ) ;
452  }
453  }
454  } catch( SkipEventException& e){
455 
456  ++ _skipMap[ e.what() ] ;
457  }
458 
459  } // end modify
460 
461 
462  }
463 
464 
465  void ProcessorMgr::processEvent( LCEvent* evt ){
466 
467  _conditions.clear() ;
468 
469  bool check = ( Global::parameters->getStringVal("SupressCheck") != "true" ) ;
470 
471  bool modify = ( Global::parameters->getStringVal("AllowToModifyEvent") == "true" ) ;
472 
473  if( modify )
474  return ; // processorEventMethods already called in modifyEvent() ...
475 
476 
477  // refresh the seeds for this event
479 
480  try{
481 
482  for( ProcessorList::iterator it = _list.begin() ; it != _list.end() ; ++it ) {
483 
484  if( _conditions.conditionIsTrue( (*it)->name() ) ) {
485 
486  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
487  //if( (*it)->logLevelName().size() > 0 )
488  scope.setLevel( (*it)->logLevelName() ) ;
489 
490  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
491 
492  start_t = clock () ; // start timer
493 
494  (*it)->processEvent( evt ) ;
495 
496  if( check ) (*it)->check( evt ) ;
497 
498  end_t = clock () ; // stop timer
499 
500 
501  TimeMap::iterator itT = tMap.find( *it ) ;
502 
503  itT->second.first += double( end_t - start_t ) ;
504  itT->second.second ++ ;
505 
506 
507  (*it)->setFirstEvent( false ) ;
508  }
509  }
510  } catch( SkipEventException& e){
511 
512  ++ _skipMap[ e.what() ] ;
513  }
514  }
515 
516 
518 
519  _conditions.setValue( proc->name() , val ) ;
520 
521  }
523  const std::string& name){
524 
525  std::string valName = proc->name() + "." + name ;
526  _conditions.setValue( valName , val ) ;
527  }
528 
530 
531  // for_each( _list.begin() , _list.end() , std::mem_fun( &Processor::end ) ) ;
532 
533  // for_each( _list.rbegin() , _list.rend() , std::mem_fun( &Processor::end ) ) ;
534 
535  for( ProcessorList::reverse_iterator it = _list.rbegin() ; it != _list.rend() ; ++it ) {
536 
537  streamlog::logscope scope( streamlog::out ) ; scope.setName( (*it)->name() ) ;
538  scope.setLevel( (*it)->logLevelName() ) ;
539 
540  streamlog::logscope scope1( my_cout ) ; scope1.setName( (*it)->name() ) ;
541 
542  (*it)->end() ;
543  }
544  // if( _skipMap.size() > 0 ) {
545  streamlog_out(MESSAGE) << " --------------------------------------------------------- " << std::endl
546  << " Events skipped by processors : " << std::endl ;
547 
548  unsigned nSkipped = 0 ;
549  for( SkippedEventMap::iterator it = _skipMap.begin() ; it != _skipMap.end() ; it++) {
550 
551  streamlog_out(MESSAGE) << " " << it->first << ": \t" << it->second << std::endl ;
552 
553  nSkipped += it->second ;
554  }
555  streamlog_out(MESSAGE) << " Total: " << nSkipped << std::endl ;
556  streamlog_out(MESSAGE) << " --------------------------------------------------------- "
557  << std::endl
558  << std::endl ;
559  // }
560 
561  // ----- print timing information ----------
562 
563  streamlog_out(MESSAGE) << " --------------------------------------------------------- " << std::endl
564  << " Time used by processors ( in processEvent() ) : " << std::endl
565  << std::endl ;
566 
567 
568 
569 
570 
571  // for( ProcessorList::iterator it = _list.begin() ; it != _list.end() ; ++it ) {
572  // TimeMap::iterator itT = tMap.find( *it ) ;
573 
574  // sort procs wrt processing time :
575  typedef std::list< TimeMap::value_type > TMList ;
576  TMList l ;
577  std::copy( tMap.begin() , tMap.end() , std::back_inserter( l ) ) ;
578  l.sort( Cmp() ) ;
579 
580  double tTotal = 0.0 ;
581  int evtTotal = 0 ;
582 
583  for( TMList::iterator itT = l.begin() ; itT != l.end() ; ++ itT ) {
584 
585  // fg: this does not work w/ streamlog !?
586  // streamlog_out(MESSAGE) << std::ios_base::left << std::setw(30) << (*it)->name() ;
587  // copy string to fixed size char* ->
588  char cName[40] = " " ;
589  const std::string& sName = itT->first->name() ;
590  unsigned nChar = ( sName.size() > 30 ? 30 : sName.size() ) ;
591  for(unsigned i=0 ; i< nChar ; i++ ) {
592  cName[i] = sName[i] ;
593  }
594 
595 
596  double tProc = itT->second.first / double(CLOCKS_PER_SEC) ;
597 
598  tTotal += tProc ;
599 
600  int evtProc = itT->second.second ;
601 
602  if( evtProc > evtTotal ){
603  evtTotal = evtProc ;
604  }
605 
606  streamlog_out(MESSAGE) << cName
607  << std::setw(12) << std::scientific << tProc << " s in "
608  << std::setw(12) << evtProc << " events ==> " ;
609 
610  if( evtProc > 0 ){
611  streamlog_out(MESSAGE) << std::setw(12) << std::scientific << tProc / evtProc << " [ s/evt.] " ;
612  }
613  else{
614  streamlog_out(MESSAGE) << std::setw(12) << std::scientific << "NaN" << " [ s/evt.] " ;
615  }
616 
617  streamlog_out(MESSAGE) << std::endl ;
618 
619  }
620 
621  streamlog_out(MESSAGE) << " Total: "
622  << std::setw(12) << std::scientific << tTotal << " s in "
623  << std::setw(12) << evtTotal << " events ==> " ;
624 
625  if( evtTotal > 0 ){
626  streamlog_out(MESSAGE) << std::setw(12) << std::scientific << tTotal / evtTotal << " [ s/evt.] " ;
627  }
628  else{
629  streamlog_out(MESSAGE) << std::setw(12) << std::scientific << "NaN" << " [ s/evt.] " ;
630  }
631 
632  streamlog_out(MESSAGE) << std::endl ;
633 
634 
635  streamlog_out(MESSAGE) << " --------------------------------------------------------- " << std::endl ;
636 
637  delete Global::EVENTSEEDER ;
638  Global::EVENTSEEDER = nullptr ;
639 
640  for (auto& pair : _activeMap ) {
641  delete pair.second;
642  }
643 
644  _activeMap.clear();
645  _map.clear();
646  _list.clear();
647 
648  delete _me;
649  _me = nullptr;
650 
651  }
652 
653 
654 
655  } // namespace marlin
virtual void readDataSource(int numEvents)
Calls readDataSource() for all Processors of type DataSourceProcessor.
Definition: ProcessorMgr.cc:91
std::set< std::string > getAvailableProcessorTypes()
Returns a list of all registered processors found.
T copy(T...args)
Tagging interface for processors that modify the LCIO event.
Definition: EventModifier.h:13
static ProcessorMgr * instance()
Return the instance of this manager.
Definition: ProcessorMgr.cc:60
Base class for data source handlers that can read arbitrary non-LCIO input files and create LCIO even...
virtual void processEvent(LCEvent *)
void clear()
Clear all boolean values.
void setValue(const std::string &key, bool val)
Set the the boolean value for the given key.
ProcessorList _list
Definition: ProcessorMgr.h:124
T rend(T...args)
virtual void setProcessorReturnValue(Processor *proc, bool val)
Set the return value for the given processor.
virtual const std::string & name() const
Return name of this processor.
Definition: Processor.h:132
SkipEventException used to skip the current event in Processor::processEvent.
Definition: Exceptions.h:34
std::map< Processor *, std::pair< double, int > > TimeMap
Definition: ProcessorMgr.cc:24
virtual const std::string & type() const
Return type name for the processor (as set in constructor).
Definition: Processor.h:128
T endl(T...args)
virtual Processor * newProcessor()=0
Return a new instance of the processor.
SkippedEventMap _skipMap
Definition: ProcessorMgr.h:125
T end(T...args)
streamlog::logstream my_cout
Definition: ProcessorMgr.cc:46
T remove(T...args)
virtual void end()
STL class.
StopProcessingException used to stop the current proccessing of events and call Processor::end().
Definition: Exceptions.h:52
T setw(T...args)
Processor * getProcessor(const std::string &type)
Return the processor that has been registered with the given type.
STL class.
bool addActiveProcessor(const std::string &processorType, const std::string &processorName, std::shared_ptr< StringParameters > parameters, const std::string condition="true")
Add a processor of type processorType with name processorName to the list of active processors...
ProcMgrStopProcessing(const std::string m)
Definition: ProcessorMgr.cc:38
T push_back(T...args)
virtual void readDataSource(int numEvents)=0
User call back to read the data source and create the LCIO event and run header.
void registerProcessor(Processor *processor)
Register a processor with the given name.
Definition: ProcessorMgr.cc:73
virtual void setParameters(std::shared_ptr< StringParameters > parameters)
Helper function returns the ProcessorParameter for the given name.
Definition: Processor.cc:54
static ProcessorEventSeeder * EVENTSEEDER
Definition: Global.h:34
Processor * getActiveProcessor(const std::string &name)
Return the active processor with the given name.
void dumpRegisteredProcessorsXML()
Dump information of all registered processors in XML format to stdout.
void refreshSeeds(LCEvent *evt)
Create new set of seeds for registered Processors for the given event.
virtual ~ProcessorMgr()
destructor deletes ProcessorEventSeeder
Definition: ProcessorMgr.cc:70
static StringParameters * parameters
Definition: Global.h:27
ProcessorList _eventModifierList
Definition: ProcessorMgr.h:127
T erase(T...args)
const std::string & getStringVal(const std::string &key)
T str(T...args)
T make_pair(T...args)
virtual void modifyRunHeader(LCRunHeader *)
T clear(T...args)
STL class.
virtual void setName(const std::string &processorName)
Set processor name.
Definition: Processor.h:227
T scientific(T...args)
static clock_t start_t
Definition: ProcessorMgr.cc:23
void dumpRegisteredProcessors()
Dump information of all registered processors to stdout.
ProcessorMap _activeMap
Definition: ProcessorMgr.h:123
T insert(T...args)
T find(T...args)
T size(T...args)
virtual void processRunHeader(LCRunHeader *)
Processor event seeder - provides independent pseudo-randomly generated seeds for registered processo...
Processor manager singleton class.
Definition: ProcessorMgr.h:36
T begin(T...args)
static ProcessorMgr * _me
Definition: ProcessorMgr.h:121
bool conditionIsTrue(const std::string &name)
True if the named condition (stored with addCondition) is true with the current values.
T back_inserter(T...args)
virtual void modifyEvent(LCEvent *)
static gear::GearMgr * GEAR
Definition: Global.h:31
static clock_t end_t
Definition: ProcessorMgr.cc:23
void removeActiveProcessor(const std::string &name)
Remove processor with name from list of active processors.
static TimeMap tMap
Definition: ProcessorMgr.cc:25
Base class for Marlin processors.
Definition: Processor.h:64
bool operator()(const TimeMap::value_type &v1, const TimeMap::value_type &v2)
Definition: ProcessorMgr.cc:31
LogicalExpressions _conditions
Definition: ProcessorMgr.h:129
virtual void init()
void addCondition(const std::string &name, const std::string &expression)
Add a new named logical expression formed out of [!,(,&amp;&amp;,||,),value], e.g.
T rbegin(T...args)