22.5. SVD Utility Functions#

svd.__init__.add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)[source]

Adds the SVD reconstruction to the path.

Reconstruction starts with SVDShaperDigits and SVDEventInfo and provides SVDClusters and SVDSpacePoints.

Parameters:
  • path – add the modules to this basf2 path.

  • isROIsimulation – SVD reconstruction can be run during simulation in order to simulate the PXD Data Reduction with ROI finding.

  • createRecoDigits – if True, SVDRecoDigits are created.

  • applyMasking – if True, hot strips found in SVDHotStripsCalibration are masked.

svd.__init__.add_svd_SPcreation(path, isROIsimulation=False)[source]#

Adds the SVD SpacePoint Creator to the path.

Parameters:
  • path – add the modules to this basf2 path.

  • isROIsimulation – SVD reconstruction can be run during simulation in order to simulate the PXD Data Reduction with ROI finding.

svd.__init__.add_svd_create_recodigits(path, recocreatorName='SVDRecoDigitCreator', shaperDigitsName='')[source]

Adds the strip reconstruction to the path.

Produce SVDRecoDigits from SVDShaperDigits.

Parameters:
  • path – add the modules to this basf2 path.

  • recocreatorName – name of the module.

  • shaperDigitsName – name of the SVDShaperDigits StoreArray.

svd.__init__.add_rel5_svd_reconstruction(path, isROIsimulation=False, applyMasking=False)[source]#

Adds the old (up to release-05) SVD reconstruction to the path.

Reconstruction starts with SVDShaperDigits and SVDEventInfo and provides SVDClusters and SVDSpacePoints.

Parameters:
  • path – add the modules to this basf2 path.

  • isROIsimulation – SVD reconstruction can be run during simulation in order to simulate the PXD Data Reduction with ROI finding.

  • applyMasking – if True, hot strips found in SVDHotStripsCalibration are masked.

svd.__init__.add_svd_unpacker(path)[source]#

Adds the SVD Unpacker to the path.

The unpacker produces SVDShaperDigits and SVDEventInfo.

Parameters:

path – add the modules to this basf2 path.

svd.__init__.add_svd_unpacker_simulate3sampleDAQ(path, latencyShift=-1, relativeShift=-1)[source]#

Adds the SVD Unpacker to the path, emulating the 3-sample mode from the 6-sample mode.

Parameters:
  • path – add the modules to this basf2 path.

  • latencyShift – relative time shift between the 3-sample and the 6-sample mode, in APV clocks. 0 <= latencyShift <=3

  • relativeShift – relative time shift between the 3-sample and the 6-sample mode, in units of 1/4 of APV clock. 0 <= relativeShift <=12

Warning

at least one between relativeShift and latencyShift should be set (different from -1).

svd.__init__.add_svd_simulation(path, useConfigFromDB=False, daqMode=2, relativeShift=9)[source]

Adds the SVD simulation to the path.

Simulation ends with SVDShaperDigits and SVDEventInfo.

Parameters:
  • path – add the modules to this basf2 path.

  • useConfigFromDB – if True, read the SVD configuration from SVDGlobalConfigParameters.

  • daqMode – = 2 for the default 6-sample mode, = 1 for the 3-sample mode, = 3 for the 3-mixed-6 sample mode.

  • relativeShift – relative time shift between the 3-sample and the 6-sample mode in units of 1/4 of APV clock. If useConfigFromDB is True, the value of this parameter is overwritten.

svd.__init__.add_svd_packer(path)[source]#

Adds the SVD Packer to the path.

Parameters:

path – add the modules to this basf2 path.

22.5.1. event skim utils#

To use these skim modules, first import it:

svd.skim_utils import skimOutRNDTrgModule

then use it:

skimRNDtrg = skimOutRNDTrgModule()
main.add_module(skimRNDtrg)
emptypath = create_path()
skimRNDtrg.if_false(emptypath)
svd.skim_utils.skimOutRNDTrgModule()[source]#

returns True if the event is NOT a random triggered event

svd.skim_utils.skimSVDBurstEventsModule()[source]#

returns True if the event is a Burst event (number of strips > max number of strips) use set_nMaxStrips(nMaxStrips) to set the max number of strips of a non-burst event, default is nMaxStrips=5000

svd.skim_utils.skim6SampleEventsPyModule()[source]#

returns True if the event is acquired with 6 samples

svd.skim_utils.skimSVDTriggerBinEventsPyModule()[source]#

returns True if TriggerBin of the event is the selected one, use set_tb(tb) to set the value of the selected TriggerBin (0,1,2,3)

svd.skim_utils.skimFineTRGEventsPyModule()[source]#

returns True if the event has a fine trigger from TRGSummary

svd.skim_utils.skimLowHighEventT0EventsPyModule()[source]#

returns True if (abs(EventT0) is smaller than a selected value that can be set with set_maxAbsEventT0(evtT0max)) AND (abs(EventT0) is larger than a selected value that can be set with set_minAbsEventT0(evtT0min))

example:

# select events with |EventT0| < maxAbsEvtT0 and |EventT0| > minAbsEvtT0
maxAbsEvtT0 = 25 # in ns
minAbsEvtT0 = -1 # in ns
skim = b2.register_module(skimLowHighEventT0EventsPyModule())
skim.set_maxAbsEventT0( maxAbsEvtT0 )
skim.set_minAbsEventT0( minAbsEvtT0 )
main.add_module(skim)
emptypath = b2.create_path()
skim.if_false(emptypath)

22.5.2. calibration validation utils#

please check svd/scripts/svd/validation_utils.py

22.5.3. background overlay utils#

Warning

These functions are not part of the official background overlay tools. Use them only if you know what you are doing!

svd.overlay_utils.prepare_svd_overlay(path, inputFiles, outputFileTag='overlay')[source]#

This function reads a list of input files and prepare them to be used in overlay_svd_data

Parameters:
  • inputFiles – list of input files to be processed

  • outputFileTag – tag added just before the .root

svd.overlay_utils.overlay_svd_data(path, datatype='randomTrigger', overlayfiles='')[source]#

This function overlay events from data to the standard simulation

Parameters:
  • datatype – must be chosen among {xTalk, cosmics,randomTrigger, randomTriggerZS5, user-defined}

  • overlayfiles – if the datatype is user-defiled, the user can specify rootfiles to be overlaied to simulation