QwAnalysis
QwBCM< T > Class Template Reference

#include <QwBCM.h>

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

Public Member Functions

 QwBCM ()
 
 QwBCM (TString name)
 
 QwBCM (TString subsystemname, TString name)
 
 QwBCM (TString subsystemname, TString name, TString type, TString clock="")
 
 QwBCM (const QwBCM &source)
 
virtual ~QwBCM ()
 
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 name, TString datatosave)
 
void InitializeChannel (TString subsystem, TString name, TString datatosave)
 
void InitializeChannel (TString subsystem, TString name, TString type, TString datatosave)
 
void ClearEventData ()
 Clear the event data in this element. More...
 
void LoadChannelParameters (QwParameterFile &paramfile)
 
void SetRandomEventDriftParameters (Double_t amplitude, Double_t phase, Double_t frequency)
 
void AddRandomEventDriftParameters (Double_t amplitude, Double_t phase, Double_t frequency)
 
void SetRandomEventParameters (Double_t mean, Double_t sigma)
 
void SetRandomEventAsymmetry (Double_t asymmetry)
 
void RandomizeEventData (int helicity=0, double time=0)
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 
void UseExternalRandomVariable ()
 
void SetExternalRandomVariable (Double_t random_variable)
 
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...
 
void UpdateErrorFlag (const VQwBCM *ev_error)
 
UInt_t GetErrorCode () const
 
Int_t SetSingleEventCuts (Double_t mean=0, Double_t sigma=0)
 
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...
 
const VQwHardwareChannelGetCharge () const
 
std::string GetExternalClockName ()
 
Bool_t NeedsExternalClock ()
 
void SetExternalClockPtr (const VQwHardwareChannel *clock)
 
void SetExternalClockName (const std::string name)
 
Double_t GetNormClockValue ()
 
VQwBCMoperator= (const VQwBCM &value)
 
VQwBCMoperator+= (const VQwBCM &value)
 
VQwBCMoperator-= (const VQwBCM &value)
 
virtual void SetBCMForCombo (VQwBCM *bcm, Double_t weight, Double_t sumqw)
 
QwBCMoperator= (const QwBCM &value)
 
QwBCMoperator+= (const QwBCM &value)
 
QwBCMoperator-= (const QwBCM &value)
 
void Sum (QwBCM &value1, QwBCM &value2)
 
void Difference (QwBCM &value1, QwBCM &value2)
 
void Ratio (const VQwBCM &numer, const VQwBCM &denom)
 
void Ratio (const QwBCM &numer, const QwBCM &denom)
 
void Scale (Double_t factor)
 
void AccumulateRunningSum (const VQwBCM &value)
 
void DeaccumulateRunningSum (VQwBCM &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 ()
 
std::vector< QwErrDBInterfaceGetErrDBEntry ()
 
Double_t GetValue ()
 
Double_t GetValueError ()
 
Double_t GetValueWidth ()
 
- Public Member Functions inherited from VQwBCM
virtual ~VQwBCM ()
 
virtual UInt_t UpdateErrorFlag ()
 Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag". More...
 
- 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)
 
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...
 

Protected Attributes

fBeamCurrent
 
- Protected Attributes inherited from VQwBCM
VQwDataElementfBeamCurrent_ref
 
- 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...
 

Friends

class QwCombinedBCM< T >
 

Additional Inherited Members

- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0, kDerived }
 
- Static Public Member Functions inherited from VQwBCM
static VQwBCMCreate (TString subsystemname, TString type, TString name, TString clock="")
 A fast way of creating a BCM of specified type. More...
 
static VQwBCMCreate (const VQwBCM &source)
 
static VQwBCMCreateCombo (TString subsystemname, TString type, TString name)
 A fast way of creating a combo BCM of specified type. More...
 
static VQwBCMCreateCombo (const VQwBCM &source)
 
- Protected Member Functions inherited from VQwBCM
 VQwBCM (VQwDataElement &beamcurrent)
 
 VQwBCM (VQwDataElement &beamcurrent, TString name)
 
- 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...
 

Detailed Description

template<typename T>
class QwBCM< T >

Definition at line 34 of file QwBCM.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file QwBCM.h.

38 : VQwBCM(fBeamCurrent) { };
VQwBCM(VQwDataElement &beamcurrent)
Definition: VQwBCM.h:41
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
QwBCM< T >::QwBCM ( TString  name)
inline

