20#if __cplusplus >= 201402L
21# define MKFADCDATA(name,title,nelem) make_unique<FADCData>((name),(title),(nelem))
23# define MKFADCDATA(name,title,nelem) unique_ptr<FADCData>(new FADCData((name),(title),(nelem)))
54 ret.first = std::move(detdata);
61 : DetectorData(
name, desc), fFADCData(nelem)
70 DetectorData::Clear(opt);
92 VarType kDataType = std::is_same<Data_t, Float_t>::value ?
kFloat :
kDouble;
95 DBRequest calib_request[] = {
131 throw logic_error(
"Bad module type (expected Fadc250Module). "
132 "Should never happen. Call expert.");
144 if( hitinfo.
type != ChannelType::kMultiFunctionADC )
150 std::invalid_argument(
msg(hitinfo,
"Logical channel number out of range"));
156 FDAT.fIntegral =
data;
157 FDAT.fOverflow = fadc->GetOverflowBit(hitinfo.
chan, hitinfo.
hit);
158 FDAT.fUnderflow = fadc->GetUnderflowBit(hitinfo.
chan, hitinfo.
hit);
159 FDAT.fPedq = fadc->GetPedestalQuality(hitinfo.
chan, hitinfo.
hit);
162 static const vector<TypeItem> items = {
168 for(
const auto& item : items ) {
171 string s(
"Error retrieving FADC item type ");
172 s += item.name; s +=
". Decoder bug. Call expert.";
173 throw logic_error(
msg(hitinfo,s.c_str()));
175 switch( item.type ) {
177 FDAT.fPeak = val.
value();
180 FDAT.fT = val.
value();
185 if( FDAT.fPedq == 0 ) {
205 const char* key_prefix,
206 const char* comment_subst )
210 const char*
const here =
"FADCData::DefineVariables";
213 Int_t ret = DetectorData::DefineVariablesImpl(
mode, key_prefix, comment_subst);
217 const RVarDef vars[] = {
218 {
"peak",
"FADC ADC peak values %s",
"fFADCData.fPeak" },
219 {
"t_fadc",
"FADC TDC values %s",
"fFADCData.fT" },
220 {
"tc_fadc",
"FADC Corrected times %s",
"fFADCData.fT_c" },
221 {
"overflow",
"Overflow bit of FADC pulse %s",
"fFADCData.fOverflow" },
222 {
"underflow",
"Underflow bit of FADC pulse %s",
"fFADCData.fUnderflow" },
223 {
"badped",
"Pedestal quality bit of FADC pulse %s",
"fFADCData.fPedq" },
#define MKFADCDATA(name, title, nelem)
winID h TVirtualViewer3D TVirtualGLPainter p
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
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 Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
static const char *const here
virtual UInt_t GetData(Decoder::EModuleType mtype, UInt_t chan, UInt_t ievent) const
virtual UInt_t GetNumEvents(Decoder::EModuleType mtype, UInt_t ichan) const
virtual Bool_t HasCapability(Decoder::EModuleType type)
Int_t StoreHit(const DigitizerHitInfo_t &hitinfo, UInt_t data) override
Int_t ReadConfig(FILE *file, const TDatime &date, const char *prefix)
static OptUInt_t LoadFADCData(const DigitizerHitInfo_t &hitinfo)
void Clear(Option_t *="") override
void Reset(Option_t *="") override
std::vector< FADCData_t > fFADCData
FADCData(const char *name, const char *desc, Int_t nelem)
Int_t DefineVariablesImpl(THaAnalysisObject::EMode mode=THaAnalysisObject::kDefine, const char *key_prefix="", const char *comment_subst="") override
virtual Int_t GetLogicalChannel(const DigitizerHitInfo_t &hitinfo) const
static std::string msg(const DigitizerHitInfo_t &hitinfo, const char *txt)
Int_t StdDefineVariables(const RVarDef *vars, THaAnalysisObject::EMode mode, const char *key_prefix, const char *here, const char *comment_subst)
static Int_t LoadDB(FILE *file, const TDatime &date, const DBRequest *request, const char *prefix, Int_t search=0, const char *here="THaAnalysisObject::LoadDB")
const char * GetPrefix() const
TString GetPrefixName() const
virtual FILE * OpenFile(const TDatime &date)
Decoder::Module *Decoder::ChannelType type
const char * GetTitle() const override
constexpr T const & value() const
pair< unique_ptr< FADCData >, Int_t > MakeFADCData(const TDatime &date, THaDetectorBase *det)
static OptUInt_t GetFADCValue(EModuleType type, const DigitizerHitInfo_t &hitinfo, Fadc250Module *fadc)