RdEventMerger.h
Go to the documentation of this file.
1 #ifndef _RdEventMerger_h_
2 #define _RdEventMerger_h_
3 
4 #include <fwk/VModule.h>
5 #include <io/IoCodes.h> // needed for "Status"
6 #include <fstream> // for ascii output
7 
8 namespace io{
9  class EventFile;
10  class EventFileChain;
11 }
12 
13 namespace evt {
14  class Event;
15 }
16 
17 namespace revt {
18  class REvent;
19 }
20 
21 // you should assign your module to a namespace
22 
23 namespace RdEventMerger {
24 
35  class RdEventMerger : public fwk::VModule {
36 
37  public:
38  // If you define a constructor, you MUST provide an implementation
39  // for it, otherwise the REGISTER_MODULE macro will not register
40  // your module. (Here, implementation is in RdEventMerger.cc)
41  RdEventMerger();
42  virtual ~RdEventMerger();
43 
47 
48  private:
49  io::EventFileChain * fInputFiles; // List of input files
50  io::Status EndOfInputFiles; // No more events in input files
51  std::vector<std::string> fInputFilenames; // ad filenames
52  std::map<const unsigned int, evt::Event > fInputBuffer; // Map for buffering and sorting events
53  int fEventsWritten; // Count written coincidences
54  void ExamineEvent(evt::Event& event); // Function to write to ascii file
55  std::string fOffFilename; // Hybrid offline output filename
56  io::EventFile * fOfflineFile; // Actual hybrid offline output file
57  io::Type fFileType; // file type
58  evt::Event * fTempEvt; // Temporary event used to store events which are read from file
59 
60  // xml settings
61  unsigned int fBufferSize;
62  unsigned int fBufferInc;
63  double fOffset;
64  double fCoinWindow;
65  double fRadioOffset;
69 
70  // for ascii output
71  std::ofstream outfile;
72 
73  // The REGISTER_MODULE macro makes the framework aware of your module.
74  // You need to put this macro at the very end of your module class definition.
75  // Give your module a name (first argument) and specify its
76  // class name (second argument). In the ModuleSequenceExample.xml file,
77  // you can see this module being refered to by the name we give it here.
78 
79  REGISTER_MODULE("RdEventMerger", RdEventMerger);
80 
81  };
82 
83 }
84 
85 
86 #endif
87 
88 // Configure (x)emacs for this file ...
89 // Local Variables:
90 // mode:c++
91 // compile-command: "make -k"
92 // End:
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Event file merger, to be used initially for RD and SD.
std::vector< std::string > fInputFilenames
Definition: RdEventMerger.h:51
REGISTER_MODULE("RdEventMerger", RdEventMerger)
Status
Return code for seek operation.
Definition: IoCodes.h:24
Module interface.
Definition: VModule.h:53
io::EventFileChain * fInputFiles
Definition: RdEventMerger.h:49
void ExamineEvent(evt::Event &event)
A collection of EventFile.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Interface to file I/O objects.
Definition: EventFile.h:34
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33
io::EventFile * fOfflineFile
Definition: RdEventMerger.h:56
std::map< const unsigned int, evt::Event > fInputBuffer
Definition: RdEventMerger.h:52

, generated on Tue Sep 26 2023.