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")
16 if flags.LArCalib.isSC:
17 mlog.info(
"Running for SC")
19 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg
20 cfg.merge(LArCalibBaseCfg(flags))
22 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
23 cfg.merge(LArOnOffIdMappingCfg(flags))
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')
32 algo = CompFactory.LArPhysWaveFromAscii(
"LArPhysWaveFromAscii", **kwargs)
33 algo.InputFile = InputFile
34 algo.GroupingType = flags.LArCalib.GroupingType
35 algo.isSC = flags.LArCalib.isSC
38 cfg.addEventAlgo(algo)
40 if flags.LArCalib.Output.ROOTFile !=
"":
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"
50 cfg.addEventAlgo(ntdump)
52 cfg.addService(CompFactory.NTupleSvc(Output = [
"FILE1 DATAFILE='"+flags.LArCalib.Output.ROOTFile+
"' OPT='NEW'" ]))
53 cfg.setAppProperty(
"HistogramPersistency",
"ROOT")
55 if ( flags.LArCalib.Output.POOLFile !=
"" ):
57 OutputObjectSpecPhysWave =
"LArPhysWaveContainer#"+kwargs[
'StoreKey']+
"#"+ flags.LArCalib.PhysWave.Folder
58 OutputObjectSpecTagPhysWave =
''.join(flags.LArCalib.PhysWave.Folder.split(
'/')) +
"-test-00"
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
69 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
True))
72 cfg.getService(
"IOVDbSvc").DBInstance=
""