JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwDataHandlerArray.cc
Go to the documentation of this file.
1/*!
2 * \file QwDataHandlerArray.cc
3 * \brief Implementation of array container for managing multiple data handlers
4 */
5
7
8// System headers
9#include <stdexcept>
10
11// Qweak headers
12#include "VQwDataHandler.h"
13#include "QwParameterFile.h"
14#include "QwHelicityPattern.h"
15
16//*****************************************************************//
17/**
18 * Create a handler array based on the configuration option 'detectors'
19 */
20QwDataHandlerArray::QwDataHandlerArray(QwOptions& options, QwHelicityPattern& helicitypattern, const TString &run)
22{
23 ProcessOptions(options);
24 if (fDataHandlersMapFile != ""){
26 QwMessage << "Loading handlers from " << fDataHandlersMapFile << "." << QwLog::endl;
27 LoadDataHandlersFromParameterFile(mapfile, helicitypattern, run);
28 }
29}
30
31/**
32 * Create a handler array based on the configuration option 'detectors'
33 */
36{
37 ProcessOptions(options);
38 if (fDataHandlersMapFile != ""){
40 QwMessage << "Loading handlers from " << fDataHandlersMapFile << "." << QwLog::endl;
41 LoadDataHandlersFromParameterFile(mapfile, detectors, run);
42 }
43}
44
45/**
46 * Copy constructor by reference
47 * @param source Source handler array
48 */
50: std::vector<std::shared_ptr<VQwDataHandler>>(),
56{
57 // Make copies of all handlers rather than copying just the pointers
58 for (const_iterator handler = source.begin(); handler != source.end(); ++handler) {
59 this->push_back(handler->get()->Clone());
60 /*
61 // Instruct the handler to publish variables
62 if (this->back()->PublishInternalValues() == kFALSE) {
63 QwError << "Not all variables for " << this->back()->GetName()
64 << " could be published!" << QwLog::endl;
65 */
66 }
67}
68
69
70
71//*****************************************************************//
72
73/// Destructor
78
79/*
80 * Load data handlers from a map file into this array.
81 * Implementation note: detailed @tparam/@param documentation lives with the
82 * declaration in the header to avoid duplication in Doxygen. See
83 * QwDataHandlerArray::LoadDataHandlersFromParameterFile in the header file.
84 */
85template<class T>
87 QwParameterFile& mapfile,
88 T& detectors,
89 const TString &run)
90{
91 // Set pointer to this object
92 SetPointer(detectors);
93
94 // This is how this should work
95 std::unique_ptr<QwParameterFile> preamble;
96 preamble = mapfile.ReadSectionPreamble();
97 // Process preamble
98 QwVerbose << "Preamble:" << QwLog::endl;
99 QwVerbose << *preamble << QwLog::endl;
100 if (preamble) preamble.reset();
101
102 std::unique_ptr<QwParameterFile> section;
103 std::string section_name;
104 while ((section = mapfile.ReadNextSection(section_name))) {
105
106 // Debugging output of configuration section
107 QwVerbose << "[" << section_name << "]" << QwLog::endl;
108 QwVerbose << *section << QwLog::endl;
109
110 // Determine type and name of handler
111 std::string handler_type = section_name;
112 std::string handler_name;
113 std::string handler_scope;
114 if (! section->FileHasVariablePair("=","name",handler_name)) {
115 QwError << "No name defined in section for handler " << handler_type << "." << QwLog::endl;
116 continue;
117 }
118 if (section->FileHasVariablePair("=","scope",handler_scope)) {
119 if (ScopeMismatch(handler_scope)) continue;
120 } else {
121 // Assume the scope of a handler without a scope specifier is
122 // "pattern".
123 if (fArrayScope != kPatternScope) continue;
124 }
125
126 // If handler type is explicitly disabled
127 bool disabled_by_type = false;
128 for (size_t i = 0; i < fDataHandlersDisabledByType.size(); i++)
129 if (handler_type == fDataHandlersDisabledByType.at(i))
130 disabled_by_type = true;
131 if (disabled_by_type) {
132 QwWarning << "DataHandler of type " << handler_type << " disabled." << QwLog::endl;
133 continue;
134 }
135
136 // If handler name is explicitly disabled
137 bool disabled_by_name = false;
138 for (size_t i = 0; i < fDataHandlersDisabledByName.size(); i++)
139 if (handler_name == fDataHandlersDisabledByName.at(i))
140 disabled_by_name = true;
141 if (disabled_by_name) {
142 QwWarning << "DataHandler with name " << handler_name << " disabled." << QwLog::endl;
143 continue;
144 }
145
146 // Create handler
147 QwMessage << "Creating handler of type " << handler_type << " "
148 << "with name " << handler_name << "." << QwLog::endl;
149 VQwDataHandler* handler = 0;
150
151 try {
152 handler =
153 VQwDataHandlerFactory::Create(handler_type, handler_name);
154 } catch (QwException_TypeUnknown&) {
155 QwError << "No support for handlers of type " << handler_type << "." << QwLog::endl;
156 // Fall-through to next error for more the psychological effect of many warnings
157 }
158 if (! handler) {
159 QwError << "Could not create handler " << handler_type << "." << QwLog::endl;
160 continue;
161 }
162
163 // If this handler cannot be stored in this array
164 if (! CanContain(handler)) {
165 QwMessage << "DataHandler " << handler_name << " cannot be stored in this "
166 << "handler array." << QwLog::endl;
167 QwMessage << "Deleting handler " << handler_name << " again" << QwLog::endl;
168 delete handler; handler = 0;
169 continue;
170 }
171
172 // Pass detector maps
173 handler->SetParent(this);
174 handler->SetRunLabel(run);
175 handler->SetPointer(&detectors);
176 handler->ParseConfigFile(*section);
177 handler->LoadChannelMap();
178 handler->ConnectChannels(detectors);
179 handler->InitRunningSum();
180
181 // Add to array
182 this->push_back(handler);
183 /*
184 // Instruct the handler to publish variables
185 if (handler->PublishInternalValues() == kFALSE) {
186 QwError << "Not all variables for " << handler->GetName()
187 << " could be published!" << QwLog::endl;
188 }
189 */
190 }
191}
192//*****************************************************************
193
194/**
195 * Add the handler to this array. Do nothing if the handler is null or if
196 * there is already a handler with that name in the array.
197 * @param handler DataHandler to add to the array
198 */
200{
201 if (handler == NULL) {
202 QwError << "QwDataHandlerArray::push_back(): NULL handler"
203 << QwLog::endl;
204 // This is an empty handler...
205 // Do nothing for now.
206
207 } else if (!this->empty() && GetDataHandlerByName(handler->GetName())){
208 // There is already a handler with this name!
209 QwError << "QwDataHandlerArray::push_back(): handler " << handler->GetName()
210 << " already exists" << QwLog::endl;
211
212 } else if (!CanContain(handler)) {
213 // There is no support for this type of handler
214 QwError << "QwDataHandlerArray::push_back(): handler " << handler->GetName()
215 << " is not supported by this handler array" << QwLog::endl;
216
217 } else {
218 std::shared_ptr<VQwDataHandler> handler_tmp(handler);
219 HandlerPtrs::push_back(handler_tmp);
220
221 // Set the parent of the handler to this array
222 // handler_tmp->SetParent(this);
223
224 }
225}
226
227/**
228 * Define configuration options for global array
229 * @param options Options
230 */
232{
233 options.AddOptions()("datahandlers",
234 po::value<std::string>(),
235 "map file with datahandlers to include");
236
237 // Versions of boost::program_options below 1.39.0 have a bug in multitoken processing
238#if BOOST_VERSION < 103900
239 options.AddOptions()("DataHandler.disable-by-type",
240 po::value<std::vector <std::string> >(),
241 "handler types to disable");
242 options.AddOptions()("DataHandler.disable-by-name",
243 po::value<std::vector <std::string> >(),
244 "handler names to disable");
245#else // BOOST_VERSION >= 103900
246 options.AddOptions()("DataHandler.disable-by-type",
247 po::value<std::vector <std::string> >()->multitoken(),
248 "handler types to disable");
249 options.AddOptions()("DataHandler.disable-by-name",
250 po::value<std::vector <std::string> >()->multitoken(),
251 "handler names to disable");
252#endif // BOOST_VERSION
253}
254
255
256/**
257 * Handle configuration options for the handler array itself
258 * @param options Options
259 */
261{
262 // Filename to use for handler creation (single filename could be expanded
263 // to a list)
264 if (options.HasValue("datahandlers")){
265 fDataHandlersMapFile = options.GetValue<std::string>("datahandlers");
266 }
267 // DataHandlers to disable
268 fDataHandlersDisabledByName = options.GetValueVector<std::string>("DataHandler.disable-by-name");
269 fDataHandlersDisabledByType = options.GetValueVector<std::string>("DataHandler.disable-by-type");
270
271 // Get the globally defined print running sum flag
272 fPrintRunningSum = options.GetValue<bool>("print-runningsum");
273}
274
275/**
276 * Get the handler in this array with the specified name
277 * @param name Name of the handler
278 * @return Pointer to the handler
279 */
281{
282 VQwDataHandler* tmp = NULL;
283 if (!empty()) {
284 // Loop over the handlers
285 for (const_iterator handler = begin(); handler != end(); ++handler) {
286 // Check the name of this handler
287 // std::cout<<"QwDataHandlerArray::GetDataHandlerByName available name=="<<(*handler)->GetName()<<"== to be compared to =="<<name<<"==\n";
288 if ((*handler)->GetName() == name) {
289 tmp = (*handler).get();
290 //std::cout<<"QwDataHandlerArray::GetDataHandlerByName found a matching name \n";
291 } else {
292 // nothing
293 }
294 }
295 }
296 return tmp;
297}
298
299
300/**
301 * Get the list of handlers in this array of the specified type
302 * @param type Type of the handler
303 * @return Vector of handlers
304 */
305std::vector<VQwDataHandler*> QwDataHandlerArray::GetDataHandlerByType(const std::string& type)
306{
307 // Vector of handler pointers
308 std::vector<VQwDataHandler*> handler_list;
309
310 // If this array is not empty
311 if (!empty()) {
312
313 // Loop over the handlers
314 for (const_iterator handler = begin(); handler != end(); ++handler) {
315
316 // Test to see if the handler inherits from the required type
317 if (VQwDataHandlerFactory::InheritsFrom((*handler).get(),type)) {
318 handler_list.push_back((*handler).get());
319 }
320
321 } // end of loop over handlers
322
323 } // end of if !empty()
324
325 return handler_list;
326}
327
329{
330 if (!empty()) {
331 std::for_each(begin(), end(),
332 std::mem_fn(&VQwDataHandler::ClearEventData));
333 }
334}
335
336
337
339{
340 if (!empty()){
341 std::for_each(begin(), end(), std::mem_fn(&VQwDataHandler::ProcessData));
342 }
343}
344
346 QwRootFile *treerootfile,
347 const std::string& treeprefix,
348 const std::string& branchprefix)
349{
350 if (!empty()){
351 for (iterator handler = begin(); handler != end(); ++handler) {
352 handler->get()->ConstructTreeBranches(treerootfile, treeprefix, branchprefix);
353 }
354 }
355}
356
358{
359 if (!empty()){
360 for (iterator handler = begin(); handler != end(); ++handler) {
361 handler->get()->FillTreeBranches(treerootfile);
362 }
363 }
364}
365
367 QwRootFile *treerootfile,
368 const std::string& treeprefix,
369 const std::string& branchprefix)
370{
371 if (!empty()){
372 for (iterator handler = begin(); handler != end(); ++handler) {
373 handler->get()->ConstructNTupleFields(treerootfile, treeprefix, branchprefix);
374 }
375 }
376}
377
379{
380 if (!empty()){
381 for (iterator handler = begin(); handler != end(); ++handler) {
382 handler->get()->FillNTupleFields(treerootfile);
383 }
384 }
385}
386
387
388
389//*****************************************************************
390
392{
393 if (!empty()){
394 for (iterator handler = begin(); handler != end(); ++handler) {
395 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
396 handler_parity->ConstructBranchAndVector(tree,prefix,values);
397 }
398 }
399}
400
402{
403 if (!empty()){
404 for (const_iterator handler = begin(); handler != end(); ++handler) {
405 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
406 handler_parity->FillTreeVector(values);
407 }
408 }
409}
410
411
412//*****************************************************************
413void QwDataHandlerArray::ConstructHistograms(TDirectory *folder, TString &prefix)
414{
415 if (!empty()) {
416 for (iterator subsys = begin(); subsys != end(); ++subsys){
417 (*subsys)->ConstructHistograms(folder,prefix);
418 }
419 }
420}
421
423{
424 if (!empty())
425 std::for_each(begin(), end(), std::mem_fn(&VQwDataHandler::FillHistograms));
426}
427
428
429//*****************************************************************//
430
431#ifdef __USE_DATABASE__
432void QwDataHandlerArray::FillDB(QwParityDB *db, TString type)
433{
434 for (iterator handler = begin(); handler != end(); ++handler) {
435 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
436 handler_parity->FillDB(db, type);
437 }
438}
439
440/*
441void QwDataHandlerArray::FillErrDB(QwParityDB *db, TString type)
442{
443 for (iterator handler = begin(); handler != end(); ++handler) {
444 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
445 handler_parity->FillErrDB(db, type);
446 }
447}
448*/
449#endif // __USE_DATABASE__
450
452{
453 if (!empty()){
454 for (const_iterator handler = begin(); handler != end(); ++handler) {
455 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
456 handler_parity->WritePromptSummary(ps, type);
457 }
458 }
459}
460
461
462//*****************************************************************//
463
464/**
465 * Assignment operator
466 * @param source DataHandler array to assign to this array
467 * @return This handler array after assignment
468 */
470{
471 Bool_t localdebug=kFALSE;
472 if(localdebug) std::cout<<"QwDataHandlerArray::operator= \n";
473 if (!source.empty()){
474 if (this->size() == source.size()){
475 for(size_t i=0;i<source.size();i++){
476 if (source.at(i)==NULL || this->at(i)==NULL){
477 // Either the source or the destination handler
478 // are null
479 } else {
480 VQwDataHandler *ptr1 =
481 dynamic_cast<VQwDataHandler*>(this->at(i).get());
482 VQwDataHandler *ptr2 = source.at(i).get();
483 if (typeid(*ptr1)==typeid(*ptr2)){
484 if(localdebug) std::cout<<" here in QwDataHandlerArray::operator= types mach \n";
485 *(ptr1) = *(source.at(i).get());
486 } else {
487 // DataHandlers don't match
488 QwError << " QwDataHandlerArray::operator= types do not mach" << QwLog::endl;
489 QwError << " typeid(*ptr1)=" << typeid(*ptr1).name()
490 << " but typeid(*ptr2)=" << typeid(*ptr2).name()
491 << QwLog::endl;
492 }
493 }
494 }
495 } else {
496 // Array sizes don't match
497 }
498 } else {
499 // The source is empty
500 }
501 return *this;
502}
503
504//*****************************************************************
505/*
506void QwDataHandlerArray::PrintInfo() const
507{
508 if (!empty()) {
509 for (const_iterator handler = begin(); handler != end(); ++handler) {
510 (*handler)->PrintInfo();
511 }
512 }
513}
514*/
515//*****************************************************************//
516
518{
519 if (!empty()) {
520 for (const_iterator handler = begin(); handler != end(); ++handler) {
521 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
522 handler_parity->PrintValue();
523 }
524 }
525}
526
527
528
529
530//*****************************************************************//
531
533{
534 if (!empty()) {
535 for (iterator handler = begin(); handler != end(); ++handler) {
536 VQwDataHandler* handler_parity = dynamic_cast<VQwDataHandler*>(handler->get());
537 handler_parity->CalculateRunningAverage();
538 }
539 }
540}
541
542
543void QwDataHandlerArray::AccumulateRunningSum(const QwDataHandlerArray& value, Int_t count, Int_t ErrorMask)
544{
545 if (!value.empty()) {
546 if (this->size() == value.size()) {
547 for (size_t i = 0; i < value.size(); i++) {
548 if (value.at(i)==NULL || this->at(i)==NULL) {
549 // Either the value or the destination handler
550 // are null
551 } else {
552 VQwDataHandler *ptr1 =
553 dynamic_cast<VQwDataHandler*>(this->at(i).get());
554 VQwDataHandler *ptr2 = value.at(i).get();
555 if (typeid(*ptr1) == typeid(*ptr2)) {
556 ptr1->AccumulateRunningSum(*ptr2, count, ErrorMask);
557 } else {
558 QwError << "QwDataHandlerArray::AccumulateRunningSum here where types don't match" << QwLog::endl;
559 QwError << " typeid(ptr1)=" << typeid(ptr1).name()
560 << " but typeid(value.at(i)))=" << typeid(value.at(i)).name()
561 << QwLog::endl;
562 // DataHandlers don't match
563 }
564 }
565 }
566
567 } else {
568 // Array sizes don't match
569
570 }
571 } else {
572 // The value is empty
573 }
574}
575
576void QwDataHandlerArray::AccumulateAllRunningSum(const QwDataHandlerArray& value, Int_t count, Int_t ErrorMask)
577{
578 if (!value.empty()) {
579 if (this->size() == value.size()) {
580 for (size_t i = 0; i < value.size(); i++) {
581 if (value.at(i)==NULL || this->at(i)==NULL) {
582 // Either the value or the destination handler
583 // are null
584 } else {
585 VQwDataHandler *ptr1 =
586 dynamic_cast<VQwDataHandler*>(this->at(i).get());
587 VQwDataHandler *ptr2 = value.at(i).get();
588 if (typeid(*ptr1) == typeid(*ptr2)) {
589 ptr1->AccumulateRunningSum(*ptr2, count, ErrorMask);
590 } else {
591 QwError << "QwDataHandlerArray::AccumulateRunningSum here where types don't match" << QwLog::endl;
592 QwError << " typeid(ptr1)=" << typeid(ptr1).name()
593 << " but typeid(value.at(i)))=" << typeid(value.at(i)).name()
594 << QwLog::endl;
595 // DataHandlers don't match
596 }
597 }
598 }
599 } else {
600 // Array sizes don't match
601
602 }
603 } else {
604 // The value is empty
605 }
606}
607
608
609
610/*
611void QwDataHandlerArray::PrintErrorCounters() const{// report number of events failed due to HW and event cut failure
612 const VQwDataHandler *handler_parity;
613 if (!empty()){
614 for (const_iterator handler = begin(); handler != end(); ++handler){
615 handler_parity=dynamic_cast<const VQwDataHandler*>((handler)->get());
616 handler_parity->PrintErrorCounters();
617 }
618 }
619}
620*/
621
622/**
623 * Add the handler to this array. Do nothing if the handler is null or if
624 * there is already a handler with that name in the array.
625 * @param handler DataHandler to add to the array
626 */
627void QwDataHandlerArray::push_back(std::shared_ptr<VQwDataHandler> handler)
628{
629
630 if (handler.get() == NULL) {
631 QwError << "QwDataHandlerArray::push_back(): NULL handler"
632 << QwLog::endl;
633 // This is an empty handler...
634 // Do nothing for now.
635
636 } else if (!this->empty() && GetDataHandlerByName(handler->GetName())){
637 // There is already a handler with this name!
638 QwError << "QwDataHandlerArray::push_back(): handler " << handler->GetName()
639 << " already exists" << QwLog::endl;
640
641 } else if (!CanContain(handler.get())) {
642 // There is no support for this type of handler
643 QwError << "QwDataHandlerArray::push_back(): handler " << handler->GetName()
644 << " is not supported by this handler array" << QwLog::endl;
645
646 } else {
647 std::shared_ptr<VQwDataHandler> handler_tmp(handler);
648 HandlerPtrs::push_back(handler_tmp);
649
650/*
651 // Set the parent of the handler to this array
652 handler_tmp->SetParent(this);
653
654
655 // Instruct the handler to publish variables
656 if (handler_tmp->PublishInternalValues() == kFALSE) {
657 QwError << "Not all variables for " << handler_tmp->GetName()
658 << " could be published!" << QwLog::endl;
659 }
660*/
661 }
662}
663
664/*
665void QwDataHandlerArray::PrintParamFileList() const
666{
667 if (not empty()) {
668 for (const_iterator handler = begin(); handler != end(); ++handler)
669 {
670 (*handler)->PrintDetectorMaps(true);
671 }
672 }
673}
674
675TList* QwDataHandlerArray::GetParamFileNameList(TString name) const
676{
677 if (not empty()) {
678
679 TList* return_maps_TList = new TList;
680 return_maps_TList->SetName(name);
681
682 std::map<TString, TString> mapfiles_handler;
683
684 for (const_iterator handler = begin(); handler != end(); ++handler)
685 {
686 mapfiles_handler = (*handler)->GetDetectorMaps();
687 for( std::map<TString, TString>::iterator ii= mapfiles_handler.begin(); ii!= mapfiles_handler.end(); ++ii)
688 {
689 TList *test = new TList;
690 test->SetName((*ii).first);
691 test->AddLast(new TObjString((*ii).second));
692 return_maps_TList -> AddLast(test);
693 }
694 }
695
696 return return_maps_TList;
697 }
698 else {
699 return NULL;
700 }
701};
702
703*/
704
706{
707 if (!empty()) {
708 for(iterator handler = begin(); handler != end(); ++handler){
709 (*handler)->ProcessData();
710 (*handler)->AccumulateRunningSum();
711 }
712 }
713}
714
716{
717 if (!empty()) {
718 for(iterator handler = begin(); handler != end(); ++handler){
719 (*handler)->FinishDataHandler();
720 }
721 }
722}
723
724
725
726
727
#define QwVerbose
Predefined log drain for verbose messages.
Definition QwLog.h:54
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
Parameter file parsing and management.
Virtual base class for data handlers accessing multiple subsystems.
Array container for managing multiple data handlers.
Helicity pattern analysis and management.
void SetParent(U *parent)
Set the parent container for this child object.
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
Command-line and configuration file options processor.
Definition QwOptions.h:141
std::vector< T > GetValueVector(const std::string &key)
Get a list of templated values.
Definition QwOptions.h:249
T GetValue(const std::string &key)
Get a templated value.
Definition QwOptions.h:236
bool HasValue(const std::string &key)
Has this key been defined.
Definition QwOptions.h:229
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
Definition QwOptions.h:170
Configuration file parser with flexible tokenization and search capabilities.
std::unique_ptr< QwParameterFile > ReadSectionPreamble()
Rewinds to the start and read until it finds next section header.
std::unique_ptr< QwParameterFile > ReadNextSection(std::string &secname, const bool keep_header=false)
A helper class to manage a vector of branch entries for ROOT trees.
Definition QwRootFile.h:53
A wrapper class for a ROOT file or memory mapped file.
Definition QwRootFile.h:827
void push_back(VQwDataHandler *handler)
Add the datahandler to this array.
static void DefineOptions(QwOptions &options)
Define configuration options for global array.
void FillNTupleFields(QwRootFile *treerootfile)
void CalculateRunningAverage()
Calculate the average for all good events.
void ConstructHistograms()
Construct the histograms for this subsystem.
void FillTreeBranches(QwRootFile *treerootfile)
VQwDataHandler * GetDataHandlerByName(const TString &name)
Get the handler with the specified name.
void FillDB(QwParityDB *db, TString type)
Fill the database.
void SetPointer(QwHelicityPattern &helicitypattern)
Bool_t ScopeMismatch(TString name)
std::vector< std::string > fDataHandlersDisabledByType
List of disabled names.
void ConstructTreeBranches(QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="")
void PrintValue() const
Print value of all channels.
QwSubsystemArrayParity * fSubsystemArray
void AccumulateAllRunningSum(const QwDataHandlerArray &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
Update the running sums for devices check only the error flags at the channel level....
QwHelicityPattern * fHelicityPattern
Pointer for the original data source.
~QwDataHandlerArray() override
Default destructor.
QwDataHandlerArray()
Private default constructor.
void FillTreeVector(QwRootTreeBranchVector &values) const
Fill the vector for this handler.
void WritePromptSummary(QwPromptSummary *ps, TString type)
void ConstructNTupleFields(QwRootFile *treerootfile, const std::string &treeprefix="", const std::string &branchprefix="")
RNTuple methods.
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
Construct a branch and vector for this handler with a prefix.
static Bool_t CanContain(VQwDataHandler *handler)
Test whether this handler array can contain a particular handler.
std::string fDataHandlersMapFile
Filename of the global detector map.
std::vector< VQwDataHandler * > GetDataHandlerByType(const std::string &type)
void ProcessOptions(QwOptions &options)
Process configuration options for the datahandler array itself.
QwDataHandlerArray & operator=(const QwDataHandlerArray &value)
Assignment operator.
void AccumulateRunningSum()
Update the running sums for devices accumulated for the global error non-zero events/patterns.
void FillHistograms()
Fill the histograms.
EDataHandlerArrayScope fArrayScope
std::vector< std::string > fDataHandlersDisabledByName
List of disabled types.
void LoadDataHandlersFromParameterFile(QwParameterFile &mapfile, T &detectors, const TString &run)
Load data handlers from a parameter file.
Manages yields/differences/asymmetries for helicity patterns.
Subsystem array container specialized for parity analysis with asymmetry calculations.
Abstract base for handlers that consume multiple subsystems and produce derived outputs.
virtual void FillHistograms()
Fill the histograms.
virtual void ProcessData()
void FillTreeVector(QwRootTreeBranchVector &values) const
void AccumulateRunningSum()
TString GetName()
void WritePromptSummary(QwPromptSummary *ps, TString type)
void PrintValue() const
virtual void ParseConfigFile(QwParameterFile &file)
virtual void ClearEventData()
void CalculateRunningAverage()
void SetRunLabel(TString x)
void SetPointer(QwHelicityPattern *ptr)
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
virtual Int_t ConnectChannels(QwSubsystemArrayParity &, QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff)