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

#include <QwScanData.h>

+ Inheritance diagram for QwScanData:
+ Collaboration diagram for QwScanData:

Data Structures

struct  CleanDataIndex
 

Public Member Functions

 QwScanData (TString const &name)
 
 QwScanData (QwScanData const &other)
 
 ~QwScanData ()=default
 
void FillDB_MPS (QwParityDB *, TString) override
 Fill the database with MPS-based variables Note that most subsystems don't need to do this.
 
void FillDB (QwParityDB *, TString) override
 Fill the database.
 
void FillErrDB (QwParityDB *, TString) override
 
void Ratio (VQwSubsystem *numer, VQwSubsystem *denom) override
 
void Scale (Double_t factor) override
 
void AccumulateRunningSum (VQwSubsystem *value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override
 Update the running sums for devices.
 
void DeaccumulateRunningSum (VQwSubsystem *value, Int_t ErrorMask=0xFFFFFFF) override
 remove one entry from the running sums for devices
 
void CalculateRunningAverage () override
 Calculate the average for all good events.
 
VQwSubsystem & operator= (VQwSubsystem *value) override
 Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)
 
VQwSubsystem & operator+= (VQwSubsystem *value) override
 
VQwSubsystem & operator-= (VQwSubsystem *value) override
 
Int_t LoadChannelMap (TString mapfile) override
 Mandatory map file definition.
 
Int_t LoadInputParameters (TString mapfile) override
 Mandatory parameter file definition.
 
Int_t ProcessConfigurationBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) override
 
Int_t ProcessEvBuffer (const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) override
 TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version.
 
void ProcessEvent () override
 
void ConstructHistograms () override
 Construct the histograms for this subsystem.
 
void ConstructHistograms (TDirectory *folder, TString &prefix) override
 Construct the histograms for this subsystem in a folder with a prefix.
 
void FillHistograms () override
 Fill the histograms for this subsystem.
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
 Construct the branch and tree vector.
 
void FillTreeVector (QwRootTreeBranchVector &values) const override
 Fill the tree vector.
 
void ConstructBranch (TTree *tree, TString &prefix) override
 Construct the branch and tree vector.
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_file) override
 Construct the branch and tree vector based on the trim file.
 
void ClearEventData () override
 
Bool_t ApplySingleEventCuts () override
 Apply the single event cuts.
 
Bool_t CheckForBurpFail (const VQwSubsystem *subsys) override
 Report the number of events failed due to HW and event cut failures.
 
void PrintErrorCounters () const override
 
void IncrementErrorCounters () override
 Increment the error counters.
 
UInt_t GetEventcutErrorFlag () override
 Return the error flag to the top level routines related to stability checks and ErrorFlag updates.
 
void UpdateErrorFlag (const VQwSubsystem *ev_error) override
 update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem
 
Int_t LoadEventCuts (TString filename) override
 Load the event cuts file.
 
virtual void LoadEventCuts_Init ()
 
virtual void LoadEventCuts_Line (QwParameterFile &, TString &, Int_t &)
 
virtual void LoadEventCuts_Fin (Int_t &)
 
- Public Member Functions inherited from VQwSubsystemParity
 VQwSubsystemParity (const TString &name)
 Constructor with name.
 
 VQwSubsystemParity (const VQwSubsystemParity &source)
 Copy constructor.
 
 ~VQwSubsystemParity () override
 Default destructor.
 
virtual void Sum (VQwSubsystem *value1, VQwSubsystem *value2)
 
virtual void Difference (VQwSubsystem *value1, VQwSubsystem *value2)
 
Int_t LoadEventCuts (TString filename) override
 Load the event cuts file.
 
virtual UInt_t UpdateErrorFlag ()
 Uses the error flags of contained data elements to update Returns the error flag to the top level routines related to stability checks and ErrorFlag updates.
 
virtual void Blind (const QwBlinder *)
 Blind the asymmetry of this subsystem.
 
virtual void Blind (const QwBlinder *, const VQwSubsystemParity *)
 Blind the difference of this subsystem.
 
virtual void PrintValue () const
 Print values of all channels.
 
virtual void WritePromptSummary (QwPromptSummary *, TString)
 
virtual Bool_t CheckForEndOfBurst () const
 
virtual void LoadMockDataParameters (TString)
 
- Public Member Functions inherited from VQwSubsystem
 VQwSubsystem (const TString &name)
 Constructor with name.
 
 VQwSubsystem (const VQwSubsystem &orig)
 Copy constructor by object.
 
 ~VQwSubsystem () override
 Default destructor.
 
virtual void ProcessOptions (QwOptions &)
 Process the command line options.
 
