JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwSubsystemArrayParity Class Reference

Subsystem array container specialized for parity analysis with asymmetry calculations. More...

#include <QwSubsystemArrayParity.h>

+ Inheritance diagram for QwSubsystemArrayParity:
+ Collaboration diagram for QwSubsystemArrayParity:

Public Member Functions

 QwSubsystemArrayParity (QwOptions &options)
 Constructor with options.
 
 QwSubsystemArrayParity (const QwSubsystemArrayParity &source)
 Copy constructor by reference.
 
 ~QwSubsystemArrayParity () override
 Default destructor.
 
VQwSubsystemParityGetSubsystemByName (const TString &name) override
 Get the subsystem with the specified name.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
 Construct a branch and vector for this subsystem with a prefix.
 
void FillTreeVector (QwRootTreeBranchVector &values) const
 Fill the vector for this subsystem.
 
void FillHistograms ()
 Fill the histograms for this subsystem.
 
void FillDB_MPS (QwParityDB *db, TString type)
 Fill the database with MPS-based variables Note that most subsystems don't need to do this.
 
void FillDB (QwParityDB *db, TString type)
 Fill the database.
 
void FillErrDB (QwParityDB *db, TString type)
 
QwSubsystemArrayParityoperator= (const QwSubsystemArrayParity &value)
 Assignment operator.
 
QwSubsystemArrayParityoperator+= (const QwSubsystemArrayParity &value)
 Addition-assignment operator.
 
QwSubsystemArrayParityoperator-= (const QwSubsystemArrayParity &value)
 Subtraction-assignment operator.
 
void Sum (const QwSubsystemArrayParity &value1, const QwSubsystemArrayParity &value2)
 Sum of two subsystem arrays.
 
void Difference (const QwSubsystemArrayParity &value1, const QwSubsystemArrayParity &value2)
 Difference of two subsystem arrays.
 
void Ratio (const QwSubsystemArrayParity &numer, const QwSubsystemArrayParity &denom)
 Ratio of two subsystem arrays.
 
void Scale (Double_t factor)
 Scale this subsystem array.
 
void AccumulateRunningSum (const QwSubsystemArrayParity &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
 Update the running sums for devices accumulated for the global error non-zero events/patterns.
 
void AccumulateAllRunningSum (const QwSubsystemArrayParity &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
 Update the running sums for devices check only the error flags at the channel level. Only used for stability checks.
 
void DeaccumulateRunningSum (const QwSubsystemArrayParity &value, Int_t ErrorMask=0xFFFFFFF)
 Remove the entry value from the running sums for devices.
 
void CalculateRunningAverage ()
 Calculate the average for all good events.
 
void Blind (const QwBlinder *blinder)
 Blind the asymmetry of this subsystem.
 
void UnBlind (const QwBlinder *)
 Unblind the asymmetry of this subsystem.
 
void Blind (const QwBlinder *blinder, const QwSubsystemArrayParity &yield)
 Blind the difference of this subsystem.
 
void UnBlind (const QwBlinder *, const QwSubsystemArrayParity &)
 Unblind the difference of this subsystem.
 
Bool_t ApplySingleEventCuts ()
 Apply the single event cuts.
 
void IncrementErrorCounters ()
 Update the data elements' error counters based on their internal error flags.
 
Bool_t CheckForBurpFail (QwSubsystemArrayParity &event)
 
Bool_t CheckBadEventRange ()
 
void PrintErrorCounters () const
 Report the number of events failed due to HW and event cut failures.
 
UInt_t GetEventcutErrorFlag () const
 Return the error flag to the main routine.
 
const UInt_t * GetEventcutErrorFlagPointer () const
 
void UpdateErrorFlag ()
 Update the error flag internally from all the subsystems.
 
void UpdateErrorFlag (const QwSubsystemArrayParity &ev_error)
 update the error flag for each channel in the subsystem array with the corresponding value in the ev_error subsystem array
 
void UpdateErrorFlag (UInt_t errflag)
 
void PrintValue () const
 Print value of all channels.
 
void WritePromptSummary (QwPromptSummary *ps, TString type)
 
virtual Bool_t CheckForEndOfBurst () const
 
void LoadMockDataParameters (std::string mapfile)
 
- Public Member Functions inherited from QwSubsystemArray
 QwSubsystemArray (QwOptions &options, CanContainFn myCanContain)
 Constructor with options.
 
 QwSubsystemArray (const QwSubsystemArray &source)
 Copy constructor by reference.
 
 ~QwSubsystemArray () override
 Virtual destructor.
 
QwSubsystemArrayoperator= (const QwSubsystemArray &value)
 Assignment operator.
 
void SetCodaRunNumber (UInt_t runnum)
 Set the internal record of the CODA run number.
 
void SetCodaSegmentNumber (UInt_t segnum)
 Set the internal record of the CODA segment number.
 
void SetCodaEventNumber (UInt_t evtnum)
 Set the internal record of the CODA event number.
 
void SetCodaEventType (UInt_t evttype)
 Set the internal record of the CODA event type.
 
UInt_t GetCodaRunNumber () const
 Get the internal record of the CODA run number.
 
UInt_t GetCodaSegmentNumber () const
 Get the internal record of the CODA segment number.
 
UInt_t GetCodaEventNumber () const
 Get the internal record of the CODA event number.
 
UInt_t GetCodaEventType () const
 Get the internal record of the CODA event type.
 
void SetCleanParameters (Double_t cleanparameter[3])
 Set the internal record of the CODA event number.
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask.
 
UInt_t GetEventTypeMask () const
 Get event type mask.
 
UInt_t UpdateEventTypeMask ()
 Update the event type mask from the subsystems.
 
void SetDataLoaded (const Bool_t flag)
 Set data loaded flag.
 
Bool_t HasDataLoaded () const
 Get data loaded flag.
 
void ProcessOptionsToplevel (QwOptions &options)
 Process configuration options for the subsystem array itself.
 
void ProcessOptionsSubsystems (QwOptions &options)
 Process configuration options for all subsystems in the array.
 
void ProcessOptions (QwOptions &options)
 Process configuration options (default behavior)
 
void LoadAllEventRanges (QwOptions &options)
 
void push_back (VQwSubsystem *subsys)
 Add the subsystem to this array.
 
virtual std::vector< VQwSubsystem * > GetSubsystemByType (const std::string &type)
 Get the list of subsystems of the specified type.
 
void ClearEventData ()
 
Int_t ProcessConfigurationBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)
 Process the event buffer for configuration events.
 
Int_t ProcessEvBuffer (const UInt_t event_type, const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words)
 Process the event buffer for events.
 
void GetROCIDList (std::vector< ROCID_t > &list)
 Get the ROCID list.
 
void ProcessEvent ()
 Process the decoded data in this event.
 
void AtEndOfEventLoop ()
 Perform actions at the end of the event loop.
 
void PrintParamFileList () const
 Print list of parameter files.
 
TList * GetParamFileNameList (TString name) const
 Get list of parameter files.
 
void ConstructObjects ()
 Construct the objects for this subsystem.
 
void ConstructObjects (TDirectory *folder)
 Construct the objects for this subsystem in a folder.
 
void ConstructObjects (TDirectory *folder, TString &prefix)
 Construct the objects for this subsystem in a folder with a prefix.
 
void ConstructHistograms ()
 Construct the histograms for this subsystem.
 
void ConstructHistograms (TDirectory *folder)
 Construct the histograms for this subsystem in a folder.
 
void ConstructHistograms (TDirectory *folder, TString &prefix)
 Construct the histograms for this subsystem in a folder with a prefix.
 
void FillHistograms ()
 Fill the histograms for this subsystem.
 
void ShareHistograms (const QwSubsystemArray &source)
 Share the histograms with another subsystem.
 
void ConstructBranchAndVector (TTree *tree, QwRootTreeBranchVector &values)
 Construct the tree and vector for this subsystem.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
 Construct a branch and vector for this subsystem with a prefix.
 
void ConstructBranch (TTree *tree, TString &prefix)
 Construct a branch for this subsystem with a prefix.
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file)
 Construct a branch for this subsystem with a prefix after tree leave trimming.
 
