24 fBeamCurrent.SetPedestal(pedestal);
30 fBeamCurrent.SetCalibrationFactor(calibration);
37 SetCalibrationFactor(1.);
38 fBeamCurrent.InitializeChannel(name,datatosave);
39 this->SetElementName(name);
45 SetCalibrationFactor(1.);
46 fBeamCurrent.InitializeChannel(subsystem,
"QwBCM", name, datatosave);
54 SetCalibrationFactor(1.);
56 fBeamCurrent.InitializeChannel(subsystem,
"QwBCM", name, datatosave);
64 fBeamCurrent.ClearEventData();
71 fBeamCurrent.UseExternalRandomVariable();
77 fBeamCurrent.SetExternalRandomVariable(random_variable);
83 fBeamCurrent.SetRandomEventDriftParameters(amplitude, phase, frequency);
89 fBeamCurrent.AddRandomEventDriftParameters(amplitude, phase, frequency);
95 fBeamCurrent.SetRandomEventParameters(mean, sigma);
101 fBeamCurrent.SetRandomEventAsymmetry(asymmetry);
107 fBeamCurrent.RandomizeEventData(helicity, time);
113 fBeamCurrent.EncodeEventData(buffer);
119 this->ApplyHWChecks();
120 fBeamCurrent.ProcessEvent();
126 Bool_t eventokay=kTRUE;
128 UInt_t deviceerror=fBeamCurrent.ApplyHWChecks();
129 eventokay=(deviceerror & 0x0);
137 fBeamCurrent.SetSingleEventCuts(LL,UL);
146 fBeamCurrent.SetSingleEventCuts(errorflag,LL,UL,stability);
152 fBeamCurrent.SetDefaultSampleSize((
size_t)sample_size);
161 Bool_t status = kTRUE;
163 if (fBeamCurrent.ApplySingleEventCuts()) {
176 fBeamCurrent.IncrementErrorCounters();
182 fBeamCurrent.PrintErrorCounters();
189 if(
typeid(*ev_error)==
typeid(*
this)) {
191 if (this->GetElementName()!=
"") {
196 TString loc=
"Standard exception from QwBCM::UpdateErrorFlag :"+
197 ev_error->
GetElementName()+
" "+this->GetElementName()+
" are not of the "
199 throw std::invalid_argument(loc.Data());
201 }
catch (std::exception&
e) {
202 std::cerr<< e.what()<<std::endl;
211 fBeamCurrent.ProcessEvBuffer(buffer,word_position_in_buffer);
213 return word_position_in_buffer;
220 if (this->GetElementName()!=
"")
236 if(
typeid(value)==
typeid(*
this)) {
238 if (this->GetElementName()!=
"") {
244 TString loc=
"Standard exception from QwBCM::operato= :"+
245 value.
GetElementName()+
" "+this->GetElementName()+
" are not of the "
247 throw std::invalid_argument(loc.Data());
249 }
catch (std::exception&
e) {
250 std::cerr<< e.what()<<std::endl;
263 if (this->GetElementName()!=
"")
274 if(
typeid(value)==
typeid(*
this)) {
276 if (this->GetElementName()!=
"") {
282 TString loc=
"Standard exception from QwBCM::operator+= :"+
283 value.
GetElementName()+
" "+this->GetElementName()+
" are not of the "
285 throw std::invalid_argument(loc.Data());
287 }
catch (std::exception&
e) {
288 std::cerr<< e.what()<<std::endl;
297 if (this->GetElementName()!=
"")
310 if(
typeid(value)==
typeid(*
this)) {
312 if (this->GetElementName()!=
"") {
318 TString loc=
"Standard exception from QwBCM::operator-= :"+
319 value.
GetElementName()+
" "+this->GetElementName()+
" are not of the "
321 throw std::invalid_argument(loc.Data());
323 }
catch (std::exception&
e) {
324 std::cerr<< e.what()<<std::endl;
345 Ratio(*
dynamic_cast<const QwBCM<T>*
>(&numer),
346 *
dynamic_cast<const QwBCM<T>*
>(&denom));
353 if (this->GetElementName()!=
"")
363 fBeamCurrent.Scale(factor);
369 fBeamCurrent.CalculateRunningAverage();
374 fBeamCurrent.AccumulateRunningSum(
375 dynamic_cast<const QwBCM<T>*
>(&value)->fBeamCurrent);
380 fBeamCurrent.DeaccumulateRunningSum(
dynamic_cast<QwBCM<T>*
>(&value)->fBeamCurrent);
385 fBeamCurrent.PrintValue();
391 std::cout <<
"QwVQWK_Channel Info " << std::endl;
392 fBeamCurrent.PrintInfo();
399 if (this->GetElementName()==
"")
405 fBeamCurrent.ConstructHistograms(folder, prefix);
412 if (this->GetElementName()==
"")
418 fBeamCurrent.FillHistograms();
425 if (this->GetElementName()==
""){
429 fBeamCurrent.ConstructBranchAndVector(tree, prefix,values);
436 if (GetElementName()==
""){
440 fBeamCurrent.ConstructBranch(tree, prefix);
450 devicename=GetElementName();
451 devicename.ToLower();
452 if (GetElementName()==
""){
458 if (modulelist.
HasValue(devicename)){
459 fBeamCurrent.ConstructBranch(tree, prefix);
469 if (this->GetElementName()==
""){
473 fBeamCurrent.FillTreeVector(values);
481 std::vector <QwDBInterface> row_list;
482 fBeamCurrent.AddEntriesToList(row_list);
491 std::vector <QwErrDBInterface> row_list;
492 fBeamCurrent.AddErrEntriesToList(row_list);
500 return fBeamCurrent.GetValue();
507 return fBeamCurrent.GetValueError();
513 return fBeamCurrent.GetValueWidth();
#define QwMessage
Predefined log drain for regular messages.
void FillHistograms()
Fill the histograms for this data element.
VQwBCM & operator+=(const VQwBCM &value)
static const UInt_t kBCMErrorFlag
VQwBCM & operator-=(const VQwBCM &value)
void SetDefaultSampleSize(Int_t sample_size)
virtual UInt_t UpdateErrorFlag()
Update the error flag based on the error flags of internally contained objects Return paramter is the...
void AddRandomEventDriftParameters(Double_t amplitude, Double_t phase, Double_t frequency)
std::vector< QwErrDBInterface > GetErrDBEntry()
void EncodeEventData(std::vector< UInt_t > &buffer)
VQwBCM & operator=(const VQwBCM &value)
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
void PrintValue() const
Print single line of value and error of this data element.
void Difference(QwBCM &value1, QwBCM &value2)
void AccumulateRunningSum(const VQwBCM &value)
std::vector< QwDBInterface > GetDBEntry()
void SetPedestal(Double_t ped)
Int_t ProcessEvBuffer(UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0)
Process the CODA event buffer for this element.
void ClearEventData()
Clear the event data in this element.
Bool_t HasValue(TString &vname)
void SetRandomEventParameters(Double_t mean, Double_t sigma)
void UpdateErrorFlag(const VQwBCM *ev_error)
Int_t SetSingleEventCuts(Double_t mean=0, Double_t sigma=0)
void FillTreeVector(std::vector< Double_t > &values) const
void Sum(QwBCM &value1, QwBCM &value2)
void PrintInfo() const
Print multiple lines of information about this data element.
Bool_t ApplySingleEventCuts()
void IncrementErrorCounters()
void ConstructBranch(TTree *tree, TString &prefix)
void Ratio(const VQwBCM &numer, const VQwBCM &denom)
void RandomizeEventData(int helicity=0, double time=0)
void SetRandomEventDriftParameters(Double_t amplitude, Double_t phase, Double_t frequency)
void SetExternalRandomVariable(Double_t random_variable)
void Scale(Double_t factor)
static std::ostream & endl(std::ostream &)
End of the line.
void SetRandomEventAsymmetry(Double_t asymmetry)
void InitializeChannel(TString name, TString datatosave)
virtual const TString & GetElementName() const
Get the name of this element.
void DeaccumulateRunningSum(VQwBCM &value)
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
void SetCalibrationFactor(Double_t calib)
void CalculateRunningAverage()
void UseExternalRandomVariable()