TString GetName () const
 
Bool_t HasDataLoaded () const
 
VQwSubsystem * GetSibling (const std::string &name) const
 Get the sibling with specified name.
 
virtual std::vector< TString > GetParamFileNameList ()
 
virtual std::map< TString, TString > GetDetectorMaps ()
 
Bool_t PublishByRequest (TString) override
 Try to publish an internal variable matching the submitted name.
 
Bool_t PublishInternalValues () const override
 Publish all variables of the subsystem.
 
virtual Int_t LoadDetectorMaps (QwParameterFile &file)
 Parse parameter file to find the map files.
 
virtual Int_t LoadGeometryDefinition (TString)
 Optional geometry definition.
 
virtual Int_t LoadCrosstalkDefinition (TString)
 Optional crosstalk definition.
 
void SetEventTypeMask (const UInt_t mask)
 Set event type mask.
 
UInt_t GetEventTypeMask () const
 Get event type mask.
 
virtual 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)
 
virtual void ExchangeProcessedData ()
 Request processed data from other subsystems for internal use in the second event processing stage. Not all derived classes will require data from other subsystems.
 
virtual void ProcessEvent_2 ()
 Process the event data again, including data from other subsystems. Not all derived classes will require a second stage of event data processing.
 
virtual void AtEndOfEventLoop ()
 Perform actions at the end of the event loop.
 
virtual void RandomizeEventData (int=0, double=0.0)
 
virtual void EncodeEventData (std::vector< UInt_t > &)
 
virtual void ConstructObjects ()
 Construct the objects for this subsystem.
 
virtual void ConstructObjects (TDirectory *folder)
 Construct the objects for this subsystem in a folder.
 
virtual void ConstructObjects (TString &prefix)
 Construct the objects for this subsystem with a prefix.
 
virtual void ConstructObjects (TDirectory *, TString &)
 Construct the objects for this subsystem in a folder with a prefix.
 
virtual void ConstructHistograms (TDirectory *folder)
 Construct the histograms for this subsystem in a folder.
 
virtual void ConstructHistograms (TString &prefix)
 Construct the histograms for this subsystem with a prefix.
 
virtual void ConstructBranchAndVector (TTree *tree, QwRootTreeBranchVector &values)
 Construct the branch and tree vector.
 
virtual void ConstructTree ()
 Construct the tree for this subsystem.
 
virtual void ConstructTree (TDirectory *folder)
 Construct the tree for this subsystem in a folder.
 
virtual void ConstructTree (TString &prefix)
 Construct the tree for this subsystem with a prefix.
 
virtual void ConstructTree (TDirectory *, TString &)
 Construct the tree for this subsystem in a folder with a prefix.
 
virtual void FillTree ()
 Fill the tree for this subsystem.
 
virtual void DeleteTree ()
 Delete the tree for this subsystem.
 
virtual void PrintInfo () const
 Print some information about the subsystem.
 
virtual void PrintDetectorMaps (Bool_t status) const
 
void GetMarkerWordList (const ROCID_t roc_id, const BankID_t bank_id, std::vector< UInt_t > &marker) const
 
std::vector< ROCID_t > GetROCIds () const
 
- Public Member Functions inherited from MQwHistograms
void ShareHistograms (const MQwHistograms *source)
 Share histogram pointers between objects.
 
- Public Member Functions inherited from MQwPublishable_child< QwSubsystemArray, VQwSubsystem >
 MQwPublishable_child ()
 Default constructor Initializes the child object and sets up self-reference for publishing.
 
 MQwPublishable_child (const MQwPublishable_child &source)
 Copy constructor.
 
virtual ~MQwPublishable_child ()
 Virtual destructor.
 
void SetParent (QwSubsystemArray *parent)
 Set the parent container for this child object.
 
QwSubsystemArray * GetParent () const
 Get the parent container for this child object.
 
- Public Member Functions inherited from MQwCloneable< VQwSubsystem, QwScanData >
 ~MQwCloneable () override
 Virtual destructor.
 
VQwSubsystem * Clone () const override
 Concrete clone method.
 
const VQwFactory< VQwSubsystem > * Factory () const override
 Factory getter.
 
- Public Member Functions inherited from VQwCloneable< VQwSubsystem >
virtual ~VQwCloneable ()
 Virtual destructor.
 
std::string GetClassName () const
 Get demangled name of this class.
 

Private Types

enum class  CleanDataVal : bool { kUNCLEAN = false , kCLEAN = true }
 
enum class  RootSaveType { kSAVE_EVT , kSAVE_ASYM , kSAVE_YIELD , kNO_SAVE }
 

Private Member Functions

