ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
python.TrigValSteering.CheckSteps.ZeroCountsStep Class Reference
Inheritance diagram for python.TrigValSteering.CheckSteps.ZeroCountsStep:
Collaboration diagram for python.TrigValSteering.CheckSteps.ZeroCountsStep:

Public Member Functions

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

Public Attributes

 input_file
 
 auto_report_result
 
 required
 
 result
 

Private Attributes

 __input_files__
 

Detailed Description

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

Definition at line 574 of file CheckSteps.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 580 of file CheckSteps.py.

580  def __init__(self, name='ZeroCounts'):
581  super(ZeroCountsStep, self).__init__(name)
582  self.input_file = 'HLTChain.txt,HLTTE.txt,L1AV.txt'
583  self.auto_report_result = True
584  self.required = True
585  self.__input_files__ = None
586 

Member Function Documentation

◆ check_zero_counts()

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

Definition at line 590 of file CheckSteps.py.

590  def check_zero_counts(self, input_file):
591  if not os.path.isfile(input_file):
592  self.log.debug(
593  'Skipping %s for %s because the file does not exist',
594  self.name, input_file)
595  return -1
596  lines_checked = 0
597  with open(input_file, encoding='utf-8') as f_in:
598  for line in f_in.readlines():
599  split_line = line.split()
600  lines_checked += 1
601  if int(split_line[-1]) != 0:
602  return 0 # at least one non-zero count
603  if lines_checked == 0:
604  self.log.error('Failed to read counts from %s', input_file)
605  return 1 # all counts are zero
606 

◆ configure()

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

Definition at line 587 of file CheckSteps.py.

587  def configure(self, test=None):
588  self.__input_files__ = self.input_file.split(',')
589 

◆ run()

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

Definition at line 607 of file CheckSteps.py.

607  def run(self, dry_run=False):
608  results = []
609  for input_file in self.__input_files__:
610  results.append(self.check_zero_counts(input_file))
611 
612  self.result = max(results)
613  cmd = '# (internal) {} for {}'.format(self.name, self.__input_files__)
614  if self.result < 0:
615  cmd = '# (internal) {} -> skipped'.format(self.name)
616  self.result = 0
617  return self.result, cmd
618  self.log.info('Running %s step', self.name)
619  if self.auto_report_result:
620  self.report_result()
621  return self.result, cmd
622 
623 

Member Data Documentation

◆ __input_files__

python.TrigValSteering.CheckSteps.ZeroCountsStep.__input_files__
private

Definition at line 585 of file CheckSteps.py.

◆ auto_report_result

python.TrigValSteering.CheckSteps.ZeroCountsStep.auto_report_result

Definition at line 583 of file CheckSteps.py.

◆ input_file

python.TrigValSteering.CheckSteps.ZeroCountsStep.input_file

Definition at line 582 of file CheckSteps.py.

◆ required

python.TrigValSteering.CheckSteps.ZeroCountsStep.required

Definition at line 584 of file CheckSteps.py.

◆ result

python.TrigValSteering.CheckSteps.ZeroCountsStep.result

Definition at line 612 of file CheckSteps.py.


The documentation for this class was generated from the following file:
grepfile.info
info
Definition: grepfile.py:38
max
#define max(a, b)
Definition: cfImp.cxx:41
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
configure
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)
Definition: TrigGlobEffCorrValidation.cxx:514
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
error
Definition: IImpactPoint3dEstimator.h:70
Trk::split
@ split
Definition: LayerMaterialProperties.h:38