QwAnalysis
QwClock< T > Class Template Reference

#include <QwClock.h>

+ Inheritance diagram for QwClock< T >:
+ Collaboration diagram for QwClock< T >:

Public Member Functions

 QwClock ()
 
 QwClock (TString subsystemname, TString name, TString type="")
 
 QwClock (const QwClock &source)
 
virtual ~QwClock ()
 
void LoadChannelParameters (QwParameterFile &paramfile)
 
Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0)
 Process the CODA event buffer for this element. More...
 
void InitializeChannel (TString subsystem, TString name, TString datatosave, TString type="")
 
void ClearEventData ()
 Clear the event data in this element. More...
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 
void ProcessEvent ()
 
Bool_t ApplyHWChecks ()
 
Bool_t ApplySingleEventCuts ()
 
void IncrementErrorCounters ()
 
void PrintErrorCounters () const
 report number of events failed due to HW and event cut failure More...
 
UInt_t GetEventcutErrorFlag ()
 return the error flag on this channel/device More...
 
UInt_t UpdateErrorFlag ()
 Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag". More...
 
void UpdateErrorFlag (const QwClock *ev_error)
 
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. More...
 
void SetDefaultSampleSize (Int_t sample_size)
 
void SetEventCutMode (Int_t bcuts)
 
void PrintValue () const
 Print single line of value and error of this data element. More...
 
void PrintInfo () const
 Print multiple lines of information about this data element. More...
 
VQwClockoperator= (const VQwClock &value)
 
VQwClockoperator+= (const VQwClock &value)
 
VQwClockoperator-= (const VQwClock &value)
 
QwClockoperator= (const QwClock &value)
 
QwClockoperator+= (const QwClock &value)
 
QwClockoperator-= (const QwClock &value)
 
void Sum (QwClock &value1, QwClock &value2)
 
void Difference (QwClock &value1, QwClock &value2)
 
void Ratio (const VQwClock &numer, const VQwClock &denom)
 
void Ratio (const QwClock &numer, const QwClock &denom)
 
void Scale (Double_t factor)
 
void AccumulateRunningSum (const VQwClock &value)
 
void CalculateRunningAverage ()
 
void SetPedestal (Double_t ped)
 
void SetCalibrationFactor (Double_t calib)
 
void ConstructHistograms (TDirectory *folder, TString &prefix)
 Construct the histograms for this data element. More...
 
void FillHistograms ()
 Fill the histograms for this data element. More...
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 
void ConstructBranch (TTree *tree, TString &prefix)
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist)
 
void FillTreeVector (std::vector< Double_t > &values) const
 
std::vector< QwDBInterfaceGetDBEntry ()
 
Double_t GetNormClockValue ()
 
Double_t GetStandardClockValue ()
 
const VQwHardwareChannelGetTime () const
 
- Public Member Functions inherited from VQwClock
 VQwClock ()
 
 VQwClock (const VQwClock &source)
 
virtual ~VQwClock ()
 
- Public Member Functions inherited from VQwDataElement
 VQwDataElement ()
 Default constructor. More...
 
 VQwDataElement (const VQwDataElement &value)
 Copy constructor. More...
 
virtual ~VQwDataElement ()
 Virtual destructor. More...
 
Bool_t IsNameEmpty () const
 Is the name of this element empty? More...
 
void SetElementName (const TString &name)
 Set the name of this element. More...
 
virtual const TString & GetElementName () const
 Get the name of this element. More...
 
size_t GetNumberOfDataWords ()
 Get the number of data words in this data element. More...
 
UInt_t GetGoodEventCount () const
 
virtual void AssignValueFrom (const VQwDataElement *valueptr)
 
virtual VQwDataElementoperator+= (const VQwDataElement &value)
 Addition-assignment operator. More...
 
virtual VQwDataElementoperator-= (const VQwDataElement &value)
 Subtraction-assignment operator. More...
 
virtual void Sum (const VQwDataElement &value1, const VQwDataElement &value2)
 Sum operator. More...
 
