Check if all counts are zero.
input_file can have multiple comma-separated values
Definition at line 571 of file CheckSteps.py.
◆ __init__()
| python.TrigValSteering.CheckSteps.ZeroCountsStep.__init__ |
( |
| self, |
|
|
| name = 'ZeroCounts' ) |
Definition at line 577 of file CheckSteps.py.
577 def __init__(self, name='ZeroCounts'):
578 super(ZeroCountsStep, self).__init__(name)
579 self.input_file = 'HLTChain.txt,HLTTE.txt,L1AV.txt'
580 self.auto_report_result = True
581 self.required = True
582 self.__input_files__ = None
583
◆ check_zero_counts()
| python.TrigValSteering.CheckSteps.ZeroCountsStep.check_zero_counts |
( |
| self, |
|
|
| input_file ) |
Definition at line 587 of file CheckSteps.py.
587 def check_zero_counts(self, input_file):
588 if not os.path.isfile(input_file):
590 'Skipping %s for %s because the file does not exist',
591 self.name, input_file)
592 return -1
593 lines_checked = 0
594 with open(input_file, encoding='utf-8') as f_in:
595 for line in f_in.readlines():
596 split_line = line.split()
597 lines_checked += 1
598 if int(split_line[-1]) != 0:
599 return 0
600 if lines_checked == 0:
601 self.log.
error(
'Failed to read counts from %s', input_file)
602 return 1
603
◆ configure()
| python.TrigValSteering.CheckSteps.ZeroCountsStep.configure |
( |
| self, |
|
|
| test = None ) |
Definition at line 584 of file CheckSteps.py.
585 self.__input_files__ = self.input_file.
split(
',')
586
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
◆ run()
| python.TrigValSteering.CheckSteps.ZeroCountsStep.run |
( |
| self, |
|
|
| dry_run = False ) |
Definition at line 604 of file CheckSteps.py.
604 def run(self, dry_run=False):
605 results = []
606 for input_file in self.__input_files__:
607 results.append(self.check_zero_counts(input_file))
608
609 self.result =
max(results)
610 cmd = '# (internal) {} for {}'.format(self.name, self.__input_files__)
611 if self.result < 0:
612 cmd = '# (internal) {} -> skipped'.format(self.name)
613 self.result = 0
614 return self.result, cmd
615 self.log.info('Running %s step', self.name)
616 if self.auto_report_result:
617 self.report_result()
618 return self.result, cmd
619
620
◆ __input_files__
| str python.TrigValSteering.CheckSteps.ZeroCountsStep.__input_files__ = None |
|
private |
◆ auto_report_result
| bool python.TrigValSteering.CheckSteps.ZeroCountsStep.auto_report_result = True |
◆ input_file
| str python.TrigValSteering.CheckSteps.ZeroCountsStep.input_file = 'HLTChain.txt,HLTTE.txt,L1AV.txt' |
◆ name
| python.TrigValSteering.CheckSteps.ZeroCountsStep.name |
◆ required
| bool python.TrigValSteering.CheckSteps.ZeroCountsStep.required = True |
◆ result
| python.TrigValSteering.CheckSteps.ZeroCountsStep.result = max(results) |
The documentation for this class was generated from the following file: