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

Data handler that forms linear combinations of channels. More...

#include <QwCombiner.h>

+ Inheritance diagram for QwCombiner:
+ Collaboration diagram for QwCombiner:

Public Types

typedef std::vector< VQwHardwareChannel * >::iterator Iterator_HdwChan
 
typedef std::vector< VQwHardwareChannel * >::const_iterator ConstIterator_HdwChan
 
- Public Types inherited from VQwDataHandler
enum  EQwHandleType {
  kHandleTypeUnknown =0 , kHandleTypeMps , kHandleTypeAsym , kHandleTypeDiff ,
  kHandleTypeYield
}
 
typedef std::vector< VQwHardwareChannel * >::iterator Iterator_HdwChan
 
typedef std::vector< VQwHardwareChannel * >::const_iterator ConstIterator_HdwChan
 

Public Member Functions

 QwCombiner (const TString &name)
 Constructor with name.
 
 QwCombiner (const QwCombiner &source)
 Copy constructor.
 
 ~QwCombiner () override
 Virtual destructor.
 
Int_t LoadChannelMap (const std::string &mapfile) override
 Load the channels and sensitivities.
 
Int_t ConnectChannels (QwSubsystemArrayParity &event) override
 Connect to Channels (event only)
 
Int_t ConnectChannels (QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) override
 Connect to Channels (asymmetry/difference only)
 
void ProcessData () override
 
- Public Member Functions inherited from VQwDataHandler
 VQwDataHandler (const TString &name)
 
 VQwDataHandler (const VQwDataHandler &source)
 
virtual void ParseConfigFile (QwParameterFile &file)
 
void SetPointer (QwHelicityPattern *ptr)
 
void SetPointer (QwSubsystemArrayParity *ptr)
 
virtual Int_t ConnectChannels (QwSubsystemArrayParity &, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff)
 
Int_t ConnectChannels (QwHelicityPattern &helicitypattern)
 
virtual void UpdateBurstCounter (Short_t burstcounter)
 
virtual void FinishDataHandler ()
 
 ~VQwDataHandler () override
 
TString GetName ()
 
virtual void ClearEventData ()
 
void InitRunningSum ()
 
void AccumulateRunningSum ()
 
virtual void AccumulateRunningSum (VQwDataHandler &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
 
void CalculateRunningAverage ()
 
void PrintValue () const
 
void WritePromptSummary (QwPromptSummary *ps, TString type)
 
virtual void ConstructTreeBranches (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="")
 
virtual void FillTreeBranches (QwRootFile *treerootfile)
 
virtual void ConstructNTupleFields (QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="")
 RNTuple methods.
 
virtual void FillNTupleFields (QwRootFile *treerootfile)
 
virtual void ConstructHistograms (TDirectory *, TString &)
 Construct the histograms in a folder with a prefix.
 
virtual void FillHistograms ()
 Fill the histograms.
 
void FillTreeVector (QwRootTreeBranchVector &values) const
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
 
void SetRunLabel (TString x)
 
Int_t LoadChannelMap ()
 
Bool_t PublishInternalValues () const override
 Publish all variables of the subsystem.
 
Bool_t PublishByRequest (TString device_name) override
 Try to publish an internal variable matching the submitted name.
 
- Public Member Functions inherited from MQwPublishable_child< QwDataHandlerArray, VQwDataHandler >
 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 (QwDataHandlerArray *parent)
 Set the parent container for this child object.
 
QwDataHandlerArrayGetParent () const
 Get the parent container for this child object.
 
- Public Member Functions inherited from MQwCloneable< VQwDataHandler, QwCombiner >
 ~MQwCloneable () override
 Virtual destructor.
 
VQwDataHandlerClone () const override
 Concrete clone method.
 
const VQwFactory< VQwDataHandler > * Factory () const override
 Factory getter.
 
- Public Member Functions inherited from VQwCloneable< VQwDataHandler >
virtual ~VQwCloneable ()
 Virtual destructor.
 
std::string GetClassName () const
 Get demangled name of this class.
 

Protected Member Functions

 QwCombiner ()
 Default constructor (Protected for child class access)
 
- Protected Member Functions inherited from VQwDataHandler
 VQwDataHandler ()
 
void SetEventcutErrorFlagPointer (const UInt_t *errorflagptr)
 
UInt_t GetEventcutErrorFlag () const
 
std::pair< EQwHandleType, std::string > ParseHandledVariable (const std::string &variable)
 
void CalcOneOutput (const VQwHardwareChannel *dv, VQwHardwareChannel *output, std::vector< const VQwHardwareChannel * > &ivs, std::vector< Double_t > &sens)
 
- Protected Member Functions inherited from MQwPublishable_child< QwDataHandlerArray, VQwDataHandler >
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 VQwHardwareChannelRequestExternalPointer (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

UInt_t fErrorFlagMask
 Error flag mask.
 
const UInt_t * fErrorFlagPointer
 
std::vector< std::vector< EQwHandleType > > fIndependentType
 List of channels to use in the combiner.
 
std::vector< std::vector< std::string > > fIndependentName
 
std::vector< std::vector< const VQwHardwareChannel * > > fIndependentVar
 
std::vector< std::vector< Double_t > > fSensitivity
 
- Protected Attributes inherited from VQwDataHandler
Int_t fPriority
 
Short_t fBurstCounter
 When a datahandler array is processed, handlers with lower priority will be processed before handlers with higher priority.
 
TString fName
 
std::string fMapFile
 
std::string fTreeName
 
std::string fTreeComment
 
std::string fPrefix
 
TString run_label
 
const UInt_t * fErrorFlagPtr
 Error flag pointer.
 
QwSubsystemArrayParityfSubsystemArray
 Single event pointer.
 
QwHelicityPatternfHelicityPattern
 Helicity pattern pointer.
 
std::vector< std::string > fDependentFull
 
std::vector< EQwHandleTypefDependentType
 
std::vector< std::string > fDependentName
 
std::vector< const VQwHardwareChannel * > fDependentVar
 
std::vector< Double_t > fDependentValues
 
std::vector< VQwHardwareChannel * > fOutputVar
 
std::vector< Double_t > fOutputValues
 
std::vector< std::vector< TString > > fPublishList
 
std::string ParseSeparator
 
Bool_t fKeepRunningSum
 
Bool_t fRunningsumFillsTree
 
VQwDataHandlerfRunningsum
 

Additional Inherited Members

- Static Public Member Functions inherited from MQwCloneable< VQwDataHandler, QwCombiner >
static VQwDataHandlerCreate (const std::string &name)
 Object creation.
 
static QwCombinerCast (QwCombiner *type)
 Object dynamic cast.
 

Detailed Description

Data handler that forms linear combinations of channels.

QwCombiner connects to one or more input variables (yields/asymmetries/ differences) and computes configured linear combinations using provided sensitivities. It is typically used to derive composite diagnostics or to prepare inputs for higher-level analyses.

Definition at line 23 of file QwCombiner.h.

Member Typedef Documentation

◆ ConstIterator_HdwChan

typedef std::vector<VQwHardwareChannel*>::const_iterator QwCombiner::ConstIterator_HdwChan

Definition at line 27 of file QwCombiner.h.

◆ Iterator_HdwChan

typedef std::vector<VQwHardwareChannel*>::iterator QwCombiner::Iterator_HdwChan

Definition at line 26 of file QwCombiner.h.

Constructor & Destructor Documentation

◆ QwCombiner() [1/3]

QwCombiner::QwCombiner ( const TString & name)

Constructor with name.

Definition at line 25 of file QwCombiner.cc.

26: VQwDataHandler(name)
27{
28 ParseSeparator = ":";
29 fKeepRunningSum = kTRUE;
32}
const UInt_t * fErrorFlagPointer
Definition QwCombiner.h:61
UInt_t fErrorFlagMask
Error flag mask.
Definition QwCombiner.h:60
std::string ParseSeparator

References fErrorFlagMask, fErrorFlagPointer, VQwDataHandler::fKeepRunningSum, VQwDataHandler::ParseSeparator, and VQwDataHandler::VQwDataHandler().

Referenced by QwCombiner(), QwCombinerSubsystem::QwCombinerSubsystem(), and QwCombinerSubsystem::QwCombinerSubsystem().

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

◆ QwCombiner() [2/3]

QwCombiner::QwCombiner ( const QwCombiner & source)

Copy constructor.

Definition at line 34 of file QwCombiner.cc.

35: VQwDataHandler(source)
36{
39}

References fErrorFlagMask, fErrorFlagPointer, QwCombiner(), and VQwDataHandler::VQwDataHandler().

+ Here is the call graph for this function:

◆ ~QwCombiner()

QwCombiner::~QwCombiner ( )
override

Virtual destructor.

Destructor.

Definition at line 42 of file QwCombiner.cc.

43{
44 Iterator_HdwChan element;
45 for (element = fOutputVar.begin(); element != fOutputVar.end(); element++) {
46 if (*element != NULL){
47 delete *element;
48 }
49 }
50 fOutputVar.clear();
51}
std::vector< VQwHardwareChannel * >::iterator Iterator_HdwChan
Definition QwCombiner.h:26
std::vector< VQwHardwareChannel * > fOutputVar

References VQwDataHandler::fOutputVar.

◆ QwCombiner() [3/3]

QwCombiner::QwCombiner ( )
inlineprotected

Default constructor (Protected for child class access)

Definition at line 57 of file QwCombiner.h.

57{ };

Member Function Documentation

◆ ConnectChannels() [1/2]

Int_t QwCombiner::ConnectChannels ( QwSubsystemArrayParity & asym,
QwSubsystemArrayParity & diff )
overridevirtual

Connect to Channels (asymmetry/difference only)

Parameters
asymSubsystem array with asymmetries
diffSubsystem array with differences
Returns
0 on success, non-zero on failure

Connect to the dependent and independent channels

Fill vector of pointers to the relevant data elements

Reimplemented from VQwDataHandler.

Definition at line 171 of file QwCombiner.cc.

174{
175 // Return if correction is not enabled
176
177 /// Fill vector of pointers to the relevant data elements
178 fIndependentVar.resize(fDependentName.size());
179 fDependentVar.resize(fDependentName.size());
180 fOutputVar.resize(fDependentName.size());
181
182 for (size_t dv = 0; dv < fDependentName.size(); dv++) {
183 // Add independent variables
184 for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) {
185 // Get the independent variables
186 const VQwHardwareChannel* iv_ptr = 0;
187 iv_ptr = RequestExternalPointer(fIndependentName.at(dv).at(iv));
188 if (iv_ptr == NULL){
189 switch (fIndependentType.at(dv).at(iv)) {
190 case kHandleTypeAsym:
191 iv_ptr = asym.RequestExternalPointer(fIndependentName.at(dv).at(iv));
192 break;
193 case kHandleTypeDiff:
194 iv_ptr = diff.RequestExternalPointer(fIndependentName.at(dv).at(iv));
195 break;
196 default:
197 QwWarning << "Independent variable for combiner has unknown type."
198 << QwLog::endl;
199 break;
200 }
201 }
202 if (iv_ptr) {
203 fIndependentVar[dv].push_back(iv_ptr);
204 } else {
205 QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for combiner of "
206 << "dependent variable " << fDependentName.at(dv) << " could not be found."
207 << QwLog::endl;
208 }
209 }
210
211 // Get the dependent variables
212 const VQwHardwareChannel* dv_ptr = 0;
213 VQwHardwareChannel* new_chan = NULL;
214 const VQwHardwareChannel* chan = NULL;
215 string name = "";
216 string calc = "calc_";
217
218 if (fDependentType.at(dv)==kHandleTypeMps){
219 // Quietly ignore the MPS type when we're connecting the asym & diff
220 continue;
221 } else if(fDependentName.at(dv).at(0) == '@' ){
222 name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length());
223 }else{
224 dv_ptr = this->RequestExternalPointer(fDependentFull.at(dv));
225 if (dv_ptr==NULL){
226 switch (fDependentType.at(dv)) {
227 case kHandleTypeAsym:
228 dv_ptr = asym.RequestExternalPointer(fDependentName.at(dv));
229 break;
230 case kHandleTypeDiff:
231 dv_ptr = diff.RequestExternalPointer(fDependentName.at(dv));
232 break;
233 default:
234 QwWarning << "QwCombiner::ConnectChannels(QwSubsystemArrayParity& asym, QwSubsystemArrayParity& diff): Dependent variable, "
235 << fDependentName.at(dv)
236 << ", for asym/diff combiner does not have proper type, type=="
237 << fDependentType.at(dv) << "."<< QwLog::endl;
238 break;
239 }
240 }
241
242 name = dv_ptr->GetElementName().Data();
243 name.insert(0, calc);
244
245 new_chan = dv_ptr->Clone(VQwDataElement::kDerived);
246 new_chan->SetElementName(name);
247 new_chan->SetSubsystemName(fName);
248 }
249
250 // alias
251 if(fDependentName.at(dv).at(0) == '@'){
252 //QwMessage << "dv: " << name << QwLog::endl;
253 if (fIndependentVar.at(dv).empty()) {
254 // Throw exception: alias cannot be created without independent variables
255 throw std::runtime_error("Cannot create alias '" + name +
256 "' for dependent variable '" + fDependentName.at(dv) +
257 "': no independent variables found to determine channel type");
258 } else {
259 // Preferred: use Clone() from first independent variable to preserve channel type
260 new_chan = fIndependentVar.at(dv).front()->Clone(VQwDataElement::kDerived);
261 }
262 new_chan->SetElementName(name);
263 new_chan->SetSubsystemName(fName);
264 }
265 // defined type
266 else if(dv_ptr!=NULL){
267 //QwMessage << "dv: " << fDependentName.at(dv) << QwLog::endl;
268 } else {
269 QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, "
270 << "or is not a known channel type." << QwLog::endl;
271 continue;
272 }
273
274 // pair creation
275 if(new_chan != NULL){
276 fDependentVar[dv] = chan;
277 fOutputVar[dv] = new_chan;
278 }
279 }
280
281 // Store error flag pointer
282 QwMessage << "Using asymmetry error flag" << QwLog::endl;
284
285 return 0;
286}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
const VQwHardwareChannel * RequestExternalPointer(const TString &name) const
const VQwHardwareChannel * RequestExternalPointer(const TString &name) const
Retrieve a direct pointer to an external variable Searches for the named variable in external subsyst...
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
void SetSubsystemName(TString sysname)
Set the name of the inheriting subsystem name.
virtual const TString & GetElementName() const
Get the name of this element.
void SetElementName(const TString &name)
Set the name of this element.
virtual VQwHardwareChannel * Clone() const
std::vector< std::vector< std::string > > fIndependentName
Definition QwCombiner.h:65
std::vector< std::vector< const VQwHardwareChannel * > > fIndependentVar
Definition QwCombiner.h:66
std::vector< std::vector< EQwHandleType > > fIndependentType
List of channels to use in the combiner.
Definition QwCombiner.h:64
const UInt_t * GetEventcutErrorFlagPointer() const
std::vector< std::string > fDependentFull
std::vector< const VQwHardwareChannel * > fDependentVar
std::vector< EQwHandleType > fDependentType
std::vector< std::string > fDependentName