Definition at line 39 of file QwBCM.h.

References QwBCM< T >::InitializeChannel().

39  : VQwBCM(fBeamCurrent,name) {
40  InitializeChannel(name,"raw");
41  };
VQwBCM(VQwDataElement &beamcurrent)
Definition: VQwBCM.h:41
void InitializeChannel(TString name, TString datatosave)
Definition: QwBCM.cc:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

template<typename T>
QwBCM< T >::QwBCM ( TString  subsystemname,
TString  name 
)
inline

Definition at line 42 of file QwBCM.h.

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

43  : VQwBCM(fBeamCurrent,name) {
44  SetSubsystemName(subsystemname);
45  InitializeChannel(subsystemname,name,"raw");
46  };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
VQwBCM(VQwDataElement &beamcurrent)
Definition: VQwBCM.h:41
void InitializeChannel(TString name, TString datatosave)
Definition: QwBCM.cc:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

template<typename T>
QwBCM< T >::QwBCM ( TString  subsystemname,
TString  name,
TString  type,
TString  clock = "" 
)
inline

Definition at line 47 of file QwBCM.h.

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

48  : VQwBCM(fBeamCurrent,name) {
49  fBeamCurrent.SetExternalClockName(clock.Data());
50  SetSubsystemName(subsystemname);
51  InitializeChannel(subsystemname,name,type,"raw");
52  };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
VQwBCM(VQwDataElement &beamcurrent)
Definition: VQwBCM.h:41
void InitializeChannel(TString name, TString datatosave)
Definition: QwBCM.cc:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

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

Definition at line 53 of file QwBCM.h.

54  : VQwBCM(source),
56  { }
VQwBCM(VQwDataElement &beamcurrent)
Definition: VQwBCM.h:41
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
virtual QwBCM< T >::~QwBCM ( )
inlinevirtual

Definition at line 57 of file QwBCM.h.

57 { };

Member Function Documentation

template<typename T >
void QwBCM< T >::AccumulateRunningSum ( const VQwBCM< T > &  value)
virtual

Implements VQwBCM.

Definition at line 373 of file QwBCM.cc.

373  {
374  fBeamCurrent.AccumulateRunningSum(
375  dynamic_cast<const QwBCM<T>* >(&value)->fBeamCurrent);
376 }
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::AddRandomEventDriftParameters ( Double_t  amplitude,
Double_t  phase,
Double_t  frequency 
)
virtual

Implements VQwBCM.

Definition at line 87 of file QwBCM.cc.

