25 fClock.SetPedestal(fPedestal);
32 fClock.SetCalibrationFactor(fCalibration);
38 SetCalibrationFactor(1.);
39 if (type.Length() > 0)
41 fClock.InitializeChannel(subsystem,
"QwClock", name, datatosave);
42 fClock.SetNeedsExternalClock(kFALSE);
52 fClock.ClearEventData();
73 fClock.EncodeEventData(buffer);
85 Bool_t eventokay=kTRUE;
87 UInt_t deviceerror=fClock.ApplyHWChecks();
88 eventokay=(deviceerror & 0x0);
99 fClock.SetSingleEventCuts(errorflag,LL,UL,stability);
105 fClock.SetDefaultSampleSize((
size_t)sample_size);
115 if (fClock.ApplySingleEventCuts()){
120 if (bDEBUG) std::cout<<
" evnt cut failed:-> set limit "<<
fULimit<<
" harware sum "<<fClock.GetValue();
130 fClock.PrintErrorCounters();
138 UInt_t words_read = fClock.ProcessEvBuffer(buffer,word_position_in_buffer);
139 this->ApplyHWChecks();
147 if (this->GetElementName()!=
"")
149 this->fClock=value.
fClock;
165 if(
typeid(value)==
typeid(*
this)) {
167 if (this->GetElementName()!=
"") {
175 TString loc=
"Standard exception from QwClock::operato= :"+
176 value.
GetElementName()+
" "+this->GetElementName()+
" are not of the "
178 throw std::invalid_argument(loc.Data());
180 }
catch (std::exception&
e) {
181 std::cerr<< e.what()<<std::endl;
195 if (this->GetElementName()!=
"")
197 this->fClock+=value.
fClock;
199 this->fCalibration=0;
208 if(
typeid(value)==
typeid(*
this)) {
210 if (this->GetElementName()!=
"") {
218 TString loc=
"Standard exception from QwClock::operator+= :"+
219 value.
GetElementName()+
" "+this->GetElementName()+
" are not of the "
221 throw std::invalid_argument(loc.Data());
223 }
catch (std::exception&
e) {
224 std::cerr<< e.what()<<std::endl;
233 if (this->GetElementName()!=
"")
248 if(
typeid(value)==
typeid(*
this)) {
250 if (this->GetElementName()!=
"") {
258 TString loc=
"Standard exception from QwClock::operator-= :"+
259 value.
GetElementName()+
" "+this->GetElementName()+
" are not of the "
261 throw std::invalid_argument(loc.Data());
263 }
catch (std::exception&
e) {
264 std::cerr<< e.what()<<std::endl;
285 Ratio(*
dynamic_cast<const QwClock<T>*
>(&numer),
293 if (this->GetElementName()!=
"")
298 this->fCalibration=0;
306 fClock.Scale(factor);
312 fClock.CalculateRunningAverage();
317 fClock.AccumulateRunningSum(
318 dynamic_cast<const QwClock<T>*
>(&value)->fClock);
330 std::cout <<
"QwVQWK_Channel Info " << std::endl;
338 if (this->GetElementName()==
"")
344 fClock.ConstructHistograms(folder, prefix);
352 if (this->GetElementName()==
"")
358 fClock.FillHistograms();
368 if (this->GetElementName()==
""){
372 fClock.ConstructBranchAndVector(tree, prefix,values);
380 if (GetElementName()==
""){
384 fClock.ConstructBranch(tree, prefix);
395 devicename=GetElementName();
396 devicename.ToLower();
397 if (GetElementName()==
""){
403 if (modulelist.
HasValue(devicename)){
404 fClock.ConstructBranch(tree, prefix);
415 if (this->GetElementName()==
""){
419 fClock.FillTreeVector(values);
429 std::vector <QwDBInterface> row_list;
430 fClock.AddEntriesToList(row_list);
void Sum(QwClock &value1, QwClock &value2)
#define QwMessage
Predefined log drain for regular messages.
void InitializeChannel(TString subsystem, TString name, TString datatosave, TString type="")
static const UInt_t kBCMErrorFlag
void PrintValue() const
Print single line of value and error of this data element.
void FillTreeVector(std::vector< Double_t > &values) const
void SetSingleEventCuts(UInt_t errorflag, Double_t min=0, Double_t max=0, Double_t stability=0)
Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.
void AccumulateRunningSum(const VQwClock &value)
VQwClock & operator+=(const VQwClock &value)
void PrintErrorCounters() const
report number of events failed due to HW and event cut failure
void ConstructBranch(TTree *tree, TString &prefix)
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 SetPedestal(Double_t ped)
void Difference(QwClock &value1, QwClock &value2)
VQwClock & operator=(const VQwClock &value)
std::vector< QwDBInterface > GetDBEntry()
Bool_t HasValue(TString &vname)
void PrintInfo() const
Print multiple lines of information about this data element.
void CalculateRunningAverage()
void ConstructHistograms(TDirectory *folder, TString &prefix)
Construct the histograms for this data element.
void ClearEventData()
Clear the event data in this element.
void SetDefaultSampleSize(Int_t sample_size)
VQwClock & operator-=(const VQwClock &value)
void Scale(Double_t factor)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
static std::ostream & endl(std::ostream &)
End of the line.
void EncodeEventData(std::vector< UInt_t > &buffer)
virtual const TString & GetElementName() const
Get the name of this element.
Bool_t ApplySingleEventCuts()
void Ratio(const VQwClock &numer, const VQwClock &denom)
void FillHistograms()
Fill the histograms for this data element.
void SetCalibrationFactor(Double_t calib)