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 571 of file CheckSteps.py.

Constructor & Destructor Documentation

◆ __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

Member Function Documentation

◆ 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):
589 self.log.debug(
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 # at least one non-zero count
600 if lines_checked == 0:
601 self.log.error('Failed to read counts from %s', input_file)
602 return 1 # all counts are zero
603
const bool debug

◆ configure()

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

Definition at line 584 of file CheckSteps.py.

584 def configure(self, test=None):
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=":")
Definition hcg.cxx:177

◆ 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
#define max(a, b)
Definition cfImp.cxx:41
Definition run.py:1

Member Data Documentation

◆ __input_files__

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

Definition at line 582 of file CheckSteps.py.

◆ auto_report_result

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

Definition at line 580 of file CheckSteps.py.

◆ input_file

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

Definition at line 579 of file CheckSteps.py.

◆ name

python.TrigValSteering.CheckSteps.ZeroCountsStep.name

Definition at line 591 of file CheckSteps.py.

◆ required

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

Definition at line 581 of file CheckSteps.py.

◆ result

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

Definition at line 609 of file CheckSteps.py.


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