void SetSaveType (TString const &prefix)
 
bool CheckCleanDataIndex () const
 
void SetCleanDataIndex (Int_t index)
 
bool SetCleanData (CleanDataVal clean_flag)
 

Private Attributes

std::vector< QwWord > fWords
 
CleanDataIndex fCleanDataIndex {}
 
Int_t fTreeArrayIndex {-1}
 
RootSaveType fSaveType {RootSaveType::kNO_SAVE}
 

Additional Inherited Members

- Static Public Member Functions inherited from VQwSubsystem
static void DefineOptions ()
 Define options function (note: no virtual static functions in C++)
 
- Static Public Member Functions inherited from MQwCloneable< VQwSubsystem, QwScanData >
static VQwSubsystem * Create (const std::string &name)
 Object creation.
 
static QwScanData * Cast (QwScanData *type)
 Object dynamic cast.
 
void ClearAllBankRegistrations ()
 Clear all registration of ROC and Bank IDs for this subsystem.
 
virtual Int_t RegisterROCNumber (const ROCID_t roc_id, const BankID_t bank_id=0)
 Tell the object that it will decode data from this ROC and sub-bank.
 
Int_t RegisterSubbank (const BankID_t bank_id)
 Tell the object that it will decode data from this sub-bank in the ROC currently open for registration.
 
Int_t RegisterMarkerWord (const UInt_t markerword)
 
void RegisterRocBankMarker (QwParameterFile &mapstr)
 
Int_t GetSubbankIndex () const
 
Int_t GetSubbankIndex (const ROCID_t roc_id, const BankID_t bank_id) const
 
void SetDataLoaded (Bool_t flag)
 
template<class T>
Int_t FindIndex (const std::vector< T > &myvec, const T value) const
 
Bool_t Compare (VQwSubsystem *source)
 
- Protected Member Functions inherited from MQwHistograms
 MQwHistograms ()
 Default constructor.
 
 MQwHistograms (const MQwHistograms &source)
 Copy constructor.
 
virtual ~MQwHistograms ()
 Virtual destructor.
 
MQwHistograms & operator= (const MQwHistograms &value)
 
void Fill_Pointer (TH1_ptr hist_ptr, Double_t value)
 
void AddHistogram (TH1 *h)
 Register a histogram.
 
- Protected Member Functions inherited from MQwPublishable_child< QwSubsystemArray, VQwSubsystem >
Bool_t RequestExternalValue (const TString &name, VQwHardwareChannel *value) const
 Retrieve the variable name from other subsystem arrays Get the value corresponding to some variable name from a different data array.
 
const VQwHardwareChannel * RequestExternalPointer (const TString &name) const
 Retrieve a pointer to an external variable by name Requests a direct pointer to a variable from sibling subsystems via the parent container.
 
Bool_t PublishInternalValue (const TString name, const TString desc, const VQwHardwareChannel *element) const
 Publish a variable from this child into the parent container.
 
- Protected Attributes inherited from VQwSubsystem
std::vector< std::vector< TString > > fPublishList
 
TString fSystemName
 Name of this subsystem.
 
UInt_t fEventTypeMask
 Mask of event types.
 
Bool_t fIsDataLoaded
 Has this subsystem gotten data to be processed?
 
std::vector< TString > fDetectorMapsNames
 Names of loaded detector map files.
 
std::map< TString, TString > fDetectorMaps
 Map of file name to full path or content.
 
ROCID_t fCurrentROC_ID
 ROC ID that is currently being processed.
 
BankID_t fCurrentBank_ID
 Bank ID (and Marker word) that is currently being processed;.
 
std::vector< ROCID_t > fROC_IDs
 Vector of ROC IDs associated with this subsystem.
 
std::vector< std::vector< BankID_t > > fBank_IDs
 Vector of Bank IDs per ROC ID associated with this subsystem.
 
std::vector< std::vector< std::vector< UInt_t > > > fMarkerWords
 Vector of marker words per ROC & subbank associated with this subsystem.
 
- Protected Attributes inherited from MQwHistograms
std::vector< TH1_ptr > fHistograms
 Histograms associated with this data element.
 

Detailed Description

Definition at line 14 of file QwScanData.h.

Member Enumeration Documentation

◆ CleanDataVal

enum class QwScanData::CleanDataVal : bool
strongprivate
Enumerator
kUNCLEAN 
kCLEAN 

Definition at line 22 of file QwScanData.h.

22: bool { kUNCLEAN = false, kCLEAN = true };

◆ RootSaveType

enum class QwScanData::RootSaveType
strongprivate
Enumerator
kSAVE_EVT 
kSAVE_ASYM 
kSAVE_YIELD 
kNO_SAVE 

