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 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.
 

Protected Member Functions

void BuildResolvedParitySelf () const
 
void ResolveParityPairing (const QwSubsystemArrayParity &value, const char *context) const
 
void LoadSubsystemsFromParameterFile (QwParameterFile &detectors)
 
void InvalidateResolvedDispatchCache ()
 
void BuildResolvedSelf () const
 
void ResolvePairing (const QwSubsystemArray &source, const char *context) const
 

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
 
std::vector< VQwSubsystemParity * > fResolvedParitySelf
 
const QwSubsystemArrayParityfResolvedParityPeer = nullptr
 
std::vector< VQwSubsystem * > fResolvedParityPeerSlots
 
std::vector< Bool_t > fResolvedParityCompatible
 
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.
 
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
 
std::vector< VQwSubsystem * > fResolvedSelf
 
const QwSubsystemArrayfResolvedPeer = nullptr
 
std::vector< VQwSubsystem * > fResolvedPeerSlots
 
std::vector< Bool_t > fResolvedPairCompatible
 
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
 

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(), ResolveParityPairing(), 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 313 of file QwSubsystemArrayParity.cc.

314{
315 if (!value.empty()) {
316 if (this->size() == value.size()) {
317 //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.
318 ResolveParityPairing(value, "QwSubsystemArrayParity::AccumulateAllRunningSum");
319 for (size_t i = 0; i < value.size(); i++) {
320 if (!fResolvedParityCompatible[i]) continue;
321 fResolvedParitySelf[i]->AccumulateRunningSum(fResolvedParityPeerSlots[i], count, ErrorMask);
322 }
323 //}//else if ((value.fErrorFlag& 512)==512){
324 //QwMessage << " AccumulateRunningSum "<<(value.fErrorFlag & 0x2FF)<<" - "<<value.GetCodaEventNumber()<< QwLog::endl;
325 //}
326 } else {
327 // Array sizes don't match
328
329 }
330 } else {
331 // The value is empty
332 }
333}
void ResolveParityPairing(const QwSubsystemArrayParity &value, const char *context) const
std::vector< Bool_t > fResolvedParityCompatible
std::vector< VQwSubsystem * > fResolvedParityPeerSlots
std::vector< VQwSubsystemParity * > fResolvedParitySelf

References fResolvedParityCompatible, fResolvedParityPeerSlots, fResolvedParitySelf, QwSubsystemArrayParity(), and ResolveParityPairing().

+ 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 290 of file QwSubsystemArrayParity.cc.

291{
292 if (!value.empty()) {
293 if (this->size() == value.size()) {
294 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.
296 std::min(fCodaEventNumber, value.fCodaEventNumber);
297 ResolveParityPairing(value, "QwSubsystemArrayParity::AccumulateRunningSum");
298 for (size_t i = 0; i < value.size(); i++) {
299 if (!fResolvedParityCompatible[i]) continue;
300 fResolvedParitySelf[i]->AccumulateRunningSum(fResolvedParityPeerSlots[i], count, ErrorMask);
301 }
302 }
303
304 } else {
305 // Array sizes don't match
306
307 }
308 } else {
309 // The value is empty
310 }
311}
UInt_t fCodaEventNumber
CODA event number as provided by QwEventBuffer.
UInt_t GetEventcutErrorFlag() const
Return the error flag to the main routine.

References QwSubsystemArray::fCodaEventNumber, fResolvedParityCompatible, fResolvedParityPeerSlots, fResolvedParitySelf, GetEventcutErrorFlag(), QwSubsystemArrayParity(), and ResolveParityPairing().

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 450 of file QwSubsystemArrayParity.cc.

450 {
451 Int_t CountFalse;
452 Bool_t status;
453 UInt_t ErrorFlag;
454 fErrorFlag=0; // Testing if event number is within bad Event Range cut
455 if( CheckBadEventRange() )
457
458 VQwSubsystemParity *subsys_parity = nullptr;
459 CountFalse=0;
460 if (!empty()){
461 for (iterator subsys = begin(); subsys != end(); ++subsys){
462 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
463 status=subsys_parity->ApplySingleEventCuts();
464 ErrorFlag = subsys_parity->GetEventcutErrorFlag();
465 if ((ErrorFlag & kEventCutMode3)==kEventCutMode3)//we only care about the event cut flag in event cut mode 3
466 fErrorFlag |= ErrorFlag;
467 if (!status)
468 {
469 if ((ErrorFlag&kGlobalCut)==kGlobalCut){
470 CountFalse++;
471 fErrorFlag |= ErrorFlag; //we need the error code for failed events in event mode 2 for beam trips and etc.
472 }
473 }
474
475
476 }
477 }
478 if (CountFalse > 0)
479 status = kFALSE;
480 else
481 status = kTRUE;
482
483 // Propagate all error codes to derived objects in the subsystems.
485
486 return status;
487}
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 363 of file QwSubsystemArrayParity.cc.

364{
365 // Loop over subsystem array
366 for (size_t i = 0; i < this->size(); i++) {
367 // Cast into parity subsystems
368 VQwSubsystemParity* subsys = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
369
370 // Check for null pointers
371 if (this->at(i) == 0) {
372 QwError << "QwSubsystemArrayParity::Blind: "
373 << "parity subsystem null pointer!" << QwLog::endl;
374 return;
375 }
376
377 // Apply blinding
378 subsys->Blind(blinder);
379 }
380}
#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 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 382 of file QwSubsystemArrayParity.cc.

383{
384 // Check for array size
385 if (this->size() != yield.size()) {
386 QwError << "QwSubsystemArrayParity::Blind: "
387 << "diff and yield array dimension mismatch!" << QwLog::endl;
388 return;
389 }
390
391 // Loop over subsystem array
392 for (size_t i = 0; i < this->size(); i++) {
393 // Cast into parity subsystems
394 VQwSubsystemParity* subsys_diff = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
395 VQwSubsystemParity* subsys_yield = dynamic_cast<VQwSubsystemParity*>(yield.at(i).get());
396
397 // Check for null pointers
398 if (subsys_diff == 0 || subsys_yield == 0) {
399 QwError << "QwSubsystemArrayParity::Blind: "
400 << "diff or yield parity subsystem null pointer!" << QwLog::endl;
401 return;
402 }
403
404 // Apply blinding
405 subsys_diff->Blind(blinder, subsys_yield);
406 }
407}

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

+ Here is the call graph for this function:

◆ BuildResolvedParitySelf()

void QwSubsystemArrayParity::BuildResolvedParitySelf ( ) const
protected

Definition at line 47 of file QwSubsystemArrayParity.cc.

48{
49 if (fResolvedParitySelf.size() == this->size()) return;
50 // Self layout changed: any peer cache built against the old layout is stale.
51 fResolvedParityPeer = nullptr;
54 fResolvedParitySelf.assign(this->size(), nullptr);
55 for (size_t i = 0; i < this->size(); ++i) {
56 if (this->at(i) != nullptr) {
57 fResolvedParitySelf[i] = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
58 if (fResolvedParitySelf[i] == nullptr) {
59 QwError << "QwSubsystemArrayParity::BuildResolvedParitySelf "
60 << "failed to cast slot " << i << " to VQwSubsystemParity."
61 << QwLog::endl;
62 }
63 }
64 }
65}
const QwSubsystemArrayParity * fResolvedParityPeer

References QwLog::endl(), fResolvedParityCompatible, fResolvedParityPeer, fResolvedParityPeerSlots, fResolvedParitySelf, and QwError.

Referenced by ResolveParityPairing().

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

◆ CalculateRunningAverage()

void QwSubsystemArrayParity::CalculateRunningAverage ( )

Calculate the average for all good events.

Definition at line 280 of file QwSubsystemArrayParity.cc.

281{
282 for (iterator subsys = begin(); subsys != end(); ++subsys) {
283 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
284 subsys_parity->CalculateRunningAverage();
285 }
286}
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 596 of file QwSubsystemArrayParity.cc.

596 {
597 std::vector< std::pair<UInt_t, UInt_t> >::iterator itber = fBadEventRange.begin(); // ber = bad event range
598 while(itber!=fBadEventRange.end()){
599 if( fCodaEventNumber >= (*itber).first
600 && fCodaEventNumber <= (*itber).second){
601 return kTRUE;
602 }
603 itber++;
604 }
605 return kFALSE;
606}
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 502 of file QwSubsystemArrayParity.cc.

503{
504 Bool_t burpstatus = kFALSE;
505 if (!event.empty() && this->size() == event.size()){
506 for(size_t i=0;i<event.size();i++){
507 if (event.at(i)!=NULL && this->at(i)!=NULL){
508 VQwSubsystemParity *ptr1 = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
509 VQwSubsystem *ptr2 = event.at(i).get();
510 if (typeid(*ptr1)==typeid(*ptr2)){
511 //*(ptr1) = event.at(i).get();//when =operator is used
512 //pass the correct subsystem to update the errorflags at subsystem to devices to channel levels
513 //wError << "************* test " << typeid(*ptr1).name() << "*****************" << QwLog::endl;
514 burpstatus |= ptr1->CheckForBurpFail(ptr2);
515 } else {
516 // Subsystems don't match
517 QwError << " QwSubsystemArrayParity::CheckForBurpFail types do not mach" << QwLog::endl;
518 QwError << " typeid(ptr1)=" << typeid(*ptr1).name()
519 << " but typeid(*(event.at(i).get()))=" << typeid(*ptr2).name()
520 << QwLog::endl;
521 }
522 }
523 }
524 } else {
525 // The source is empty
526 }
527 return burpstatus;
528}
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 268 of file QwSubsystemArrayParity.cc.

269{
270 Bool_t status = kFALSE;
271 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
272 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
273 status |= subsys_parity->CheckForEndOfBurst();
274 }
275 return status;
276};
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 608 of file QwSubsystemArrayParity.cc.

608 {
609 QwSubsystemArray::ConstructBranchAndVector(tree, prefix, values);
610 if (prefix.Contains("yield_") || prefix==""){
611 values.push_back("ErrorFlag", 'D');
612 fErrorFlagTreeIndex = values.size()-1;
613 tree->Branch("ErrorFlag", &(values.back<Double_t>()), "ErrorFlag/D");
614 } else {
616 }
617}
size_type size() const noexcept
Definition QwRootFile.h:83
void push_back(const std::string &name, const char type='D')
Definition QwRootFile.h:197
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 336 of file QwSubsystemArrayParity.cc.

337{
338 //Bool_t berror=kTRUE;//only needed for deaccumulation (stability check purposes)
339 //if (value.fErrorFlag>0){//check the error is global
340 //berror=((value.fErrorFlag & 0x2FF) == 0); //The operation value.fErrorFlag & 0x2FF clear everything else but the HW errors + event cut errors + blinder error
341 //}
342 if (!value.empty()) {
343 if (this->size() == value.size()) {
344 //if (value.GetEventcutErrorFlag()==0){//do derunningsum only if error flag is zero.
345 ResolveParityPairing(value, "QwSubsystemArrayParity::DeaccumulateRunningSum");
346 for (size_t i = 0; i < value.size(); i++) {
347 if (!fResolvedParityCompatible[i]) continue;
348 fResolvedParitySelf[i]->DeaccumulateRunningSum(fResolvedParityPeerSlots[i], ErrorMask);
349 }
350 //}//else if ((value.fErrorFlag & 268435968)==268435968){
351 //QwMessage << " DeaccumulateRunningSum "<<(value.fErrorFlag & 0x2FF)<<" - "<<value.GetCodaEventNumber()<< QwLog::endl;
352 //}
353 } else {
354 // Array sizes don't match
355
356 }
357 } else {
358 // The value is empty
359 }
360}

References fResolvedParityCompatible, fResolvedParityPeerSlots, fResolvedParitySelf, QwSubsystemArrayParity(), and ResolveParityPairing().

+ 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 229 of file QwSubsystemArrayParity.cc.

232{
233
234 if (!value1.empty()&& !value2.empty()){
235 *(this) = value1;
236 *(this) -= value2;
237 } else {
238 // The source is empty
239 }
240}

References QwSubsystemArrayParity().

+ Here is the call graph for this function:

◆ FillDB()

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

Fill the database.

Definition at line 116 of file QwSubsystemArrayParity.cc.

117{
118 for (iterator subsys = begin(); subsys != end(); ++subsys) {
119 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
120 subsys_parity->FillDB(db, type);
121 }
122}
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 108 of file QwSubsystemArrayParity.cc.

109{
110 for (iterator subsys = begin(); subsys != end(); ++subsys) {
111 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
112 subsys_parity->FillDB_MPS(db, type);
113 }
114}
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 124 of file QwSubsystemArrayParity.cc.

125{
126 for (iterator subsys = begin(); subsys != end(); ++subsys) {
127 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
128 subsys_parity->FillErrDB(db, type);
129 }
130}
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 629 of file QwSubsystemArrayParity.cc.

