Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaScalerEvtHandler.h
Go to the documentation of this file.
1#ifndef Podd_THaScalerEvtHandler_h_
2#define Podd_THaScalerEvtHandler_h_
3
5//
6// THaScalerEvtHandler
7// Class to handle Hall A scaler events (type 140)
8// author Robert Michaels (rom@jlab.org)
9//
11
12#include "THaEvtTypeHandler.h"
13#include "Decoder.h"
14#include "TString.h"
15#include <vector>
16#include <string>
17
18class TTree;
19
20static const UInt_t ICOUNT = 1;
21static const UInt_t IRATE = 2;
22static const UInt_t MAXCHAN = 32;
23static const UInt_t MAXTEVT = 5000;
24static const UInt_t defaultDT = 4;
25
26class ScalerLoc { // Utility class used by THaScalerEvtHandler
27 public:
29 UInt_t ich, UInt_t iki )
30 : name(std::move(nm))
31 , description(std::move(desc))
32 , index(idx)
33 , islot(sl)
34 , ichan(ich)
35 , ikind(iki)
36 {}
39};
40
42
43public:
44
45 THaScalerEvtHandler(const char* name, const char* description);
48 virtual ~THaScalerEvtHandler();
49
50 virtual Int_t Analyze(THaEvData *evdata);
51 virtual EStatus Init( const TDatime& run_time);
52 virtual Int_t End( THaRunBase* r=nullptr );
53
54
55protected:
56
57 void AddVars( const TString& name, const TString& desc, UInt_t iscal,
58 UInt_t ichan, UInt_t ikind );
59 void DefVars();
60 void ParseVariable( const std::vector<std::string>& dbline );
61 void ParseMap( const char* cbuf, const std::vector<std::string>& dbline );
62 void VerifySlots();
63 void SetIndices();
64 void AssignNormScaler();
65
66 std::vector<Decoder::GenScaler*> scalers;
67 std::vector<ScalerLoc*> scalerloc;
72
73 ClassDef(THaScalerEvtHandler,0) // Scaler Event handler
74
75};
76
77#endif
int Int_t
unsigned int UInt_t
double Double_t
#define ClassDef(name, id)
char name[80]
static const UInt_t IRATE
static const UInt_t defaultDT
static const UInt_t ICOUNT
static const UInt_t MAXCHAN
static const UInt_t MAXTEVT
ScalerLoc(TString nm, TString desc, UInt_t idx, UInt_t sl, UInt_t ich, UInt_t iki)
THaScalerEvtHandler(const THaScalerEvtHandler &fh)=delete
std::vector< Decoder::GenScaler * > scalers
void AddVars(const TString &name, const TString &desc, UInt_t iscal, UInt_t ichan, UInt_t ikind)
virtual Int_t Analyze(THaEvData *evdata)
void ParseMap(const char *cbuf, const std::vector< std::string > &dbline)
virtual Int_t End(THaRunBase *r=nullptr)
THaScalerEvtHandler & operator=(const THaScalerEvtHandler &fh)=delete
void ParseVariable(const std::vector< std::string > &dbline)
std::vector< ScalerLoc * > scalerloc
STL namespace.