void FillTreeVector (QwRootTreeBranchVector &values) const
 Fill the vector for this subsystem.
 
void ConstructTree ()
 Construct the tree for this subsystem.
 
void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder.
 
void ConstructTree (TDirectory *folder, TString &prefix)
 Construct the tree for this subsystem in a folder with a prefix.
 
void FillTree ()
 Fill the tree for this subsystem.
 
void DeleteTree ()
 Delete the tree for this subsystem.
 
void PrintInfo () const
 Print some information about the subsystem.
 
void push_back (std::shared_ptr< VQwSubsystem > subsys)
 
void GetMarkerWordList (const ROCID_t roc_id, const BankID_t bank_id, std::vector< UInt_t > &marker) const
 
void RandomizeEventData (int helicity=0, double time=0.0)
 Randomize the data in this event.
 
void EncodeEventData (std::vector< UInt_t > &buffer)
 Encode the data in this event.
 
double GetWindowPeriod ()
 
- Public Member Functions inherited from MQwPublishable< QwSubsystemArray, VQwSubsystem >
 MQwPublishable ()
 Default constructor Initializes empty variable publishing maps.
 
 MQwPublishable (const MQwPublishable &source)
 Copy constructor Creates a new container with cleared publishing maps (variables are not copied).
 
virtual ~MQwPublishable ()
 Virtual destructor.
 
Bool_t RequestExternalValue (const TString &name, VQwHardwareChannel *value) const
 Retrieve a variable value from external sources by copying Searches for the named variable in external subsystem arrays and copies its value into the provided data element.
 
const VQwHardwareChannelRequestExternalPointer (const TString &name) const
 Retrieve a direct pointer to an external variable Searches for the named variable in external subsystem arrays and returns a direct pointer to the data element.
 
virtual const VQwHardwareChannelReturnInternalValue (const TString &name) const
 Retrieve an internal variable by name (pointer version) Searches for the named variable among published internal variables and returns a direct pointer to the data element.
 
Bool_t ReturnInternalValue (const TString &name, VQwHardwareChannel *value) const
 Retrieve an internal variable by name (copy version) Searches for the named variable among published internal variables and copies its value into the provided data element.
 
void ListPublishedValues () const
 List all published variables with descriptions Prints a summary of all currently published variables and their descriptions to the logging output for debugging and inspection purposes.
 
Bool_t PublishInternalValue (const TString name, const TString desc, const VQwSubsystem *subsys, const VQwHardwareChannel *element)
 Publish an internal variable from a subsystem Registers a variable from one of the contained subsystems in the publishing framework, making it available for external access by name.
 

Static Protected Member Functions

static Bool_t CanContain (VQwSubsystem *subsys)
 Test whether this subsystem array can contain a particular subsystem.
 
static Bool_t CanContain (VQwSubsystem *subsys)
 Test whether this subsystem array can contain a particular subsystem.
 

Protected Attributes

UInt_t fErrorFlag
 
Int_t fErrorFlagTreeIndex
 
size_t fTreeArrayIndex
 
UInt_t fCodaRunNumber
 Index of this data element in root tree.
 
UInt_t fCodaSegmentNumber
 CODA segment number as provided by QwEventBuffer.
 
UInt_t fCodaEventNumber
 CODA event number as provided by QwEventBuffer.
 
UInt_t fCodaEventType
 CODA event type as provided by QwEventBuffer.
 
Double_t fCleanParameter [3]
 
UInt_t fEventTypeMask
 Mask of event types.
 
Bool_t fHasDataLoaded
 Has this array gotten data to be processed?
 
CanContainFn fnCanContain
 Function to determine which subsystems we can accept.
 
std::vector< std::pair< UInt_t, UInt_t > > fBadEventRange
 
double fWindowPeriod
 

Private Member Functions

 QwSubsystemArrayParity ()
 Private default constructor.
 

Friends

class VQwDataHandler
 
class QwAlarmHandler
 
class QwCombiner
 
class QwCorrelator
 
class LRBCorrector
 
class QwExtractor
 

Additional Inherited Members

- Public Types inherited from QwSubsystemArray
typedef Bool_t(* CanContainFn) (VQwSubsystem *)
 
- Static Public Member Functions inherited from QwSubsystemArray
static void DefineOptions (QwOptions &options)
 Define configuration options for global array.
 
- Data Fields inherited from MQwPublishable< QwSubsystemArray, VQwSubsystem >
std::vector< std::vector< TString > > fPublishList
 
void LoadSubsystemsFromParameterFile (QwParameterFile &detectors)
 

Detailed Description

Subsystem array container specialized for parity analysis with asymmetry calculations.

Extends QwSubsystemArray to provide parity-specific operations such as asymmetry formation, helicity-based accumulation, blinding support, and database output for parity measurements. Manages collections of VQwSubsystemParity objects with coordinated event processing.

Definition at line 36 of file QwSubsystemArrayParity.h.

Constructor & Destructor Documentation

◆ QwSubsystemArrayParity() [1/3]

QwSubsystemArrayParity::QwSubsystemArrayParity ( )
private

Private default constructor.