Definition at line 64 of file QwScanData.h.

64{ kSAVE_EVT, kSAVE_ASYM, kSAVE_YIELD, kNO_SAVE };

Constructor & Destructor Documentation

◆ QwScanData() [1/2]

QwScanData::QwScanData ( TString const & name)

Definition at line 6 of file QwScanData.cc.

7: VQwSubsystem(name)
8, VQwSubsystemParity(name) {}
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)

References VQwSubsystem::VQwSubsystem(), and VQwSubsystemParity::VQwSubsystemParity().

Referenced by operator+=(), operator-=(), operator=(), and QwScanData().

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

◆ QwScanData() [2/2]

QwScanData::QwScanData ( QwScanData const & other)

Definition at line 10 of file QwScanData.cc.

11: VQwSubsystem(other)
12, VQwSubsystemParity(other)
13, fWords(other.fWords)
14, fCleanDataIndex(other.fCleanDataIndex)
15, fTreeArrayIndex(other.fTreeArrayIndex)
16, fSaveType(other.fSaveType) {}
RootSaveType fSaveType
Definition QwScanData.h:66
Int_t fTreeArrayIndex
Definition QwScanData.h:25
std::vector< QwWord > fWords
Definition QwScanData.h:23
CleanDataIndex fCleanDataIndex
Definition QwScanData.h:24

References fCleanDataIndex, fSaveType, fTreeArrayIndex, fWords, QwScanData(), VQwSubsystem::VQwSubsystem(), and VQwSubsystemParity::VQwSubsystemParity().

+ Here is the call graph for this function:

◆ ~QwScanData()

QwScanData::~QwScanData ( )
default

Member Function Documentation

◆ AccumulateRunningSum()

void QwScanData::AccumulateRunningSum ( VQwSubsystem * value,
Int_t count = 0,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

Update the running sums for devices.

Implements VQwSubsystemParity.

Definition at line 157 of file QwScanData.cc.

158{
159 // No-op
160 return;
161}

References VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ ApplySingleEventCuts()

Bool_t QwScanData::ApplySingleEventCuts ( )
overridevirtual

Apply the single event cuts.

Implements VQwSubsystemParity.

Definition at line 144 of file QwScanData.cc.

145{
146 // Apply cuts here
147 // By Default, we have none
148 return true;
149}

◆ CalculateRunningAverage()

void QwScanData::CalculateRunningAverage ( )
overridevirtual

Calculate the average for all good events.

Implements VQwSubsystemParity.

Definition at line 198 of file QwScanData.cc.

199{
200 // No-op
201 return;
202}

◆ CheckCleanDataIndex()

bool QwScanData::CheckCleanDataIndex ( ) const
private

Definition at line 297 of file QwScanData.cc.

References fCleanDataIndex.

Referenced by LoadChannelMap(), SetCleanData(), and SetCleanDataIndex().

+ Here is the caller graph for this function:

◆ CheckForBurpFail()

Bool_t QwScanData::CheckForBurpFail ( const VQwSubsystem * subsys)
overridevirtual

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

Implements VQwSubsystemParity.

Definition at line 162 of file QwScanData.cc.

163{
164 // Check for Burb failure
165 // By default, we succeed
166 return kFALSE;
167}

References VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ ClearEventData()

void QwScanData::ClearEventData ( )
overridevirtual

Implements VQwSubsystem.

Definition at line 116 of file QwScanData.cc.

117{
118 for(auto & word : fWords) word.ClearEventData();
119}

References VQwSubsystem::ClearEventData(), and fWords.

+ Here is the call graph for this function:

◆ ConstructBranch() [1/2]

void QwScanData::ConstructBranch ( TTree * tree,
TString & prefix )
inlineoverridevirtual

Construct the branch and tree vector.

Construct the branches for this subsystem.

Parameters
treeOutput ROOT tree.
prefixName prefix for all branch names.

Implements VQwSubsystem.

Definition at line 71 of file QwScanData.h.

71{ throw std::runtime_error("QwScanData::ConstructBranch() is not supported"); };

◆ ConstructBranch() [2/2]

void QwScanData::ConstructBranch ( TTree * tree,
TString & prefix,
QwParameterFile & trim_file )
inlineoverridevirtual

Construct the branch and tree vector based on the trim file.

Construct the branches for this subsystem using a trim file.

Parameters
treeOutput ROOT tree.
prefixName prefix for all branch names.
trim_fileTrim file describing which branches to construct.

Implements VQwSubsystem.

Definition at line 72 of file QwScanData.h.

72{ throw std::runtime_error("QwScanData::ConstructBranch() is not supported"); };

◆ ConstructBranchAndVector()

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

Construct the branch and tree vector.

Construct the branch and fill the provided values vector.

Parameters
treeOutput ROOT tree to which branches are added.
prefixName prefix for all branch names.
valuesVector that will be filled by FillTreeVector.

Implements VQwSubsystem.

Definition at line 222 of file QwScanData.cc.

223{
224 SetSaveType(prefix);
226 fTreeArrayIndex = values.size();
227 for (size_t i=0; i<fWords.size(); i++) {
228 TString basename = fWords[i].fWordName;
229 values.push_back(basename.Data(), 'I');
230 tree->Branch(basename, &(values[fTreeArrayIndex + i]), values.LeafList(fTreeArrayIndex + i).c_str());
231 }
232 }
233}
size_type size() const noexcept
Definition QwRootFile.h:83
std::string LeafList(size_type start_index=0) const
Definition QwRootFile.h:230
void push_back(const std::string &name, const char type='D')
Definition QwRootFile.h:197
void SetSaveType(TString const &prefix)

References fSaveType, fTreeArrayIndex, fWords, kSAVE_ASYM, kSAVE_EVT, QwRootTreeBranchVector::LeafList(), QwRootTreeBranchVector::push_back(), SetSaveType(), and QwRootTreeBranchVector::size().

+ Here is the call graph for this function:

◆ ConstructHistograms() [1/2]

void QwScanData::ConstructHistograms ( )
inlineoverridevirtual

Construct the histograms for this subsystem.

Reimplemented from VQwSubsystem.

Definition at line 59 of file QwScanData.h.

59{ std::runtime_error("QwScanData::ConstructHistograms() is not supported"); }

◆ ConstructHistograms() [2/2]

void QwScanData::ConstructHistograms ( TDirectory * folder,
TString & prefix )
inlineoverridevirtual

Construct the histograms for this subsystem in a folder with a prefix.

Implements VQwSubsystem.

Definition at line 60 of file QwScanData.h.

60{ std::runtime_error("QwScanData::ConstructHistograms() is not supported"); }

◆ DeaccumulateRunningSum()

void QwScanData::DeaccumulateRunningSum ( VQwSubsystem * value,
Int_t ErrorMask = 0xFFFFFFF )
overridevirtual

remove one entry from the running sums for devices

Implements VQwSubsystemParity.

Definition at line 169 of file QwScanData.cc.

170{
171 // No-op
172 return;
173}

References VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ FillDB()

void QwScanData::FillDB ( QwParityDB * ,
TString  )
inlineoverridevirtual

Fill the database.

Reimplemented from VQwSubsystemParity.

Definition at line 35 of file QwScanData.h.

35{ throw std::runtime_error("QwScanData::FillDB() is not supported" ); }

◆ FillDB_MPS()

void QwScanData::FillDB_MPS ( QwParityDB * ,
TString  )
inlineoverridevirtual

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

Reimplemented from VQwSubsystemParity.

Definition at line 34 of file QwScanData.h.

34{ throw std::runtime_error("QwScanData::FillDB_MPS() is not supported"); }

◆ FillErrDB()

void QwScanData::FillErrDB ( QwParityDB * ,
TString  )
inlineoverridevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 36 of file QwScanData.h.

36{ throw std::runtime_error("QwScanData::FillErrDB() is not supported"); }

◆ FillHistograms()

void QwScanData::FillHistograms ( )
inlineoverridevirtual

Fill the histograms for this subsystem.

Implements VQwSubsystem.

Definition at line 61 of file QwScanData.h.

61{ std::runtime_error("QwScanData::FillHistograms() is not supported"); }

◆ FillTreeVector()

void QwScanData::FillTreeVector ( QwRootTreeBranchVector & values) const
overridevirtual

Fill the tree vector.

Fill the tree export vector with the current event values.

Parameters
valuesOutput vector to be filled.

Implements VQwSubsystem.

Definition at line 235 of file QwScanData.cc.

236{
237
239 int index = fTreeArrayIndex;
240 for (auto& word : fWords){
241 values.SetValue(index++, word.fValue);
242 }
243 }
244}
void SetValue(size_type index, Double_t val)
Definition QwRootFile.h:110

References fSaveType, fTreeArrayIndex, fWords, kSAVE_ASYM, kSAVE_EVT, and QwRootTreeBranchVector::SetValue().

+ Here is the call graph for this function:

◆ GetEventcutErrorFlag()

UInt_t QwScanData::GetEventcutErrorFlag ( )
overridevirtual

Return the error flag to the top level routines related to stability checks and ErrorFlag updates.

Implements VQwSubsystemParity.

Definition at line 151 of file QwScanData.cc.

152{
153 // Return errors here
154 // By default, we have none
155 return 0;
156}

◆ IncrementErrorCounters()

void QwScanData::IncrementErrorCounters ( )
overridevirtual

Increment the error counters.

Implements VQwSubsystemParity.

Definition at line 175 of file QwScanData.cc.

176{
177 // No-op
178 return;
179}

◆ LoadChannelMap()

Int_t QwScanData::LoadChannelMap ( TString mapfile)
overridevirtual

Mandatory map file definition.

Implements VQwSubsystem.

Definition at line 18 of file QwScanData.cc.

19{
20 // Open the Param file
21 QwParameterFile mapstr(mapfile.Data());
22 mapstr.EnableGreediness();
23 mapstr.SetCommentChars("!");
24
25 fDetectorMaps.insert(mapstr.GetParamFileNameContents());
26
27 while (mapstr.ReadNextLine()) {
28 // This sets fCurrentROC_ID and fCurrentBank_ID
30 mapstr.TrimComment(); // Remove everything after a comment character.
31 mapstr.TrimWhitespace(); // Get rid of leading and trailing whitespace
32 if (mapstr.LineIsEmpty()) continue;
33
34 // Break this line into tokens to process it.
35 TString modtype = mapstr.GetTypedNextToken<TString>();
36 UInt_t modnum = mapstr.GetTypedNextToken<UInt_t>();
37 UInt_t channum = mapstr.GetTypedNextToken<UInt_t>();
38 TString name = mapstr.GetTypedNextToken<TString>();
39 modtype.ToUpper();
40
41 if(modtype != "WORD") {
42 QwError << "Unrecognized module type " << modtype << QwLog::endl;
43 continue;
44 }
45 // Register data channel type
46 Int_t subbank = GetSubbankIndex();
47 QwVerbose << "Registering " << modtype << " " << name
48 << std::hex
49 << " in ROC 0x" << fCurrentROC_ID << ", bank 0x" << fCurrentBank_ID
50 << std::dec
51 << " at mod " << modnum << ", chan " << channum
52 << QwLog::endl;
53 fWords.emplace_back( QwWord{subbank, 0, modtype, name, "", -1} );
55 SetCleanDataIndex(fWords.size()-1);
56 }
57 }
58 if(CheckCleanDataIndex() == false) {
59 QwError << "fCleanDataIndex is not set inside QwScanData Subsystem" << QwLog::endl;
60 }
61 return 0;
62}
#define QwVerbose
Predefined log drain for verbose messages.
Definition QwLog.h:54
#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
BankID_t fCurrentBank_ID
Bank ID (and Marker word) that is currently being processed;.
Int_t GetSubbankIndex() const
void RegisterRocBankMarker(QwParameterFile &mapstr)
std::map< TString, TString > fDetectorMaps
Map of file name to full path or content.
ROCID_t fCurrentROC_ID
ROC ID that is currently being processed.
void SetCleanDataIndex(Int_t index)
bool CheckCleanDataIndex() const
static char const *const fCleanWordName
Definition QwScanData.h:19

