7def LArPhysWaveFromAsciiCfg(flags,InputFile='',hasIndex=False, **kwargs):
8
9 cfg=ComponentAccumulator()
10 from AthenaCommon.Logging import logging
11 mlog = logging.getLogger( 'LArPhysWaveFromAscii' )
12 if not flags.hasCategory('LArCalib'):
13 mlog.error("We need the LArCalib flags")
14 return cfg
15
16 if flags.LArCalib.isSC:
17 mlog.info("Running for SC")
18
19 from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
20 cfg.merge(LArCalibBaseCfg(flags))
21
22 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
23 cfg.merge(LArOnOffIdMappingCfg(flags))
24
25 if 'SkipPoints' not in kwargs:
26 kwargs.setdefault('SkipPoints', 0)
27 if 'PrefixPoints' not in kwargs:
28 kwargs.setdefault('PrefixPoints', 0)
29 if 'StoreKey' not in kwargs:
30 kwargs.setdefault('StoreKey', 'LArPhysWaveSCMeasured')
31
32 algo = CompFactory.LArPhysWaveFromAscii("LArPhysWaveFromAscii", **kwargs)
33 algo.InputFile = InputFile
34 algo.GroupingType = flags.LArCalib.GroupingType
35 algo.isSC = flags.LArCalib.isSC
36 algo.Index = hasIndex
37
38 cfg.addEventAlgo(algo)
39
40 if flags.LArCalib.Output.ROOTFile != "":
41
42 ntdump = CompFactory.LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" )
43 ntdump.NtupleName = "PHYSWAVE"
44 ntdump.KeyList = [ kwargs['StoreKey'] ]
45 ntdump.SaveDerivedInfo = True
46 if flags.LArCalib.isSC:
47 ntdump.isSC = flags.LArCalib.isSC
48 ntdump.BadChanKey = "LArBadChannelSC"
49
50 cfg.addEventAlgo(ntdump)
51
52 cfg.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+flags.LArCalib.Output.ROOTFile+"' OPT='NEW'" ]))
53 cfg.setAppProperty("HistogramPersistency","ROOT")
54
55 if ( flags.LArCalib.Output.POOLFile != "" ):
56
57 OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+kwargs['StoreKey']+"#"+ flags.LArCalib.PhysWave.Folder
58 OutputObjectSpecTagPhysWave = ''.join(flags.LArCalib.PhysWave.Folder.split('/')) + "-test-00"
59
60 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
61 cfg.merge(OutputConditionsAlgCfg(flags,
62 outputFile=flags.LArCalib.Output.POOLFile,
63 ObjectList=[OutputObjectSpecPhysWave],
64 IOVTagList=[OutputObjectSpecTagPhysWave],
65 Run1=flags.LArCalib.IOVStart,
66 Run2=flags.LArCalib.IOVEnd
67 ))
68
69 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = True))
70
71
72 cfg.getService("IOVDbSvc").DBInstance=""
73
74 return cfg
75
76