Referenced by AccumulateAllRunningSum(), AccumulateRunningSum(), Blind(), CheckForBurpFail(), DeaccumulateRunningSum(), Difference(), operator+=(), operator-=(), operator=(), QwExtractor, QwSubsystemArrayParity(), Ratio(), Sum(), UnBlind(), and UpdateErrorFlag().

+ Here is the caller graph for this function:

◆ QwSubsystemArrayParity() [2/3]

QwSubsystemArrayParity::QwSubsystemArrayParity ( QwOptions & options)

Constructor with options.

Default constructor.

Definition at line 20 of file QwSubsystemArrayParity.cc.

22 fErrorFlag(0),
24{
25
26}
QwSubsystemArray()
Private default constructor.
static Bool_t CanContain(VQwSubsystem *subsys)
Test whether this subsystem array can contain a particular subsystem.

References CanContain(), fErrorFlag, fErrorFlagTreeIndex, and QwSubsystemArray::QwSubsystemArray().

+ Here is the call graph for this function:

◆ QwSubsystemArrayParity() [3/3]

QwSubsystemArrayParity::QwSubsystemArrayParity ( const QwSubsystemArrayParity & source)

Copy constructor by reference.

Copy constructor.

Definition at line 31 of file QwSubsystemArrayParity.cc.

32: QwSubsystemArray(source)
33{
34 // Copy error flags
35 fErrorFlag = source.fErrorFlag;
37}

References fErrorFlag, fErrorFlagTreeIndex, QwSubsystemArray::QwSubsystemArray(), and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ ~QwSubsystemArrayParity()

QwSubsystemArrayParity::~QwSubsystemArrayParity ( )
override

Default destructor.

Destructor.

Definition at line 42 of file QwSubsystemArrayParity.cc.

43{
44 // nothing
45}

Member Function Documentation

◆ AccumulateAllRunningSum()

void QwSubsystemArrayParity::AccumulateAllRunningSum ( const QwSubsystemArrayParity & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )

Update the running sums for devices check only the error flags at the channel level. Only used for stability checks.

Definition at line 300 of file QwSubsystemArrayParity.cc.

301{
302 if (!value.empty()) {
303 if (this->size() == value.size()) {
304 //if (value.GetEventcutErrorFlag()==0){//do running sum only if error flag is zero. This way will prevent any Beam Trip(in ev mode 3) related events going into the running sum.
305 for (size_t i = 0; i < value.size(); i++) {
306 if (value.at(i)==NULL || this->at(i)==NULL) {
307 // Either the value or the destination subsystem
308 // are null
309 } else {
310 VQwSubsystemParity *ptr1 =
311 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
312 VQwSubsystem *ptr2 = value.at(i).get();
313 if (typeid(*ptr1) == typeid(*ptr2)) {
314 ptr1->AccumulateRunningSum(ptr2, count, ErrorMask);
315 } else {
316 QwError << "QwSubsystemArrayParity::AccumulateRunningSum here where types don't match" << QwLog::endl;
317 QwError << " typeid(ptr1)=" << typeid(ptr1).name()
318 << " but typeid(value.at(i)))=" << typeid(value.at(i)).name()
319 << QwLog::endl;
320 // Subsystems don't match
321 }
322 }
323 }
324 //}//else if ((value.fErrorFlag& 512)==512){
325 //QwMessage << " AccumulateRunningSum "<<(value.fErrorFlag & 0x2FF)<<" - "<<value.GetCodaEventNumber()<< QwLog::endl;
326 //}
327 } else {
328 // Array sizes don't match
329
330 }
331 } else {
332 // The value is empty
333 }
334}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
virtual void AccumulateRunningSum(VQwSubsystem *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)=0
Update the running sums for devices.

References VQwSubsystemParity::AccumulateRunningSum(), QwLog::endl(), QwError, and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ AccumulateRunningSum()

void QwSubsystemArrayParity::AccumulateRunningSum ( const QwSubsystemArrayParity & value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )

Update the running sums for devices accumulated for the global error non-zero events/patterns.

Definition at line 263 of file QwSubsystemArrayParity.cc.

264{
265 if (!value.empty()) {
266 if (this->size() == value.size()) {
267 if (value.GetEventcutErrorFlag()==0){//do running sum only if error flag is zero. This way will prevent any Beam Trip(in ev mode 3) related events going into the running sum.
269 std::min(fCodaEventNumber, value.fCodaEventNumber);
270 for (size_t i = 0; i < value.size(); i++) {
271 if (value.at(i)==NULL || this->at(i)==NULL) {
272 // Either the value or the destination subsystem
273 // are null
274 } else {
275 VQwSubsystemParity *ptr1 =
276 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
277 VQwSubsystem *ptr2 = value.at(i).get();
278 if (typeid(*ptr1) == typeid(*ptr2)) {
279 ptr1->AccumulateRunningSum(ptr2, count, ErrorMask);
280 } else {
281 QwError << "QwSubsystemArrayParity::AccumulateRunningSum here where types don't match" << QwLog::endl;
282 QwError << " typeid(ptr1)=" << typeid(ptr1).name()
283 << " but typeid(value.at(i)))=" << typeid(value.at(i)).name()
284 << QwLog::endl;
285 // Subsystems don't match
286 }
287 }
288 }
289 }
290
291 } else {
292 // Array sizes don't match
293
294 }
295 } else {
296 // The value is empty
297 }
298}
UInt_t fCodaEventNumber
CODA event number as provided by QwEventBuffer.
UInt_t GetEventcutErrorFlag() const
Return the error flag to the main routine.

References VQwSubsystemParity::AccumulateRunningSum(), QwLog::endl(), QwSubsystemArray::fCodaEventNumber, GetEventcutErrorFlag(), QwError, and QwSubsystemArrayParity().

Referenced by main().

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

◆ ApplySingleEventCuts()

Bool_t QwSubsystemArrayParity::ApplySingleEventCuts ( )

Apply the single event cuts.

Definition at line 465 of file QwSubsystemArrayParity.cc.

465 {
466 Int_t CountFalse;
467 Bool_t status;
468 UInt_t ErrorFlag;
469 fErrorFlag=0; // Testing if event number is within bad Event Range cut
470 if( CheckBadEventRange() )
472
473 VQwSubsystemParity *subsys_parity = nullptr;
474 CountFalse=0;
475 if (!empty()){
476 for (iterator subsys = begin(); subsys != end(); ++subsys){
477 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
478 status=subsys_parity->ApplySingleEventCuts();
479 ErrorFlag = subsys_parity->GetEventcutErrorFlag();
480 if ((ErrorFlag & kEventCutMode3)==kEventCutMode3)//we only care about the event cut flag in event cut mode 3
481 fErrorFlag |= ErrorFlag;
482 if (!status)
483 {
484 if ((ErrorFlag&kGlobalCut)==kGlobalCut){
485 CountFalse++;
486 fErrorFlag |= ErrorFlag; //we need the error code for failed events in event mode 2 for beam trips and etc.
487 }
488 }
489
490
491 }
492 }
493 if (CountFalse > 0)
494 status = kFALSE;
495 else
496 status = kTRUE;
497
498 // Propagate all error codes to derived objects in the subsystems.
500
501 return status;
502}
static const UInt_t kBadEventRangeError
Definition QwTypes.h:185
static const UInt_t kGlobalCut
Definition QwTypes.h:182
static const UInt_t kEventCutMode3
Definition QwTypes.h:174
void UpdateErrorFlag()
Update the error flag internally from all the subsystems.
virtual UInt_t GetEventcutErrorFlag()=0
Return the error flag to the top level routines related to stability checks and ErrorFlag updates.
virtual Bool_t ApplySingleEventCuts()=0
Apply the single event cuts.

References VQwSubsystemParity::ApplySingleEventCuts(), CheckBadEventRange(), fErrorFlag, VQwSubsystemParity::GetEventcutErrorFlag(), kBadEventRangeError, kEventCutMode3, kGlobalCut, and UpdateErrorFlag().

Referenced by main().

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

◆ Blind() [1/2]

void QwSubsystemArrayParity::Blind ( const QwBlinder * blinder)

Blind the asymmetry of this subsystem.

Definition at line 378 of file QwSubsystemArrayParity.cc.

379{
380 // Loop over subsystem array
381 for (size_t i = 0; i < this->size(); i++) {
382 // Cast into parity subsystems
383 VQwSubsystemParity* subsys = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
384
385 // Check for null pointers
386 if (this->at(i) == 0) {
387 QwError << "QwSubsystemArrayParity::Blind: "
388 << "parity subsystem null pointer!" << QwLog::endl;
389 return;
390 }
391
392 // Apply blinding
393 subsys->Blind(blinder);
394 }
395}
virtual void Blind(const QwBlinder *)
Blind the asymmetry of this subsystem.

References VQwSubsystemParity::Blind(), QwLog::endl(), and QwError.

Referenced by QwBlinder::Blind(), QwBlinder::Blind(), QwBlinder::BlindPair(), and QwBlinder::BlindPair().

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

◆ Blind() [2/2]

void QwSubsystemArrayParity::Blind ( const QwBlinder * blinder,
const QwSubsystemArrayParity & yield )

Blind the difference of this subsystem.

Definition at line 397 of file QwSubsystemArrayParity.cc.

398{
399 // Check for array size
400 if (this->size() != yield.size()) {
401 QwError << "QwSubsystemArrayParity::Blind: "
402 << "diff and yield array dimension mismatch!" << QwLog::endl;
403 return;
404 }
405
406 // Loop over subsystem array
407 for (size_t i = 0; i < this->size(); i++) {
408 // Cast into parity subsystems
409 VQwSubsystemParity* subsys_diff = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
410 VQwSubsystemParity* subsys_yield = dynamic_cast<VQwSubsystemParity*>(yield.at(i).get());
411
412 // Check for null pointers
413 if (subsys_diff == 0 || subsys_yield == 0) {
414 QwError << "QwSubsystemArrayParity::Blind: "
415 << "diff or yield parity subsystem null pointer!" << QwLog::endl;
416 return;
417 }
418
419 // Apply blinding
420 subsys_diff->Blind(blinder, subsys_yield);
421 }
422}

References VQwSubsystemParity::Blind(), QwLog::endl(), QwError, and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ CalculateRunningAverage()

void QwSubsystemArrayParity::CalculateRunningAverage ( )

Calculate the average for all good events.

Definition at line 253 of file QwSubsystemArrayParity.cc.

254{
255 for (iterator subsys = begin(); subsys != end(); ++subsys) {
256 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
257 subsys_parity->CalculateRunningAverage();
258 }
259}
virtual void CalculateRunningAverage()=0
Calculate the average for all good events.

References VQwSubsystemParity::CalculateRunningAverage().

Referenced by main().

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

◆ CanContain()

static Bool_t QwSubsystemArrayParity::CanContain ( VQwSubsystem * subsys)
inlinestaticprotected

Test whether this subsystem array can contain a particular subsystem.

Definition at line 151 of file QwSubsystemArrayParity.h.

151 {
152 return (dynamic_cast<VQwSubsystemParity*>(subsys) != 0);
153 };

Referenced by QwSubsystemArrayParity().

+ Here is the caller graph for this function:

◆ CheckBadEventRange()

Bool_t QwSubsystemArrayParity::CheckBadEventRange ( )

Definition at line 611 of file QwSubsystemArrayParity.cc.

611 {
612 std::vector< std::pair<UInt_t, UInt_t> >::iterator itber = fBadEventRange.begin(); // ber = bad event range
613 while(itber!=fBadEventRange.end()){
614 if( fCodaEventNumber >= (*itber).first
615 && fCodaEventNumber <= (*itber).second){
616 return kTRUE;
617 }
618 itber++;
619 }
620 return kFALSE;
621}
std::vector< std::pair< UInt_t, UInt_t > > fBadEventRange

References QwSubsystemArray::fBadEventRange, and QwSubsystemArray::fCodaEventNumber.

Referenced by ApplySingleEventCuts(), and UpdateErrorFlag().

+ Here is the caller graph for this function:

◆ CheckForBurpFail()

Bool_t QwSubsystemArrayParity::CheckForBurpFail ( QwSubsystemArrayParity & event)

Definition at line 517 of file QwSubsystemArrayParity.cc.

518{
519 Bool_t burpstatus = kFALSE;
520 if (!event.empty() && this->size() == event.size()){
521 for(size_t i=0;i<event.size();i++){
522 if (event.at(i)!=NULL && this->at(i)!=NULL){
523 VQwSubsystemParity *ptr1 = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
524 VQwSubsystem *ptr2 = event.at(i).get();
525 if (typeid(*ptr1)==typeid(*ptr2)){
526 //*(ptr1) = event.at(i).get();//when =operator is used
527 //pass the correct subsystem to update the errorflags at subsystem to devices to channel levels
528 //wError << "************* test " << typeid(*ptr1).name() << "*****************" << QwLog::endl;
529 burpstatus |= ptr1->CheckForBurpFail(ptr2);
530 } else {
531 // Subsystems don't match
532 QwError << " QwSubsystemArrayParity::CheckForBurpFail types do not mach" << QwLog::endl;
533 QwError << " typeid(ptr1)=" << typeid(*ptr1).name()
534 << " but typeid(*(event.at(i).get()))=" << typeid(*ptr2).name()
535 << QwLog::endl;
536 }
537 }
538 }
539 } else {
540 // The source is empty
541 }
542 return burpstatus;
543}
virtual Bool_t CheckForBurpFail(const VQwSubsystem *subsys)=0
Report the number of events failed due to HW and event cut failures.

References VQwSubsystemParity::CheckForBurpFail(), QwLog::endl(), QwError, and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ CheckForEndOfBurst()

Bool_t QwSubsystemArrayParity::CheckForEndOfBurst ( ) const
virtual

Definition at line 241 of file QwSubsystemArrayParity.cc.

242{
243 Bool_t status = kFALSE;
244 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
245 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
246 status |= subsys_parity->CheckForEndOfBurst();
247 }
248 return status;
249};
virtual Bool_t CheckForEndOfBurst() const

References VQwSubsystemParity::CheckForEndOfBurst().

+ Here is the call graph for this function:

◆ ConstructBranchAndVector()

void QwSubsystemArrayParity::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
QwRootTreeBranchVector & values )

Construct a branch and vector for this subsystem with a prefix.

Definition at line 623 of file QwSubsystemArrayParity.cc.

623 {
624 QwSubsystemArray::ConstructBranchAndVector(tree, prefix, values);
625 if (prefix.Contains("yield_") || prefix==""){
626 values.push_back("ErrorFlag", 'D');
627 fErrorFlagTreeIndex = values.size()-1;
628 tree->Branch("ErrorFlag", &(values.back<Double_t>()), "ErrorFlag/D");
629 } else {
631 }
632}
size_type size() const noexcept
Definition QwRootFile.h:81
void push_back(const std::string &name, const char type='D')
Definition QwRootFile.h:195
void ConstructBranchAndVector(TTree *tree, QwRootTreeBranchVector &values)
Construct the tree and vector for this subsystem.

References QwRootTreeBranchVector::back(), QwSubsystemArray::ConstructBranchAndVector(), fErrorFlagTreeIndex, QwRootTreeBranchVector::push_back(), and QwRootTreeBranchVector::size().

+ Here is the call graph for this function:

◆ DeaccumulateRunningSum()

void QwSubsystemArrayParity::DeaccumulateRunningSum ( const QwSubsystemArrayParity & value,
Int_t ErrorMask = 0xFFFFFFF )

Remove the entry value from the running sums for devices.

Definition at line 337 of file QwSubsystemArrayParity.cc.

338{
339 //Bool_t berror=kTRUE;//only needed for deaccumulation (stability check purposes)
340 //if (value.fErrorFlag>0){//check the error is global
341 //berror=((value.fErrorFlag & 0x2FF) == 0); //The operation value.fErrorFlag & 0x2FF clear everything else but the HW errors + event cut errors + blinder error
342 //}
343 if (!value.empty()) {
344 if (this->size() == value.size()) {
345 //if (value.GetEventcutErrorFlag()==0){//do derunningsum only if error flag is zero.
346 for (size_t i = 0; i < value.size(); i++) {
347 if (value.at(i)==NULL || this->at(i)==NULL) {
348 // Either the value or the destination subsystem
349 // are null
350 } else {
351 VQwSubsystemParity *ptr1 =
352 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
353 VQwSubsystem *ptr2 = value.at(i).get();
354 if (typeid(*ptr1) == typeid(*ptr2)) {
355 ptr1->DeaccumulateRunningSum(ptr2, ErrorMask);
356 } else {
357 QwError << "QwSubsystemArrayParity::AccumulateRunningSum here where types don't match" << QwLog::endl;
358 QwError << " typeid(ptr1)=" << typeid(ptr1).name()
359 << " but typeid(value.at(i)))=" << typeid(value.at(i)).name()
360 << QwLog::endl;
361 // Subsystems don't match
362 }
363 }
364 }
365 //}//else if ((value.fErrorFlag & 268435968)==268435968){
366 //QwMessage << " DeaccumulateRunningSum "<<(value.fErrorFlag & 0x2FF)<<" - "<<value.GetCodaEventNumber()<< QwLog::endl;
367 //}
368 } else {
369 // Array sizes don't match
370
371 }
372 } else {
373 // The value is empty
374 }
375}
virtual void DeaccumulateRunningSum(VQwSubsystem *value, Int_t ErrorMask=0xFFFFFFF)=0
remove one entry from the running sums for devices

References VQwSubsystemParity::DeaccumulateRunningSum(), QwLog::endl(), QwError, and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ Difference()

void QwSubsystemArrayParity::Difference ( const QwSubsystemArrayParity & value1,
const QwSubsystemArrayParity & value2 )

Difference of two subsystem arrays.

Difference of two subsystem arrays

Parameters
value1First subsystem array
value2Second subsystem array

Definition at line 202 of file QwSubsystemArrayParity.cc.

205{
206
207 if (!value1.empty()&& !value2.empty()){
208 *(this) = value1;
209 *(this) -= value2;
210 } else {
211 // The source is empty
212 }
213}

References QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ FillDB()

void QwSubsystemArrayParity::FillDB ( QwParityDB * db,
TString type )

Fill the database.

Definition at line 64 of file QwSubsystemArrayParity.cc.

65{
66 for (iterator subsys = begin(); subsys != end(); ++subsys) {
67 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
68 subsys_parity->FillDB(db, type);
69 }
70}
virtual void FillDB(QwParityDB *, TString)
Fill the database.

References VQwSubsystemParity::FillDB().

+ Here is the call graph for this function:

◆ FillDB_MPS()

void QwSubsystemArrayParity::FillDB_MPS ( QwParityDB * db,
TString type )

Fill the database with MPS-based variables Note that most subsystems don't need to do this.

Definition at line 56 of file QwSubsystemArrayParity.cc.

57{
58 for (iterator subsys = begin(); subsys != end(); ++subsys) {
59 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
60 subsys_parity->FillDB_MPS(db, type);
61 }
62}
virtual void FillDB_MPS(QwParityDB *, TString)
Fill the database with MPS-based variables Note that most subsystems don't need to do this.

References VQwSubsystemParity::FillDB_MPS().

Referenced by main().

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

◆ FillErrDB()

void QwSubsystemArrayParity::FillErrDB ( QwParityDB * db,
TString type )

Definition at line 72 of file QwSubsystemArrayParity.cc.

73{
74 for (iterator subsys = begin(); subsys != end(); ++subsys) {
75 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
76 subsys_parity->FillErrDB(db, type);
77 }
78}
virtual void FillErrDB(QwParityDB *, TString)

References VQwSubsystemParity::FillErrDB().

+ Here is the call graph for this function:

◆ FillHistograms()

void QwSubsystemArrayParity::FillHistograms ( )

Fill the histograms for this subsystem.

Definition at line 644 of file QwSubsystemArrayParity.cc.

645{
646 if (GetEventcutErrorFlag()==0)
648}
void FillHistograms()
Fill the histograms for this subsystem.

References QwSubsystemArray::FillHistograms(), and GetEventcutErrorFlag().

+ Here is the call graph for this function:

◆ FillTreeVector()

void QwSubsystemArrayParity::FillTreeVector ( QwRootTreeBranchVector & values) const

Fill the vector for this subsystem.

Definition at line 634 of file QwSubsystemArrayParity.cc.

635{
637 if (fErrorFlagTreeIndex>=0 && fErrorFlagTreeIndex<static_cast<int>(values.size())){
638 values.SetValue(fErrorFlagTreeIndex, static_cast<double>(fErrorFlag));
639 }
640}
void SetValue(size_type index, Double_t val)
Definition QwRootFile.h:108
void FillTreeVector(QwRootTreeBranchVector &values) const
Fill the vector for this subsystem.

References fErrorFlag, fErrorFlagTreeIndex, QwSubsystemArray::FillTreeVector(), QwRootTreeBranchVector::SetValue(), and QwRootTreeBranchVector::size().

+ Here is the call graph for this function:

◆ GetEventcutErrorFlag()

UInt_t QwSubsystemArrayParity::GetEventcutErrorFlag ( ) const
inline

Return the error flag to the main routine.

Definition at line 124 of file QwSubsystemArrayParity.h.

124 {
125 return fErrorFlag;
126 };

References fErrorFlag.

Referenced by QwHelicityPattern::AccumulateRunningSum(), AccumulateRunningSum(), and FillHistograms().

+ Here is the caller graph for this function:

◆ GetEventcutErrorFlagPointer()

const UInt_t * QwSubsystemArrayParity::GetEventcutErrorFlagPointer ( ) const
inline

Definition at line 127 of file QwSubsystemArrayParity.h.

127 {
128 return &fErrorFlag;
129 };

References fErrorFlag.

Referenced by QwAlarmHandler::ConnectChannels(), QwCombiner::ConnectChannels(), QwCorrelator::ConnectChannels(), VQwDataHandler::ConnectChannels(), and VQwDataHandler::SetPointer().

+ Here is the caller graph for this function:

◆ GetSubsystemByName()

VQwSubsystemParity * QwSubsystemArrayParity::GetSubsystemByName ( const TString & name)
overridevirtual

Get the subsystem with the specified name.

Reimplemented from QwSubsystemArray.

Definition at line 49 of file QwSubsystemArrayParity.cc.

50{
51 return dynamic_cast<VQwSubsystemParity*>(QwSubsystemArray::GetSubsystemByName(name));
52}
virtual VQwSubsystem * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.

References QwSubsystemArray::GetSubsystemByName().

Referenced by LoadMockDataParameters(), and main().

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

◆ IncrementErrorCounters()

void QwSubsystemArrayParity::IncrementErrorCounters ( )

Update the data elements' error counters based on their internal error flags.

Definition at line 506 of file QwSubsystemArrayParity.cc.

507{
508 VQwSubsystemParity *subsys_parity = nullptr;
509 if (!empty()){
510 for (iterator subsys = begin(); subsys != end(); ++subsys){
511 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
512 subsys_parity->IncrementErrorCounters();
513 }
514 }
515}
virtual void IncrementErrorCounters()=0
Increment the error counters.

References VQwSubsystemParity::IncrementErrorCounters().

Referenced by main().

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

◆ LoadMockDataParameters()

void QwSubsystemArrayParity::LoadMockDataParameters ( std::string mapfile)

Definition at line 651 of file QwSubsystemArrayParity.cc.

652{
653 // for (iterator subsys = begin(); subsys != end(); ++subsys) {
654 // VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(GetSubsystemByName(subsys_name)->LoadMockDataParameters(mock_param_name));
655 // subsys_parity->LoadMockDataParameters(mapfile);
656 // }
657 QwParameterFile detectors(mapfile);
658 // This is how this should work
659 std::unique_ptr<QwParameterFile> preamble = nullptr;
660 preamble = detectors.ReadSectionPreamble();
661 // Process preamble
662 QwVerbose << "Preamble:" << QwLog::endl;
663 QwVerbose << *preamble << QwLog::endl;
664 double window_period = 0.0;
665 if (preamble->FileHasVariablePair("=","window_period",window_period)){
666 fWindowPeriod = window_period * Qw::sec;
667 }else{
669 }
670
671 QwMessage << "fWindowPeriod = " << fWindowPeriod << QwLog::endl;
672
673 std::unique_ptr<QwParameterFile> section = nullptr;
674 std::string section_name;
675 while ((section = detectors.ReadNextSection(section_name))) {
676
677 // Debugging output of configuration section
678 QwVerbose << "[" << section_name << "]" << QwLog::endl;
679 QwVerbose << *section << QwLog::endl;
680
681 // Determine type and name of subsystem
682 std::string subsys_type = section_name;
683 std::string subsys_name;
684 if (! section->FileHasVariablePair("=","name",subsys_name)) {
685 QwError << "No name defined in section for subsystem " << subsys_type << "." << QwLog::endl;
686 continue;
687 }
688 std::string mock_param_name;
689 if (! section->FileHasVariablePair("=","mock_param",mock_param_name)) {
690 QwError << "No mock data parameter defined for " << subsys_name << "." << QwLog::endl;
691 continue;
692 }
693 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(GetSubsystemByName(subsys_name));
694 if (! subsys_parity){
695 QwError << "Subsystem " << subsys_name << " listed in the mock-data-parameter map does not match any subsystems in the detetor map file." <<QwLog::endl;
696 } else {
697 subsys_parity->LoadMockDataParameters(mock_param_name);
698 }
699 }
700}
#define QwVerbose
Predefined log drain for verbose messages.
Definition QwLog.h:54
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
static const double sec
Definition QwUnits.h:80
static const double ms
Time units: base unit is ms.
Definition QwUnits.h:77
VQwSubsystemParity * GetSubsystemByName(const TString &name) override
Get the subsystem with the specified name.
virtual void LoadMockDataParameters(TString)

References QwLog::endl(), QwSubsystemArray::fWindowPeriod, GetSubsystemByName(), VQwSubsystemParity::LoadMockDataParameters(), Qw::ms, QwError, QwMessage, QwVerbose, QwParameterFile::ReadNextSection(), QwParameterFile::ReadSectionPreamble(), and Qw::sec.

Referenced by main().

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

◆ operator+=()

QwSubsystemArrayParity & QwSubsystemArrayParity::operator+= ( const QwSubsystemArrayParity & value)

Addition-assignment operator.

Addition-assignment operator

Parameters
valueSubsystem array to add to this array
Returns
This subsystem array after addition

