ATLAS Offline Software
Loading...
Searching...
No Matches
python.TrigValSteering.CheckSteps.ZeroCountsStep Class Reference
Inheritance diagram for python.TrigValSteering.CheckSteps.ZeroCountsStep:
Collaboration diagram for python.TrigValSteering.CheckSteps.ZeroCountsStep:

Public Member Functions

 __init__ (self, name='ZeroCounts')
 configure (self, test=None)
 check_zero_counts (self, input_file)
 run (self, dry_run=False)

Public Attributes

str input_file = 'HLTChain.txt,HLTTE.txt,L1AV.txt'
bool auto_report_result = True
bool required = True
 name
int result = max(results)

Private Attributes

str __input_files__ = None

Detailed Description

Check if all counts are zero.
input_file can have multiple comma-separated values

Definition at line 550 of file CheckSteps.py.

Constructor & Destructor Documentation

◆ __init__()

python.TrigValSteering.CheckSteps.ZeroCountsStep.__init__ ( self,
name = 'ZeroCounts' )

Definition at line 556 of file CheckSteps.py.

556 def __init__(self, name='ZeroCounts'):
557 super(ZeroCountsStep, self).__init__(name)
558 self.input_file = 'HLTChain.txt,HLTTE.txt,L1AV.txt'
559 self.auto_report_result = True
560 self.required = True
561 self.__input_files__ = None
562

Member Function Documentation

◆ check_zero_counts()

python.TrigValSteering.CheckSteps.ZeroCountsStep.check_zero_counts ( self,
input_file )

Definition at line 566 of file CheckSteps.py.

566 def check_zero_counts(self, input_file):
567 if not os.path.isfile(input_file):
568 self.log.debug(
569 'Skipping %s for %s because the file does not exist',
570 self.name, input_file)
571 return -1
572 lines_checked = 0
573 with open(input_file, encoding='utf-8') as f_in:
574 for line in f_in.readlines():
575 split_line = line.split()
576 lines_checked += 1
577 if int(split_line[-1]) != 0:
578 return 0 # at least one non-zero count
579 if lines_checked == 0:
580 self.log.error('Failed to read counts from %s', input_file)
581 return 1 # all counts are zero
582
const bool debug

◆ configure()

python.TrigValSteering.CheckSteps.ZeroCountsStep.configure ( self,
test = None )

Definition at line 563 of file CheckSteps.py.

563 def configure(self, test=None):
564 self.__input_files__ = self.input_file.split(',')
565
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=":")
Definition hcg.cxx:179

◆ run()

python.TrigValSteering.CheckSteps.ZeroCountsStep.run ( self,
dry_run = False )

Definition at line 583 of file CheckSteps.py.

583 def run(self, dry_run=False):
584 results = []
585 for input_file in self.__input_files__:
586 results.append(self.check_zero_counts(input_file))
587
588 self.result = max(results)
589 cmd = '# (internal) {} for {}'.format(self.name, self.__input_files__)
590 if self.result < 0:
591 cmd = '# (internal) {} -> skipped'.format(self.name)
592 self.result = 0
593 return self.result, cmd
594 self.log.info('Running %s step', self.name)
595 if self.auto_report_result:
596 self.report_result()
597 return self.result, cmd
598
599
#define max(a, b)
Definition cfImp.cxx:41
int run(int argc, char *argv[])

Member Data Documentation

◆ __input_files__

str python.TrigValSteering.CheckSteps.ZeroCountsStep.__input_files__ = None
private

Definition at line 561 of file CheckSteps.py.

◆ auto_report_result

bool python.TrigValSteering.CheckSteps.ZeroCountsStep.auto_report_result = True

Definition at line 559 of file CheckSteps.py.

◆ input_file

str python.TrigValSteering.CheckSteps.ZeroCountsStep.input_file = 'HLTChain.txt,HLTTE.txt,L1AV.txt'

Definition at line 558 of file CheckSteps.py.

◆ name

python.TrigValSteering.CheckSteps.ZeroCountsStep.name

Definition at line 570 of file CheckSteps.py.

◆ required

bool python.TrigValSteering.CheckSteps.ZeroCountsStep.required = True

Definition at line 560 of file CheckSteps.py.

◆ result

python.TrigValSteering.CheckSteps.ZeroCountsStep.result = max(results)

Definition at line 588 of file CheckSteps.py.


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