virtual void Difference (const VQwDataElement &value1, const VQwDataElement &value2)
 Difference operator. More...
 
virtual void Ratio (const VQwDataElement &numer, const VQwDataElement &denom)
 Ratio operator. More...
 
virtual void SetNeedsExternalClock (Bool_t needed)
 
virtual Bool_t NeedsExternalClock ()
 
virtual std::string GetExternalClockName ()
 
virtual void SetExternalClockPtr (const VQwHardwareChannel *clock)
 
virtual void SetExternalClockName (const std::string name)
 
TString GetSubsystemName () const
 Return the name of the inheriting subsystem name. More...
 
void SetSubsystemName (TString sysname)
 Set the name of the inheriting subsystem name. More...
 
TString GetModuleType () const
 Return the type of the beam instrument. More...
 
void SetModuleType (TString ModuleType)
 set the type of the beam instrument More...
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects. More...
 

Private Attributes

Double_t fPedestal
 
Double_t fCalibration
 
Double_t fULimit
 
Double_t fLLimit
 
fClock
 
Int_t fDeviceErrorCode
 
Bool_t bEVENTCUTMODE
 
Double_t fNormalizationValue
 

Static Private Attributes

static const Bool_t bDEBUG =kFALSE
 

Additional Inherited Members

- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0, kDerived }
 
- Static Public Member Functions inherited from VQwClock
static VQwClockCreate (TString subsystemname, TString type, TString name)
 A fast way of creating a Clock of specified type. More...
 
static VQwClockCreate (const VQwClock &source)
 
- Protected Member Functions inherited from VQwDataElement
void SetNumberOfDataWords (const UInt_t &numwords)
 Set the number of data words in this data element. More...
 
virtual VQwDataElementoperator= (const VQwDataElement &value)
 Arithmetic assignment operator: Should only copy event-based data. More...
 
virtual void UpdateErrorFlag (const UInt_t &error)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor. More...
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor. More...
 
virtual ~MQwHistograms ()
 Virtual destructor. More...
 
virtual MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram. More...
 
- Protected Attributes inherited from VQwDataElement
TString fElementName
 Name of this data element. More...
 
UInt_t fNumberOfDataWords
 Number of raw data words in this data element. More...
 
Int_t fGoodEventCount
 Number of good events accumulated in this element. More...
 
TString fSubsystemName
 
TString fModuleType
 
UInt_t fErrorFlag
 This the standard error code generated for the channel that contains the global/local/stability flags and the Device error code (Unique error code for HW failures) More...
 
UInt_t fErrorConfigFlag
 contains the global/local/stability flags More...
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element. More...
 

Detailed Description

template<typename T>
class QwClock< T >

Definition at line 35 of file QwClock.h.

Constructor & Destructor Documentation

template<typename T>
QwClock< T >::QwClock ( )
inline

Definition at line 38 of file QwClock.h.

38 { };
template<typename T>
QwClock< T >::QwClock ( TString  subsystemname,
TString  name,
TString  type = "" 
)
inline

Definition at line 39 of file QwClock.h.

References QwClock< T >::InitializeChannel(), and VQwDataElement::SetSubsystemName().

39  {
40  SetSubsystemName(subsystemname);
41  InitializeChannel(subsystemname, name, "raw", type);
42  };
void InitializeChannel(TString subsystem, TString name, TString datatosave, TString type="")
Definition: QwClock.cc:36
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.

+ Here is the call graph for this function:

template<typename T>
QwClock< T >::QwClock ( const QwClock< T > &  source)
inline

Definition at line 43 of file QwClock.h.

44  : VQwClock(source),
46  fULimit(source.fULimit),fLLimit(source.fLLimit),
47  fClock(source.fClock),
49  { }
T fClock
Definition: QwClock.h:140
Double_t fULimit
Definition: QwClock.h:138
Double_t fNormalizationValue
Definition: QwClock.h:147
Double_t fCalibration
Definition: QwClock.h:137
Double_t fLLimit
Definition: QwClock.h:138
Double_t fPedestal
Definition: QwClock.h:128
VQwClock()
Definition: VQwClock.h:39
template<typename T>
virtual QwClock< T >::~QwClock ( )
inlinevirtual

Definition at line 50 of file QwClock.h.

50 { };

Member Function Documentation

template<typename T >
void QwClock< T >::AccumulateRunningSum ( const VQwClock< T > &  value)
virtual

Implements VQwClock.

Definition at line 316 of file QwClock.cc.

316  {
317  fClock.AccumulateRunningSum(
318  dynamic_cast<const QwClock<T>* >(&value)->fClock);
319 }
T fClock
Definition: QwClock.h:140
template<typename T >
Bool_t QwClock< T >::ApplyHWChecks ( )

Definition at line 83 of file QwClock.cc.

84 {
85  Bool_t eventokay=kTRUE;
86 
87  UInt_t deviceerror=fClock.ApplyHWChecks();//will check for HW consistancy and return the error code (=0 is HW good)
88  eventokay=(deviceerror & 0x0);//if no HW error return true
89 
90  return eventokay;
91 }
T fClock
Definition: QwClock.h:140
template<typename T >
Bool_t QwClock< T >::ApplySingleEventCuts ( )
virtual

Implements VQwClock.

Definition at line 111 of file QwClock.cc.

References fULimit.

111  {
112  //std::cout<<" QwClock::SingleEventCuts() "<<std::endl;
113  Bool_t status=kTRUE;
114 
115  if (fClock.ApplySingleEventCuts()){
116  status=kTRUE;
117  }
118  else{
119 
120  if (bDEBUG) std::cout<<" evnt cut failed:-> set limit "<<fULimit<<" harware sum "<<fClock.GetValue();
121  status&=kFALSE;
122  }
123  return status;
124 }
T fClock
Definition: QwClock.h:140
Double_t fULimit
Definition: QwClock.h:138
static const Bool_t bDEBUG
Definition: QwClock.h:144
template<typename T >
void QwClock< T >::CalculateRunningAverage ( )
virtual

Implements VQwClock.

Definition at line 311 of file QwClock.cc.

311  {
312  fClock.CalculateRunningAverage();
313 }
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::ClearEventData ( )
virtual

Clear the event data in this element.

Implements VQwClock.

Definition at line 50 of file QwClock.cc.

51 {
52  fClock.ClearEventData();
53  return;
54 }
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
virtual

Implements VQwClock.

Definition at line 378 of file QwClock.cc.

379 {
380  if (GetElementName()==""){
381  // This channel is not used, so skip filling the histograms.
382  } else
383  {
384  fClock.ConstructBranch(tree, prefix);
385  // this functions doesn't do anything yet
386  }
387  return;
388 }
T fClock
Definition: QwClock.h:140
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwClock< T >::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile modulelist 
)
virtual

Implements VQwClock.

Definition at line 391 of file QwClock.cc.

References QwLog::endl(), QwParameterFile::HasValue(), and QwMessage.