630{
631 if (GetEventcutErrorFlag()==0)
633}
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 619 of file QwSubsystemArrayParity.cc.

620{
622 if (fErrorFlagTreeIndex>=0 && fErrorFlagTreeIndex<static_cast<int>(values.size())){
623 values.SetValue(fErrorFlagTreeIndex, static_cast<double>(fErrorFlag));
624 }
625}
void SetValue(size_type index, Double_t val)
Definition QwRootFile.h:110
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 GrandCorrelator::ConnectChannels(), QwAlarmHandler::ConnectChannels(), QwCombiner::ConnectChannels(), QwCorrelator::ConnectChannels(), QwCorrelatorNew::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 101 of file QwSubsystemArrayParity.cc.

102{
103 return dynamic_cast<VQwSubsystemParity*>(QwSubsystemArray::GetSubsystemByName(name));
104}
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 491 of file QwSubsystemArrayParity.cc.

492{
493 VQwSubsystemParity *subsys_parity = nullptr;
494 if (!empty()){
495 for (iterator subsys = begin(); subsys != end(); ++subsys){
496 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
497 subsys_parity->IncrementErrorCounters();
498 }
499 }
500}
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 636 of file QwSubsystemArrayParity.cc.

637{
638 // for (iterator subsys = begin(); subsys != end(); ++subsys) {
639 // VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(GetSubsystemByName(subsys_name)->LoadMockDataParameters(mock_param_name));
640 // subsys_parity->LoadMockDataParameters(mapfile);
641 // }
642 QwParameterFile detectors(mapfile);
643 // This is how this should work
644 std::unique_ptr<QwParameterFile> preamble = nullptr;
645 preamble = detectors.ReadSectionPreamble();
646 // Process preamble
647 QwVerbose << "Preamble:" << QwLog::endl;
648 QwVerbose << *preamble << QwLog::endl;
649 double window_period = 0.0;
650 if (preamble->FileHasVariablePair("=","window_period",window_period)){
651 fWindowPeriod = window_period * Qw::sec;
652 }else{
654 }
655
656 QwMessage << "fWindowPeriod = " << fWindowPeriod << QwLog::endl;
657
658 std::unique_ptr<QwParameterFile> section = nullptr;
659 std::string section_name;
660 while ((section = detectors.ReadNextSection(section_name))) {
661
662 // Debugging output of configuration section
663 QwVerbose << "[" << section_name << "]" << QwLog::endl;
664 QwVerbose << *section << QwLog::endl;
665
666 // Determine type and name of subsystem
667 std::string subsys_type = section_name;
668 std::string subsys_name;
669 if (! section->FileHasVariablePair("=","name",subsys_name)) {
670 QwError << "No name defined in section for subsystem " << subsys_type << "." << QwLog::endl;
671 continue;
672 }
673 std::string mock_param_name;
674 if (! section->FileHasVariablePair("=","mock_param",mock_param_name)) {
675 QwError << "No mock data parameter defined for " << subsys_name << "." << QwLog::endl;
676 continue;
677 }
678 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(GetSubsystemByName(subsys_name));
679 if (! subsys_parity){
680 QwError << "Subsystem " << subsys_name << " listed in the mock-data-parameter map does not match any subsystems in the detetor map file." <<QwLog::endl;
681 } else {
682 subsys_parity->LoadMockDataParameters(mock_param_name);
683 }
684 }
685}
#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 160 of file QwSubsystemArrayParity.cc.

161{
162 if (!value.empty()){
164 std::min(fCodaEventNumber, value.fCodaEventNumber);
165 if (this->size() == value.size()){
166 this->fErrorFlag|=value.fErrorFlag;
167 ResolveParityPairing(value, "QwSubsystemArrayParity::operator+=");
168 for(size_t i=0;i<value.size();i++){
169 if (!fResolvedParityCompatible[i]) continue;
170 *(fResolvedParitySelf[i]) += fResolvedParityPeerSlots[i];
171 }
172 } else {
173 // Array sizes don't match
174 }
175 } else {
176 // The vsource is empty
177 }
178 return *this;
179}

References QwSubsystemArray::fCodaEventNumber, fErrorFlag, fResolvedParityCompatible, fResolvedParityPeerSlots, fResolvedParitySelf, QwSubsystemArrayParity(), and ResolveParityPairing().

