15. Reconstruction

15.1. Functions in reconstructions.py

reconstruction.add_arich_modules(path, components=None)[source]

Add the ARICH reconstruction to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_cdst_output(path, mc=True, filename='cdst.root', additionalBranches=[], dataDescription=None, rawFormat=False, ignoreInputModulesCheck=False)[source]

This function adds the RootOutput module to a path with the settings needed to produce a cDST output.

Parameters
  • path – Path to add modules to.

  • mc – Save Monte Carlo quantities? (MCParticles and corresponding relations)

  • filename – Output file name.

  • additionalBranches – Additional objects/arrays of event durability to save

  • dataDescription – Additional key->value pairs to be added as data description fields to the output FileMetaData

  • rawFormat – Saves the cDST file in the raw+tracking format if mc=False, otherwise saves the cDST file in the digits+tracking format.

  • ignoreInputModulesCheck – If True, do not enforce check on missing PXD modules in the input path. Needed when a conditional path is passed as input.

reconstruction.add_cluster_expert_modules(path, components=None)[source]

Add the KLMExpert and ClusterMatcher modules to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_cosmics_reconstruction(path, components=None, pruneTracks=True, skipGeometryAdding=False, eventTimingExtraction=True, addClusterExpertModules=True, merge_tracks=True, top_in_counter=False, data_taking_period='early_phase3', use_second_cdc_hits=False, add_muid_hits=False, reconstruct_cdst=False)[source]

This function adds the standard reconstruction modules for cosmic data to a path. Consists of tracking and the functionality provided by add_posttracking_reconstruction(), plus the modules to calculate the software trigger cuts.

Parameters
  • path – Add the modules to this path.

  • data_taking_period – The cosmics generation will be added using the parameters, that where used in this period of data taking. The periods can be found in cdc/cr/__init__.py.

  • components – list of geometry components to include reconstruction for, or None for all components.

  • pruneTracks – Delete all hits except the first and last of the tracks after the dEdX modules.

  • skipGeometryAdding – Advances flag: The tracking modules need the geometry module and will add it, if it is not already present in the path. In a setup with multiple (conditional) paths however, it can not determine, if the geometry is already loaded. This flag can be used to just turn off the geometry adding at all (but you will have to add it on your own then).

  • eventTimingExtraction – extract the event time

  • addClusterExpertModules – Add the cluster expert modules in the KLM and ECL. Turn this off to reduce execution time.

  • merge_tracks – The upper and lower half of the tracks should be merged together in one track

  • use_second_cdc_hits – If true, the second hit information will be used in the CDC track finding.

  • top_in_counter – time of propagation from the hit point to the PMT in the trigger counter is subtracted (assuming PMT is put at -z of the counter).

  • add_muid_hits – Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.

  • reconstruct_cdst – run only the minimal reconstruction needed to produce the cdsts (raw+tracking+dE/dx)

reconstruction.add_dedx_modules(path, components=None)[source]

Add the dEdX reconstruction modules to the path and prune the tracks afterwards if wanted.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_chargedpid_module(path, components=None)[source]

Add the ECL charged PID module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_cluster_properties_modules(path, components=None)[source]

Add the ECL cluster properties module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_finalizer_module(path, components=None)[source]

Add the ECL finalizer module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_mc_matcher_module(path, components=None)[source]

Add the ECL MC matcher module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_modules(path, components=None)[source]

Add the ECL reconstruction modules to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_track_brem_finder(path, components=None)[source]

Add the bremsstrahlung finding module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ecl_track_cluster_modules(path, components=None)[source]

Add the ECL track cluster matching module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_ext_module(path, components=None)[source]

Add the extrapolation module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_klm_mc_matcher_module(path, components=None)[source]

Add the KLM mc matcher module to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_klm_modules(path, components=None)[source]

Add the KLM reconstruction modules to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_mc_reconstruction(path, components=None, pruneTracks=True, addClusterExpertModules=True, use_second_cdc_hits=False, add_muid_hits=False)[source]

This function adds the standard reconstruction modules with MC tracking to a path.

Parameters
  • components – list of geometry components to include reconstruction for, or None for all components.

  • use_second_cdc_hits – If true, the second hit information will be used in the CDC track finding.

  • add_muid_hits – Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.

reconstruction.add_mdst_output(path, mc=True, filename='mdst.root', additionalBranches=[], dataDescription=None)[source]

This function adds the MDST output modules to a path, saving only objects defined as part of the MDST data format.

Parameters
  • path – Path to add modules to

  • mc – Save Monte Carlo quantities? (MCParticles and corresponding relations)

  • filename – Output file name.

  • additionalBranches – Additional objects/arrays of event durability to save

  • dataDescription – Additional key->value pairs to be added as data description fields to the output FileMetaData

reconstruction.add_muid_module(path, add_hits_to_reco_track=False, components=None)[source]

Add the MuID module to the path.

Parameters
  • path – The path to add the modules to.

  • add_hits_to_reco_track – Add the found KLM hits also to the RecoTrack. Make sure to refit the track afterwards.

  • components – The components to use or None to use all standard components.

reconstruction.add_pid_module(path, components=None)[source]

Add the PID modules to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

reconstruction.add_posttracking_reconstruction(path, components=None, pruneTracks=True, addClusterExpertModules=True, add_muid_hits=False, cosmics=False)[source]

This function adds the standard reconstruction modules after tracking to a path.

Parameters
  • path – The path to add the modules to.

  • components – list of geometry components to include reconstruction for, or None for all components.

  • pruneTracks – Delete all hits except the first and last after the post-tracking modules.

  • addClusterExpertModules – Add the cluster expert modules in the KLM and ECL. Turn this off to reduce execution time.

  • add_muid_hits – Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.

  • cosmics – if True, steer TOP for cosmic reconstruction

reconstruction.add_pretracking_reconstruction(path, components=None)[source]

This function adds the standard reconstruction modules BEFORE tracking to a path.

Parameters
  • path – The path to add the modules to.

  • components – list of geometry components to include reconstruction for, or None for all components.

reconstruction.add_reconstruction(path, components=None, pruneTracks=True, add_trigger_calculation=True, skipGeometryAdding=False, trackFitHypotheses=None, addClusterExpertModules=True, use_second_cdc_hits=False, add_muid_hits=False, reconstruct_cdst=None, nCDCHitsMax=6000, nSVDShaperDigitsMax=70000, event_abort=<function default_event_abort>, use_random_numbers_for_hlt_prescale=True)[source]

This function adds the standard reconstruction modules to a path. Consists of tracking and the functionality provided by add_posttracking_reconstruction(), plus the modules to calculate the software trigger cuts.

Parameters
  • path – Add the modules to this path.

  • components – list of geometry components to include reconstruction for, or None for all components.

  • pruneTracks – Delete all hits except the first and last of the tracks after the dEdX modules.

  • skipGeometryAdding – Advances flag: The tracking modules need the geometry module and will add it, if it is not already present in the path. In a setup with multiple (conditional) paths however, it can not determine, if the geometry is already loaded. This flag can be used to just turn off the geometry adding at all (but you will have to add it on your own then).

  • trackFitHypotheses – Change the additional fitted track fit hypotheses. If no argument is given, the fitted hypotheses are pion, muon and proton, i.e. [211, 321, 2212].

  • addClusterExpertModules – Add the cluster expert modules in the KLM and ECL. Turn this off to reduce execution time.

  • use_second_cdc_hits – If true, the second hit information will be used in the CDC track finding.

  • add_muid_hits – Add the found KLM hits to the RecoTrack. Make sure to refit the track afterwards.

  • add_trigger_calculation – add the software trigger modules for monitoring (do not make any cut)

  • reconstruct_cdst – None for mdst, ‘rawFormat’ to reconstruct cdsts in rawFormat, ‘fullFormat’ for the full (old) format. This parameter is needed when reconstructing cdsts, otherwise the required PXD objects won’t be added.

  • nCDCHitsMax – the max number of CDC hits for an event to be reconstructed.

  • nSVDShaperDigitsMax – the max number of SVD shaper digits for an event to be reconstructed.

  • event_abort – A function to abort event processing at the given point. Should take three arguments: a module, the condition and the error_flag to be set if these events are kept. If run on HLT this will not abort the event but just remove all data except for the event information.

  • use_random_numbers_for_hlt_prescale – If True, the HLT filter prescales are applied using randomly generated numbers, otherwise are applied using an internal counter.

reconstruction.add_top_modules(path, components=None, cosmics=False)[source]

Add the TOP reconstruction to the path.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

  • cosmics – if True, steer TOP for cosmic reconstruction

reconstruction.default_event_abort(module, condition, error_flag)[source]

Default event abort outside of HLT: Ignore the error flag and just stop processing by giving an empty path

reconstruction.prepare_cdst_analysis(path, components=None, mc=False)[source]

Adds to a (analysis) path all the modules needed to analyse a cDST file in the raw+tracking format for collisions/cosmics data or in the digits+tracking format for MC data.

Parameters
  • path – The path to add the modules to.

  • components – The components to use or None to use all standard components.

  • mc – Are we running over MC data or not? If so, do not run the unpackers.