Definition at line 108 of file QwSubsystemArrayParity.cc.

109{
110 if (!value.empty()){
112 std::min(fCodaEventNumber, value.fCodaEventNumber);
113 if (this->size() == value.size()){
114 this->fErrorFlag|=value.fErrorFlag;
115 for(size_t i=0;i<value.size();i++){
116 if (value.at(i)==NULL || this->at(i)==NULL){
117 // Either the value or the destination subsystem
118 // are null
119 } else {
120 VQwSubsystemParity *ptr1 =
121 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
122 VQwSubsystem *ptr2 = value.at(i).get();
123 if (typeid(*ptr1)==typeid(*ptr2)){
124 *(ptr1) += ptr2;
125 //std::cout<<"QwSubsystemArrayParity::operator+ here where types match \n";
126 } else {
127 QwError << "QwSubsystemArrayParity::operator+ here where types don't match" << QwLog::endl;
128 QwError << " typeid(ptr1)=" << typeid(ptr1).name()
129 << " but typeid(value.at(i)))=" << typeid(value.at(i)).name()
130 << QwLog::endl;
131 // Subsystems don't match
132 }
133 }
134 }
135 } else {
136 // Array sizes don't match
137 }
138 } else {
139 // The vsource is empty
140 }
141 return *this;
142}

References QwLog::endl(), QwSubsystemArray::fCodaEventNumber, fErrorFlag, QwError, and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ operator-=()

QwSubsystemArrayParity & QwSubsystemArrayParity::operator-= ( const QwSubsystemArrayParity & value)

Subtraction-assignment operator.

Subtraction-assignment operator

Parameters
valueSubsystem array to subtract from this array
Returns
This array after subtraction

Definition at line 149 of file QwSubsystemArrayParity.cc.

150{
151 if (!value.empty()){
153 std::min(fCodaEventNumber, value.fCodaEventNumber);
154 if (this->size() == value.size()){
155 this->fErrorFlag|=value.fErrorFlag;
156 for(size_t i=0;i<value.size();i++){
157 if (value.at(i)==NULL || this->at(i)==NULL){
158 // Either the value or the destination subsystem
159 // are null
160 } else {
161 VQwSubsystemParity *ptr1 =
162 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
163 VQwSubsystem *ptr2 = value.at(i).get();
164 if (typeid(*ptr1)==typeid(*ptr2)){
165 *(ptr1) -= ptr2;
166 } else {
167 // Subsystems don't match
168 }
169 }
170 }
171 } else {
172 // Array sizes don't match
173 }
174 } else {
175 // The vsource is empty
176 }
177 return *this;
178}

References QwSubsystemArray::fCodaEventNumber, fErrorFlag, and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ operator=()

QwSubsystemArrayParity & QwSubsystemArrayParity::operator= ( const QwSubsystemArrayParity & source)

Assignment operator.

Assignment operator

Parameters
sourceSubsystem array to assign to this array
Returns
This subsystem array after assignment

Definition at line 95 of file QwSubsystemArrayParity.cc.

96{
98 this->fErrorFlag = source.fErrorFlag;
99 return *this;
100}
QwSubsystemArray & operator=(const QwSubsystemArray &value)
Assignment operator.

References fErrorFlag, QwSubsystemArray::operator=(), and QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ PrintErrorCounters()

void QwSubsystemArrayParity::PrintErrorCounters ( ) const

Report the number of events failed due to HW and event cut failures.

Definition at line 546 of file QwSubsystemArrayParity.cc.

546 {// report number of events failed due to HW and event cut failure
547 const VQwSubsystemParity *subsys_parity = nullptr;
548 if (!empty()){
549 for (const_iterator subsys = begin(); subsys != end(); ++subsys){
550 subsys_parity=dynamic_cast<const VQwSubsystemParity*>((subsys)->get());
551 subsys_parity->PrintErrorCounters();
552 }
553 }
554}
virtual void PrintErrorCounters() const =0

References VQwSubsystemParity::PrintErrorCounters().

Referenced by main().

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

◆ PrintValue()

void QwSubsystemArrayParity::PrintValue ( ) const

Print value of all channels.

Definition at line 229 of file QwSubsystemArrayParity.cc.

230{
231 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
232 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
233 subsys_parity->PrintValue();
234 }
235}
virtual void PrintValue() const
Print values of all channels.

References VQwSubsystemParity::PrintValue().

Referenced by main().

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

◆ Ratio()

void QwSubsystemArrayParity::Ratio ( const QwSubsystemArrayParity & numer,
const QwSubsystemArrayParity & denom )

Ratio of two subsystem arrays.

Definition at line 424 of file QwSubsystemArrayParity.cc.

427{
428 Bool_t localdebug=kFALSE;
429
430 if(localdebug) std::cout<<"QwSubsystemArrayParity::Ratio \n";
431 *this=numer;
432 if ( !denom.empty()){
433 this->fErrorFlag=(numer.fErrorFlag|denom.fErrorFlag);
434 if (this->size() == denom.size() ){
435 for(size_t i=0;i<denom.size();i++){
436 if (denom.at(i)==NULL || this->at(i)==NULL){
437 // Either the value or the destination subsystem are null
438 if(localdebug) std::cout<<"Either the value or the destination subsystem are null\n";
439 } else {
440 VQwSubsystemParity *ptr1 =
441 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
442 VQwSubsystem *ptr2 = denom.at(i).get();
443 if (typeid(*ptr1)==typeid(*ptr2))
444 {
445 ptr1->Ratio(numer.at(i).get(),denom.at(i).get());
446 } else {
447 // Subsystems don't match
448 QwError << "subsystem #" << i
449 << " type do not match : ratio computation aborted" << QwLog::endl;
450 }
451 }
452 }
453 } else {
454 QwError << "array size do not match : ratio computation aborted" << QwLog::endl;
455 // Array sizes don't match
456 }
457 } else {
458 QwError << "source empty : ratio computation aborted" << QwLog::endl;
459 // The source is empty
460 }
461 if(localdebug) std::cout<<"I am out of it \n";
462
463}
virtual void Ratio(VQwSubsystem *numer, VQwSubsystem *denom)=0

References QwLog::endl(), fErrorFlag, QwError, QwSubsystemArrayParity(), and VQwSubsystemParity::Ratio().

+ Here is the call graph for this function:

◆ Scale()

void QwSubsystemArrayParity::Scale ( Double_t factor)

Scale this subsystem array.

Scale this subsystem array

Parameters
factorScale factor

Definition at line 219 of file QwSubsystemArrayParity.cc.

220{
221 for (iterator subsys = begin(); subsys != end(); ++subsys) {
222 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
223 subsys_parity->Scale(factor);
224 }
225}
virtual void Scale(Double_t factor)=0

