5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 if __name__==
'__main__':
13 from AthenaCommon
import Logging
14 log = Logging.logging.getLogger(
'LArNoiseCorrelation' )
16 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
17 parser.add_argument(
'-i',
'--indir', dest=
'indir', default=
"/eos/atlas/atlastier0/rucio/data_test/calibration_pulseall/00414414/data_test.00414414.calibration_pulseall.daq.RAW/", help=
'input files dir', type=str)
18 parser.add_argument(
'-p',
'--inprefix', dest=
'inpref', default=
"data_test", help=
'Input filenames prefix', type=str)
19 parser.add_argument(
'-y',
'--inppatt', dest=
'inppatt', default=
"lb3512", help=
'Input filenames pattern', type=str)
20 parser.add_argument(
'-l',
'--infile', dest=
'infile', default=
"", help=
'Input filename (if given indir and inprefix are ignored', type=str)
21 parser.add_argument(
'-r',
'--run', dest=
'run', default=0, help=
'Run number (if not given trying to judge from input file name)', type=int)
22 parser.add_argument(
'-n',
'--cnf', dest=
'cnf', default=
False, action=
"store_true", help=
'Run also CNF computation')
23 parser.add_argument(
'-c',
'--calib', dest=
'calib', default=
False, action=
"store_true", help=
'Is this calibration run ?')
24 parser.add_argument(
'-g',
'--gain', dest=
'gain', default=
"HIGH", help=
'Gain in case of calib. data', type=str)
25 parser.add_argument(
'-f',
'--febs', dest=
'febs', default=[], nargs=
"+", help=
'space-separated list of FEB names, which will be monitored', type=str)
26 parser.add_argument(
'-m',
'--maxev', dest=
'maxev', default=-1, help=
'Max number of events to dump', type=int)
27 parser.add_argument(
'-s',
'--skipev', dest=
'skipev', default=-1, help=
'events to skip', type=int)
28 parser.add_argument(
'-x',
'--outlevel', dest=
'olevel', default=3, help=
'OuputLevel for dumping algo', type=int)
29 parser.add_argument(
'-o',
'--outfile', dest=
'outfile', default=
"LArNoiseCorr.root", help=
'Output root filename', type=str)
30 parser.add_argument(
'-a',
'--postproc', dest=
'postp', default=
False, action=
"store_true", help=
'Do a postprocessing ?')
31 parser.add_argument(
'-t',
'--FTs', dest=
'ft', default=[], nargs=
"+", type=int, help=
'list of FT which will be read out (space separated).')
32 parser.add_argument(
'-v',
'--posneg', dest=
'posneg', default=[], nargs=
"+", help=
'side to read out (-1 means both), can give multiple arguments (space separated). Default %(default)s.', type=int,choices=
range(-1,2))
33 parser.add_argument(
'-b',
'--barrel_ec', dest=
'be', default=[], nargs=
"+", help=
'subdet to read out (-1 means both), can give multiple arguments (space separated) Default %(default)s.', type=int,choices=
range(-1,2))
35 args = parser.parse_args()
40 for _, value
in args._get_kwargs():
45 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
46 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
47 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
49 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
53 if len(args.infile) > 0:
54 flags.Input.Files = [args.infile]
55 elif len(args.inppatt) > 0:
56 from LArCalibProcessing.GetInputFiles
import GetInputFilesFromPattern
59 from LArCalibProcessing.GetInputFiles
import GetInputFilesFromPrefix
63 flags.Input.RunNumber = [args.run]
65 if len(args.febs) > 0:
66 flags.LArMon.customFEBsToMonitor = args.febs
69 flags.LArMon.LArDigitKey = args.gain
70 flags.LArMon.calibRun =
True
72 flags.LArMon.LArDigitKey =
'FREE'
74 if len(args.posneg) >= 0:
75 flags.LArCalib.Preselection.Side = args.posneg
77 flags.LArCalib.Preselection.BEC = args.be
79 flags.LArCalib.Preselection.FT = args.ft
82 flags.Output.HISTFileName = args.outfile
83 flags.DQ.enableLumiAccess =
False
84 flags.DQ.useTrigger =
False
87 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
89 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg
93 from LArByteStream.LArRawCalibDataReadingConfig
import LArRawCalibDataReadingCfg
96 from LArByteStream.LArRawDataReadingConfig
import LArRawDataReadingCfg
98 if len(flags.LArCalib.Preselection.Side) > 0
or len(flags.LArCalib.Preselection.BEC) > 0
or len(flags.LArCalib.Preselection.FT) > 0:
99 log.warning(
'No preselection yet in reading physics data !!!')
102 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
105 from LArMonitoring.LArNoiseCorrelationMonAlg
import LArNoiseCorrelationMonConfig
109 from LArMonitoring.LArNoiseCorrelationMonAlg
import LArCoherentNoisefractionConfig
114 from DataQualityUtils.DQPostProcessingAlg
import DQPostProcessingAlg
115 ppa = DQPostProcessingAlg(
"DQPostProcessingAlg")
116 ppa.Interval = 1000000
117 rn=flags.Input.RunNumber[0]
118 ppa.FileKey = f
'/{flags.DQ.FileKey}/run_{rn}/'
119 cfg.addEventAlgo(ppa, sequenceName=
'AthEndSeq')
122 cfg.getService(
"EventSelector").SkipEvents=
int(args.skipev)