References VQwHardwareChannel::Clone(), QwLog::endl(), VQwDataHandler::fDependentFull, VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, VQwDataHandler::fDependentVar, fErrorFlagPointer, fIndependentName, fIndependentType, fIndependentVar, VQwDataHandler::fName, VQwDataHandler::fOutputVar, VQwDataElement::GetElementName(), QwSubsystemArrayParity::GetEventcutErrorFlagPointer(), VQwDataElement::kDerived, VQwDataHandler::kHandleTypeAsym, VQwDataHandler::kHandleTypeDiff, VQwDataHandler::kHandleTypeMps, QwMessage, QwWarning, MQwPublishable< U, T >::RequestExternalPointer(), MQwPublishable_child< QwDataHandlerArray, VQwDataHandler >::RequestExternalPointer(), VQwDataElement::SetElementName(), and VQwDataElement::SetSubsystemName().

+ Here is the call graph for this function:

◆ ConnectChannels() [2/2]

Int_t QwCombiner::ConnectChannels ( QwSubsystemArrayParity & event)
overridevirtual

Connect to Channels (event only)

Parameters
eventSubsystem array with per-MPS yields
Returns
0 on success, non-zero on failure

Connect to the dependent and independent channels

Parameters: event Helicity event structure Returns: Zero on success

