14#include "ROOT/RNTupleModel.hxx"
15#include "ROOT/RField.hxx"
18#ifdef __USE_DATABASE__
45 if (type.Length() > 0)
47 fClock.InitializeChannel(subsystem,
"QwClock", name, datatosave);
48 fClock.SetNeedsExternalClock(kFALSE);
79 fClock.EncodeEventData(buffer);
91 Bool_t eventokay=kTRUE;
93 UInt_t deviceerror=
fClock.ApplyHWChecks();
94 eventokay=(deviceerror & 0x0);
105 fClock.SetSingleEventCuts(errorflag,LL,UL,stability,burplevel);
111 fClock.SetDefaultSampleSize((
size_t)sample_size);
121 if (
fClock.ApplySingleEventCuts()){
126 if (
bDEBUG) std::cout<<
" evnt cut failed:-> set limit "<<
fULimit<<
" hardware sum "<<
fClock.GetValue();
136 fClock.PrintErrorCounters();
144 UInt_t words_read =
fClock.ProcessEvBuffer(buffer,word_position_in_buffer);
171 if(
typeid(value)==
typeid(*
this)) {
181 TString loc=
"Standard exception from QwClock::operator= :"+
184 throw std::invalid_argument(loc.Data());
186 }
catch (std::exception& e) {
187 std::cerr<< e.what()<<std::endl;
214 if(
typeid(value)==
typeid(*
this)) {
224 TString loc=
"Standard exception from QwClock::operator+= :"+
227 throw std::invalid_argument(loc.Data());
229 }
catch (std::exception& e) {
230 std::cerr<< e.what()<<std::endl;
254 if(
typeid(value)==
typeid(*
this)) {
264 TString loc=
"Standard exception from QwClock::operator-= :"+
267 throw std::invalid_argument(loc.Data());
269 }
catch (std::exception& e) {
270 std::cerr<< e.what()<<std::endl;
305 fClock.CalculateRunningAverage();
310 fClock.AccumulateRunningSum(
316 fClock.DeaccumulateRunningSum(
329 std::cout <<
"QwVQWK_Channel Info " << std::endl;
343 fClock.ConstructHistograms(folder, prefix);
371 fClock.ConstructBranchAndVector(tree, prefix,values);
383 fClock.ConstructBranch(tree, prefix);
395 devicename.ToLower();
402 if (modulelist.
HasValue(devicename)){
403 fClock.ConstructBranch(tree, prefix);
418 fClock.FillTreeVector(values);
424#ifdef HAS_RNTUPLE_SUPPORT
426void QwClock<T>::ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs)
428 if (this->GetElementName()==
""){
432 fClock.ConstructNTupleAndVector(model, prefix, values, fieldPtrs);
439 if (this->GetElementName()==
""){
443 fClock.FillNTupleVector(values);
449#ifdef __USE_DATABASE__
454 std::vector <QwDBInterface> row_list;
455 fClock.AddEntriesToList(row_list);
Decoding and management for VQWK ADC channels (6x32-bit datawords)
static const UInt_t kBCMErrorFlag
#define QwMessage
Predefined log drain for regular messages.
Base and derived classes for scaler channel data handling.
Database interface for QwIntegrationPMT and subsystems.
Clock channel implementation for normalization and timing.
const TString QwBPMStripline< T >::subelement[4]
static std::ostream & endl(std::ostream &)
End of the line.
Configuration file parser with flexible tokenization and search capabilities.
Bool_t HasValue(TString &vname)
A helper class to manage a vector of branch entries for ROOT trees.
virtual const TString & GetElementName() const
Get the name of this element.
void SetElementName(const TString &name)
Set the name of this element.
void SetModuleType(TString ModuleType)
set the type of the beam instrument
Standard clock channel with calibration representing frequency.
VQwClock & operator+=(const VQwClock &value) override
void SetSingleEventCuts(UInt_t errorflag, Double_t min=0, Double_t max=0, Double_t stability=0, Double_t burplevel=0) override
Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit),...
void AccumulateRunningSum(const VQwClock &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
VQwClock & operator=(const VQwClock &value) override
void ConstructBranch(TTree *tree, TString &prefix) override
void InitializeChannel(TString subsystem, TString name, TString datatosave, TString type="") override
void ClearEventData() override
Clear the event data in this element.
void PrintErrorCounters() const override
report number of events failed due to HW and event cut failure
Bool_t ApplySingleEventCuts() override
void CalculateRunningAverage() override
void DeaccumulateRunningSum(VQwClock &value, Int_t ErrorMask=0xFFFFFFF) override
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
void SetDefaultSampleSize(Int_t sample_size)
void Ratio(const VQwClock &numer, const VQwClock &denom) override
void EncodeEventData(std::vector< UInt_t > &buffer)
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0) override
Process the CODA event buffer for this element.
void FillTreeVector(QwRootTreeBranchVector &values) const override
void PrintValue() const override
Print single line of value and error of this data element.
void ProcessEvent() override
VQwClock & operator-=(const VQwClock &value) override
void PrintInfo() const override
Print multiple lines of information about this data element.
static const Bool_t bDEBUG
void ConstructHistograms(TDirectory *folder, TString &prefix) override
Construct the histograms for this data element.
void SetPedestal(Double_t ped) override
void SetCalibrationFactor(Double_t calib) override
void FillHistograms() override
Fill the histograms for this data element.
void Scale(Double_t factor) override