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