QwAnalysis
QwCombinedBCM< T > Class Template Reference

#include <QwBCM.h>

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

Public Member Functions

 QwCombinedBCM ()
 
 QwCombinedBCM (TString name)
 
 QwCombinedBCM (TString subsystem, TString name)
 
 QwCombinedBCM (TString subsystemname, TString name, TString type)
 
 QwCombinedBCM (const QwCombinedBCM &source)
 
virtual ~QwCombinedBCM ()
 
void SetBCMForCombo (VQwBCM *bcm, Double_t weight, Double_t sumqw)
 
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 ProcessEvent ()
 
Bool_t ApplyHWChecks ()
 
Bool_t ApplySingleEventCuts ()
 
UInt_t UpdateErrorFlag ()
 Update the error flag based on the error flags of internally contained objects Return paramter is the "Eventcut Error Flag". More...
 
VQwBCMoperator= (const VQwBCM &value)
 
QwCombinedBCMoperator= (const QwCombinedBCM &value)
 
void SetPedestal (Double_t ped)
 
void SetCalibrationFactor (Double_t calib)
 
VQwHardwareChannelGetCharge ()
 
const VQwHardwareChannelGetCharge () const
 
- Public Member Functions inherited from QwBCM< T >
 QwBCM ()
 
 QwBCM (TString name)
 
 QwBCM (TString subsystemname, TString name)
 
 QwBCM (TString subsystemname, TString name, TString type, TString clock="")
 
 QwBCM (const QwBCM &source)
 
virtual ~QwBCM ()
 
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)
 
Bool_t ApplyHWChecks ()
 
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...
 
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)
 
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 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 ()
 
- 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...
 

Private Attributes

std::vector< QwBCM< T > * > fElement
 
std::vector< Double_t > fWeights
 
Double_t fSumQweights
 

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...
 
- Protected Attributes inherited from QwBCM< T >
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...
 

Detailed Description

template<typename T>
class QwCombinedBCM< T >

Definition at line 26 of file QwBCM.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file QwCombinedBCM.h.

37 { };
template<typename T>
QwCombinedBCM< T >::QwCombinedBCM ( TString  name)
inline

Definition at line 38 of file QwCombinedBCM.h.

References QwCombinedBCM< T >::InitializeChannel().

38  {
39  InitializeChannel(name, "derived");
40  };
void InitializeChannel(TString name, TString datatosave)

+ Here is the call graph for this function:

template<typename T>
QwCombinedBCM< T >::QwCombinedBCM ( TString  subsystem,
TString  name 
)
inline

Definition at line 41 of file QwCombinedBCM.h.

References QwCombinedBCM< T >::InitializeChannel().

41  {
42  InitializeChannel(subsystem, name, "derived");
43  };
void InitializeChannel(TString name, TString datatosave)

+ Here is the call graph for this function:

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

Definition at line 44 of file QwCombinedBCM.h.

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

44  {
45  this->SetSubsystemName(subsystemname);
46  InitializeChannel(subsystemname, name,type,"raw");
47  };
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
void InitializeChannel(TString name, TString datatosave)

+ Here is the call graph for this function:

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

Definition at line 48 of file QwCombinedBCM.h.

49  : QwBCM<T>(source)
50  { }
Definition: QwBCM.h:34
template<typename T>
virtual QwCombinedBCM< T >::~QwCombinedBCM ( )
inlinevirtual

Definition at line 51 of file QwCombinedBCM.h.

51 { };

Member Function Documentation

template<typename T>
Bool_t QwCombinedBCM< T >::ApplyHWChecks ( )
inline

Definition at line 67 of file QwCombinedBCM.h.

67  {
68  return kTRUE;
69  };
template<typename T >
Bool_t QwCombinedBCM< T >::ApplySingleEventCuts ( )
virtual

Reimplemented from QwBCM< T >.

Definition at line 97 of file QwCombinedBCM.cc.

References QwBCM< T >::ApplySingleEventCuts().

98 {
99 
100  //This is required to update single event cut faliures in individual channels
101  // First update the error code based on the codes
102  // of the elements. This requires that the BCMs
103  // have had ApplySingleEventCuts run on them already.
104 
105  for (size_t i=0;i<fElement.size();i++){
106  this->fBeamCurrent.UpdateErrorFlag(fElement.at(i)->fBeamCurrent.GetErrorCode());
107  }
108 
109 
110  // Everything is identical as for a regular BCM
112 }
Bool_t ApplySingleEventCuts()
Definition: QwBCM.cc:158
std::vector< QwBCM< T > * > fElement
Definition: QwCombinedBCM.h:98
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