References VQwSubsystemParity::Scale().

+ Here is the call graph for this function:

◆ Sum()

void QwSubsystemArrayParity::Sum ( const QwSubsystemArrayParity & value1,
const QwSubsystemArrayParity & value2 )

Sum of two subsystem arrays.

Sum of two subsystem arrays

Parameters
value1First subsystem array
value2Second subsystem array

Definition at line 185 of file QwSubsystemArrayParity.cc.

188{
189 if (!value1.empty()&& !value2.empty()){
190 *(this) = value1;
191 *(this) += value2;
192 } else {
193 // The source is empty
194 }
195}

References QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ UnBlind() [1/2]

void QwSubsystemArrayParity::UnBlind ( const QwBlinder * )
inline

Unblind the asymmetry of this subsystem.

Definition at line 104 of file QwSubsystemArrayParity.h.

105 { /* Not yet implemented */ };

Referenced by QwBlinder::UnBlind(), and QwBlinder::UnBlind().

+ Here is the caller graph for this function:

◆ UnBlind() [2/2]

void QwSubsystemArrayParity::UnBlind ( const QwBlinder * ,
const QwSubsystemArrayParity &  )
inline

Unblind the difference of this subsystem.

Definition at line 109 of file QwSubsystemArrayParity.h.

110 { /* Not yet implemented */ };

References QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ UpdateErrorFlag() [1/3]

void QwSubsystemArrayParity::UpdateErrorFlag ( )

Update the error flag internally from all the subsystems.

Definition at line 593 of file QwSubsystemArrayParity.cc.

593 {
594 //this routine will refresh the global error flag after stability cut check
595 //by default at the ApplySingleEventCuts routine fErrorFlag is updated properly and a const GetEventcutErrorFlag() routine
596 //returns the fErrorFlag value
597 fErrorFlag=0;
598 if( CheckBadEventRange() )
600
601 VQwSubsystemParity *subsys_parity = nullptr;
602 if (!empty()){
603 for (iterator subsys = begin(); subsys != end(); ++subsys){
604 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
605 //Update the error flag of the parity subsystem
606 fErrorFlag|=subsys_parity->UpdateErrorFlag();
607 }
608 }
609}
virtual UInt_t UpdateErrorFlag()
Uses the error flags of contained data elements to update Returns the error flag to the top level rou...

References CheckBadEventRange(), fErrorFlag, kBadEventRangeError, and VQwSubsystemParity::UpdateErrorFlag().

Referenced by ApplySingleEventCuts().

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

◆ UpdateErrorFlag() [2/3]

void QwSubsystemArrayParity::UpdateErrorFlag ( const QwSubsystemArrayParity & ev_error)

update the error flag for each channel in the subsystem array with the corresponding value in the ev_error subsystem array

Definition at line 556 of file QwSubsystemArrayParity.cc.

556 {
557 Bool_t localdebug=kFALSE;//kTRUE;
558 if(localdebug) std::cout<<"QwSubsystemArrayParity::UpdateErrorFlag \n";
559 if (!ev_error.empty()){
560 if (this->size() == ev_error.size()){
561 this->fErrorFlag |= ev_error.fErrorFlag;
562 for(size_t i=0;i<ev_error.size();i++){
563 if (ev_error.at(i)==NULL || this->at(i)==NULL){
564 // Either the source or the destination subsystem
565 // are null
566 } else {
567 VQwSubsystemParity *ptr1 =
568 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
569 VQwSubsystem *ptr2 = ev_error.at(i).get();
570 if (typeid(*ptr1)==typeid(*ptr2)){
571 if(localdebug) std::cout<<" here in QwSubsystemArrayParity::UpdateErrorFlag types mach \n";
572 //*(ptr1) = ev_error.at(i).get();//when =operator is used
573 //pass the correct subsystem to update the errorflags at subsystem to devices to channel levels
574 ptr1->UpdateErrorFlag(ev_error.at(i).get());
575 } else {
576 // Subsystems don't match
577 QwError << " QwSubsystemArrayParity::UpdateErrorFlag types do not mach" << QwLog::endl;
578 QwError << " typeid(ptr1)=" << typeid(*ptr1).name()
579 << " but typeid(*(ev_error.at(i).get()))=" << typeid(*ptr2).name()
580 << QwLog::endl;
581 }
582 }
583 }
584 } else {
585 // Array sizes don't match
586 }
587 } else {
588 // The source is empty
589 }
590};

References QwLog::endl(), fErrorFlag, QwError, QwSubsystemArrayParity(), and VQwSubsystemParity::UpdateErrorFlag().

+ Here is the call graph for this function:

◆ UpdateErrorFlag() [3/3]

void QwSubsystemArrayParity::UpdateErrorFlag ( UInt_t errflag)
inline

Definition at line 137 of file QwSubsystemArrayParity.h.

137{fErrorFlag |= errflag;};

References fErrorFlag.

◆ WritePromptSummary()

void QwSubsystemArrayParity::WritePromptSummary ( QwPromptSummary * ps,
TString type )

Definition at line 80 of file QwSubsystemArrayParity.cc.

81{
82 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
83 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
84 subsys_parity->WritePromptSummary(ps, type);
85 }
86}
virtual void WritePromptSummary(QwPromptSummary *, TString)

References VQwSubsystemParity::WritePromptSummary().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ LRBCorrector

friend class LRBCorrector
friend

Definition at line 49 of file QwSubsystemArrayParity.h.

References LRBCorrector.

Referenced by LRBCorrector.

◆ QwAlarmHandler

friend class QwAlarmHandler
friend

Definition at line 46 of file QwSubsystemArrayParity.h.

References QwAlarmHandler.

Referenced by QwAlarmHandler.

◆ QwCombiner

friend class QwCombiner
friend

Definition at line 47 of file QwSubsystemArrayParity.h.

References QwCombiner.

Referenced by QwCombiner.

◆ QwCorrelator

friend class QwCorrelator
friend

Definition at line 48 of file QwSubsystemArrayParity.h.

References QwCorrelator.

Referenced by QwCorrelator.

◆ QwExtractor

friend class QwExtractor
friend

Definition at line 50 of file QwSubsystemArrayParity.h.

References QwExtractor, and QwSubsystemArrayParity().

Referenced by QwExtractor.

◆ VQwDataHandler

friend class VQwDataHandler
friend

Definition at line 45 of file QwSubsystemArrayParity.h.

References VQwDataHandler.

Referenced by VQwDataHandler.

Field Documentation

◆ fErrorFlag

◆ fErrorFlagTreeIndex

Int_t QwSubsystemArrayParity::fErrorFlagTreeIndex
protected

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