Fill vector of pointers to the relevant data elements

Reimplemented from VQwDataHandler.

Definition at line 293 of file QwCombiner.cc.

294{
295 // Return if correction is not enabled
296
297 /// Fill vector of pointers to the relevant data elements
298 fIndependentVar.resize(fDependentName.size());
299 fDependentVar.resize(fDependentName.size());
300 fOutputVar.resize(fDependentName.size());
301
302 for (size_t dv = 0; dv < fDependentName.size(); dv++) {
303
304 // Add independent variables
305 for (size_t iv = 0; iv < fIndependentName.at(dv).size(); iv++) {
306 // Get the independent variables
307 const VQwHardwareChannel* iv_ptr = 0;
308 if(fIndependentType.at(dv).at(iv) == kHandleTypeMps){
309 iv_ptr = event.RequestExternalPointer(fIndependentName.at(dv).at(iv));
310 } else {
311 QwWarning << "Independent variable for MPS combiner has unknown type."
312 << QwLog::endl;
313 }
314 if (iv_ptr) {
315 fIndependentVar[dv].push_back(iv_ptr);
316 } else {
317 QwWarning << "Independent variable " << fIndependentName.at(dv).at(iv) << " for combiner of "
318 << "dependent variable " << fDependentName.at(dv) << " could not be found."
319 << QwLog::endl;
320 }
321 }
322
323 // Get the dependent variables
324 const VQwHardwareChannel* dv_ptr = 0;
325 VQwHardwareChannel* new_chan = NULL;
326 const VQwHardwareChannel* chan = NULL;
327 string name = " s";
328 string calc = "calc_";
329
331 // Quietly skip the asymmetry or difference types.
332 continue;
333 } else if(fDependentType.at(dv) != kHandleTypeMps){
334 QwWarning << "QwCombiner::ConnectChannels(QwSubsystemArrayParity& event): Dependent variable, "
335 << fDependentName.at(dv)
336 << ", for MPS combiner does not have MPS type, type=="
337 << fDependentType.at(dv) << "."<< QwLog::endl;
338 continue;
339 } else {
340 if(fDependentName.at(dv).at(0) == '@' ){
341 name = fDependentName.at(dv).substr(1,fDependentName.at(dv).length());
342 new_chan = fIndependentVar.at(dv).front()->Clone(VQwDataElement::kDerived);
343 new_chan->SetElementName(name);
344 new_chan->SetSubsystemName(fName);
345 } else {
346 dv_ptr = event.RequestExternalPointer(fDependentName.at(dv));
347
348 name = dv_ptr->GetElementName().Data();
349 name.insert(0,calc);
350
351 new_chan = dv_ptr->Clone(VQwDataElement::kDerived);
352 new_chan->SetElementName(name);
353 new_chan->SetSubsystemName(fName);
354 }
355 }
356
357 // alias
358 if(new_chan==NULL){
359 QwWarning << "Dependent variable " << fDependentName.at(dv) << " could not be found, "
360 << "or is not a known channel type." << QwLog::endl;
361 continue;
362 } else {
363 // pair creation
364 fDependentVar[dv] = chan;
365 fOutputVar[dv] = new_chan;
366 }
367 }
368
369 // Store error flag pointer
370 QwMessage << "Using event error flag" << QwLog::endl;
371 fErrorFlagPointer = event.GetEventcutErrorFlagPointer();
372
373 return 0;
374}

References VQwHardwareChannel::Clone(), QwLog::endl(), VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, VQwDataHandler::fDependentVar, fErrorFlagPointer, fIndependentName, fIndependentType, fIndependentVar, VQwDataHandler::fName, VQwDataHandler::fOutputVar, VQwDataElement::GetElementName(), VQwDataElement::kDerived, VQwDataHandler::kHandleTypeAsym, VQwDataHandler::kHandleTypeDiff, VQwDataHandler::kHandleTypeMps, QwMessage, QwWarning, VQwDataElement::SetElementName(), and VQwDataElement::SetSubsystemName().

+ Here is the call graph for this function:

◆ LoadChannelMap()

Int_t QwCombiner::LoadChannelMap ( const std::string & mapfile)
overridevirtual

Load the channels and sensitivities.

Load the channel map

Parameters
mapfileFilename of map file
Returns
Zero when success

Reimplemented from VQwDataHandler.

Definition at line 68 of file QwCombiner.cc.

69{
70 // Open the file
71 QwParameterFile map(mapfile);
72
73 // Read the preamble
74 std::unique_ptr<QwParameterFile> preamble = map.ReadSectionPreamble();
75 TString mask;
76 if (preamble->FileHasVariablePair("=", "mask", mask)) {
78 }
79
80
81 // Read the sections of dependent variables
82 bool keep_header = true;
83 std::string section_name;
84 std::unique_ptr<QwParameterFile> section = nullptr;
85 std::pair<EQwHandleType,std::string> type_name;
86 while ((section = map.ReadNextSection(section_name,keep_header))) {
87 if(section_name=="PUBLISH") continue;
88
89 // Store index to the current position in the dv vector
90 size_t current_dv_start = fDependentName.size();
91
92 // Add dependent variables from the section header
93 section->ReadNextLine();
94 if (section->LineHasSectionHeader()) {
95 section->TrimSectionHeader();
96 section->TrimWhitespace();
97 // Parse section header into tokens separated by a comma
98 std::string current_token;
99 std::string previous_token;
100 do {
101 previous_token = current_token;
102 current_token = section->GetNextToken(",");
103 if (current_token.size() == 0) continue;
104 // Parse current token into dependent variable type and name
105 type_name = ParseHandledVariable(current_token);
106 fDependentType.push_back(type_name.first);
107 fDependentName.push_back(type_name.second);
108 fDependentFull.push_back(current_token);
109 // Resize the vectors of sensitivities and independent variables
110 fSensitivity.resize(fDependentName.size());
111 fIndependentType.resize(fDependentName.size());
112 fIndependentName.resize(fDependentName.size());
113 } while (current_token.size() != 0);
114 } else QwError << "Section does not start with header." << QwLog::endl;
115
116 // Add independent variables and sensitivities
117 while (section->ReadNextLine()) {
118 // Throw away comments, whitespace, empty lines
119 section->TrimComment();
120 section->TrimWhitespace();
121 if (section->LineIsEmpty()) continue;
122 // Get first token: independent variable
123 std::string current_token = section->GetNextToken(",");
124 // Parse current token into independent variable type and name
125 type_name = ParseHandledVariable(current_token);
126 // Loop over dependent variables to set sensitivities
127 for (size_t dv = current_dv_start; dv < fDependentName.size(); dv++) {
128 Double_t sensitivity = atof(section->GetNextToken(",").c_str());
129 fSensitivity.at(dv).push_back(sensitivity);
130 fIndependentType.at(dv).push_back(type_name.first);
131 fIndependentName.at(dv).push_back(type_name.second);
132 }
133 }
134 }
135
136 TString varvalue;
137 // Now load the variables to publish
138 std::vector<std::vector<TString> > fPublishList;
139 map.RewindToFileStart();
140 std::unique_ptr<QwParameterFile> section2;
141 std::vector<TString> publishinfo;
142 while ((section2=map.ReadNextSection(varvalue))) {
143 if (varvalue == "PUBLISH") {
144 fPublishList.clear();
145 while (section2->ReadNextLine()) {
146 section2->TrimComment(); // Remove everything after a comment character
147 section2->TrimWhitespace(); // Get rid of leading and trailing spaces
148 for (int ii = 0; ii < 4; ii++) {
149 varvalue = section2->GetTypedNextToken<TString>();
150 if (varvalue.Length()) {
151 publishinfo.push_back(varvalue);
152 }
153 }
154 if (publishinfo.size() == 4)
155 fPublishList.push_back(publishinfo);
156 publishinfo.clear();
157 }
158 }
159 }
160 // Print list of variables to publish
161 if (fPublishList.size()>0){
162 QwMessage << "Variables to publish:" << QwLog::endl;
163 for (size_t jj = 0; jj < fPublishList.size(); jj++){
164 QwMessage << fPublishList.at(jj).at(0) << " " << fPublishList.at(jj).at(1) << " " << fPublishList.at(jj).at(2) << " " << fPublishList.at(jj).at(3) << QwLog::endl;
165 }
166 }
167 return 0;
168}
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
static UInt_t GetUInt(const TString &varvalue)
std::vector< std::vector< Double_t > > fSensitivity
Definition QwCombiner.h:67
std::vector< std::vector< TString > > fPublishList
std::pair< EQwHandleType, std::string > ParseHandledVariable(const std::string &variable)

References QwLog::endl(), VQwDataHandler::fDependentFull, VQwDataHandler::fDependentName, VQwDataHandler::fDependentType, fErrorFlagMask, fIndependentName, fIndependentType, VQwDataHandler::fPublishList, fSensitivity, QwParameterFile::GetUInt(), VQwDataHandler::ParseHandledVariable(), QwError, QwMessage, QwParameterFile::ReadNextSection(), QwParameterFile::ReadSectionPreamble(), and QwParameterFile::RewindToFileStart().

+ Here is the call graph for this function:

◆ ProcessData()

void QwCombiner::ProcessData ( )
overridevirtual

Copy dependent variables to output variables (default processing).

Reimplemented from VQwDataHandler.

Reimplemented in QwCombinerSubsystem.

Definition at line 376 of file QwCombiner.cc.

377{
378 if (fErrorFlagMask!=0 && fErrorFlagPointer!=NULL) {
379 if ((*fErrorFlagPointer & fErrorFlagMask)!=0) {
380 //QwMessage << "0x" << std::hex << *fErrorFlagPointer << " passed mask " << "0x" << fErrorFlagMask << std::dec << QwLog::endl;
381 for (size_t i = 0; i < fDependentVar.size(); ++i) {
383 }
384 //} else {
385 //QwMessage << "0x" << std::hex << *fErrorFlagPointer << " failed mask " << "0x" << fErrorFlagMask << std::dec << QwLog::endl;
386 }
387 }
388 else{
389 for (size_t i = 0; i < fDependentVar.size(); ++i) {
391 }
392 }
393}
void CalcOneOutput(const VQwHardwareChannel *dv, VQwHardwareChannel *output, std::vector< const VQwHardwareChannel * > &ivs, std::vector< Double_t > &sens)

References VQwDataHandler::CalcOneOutput(), VQwDataHandler::fDependentVar, fErrorFlagMask, fErrorFlagPointer, fIndependentVar, VQwDataHandler::fOutputVar, and fSensitivity.

Referenced by QwCombinerSubsystem::ProcessData().

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

Field Documentation

◆ fErrorFlagMask

UInt_t QwCombiner::fErrorFlagMask
protected

Error flag mask.

Definition at line 60 of file QwCombiner.h.

Referenced by LoadChannelMap(), ProcessData(), QwCombiner(), and QwCombiner().

◆ fErrorFlagPointer

const UInt_t* QwCombiner::fErrorFlagPointer
protected

Definition at line 61 of file QwCombiner.h.

Referenced by ConnectChannels(), ConnectChannels(), ProcessData(), QwCombiner(), and QwCombiner().

◆ fIndependentName

std::vector< std::vector< std::string > > QwCombiner::fIndependentName
protected

Definition at line 65 of file QwCombiner.h.

Referenced by ConnectChannels(), ConnectChannels(), and LoadChannelMap().

◆ fIndependentType

std::vector< std::vector< EQwHandleType > > QwCombiner::fIndependentType
protected

List of channels to use in the combiner.

Definition at line 64 of file QwCombiner.h.

Referenced by ConnectChannels(), ConnectChannels(), and LoadChannelMap().

◆ fIndependentVar

std::vector< std::vector< const VQwHardwareChannel* > > QwCombiner::fIndependentVar
protected

Definition at line 66 of file QwCombiner.h.

Referenced by ConnectChannels(), ConnectChannels(), and ProcessData().

◆ fSensitivity

std::vector< std::vector< Double_t > > QwCombiner::fSensitivity
protected

Definition at line 67 of file QwCombiner.h.

Referenced by LoadChannelMap(), and ProcessData().


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