+ 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 186 of file QwSubsystemArrayParity.cc.

187{
188 if (!value.empty()){
190 std::min(fCodaEventNumber, value.fCodaEventNumber);
191 if (this->size() == value.size()){
192 this->fErrorFlag|=value.fErrorFlag;
193 ResolveParityPairing(value, "QwSubsystemArrayParity::operator-=");
194 for(size_t i=0;i<value.size();i++){
195 if (!fResolvedParityCompatible[i]) continue;
196 *(fResolvedParitySelf[i]) -= fResolvedParityPeerSlots[i];
197 }
198 } else {
199 // Array sizes don't match
200 }
201 } else {
202 // The vsource is empty
203 }
204 return *this;
205}

References QwSubsystemArray::fCodaEventNumber, fErrorFlag, fResolvedParityCompatible, fResolvedParityPeerSlots, fResolvedParitySelf, QwSubsystemArrayParity(), and ResolveParityPairing().

+ 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 147 of file QwSubsystemArrayParity.cc.

148{
150 this->fErrorFlag = source.fErrorFlag;
151 return *this;
152}
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 531 of file QwSubsystemArrayParity.cc.

531 {// report number of events failed due to HW and event cut failure
532 const VQwSubsystemParity *subsys_parity = nullptr;
533 if (!empty()){
534 for (const_iterator subsys = begin(); subsys != end(); ++subsys){
535 subsys_parity=dynamic_cast<const VQwSubsystemParity*>((subsys)->get());
536 subsys_parity->PrintErrorCounters();
537 }
538 }
539}
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 256 of file QwSubsystemArrayParity.cc.

257{
258 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
259 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
260 subsys_parity->PrintValue();
261 }
262}
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 409 of file QwSubsystemArrayParity.cc.

412{
413 Bool_t localdebug=kFALSE;
414
415 if(localdebug) std::cout<<"QwSubsystemArrayParity::Ratio \n";
416 *this=numer;
417 if ( !denom.empty()){
418 this->fErrorFlag=(numer.fErrorFlag|denom.fErrorFlag);
419 if (this->size() == denom.size() ){
420 for(size_t i=0;i<denom.size();i++){
421 if (denom.at(i)==NULL || this->at(i)==NULL){
422 // Either the value or the destination subsystem are null
423 if(localdebug) std::cout<<"Either the value or the destination subsystem are null\n";
424 } else {
425 VQwSubsystemParity *ptr1 =
426 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
427 VQwSubsystem *ptr2 = denom.at(i).get();
428 if (typeid(*ptr1)==typeid(*ptr2))
429 {
430 ptr1->Ratio(numer.at(i).get(),denom.at(i).get());
431 } else {
432 // Subsystems don't match
433 QwError << "subsystem #" << i
434 << " type do not match : ratio computation aborted" << QwLog::endl;
435 }
436 }
437 }
438 } else {
439 QwError << "array size do not match : ratio computation aborted" << QwLog::endl;
440 // Array sizes don't match
441 }
442 } else {
443 QwError << "source empty : ratio computation aborted" << QwLog::endl;
444 // The source is empty
445 }
446 if(localdebug) std::cout<<"I am out of it \n";
447
448}
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:

◆ ResolveParityPairing()

void QwSubsystemArrayParity::ResolveParityPairing ( const QwSubsystemArrayParity & value,
const char * context ) const
protected

Definition at line 67 of file QwSubsystemArrayParity.cc.

69{
71 const Bool_t cache_valid =
72 (fResolvedParityPeer == &value)
73 && (fResolvedParityPeerSlots.size() == value.size())
74 && (fResolvedParityCompatible.size() == value.size());
75 if (cache_valid) return;
76
77 fResolvedParityPeer = &value;
78 fResolvedParityPeerSlots.assign(value.size(), nullptr);
79 fResolvedParityCompatible.assign(value.size(), kFALSE);
80 if (this->size() != value.size()) return;
81
82 for (size_t i = 0; i < value.size(); ++i) {
83 VQwSubsystemParity* ptr1 = fResolvedParitySelf[i];
84 VQwSubsystem* ptr2 = value.at(i).get();
86 if (ptr1 == nullptr || ptr2 == nullptr) continue;
87
88 if (typeid(*ptr1) == typeid(*ptr2)) {
90 } else {
91 QwError << context << " types do not match at slot " << i << QwLog::endl;
92 QwError << " typeid(*ptr1)=" << typeid(*ptr1).name()
93 << " but typeid(*ptr2)=" << typeid(*ptr2).name()
94 << QwLog::endl;
95 }
96 }
97}

