HPS-MC
_DetectorEditor Class Reference

Abstract component to hold shared functionality for compoents that edit the detectors in hps-java. More...

Inheritance diagram for _DetectorEditor:
Component ApplyPedeRes ConstructDetector WriteMisalignedDet

Public Member Functions

def __init__ (self, name, **kwargs)
 
def required_config (self)
 Return a list of required configuration settings. More...
 
def required_parameters (self)
 Return a list of required parameters. More...
 
def optional_parameters (self)
 Return a list of optional parameters. More...
 
- Public Member Functions inherited from Component
def __init__ (self, name, command=None, nevents=None, seed=1, inputs=[], outputs=None, append_tok=None, output_ext=None, ignore_job_params=[], **kwargs)
 
def cmd_line_str (self)
 
def execute (self, log_out=sys.stdout, log_err=sys.stderr)
 Generic component execution method. More...
 
def cmd_exists (self)
 Check if the component's assigned command exists. More...
 
def cmd_args (self)
 Return the command arguments of this component. More...
 
def cmd_args_str (self)
 Return list of arguments, making sure they are all converted to strings. More...
 
def setup (self)
 Perform any necessary setup for this component to run such as making symlinks to required directories. More...
 
def cleanup (self)
 Perform post-job cleanup such as deleting temporary files. More...
 
def config_logging (self, parser)
 Configure the logging for a component. More...
 
def config (self, parser)
 Automatic configuration. More...
 
def set_parameters (self, params)
 Set class attributes for the component based on JSON parameters. More...
 
def check_config (self)
 Raise an exception on the first missing config setting for this component. More...
 
def input_files (self)
 Get a list of input files for this component. More...
 
def output_files (self)
 Return a list of output files created by this component. More...
 
def config_from_environ (self)
 Configure component from environment variables which are just upper case versions of the required config names set in the shell environment. More...
 

Public Attributes

 java_dir
 
 detector
 
 next_detector
 
 force
 
- Public Attributes inherited from Component
 name
 
 command
 
 nevents
 
 seed
 
 inputs
 
 outputs
 
 append_tok
 
 output_ext
 
 ignore_job_params
 
 hpsmc_dir
 
 logger
 

Private Member Functions

def _detector_dir (self, det_name)
 
def _deduce_next_detector (self, bump=False)
 deduce what the next detector should be given how the component has been configured More...
 
def _to_compact (self, parameter_set, detname, save_prev=True, prev_ext='prev')
 write the input parameter set into the input compact.xml file More...
 
def _update_readme (self, detname, msg)
 Update the readme for the passed detector name. More...
 

Detailed Description

Abstract component to hold shared functionality for compoents that edit the detectors in hps-java.

This component should never be used directly.

Required Config:

[<Component>]
java_dir = /full/path/to/hps-java

Required Job:

  • detector: name of detector we are starting from

Optional Parameters:

  • next_detector: name of detector to write to
  • force: ignore if the detector we are writing to already exists

Definition at line 13 of file _apply.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
**  kwargs 
)

Definition at line 33 of file _apply.py.

Member Function Documentation

◆ _deduce_next_detector()

def _deduce_next_detector (   self,
  bump = False 
)
private

deduce what the next detector should be given how the component has been configured

   The component parameter **bump** is an argument here since it is only
   a valid parameter for some components inheriting from this function.

Definition at line 58 of file _apply.py.

◆ _detector_dir()

def _detector_dir (   self,
  det_name 
)
private

Definition at line 55 of file _apply.py.

◆ _to_compact()

def _to_compact (   self,
  parameter_set,
  detname,
  save_prev = True,
  prev_ext = 'prev' 
)
private

write the input parameter set into the input compact.xml file

   Update the millepede parameters in the destination compact.xml with the
   parameters stored in the parameter_set map.

   Parameters
   ----------
   parameter_set : dict
       dict mapping parameter ID number to Parameter instance
   detname : str
       name of detector whose compact.xml we should edit
   save_prev : bool, optional
       whether to save a copy of the original compact.xml before we edited it
   prev_ext : str, optional
       extension to add to the original compact.xml if it is being saved

Definition at line 86 of file _apply.py.

◆ _update_readme()

def _update_readme (   self,
  detname,
  msg 
)
private

Update the readme for the passed detector name.

   Includes a timestamp at the end of the passed message.

Definition at line 182 of file _apply.py.

◆ optional_parameters()

def optional_parameters (   self)

Return a list of optional parameters.

Optional parameters are: nevents, seed

Reimplemented from Component.

Reimplemented in ConstructDetector, and ApplyPedeRes.

Definition at line 52 of file _apply.py.

◆ required_config()

def required_config (   self)

Return a list of required configuration settings.

There are none by default.

Reimplemented from Component.

Reimplemented in ConstructDetector, and WriteMisalignedDet.

Definition at line 46 of file _apply.py.

◆ required_parameters()

def required_parameters (   self)

Return a list of required parameters.

The job will fail if these are not present in the JSON file.

Reimplemented from Component.

Reimplemented in WriteMisalignedDet.

Definition at line 49 of file _apply.py.

Member Data Documentation

◆ detector

detector

Definition at line 38 of file _apply.py.

◆ force

force

Definition at line 42 of file _apply.py.

◆ java_dir

java_dir

Definition at line 35 of file _apply.py.

◆ next_detector

next_detector

Definition at line 41 of file _apply.py.


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