template<typename T>
VQwHardwareChannel* QwCombinedBCM< T >::GetCharge ( )
inline

Definition at line 92 of file QwCombinedBCM.h.

References QwBCM< T >::fBeamCurrent.

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

92  {
93  return &(this->fBeamCurrent);
94  };
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the caller graph for this function:

template<typename T>
const VQwHardwareChannel* QwCombinedBCM< T >::GetCharge ( ) const
inlinevirtual

Reimplemented from QwBCM< T >.

Definition at line 96 of file QwCombinedBCM.h.

References QwCombinedBCM< T >::GetCharge().

96  {
97  return const_cast<QwCombinedBCM*>(this)->GetCharge();
98  };
VQwHardwareChannel * GetCharge()
Definition: QwCombinedBCM.h:92

+ Here is the call graph for this function:

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

Reimplemented from QwBCM< T >.

Definition at line 37 of file QwCombinedBCM.cc.

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

38 {
39  SetPedestal(0.);
41  this->SetElementName(name);
42  this->fBeamCurrent.InitializeChannel(name,"derived");
43 }
void SetCalibrationFactor(Double_t calib)
Definition: QwCombinedBCM.h:88
void SetPedestal(Double_t ped)
Definition: QwCombinedBCM.h:85
void SetElementName(const TString &name)
Set the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the caller graph for this function:

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

Reimplemented from QwBCM< T >.

Definition at line 46 of file QwCombinedBCM.cc.

47 {
48  SetPedestal(0.);
50  this->SetElementName(name);
51  this->fBeamCurrent.InitializeChannel(subsystem, "QwCombinedBCM", name,"derived");
52 }
void SetCalibrationFactor(Double_t calib)
Definition: QwCombinedBCM.h:88
void SetPedestal(Double_t ped)
Definition: QwCombinedBCM.h:85
void SetElementName(const TString &name)
Set the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
void QwCombinedBCM< T >::InitializeChannel ( TString  subsystem,
TString  name,
TString  type,
TString  datatosave 
)

Definition at line 55 of file QwCombinedBCM.cc.

57 {
58  SetPedestal(0.);
60  this->SetElementName(name);
61  this->SetModuleType(type);
62  this->fBeamCurrent.InitializeChannel(subsystem, "QwCombinedBCM", name,"derived");
63 }
void SetCalibrationFactor(Double_t calib)
Definition: QwCombinedBCM.h:88
void SetPedestal(Double_t ped)
Definition: QwCombinedBCM.h:85
void SetElementName(const TString &name)
Set the name of this element.
void SetModuleType(TString ModuleType)
set the type of the beam instrument
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
VQwBCM & QwCombinedBCM< T >::operator= ( const VQwBCM value)
virtual

Reimplemented from QwBCM< T >.

Definition at line 188 of file QwCombinedBCM.cc.

References QwBCM< T >::fBeamCurrent.

