Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcScalerEvtHandler.h
Go to the documentation of this file.
1#ifndef THcScalerEvtHandler_
2#define THcScalerEvtHandler_
3
5//
6// THcScalerEvtHandler
7// Class to handle Hall C scaler events (type 0)
8// author Edward Brash (brash@jlab.org)
9// based on THaScalerEvtHandler by Robert Michaels (rom@jlab.org)
10//
12
13#include "THaEvtTypeHandler.h"
14#include "Decoder.h"
15#include <string>
16#include <utility>
17#include <vector>
18#include <set>
19#include "TTree.h"
20#include "TString.h"
21#include <cstring>
22
23class HCScalerLoc { // Utility class used by THcScalerEvtHandler
24public:
25 HCScalerLoc(TString nm, TString desc, UInt_t idx, Int_t s1, UInt_t ich,
26 UInt_t iki, Int_t iv)
27 : name(std::move(nm))
28 , description(std::move(desc))
29 , index(idx)
30 , islot(s1)
31 , ichan(ich)
32 , ikind(iki)
33 , ivar(iv)
34 {}
37};
38
40
41public:
42
43 THcScalerEvtHandler(const char*, const char*);
44 virtual ~THcScalerEvtHandler();
45
46 Int_t Analyze(THaEvData *evdata);
47 Int_t AnalyzeBuffer(UInt_t *rdata, Bool_t onlysync);
48 virtual EStatus Init( const TDatime& run_time);
49 virtual Int_t ReadDatabase(const TDatime& date );
50 virtual Int_t End( THaRunBase* r = nullptr );
51 virtual void SetUseFirstEvent(Bool_t b = kFALSE) {fUseFirstEvent = b;}
52 virtual void SetDelayedType(int evtype);
53 virtual void SetOnlyBanks(Bool_t b = kFALSE) {fOnlyBanks = b;fRocSet.clear();}
54 virtual void SetOnlyUseSyncEvents(Bool_t b=kFALSE) {fOnlySyncEvents = b;}
55
56private:
57
58 void AddVars(const TString& name, const TString& desc, UInt_t iscal, UInt_t ichan, UInt_t ikind);
59 void DefVars();
60
61 std::vector<Decoder::GenScaler*> scalers;
62 std::vector<HCScalerLoc*> scalerloc;
75 std::vector <std::string> fBCM_Name;
83 std::vector<UInt_t> scal_prev_read;
84 std::vector<UInt_t> scal_present_read;
85 std::vector<UInt_t> scal_overflows;
95 std::vector<UInt_t*> fDelayedEvents;
96 std::set<UInt_t> fRocSet;
97 std::set<UInt_t> fModuleSet;
98
101
102 ClassDef(THcScalerEvtHandler,0) // Scaler Event handler
103
104};
105
106#endif
int Int_t
unsigned int UInt_t
ROOT::R::TRInterface & r
#define s1(x)
bool Bool_t
double Double_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
HCScalerLoc(TString nm, TString desc, UInt_t idx, Int_t s1, UInt_t ich, UInt_t iki, Int_t iv)
Event handler for Hall C scalers.
Int_t Analyze(THaEvData *evdata)
THcScalerEvtHandler(const THcScalerEvtHandler &fh)
std::set< UInt_t > fModuleSet
virtual void SetOnlyUseSyncEvents(Bool_t b=kFALSE)
std::vector< HCScalerLoc * > scalerloc
std::vector< UInt_t > scal_prev_read
std::vector< Decoder::GenScaler * > scalers
std::vector< UInt_t * > fDelayedEvents
virtual void SetUseFirstEvent(Bool_t b=kFALSE)
virtual Int_t ReadDatabase(const TDatime &date)
std::vector< UInt_t > scal_present_read
std::vector< std::string > fBCM_Name
virtual void SetDelayedType(int evtype)
std::set< UInt_t > fRocSet
void AddVars(const TString &name, const TString &desc, UInt_t iscal, UInt_t ichan, UInt_t ikind)
virtual void SetOnlyBanks(Bool_t b=kFALSE)
virtual Int_t End(THaRunBase *r=nullptr)
THcScalerEvtHandler & operator=(const THcScalerEvtHandler &fh)
Int_t AnalyzeBuffer(UInt_t *rdata, Bool_t onlysync)
std::vector< UInt_t > scal_overflows
STL namespace.