14from caf.framework
import CAF
15from caf
import backends
17from reconstruction
import add_cosmics_reconstruction
19from alignment
import setups
21b2.set_log_level(b2.LogLevel.INFO)
25 print(
'Demonstrator of Millepede alignment of CDC layers with CAF')
29 inputFiles.append(os.path.abspath(file))
31 if not len(inputFiles):
32 print(
'Usage: basf2 caf_cdc_alignment DST_FILE.root [DST_FILE2.root ... ]')
35 print(
'Input DST files:')
38 reco_path = b2.create_path()
39 reco_path.add_module(
'Progress')
40 reco_path.add_module(
'Gearbox')
41 reco_path.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'ARICH',
'BeamPipe',
'EKLM'])
43 add_cosmics_reconstruction(reco_path, components=[
'CDC'], merge_tracks=
True, pruneTracks=
False)
45 setups.dirty_data =
True
46 millepede = setups.setup_CDCLayers_GCR_Karim()
47 millepede.path = reco_path
48 calib_init = millepede.create(
'cdc_layers_init', inputFiles)
49 calib_init.max_iterations = 0
50 calib_init.max_files_per_collector_job = 1
52 setups.dirty_data =
False
53 millepede = setups.setup_CDCLayers_GCR_Karim()
54 millepede.path = reco_path
55 millepede.set_param(1.e-3,
'minPValue')
56 calib_std = millepede.create(
'cdc_layers_std', inputFiles)
57 calib_std.max_files_per_collector_job = 1
59 calib_std.depends_on(calib_init)
63 caf.add_calibration(calib_init)
64 caf.add_calibration(calib_std)
66 caf.backend = backends.Local(2)
68 caf.output_dir =
'caf_output'
71 print(
"Finished CAF Processing")
74if __name__ ==
"__main__":