JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
VQwClock Class Referenceabstract

Abstract base for beam clocks used to normalize rates and yields. More...

#include <VQwClock.h>

+ Inheritance diagram for VQwClock:
+ Collaboration diagram for VQwClock:

Public Member Functions

 VQwClock ()
 
 VQwClock (const VQwClock &source)
 
 ~VQwClock () override
 
Int_t ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0) override=0
 Process the CODA event buffer for this element.
 
void ConstructHistograms (TDirectory *folder, TString &prefix) override=0
 Construct the histograms for this data element.
 
void FillHistograms () override=0
 Fill the histograms for this data element.
 
virtual void SetSingleEventCuts (UInt_t errorflag, Double_t min, Double_t max, Double_t stability, Double_t burplevel)=0
 Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel.
 
virtual void Ratio (const VQwClock &, const VQwClock &)
 
void ClearEventData () override=0
 Clear the event data in this element.
 
virtual void InitializeChannel (TString subsystem, TString name, TString datatosave, TString type="")=0
 
void LoadChannelParameters (QwParameterFile &paramfile) override=0
 
virtual void SetEventCutMode (Int_t bcuts)=0
 
virtual void SetPedestal (Double_t ped)=0
 
virtual void SetCalibrationFactor (Double_t calib)=0
 
virtual Bool_t ApplySingleEventCuts ()=0
 
virtual void IncrementErrorCounters ()=0
 
virtual void ProcessEvent ()=0
 
virtual void Scale (Double_t factor)=0
 
virtual void CalculateRunningAverage ()=0
 
virtual void AccumulateRunningSum (const VQwClock &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)=0
 
virtual void DeaccumulateRunningSum (VQwClock &value, Int_t ErrorMask=0xFFFFFFF)=0
 
virtual void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)=0
 
virtual void ConstructBranch (TTree *tree, TString &prefix)=0
 
virtual void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist)=0
 
virtual void FillTreeVector (QwRootTreeBranchVector &values) const =0
 
virtual VQwClockoperator= (const VQwClock &value)=0
 
virtual VQwClockoperator+= (const VQwClock &value)=0
 
virtual VQwClockoperator-= (const VQwClock &value)=0
 
Double_t GetNormClockValue () override=0
 
virtual Double_t GetStandardClockValue ()=0
 
virtual const VQwHardwareChannelGetTime () const =0
 
virtual Bool_t CheckForBurpFail (const VQwClock *ev_error)=0
 
- Public Member Functions inherited from VQwDataElement
 VQwDataElement ()
 Default constructor.
 
 VQwDataElement (const VQwDataElement &value)
 Copy constructor.
 
 ~VQwDataElement () override
 Virtual destructor.
 
void CopyFrom (const VQwDataElement &value)
 
Bool_t IsNameEmpty () const
 Is the name of this element empty?
 
void SetElementName (const TString &name)
 Set the name of this element.
 
virtual const TString & GetElementName () const
 Get the name of this element.
 
virtual void LoadMockDataParameters (QwParameterFile &)
 
size_t GetNumberOfDataWords ()
 Get the number of data words in this data element.
 
UInt_t GetGoodEventCount () const
 
virtual void AssignValueFrom (const VQwDataElement *)
 
VQwDataElementoperator+= (const VQwDataElement &)
 Addition-assignment operator.
 
VQwDataElementoperator-= (const VQwDataElement &)
 Subtraction-assignment operator.
 
void Sum (const VQwDataElement &, const VQwDataElement &)
 Sum operator (base class fallback throws runtime error)
 
void Difference (const VQwDataElement &, const VQwDataElement &)
 Difference operator (base class fallback throws runtime error)
 
void Ratio (const VQwDataElement &, const VQwDataElement &)
 Ratio operator (base class fallback throws runtime error)
 
virtual void PrintValue () const
 Print single line of value and error of this data element.
 
virtual void PrintInfo () const
 Print multiple lines of information about this data element.
 
void SetSingleEventCuts (UInt_t, Double_t, Double_t, Double_t)
 set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel
 
virtual void PrintErrorCounters () const
 report number of events failed due to HW and event cut failure
 
Bool_t CheckForBurpFail (const VQwDataElement *)
 
virtual UInt_t GetEventcutErrorFlag ()
 return the error flag on this channel/device
 
virtual UInt_t UpdateErrorFlag ()
 Update the error flag based on the error flags of internally contained objects Return parameter is the "Eventcut Error Flag".
 
virtual void SetNeedsExternalClock (Bool_t)
 
virtual Bool_t NeedsExternalClock ()
 
virtual std::string GetExternalClockName ()
 
virtual void SetExternalClockPtr (const VQwHardwareChannel *)
 
virtual void SetExternalClockName (const std::string)
 
TString GetSubsystemName () const
 Return the name of the inheriting subsystem name.
 
void SetSubsystemName (TString sysname)
 Set the name of the inheriting subsystem name.
 
TString GetModuleType () const
 Return the type of the beam instrument.
 
void SetModuleType (TString ModuleType)
 set the type of the beam instrument
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects.
 

Static Public Member Functions

static VQwClockCreate (TString subsystemname, TString type, TString name)
 
static VQwClockCreate (const VQwClock &source)
 

Additional Inherited Members

- Public Types inherited from VQwDataElement
enum  EDataToSave { kRaw = 0 , kDerived , kMoments }
 
- Protected Member Functions inherited from VQwDataElement
void SetNumberOfDataWords (const UInt_t &numwords)
 Set the number of data words in this data element.
 
VQwDataElementoperator= (const VQwDataElement &value)
 Arithmetic assignment operator: Should only copy event-based data.
 
void UpdateErrorFlag (const UInt_t &error)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor.
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor.
 
virtual ~MQwHistograms ()
 Virtual destructor.
 
MQwHistogramsoperator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 
- Protected Attributes inherited from VQwDataElement
TString fElementName
 Name of this data element.
 
UInt_t fNumberOfDataWords
 Number of raw data words in this data element.
 
UInt_t fGoodEventCount
 Number of good events accumulated in this element.
 
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)
 
UInt_t fErrorConfigFlag
 contains the global/local/stability flags
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptrfHistograms
 Histograms associated with this data element.
 

Detailed Description

Abstract base for beam clocks used to normalize rates and yields.

VQwClock provides the interface for clock-like data elements that can be used to normalize other channels. Concrete clocks are provided by the templated QwClock<T> factory. The class exposes hooks for event decoding, tree/histogram output, accumulation, and single-event cuts.

Specialized note: containers may hold pointers of type VQwClock* and invoke virtual hooks such as CheckForBurpFail; derived implementations must ensure proper overrides are provided to enable polymorphic dispatch.

Definition at line 47 of file VQwClock.h.

Constructor & Destructor Documentation

◆ VQwClock() [1/2]

VQwClock::VQwClock ( )
inline

Definition at line 56 of file VQwClock.h.

56{ }; // Do not use this function!!

Referenced by QwClock< T >::AccumulateRunningSum(), AccumulateRunningSum(), QwClock< T >::CheckForBurpFail(), CheckForBurpFail(), Create(), Create(), QwClock< T >::DeaccumulateRunningSum(), DeaccumulateRunningSum(), QwClock< T >::operator+=(), operator+=(), QwClock< T >::operator-=(), operator-=(), QwClock< T >::operator=(), operator=(), QwClock< T >::QwClock(), QwClock< T >::Ratio(), Ratio(), and VQwClock().

+ Here is the caller graph for this function:

◆ VQwClock() [2/2]

VQwClock::VQwClock ( const VQwClock & source)
inline

Definition at line 57 of file VQwClock.h.

58 : VQwDataElement(source)
59 { }
VQwDataElement()
Default constructor.

References VQwClock(), and VQwDataElement::VQwDataElement().

+ Here is the call graph for this function:

◆ ~VQwClock()

VQwClock::~VQwClock ( )
inlineoverride

Definition at line 60 of file VQwClock.h.

60{};

Member Function Documentation

◆ AccumulateRunningSum()

virtual void VQwClock::AccumulateRunningSum ( const VQwClock & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )
pure virtual

Implemented in QwClock< T >.

References VQwClock().

+ Here is the call graph for this function:

◆ ApplySingleEventCuts()

virtual Bool_t VQwClock::ApplySingleEventCuts ( )
pure virtual

Implemented in QwClock< T >.

