|
19 | 19 | # |
20 | 20 |
|
21 | 21 | from Gaudi.Configuration import INFO |
22 | | -from Configurables import MarlinProcessorWrapper, k4DataSvc, GeoSvc |
| 22 | +from Configurables import MarlinProcessorWrapper, EventDataSvc, GeoSvc |
| 23 | +from k4FWCore import ApplicationMgr, IOSvc |
23 | 24 | from k4FWCore.parseArgs import parser |
24 | | -from k4MarlinWrapper.inputReader import create_reader, attach_edm4hep2lcio_conversion |
| 25 | +from k4MarlinWrapper.io_helpers import IOHandlerHelper |
25 | 26 |
|
26 | 27 |
|
27 | 28 | parser.add_argument( |
|
42 | 43 | reco_args = parser.parse_known_args()[0] |
43 | 44 |
|
44 | 45 | algList = [] |
45 | | -svcList = [] |
46 | | - |
47 | | -evtsvc = k4DataSvc("EventDataSvc") |
48 | | -svcList.append(evtsvc) |
| 46 | +svcList = [EventDataSvc("EventDataSvc")] |
49 | 47 |
|
| 48 | +iosvc = IOSvc() |
50 | 49 |
|
51 | 50 | geoSvc = GeoSvc("GeoSvc") |
52 | 51 | geoSvc.detectors = [reco_args.compactFile] |
53 | 52 | geoSvc.OutputLevel = INFO |
54 | 53 | geoSvc.EnableGeant4Geo = False |
55 | 54 | svcList.append(geoSvc) |
56 | 55 |
|
57 | | - |
58 | | -if reco_args.inputFiles: |
59 | | - read = create_reader(reco_args.inputFiles, evtsvc) |
60 | | - read.OutputLevel = INFO |
61 | | - algList.append(read) |
62 | | -else: |
63 | | - read = None |
| 56 | +io_handler = IOHandlerHelper(algList, iosvc) |
| 57 | +io_handler.add_reader(reco_args.inputFiles) |
64 | 58 |
|
65 | 59 | MyCEDViewer = MarlinProcessorWrapper("MyCEDViewer") |
66 | 60 | MyCEDViewer.OutputLevel = INFO |
|
527 | 521 | algList.append(MyCEDViewer) |
528 | 522 |
|
529 | 523 | # We need to convert the inputs in case we have EDM4hep input |
530 | | -attach_edm4hep2lcio_conversion(algList, read) |
| 524 | +io_handler.finalize_converters() |
531 | 525 |
|
532 | | -from Configurables import ApplicationMgr |
533 | | - |
534 | | -ApplicationMgr(TopAlg=algList, EvtSel="NONE", EvtMax=10, ExtSvc=svcList, OutputLevel=INFO) |
| 526 | +ApplicationMgr( |
| 527 | + TopAlg=algList, EvtSel="NONE", EvtMax=10, ExtSvc=svcList, OutputLevel=INFO |
| 528 | +) |
0 commit comments