JAPAn
Just Another Parity Analyzer
|
Combines multiple integration PMTs into weighted sum/average. More...
#include <QwCombinedPMT.h>
Public Member Functions | |
QwCombinedPMT () | |
QwCombinedPMT (TString name) | |
QwCombinedPMT (TString subsystemname, TString name) | |
QwCombinedPMT (const QwCombinedPMT &source) | |
~QwCombinedPMT () override | |
void | InitializeChannel (TString name, TString datatosave) |
Initialize the combined PMT with a name and data-saving mode. | |
void | InitializeChannel (TString subsystem, TString name, TString datatosave) |
Initialize the combined PMT with subsystem and name. | |
void | LinkChannel (TString name) |
Link internal sum channel names to the given detector name. | |
const QwMollerADC_Channel * | GetChannel (const TString name) const |
void | Add (QwIntegrationPMT *pmt, Double_t weight) |
Add a PMT channel to this combination with a weight. | |
Int_t | ProcessEvBuffer (UInt_t *buffer, UInt_t word_position_in_buffer, UInt_t subelement=0) override |
Process the CODA event buffer for this element. | |
void | ClearEventData () override |
Clear event-scoped data for the sum channel. | |
void | PrintErrorCounters () |
void | CalculateSumAndAverage () |
Compute the weighted sum (and average) from member PMTs. | |
void | SetRandomEventParameters (Double_t mean, Double_t sigma) |
void | SetRandomEventAsymmetry (Double_t asymmetry) |
void | RandomizeEventData (int helicity) |
void | SetHardwareSum (Double_t hwsum, UInt_t sequencenumber=0) |
Set the hardware-level sum for a sequence (unused for combo). | |
void | SetEventData (Double_t *block, UInt_t sequencenumber) |
Set the block data for the current event sequence. | |
void | EncodeEventData (std::vector< UInt_t > &buffer) |
void | ProcessEvent () |
Process event by computing the weighted average of members. | |
Bool_t | ApplyHWChecks () |
Apply hardware checks (none needed at combiner level). | |
Bool_t | ApplySingleEventCuts () |
void | PrintErrorCounters () const override |
Print error counters aggregated by the sum ADC. | |
void | SetSingleEventCuts (UInt_t errorflag, Double_t LL, Double_t UL, Double_t stability, Double_t burplevel) |
Inherited from VQwDataElement to set the upper and lower limits (fULimit and fLLimit), stability % and the error flag on this channel. | |
void | SetDefaultSampleSize (Int_t sample_size) |
Set default sample size on the sum ADC. | |
void | SetEventCutMode (Int_t bcuts) |
UInt_t | GetEventcutErrorFlag () override |
return the error flag on this channel/device | |
void | IncrementErrorCounters () |
Bool_t | CheckForBurpFail (const VQwDataElement *ev_error) |
Check for burp failures by delegating to the sum ADC channel. | |
UInt_t | UpdateErrorFlag () override |
Update the sum ADC error flag from member PMTs. | |
void | UpdateErrorFlag (const QwCombinedPMT *ev_error) |
Merge error flags from a reference combined PMT. | |
void | PrintInfo () const override |
Print multiple lines of information about this data element. | |
void | PrintValue () const override |
Print single line of value and error of this data element. | |
QwCombinedPMT & | operator= (const QwCombinedPMT &value) |
QwCombinedPMT & | operator+= (const QwCombinedPMT &value) |
QwCombinedPMT & | operator-= (const QwCombinedPMT &value) |
void | Sum (const QwCombinedPMT &value1, const QwCombinedPMT &value2) |
void | Difference (const QwCombinedPMT &value1, const QwCombinedPMT &value2) |
void | Ratio (QwCombinedPMT &numer, QwCombinedPMT &denom) |
void | Scale (Double_t factor) |
void | Normalize (VQwDataElement *denom) |
void | AccumulateRunningSum (const QwCombinedPMT &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) |
void | DeaccumulateRunningSum (QwCombinedPMT &value, Int_t ErrorMask=0xFFFFFFF) |
void | CalculateRunningAverage () |
void | SetBlindability (Bool_t isblindable) |
void | SetNormalizability (Bool_t isnormalizable) |
void | Blind (const QwBlinder *blinder) |
Blind the asymmetry. | |
void | Blind (const QwBlinder *blinder, const QwCombinedPMT &yield) |
Blind the difference using the yield. | |
void | SetPedestal (Double_t ped) |
void | SetCalibrationFactor (Double_t calib) |
void | ConstructHistograms (TDirectory *folder, TString &prefix) override |
Construct the histograms for this data element. | |
void | FillHistograms () override |
Fill the histograms for this data element. | |
void | ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) |
void | ConstructBranch (TTree *tree, TString &prefix) |
void | ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &modulelist) |
void | FillTreeVector (QwRootTreeBranchVector &values) const |
std::vector< QwDBInterface > | GetDBEntry () |
std::vector< QwErrDBInterface > | GetErrDBEntry () |
![]() | |
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 | LoadChannelParameters (QwParameterFile &) |
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 *) |
VQwDataElement & | operator+= (const VQwDataElement &) |
Addition-assignment operator. | |
VQwDataElement & | operator-= (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) | |
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 | |
Bool_t | CheckForBurpFail (const VQwDataElement *) |
virtual void | SetNeedsExternalClock (Bool_t) |
virtual Bool_t | NeedsExternalClock () |
virtual std::string | GetExternalClockName () |
virtual void | SetExternalClockPtr (const VQwHardwareChannel *) |
virtual void | SetExternalClockName (const std::string) |
virtual Double_t | GetNormClockValue () |
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 | |
![]() | |
void | ShareHistograms (const MQwHistograms *source) |
Share histogram pointers between objects. | |
Private Attributes | |
Int_t | fDataToSave |
Double_t | fCalibration |
Double_t | fULimit |
Double_t | fLLimit |
Double_t | fSequenceNo_Prev |
Bool_t | fGoodEvent |
std::vector< QwIntegrationPMT * > | fElement |
used to validate sequence number in the IsGoodEvent() | |
std::vector< Double_t > | fWeights |
QwIntegrationPMT | fSumADC |
Int_t | fDevice_flag |
Int_t | fDeviceErrorCode |
Bool_t | bEVENTCUTMODE |
Static Private Attributes | |
static const Bool_t | bDEBUG =kFALSE |
Additional Inherited Members | |
![]() | |
enum | EDataToSave { kRaw = 0 , kDerived , kMoments } |
![]() | |
void | SetNumberOfDataWords (const UInt_t &numwords) |
Set the number of data words in this data element. | |
VQwDataElement & | operator= (const VQwDataElement &value) |
Arithmetic assignment operator: Should only copy event-based data. | |
void | UpdateErrorFlag (const UInt_t &error) |
![]() | |
MQwHistograms () | |
Default constructor. | |
MQwHistograms (const MQwHistograms &source) | |
Copy constructor. | |
virtual | ~MQwHistograms () |
Virtual destructor. | |
MQwHistograms & | operator= (const MQwHistograms &value) |
void | Fill_Pointer (TH1_ptr hist_ptr, Double_t value) |
void | AddHistogram (TH1 *h) |
Register a histogram. | |
![]() | |
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 | |
![]() | |
std::vector< TH1_ptr > | fHistograms |
Histograms associated with this data element. | |
Combines multiple integration PMTs into weighted sum/average.
Definition at line 31 of file QwCombinedPMT.h.
|
inline |
Definition at line 34 of file QwCombinedPMT.h.
References InitializeChannel().
Referenced by AccumulateRunningSum(), Blind(), CheckForBurpFail(), DeaccumulateRunningSum(), Difference(), operator+=(), operator-=(), operator=(), QwCombinedPMT(), Ratio(), Sum(), and UpdateErrorFlag().
|
inline |
Definition at line 38 of file QwCombinedPMT.h.
References InitializeChannel().
|
inline |
Definition at line 42 of file QwCombinedPMT.h.
References InitializeChannel(), and VQwDataElement::SetSubsystemName().
|
inline |
Definition at line 46 of file QwCombinedPMT.h.
References fCalibration, fElement, fSumADC, fWeights, QwCombinedPMT(), and VQwDataElement::VQwDataElement().
|
inlineoverride |
Definition at line 53 of file QwCombinedPMT.h.
void QwCombinedPMT::AccumulateRunningSum | ( | const QwCombinedPMT & | value, |
Int_t | count = 0, | ||
Int_t | ErrorMask = 0xFFFFFFF ) |
Definition at line 350 of file QwCombinedPMT.cc.
References fSumADC, and QwCombinedPMT().
void QwCombinedPMT::Add | ( | QwIntegrationPMT * | pmt, |
Double_t | weight ) |
Add a PMT channel to this combination with a weight.
pmt | Pointer to the PMT to include. |
weight | Weight applied to the PMT in the sum/average. |
Definition at line 26 of file QwCombinedPMT.cc.
Bool_t QwCombinedPMT::ApplyHWChecks | ( | ) |
Apply hardware checks (none needed at combiner level).
Definition at line 159 of file QwCombinedPMT.cc.
Bool_t QwCombinedPMT::ApplySingleEventCuts | ( | ) |
Definition at line 261 of file QwCombinedPMT.cc.
References fSumADC.
void QwCombinedPMT::Blind | ( | const QwBlinder * | blinder | ) |
void QwCombinedPMT::Blind | ( | const QwBlinder * | blinder, |
const QwCombinedPMT & | yield ) |
Blind the difference using the yield.
Definition at line 394 of file QwCombinedPMT.cc.
References fSumADC, and QwCombinedPMT().
void QwCombinedPMT::CalculateRunningAverage | ( | ) |
Definition at line 382 of file QwCombinedPMT.cc.
References fSumADC.
void QwCombinedPMT::CalculateSumAndAverage | ( | ) |
Compute the weighted sum (and average) from member PMTs.
Definition at line 109 of file QwCombinedPMT.cc.
References fElement, fSumADC, fWeights, VQwDataElement::GetElementName(), and QwIntegrationPMT::Scale().
Referenced by ProcessEvent().
Bool_t QwCombinedPMT::CheckForBurpFail | ( | const VQwDataElement * | ev_error | ) |
Check for burp failures by delegating to the sum ADC channel.
ev_error | Reference combined PMT to compare against. |
Definition at line 207 of file QwCombinedPMT.cc.
References fSumADC, VQwDataElement::GetElementName(), QwCombinedPMT(), and VQwDataElement::VQwDataElement().
|
overridevirtual |
Clear event-scoped data for the sum channel.
Reimplemented from VQwDataElement.
Definition at line 88 of file QwCombinedPMT.cc.
References fSumADC.
void QwCombinedPMT::ConstructBranch | ( | TTree * | tree, |
TString & | prefix ) |
Definition at line 461 of file QwCombinedPMT.cc.
References fSumADC, and VQwDataElement::GetElementName().
void QwCombinedPMT::ConstructBranch | ( | TTree * | tree, |
TString & | prefix, | ||
QwParameterFile & | modulelist ) |
Definition at line 475 of file QwCombinedPMT.cc.
References QwLog::endl(), fSumADC, VQwDataElement::GetElementName(), QwParameterFile::HasValue(), and QwMessage.
void QwCombinedPMT::ConstructBranchAndVector | ( | TTree * | tree, |
TString & | prefix, | ||
QwRootTreeBranchVector & | values ) |
Definition at line 446 of file QwCombinedPMT.cc.
References fSumADC, and VQwDataElement::GetElementName().
|
overridevirtual |
Construct the histograms for this data element.
Implements VQwDataElement.
Definition at line 413 of file QwCombinedPMT.cc.
References fSumADC, and VQwDataElement::GetElementName().
void QwCombinedPMT::DeaccumulateRunningSum | ( | QwCombinedPMT & | value, |
Int_t | ErrorMask = 0xFFFFFFF ) |
Definition at line 355 of file QwCombinedPMT.cc.
References fSumADC, and QwCombinedPMT().
void QwCombinedPMT::Difference | ( | const QwCombinedPMT & | value1, |
const QwCombinedPMT & | value2 ) |
Definition at line 345 of file QwCombinedPMT.cc.
References QwCombinedPMT().
void QwCombinedPMT::EncodeEventData | ( | std::vector< UInt_t > & | buffer | ) |
|
overridevirtual |
Fill the histograms for this data element.
Implements VQwDataElement.
Definition at line 430 of file QwCombinedPMT.cc.
References fSumADC, and VQwDataElement::GetElementName().
void QwCombinedPMT::FillTreeVector | ( | QwRootTreeBranchVector & | values | ) | const |
Definition at line 496 of file QwCombinedPMT.cc.
References fSumADC, and VQwDataElement::GetElementName().
|
inline |
Definition at line 60 of file QwCombinedPMT.h.
References fSumADC.
Referenced by VQwDetectorArray::PublishInternalValues().
std::vector< QwDBInterface > QwCombinedPMT::GetDBEntry | ( | ) |
std::vector< QwErrDBInterface > QwCombinedPMT::GetErrDBEntry | ( | ) |
|
inlineoverridevirtual |
return the error flag on this channel/device
Reimplemented from VQwDataElement.
Definition at line 93 of file QwCombinedPMT.h.
References fSumADC.
Referenced by UpdateErrorFlag().
|
inline |
Definition at line 97 of file QwCombinedPMT.h.
References fSumADC.
void QwCombinedPMT::InitializeChannel | ( | TString | name, |
TString | datatosave ) |
Initialize the combined PMT with a name and data-saving mode.
name | Detector name used for branches and histograms. |
datatosave | Storage mode (e.g., "raw" or "derived"). |
Definition at line 39 of file QwCombinedPMT.cc.
References fDataToSave, fSumADC, VQwDataElement::kDerived, VQwDataElement::kRaw, SetBlindability(), and VQwDataElement::SetElementName().
Referenced by QwCombinedPMT(), QwCombinedPMT(), and QwCombinedPMT().
void QwCombinedPMT::InitializeChannel | ( | TString | subsystemname, |
TString | name, | ||
TString | datatosave ) |
Initialize the combined PMT with subsystem and name.
subsystemname | Subsystem identifier. |
name | Detector name used for branches and histograms. |
datatosave | Storage mode (e.g., "raw" or "derived"). |
Definition at line 59 of file QwCombinedPMT.cc.
References fDataToSave, fSumADC, VQwDataElement::kDerived, VQwDataElement::kRaw, SetBlindability(), and VQwDataElement::SetElementName().
void QwCombinedPMT::LinkChannel | ( | TString | name | ) |
Link internal sum channel names to the given detector name.
Definition at line 75 of file QwCombinedPMT.cc.
References fSumADC, VQwDataElement::GetElementName(), and VQwDataElement::SetElementName().
void QwCombinedPMT::Normalize | ( | VQwDataElement * | denom | ) |
Definition at line 374 of file QwCombinedPMT.cc.
References fSumADC, and VQwDataElement::VQwDataElement().
QwCombinedPMT & QwCombinedPMT::operator+= | ( | const QwCombinedPMT & | value | ) |
Definition at line 302 of file QwCombinedPMT.cc.
References fElement, fSumADC, fWeights, VQwDataElement::GetElementName(), and QwCombinedPMT().
QwCombinedPMT & QwCombinedPMT::operator-= | ( | const QwCombinedPMT & | value | ) |
Definition at line 320 of file QwCombinedPMT.cc.
References fElement, fSumADC, fWeights, VQwDataElement::GetElementName(), and QwCombinedPMT().
QwCombinedPMT & QwCombinedPMT::operator= | ( | const QwCombinedPMT & | value | ) |
Definition at line 273 of file QwCombinedPMT.cc.
References fElement, fSumADC, fWeights, VQwDataElement::GetElementName(), and QwCombinedPMT().
void QwCombinedPMT::PrintErrorCounters | ( | ) |
|
overridevirtual |
Print error counters aggregated by the sum ADC.
Reimplemented from VQwDataElement.
Definition at line 197 of file QwCombinedPMT.cc.
References fSumADC.
|
overridevirtual |
Print multiple lines of information about this data element.
Reimplemented from VQwDataElement.
Definition at line 406 of file QwCombinedPMT.cc.
References fSumADC.
|
overridevirtual |
Print single line of value and error of this data element.
Reimplemented from VQwDataElement.
Definition at line 400 of file QwCombinedPMT.cc.
References fSumADC.
|
overridevirtual |
Process the CODA event buffer for this element.
Implements VQwDataElement.
Definition at line 267 of file QwCombinedPMT.cc.
References QwBPMStripline< T >::subelement.
void QwCombinedPMT::ProcessEvent | ( | ) |
Process event by computing the weighted average of members.
Definition at line 179 of file QwCombinedPMT.cc.
References CalculateSumAndAverage().
void QwCombinedPMT::RandomizeEventData | ( | int | helicity | ) |
void QwCombinedPMT::Ratio | ( | QwCombinedPMT & | numer, |
QwCombinedPMT & | denom ) |
Definition at line 360 of file QwCombinedPMT.cc.
References fSumADC, and QwCombinedPMT().
void QwCombinedPMT::Scale | ( | Double_t | factor | ) |
Definition at line 368 of file QwCombinedPMT.cc.
References fSumADC.
|
inline |
Definition at line 121 of file QwCombinedPMT.h.
References fSumADC.
Referenced by InitializeChannel(), InitializeChannel(), and VQwDetectorArray::LoadChannelMap().
void QwCombinedPMT::SetCalibrationFactor | ( | Double_t | calib | ) |
void QwCombinedPMT::SetDefaultSampleSize | ( | Int_t | sample_size | ) |
Set default sample size on the sum ADC.
Definition at line 190 of file QwCombinedPMT.cc.
References fSumADC.
|
inline |
Definition at line 89 of file QwCombinedPMT.h.
References bEVENTCUTMODE, and fSumADC.
void QwCombinedPMT::SetEventData | ( | Double_t * | block, |
UInt_t | sequencenumber ) |
Set the block data for the current event sequence.
Definition at line 102 of file QwCombinedPMT.cc.
References fSumADC.
void QwCombinedPMT::SetHardwareSum | ( | Double_t | hwsum, |
UInt_t | sequencenumber = 0 ) |
Set the hardware-level sum for a sequence (unused for combo).
Definition at line 96 of file QwCombinedPMT.cc.
|
inline |
Definition at line 122 of file QwCombinedPMT.h.
References fSumADC.
Referenced by VQwDetectorArray::LoadChannelMap().
void QwCombinedPMT::SetPedestal | ( | Double_t | ped | ) |
void QwCombinedPMT::SetRandomEventAsymmetry | ( | Double_t | asymmetry | ) |
void QwCombinedPMT::SetRandomEventParameters | ( | Double_t | mean, |
Double_t | sigma ) |
void QwCombinedPMT::SetSingleEventCuts | ( | UInt_t | errorflag, |
Double_t | LL = 0, | ||
Double_t | UL = 0, | ||
Double_t | stability = 0, | ||
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.
Configure detailed single-event cuts forwarded to the sum ADC.
Definition at line 169 of file QwCombinedPMT.cc.
References QwLog::endl(), fSumADC, and QwMessage.
void QwCombinedPMT::Sum | ( | const QwCombinedPMT & | value1, |
const QwCombinedPMT & | value2 ) |
Definition at line 340 of file QwCombinedPMT.cc.
References QwCombinedPMT().
|
overridevirtual |
Update the sum ADC error flag from member PMTs.
Reimplemented from VQwDataElement.
Definition at line 231 of file QwCombinedPMT.cc.
References fElement, fSumADC, and GetEventcutErrorFlag().
void QwCombinedPMT::UpdateErrorFlag | ( | const QwCombinedPMT * | ev_error | ) |
Merge error flags from a reference combined PMT.
Definition at line 241 of file QwCombinedPMT.cc.
References fSumADC, VQwDataElement::GetElementName(), and QwCombinedPMT().
|
staticprivate |
If this set to kFALSE then Event cuts do not depend on HW checks. This is set externally through the qweak_beamline_eventcuts.map
Definition at line 177 of file QwCombinedPMT.h.
|
private |
keep the device HW status using a unique code from the QwMollerADC_Channel::fDeviceErrorCode
Definition at line 173 of file QwCombinedPMT.h.
Referenced by SetEventCutMode().
|
private |
Definition at line 154 of file QwCombinedPMT.h.
Referenced by QwCombinedPMT().
|
private |
Definition at line 153 of file QwCombinedPMT.h.
Referenced by InitializeChannel(), and InitializeChannel().
|
private |
Definition at line 166 of file QwCombinedPMT.h.
|
private |
sets the event cut level for the device fDevice_flag=1 Event cuts & HW check, fDevice_flag=0 HW check, fDevice_flag=-1 no check
Definition at line 170 of file QwCombinedPMT.h.
|
private |
used to validate sequence number in the IsGoodEvent()
Definition at line 160 of file QwCombinedPMT.h.
Referenced by Add(), CalculateSumAndAverage(), operator+=(), operator-=(), operator=(), QwCombinedPMT(), and UpdateErrorFlag().
|
private |
Definition at line 158 of file QwCombinedPMT.h.
|
private |
Definition at line 155 of file QwCombinedPMT.h.
|
private |
Definition at line 156 of file QwCombinedPMT.h.
|
private |
Definition at line 163 of file QwCombinedPMT.h.
Referenced by AccumulateRunningSum(), ApplySingleEventCuts(), Blind(), Blind(), CalculateRunningAverage(), CalculateSumAndAverage(), CheckForBurpFail(), ClearEventData(), ConstructBranch(), ConstructBranch(), ConstructBranchAndVector(), ConstructHistograms(), DeaccumulateRunningSum(), FillHistograms(), FillTreeVector(), GetChannel(), GetEventcutErrorFlag(), IncrementErrorCounters(), InitializeChannel(), InitializeChannel(), LinkChannel(), Normalize(), operator+=(), operator-=(), operator=(), PrintErrorCounters(), PrintInfo(), PrintValue(), QwCombinedPMT(), Ratio(), Scale(), SetBlindability(), SetDefaultSampleSize(), SetEventCutMode(), SetEventData(), SetNormalizability(), SetSingleEventCuts(), UpdateErrorFlag(), and UpdateErrorFlag().
|
private |
Definition at line 155 of file QwCombinedPMT.h.
|
private |
Definition at line 161 of file QwCombinedPMT.h.
Referenced by Add(), CalculateSumAndAverage(), operator+=(), operator-=(), operator=(), and QwCombinedPMT().