Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaEvtTypeHandler.h
Go to the documentation of this file.
1#ifndef Podd_THaEvtTypeHandler_h_
2#define Podd_THaEvtTypeHandler_h_
3
5//
6// THaEvtTypeHandler
7// Base class to handle different types of events.
8// author Robert Michaels (rom@jlab.org)
9//
11
12#include "THaAnalysisObject.h"
13#include <vector>
14#include <fstream>
15#include <cassert>
16
18
19public:
20 THaEvtTypeHandler(const char* name, const char* description);
21 virtual ~THaEvtTypeHandler();
22
23 virtual Int_t Analyze(THaEvData *evdata) = 0;
24 virtual EStatus Init( const TDatime& run_time );
25 virtual void EvPrint() const;
26 virtual Bool_t IsMyEvent( UInt_t type ) const;
27 virtual void EvDump(THaEvData *evdata) const;
28 virtual void SetDebugFile(std::ofstream *file) { if (file) fDebugFile=file; };
29 virtual void SetDebugFile(const char *filename);
30 virtual void AddEvtType( UInt_t evtype );
31 virtual void SetEvtType( UInt_t evtype );
32 virtual UInt_t GetNumTypes() { return eventtypes.size(); };
33 virtual UInt_t GetEvtType() {
34 assert( !eventtypes.empty() );
35 return eventtypes[0];
36 }
37 virtual std::vector<UInt_t> GetEvtTypes() { return eventtypes; };
38
39protected:
40 std::vector<UInt_t> eventtypes;
41 std::ofstream *fDebugFile;
42
43 virtual void MakePrefix();
44
45private:
48
49 ClassDef(THaEvtTypeHandler,0) // Event type handler
50
51};
52
53#endif
int Int_t
unsigned int UInt_t
bool Bool_t
#define ClassDef(name, id)
char name[80]
std::vector< UInt_t > eventtypes
virtual void AddEvtType(UInt_t evtype)
virtual void EvPrint() const
virtual Bool_t IsMyEvent(UInt_t type) const
THaEvtTypeHandler(const THaEvtTypeHandler &fh)
virtual std::vector< UInt_t > GetEvtTypes()
virtual void EvDump(THaEvData *evdata) const
virtual UInt_t GetNumTypes()
virtual void SetDebugFile(std::ofstream *file)
virtual void SetEvtType(UInt_t evtype)
virtual Int_t Analyze(THaEvData *evdata)=0
THaEvtTypeHandler & operator=(const THaEvtTypeHandler &fh)
std::ofstream * fDebugFile
virtual UInt_t GetEvtType()
virtual void MakePrefix()