30 fInvertGate(false), fNchan(0)
50 const RVarDef var[] = {
51 {
"adc",
"Helicity ADC raw data",
"fADC_hdata" },
52 {
"gate_adc",
"Gate ADC raw data",
"fADC_Gate" },
53 {
"adc_hel",
"Beam helicity from ADC",
"fADC_Hel" },
64 static const char*
const here =
"ReadDatabase";
73 vector<Int_t> heldef, gatedef;
75 Int_t ignore_gate = -1, invert_gate = 0;
76 const DBRequest request[] = {
77 {
"helchan", &heldef, kIntV, 0,
false, -2 },
78 {
"gatechan", &gatedef, kIntV, 0,
true, -2 },
80 {
"ignore_gate", &ignore_gate,
kInt, 0,
true, -2 },
81 {
"invert_gate", &invert_gate,
kInt, 0,
true, -2 },
90 if( heldef.size() != 3 ) {
91 Error(
Here(
here),
"Incorrect definition of helicity data channel. Must be "
92 "exactly 3 numbers (roc,slot,chan), found %u. Fix database.",
93 static_cast<unsigned int>(heldef.size()) );
97 if( gatedef.empty() ) {
101 Error(
Here(
here),
"Missing gate data channel definition gatechan. "
106 if( !gatedef.empty() && gatedef.size() != 3 ) {
107 Error(
Here(
here),
"Incorrect definition of gate data channel. Must be "
108 "exactly 3 numbers (roc,slot,chan), found %u. Fix database.",
109 static_cast<unsigned int>(gatedef.size()) );
119 if( !gatedef.empty() )
122 catch(
const std::out_of_range&
e) {
158 bool gate_high =
false;
168 cout <<
"crate "<<roc<<
" slot "<<slot<<
" chan "
171 cout <<
" above cut !";
206 cout <<
"ADC helicity info "<<endl
209 <<
" resulting helicity"<<
fHelicity<<endl;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char mode
static const Double_t kDefaultThreshold
static const char *const here
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual ~THaADCHelicity()
virtual Int_t ReadDatabase(const TDatime &date)
virtual Int_t Decode(const THaEvData &evdata)
virtual void Clear(Option_t *opt="")
static Int_t LoadDB(FILE *file, const TDatime &date, const DBRequest *request, const char *prefix, Int_t search=0, const char *here="THaAnalysisObject::LoadDB")
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
virtual const char * Here(const char *) const
virtual FILE * OpenFile(const TDatime &date)
UInt_t GetNumHits(UInt_t crate, UInt_t slot, UInt_t chan) const
UInt_t GetData(UInt_t crate, UInt_t slot, UInt_t chan, UInt_t hit) const
virtual void Clear(Option_t *opt="")
virtual Int_t ReadDatabase(const TDatime &date)
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual void Error(const char *method, const char *msgfmt,...) const