189 {
190  if (this->GetElementName()!="")
191  dynamic_cast<QwCombinedBCM<T>* >(this)->fBeamCurrent=
192  dynamic_cast<const QwCombinedBCM<T>* >(&value)->fBeamCurrent;
193 
194  return *this;
195 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T >
QwCombinedBCM< T > & QwCombinedBCM< T >::operator= ( const QwCombinedBCM< T > &  value)

Definition at line 179 of file QwCombinedBCM.cc.

References QwBCM< T >::fBeamCurrent.

180 {
181  if (this->GetElementName()!="")
182  this->fBeamCurrent=value.fBeamCurrent;
183 
184  return *this;
185 }
virtual const TString & GetElementName() const
Get the name of this element.
T fBeamCurrent
Definition: QwBCM.h:168
template<typename T>
Int_t QwCombinedBCM< T >::ProcessEvBuffer ( UInt_t *  buffer,
UInt_t  num_words_left,
UInt_t  subelement = 0 
)
inlinevirtual

Process the CODA event buffer for this element.

Reimplemented from QwBCM< T >.

Definition at line 57 of file QwCombinedBCM.h.

57 { return 0; };
template<typename T >
void QwCombinedBCM< T >::ProcessEvent ( )
virtual

Reimplemented from QwBCM< T >.

Definition at line 68 of file QwCombinedBCM.cc.

References QwLog::endl(), QwMessage, and Qw::T.

69 {
70  static T tmpADC;
71  tmpADC.InitializeChannel("tmp","derived");
72 
73  for (size_t i = 0; i < fElement.size(); i++) {
74  tmpADC = fElement[i]->fBeamCurrent;
75  tmpADC.Scale(fWeights[i]);
76  this->fBeamCurrent += tmpADC;
77  }
78  this->fBeamCurrent.Scale(1.0/fSumQweights);
79 
80  Bool_t ldebug = kFALSE;
81  if (ldebug) {
82  QwMessage << "*****************" << QwLog::endl;
83  QwMessage << "QwCombinedBCM: " << this->GetElementName() << QwLog::endl
84  << "weighted average of hardware sums = " << this->fBeamCurrent.GetValue() << QwLog::endl;
85  if (this->fBeamCurrent.GetNumberOfSubelements() > 1) {
86  for (size_t i = 0; i < 4; i++) {
87  QwMessage << "weighted average of block[" << i << "] = " << this->fBeamCurrent.GetValue(i) << QwLog::endl;
88  }
89  }
90  QwMessage << "*****************" << QwLog::endl;
91  }
92 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
std::vector< Double_t > fWeights
static const double T
Magnetic field: base unit is T.
Definition: QwUnits.h:111
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.
Double_t fSumQweights
std::vector< QwBCM< T > * > fElement
Definition: QwCombinedBCM.h:98
T fBeamCurrent
Definition: QwBCM.h:168

+ Here is the call graph for this function:

template<typename T >
void QwCombinedBCM< T >::SetBCMForCombo ( VQwBCM bcm,
Double_t  weight,
Double_t  sumqw 
)
virtual

Reimplemented from QwBCM< T >.

Definition at line 26 of file QwCombinedBCM.cc.

27 {
28  // Convert back to QWBCM<T>* from generic VQwBCM*
29  fElement.push_back(dynamic_cast<QwBCM<T>* >(bcm));
30  fWeights.push_back(weight);
31  fSumQweights = sumqw;
32 }
std::vector< Double_t > fWeights
Double_t fSumQweights
Definition: QwBCM.h:34
std::vector< QwBCM< T > * > fElement
Definition: QwCombinedBCM.h:98
template<typename T>
void QwCombinedBCM< T >::SetCalibrationFactor ( Double_t  calib)
inlinevirtual

Reimplemented from QwBCM< T >.

Definition at line 88 of file QwCombinedBCM.h.

References QwBCM< T >::SetCalibrationFactor().

88  {
90  }
void SetCalibrationFactor(Double_t calib)
Definition: QwBCM.cc:28

+ Here is the call graph for this function:

template<typename T>
void QwCombinedBCM< T >::SetPedestal ( Double_t  ped)
inlinevirtual

Reimplemented from QwBCM< T >.

Definition at line 85 of file QwCombinedBCM.h.

References QwBCM< T >::SetPedestal().

85  {
87  }
void SetPedestal(Double_t ped)
Definition: QwBCM.cc:22

+ Here is the call graph for this function:

template<typename T >
UInt_t QwCombinedBCM< T >::UpdateErrorFlag ( )
virtual

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

Reimplemented from VQwBCM.

Definition at line 115 of file QwCombinedBCM.cc.

115  {
116  for (size_t i=0;i<fElement.size();i++){
117  this->fBeamCurrent.UpdateErrorFlag(fElement.at(i)->fBeamCurrent.GetErrorCode());
118  }
119  return this->fBeamCurrent.GetEventcutErrorFlag();
120 }
std::vector< QwBCM< T > * > fElement
Definition: QwCombinedBCM.h:98
T fBeamCurrent
Definition: QwBCM.h:168

Field Documentation

template<typename T>
std::vector<QwBCM<T>*> QwCombinedBCM< T >::fElement
private

Definition at line 98 of file QwCombinedBCM.h.

template<typename T>
Double_t QwCombinedBCM< T >::fSumQweights
private

Definition at line 105 of file QwCombinedBCM.h.

template<typename T>
std::vector<Double_t> QwCombinedBCM< T >::fWeights
private

Definition at line 104 of file QwCombinedBCM.h.


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