JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwSubsystemArrayParity.cc
Go to the documentation of this file.
1/**********************************************************\
2* File: QwSubsystemArrayParity.cc *
3* *
4* Author: *
5* Time-stamp: *
6\**********************************************************/
7
9
10// System headers
11#include <stdexcept>
12
13// Qweak headers
14#include "VQwSubsystemParity.h"
15#include "QwRootFile.h"
16
17//*****************************************************************//
18
19/// Default constructor
27
28//*****************************************************************//
29
30/// Copy constructor
38
39//*****************************************************************//
40
41/// Destructor
46
48{
49 if (fResolvedParitySelf.size() == this->size()) return;
50 // Self layout changed: any peer cache built against the old layout is stale.
51 fResolvedParityPeer = nullptr;
54 fResolvedParitySelf.assign(this->size(), nullptr);
55 for (size_t i = 0; i < this->size(); ++i) {
56 if (this->at(i) != nullptr) {
57 fResolvedParitySelf[i] = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
58 if (fResolvedParitySelf[i] == nullptr) {
59 QwError << "QwSubsystemArrayParity::BuildResolvedParitySelf "
60 << "failed to cast slot " << i << " to VQwSubsystemParity."
61 << QwLog::endl;
62 }
63 }
64 }
65}
66
68 const QwSubsystemArrayParity& value, const char* context) const
69{
71 const Bool_t cache_valid =
72 (fResolvedParityPeer == &value)
73 && (fResolvedParityPeerSlots.size() == value.size())
74 && (fResolvedParityCompatible.size() == value.size());
75 if (cache_valid) return;
76
77 fResolvedParityPeer = &value;
78 fResolvedParityPeerSlots.assign(value.size(), nullptr);
79 fResolvedParityCompatible.assign(value.size(), kFALSE);
80 if (this->size() != value.size()) return;
81
82 for (size_t i = 0; i < value.size(); ++i) {
84 VQwSubsystem* ptr2 = value.at(i).get();
86 if (ptr1 == nullptr || ptr2 == nullptr) continue;
87
88 if (typeid(*ptr1) == typeid(*ptr2)) {
90 } else {
91 QwError << context << " types do not match at slot " << i << QwLog::endl;
92 QwError << " typeid(*ptr1)=" << typeid(*ptr1).name()
93 << " but typeid(*ptr2)=" << typeid(*ptr2).name()
94 << QwLog::endl;
95 }
96 }
97}
98
99//*****************************************************************//
100
105
106//*****************************************************************//
107
108void QwSubsystemArrayParity::FillDB_MPS(QwParityDB *db, TString type)
109{
110 for (iterator subsys = begin(); subsys != end(); ++subsys) {
111 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
112 subsys_parity->FillDB_MPS(db, type);
113 }
114}
115
116void QwSubsystemArrayParity::FillDB(QwParityDB *db, TString type)
117{
118 for (iterator subsys = begin(); subsys != end(); ++subsys) {
119 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
120 subsys_parity->FillDB(db, type);
121 }
122}
123
124void QwSubsystemArrayParity::FillErrDB(QwParityDB *db, TString type)
125{
126 for (iterator subsys = begin(); subsys != end(); ++subsys) {
127 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
128 subsys_parity->FillErrDB(db, type);
129 }
130}
131
133{
134 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
135 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
136 subsys_parity->WritePromptSummary(ps, type);
137 }
138}
139
140//*****************************************************************//
141
142/**
143 * Assignment operator
144 * @param source Subsystem array to assign to this array
145 * @return This subsystem array after assignment
146 */
153
154
155/**
156 * Addition-assignment operator
157 * @param value Subsystem array to add to this array
158 * @return This subsystem array after addition
159 */
161{
162 if (!value.empty()){
164 std::min(fCodaEventNumber, value.fCodaEventNumber);
165 if (this->size() == value.size()){
166 this->fErrorFlag|=value.fErrorFlag;
167 ResolveParityPairing(value, "QwSubsystemArrayParity::operator+=");
168 for(size_t i=0;i<value.size();i++){
169 if (!fResolvedParityCompatible[i]) continue;
171 }
172 } else {
173 // Array sizes don't match
174 }
175 } else {
176 // The vsource is empty
177 }
178 return *this;
179}
180
181/**
182 * Subtraction-assignment operator
183 * @param value Subsystem array to subtract from this array
184 * @return This array after subtraction
185 */
187{
188 if (!value.empty()){
190 std::min(fCodaEventNumber, value.fCodaEventNumber);
191 if (this->size() == value.size()){
192 this->fErrorFlag|=value.fErrorFlag;
193 ResolveParityPairing(value, "QwSubsystemArrayParity::operator-=");
194 for(size_t i=0;i<value.size();i++){
195 if (!fResolvedParityCompatible[i]) continue;
197 }
198 } else {
199 // Array sizes don't match
200 }
201 } else {
202 // The vsource is empty
203 }
204 return *this;
205}
206
207/**
208 * Sum of two subsystem arrays
209 * @param value1 First subsystem array
210 * @param value2 Second subsystem array
211 */
213 const QwSubsystemArrayParity &value1,
214 const QwSubsystemArrayParity &value2)
215{
216 if (!value1.empty()&& !value2.empty()){
217 *(this) = value1;
218 *(this) += value2;
219 } else {
220 // The source is empty
221 }
222}
223
224/**
225 * Difference of two subsystem arrays
226 * @param value1 First subsystem array
227 * @param value2 Second subsystem array
228 */
230 const QwSubsystemArrayParity &value1,
231 const QwSubsystemArrayParity &value2)
232{
233
234 if (!value1.empty()&& !value2.empty()){
235 *(this) = value1;
236 *(this) -= value2;
237 } else {
238 // The source is empty
239 }
240}
241
242/**
243 * Scale this subsystem array
244 * @param factor Scale factor
245 */
246void QwSubsystemArrayParity::Scale(Double_t factor)
247{
248 for (iterator subsys = begin(); subsys != end(); ++subsys) {
249 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
250 subsys_parity->Scale(factor);
251 }
252}
253
254//*****************************************************************//
255
257{
258 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
259 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
260 subsys_parity->PrintValue();
261 }
262}
263
264
265
266//*****************************************************************//
267
269{
270 Bool_t status = kFALSE;
271 for (const_iterator subsys = begin(); subsys != end(); ++subsys) {
272 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
273 status |= subsys_parity->CheckForEndOfBurst();
274 }
275 return status;
276};
277
278//*****************************************************************//
279
281{
282 for (iterator subsys = begin(); subsys != end(); ++subsys) {
283 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(subsys->get());
284 subsys_parity->CalculateRunningAverage();
285 }
286}
287
288
289
290void QwSubsystemArrayParity::AccumulateRunningSum(const QwSubsystemArrayParity& value, Int_t count, Int_t ErrorMask)
291{
292 if (!value.empty()) {
293 if (this->size() == value.size()) {
294 if (value.GetEventcutErrorFlag()==0){//do running sum only if error flag is zero. This way will prevent any Beam Trip(in ev mode 3) related events going into the running sum.
296 std::min(fCodaEventNumber, value.fCodaEventNumber);
297 ResolveParityPairing(value, "QwSubsystemArrayParity::AccumulateRunningSum");
298 for (size_t i = 0; i < value.size(); i++) {
299 if (!fResolvedParityCompatible[i]) continue;
300 fResolvedParitySelf[i]->AccumulateRunningSum(fResolvedParityPeerSlots[i], count, ErrorMask);
301 }
302 }
303
304 } else {
305 // Array sizes don't match
306
307 }
308 } else {
309 // The value is empty
310 }
311}
312
313void QwSubsystemArrayParity::AccumulateAllRunningSum(const QwSubsystemArrayParity& value, Int_t count, Int_t ErrorMask)
314{
315 if (!value.empty()) {
316 if (this->size() == value.size()) {
317 //if (value.GetEventcutErrorFlag()==0){//do running sum only if error flag is zero. This way will prevent any Beam Trip(in ev mode 3) related events going into the running sum.
318 ResolveParityPairing(value, "QwSubsystemArrayParity::AccumulateAllRunningSum");
319 for (size_t i = 0; i < value.size(); i++) {
320 if (!fResolvedParityCompatible[i]) continue;
321 fResolvedParitySelf[i]->AccumulateRunningSum(fResolvedParityPeerSlots[i], count, ErrorMask);
322 }
323 //}//else if ((value.fErrorFlag& 512)==512){
324 //QwMessage << " AccumulateRunningSum "<<(value.fErrorFlag & 0x2FF)<<" - "<<value.GetCodaEventNumber()<< QwLog::endl;
325 //}
326 } else {
327 // Array sizes don't match
328
329 }
330 } else {
331 // The value is empty
332 }
333}
334
335
337{
338 //Bool_t berror=kTRUE;//only needed for deaccumulation (stability check purposes)
339 //if (value.fErrorFlag>0){//check the error is global
340 //berror=((value.fErrorFlag & 0x2FF) == 0); //The operation value.fErrorFlag & 0x2FF clear everything else but the HW errors + event cut errors + blinder error
341 //}
342 if (!value.empty()) {
343 if (this->size() == value.size()) {
344 //if (value.GetEventcutErrorFlag()==0){//do derunningsum only if error flag is zero.
345 ResolveParityPairing(value, "QwSubsystemArrayParity::DeaccumulateRunningSum");
346 for (size_t i = 0; i < value.size(); i++) {
347 if (!fResolvedParityCompatible[i]) continue;
348 fResolvedParitySelf[i]->DeaccumulateRunningSum(fResolvedParityPeerSlots[i], ErrorMask);
349 }
350 //}//else if ((value.fErrorFlag & 268435968)==268435968){
351 //QwMessage << " DeaccumulateRunningSum "<<(value.fErrorFlag & 0x2FF)<<" - "<<value.GetCodaEventNumber()<< QwLog::endl;
352 //}
353 } else {
354 // Array sizes don't match
355
356 }
357 } else {
358 // The value is empty
359 }
360}
361
362
364{
365 // Loop over subsystem array
366 for (size_t i = 0; i < this->size(); i++) {
367 // Cast into parity subsystems
368 VQwSubsystemParity* subsys = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
369
370 // Check for null pointers
371 if (this->at(i) == 0) {
372 QwError << "QwSubsystemArrayParity::Blind: "
373 << "parity subsystem null pointer!" << QwLog::endl;
374 return;
375 }
376
377 // Apply blinding
378 subsys->Blind(blinder);
379 }
380}
381
383{
384 // Check for array size
385 if (this->size() != yield.size()) {
386 QwError << "QwSubsystemArrayParity::Blind: "
387 << "diff and yield array dimension mismatch!" << QwLog::endl;
388 return;
389 }
390
391 // Loop over subsystem array
392 for (size_t i = 0; i < this->size(); i++) {
393 // Cast into parity subsystems
394 VQwSubsystemParity* subsys_diff = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
395 VQwSubsystemParity* subsys_yield = dynamic_cast<VQwSubsystemParity*>(yield.at(i).get());
396
397 // Check for null pointers
398 if (subsys_diff == 0 || subsys_yield == 0) {
399 QwError << "QwSubsystemArrayParity::Blind: "
400 << "diff or yield parity subsystem null pointer!" << QwLog::endl;
401 return;
402 }
403
404 // Apply blinding
405 subsys_diff->Blind(blinder, subsys_yield);
406 }
407}
408
410 const QwSubsystemArrayParity &numer,
411 const QwSubsystemArrayParity &denom)
412{
413 Bool_t localdebug=kFALSE;
414
415 if(localdebug) std::cout<<"QwSubsystemArrayParity::Ratio \n";
416 *this=numer;
417 if ( !denom.empty()){
418 this->fErrorFlag=(numer.fErrorFlag|denom.fErrorFlag);
419 if (this->size() == denom.size() ){
420 for(size_t i=0;i<denom.size();i++){
421 if (denom.at(i)==NULL || this->at(i)==NULL){
422 // Either the value or the destination subsystem are null
423 if(localdebug) std::cout<<"Either the value or the destination subsystem are null\n";
424 } else {
425 VQwSubsystemParity *ptr1 =
426 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
427 VQwSubsystem *ptr2 = denom.at(i).get();
428 if (typeid(*ptr1)==typeid(*ptr2))
429 {
430 ptr1->Ratio(numer.at(i).get(),denom.at(i).get());
431 } else {
432 // Subsystems don't match
433 QwError << "subsystem #" << i
434 << " type do not match : ratio computation aborted" << QwLog::endl;
435 }
436 }
437 }
438 } else {
439 QwError << "array size do not match : ratio computation aborted" << QwLog::endl;
440 // Array sizes don't match
441 }
442 } else {
443 QwError << "source empty : ratio computation aborted" << QwLog::endl;
444 // The source is empty
445 }
446 if(localdebug) std::cout<<"I am out of it \n";
447
448}
449
451 Int_t CountFalse;
452 Bool_t status;
453 UInt_t ErrorFlag;
454 fErrorFlag=0; // Testing if event number is within bad Event Range cut
455 if( CheckBadEventRange() )
457
458 VQwSubsystemParity *subsys_parity = nullptr;
459 CountFalse=0;
460 if (!empty()){
461 for (iterator subsys = begin(); subsys != end(); ++subsys){
462 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
463 status=subsys_parity->ApplySingleEventCuts();
464 ErrorFlag = subsys_parity->GetEventcutErrorFlag();
465 if ((ErrorFlag & kEventCutMode3)==kEventCutMode3)//we only care about the event cut flag in event cut mode 3
466 fErrorFlag |= ErrorFlag;
467 if (!status)
468 {
469 if ((ErrorFlag&kGlobalCut)==kGlobalCut){
470 CountFalse++;
471 fErrorFlag |= ErrorFlag; //we need the error code for failed events in event mode 2 for beam trips and etc.
472 }
473 }
474
475
476 }
477 }
478 if (CountFalse > 0)
479 status = kFALSE;
480 else
481 status = kTRUE;
482
483 // Propagate all error codes to derived objects in the subsystems.
485
486 return status;
487}
488
489
490
492{
493 VQwSubsystemParity *subsys_parity = nullptr;
494 if (!empty()){
495 for (iterator subsys = begin(); subsys != end(); ++subsys){
496 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
497 subsys_parity->IncrementErrorCounters();
498 }
499 }
500}
501
503{
504 Bool_t burpstatus = kFALSE;
505 if (!event.empty() && this->size() == event.size()){
506 for(size_t i=0;i<event.size();i++){
507 if (event.at(i)!=NULL && this->at(i)!=NULL){
508 VQwSubsystemParity *ptr1 = dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
509 VQwSubsystem *ptr2 = event.at(i).get();
510 if (typeid(*ptr1)==typeid(*ptr2)){
511 //*(ptr1) = event.at(i).get();//when =operator is used
512 //pass the correct subsystem to update the errorflags at subsystem to devices to channel levels
513 //wError << "************* test " << typeid(*ptr1).name() << "*****************" << QwLog::endl;
514 burpstatus |= ptr1->CheckForBurpFail(ptr2);
515 } else {
516 // Subsystems don't match
517 QwError << " QwSubsystemArrayParity::CheckForBurpFail types do not mach" << QwLog::endl;
518 QwError << " typeid(ptr1)=" << typeid(*ptr1).name()
519 << " but typeid(*(event.at(i).get()))=" << typeid(*ptr2).name()
520 << QwLog::endl;
521 }
522 }
523 }
524 } else {
525 // The source is empty
526 }
527 return burpstatus;
528}
529
530
531void QwSubsystemArrayParity::PrintErrorCounters() const{// report number of events failed due to HW and event cut failure
532 const VQwSubsystemParity *subsys_parity = nullptr;
533 if (!empty()){
534 for (const_iterator subsys = begin(); subsys != end(); ++subsys){
535 subsys_parity=dynamic_cast<const VQwSubsystemParity*>((subsys)->get());
536 subsys_parity->PrintErrorCounters();
537 }
538 }
539}
540
542 Bool_t localdebug=kFALSE;//kTRUE;
543 if(localdebug) std::cout<<"QwSubsystemArrayParity::UpdateErrorFlag \n";
544 if (!ev_error.empty()){
545 if (this->size() == ev_error.size()){
546 this->fErrorFlag |= ev_error.fErrorFlag;
547 for(size_t i=0;i<ev_error.size();i++){
548 if (ev_error.at(i)==NULL || this->at(i)==NULL){
549 // Either the source or the destination subsystem
550 // are null
551 } else {
552 VQwSubsystemParity *ptr1 =
553 dynamic_cast<VQwSubsystemParity*>(this->at(i).get());
554 VQwSubsystem *ptr2 = ev_error.at(i).get();
555 if (typeid(*ptr1)==typeid(*ptr2)){
556 if(localdebug) std::cout<<" here in QwSubsystemArrayParity::UpdateErrorFlag types mach \n";
557 //*(ptr1) = ev_error.at(i).get();//when =operator is used
558 //pass the correct subsystem to update the errorflags at subsystem to devices to channel levels
559 ptr1->UpdateErrorFlag(ev_error.at(i).get());
560 } else {
561 // Subsystems don't match
562 QwError << " QwSubsystemArrayParity::UpdateErrorFlag types do not mach" << QwLog::endl;
563 QwError << " typeid(ptr1)=" << typeid(*ptr1).name()
564 << " but typeid(*(ev_error.at(i).get()))=" << typeid(*ptr2).name()
565 << QwLog::endl;
566 }
567 }
568 }
569 } else {
570 // Array sizes don't match
571 }
572 } else {
573 // The source is empty
574 }
575};
576
577
579 //this routine will refresh the global error flag after stability cut check
580 //by default at the ApplySingleEventCuts routine fErrorFlag is updated properly and a const GetEventcutErrorFlag() routine
581 //returns the fErrorFlag value
582 fErrorFlag=0;
583 if( CheckBadEventRange() )
585
586 VQwSubsystemParity *subsys_parity = nullptr;
587 if (!empty()){
588 for (iterator subsys = begin(); subsys != end(); ++subsys){
589 subsys_parity=dynamic_cast<VQwSubsystemParity*>((subsys)->get());
590 //Update the error flag of the parity subsystem
591 fErrorFlag|=subsys_parity->UpdateErrorFlag();
592 }
593 }
594}
595
597 std::vector< std::pair<UInt_t, UInt_t> >::iterator itber = fBadEventRange.begin(); // ber = bad event range
598 while(itber!=fBadEventRange.end()){
599 if( fCodaEventNumber >= (*itber).first
600 && fCodaEventNumber <= (*itber).second){
601 return kTRUE;
602 }
603 itber++;
604 }
605 return kFALSE;
606}
607
609 QwSubsystemArray::ConstructBranchAndVector(tree, prefix, values);
610 if (prefix.Contains("yield_") || prefix==""){
611 values.push_back("ErrorFlag", 'D');
612 fErrorFlagTreeIndex = values.size()-1;
613 tree->Branch("ErrorFlag", &(values.back<Double_t>()), "ErrorFlag/D");
614 } else {
616 }
617}
618
620{
622 if (fErrorFlagTreeIndex>=0 && fErrorFlagTreeIndex<static_cast<int>(values.size())){
623 values.SetValue(fErrorFlagTreeIndex, static_cast<double>(fErrorFlag));
624 }
625}
626
627
628//*****************************************************************//
634
635//*****************************************************************//
637{
638 // for (iterator subsys = begin(); subsys != end(); ++subsys) {
639 // VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(GetSubsystemByName(subsys_name)->LoadMockDataParameters(mock_param_name));
640 // subsys_parity->LoadMockDataParameters(mapfile);
641 // }
642 QwParameterFile detectors(mapfile);
643 // This is how this should work
644 std::unique_ptr<QwParameterFile> preamble = nullptr;
645 preamble = detectors.ReadSectionPreamble();
646 // Process preamble
647 QwVerbose << "Preamble:" << QwLog::endl;
648 QwVerbose << *preamble << QwLog::endl;
649 double window_period = 0.0;
650 if (preamble->FileHasVariablePair("=","window_period",window_period)){
651 fWindowPeriod = window_period * Qw::sec;
652 }else{
654 }
655
656 QwMessage << "fWindowPeriod = " << fWindowPeriod << QwLog::endl;
657
658 std::unique_ptr<QwParameterFile> section = nullptr;
659 std::string section_name;
660 while ((section = detectors.ReadNextSection(section_name))) {
661
662 // Debugging output of configuration section
663 QwVerbose << "[" << section_name << "]" << QwLog::endl;
664 QwVerbose << *section << QwLog::endl;
665
666 // Determine type and name of subsystem
667 std::string subsys_type = section_name;
668 std::string subsys_name;
669 if (! section->FileHasVariablePair("=","name",subsys_name)) {
670 QwError << "No name defined in section for subsystem " << subsys_type << "." << QwLog::endl;
671 continue;
672 }
673 std::string mock_param_name;
674 if (! section->FileHasVariablePair("=","mock_param",mock_param_name)) {
675 QwError << "No mock data parameter defined for " << subsys_name << "." << QwLog::endl;
676 continue;
677 }
678 VQwSubsystemParity* subsys_parity = dynamic_cast<VQwSubsystemParity*>(GetSubsystemByName(subsys_name));
679 if (! subsys_parity){
680 QwError << "Subsystem " << subsys_name << " listed in the mock-data-parameter map does not match any subsystems in the detetor map file." <<QwLog::endl;
681 } else {
682 subsys_parity->LoadMockDataParameters(mock_param_name);
683 }
684 }
685}
#define QwVerbose
Predefined log drain for verbose messages.
Definition QwLog.h:54
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
ROOT file and tree management wrapper classes.
static const UInt_t kBadEventRangeError
Definition QwTypes.h:185
static const UInt_t kGlobalCut
Definition QwTypes.h:182
static const UInt_t kEventCutMode3
Definition QwTypes.h:174
Subsystem array container for parity analysis with asymmetry calculations.
Virtual base class for parity analysis subsystems.
static const double sec
Definition QwUnits.h:80
static const double ms
Time units: base unit is ms.
Definition QwUnits.h:77
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
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:55
size_type size() const noexcept
Definition QwRootFile.h:83
void push_back(const std::string &name, const char type='D')
Definition QwRootFile.h:197
void SetValue(size_type index, Double_t val)
Definition QwRootFile.h:110
QwSubsystemArray & operator=(const QwSubsystemArray &value)
Assignment operator.
virtual VQwSubsystem * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.
QwSubsystemArray()
Private default constructor.
void ConstructBranchAndVector(TTree *tree, QwRootTreeBranchVector &values)
Construct the tree and vector for this subsystem.
std::vector< std::pair< UInt_t, UInt_t > > fBadEventRange
void FillTreeVector(QwRootTreeBranchVector &values) const
Fill the vector for this subsystem.
UInt_t fCodaEventNumber
CODA event number as provided by QwEventBuffer.
void FillHistograms()
Fill the histograms for this subsystem.
Base class for subsystems implementing container-delegation pattern.
Data blinding utilities for parity violation analysis.
Definition QwBlinder.h:57
QwSubsystemArrayParity()
Private default constructor.
void PrintErrorCounters() const
Report the number of events failed due to HW and event cut failures.
QwSubsystemArrayParity & operator=(const QwSubsystemArrayParity &value)
Assignment operator.
void PrintValue() const
Print value of all channels.
~QwSubsystemArrayParity() override
Default destructor.
VQwSubsystemParity * GetSubsystemByName(const TString &name) override
Get the subsystem with the specified name.
void DeaccumulateRunningSum(const QwSubsystemArrayParity &value, Int_t ErrorMask=0xFFFFFFF)
Remove the entry value from the running sums for devices.
void Ratio(const QwSubsystemArrayParity &numer, const QwSubsystemArrayParity &denom)
Ratio of two subsystem arrays.
void Sum(const QwSubsystemArrayParity &value1, const QwSubsystemArrayParity &value2)
Sum of two subsystem arrays.
void ResolveParityPairing(const QwSubsystemArrayParity &value, const char *context) const
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
Construct a branch and vector for this subsystem with a prefix.
void WritePromptSummary(QwPromptSummary *ps, TString type)
void AccumulateAllRunningSum(const QwSubsystemArrayParity &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
Update the running sums for devices check only the error flags at the channel level....
void FillDB(QwParityDB *db, TString type)
Fill the database.
void FillHistograms()
Fill the histograms for this subsystem.
void Scale(Double_t factor)
Scale this subsystem array.
const QwSubsystemArrayParity * fResolvedParityPeer
void LoadMockDataParameters(std::string mapfile)
UInt_t GetEventcutErrorFlag() const
Return the error flag to the main routine.
void Blind(const QwBlinder *blinder)
Blind the asymmetry of this subsystem.
std::vector< Bool_t > fResolvedParityCompatible
virtual Bool_t CheckForEndOfBurst() const
void UpdateErrorFlag()
Update the error flag internally from all the subsystems.
Bool_t CheckForBurpFail(QwSubsystemArrayParity &event)
static Bool_t CanContain(VQwSubsystem *subsys)
Test whether this subsystem array can contain a particular subsystem.
std::vector< VQwSubsystem * > fResolvedParityPeerSlots
void IncrementErrorCounters()
Update the data elements' error counters based on their internal error flags.
QwSubsystemArrayParity & operator-=(const QwSubsystemArrayParity &value)
Subtraction-assignment operator.
void Difference(const QwSubsystemArrayParity &value1, const QwSubsystemArrayParity &value2)
Difference of two subsystem arrays.
void AccumulateRunningSum(const QwSubsystemArrayParity &value, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
Update the running sums for devices accumulated for the global error non-zero events/patterns.
void FillErrDB(QwParityDB *db, TString type)
QwSubsystemArrayParity & operator+=(const QwSubsystemArrayParity &value)
Addition-assignment operator.
void FillTreeVector(QwRootTreeBranchVector &values) const
Fill the vector for this subsystem.
void CalculateRunningAverage()
Calculate the average for all good events.
void FillDB_MPS(QwParityDB *db, TString type)
Fill the database with MPS-based variables Note that most subsystems don't need to do this.
std::vector< VQwSubsystemParity * > fResolvedParitySelf
Bool_t ApplySingleEventCuts()
Apply the single event cuts.
Abstract base class for subsystems participating in parity analysis.
virtual void Ratio(VQwSubsystem *numer, VQwSubsystem *denom)=0
virtual Bool_t CheckForBurpFail(const VQwSubsystem *subsys)=0
Report the number of events failed due to HW and event cut failures.
virtual UInt_t GetEventcutErrorFlag()=0
Return the error flag to the top level routines related to stability checks and ErrorFlag updates.
virtual void PrintValue() const
Print values of all channels.
virtual void FillDB_MPS(QwParityDB *, TString)
Fill the database with MPS-based variables Note that most subsystems don't need to do this.
virtual Bool_t ApplySingleEventCuts()=0
Apply the single event cuts.
virtual void FillDB(QwParityDB *, TString)
Fill the database.
virtual void Blind(const QwBlinder *)
Blind the asymmetry of this subsystem.
virtual void WritePromptSummary(QwPromptSummary *, TString)
virtual void IncrementErrorCounters()=0
Increment the error counters.
virtual void PrintErrorCounters() const =0
virtual UInt_t UpdateErrorFlag()
Uses the error flags of contained data elements to update Returns the error flag to the top level rou...
virtual void LoadMockDataParameters(TString)
virtual void CalculateRunningAverage()=0
Calculate the average for all good events.
virtual Bool_t CheckForEndOfBurst() const
virtual void FillErrDB(QwParityDB *, TString)
virtual void Scale(Double_t factor)=0