All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProcessorBlock.hh
Go to the documentation of this file.
1 #ifndef __sbnanalysis_core_ProcessorBlock__
2 #define __sbnanalysis_core_ProcessorBlock__
3 
4 /**
5  * \file ProcessorBlock.hh
6  *
7  * Processor management.
8  *
9  * Author: A. Mastbaum <mastbaum@uchicago.edu>, 2018/01/30
10  */
11 
12 #include <string>
13 #include <vector>
14 
15 namespace fhicl {
16  class ParameterSet;
17 }
18 
19 namespace core {
20 
21 /**
22  * \class core::ProcessorBlock
23  * \brief A set of Processors
24  */
26 public:
27  /** Constructor */
29 
30  /** Destructor */
31  virtual ~ProcessorBlock();
32 
33  /**
34  * Add a processor to the block.
35  *
36  * Note that the ProcessorBlock takes ownership of the Processor.
37  *
38  * \param processor The processor
39  * \param config The configuration, if any
40  */
41  virtual void AddProcessor(ProcessorBase* processor, fhicl::ParameterSet* config);
42 
43  /**
44  * Process a set of files.
45  *
46  * \param filenames A list of art ROOT files to process
47  */
48  virtual void ProcessFiles(std::vector<std::string> filenames);
49 
50  /** Delete all processors owned by the block. */
51  virtual void DeleteProcessors();
52 
53 protected:
54  /** Processors and their configurations. */
55  std::vector<std::pair<ProcessorBase*, fhicl::ParameterSet*> > fProcessors;
56 };
57 
58 } // namespace core
59 
60 #endif // __sbnanalysis_core_ProcessorBlock__
61 
std::vector< std::pair< ProcessorBase *, fhicl::ParameterSet * > > fProcessors
A set of Processors.
virtual void DeleteProcessors()
A generic tree-writing event-by-event processor.
virtual void ProcessFiles(std::vector< std::string > filenames)
virtual void AddProcessor(ProcessorBase *processor, fhicl::ParameterSet *config)