References CheckCleanDataIndex(), QwParameterFile::EnableGreediness(), QwLog::endl(), QwScanData::CleanDataIndex::fCleanWordName, VQwSubsystem::fCurrentBank_ID, VQwSubsystem::fCurrentROC_ID, VQwSubsystem::fDetectorMaps, fWords, QwParameterFile::GetParamFileNameContents(), VQwSubsystem::GetSubbankIndex(), QwParameterFile::GetTypedNextToken(), QwParameterFile::LineIsEmpty(), QwError, QwVerbose, QwParameterFile::ReadNextLine(), VQwSubsystem::RegisterRocBankMarker(), SetCleanDataIndex(), QwParameterFile::SetCommentChars(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

+ Here is the call graph for this function:

◆ LoadEventCuts()

Int_t VQwSubsystemParity::LoadEventCuts ( TString filename)
inlineoverridevirtual

Load the event cuts file.

Reimplemented from VQwSubsystem.

Definition at line 88 of file VQwSubsystemParity.h.

88 {
89 Int_t eventcut_flag = 1;
90
91 // Open the file
92 QwParameterFile mapstr(filename.Data());
93 fDetectorMaps.insert(mapstr.GetParamFileNameContents());
94 this->LoadEventCuts_Init();
95
96 while (mapstr.ReadNextLine()){
97 mapstr.TrimComment('!'); // Remove everything after a '!' character.
98 mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
99 if (mapstr.LineIsEmpty())
100 continue;
101 TString varname, varvalue;
102 if (mapstr.HasVariablePair("=",varname,varvalue)){
103 if (varname == "EVENTCUTS"){
104 eventcut_flag = QwParameterFile::GetUInt(varvalue);
105 }
106 } else {
107 this->LoadEventCuts_Line(mapstr, varvalue, eventcut_flag);
108 }
109 }
110
111 this->LoadEventCuts_Fin(eventcut_flag);
112 mapstr.Close();
113 return 0;
114 };
static UInt_t GetUInt(const TString &varvalue)
virtual void LoadEventCuts_Init()
virtual void LoadEventCuts_Fin(Int_t &)
virtual void LoadEventCuts_Line(QwParameterFile &, TString &, Int_t &)

◆ LoadEventCuts_Fin()

virtual void VQwSubsystemParity::LoadEventCuts_Fin ( Int_t & )
inlinevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 117 of file VQwSubsystemParity.h.

117{};

◆ LoadEventCuts_Init()

virtual void VQwSubsystemParity::LoadEventCuts_Init ( )
inlinevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 115 of file VQwSubsystemParity.h.

115{};

◆ LoadEventCuts_Line()

virtual void VQwSubsystemParity::LoadEventCuts_Line ( QwParameterFile & ,
TString & ,
Int_t &  )
inlinevirtual

Reimplemented from VQwSubsystemParity.

Definition at line 116 of file VQwSubsystemParity.h.

116{};

◆ LoadInputParameters()

Int_t QwScanData::LoadInputParameters ( TString mapfile)
inlineoverridevirtual

Mandatory parameter file definition.

Implements VQwSubsystem.

Definition at line 55 of file QwScanData.h.

55{ throw std::runtime_error("QwScanData::LoadInputParameters() is not supported"); return 0; }

◆ operator+=()

VQwSubsystem & QwScanData::operator+= ( VQwSubsystem * value)
overridevirtual

Implements VQwSubsystemParity.

Definition at line 77 of file QwScanData.cc.

78{
79 if(Compare(value)){
80 QwScanData* input = dynamic_cast<QwScanData*>(value);
81 if( !std::equal(
82 fWords.cbegin(),
83 fWords.cend(),
84 input->fWords.cbegin(),
85 input->fWords.cend(),
86 [](QwWord const& q1, QwWord const& q2){
87 return q1.fValue == q2.fValue;
88 })) {
90 }
91 }
92 return *this;
93}
Bool_t Compare(VQwSubsystem *source)
bool SetCleanData(CleanDataVal clean_flag)
QwScanData(TString const &name)
Definition QwScanData.cc:6

References VQwSubsystem::Compare(), fWords, kUNCLEAN, QwScanData(), SetCleanData(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ operator-=()

VQwSubsystem & QwScanData::operator-= ( VQwSubsystem * value)
overridevirtual

Implements VQwSubsystemParity.

Definition at line 97 of file QwScanData.cc.

98{
99 if(Compare(value)){
100 QwScanData* input = dynamic_cast<QwScanData*>(value);
101 if( !std::equal(
102 fWords.cbegin(),
103 fWords.cend(),
104 input->fWords.cbegin(),
105 input->fWords.cend(),
106 [](QwWord const& q1, QwWord const& q2){
107 return q1.fValue == q2.fValue;
108 })) {
110 }
111 }
112 return *this;
113}

References VQwSubsystem::Compare(), fWords, kUNCLEAN, QwScanData(), SetCleanData(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ operator=()

VQwSubsystem & QwScanData::operator= ( VQwSubsystem * value)
overridevirtual

Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsystem *value) by VQwSubsystem::operator=(value)

Implements VQwSubsystemParity.

Definition at line 64 of file QwScanData.cc.

65{
66 if(Compare(value))
67 {
69 QwScanData* input = dynamic_cast<QwScanData*>(value);
70 fWords = input->fWords;
71 }
72 return *this;
73}
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...

References VQwSubsystem::Compare(), fWords, VQwSubsystem::operator=(), QwScanData(), and VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ PrintErrorCounters()

void QwScanData::PrintErrorCounters ( ) const
overridevirtual

Implements VQwSubsystemParity.

Definition at line 204 of file QwScanData.cc.

205{
206 // No-op
207 return;
208}

◆ ProcessConfigurationBuffer()

Int_t QwScanData::ProcessConfigurationBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )
inlineoverridevirtual

Implements VQwSubsystem.

Definition at line 56 of file QwScanData.h.

56{ throw std::runtime_error("QwScanData::ProcessConfigurationBuffer() is not supported"); return 0; }

◆ ProcessEvBuffer()

Int_t QwScanData::ProcessEvBuffer ( const ROCID_t roc_id,
const BankID_t bank_id,
UInt_t * buffer,
UInt_t num_words )
overridevirtual

TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware version.

Implements VQwSubsystem.

Definition at line 121 of file QwScanData.cc.

122{
123 UInt_t words_read = 0;
124
125 // Get the subbank index (or -1 when no match)
126 Int_t subbank = GetSubbankIndex(roc_id, bank_id);
127 if (subbank >= 0 && num_words > 0) {
128 words_read++;
129 for(std::size_t i = 0; i < fWords.size(); i++)
130 fWords[i].fValue = buffer[i];
131 words_read = num_words;
132 }
133
134 return words_read;
135}

References fWords, and VQwSubsystem::GetSubbankIndex().

+ Here is the call graph for this function:

◆ ProcessEvent()

void QwScanData::ProcessEvent ( )
overridevirtual

Implements VQwSubsystem.

Definition at line 137 of file QwScanData.cc.

138{
139 // Do post-processing here
140 // By Default, we have none
141 return;
142}

◆ Ratio()

void QwScanData::Ratio ( VQwSubsystem * numer,
VQwSubsystem * denom )
overridevirtual

Implements VQwSubsystemParity.

Definition at line 192 of file QwScanData.cc.

193{
194 // No-op
195 return;
196}

References VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

◆ Scale()

void QwScanData::Scale ( Double_t factor)
overridevirtual

Implements VQwSubsystemParity.

Definition at line 180 of file QwScanData.cc.

181{
182 // No-op
183 return;
184}

◆ SetCleanData()

bool QwScanData::SetCleanData ( CleanDataVal clean_flag)
private

Definition at line 308 of file QwScanData.cc.

309{
310 bool status = false;
311 if(CheckCleanDataIndex()) {
312 fWords[fCleanDataIndex.fIndex].fValue = static_cast<int>(clean_flag);
313 status = true;
314 }
315 return status;
316}

References CheckCleanDataIndex(), fCleanDataIndex, and fWords.

Referenced by operator+=(), and operator-=().

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

◆ SetCleanDataIndex()

void QwScanData::SetCleanDataIndex ( Int_t index)
private

Definition at line 281 of file QwScanData.cc.

282{
283 if(CheckCleanDataIndex() == false) {
284 fCleanDataIndex.fIndex= fWords.size()-1;
285 } else {
286 QwWarning << "ScanData Word already Set! " << '\n';
287 QwWarning << "\tCurrent: " << fCleanDataIndex.fIndex << '\n';
288 QwWarning << "\tFound: " << index << QwLog::endl;
289 }
290
291}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44

References CheckCleanDataIndex(), QwLog::endl(), fCleanDataIndex, fWords, and QwWarning.

Referenced by LoadChannelMap().

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

◆ SetSaveType()

void QwScanData::SetSaveType ( TString const & prefix)
private

Definition at line 210 of file QwScanData.cc.

211{
212 Ssiz_t len;
213 if (TRegexp("diff_").Index(prefix,&len) == 0
214 || TRegexp("asym[1-9]+_").Index(prefix,&len) == 0
215 || TRegexp("yield_").Index(prefix,&len) == 0)
217 else if (TRegexp("asym").Index(prefix,&len) == 0)
219 else
221}

References fSaveType, kNO_SAVE, kSAVE_ASYM, and kSAVE_EVT.

Referenced by ConstructBranchAndVector().

+ Here is the caller graph for this function:

◆ UpdateErrorFlag()

void QwScanData::UpdateErrorFlag ( const VQwSubsystem * ev_error)
overridevirtual

update the error flag in the subsystem level from the top level routines related to stability checks. This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem

Implements VQwSubsystemParity.

Definition at line 186 of file QwScanData.cc.

187{
188 // No-op
189 return;
190}

References VQwSubsystem::VQwSubsystem().

+ Here is the call graph for this function:

Field Documentation

◆ fCleanDataIndex

CleanDataIndex QwScanData::fCleanDataIndex {}
private

Definition at line 24 of file QwScanData.h.

24{};

Referenced by CheckCleanDataIndex(), QwScanData(), SetCleanData(), and SetCleanDataIndex().

◆ fSaveType

RootSaveType QwScanData::fSaveType {RootSaveType::kNO_SAVE}
private

◆ fTreeArrayIndex

Int_t QwScanData::fTreeArrayIndex {-1}
private

Definition at line 25 of file QwScanData.h.

25{-1};

Referenced by ConstructBranchAndVector(), FillTreeVector(), and QwScanData().

◆ fWords


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