Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaADCHelicity.h
Go to the documentation of this file.
1
#ifndef Podd_THaADCHelicity_h_
2
#define Podd_THaADCHelicity_h_
3
5
//
6
// THaADCHelicity
7
//
8
// Helicity of the beam - from ADC
9
//
11
12
13
#include "
THaHelicityDet.h
"
14
#include <vector>
15
#include <stdexcept>
16
17
class
THaADCHelicity
:
public
THaHelicityDet
{
18
19
public
:
20
21
THaADCHelicity
(
const
char
*
name
,
const
char
* description,
22
THaApparatus
*
a
=
nullptr
);
23
virtual
~THaADCHelicity
();
24
25
virtual
void
Clear
(
Option_t
* opt =
""
);
26
virtual
Int_t
Decode
(
const
THaEvData
& evdata );
27
28
THaADCHelicity
()
29
:
fADC_hdata
(0),
fADC_Gate
(0),
fADC_Hel
(
kUnknown
),
30
fThreshold
(0),
fIgnoreGate
(false),
fInvertGate
(false),
31
fNchan
(0) {}
// For ROOT I/O only
32
33
protected
:
34
// ADC data for helicity and gate
35
Double_t
fADC_hdata
;
// Helicity ADC raw data
36
Double_t
fADC_Gate
;
// Gate ADC raw data
37
EHelicity
fADC_Hel
;
// Calculated beam helicity from ADC data
38
39
Double_t
fThreshold
;
// Min ADC amplitude required for Hel = Plus
40
Bool_t
fIgnoreGate
;
// Ignore the gate info and always assign helicity
41
Bool_t
fInvertGate
;
// Invert polarity of gate signal, so that 0=active
42
43
// Simplified detector map for the two data channels
44
class
ChanDef_t
{
45
public
:
46
ChanDef_t
() :
roc
(-1),
slot
(-1),
chan
(-1) {}
47
ChanDef_t
&
operator=
(
const
std::vector<int>& rhs) {
48
if
( rhs.size() < 3 ) {
49
static
const
std::string
50
msg(
"Attempt to assign ChanDef_t with a vector of size < 3"
);
51
throw
std::invalid_argument(msg);
52
}
53
if
( rhs[0] < 0 || rhs[1] < 0 || rhs[3] < 0 ) {
54
static
const
std::string
55
msg(
"Illegal negative value for chan, slot or channel"
);
56
throw
std::out_of_range(msg);
57
}
58
roc
= rhs[0];
slot
= rhs[1];
chan
= rhs[3];
59
return
*
this
;
60
}
61
UInt_t
roc
;
// ROC to read out
62
UInt_t
slot
;
// Slot of module
63
UInt_t
chan
;
// Channel within module
64
};
65
66
ChanDef_t
fAddr
[2];
// Definitions of helicity and gate channels
67
UInt_t
fNchan
;
// Number of channels to read out (1 or 2)
68
69
virtual
Int_t
DefineVariables
(
EMode
mode =
kDefine
);
70
virtual
Int_t
ReadDatabase
(
const
TDatime
& date );
71
72
ClassDef
(
THaADCHelicity
,1)
// Beam helicity from ADC (in time)
73
};
74
75
#endif
76
kDefine
#define kDefine
Definition
BdataLoc.cxx:38
Int_t
int Int_t
UInt_t
unsigned int UInt_t
Bool_t
bool Bool_t
Double_t
double Double_t
Option_t
const char Option_t
ClassDef
#define ClassDef(name, id)
name
char name[80]
THaHelicityDet.h
TDatime
THaADCHelicity::ChanDef_t
Definition
THaADCHelicity.h:44
THaADCHelicity::ChanDef_t::slot
UInt_t slot
Definition
THaADCHelicity.h:62
THaADCHelicity::ChanDef_t::roc
UInt_t roc
Definition
THaADCHelicity.h:61
THaADCHelicity::ChanDef_t::ChanDef_t
ChanDef_t()
Definition
THaADCHelicity.h:46
THaADCHelicity::ChanDef_t::operator=
ChanDef_t & operator=(const std::vector< int > &rhs)
Definition
THaADCHelicity.h:47
THaADCHelicity::ChanDef_t::chan
UInt_t chan
Definition
THaADCHelicity.h:63
THaADCHelicity
Definition
THaADCHelicity.h:17
THaADCHelicity::fADC_Gate
Double_t fADC_Gate
Definition
THaADCHelicity.h:36
THaADCHelicity::fThreshold
Double_t fThreshold
Definition
THaADCHelicity.h:39
THaADCHelicity::fIgnoreGate
Bool_t fIgnoreGate
Definition
THaADCHelicity.h:40
THaADCHelicity::DefineVariables
virtual Int_t DefineVariables(EMode mode=kDefine)
Definition
THaADCHelicity.cxx:42
THaADCHelicity::fNchan
UInt_t fNchan
Definition
THaADCHelicity.h:67
THaADCHelicity::~THaADCHelicity
virtual ~THaADCHelicity()
Definition
THaADCHelicity.cxx:36
THaADCHelicity::fADC_hdata
Double_t fADC_hdata
Definition
THaADCHelicity.h:35
THaADCHelicity::THaADCHelicity
THaADCHelicity()
Definition
THaADCHelicity.h:28
THaADCHelicity::ReadDatabase
virtual Int_t ReadDatabase(const TDatime &date)
Definition
THaADCHelicity.cxx:61
THaADCHelicity::fInvertGate
Bool_t fInvertGate
Definition
THaADCHelicity.h:41
THaADCHelicity::fAddr
ChanDef_t fAddr[2]
Definition
THaADCHelicity.h:66
THaADCHelicity::Decode
virtual Int_t Decode(const THaEvData &evdata)
Definition
THaADCHelicity.cxx:144
THaADCHelicity::Clear
virtual void Clear(Option_t *opt="")
Definition
THaADCHelicity.cxx:133
THaADCHelicity::fADC_Hel
EHelicity fADC_Hel
Definition
THaADCHelicity.h:37
THaAnalysisObject::EMode
EMode
Definition
THaAnalysisObject.h:36
THaApparatus
Definition
THaApparatus.h:16
THaEvData
Definition
THaEvData.h:27
THaHelicityDet
Definition
THaHelicityDet.h:18
THaHelicityDet::EHelicity
EHelicity
Definition
THaHelicityDet.h:20
THaHelicityDet::kUnknown
@ kUnknown
Definition
THaHelicityDet.h:20
a
TArc a
HallA
THaADCHelicity.h
Generated by
1.9.8