JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwCombinerSubsystem.h
Go to the documentation of this file.
1/*!
2 * \file QwCombinerSubsystem.h
3 * \brief Combiner subsystem for parity analysis data handling
4 * \author meeker
5 * \date 2011-08-11
6 */
7
8#pragma once
9
10// headers
11#include "VQwSubsystemParity.h"
13#include "QwCombiner.h"
14
15class QwParameterFile;
16
17/**
18 * \class QwCombinerSubsystem
19 *
20 * \brief
21 *
22 */
23
25 public MQwSubsystemCloneable<QwCombinerSubsystem>,
26 public QwCombiner
27{
28
29 public:
30 // Constructors
31 /// \brief Constructor with just name.
32 QwCombinerSubsystem(const TString name)
33 : VQwSubsystem(name), VQwSubsystemParity(name), QwCombiner(name) { }
34
35 // Copy Constructor
37 : VQwSubsystem(source), VQwSubsystemParity(source), QwCombiner(source) { }
38
39 // Destructor
40 ~QwCombinerSubsystem() override;
41
42 std::shared_ptr<VQwSubsystem> GetSharedPointerToStaticObject();
43
44 /// \brief Update the running sums
45 void AccumulateRunningSum(VQwSubsystem* input, Int_t count=0, Int_t ErrorMask=0xFFFFFFF) override;
46 void DeaccumulateRunningSum(VQwSubsystem* value, Int_t ErrorMask=0xFFFFFFF) override;
47 /// \brief Calculate the average for all good events
48 void CalculateRunningAverage() override;
49 /// \brief Print values for all channels
50 void PrintValue() const override;
51
52 void ProcessData() override{
54 }
55
56 /// \brief Overloaded Operators
57 VQwSubsystem& operator= (VQwSubsystem *value) override;
58 VQwSubsystem& operator+= (VQwSubsystem *value) override;
59 VQwSubsystem& operator-= (VQwSubsystem *value) override;
62 void Ratio(VQwSubsystem* value1, VQwSubsystem* value2) override;
63 void Scale(Double_t value) override;
64
65 void ConstructBranchAndVector(TTree *tree, TString& prefix, QwRootTreeBranchVector &values) override{
66 QwCombiner::ConstructBranchAndVector(tree,prefix,values);
67 }
68 void FillTreeVector(QwRootTreeBranchVector &values) const override{
70 }
71#ifdef HAS_RNTUPLE_SUPPORT
72 void ConstructNTupleAndVector(std::unique_ptr<ROOT::RNTupleModel>& model, TString& prefix, std::vector<Double_t>& values, std::vector<std::shared_ptr<Double_t>>& fieldPtrs) override{
73 QwCombiner::ConstructNTupleAndVector(model, prefix, values, fieldPtrs);
74 }
75 void FillNTupleVector(std::vector<Double_t>& values) const override{
76 QwCombiner::FillNTupleVector(values);
77 }
78#endif // HAS_RNTUPLE_SUPPORT
79
80 void ConstructHistograms(TDirectory *folder, TString &prefix) override;
81 void FillHistograms() override;
82 void DeleteHistograms();
83 void ConstructBranch(TTree *tree, TString & prefix) override;
84 void ConstructBranch(TTree *tree, TString & prefix, QwParameterFile& trim_file) override;
85
86
87
88
89 //update the error flag in the subsystem level from the top level routines related to stability checks
90 // This will uniquely update the errorflag at each channel based on the error flag in the corresponding channel in the ev_error subsystem
91 void UpdateErrorFlag(const VQwSubsystem *ev_error) override;
92
93
94 /// \brief Derived functions
95 // not sure if there should be empty definition, no definition or defined
96 Int_t LoadChannelMap(TString) override;
97 Int_t LoadInputParameters(TString) override;
98 Int_t LoadEventCuts(TString) override;
99 void ClearEventData() override{
100 for (size_t i = 0; i < fOutputVar.size(); ++i) {
101 if (fOutputVar.at(i) != NULL) {
102 fOutputVar.at(i)->ClearEventData();
103 }
104 }
105 /*
106 Iterator_HdwChan element;
107 for (element = fOutputVar.begin(); element != fOutputVar.end(); ++element) {
108 if (*element != NULL) {
109 (*element)->ClearEventData();
110 }
111 }
112 */
113 };
114 Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) override;
115 Int_t ProcessEvBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t* buffer, UInt_t num_words) override;
116 void ProcessEvent() override{};
117
118 Bool_t ApplySingleEventCuts() override;
119
120 Bool_t CheckForBurpFail(const VQwSubsystem *ev_error) override{
121 return kFALSE;
122 };
123
124 void IncrementErrorCounters() override;
125 void PrintErrorCounters() const override;
126 UInt_t GetEventcutErrorFlag() override;
127
128
129 private:
130
131 /**
132 * Default Constructor
133 *
134 * Error: tries to call default constructors of base class,
135 * QwCombiner() is private
136 */
137 // QwCombinerSubsystem() {};
138
139
140}; // class QwCombinerSubsystem
ULong64_t BankID_t
Definition QwTypes.h:21
UInt_t ROCID_t
Definition QwTypes.h:20
Subsystem array container for parity analysis with asymmetry calculations.
Virtual base class for parity analysis subsystems.
Data combiner handler for channel operations.
Configuration file parser with flexible tokenization and search capabilities.
A helper class to manage a vector of branch entries for ROOT trees.
Definition QwRootFile.h:53
Base class for subsystems implementing container-delegation pattern.
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
VQwSubsystem(const TString &name)
Constructor with name.
QwCombiner(const TString &name)
Constructor with name.
Definition QwCombiner.cc:28
void ProcessData() override
VQwSubsystem & operator=(VQwSubsystem *value) override
Overloaded Operators.
std::shared_ptr< VQwSubsystem > GetSharedPointerToStaticObject()
void ProcessEvent() override
VQwSubsystem & operator*=(VQwSubsystem *value)
QwCombinerSubsystem(const QwCombinerSubsystem &source)
Int_t ProcessConfigurationBuffer(const ROCID_t roc_id, const BankID_t bank_id, UInt_t *buffer, UInt_t num_words) override
void PrintValue() const override
Print values for all channels.
void ClearEventData() override
void FillHistograms() override
Fill the histograms for this subsystem.
void ProcessData() override
void PrintErrorCounters() const override
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values) override
Construct the branch and tree vector.
void ConstructBranch(TTree *tree, TString &prefix) override
Construct the branch and tree vector.
VQwSubsystem & operator/=(VQwSubsystem *value)
VQwSubsystem & operator+=(VQwSubsystem *value) override
UInt_t GetEventcutErrorFlag() override
Return the error flag to the top level routines related to stability checks and ErrorFlag updates.
void Scale(Double_t value) override
void DeaccumulateRunningSum(VQwSubsystem *value, Int_t ErrorMask=0xFFFFFFF) override
remove one entry from the running sums for devices
Int_t LoadInputParameters(TString) override
Mandatory parameter file definition.
void IncrementErrorCounters() override
Increment the error counters.
QwCombinerSubsystem(const TString name)
Constructor with just name.
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 v...
VQwSubsystem & operator-=(VQwSubsystem *value) override
Bool_t ApplySingleEventCuts() override
Apply the single event cuts.
Int_t LoadEventCuts(TString) override
Optional event cut file.
Bool_t CheckForBurpFail(const VQwSubsystem *ev_error) override
Report the number of events failed due to HW and event cut failures.
void CalculateRunningAverage() override
Calculate the average for all good events.
void FillTreeVector(QwRootTreeBranchVector &values) const override
Fill the tree vector.
void Ratio(VQwSubsystem *value1, VQwSubsystem *value2) override
void FillTreeVector(QwRootTreeBranchVector &values) const
void AccumulateRunningSum()
std::vector< VQwHardwareChannel * > fOutputVar
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
VQwSubsystemParity()
Private default constructor (not implemented, will throw linker error on use)
virtual UInt_t UpdateErrorFlag()
Uses the error flags of contained data elements to update Returns the error flag to the top level rou...