◆ CalculateRunningAverage()

virtual void VQwClock::CalculateRunningAverage ( )
pure virtual

Implemented in QwClock< T >.

◆ CheckForBurpFail()

virtual Bool_t VQwClock::CheckForBurpFail ( const VQwClock * ev_error)
pure virtual

Implemented in QwClock< T >.

References VQwClock().

+ Here is the call graph for this function:

◆ ClearEventData()

void VQwClock::ClearEventData ( )
overridepure virtual

Clear the event data in this element.

Reimplemented from VQwDataElement.

Implemented in QwClock< T >.

◆ ConstructBranch() [1/2]

virtual void VQwClock::ConstructBranch ( TTree * tree,
TString & prefix )
pure virtual

Implemented in QwClock< T >.

◆ ConstructBranch() [2/2]

virtual void VQwClock::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & modulelist )
pure virtual

Implemented in QwClock< T >.

◆ ConstructBranchAndVector()

virtual void VQwClock::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )
pure virtual

Implemented in QwClock< T >.

◆ ConstructHistograms()

void VQwClock::ConstructHistograms ( TDirectory * folder,
TString & prefix )
overridepure virtual

Construct the histograms for this data element.

Implements VQwDataElement.

Implemented in QwClock< T >.

◆ Create() [1/2]

VQwClock * VQwClock::Create ( const VQwClock & source)
static

Copy-construct a concrete Clock based on the source module type.

Definition at line 52 of file VQwClock.cc.

52 {
53 Bool_t localDebug = kFALSE;
54 TString type = source.GetModuleType();
55 type.ToUpper();
56 if (localDebug) QwMessage<<"Creating Clock of type: " << type << QwLog::endl;
57 // (jc2) As a first try, let's do this the ugly way (but rather very
58 // simple), just list out the types of Clock's supported by this code!!!
59 if( type == "VQWK") { // (jc2) I don't know why on earth anyone would want
60 // a VQWK clock, but it is added here for completion :)
61 return new QwClock<QwVQWK_Channel>(dynamic_cast<const QwClock<QwVQWK_Channel>&>(source));
62 } else if ( type == "SIS3801" ) {
63 return new QwClock<QwSIS3801_Channel>(dynamic_cast<const QwClock<QwSIS3801_Channel>&>(source));
64 } else if ( type == "SCALER" || type == "SIS3801D24" ) {
65 return new QwClock<QwSIS3801D24_Channel>(dynamic_cast<const QwClock<QwSIS3801D24_Channel>&>(source));
66 } else { // Unsupported one!
67 QwWarning << "Clock of type="<<type<<" is UNSUPPORTED!!\n";
68 exit(-1);
69 }
70
71}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
TString GetModuleType() const
Return the type of the beam instrument.

References QwLog::endl(), VQwDataElement::GetModuleType(), QwMessage, QwWarning, and VQwClock().

+ Here is the call graph for this function:

◆ Create() [2/2]

VQwClock * VQwClock::Create ( TString subsystemname,
TString name,
TString type )
static

Create a concrete Clock instance for the requested module type. Supported: VQWK, SIS3801, SIS3801D24/SCALER.

Definition at line 30 of file VQwClock.cc.

31{
32 Bool_t localDebug = kFALSE;
33 type.ToUpper();
34 if( localDebug ) QwMessage<<"Creating Clock of type: "<<type<<" with name: "<<
35 name<<". Subsystem Name: " <<subsystemname<<"\n";
36 // (jc2) As a first try, let's do this the ugly way (but rather very
37 // simple), just list out the types of Clock's supported by this code!!!
38 if( type == "VQWK") { // (jc2) I don't know why on earth anyone would want
39 // a VQWK clock, but it is added here for completion :)
40 return new QwClock<QwVQWK_Channel>(subsystemname,name,type);
41 } else if ( type == "SIS3801" ) {
42 return new QwClock<QwSIS3801_Channel>(subsystemname,name,type);
43 } else if ( type == "SCALER" || type == "SIS3801D24" ) {
44 return new QwClock<QwSIS3801D24_Channel>(subsystemname,name,type);
45 } else { // Unsupported one!
46 QwWarning << "Clock of type="<<type<<" is UNSUPPORTED!!\n";
47 exit(-1);
48 }
49}