88 {
89  fBeamCurrent.AddRandomEventDriftParameters(amplitude, phase, frequency);
90 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Bool_t QwBCM< T >::ApplyHWChecks ( )

Definition at line 124 of file QwBCM.cc.

125 {
126  Bool_t eventokay=kTRUE;
127 
128  UInt_t deviceerror=fBeamCurrent.ApplyHWChecks();//will check for HW consistancy and return the error code (=0 is HW good)
129  eventokay=(deviceerror & 0x0);//if no HW error return true
130 
131  return eventokay;
132 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Bool_t QwBCM< T >::ApplySingleEventCuts ( )
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 158 of file QwBCM.cc.

Referenced by QwCombinedBCM< T >::ApplySingleEventCuts().

159 {
160  //std::cout<<" QwBCM::SingleEventCuts() "<<std::endl;
161  Bool_t status = kTRUE;
162 
163  if (fBeamCurrent.ApplySingleEventCuts()) {
164  status = kTRUE;
165  } else {
166  status &= kFALSE;
167  }
168  return status;
169 }
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the caller graph for this function:

template<typename T >
void QwBCM< T >::CalculateRunningAverage ( )
virtual

Implements VQwBCM.

Definition at line 367 of file QwBCM.cc.

368 {
369  fBeamCurrent.CalculateRunningAverage();
370 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::ClearEventData ( )
virtual

Clear the event data in this element.

Implements VQwBCM.

Definition at line 62 of file QwBCM.cc.

63 {
64  fBeamCurrent.ClearEventData();
65 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::ConstructBranch ( TTree *  tree,
TString &  prefix 
)
virtual

Implements VQwBCM.

Definition at line 434 of file QwBCM.cc.

435 {
436  if (GetElementName()==""){
437  // This channel is not used, so skip filling the histograms.
438  } else
439  {
440  fBeamCurrent.ConstructBranch(tree, prefix);
441  // this functions doesn't do anything yet
442  }
443 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::ConstructBranch ( TTree *  tree,
TString &  prefix,
QwParameterFile modulelist 
)
virtual

Implements VQwBCM.

Definition at line 446 of file QwBCM.cc.

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

447 {
448  TString devicename;
449 
450  devicename=GetElementName();
451  devicename.ToLower();
452  if (GetElementName()==""){
453  // This channel is not used, so skip filling the histograms.
454  } else
455  {
456 
457  //QwMessage <<" QwBCM "<<devicename<<QwLog::endl;
458  if (modulelist.HasValue(devicename)){
459  fBeamCurrent.ConstructBranch(tree, prefix);
460  QwMessage <<" Tree leave added to "<<devicename<<QwLog::endl;
461  }
462  // this functions doesn't do anything yet
463  }
464 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
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.
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

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

Implements VQwBCM.

Definition at line 423 of file QwBCM.cc.

424 {
425  if (this->GetElementName()==""){
426  // This channel is not used, so skip
427  } else
428  {
429  fBeamCurrent.ConstructBranchAndVector(tree, prefix,values);
430  }
431 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::ConstructHistograms ( TDirectory *  folder,
TString &  prefix 
)
virtual

Construct the histograms for this data element.

Implements VQwBCM.

Definition at line 397 of file QwBCM.cc.

398 {
399  if (this->GetElementName()=="")
400  {
401  // This channel is not used, so skip filling the histograms.
402  }
403  else
404  {
405  fBeamCurrent.ConstructHistograms(folder, prefix);
406  }
407 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::DeaccumulateRunningSum ( VQwBCM< T > &  value)
virtual

Implements VQwBCM.

Definition at line 379 of file QwBCM.cc.

379  {
380  fBeamCurrent.DeaccumulateRunningSum(dynamic_cast<QwBCM<T>* >(&value)->fBeamCurrent);
381 }
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::Difference ( QwBCM< T > &  value1,
QwBCM< T > &  value2 
)

Definition at line 337 of file QwBCM.cc.

337  {
338  *this = value1;
339  *this -= value2;
340 }
template<typename T >
void QwBCM< T >::EncodeEventData ( std::vector< UInt_t > &  buffer)
virtual

Implements VQwBCM.

Definition at line 111 of file QwBCM.cc.

112 {
113  fBeamCurrent.EncodeEventData(buffer);
114 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::FillHistograms ( )
virtual

Fill the histograms for this data element.

Implements VQwBCM.

Definition at line 410 of file QwBCM.cc.

411 {
412  if (this->GetElementName()=="")
413  {
414  // This channel is not used, so skip filling the histograms.
415  }
416  else
417  {
418  fBeamCurrent.FillHistograms();
419  }
420 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::FillTreeVector ( std::vector< Double_t > &  values) const
virtual

Implements VQwBCM.

Definition at line 467 of file QwBCM.cc.

468 {
469  if (this->GetElementName()==""){
470  // This channel is not used, so skip filling the histograms.
471  } else
472  {
473  fBeamCurrent.FillTreeVector(values);
474  // this functions doesn't do anything yet
475  }
476 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
const VQwHardwareChannel* QwBCM< T >::GetCharge ( ) const
inlinevirtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 108 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

108  {
109  return &fBeamCurrent;
110  };
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
std::vector< QwDBInterface > QwBCM< T >::GetDBEntry ( )
virtual

Implements VQwBCM.

Definition at line 479 of file QwBCM.cc.

480 {
481  std::vector <QwDBInterface> row_list;
482  fBeamCurrent.AddEntriesToList(row_list);
483  return row_list;
484 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
std::vector< QwErrDBInterface > QwBCM< T >::GetErrDBEntry ( )
virtual

Implements VQwBCM.

Definition at line 489 of file QwBCM.cc.

490 {
491  std::vector <QwErrDBInterface> row_list;
492  fBeamCurrent.AddErrEntriesToList(row_list);
493  return row_list;
494 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
UInt_t QwBCM< T >::GetErrorCode ( ) const
inline

Definition at line 93 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

93 {return (fBeamCurrent.GetErrorCode());};
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
UInt_t QwBCM< T >::GetEventcutErrorFlag ( )
inlinevirtual

return the error flag on this channel/device

Reimplemented from VQwDataElement.

Definition at line 87 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

87  {//return the error flag
88  return fBeamCurrent.GetEventcutErrorFlag();
89  }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
std::string QwBCM< T >::GetExternalClockName ( )
inlinevirtual

Reimplemented from VQwDataElement.

Definition at line 114 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

114 { return fBeamCurrent.GetExternalClockName(); };
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
Double_t QwBCM< T >::GetNormClockValue ( )
inlinevirtual

Implements VQwBCM.

Definition at line 118 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

118 { return fBeamCurrent.GetNormClockValue();}
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Double_t QwBCM< T >::GetValue ( )
virtual

Implements VQwBCM.

Definition at line 498 of file QwBCM.cc.

499 {
500  return fBeamCurrent.GetValue();
501 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Double_t QwBCM< T >::GetValueError ( )
virtual

Implements VQwBCM.

Definition at line 505 of file QwBCM.cc.

506 {
507  return fBeamCurrent.GetValueError();
508 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Double_t QwBCM< T >::GetValueWidth ( )
virtual

Implements VQwBCM.

Definition at line 511 of file QwBCM.cc.

512 {
513  return fBeamCurrent.GetValueWidth();
514 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::IncrementErrorCounters ( )
virtual

Implements VQwBCM.

Definition at line 174 of file QwBCM.cc.

175 {// report number of events failed due to HW and event cut faliure
176  fBeamCurrent.IncrementErrorCounters();
177 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::InitializeChannel ( TString  name,
TString  datatosave 
)
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 34 of file QwBCM.cc.

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

35 {
36  SetPedestal(0.);
38  fBeamCurrent.InitializeChannel(name,datatosave);
39  this->SetElementName(name);
40 }
void SetPedestal(Double_t ped)
Definition: QwBCM.cc:22
void SetElementName(const TString &name)
Set the name of this element.
void SetCalibrationFactor(Double_t calib)
Definition: QwBCM.cc:28
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the caller graph for this function:

template<typename T >
void QwBCM< T >::InitializeChannel ( TString  subsystem,
TString  name,
TString  datatosave 
)
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 43 of file QwBCM.cc.

43  {
44  SetPedestal(0.);
46  fBeamCurrent.InitializeChannel(subsystem, "QwBCM", name, datatosave);
47  SetElementName(name);
48 }
void SetPedestal(Double_t ped)
Definition: QwBCM.cc:22
void SetElementName(const TString &name)
Set the name of this element.
void SetCalibrationFactor(Double_t calib)
Definition: QwBCM.cc:28
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::InitializeChannel ( TString  subsystem,
TString  name,
TString  type,
TString  datatosave 
)

Definition at line 51 of file QwBCM.cc.

52  {
53  SetPedestal(0.);
55  SetModuleType(type);
56  fBeamCurrent.InitializeChannel(subsystem, "QwBCM", name, datatosave);
57  SetElementName(name);
58 }
void SetPedestal(Double_t ped)
Definition: QwBCM.cc:22
void SetElementName(const TString &name)
Set the name of this element.
void SetModuleType(TString ModuleType)
set the type of the beam instrument
void SetCalibrationFactor(Double_t calib)
Definition: QwBCM.cc:28
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
void QwBCM< T >::LoadChannelParameters ( QwParameterFile paramfile)
inlinevirtual

Implements VQwBCM.

Definition at line 68 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

68  {
69  fBeamCurrent.LoadChannelParameters(paramfile);
70  };
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
Bool_t QwBCM< T >::NeedsExternalClock ( )
inlinevirtual

Implements VQwBCM.

Definition at line 115 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

115 { return fBeamCurrent.NeedsExternalClock(); };
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
VQwBCM & QwBCM< T >::operator+= ( const VQwBCM< T > &  value)
virtual

Implements VQwBCM.

Definition at line 271 of file QwBCM.cc.

References Qw::e, QwBCM< T >::fBeamCurrent, and VQwDataElement::GetElementName().

272 {
273  try {
274  if(typeid(value)==typeid(*this)) {
275  // std::cout<<" Here in QwBCM::operator+= \n";
276  if (this->GetElementName()!="") {
277  const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
278  QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
279  this_cast->fBeamCurrent+=value_bcm->fBeamCurrent;
280  }
281  } else {
282  TString loc="Standard exception from QwBCM::operator+= :"+
283  value.GetElementName()+" "+this->GetElementName()+" are not of the "
284  +"same type";
285  throw std::invalid_argument(loc.Data());
286  }
287  } catch (std::exception& e) {
288  std::cerr<< e.what()<<std::endl;
289  }
290 
291  return *this;
292 }
static const double e
Definition: QwUnits.h:91
virtual const TString & GetElementName() const
Get the name of this element.
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

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

Definition at line 261 of file QwBCM.cc.

References QwBCM< T >::fBeamCurrent.

262 {
263  if (this->GetElementName()!="")
264  {
265  this->fBeamCurrent+=value.fBeamCurrent;
266  }
267  return *this;
268 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
VQwBCM & QwBCM< T >::operator-= ( const VQwBCM< T > &  value)
virtual

Implements VQwBCM.

Definition at line 295 of file QwBCM.cc.

References QwBCM< T >::fBeamCurrent.

296 {
297  if (this->GetElementName()!="")
298  {
299  const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
300  QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
301  this_cast->fBeamCurrent-=value_bcm->fBeamCurrent;
302  }
303  return *this;
304 }
virtual const TString & GetElementName() const
Get the name of this element.
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
QwBCM< T > & QwBCM< T >::operator-= ( const QwBCM< T > &  value)

Definition at line 307 of file QwBCM.cc.

References Qw::e, QwBCM< T >::fBeamCurrent, and VQwDataElement::GetElementName().

308 {
309  try {
310  if(typeid(value)==typeid(*this)) {
311  // std::cout<<" Here in QwBCM::operator-= \n";
312  if (this->GetElementName()!="") {
313  const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
314  QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
315  this_cast->fBeamCurrent-=value_bcm->fBeamCurrent;
316  }
317  } else {
318  TString loc="Standard exception from QwBCM::operator-= :"+
319  value.GetElementName()+" "+this->GetElementName()+" are not of the "
320  +"same type";
321  throw std::invalid_argument(loc.Data());
322  }
323  } catch (std::exception& e) {
324  std::cerr<< e.what()<<std::endl;
325  }
326  return *this;
327 }
static const double e
Definition: QwUnits.h:91
virtual const TString & GetElementName() const
Get the name of this element.
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

template<typename T >
VQwBCM & QwBCM< T >::operator= ( const VQwBCM< T > &  value)
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 233 of file QwBCM.cc.

References Qw::e, QwBCM< T >::fBeamCurrent, and VQwDataElement::GetElementName().

234 {
235  try {
236  if(typeid(value)==typeid(*this)) {
237  // std::cout<<" Here in QwBCM::operator= \n";
238  if (this->GetElementName()!="") {
239  const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(&value);
240  QwBCM<T>* this_cast = dynamic_cast<QwBCM<T>* >(this);
241  this_cast->fBeamCurrent= value_bcm->fBeamCurrent;
242  }
243  } else {
244  TString loc="Standard exception from QwBCM::operato= :"+
245  value.GetElementName()+" "+this->GetElementName()+" are not of the "
246  +"same type";
247  throw std::invalid_argument(loc.Data());
248  }
249  } catch (std::exception& e) {
250  std::cerr<< e.what()<<std::endl;
251  }
252 // std::cout<<" to be copied \n";
253 // value.Print();
254 // std::cout<<" copied \n";
255 // this->Print();
256 
257  return *this;
258 }
static const double e
Definition: QwUnits.h:91
virtual const TString & GetElementName() const
Get the name of this element.
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

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

Definition at line 217 of file QwBCM.cc.

References QwBCM< T >::fBeamCurrent.

218 {
219 // std::cout<<" Here in QwBCM::operator= \n";
220  if (this->GetElementName()!="")
221  {
222  this->fBeamCurrent=value.fBeamCurrent;
223  }
224 // std::cout<<" to be copied \n";
225 // value.Print();
226 // std::cout<<" copied \n";
227 // this->Print();
228 
229  return *this;
230 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::PrintErrorCounters ( ) const
virtual

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

Reimplemented from VQwDataElement.

Definition at line 180 of file QwBCM.cc.

181 {// report number of events failed due to HW and event cut faliure
182  fBeamCurrent.PrintErrorCounters();
183 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::PrintInfo ( ) const
virtual

Print multiple lines of information about this data element.

Reimplemented from VQwDataElement.

Definition at line 389 of file QwBCM.cc.

390 {
391  std::cout << "QwVQWK_Channel Info " << std::endl;
392  fBeamCurrent.PrintInfo();
393 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::PrintValue ( ) const
virtual

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

Reimplemented from VQwDataElement.

Definition at line 383 of file QwBCM.cc.

384 {
385  fBeamCurrent.PrintValue();
386 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Int_t QwBCM< T >::ProcessEvBuffer ( UInt_t *  buffer,
UInt_t  num_words_left,
UInt_t  subelement = 0 
)
virtual

Process the CODA event buffer for this element.

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 209 of file QwBCM.cc.

210 {
211  fBeamCurrent.ProcessEvBuffer(buffer,word_position_in_buffer);
212 
213  return word_position_in_buffer;
214 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::ProcessEvent ( )
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 117 of file QwBCM.cc.

118 {
119  this->ApplyHWChecks();//first apply HW checks and update HW error flags. Calling this routine either in ApplySingleEventCuts or here do not make any difference for a BCM but do for a BPMs because they have derrived devices.
120  fBeamCurrent.ProcessEvent();
121 }
Bool_t ApplyHWChecks()
Definition: QwBCM.cc:124
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::RandomizeEventData ( int  helicity = 0,
double  time = 0 
)
virtual

Implements VQwBCM.

Definition at line 105 of file QwBCM.cc.

106 {
107  fBeamCurrent.RandomizeEventData(helicity, time);
108 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::Ratio ( const VQwBCM< T > &  numer,
const VQwBCM< T > &  denom 
)
virtual

Reimplemented from VQwBCM.

Definition at line 343 of file QwBCM.cc.

344 {
345  Ratio(*dynamic_cast<const QwBCM<T>* >(&numer),
346  *dynamic_cast<const QwBCM<T>* >(&denom));
347 }
void Ratio(const VQwBCM &numer, const VQwBCM &denom)
Definition: QwBCM.cc:343
Definition: QwBCM.h:34
template<typename T >
void QwBCM< T >::Ratio ( const QwBCM< T > &  numer,
const QwBCM< T > &  denom 
)

Definition at line 350 of file QwBCM.cc.

References QwBCM< T >::fBeamCurrent.

351 {
352  // std::cout<<"QwBCM::Ratio element name ="<<GetElementName()<<" \n";
353  if (this->GetElementName()!="")
354  {
355  // std::cout<<"here in \n";
356  this->fBeamCurrent.Ratio(numer.fBeamCurrent,denom.fBeamCurrent);
357  }
358 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::Scale ( Double_t  factor)
virtual

Implements VQwBCM.

Definition at line 361 of file QwBCM.cc.

362 {
363  fBeamCurrent.Scale(factor);
364 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
virtual void QwBCM< T >::SetBCMForCombo ( VQwBCM< T > *  bcm,
Double_t  weight,
Double_t  sumqw 
)
inlinevirtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 128 of file QwBCM.h.

128  {
129  std::cerr<<"SetBCMForCombo for QwCombinedBCM<T> not defined!!\n";
130  };
template<typename T >
void QwBCM< T >::SetCalibrationFactor ( Double_t  calib)
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 28 of file QwBCM.cc.

Referenced by QwCombinedBCM< T >::SetCalibrationFactor().

29 {
30  fBeamCurrent.SetCalibrationFactor(calibration);
31 }
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the caller graph for this function:

template<typename T >
void QwBCM< T >::SetDefaultSampleSize ( Int_t  sample_size)
virtual

Implements VQwBCM.

Definition at line 151 of file QwBCM.cc.

151  {
152  fBeamCurrent.SetDefaultSampleSize((size_t)sample_size);
153 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
void QwBCM< T >::SetEventCutMode ( Int_t  bcuts)
inlinevirtual

Implements VQwBCM.

Definition at line 101 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

101  {
102  fBeamCurrent.SetEventCutMode(bcuts);
103  }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
void QwBCM< T >::SetExternalClockName ( const std::string  name)
inlinevirtual

Implements VQwBCM.

Definition at line 117 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

117 { fBeamCurrent.SetExternalClockName(name);};
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
void QwBCM< T >::SetExternalClockPtr ( const VQwHardwareChannel clock)
inlinevirtual

Implements VQwBCM.

Definition at line 116 of file QwBCM.h.

References QwBCM< T >::fBeamCurrent.

116 {fBeamCurrent.SetExternalClockPtr(clock);};
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
void QwBCM< T >::SetExternalRandomVariable ( Double_t  random_variable)

Definition at line 75 of file QwBCM.cc.

76 {
77  fBeamCurrent.SetExternalRandomVariable(random_variable);
78 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::SetPedestal ( Double_t  ped)
virtual

Implements VQwBCM.

Reimplemented in QwCombinedBCM< T >.

Definition at line 22 of file QwBCM.cc.

Referenced by QwCombinedBCM< T >::SetPedestal().

23 {
24  fBeamCurrent.SetPedestal(pedestal);
25 }
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the caller graph for this function:

template<typename T >
void QwBCM< T >::SetRandomEventAsymmetry ( Double_t  asymmetry)
virtual

Implements VQwBCM.

Definition at line 99 of file QwBCM.cc.

100 {
101  fBeamCurrent.SetRandomEventAsymmetry(asymmetry);
102 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::SetRandomEventDriftParameters ( Double_t  amplitude,
Double_t  phase,
Double_t  frequency 
)

Definition at line 81 of file QwBCM.cc.

82 {
83  fBeamCurrent.SetRandomEventDriftParameters(amplitude, phase, frequency);
84 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< T >::SetRandomEventParameters ( Double_t  mean,
Double_t  sigma 
)
virtual

Implements VQwBCM.

Definition at line 93 of file QwBCM.cc.

94 {
95  fBeamCurrent.SetRandomEventParameters(mean, sigma);
96 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
Int_t QwBCM< T >::SetSingleEventCuts ( Double_t  mean = 0,
Double_t  sigma = 0 
)

Definition at line 136 of file QwBCM.cc.

136  {//std::vector<Double_t> & dEventCuts){//two limts and sample size
137  fBeamCurrent.SetSingleEventCuts(LL,UL);
138  return 1;
139 }
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwBCM< 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 VQwBCM.

Definition at line 142 of file QwBCM.cc.

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

142  {
143  //set the unique tag to identify device type (bcm,bpm & etc)
144  errorflag|=kBCMErrorFlag;
145  QwMessage<<"QwBCM Error Code passing to QwVQWK_Ch "<<errorflag<<" "<<stability<<QwLog::endl;
146  fBeamCurrent.SetSingleEventCuts(errorflag,LL,UL,stability);
147 
148 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
static const UInt_t kBCMErrorFlag
Definition: QwTypes.h:167
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

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

Definition at line 331 of file QwBCM.cc.

331  {
332  *this = value1;
333  *this += value2;
334 }
template<typename T >
void QwBCM< T >::UpdateErrorFlag ( const VQwBCM< T > *  ev_error)
virtual

Implements VQwBCM.

Definition at line 187 of file QwBCM.cc.

References Qw::e, QwBCM< T >::fBeamCurrent, VQwDataElement::GetElementName(), and QwBCM< T >::UpdateErrorFlag().

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

187  {
188  try {
189  if(typeid(*ev_error)==typeid(*this)) {
190  // std::cout<<" Here in QwBCM::UpdateErrorFlag \n";
191  if (this->GetElementName()!="") {
192  const QwBCM<T>* value_bcm = dynamic_cast<const QwBCM<T>* >(ev_error);
193  fBeamCurrent.UpdateErrorFlag(value_bcm->fBeamCurrent);
194  }
195  } else {
196  TString loc="Standard exception from QwBCM::UpdateErrorFlag :"+
197  ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
198  +"same type";
199  throw std::invalid_argument(loc.Data());
200  }
201  } catch (std::exception& e) {
202  std::cerr<< e.what()<<std::endl;
203  }
204 };
static const double e
Definition: QwUnits.h:91
virtual const TString & GetElementName() const
Get the name of this element.
Definition: QwBCM.h:34
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void QwBCM< T >::UseExternalRandomVariable ( )

Definition at line 69 of file QwBCM.cc.

70 {
71  fBeamCurrent.UseExternalRandomVariable();
72 }
T fBeamCurrent
Definition: QwBCM.h:168

Friends And Related Function Documentation

template<typename T>
friend class QwCombinedBCM< T >
friend

Definition at line 36 of file QwBCM.h.

Field Documentation


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