392 {
393  TString devicename;
394 
395  devicename=GetElementName();
396  devicename.ToLower();
397  if (GetElementName()==""){
398  // This channel is not used, so skip filling the histograms.
399  } else
400  {
401 
402  //QwMessage <<" QwClock "<<devicename<<QwLog::endl;
403  if (modulelist.HasValue(devicename)){
404  fClock.ConstructBranch(tree, prefix);
405  QwMessage <<" Tree leave added to "<<devicename<<QwLog::endl;
406  }
407  // this functions doesn't do anything yet
408  }
409  return;
410 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
T fClock
Definition: QwClock.h:140
Bool_t HasValue(TString &vname)
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
virtual const TString & GetElementName() const
Get the name of this element.

+ Here is the call graph for this function:

template<typename T >
void QwClock< T >::ConstructBranchAndVector ( TTree *  tree,
TString &  prefix,
std::vector< Double_t > &  values 
)
virtual

Implements VQwClock.

Definition at line 366 of file QwClock.cc.

367 {
368  if (this->GetElementName()==""){
369  // This channel is not used, so skip
370  } else
371  {
372  fClock.ConstructBranchAndVector(tree, prefix,values);
373  }
374  return;
375 }
T fClock
Definition: QwClock.h:140
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwClock< T >::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

Construct the histograms for this data element.

Implements VQwClock.

Definition at line 336 of file QwClock.cc.

337 {
338  if (this->GetElementName()=="")
339  {
340  // This channel is not used, so skip filling the histograms.
341  }
342  else
343  {
344  fClock.ConstructHistograms(folder, prefix);
345  }
346  return;
347 }
T fClock
Definition: QwClock.h:140
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwClock< T >::Difference ( QwClock< T > &  value1,
QwClock< T > &  value2 
)

Definition at line 277 of file QwClock.cc.

277  {
278  *this = value1;
279  *this -= value2;
280 }
template<typename T >
void QwClock< T >::EncodeEventData ( std::vector< UInt_t > &  buffer)

Definition at line 71 of file QwClock.cc.

72 {
73  fClock.EncodeEventData(buffer);
74 }
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::FillHistograms ( )
virtual

Fill the histograms for this data element.

Implements VQwClock.

Definition at line 350 of file QwClock.cc.

351 {
352  if (this->GetElementName()=="")
353  {
354  // This channel is not used, so skip filling the histograms.
355  }
356  else
357  {
358  fClock.FillHistograms();
359  }
360 
361 
362  return;
363 }
T fClock
Definition: QwClock.h:140
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
void QwClock< T >::FillTreeVector ( std::vector< Double_t > &  values) const
virtual

Implements VQwClock.

Definition at line 413 of file QwClock.cc.

414 {
415  if (this->GetElementName()==""){
416  // This channel is not used, so skip filling the histograms.
417  } else
418  {
419  fClock.FillTreeVector(values);
420  // this functions doesn't do anything yet
421  }
422  return;
423 }
T fClock
Definition: QwClock.h:140
virtual const TString & GetElementName() const
Get the name of this element.
template<typename T >
std::vector< QwDBInterface > QwClock< T >::GetDBEntry ( )
virtual

Implements VQwClock.

Definition at line 427 of file QwClock.cc.

428 {
429  std::vector <QwDBInterface> row_list;
430  fClock.AddEntriesToList(row_list);
431  return row_list;
432 }
T fClock
Definition: QwClock.h:140
template<typename T>
UInt_t QwClock< T >::GetEventcutErrorFlag ( )
inlinevirtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 69 of file QwClock.h.

References QwClock< T >::fClock.

Referenced by QwClock< T >::UpdateErrorFlag().

69  {//return the error flag
70  return fClock.GetEventcutErrorFlag();
71  }
T fClock
Definition: QwClock.h:140

+ Here is the caller graph for this function:

template<typename T>
Double_t QwClock< T >::GetNormClockValue ( )
inlinevirtual

Implements VQwClock.

Definition at line 123 of file QwClock.h.

References QwClock< T >::fNormalizationValue.

123 { return fNormalizationValue;};
Double_t fNormalizationValue
Definition: QwClock.h:147
template<typename T>
Double_t QwClock< T >::GetStandardClockValue ( )
inlinevirtual

Implements VQwClock.

Definition at line 124 of file QwClock.h.

References QwClock< T >::fCalibration.

124 { return fCalibration; };
Double_t fCalibration
Definition: QwClock.h:137
template<typename T>
const VQwHardwareChannel* QwClock< T >::GetTime ( ) const
inlinevirtual

Implements VQwClock.

Definition at line 126 of file QwClock.h.

References QwClock< T >::fClock.

126  {
127  return &fClock;
128  };
T fClock
Definition: QwClock.h:140
template<typename T>
void QwClock< T >::IncrementErrorCounters ( )
inlinevirtual

Implements VQwClock.

Definition at line 67 of file QwClock.h.

References QwClock< T >::fClock.

67 {fClock.IncrementErrorCounters();}
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::InitializeChannel ( TString  subsystem,
TString  name,
TString  datatosave,
TString  type = "" 
)
virtual

Implements VQwClock.

Definition at line 36 of file QwClock.cc.

References fLLimit, and fULimit.

Referenced by QwClock< T >::QwClock().

36  {
37  SetPedestal(0.);
39  if (type.Length() > 0)
40  SetModuleType(type);
41  fClock.InitializeChannel(subsystem, "QwClock", name, datatosave);
42  fClock.SetNeedsExternalClock(kFALSE);
43  SetElementName(name);
44  //set default limits to event cuts
45  fLLimit=0;//init two timits
46  fULimit=0;//init two timits
47 }
T fClock
Definition: QwClock.h:140
Double_t fULimit
Definition: QwClock.h:138
void SetPedestal(Double_t ped)
Definition: QwClock.cc:22
void SetElementName(const TString &name)
Set the name of this element.
void SetModuleType(TString ModuleType)
set the type of the beam instrument
Double_t fLLimit
Definition: QwClock.h:138
void SetCalibrationFactor(Double_t calib)
Definition: QwClock.cc:29

+ Here is the caller graph for this function:

template<typename T>
void QwClock< T >::LoadChannelParameters ( QwParameterFile paramfile)
inlinevirtual

Implements VQwClock.

Definition at line 52 of file QwClock.h.

References QwClock< T >::fClock.

52  {
53  fClock.LoadChannelParameters(paramfile);
54  };
T fClock
Definition: QwClock.h:140
template<typename T >
VQwClock & QwClock< T >::operator+= ( const VQwClock< T > &  value)
virtual

Implements VQwClock.

Definition at line 205 of file QwClock.cc.

References Qw::e, QwClock< T >::fCalibration, QwClock< T >::fClock, QwClock< T >::fPedestal, and VQwDataElement::GetElementName().

206 {
207  try {
208  if(typeid(value)==typeid(*this)) {
209  // std::cout<<" Here in QwClock::operator+= \n";
210  if (this->GetElementName()!="") {
211  const QwClock<T>* value_bcm = dynamic_cast<const QwClock<T>* >(&value);
212  QwClock<T>* this_cast = dynamic_cast<QwClock<T>* >(this);
213  this_cast->fClock+=value_bcm->fClock;
214  this_cast->fPedestal+=value_bcm->fPedestal;
215  this_cast->fCalibration=0;
216  }
217  } else {
218  TString loc="Standard exception from QwClock::operator+= :"+
219  value.GetElementName()+" "+this->GetElementName()+" are not of the "
220  +"same type";
221  throw std::invalid_argument(loc.Data());
222  }
223  } catch (std::exception& e) {
224  std::cerr<< e.what()<<std::endl;
225  }
226 
227  return *this;
228 }
T fClock
Definition: QwClock.h:140
static const double e
Definition: QwUnits.h:91
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128

+ Here is the call graph for this function:

template<typename T >
QwClock< T > & QwClock< T >::operator+= ( const QwClock< T > &  value)

Definition at line 193 of file QwClock.cc.

References QwClock< T >::fClock, and QwClock< T >::fPedestal.

194 {
195  if (this->GetElementName()!="")
196  {
197  this->fClock+=value.fClock;
198  this->fPedestal+=value.fPedestal;
199  this->fCalibration=0;
200  }
201  return *this;
202 }
T fClock
Definition: QwClock.h:140
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128
template<typename T >
VQwClock & QwClock< T >::operator-= ( const VQwClock< T > &  value)
virtual

Implements VQwClock.

Definition at line 231 of file QwClock.cc.

References QwClock< T >::fCalibration, QwClock< T >::fClock, and QwClock< T >::fPedestal.

232 {
233  if (this->GetElementName()!="")
234  {
235  const QwClock<T>* value_bcm = dynamic_cast<const QwClock<T>* >(&value);
236  QwClock<T>* this_cast = dynamic_cast<QwClock<T>* >(this);
237  this_cast->fClock-=value_bcm->fClock;
238  this_cast->fPedestal-=value_bcm->fPedestal;
239  this_cast->fCalibration=0;
240  }
241  return *this;
242 }
T fClock
Definition: QwClock.h:140
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128
template<typename T >
QwClock< T > & QwClock< T >::operator-= ( const QwClock< T > &  value)

Definition at line 245 of file QwClock.cc.

References Qw::e, QwClock< T >::fCalibration, QwClock< T >::fClock, QwClock< T >::fPedestal, and VQwDataElement::GetElementName().

246 {
247  try {
248  if(typeid(value)==typeid(*this)) {
249  // std::cout<<" Here in QwClock::operator-= \n";
250  if (this->GetElementName()!="") {
251  const QwClock<T>* value_bcm = dynamic_cast<const QwClock<T>* >(&value);
252  QwClock<T>* this_cast = dynamic_cast<QwClock<T>* >(this);
253  this_cast->fClock-=value_bcm->fClock;
254  this_cast->fPedestal-=value_bcm->fPedestal;
255  this_cast->fCalibration=0;
256  }
257  } else {
258  TString loc="Standard exception from QwClock::operator-= :"+
259  value.GetElementName()+" "+this->GetElementName()+" are not of the "
260  +"same type";
261  throw std::invalid_argument(loc.Data());
262  }
263  } catch (std::exception& e) {
264  std::cerr<< e.what()<<std::endl;
265  }
266  return *this;
267 }
T fClock
Definition: QwClock.h:140
static const double e
Definition: QwUnits.h:91
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128

+ Here is the call graph for this function:

template<typename T >
VQwClock & QwClock< T >::operator= ( const VQwClock< T > &  value)
virtual

Implements VQwClock.

Definition at line 162 of file QwClock.cc.

References Qw::e, QwClock< T >::fCalibration, QwClock< T >::fClock, QwClock< T >::fPedestal, and VQwDataElement::GetElementName().

163 {
164  try {
165  if(typeid(value)==typeid(*this)) {
166  // std::cout<<" Here in QwClock::operator= \n";
167  if (this->GetElementName()!="") {
168  const QwClock<T>* value_bcm = dynamic_cast<const QwClock<T>* >(&value);
169  QwClock<T>* this_cast = dynamic_cast<QwClock<T>* >(this);
170  this_cast->fClock= value_bcm->fClock;
171  this_cast->fPedestal=value_bcm->fPedestal;
172  this_cast->fCalibration=value_bcm->fCalibration;
173  }
174  } else {
175  TString loc="Standard exception from QwClock::operato= :"+
176  value.GetElementName()+" "+this->GetElementName()+" are not of the "
177  +"same type";
178  throw std::invalid_argument(loc.Data());
179  }
180  } catch (std::exception& e) {
181  std::cerr<< e.what()<<std::endl;
182  }
183 // std::cout<<" to be copied \n";
184 // value.Print();
185 // std::cout<<" copied \n";
186 // this->Print();
187 
188  return *this;
189 
190 }
T fClock
Definition: QwClock.h:140
static const double e
Definition: QwUnits.h:91
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128

+ Here is the call graph for this function:

template<typename T >
QwClock< T > & QwClock< T >::operator= ( const QwClock< T > &  value)

Definition at line 144 of file QwClock.cc.

References QwClock< T >::fCalibration, QwClock< T >::fClock, and QwClock< T >::fPedestal.

145 {
146 // std::cout<<" Here in QwClock::operator= \n";
147  if (this->GetElementName()!="")
148  {
149  this->fClock=value.fClock;
150  this->fPedestal=value.fPedestal;
151  this->fCalibration=value.fCalibration;
152  }
153 // std::cout<<" to be copied \n";
154 // value.Print();
155 // std::cout<<" copied \n";
156 // this->Print();
157 
158  return *this;
159 }
T fClock
Definition: QwClock.h:140
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128
template<typename T >
void QwClock< T >::PrintErrorCounters ( ) const
virtual

report number of events failed due to HW and event cut failure

Reimplemented from VQwDataElement.

Definition at line 129 of file QwClock.cc.

129  {// report number of events failed due to HW and event cut faliure
130  fClock.PrintErrorCounters();
131 }
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::PrintInfo ( ) const
virtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Definition at line 328 of file QwClock.cc.

329 {
330  std::cout << "QwVQWK_Channel Info " << std::endl;
331  fClock.PrintInfo();
332 }
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::PrintValue ( ) const
virtual

Print single line of value and error of this data element.

Reimplemented from VQwDataElement.

Definition at line 322 of file QwClock.cc.

323 {
324  fClock.PrintValue();
325 }
T fClock
Definition: QwClock.h:140
template<typename T >
Int_t QwClock< T >::ProcessEvBuffer ( UInt_t *  buffer,
UInt_t  num_words_left,
UInt_t  subelement = 0 
)
virtual

Process the CODA event buffer for this element.

Implements VQwClock.

Definition at line 136 of file QwClock.cc.

137 {
138  UInt_t words_read = fClock.ProcessEvBuffer(buffer,word_position_in_buffer);
139  this->ApplyHWChecks();
140  return words_read;
141 }
T fClock
Definition: QwClock.h:140
Bool_t ApplyHWChecks()
Definition: QwClock.cc:83
template<typename T >
void QwClock< T >::ProcessEvent ( )
virtual

Implements VQwClock.

Definition at line 77 of file QwClock.cc.

78 {
79  return;
80 }
template<typename T >
void QwClock< T >::Ratio ( const VQwClock< T > &  numer,
const VQwClock< T > &  denom 
)
virtual

Reimplemented from VQwClock.

Definition at line 283 of file QwClock.cc.

284 {
285  Ratio(*dynamic_cast<const QwClock<T>* >(&numer),
286  *dynamic_cast<const QwClock<T>* >(&denom));
287 }
void Ratio(const VQwClock &numer, const VQwClock &denom)
Definition: QwClock.cc:283
template<typename T >
void QwClock< T >::Ratio ( const QwClock< T > &  numer,
const QwClock< T > &  denom 
)

Definition at line 290 of file QwClock.cc.

References QwClock< T >::fClock.

291 {
292  // std::cout<<"QwClock::Ratio element name ="<<GetElementName()<<" \n";
293  if (this->GetElementName()!="")
294  {
295  // std::cout<<"here in \n";
296  this->fClock.Ratio(numer.fClock,denom.fClock);
297  this->fPedestal=0;
298  this->fCalibration=0;
299  }
300  return;
301 }
T fClock
Definition: QwClock.h:140
Double_t fCalibration
Definition: QwClock.h:137
virtual const TString & GetElementName() const
Get the name of this element.
Double_t fPedestal
Definition: QwClock.h:128
template<typename T >
void QwClock< T >::Scale ( Double_t  factor)
virtual

Implements VQwClock.

Definition at line 304 of file QwClock.cc.

305 {
306  fClock.Scale(factor);
307  return;
308 }
T fClock
Definition: QwClock.h:140
template<typename T >
void QwClock< T >::SetCalibrationFactor ( Double_t  calib)
virtual

Implements VQwClock.

Definition at line 29 of file QwClock.cc.

30 {
31  fCalibration=calib;
32  fClock.SetCalibrationFactor(fCalibration);
33 }
T fClock
Definition: QwClock.h:140
Double_t fCalibration
Definition: QwClock.h:137
template<typename T >
void QwClock< T >::SetDefaultSampleSize ( Int_t  sample_size)

Definition at line 104 of file QwClock.cc.

104  {
105  fClock.SetDefaultSampleSize((size_t)sample_size);
106 }
T fClock
Definition: QwClock.h:140
template<typename T>
void QwClock< T >::SetEventCutMode ( Int_t  bcuts)
inlinevirtual

Implements VQwClock.

Definition at line 81 of file QwClock.h.

References QwClock< T >::bEVENTCUTMODE, and QwClock< T >::fClock.

81  {
82  bEVENTCUTMODE=bcuts;
83  fClock.SetEventCutMode(bcuts);
84  }
T fClock
Definition: QwClock.h:140
Bool_t bEVENTCUTMODE
Definition: QwClock.h:145
template<typename T >
void QwClock< T >::SetPedestal ( Double_t  ped)
virtual

Implements VQwClock.

Definition at line 22 of file QwClock.cc.

23 {
24  fPedestal=pedestal;
25  fClock.SetPedestal(fPedestal);
26 }
T fClock
Definition: QwClock.h:140
Double_t fPedestal
Definition: QwClock.h:128
template<typename T >
void QwClock< T >::SetSingleEventCuts ( UInt_t  errorflag,
Double_t  min = 0,
Double_t  max = 0,
Double_t  stability = 0 
)
virtual

Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.

Implements VQwClock.

Definition at line 95 of file QwClock.cc.

References QwLog::endl(), kBCMErrorFlag, and QwMessage.

95  {
96  //set the unique tag to identify device type (bcm,bpm & etc)
97  errorflag|=kBCMErrorFlag;
98  QwMessage<<"QwClock Error Code passing to QwVQWK_Ch "<<errorflag<<QwLog::endl;
99  fClock.SetSingleEventCuts(errorflag,LL,UL,stability);
100 
101 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
static const UInt_t kBCMErrorFlag
Definition: QwTypes.h:167
T fClock
Definition: QwClock.h:140
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299

+ Here is the call graph for this function:

template<typename T >
void QwClock< T >::Sum ( QwClock< T > &  value1,
QwClock< T > &  value2 
)

Definition at line 271 of file QwClock.cc.

271  {
272  *this = value1;
273  *this += value2;
274 }
template<typename T>
UInt_t QwClock< T >::UpdateErrorFlag ( )
inlinevirtual

Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag".

Reimplemented from VQwDataElement.

Definition at line 72 of file QwClock.h.

References QwClock< T >::GetEventcutErrorFlag().

72 {return GetEventcutErrorFlag();};
UInt_t GetEventcutErrorFlag()
return the error flag on this channel/device
Definition: QwClock.h:69

+ Here is the call graph for this function:

template<typename T>
void QwClock< T >::UpdateErrorFlag ( const QwClock< T > *  ev_error)
inline

Definition at line 73 of file QwClock.h.

References QwClock< T >::fClock.

73  {
74  fClock.UpdateErrorFlag(ev_error->fClock);
75  }
T fClock
Definition: QwClock.h:140

Field Documentation

template<typename T>
const Bool_t QwClock< T >::bDEBUG =kFALSE
staticprivate

Definition at line 144 of file QwClock.h.

template<typename T>
Bool_t QwClock< T >::bEVENTCUTMODE
private

Definition at line 145 of file QwClock.h.

Referenced by QwClock< T >::SetEventCutMode().

template<typename T>
Double_t QwClock< T >::fCalibration
private
template<typename T>
Int_t QwClock< T >::fDeviceErrorCode
private

Definition at line 142 of file QwClock.h.

template<typename T>
Double_t QwClock< T >::fLLimit
private

Definition at line 138 of file QwClock.h.

template<typename T>
Double_t QwClock< T >::fNormalizationValue
private

Definition at line 147 of file QwClock.h.

Referenced by QwClock< T >::GetNormClockValue().

template<typename T>
Double_t QwClock< T >::fPedestal
private
template<typename T>
Double_t QwClock< T >::fULimit
private

Definition at line 138 of file QwClock.h.


The documentation for this class was generated from the following files: