25from setup_modules
import setup_RTCtoSPTCConverters
31parser = argparse.ArgumentParser(description=
'Training sample preparation:\
32 Prepare a data sample to train the sector map.\n\
33 Usage: basf2 traininPreparation.py -i dataSample.root -- --enable_selection boolean')
40 help=
'enable the selection of training sample based on track parameters')
48 help=
"By default only RecoTracks with valid fit are taken for training. Using this option will disable that. ")
50arguments = parser.parse_args()
51use_noKick = arguments.use_NoKick
59b2.set_log_level(b2.LogLevel.ERROR)
60b2.log_to_file(
'logVXDTF2Preparation.log', append=
False)
67path = b2.create_path()
71rootInputM = b2.register_module(
'RootInput')
72path.add_module(rootInputM)
75eventinfoprinter = b2.register_module(
'EventInfoPrinter')
76path.add_module(eventinfoprinter)
78path.add_module(
"PrintCollections", printForEvent=1)
82gearbox = b2.register_module(
'Gearbox')
83path.add_module(gearbox)
86geometry = b2.register_module(
'Geometry')
87path.add_module(geometry)
96 spCreatorPXD = b2.register_module(
'PXDSpacePointCreator')
97 spCreatorPXD.param(
'NameOfInstance',
'PXDSpacePointCreator')
98 spCreatorPXD.param(
'SpacePoints',
'PXDSpacePoints')
99 path.add_module(spCreatorPXD)
101spCreatorSVD = b2.register_module(
'SVDSpacePointCreator')
102spCreatorSVD.param(
'OnlySingleClusterSpacePoints',
False)
103spCreatorSVD.param(
'NameOfInstance',
'SVDSpacePointCreator')
104spCreatorSVD.param(
'SpacePoints',
'SVDSpacePoints')
105path.add_module(spCreatorSVD)
110setup_RTCtoSPTCConverters(path=path,
111 SVDSPscollection=
'SVDSpacePoints',
112 PXDSPscollection=
'PXDSpacePoints',
113 RTCinput=
'MCRecoTracks',
114 sptcOutput=
'checkedSPTCs',
116 logLevel=b2.LogLevel.ERROR,
117 useNoKick=use_noKick,
118 useOnlyFittedTracks=
True)
126secMapBootStrap = b2.register_module(
'SectorMapBootstrap')
127secMapBootStrap.param(
'ReadSectorMap',
False)
128secMapBootStrap.param(
'WriteSectorMap',
False)
129path.add_module(secMapBootStrap)
134if os.environ.get(
'USE_BEAST2_GEOMETRY'):
140 nameTag +=
'_SVDOnly'
143SecMapTrainerBase = b2.register_module(
'VXDTFTrainingDataCollector')
144SecMapTrainerBase.param(
'NameTag', nameTag)
145SecMapTrainerBase.param(
'SpacePointTrackCandsName',
'checkedSPTCs')
147path.add_module(SecMapTrainerBase)
150path.add_module(
'Progress')
152path.add_module(
"PrintCollections", printForEvent=1)