JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
VQwHardwareChannel.cc
Go to the documentation of this file.
1/**
2 * VQwHardwareChannel.cc
3 *
4 * Base implementation for hardware channels providing common functionality:
5 * constructors, option processing, single-event cuts, database interfaces,
6 * and tree branch construction with module list filtering. Used by all
7 * concrete channel types. Documentation-only edits; runtime behavior unchanged.
8 */
9
10#include "VQwHardwareChannel.h"
11
12// Qweak database headers
13#include "QwLog.h"
14#ifdef __USE_DATABASE__
15#include "QwDBInterface.h"
16#endif
17#include "QwParameterFile.h"
18#include "QwOptions.h"
19
21
22/** Default constructor: initialize limits, error flags, and process options. */
34
35/** Copy constructor: duplicate all channel state and configuration. */
55
56/** Copy constructor with data-to-save override. */
76
77/** Copy all state from another hardware channel instance. */
97
98/** Configure upper and lower limits for single-event cuts. */
99void VQwHardwareChannel::SetSingleEventCuts(Double_t min, Double_t max)
100{
101 fULimit=max;
102 fLLimit=min;
103}
104
105/**
106 * Configure comprehensive single-event cuts with error flags, stability, and
107 * burp detection thresholds.
108 */
109void VQwHardwareChannel::SetSingleEventCuts(UInt_t errorflag,Double_t min, Double_t max, Double_t stability, Double_t BurpLevel)
110{
111 //QwError<<"***************************inside VQwHardwareChannel, BurpLevel = "<<BurpLevel<<QwLog::endl;
112 fErrorConfigFlag=errorflag;
113 fStability=stability;
114 fBurpThreshold=BurpLevel;
115 SetSingleEventCuts(min,max);
116 QwMessage << "Set single event cuts for " << GetElementName() << ": "
117 << "Config-error-flag == 0x" << std::hex << errorflag << std::dec
118 << ", global? " << ((fErrorConfigFlag & kGlobalCut)==kGlobalCut) << ", stability? " << ((fErrorConfigFlag & kStabilityCut)==kStabilityCut)<<" cut "<<fStability << ", burpcut " << fBurpThreshold << QwLog::endl;
119}
120
121/**
122 * Build database interface rows for all subelements of this channel.
123 */
124#ifdef __USE_DATABASE__
125void VQwHardwareChannel::AddEntriesToList(std::vector<QwDBInterface> &row_list)
126{
127 QwDBInterface row;
128 TString name = GetElementName();
129 UInt_t entries = GetGoodEventCount();
130 // Loop over subelements and build the list.
131 for(UInt_t subelement=0;
133 subelement++) {
134 row.Reset();
135 row.SetDetectorName(name);
137 row.SetN(entries);
140 row_list.push_back(row);
141 }
142}
143#endif // __USE_DATABASE__
144
145/**
146 * Conditionally construct tree branch if this channel name appears in the
147 * module list filter.
148 */
149void VQwHardwareChannel::ConstructBranch(TTree *tree, TString &prefix, QwParameterFile& modulelist){
150 if (GetElementName()!=""){
151 TString devicename;
152 devicename=GetElementName();
153 devicename.ToLower();
154 if (modulelist.HasValue(devicename)){
155 ConstructBranch(tree,prefix);
156 }
157 }
158}
An options class which parses command line, config file and environment.
A logfile class, based on an identical class in the Hermes analyzer.
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
Parameter file parsing and management.
static const UInt_t kGlobalCut
Definition QwTypes.h:182
static const UInt_t kStabilityCut
Definition QwTypes.h:184
Database interface for QwIntegrationPMT and subsystems.
const TString QwBPMStripline< T >::subelement[4]
void SetSubblock(UInt_t in)
void SetError(Double_t in)
void SetN(UInt_t in)
void SetValue(Double_t in)
void SetDetectorName(TString &in)
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
Configuration file parser with flexible tokenization and search capabilities.
Bool_t HasValue(TString &vname)
void CopyFrom(const VQwDataElement &value)
VQwDataElement()
Default constructor.
UInt_t fErrorConfigFlag
contains the global/local/stability flags
virtual const TString & GetElementName() const
Get the name of this element.
UInt_t fErrorFlag
This the standard error code generated for the channel that contains the global/local/stability flags...
UInt_t GetGoodEventCount() const
void AddEntriesToList(std::vector< QwDBInterface > &row_list)
void SetSingleEventCuts(Double_t min, Double_t max)
Set the upper and lower limits (fULimit and fLLimit) for this channel.
Double_t GetValueError() const
size_t GetNumberOfSubelements()
Get the number of subelements in this data element.
UInt_t fNumberOfSubElements
Number of subelements in this data element.
void CopyFrom(const VQwHardwareChannel &value)
virtual void ConstructBranch(TTree *tree, TString &prefix)=0
UInt_t fNumberOfDataWords
Number of raw data words in this data element.
Double_t GetValue() const