References BuildResolvedParitySelf(), QwLog::endl(), fResolvedParityCompatible, fResolvedParityPeer, fResolvedParityPeerSlots, fResolvedParitySelf, QwError, and QwSubsystemArrayParity().

Referenced by AccumulateAllRunningSum(), AccumulateRunningSum(), DeaccumulateRunningSum(), operator+=(), and operator-=().

+ Here is the call graph for this function:
+ Here is the caller 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 246 of file QwSubsystemArrayParity.cc.

247{
248 for (iterator subsys = begin(); subsys != end(); ++subsys) {
249 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
250 subsys_parity->Scale(factor);
251 }
252}
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 212 of file QwSubsystemArrayParity.cc.

215{
216 if (!value1.empty()&& !value2.empty()){
217 *(this) = value1;
218 *(this) += value2;
219 } else {
220 // The source is empty
221 }
222}

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 578 of file QwSubsystemArrayParity.cc.

578 {
579 //this routine will refresh the global error flag after stability cut check
580 //by default at the ApplySingleEventCuts routine fErrorFlag is updated properly and a const GetEventcutErrorFlag() routine
581 //returns the fErrorFlag value
582 fErrorFlag=0;
583 if( CheckBadEventRange() )
585
586 VQwSubsystemParity *subsys_parity = nullptr;
587 if (!empty()){
588 for (iterator subsys = begin(); subsys != end(); ++subsys){
589 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
590 //Update the error flag of the parity subsystem
591 fErrorFlag|=subsys_parity->UpdateErrorFlag();
592 }
593 }
594}
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 541 of file QwSubsystemArrayParity.cc.

541 {
542 Bool_t localdebug=kFALSE;//kTRUE;
543 if(localdebug) std::cout<<"QwSubsystemArrayParity::UpdateErrorFlag \n";
544 if (!ev_error.empty()){
545 if (this->size() == ev_error.size()){
546 this->fErrorFlag |= ev_error.fErrorFlag;
547 for(size_t i=0;i<ev_error.size();i++){
548 if (ev_error.at(i)==NULL || this->at(i)==NULL){
549 // Either the source or the destination subsystem
550 // are null
551 } else {
552 VQwSubsystemParity *ptr1 =
553 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
554 VQwSubsystem *ptr2 = ev_error.at(i).get();
555 if (typeid(*ptr1)==typeid(*ptr2)){
556 if(localdebug) std::cout<<" here in QwSubsystemArrayParity::UpdateErrorFlag types mach \n";
557 //*(ptr1) = ev_error.at(i).get();//when =operator is used
558 //pass the correct subsystem to update the errorflags at subsystem to devices to channel levels
559 ptr1->UpdateErrorFlag(ev_error.at(i).get());
560 } else {
561 // Subsystems don't match
562 QwError << " QwSubsystemArrayParity::UpdateErrorFlag types do not mach" << QwLog::endl;
563 QwError << " typeid(ptr1)=" << typeid(*ptr1).name()
564 << " but typeid(*(ev_error.at(i).get()))=" << typeid(*ptr2).name()
565 << QwLog::endl;
566 }
567 }
568 }
569 } else {
570 // Array sizes don't match
571 }
572 } else {
573 // The source is empty
574 }
575};

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 132 of file QwSubsystemArrayParity.cc.

133{
134 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
135 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
136 subsys_parity->WritePromptSummary(ps, type);
137 }
138}
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

◆ fResolvedParityCompatible

std::vector<Bool_t> QwSubsystemArrayParity::fResolvedParityCompatible
mutableprotected

◆ fResolvedParityPeer

const QwSubsystemArrayParity* QwSubsystemArrayParity::fResolvedParityPeer = nullptr
mutableprotected

Definition at line 160 of file QwSubsystemArrayParity.h.

Referenced by BuildResolvedParitySelf(), and ResolveParityPairing().

◆ fResolvedParityPeerSlots

std::vector<VQwSubsystem*> QwSubsystemArrayParity::fResolvedParityPeerSlots
mutableprotected

◆ fResolvedParitySelf

std::vector<VQwSubsystemParity*> QwSubsystemArrayParity::fResolvedParitySelf
mutableprotected

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