References QwMessage, QwWarning, and VQwClock().

Referenced by QwBeamLine::AddToElementList(), and QwBeamLine::CopyTemplatedDataElements().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeaccumulateRunningSum()

virtual void VQwClock::DeaccumulateRunningSum ( VQwClock & value,
Int_t ErrorMask = 0xFFFFFFF )
pure virtual

Implemented in QwClock< T >.

References VQwClock().

+ Here is the call graph for this function:

◆ FillHistograms()

void VQwClock::FillHistograms ( )
overridepure virtual

Fill the histograms for this data element.

Implements VQwDataElement.

Implemented in QwClock< T >.

◆ FillTreeVector()

virtual void VQwClock::FillTreeVector ( QwRootTreeBranchVector & values) const
pure virtual

Implemented in QwClock< T >.

◆ GetNormClockValue()

Double_t VQwClock::GetNormClockValue ( )
overridepure virtual

Reimplemented from VQwDataElement.

Implemented in QwClock< T >.

◆ GetStandardClockValue()

virtual Double_t VQwClock::GetStandardClockValue ( )
pure virtual

Implemented in QwClock< T >.

◆ GetTime()

virtual const VQwHardwareChannel * VQwClock::GetTime ( ) const
pure virtual

Implemented in QwClock< T >.

◆ IncrementErrorCounters()

virtual void VQwClock::IncrementErrorCounters ( )
pure virtual

Implemented in QwClock< T >.

◆ InitializeChannel()

virtual void VQwClock::InitializeChannel ( TString subsystem,
TString name,
TString datatosave,
TString type = "" )
pure virtual

Implemented in QwClock< T >.

◆ LoadChannelParameters()

void VQwClock::LoadChannelParameters ( QwParameterFile & paramfile)
overridepure virtual

Reimplemented from VQwDataElement.

Implemented in QwClock< T >.

◆ operator+=()

virtual VQwClock & VQwClock::operator+= ( const VQwClock & value)
pure virtual

Implemented in QwClock< T >.

References VQwClock().

+ Here is the call graph for this function:

◆ operator-=()

virtual VQwClock & VQwClock::operator-= ( const VQwClock & value)
pure virtual

Implemented in QwClock< T >.

References VQwClock().

+ Here is the call graph for this function:

◆ operator=()

virtual VQwClock & VQwClock::operator= ( const VQwClock & value)
pure virtual

Implemented in QwClock< T >.

References VQwClock().

+ Here is the call graph for this function:

◆ ProcessEvBuffer()

Int_t VQwClock::ProcessEvBuffer ( UInt_t * buffer,
UInt_t num_words_left,
UInt_t subelement = 0 )
overridepure virtual

Process the CODA event buffer for this element.

Implements VQwDataElement.

Implemented in QwClock< T >.

References QwBPMStripline< T >::subelement.

◆ ProcessEvent()

virtual void VQwClock::ProcessEvent ( )
pure virtual

Implemented in QwClock< T >.

◆ Ratio()

virtual void VQwClock::Ratio ( const VQwClock & ,
const VQwClock &  )
inlinevirtual

Reimplemented in QwClock< T >.

Definition at line 68 of file VQwClock.h.

69 { std::cerr << "Ratio not defined! (VQwClock)" << std::endl; }

References VQwClock().

+ Here is the call graph for this function:

◆ Scale()

virtual void VQwClock::Scale ( Double_t factor)
pure virtual

Implemented in QwClock< T >.

◆ SetCalibrationFactor()

virtual void VQwClock::SetCalibrationFactor ( Double_t calib)
pure virtual

Implemented in QwClock< T >.

◆ SetEventCutMode()

virtual void VQwClock::SetEventCutMode ( Int_t bcuts)
pure virtual

Implemented in QwClock< T >.

◆ SetPedestal()

virtual void VQwClock::SetPedestal ( Double_t ped)
pure virtual

Implemented in QwClock< T >.

◆ SetSingleEventCuts()

virtual void VQwClock::SetSingleEventCuts ( UInt_t errorflag,
Double_t min,
Double_t max,
Double_t stability,
Double_t burplevel )
pure virtual

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

Implemented in QwClock< T >.


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