Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
FadcCherenkov.cxx
Go to the documentation of this file.
1
2// //
3// HallA::FadcCherenkov //
4// Generic Cherenkov with FADC frontends //
5// //
7
8#include "FadcCherenkov.h"
9#include "FADCData.h"
10#include "THaDetMap.h"
11#include "THaEvData.h"
12
13using namespace std;
14
15namespace HallA {
16
17//_____________________________________________________________________________
18FadcCherenkov::FadcCherenkov( const char* name, const char* description,
19 THaApparatus* a )
20 : THaCherenkov(name, description, a),fFADCData(nullptr)
21{
22 // Constructor
23}
24
25//_____________________________________________________________________________
27{
28 // Default constructor (for ROOT RTTI)
29}
30
31//_____________________________________________________________________________
33{
34 // Destructor. Remove variables from global list.
35
37}
38
39//_____________________________________________________________________________
41{
43 if( ret )
44 return ret;
45
47}
48
49//_____________________________________________________________________________
51{
52 // Read this detector's parameters from the database
53
55 if( err )
56 return err;
57
58 // Set up a new FADC object, initialized from the database
59 auto ret = MakeFADCData(date, this);
60 if( ret.second )
61 return ret.second;
62
63 // Keep a pointer for convenient access
64 fFADCData = ret.first.get();
65
66 // Move data object into the detector data array
67 fDetectorData.emplace_back(std::move(ret.first));
68
69 return kOK;
70}
71
72//_____________________________________________________________________________
74 const DigitizerHitInfo_t& hitinfo )
75{
76 // Callback from Decoder for loading the data for the 'hitinfo' channel.
77 // This routine supports FADC modules and returns the pulse amplitude integral.
78 // Additional info is retrieved from the FADC modules in StoreHit later.
79
81 return FADCData::LoadFADCData(hitinfo);
82
83 // Fallback for legacy modules not recognized above.
84 return THaCherenkov::LoadData(evdata, hitinfo);
85}
86
87//_____________________________________________________________________________
89{
90 // Put decoded frontend data into fDetectorData. Called from Decode().
91
92 // Call StoreHit for the FADC modules first to get updated pedestals
93 fFADCData->StoreHit(hitinfo, data);
94
95 // Retrieve pedestal, if available, and update the PMTData calibrations
96 const auto& FDAT = fFADCData->GetData(hitinfo);
97 if( FDAT.fPedq == 0 )
98 fPMTData->GetCalib(hitinfo).ped = FDAT.fPedestal;
99
100 // Now fill the PMTData in fDetectorData
101 return THaCherenkov::StoreHit(hitinfo, data);
102}
103
104} // namespace HallA
105
106//_____________________________________________________________________________
#define kOK
Definition BdataLoc.cxx:40
int Int_t
unsigned int UInt_t
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
char name[80]
Int_t StoreHit(const DigitizerHitInfo_t &hitinfo, UInt_t data) override
Definition FADCData.cxx:138
static OptUInt_t LoadFADCData(const DigitizerHitInfo_t &hitinfo)
Definition FADCData.cxx:125
FADCData_t & GetData(size_t i)
Definition FADCData.h:81
OptUInt_t LoadData(const THaEvData &evdata, const DigitizerHitInfo_t &hitinfo) override
Int_t DefineVariables(EMode mode=kDefine) override
Int_t StoreHit(const DigitizerHitInfo_t &hitinfo, UInt_t data) override
Int_t ReadDatabase(const TDatime &date) override
Int_t DefineVariables(THaAnalysisObject::EMode mode=THaAnalysisObject::kDefine, const char *key_prefix="", const char *comment_subst="")
PMTCalib_t & GetCalib(size_t i)
virtual Int_t ReadDatabase(const TDatime &date)
virtual Int_t DefineVariables(EMode mode=kDefine)
Podd::PMTData * fPMTData
virtual Int_t StoreHit(const DigitizerHitInfo_t &hitinfo, UInt_t data)
Decoder::Module *Decoder::ChannelType type
Definition THaDetMap.h:197
virtual OptUInt_t LoadData(const THaEvData &evdata, const DigitizerHitInfo_t &hitinfo)
VecDetData_t fDetectorData
pair< unique_ptr< FADCData >, Int_t > MakeFADCData(const TDatime &date, THaDetectorBase *det)
Definition FADCData.cxx:27
STL namespace.
TArc a
ClassImp(TPyArg)