5 from optparse
import OptionParser
9 physicsStreams = [
"physics_Main",
"physics_MinBias",
"physics_MinBiasOverlay",
"physics_ZeroBias",
"physics_HardProbes",
10 "physics_TauOverlay",
"physics_CosmicCalo",
"physics_CosmicMuons",
"physics_IDCosmic",
11 "physics_HLT_IDCosmic",
"physics_Standby",
"physics_Late",
"physics_L1Calo",
"physics_L1Topo",
15 monitoringStreams = [
"calibration_Background",
"calibration_beamspot",
"calibration_IBLLumi",
"calibration_PixelBeam",
16 "caibration_vdM",
"calibration_PIxelNoise",
"calibration_SCTNoise",
"calibration_IDTracks",
17 "calibration_LArCells",
"calibration_LArCellsEmpty",
"calibration_LArNoiseBurst",
"calibration_Tile"
18 "calibration_MuonAll",
"calibration_CostMonitoring"]
20 otherStream = [
"calibration_IDFwd",
"calibration_ALFA",
"calibration_DataScoutingXX",
"debugrec_hltacc",
"debugrec_hltrej",
"debugrec_crashed"]
32 def_outputs = {
'outputDESDM_CALJETFile': {
'dstype':
'DESDM_CALJET',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputESDFile': {
'dstype':
'!replace RAW ESD',
'ifMatch':
'(?!.*DRAW.*)(?!.*physics_Main.*)'},
'outputDESDM_SGLELFile': {
'dstype':
'DESDM_SGLEL',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputDESDM_SLTTMUFile': {
'dstype':
'DESDM_SLTTMU',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputDESDM_RPVLLFile': {
'dstype':
'DESDM_RPVLL',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputDAOD_IDTRKVALIDFile': {
'dstype':
'DAOD_IDTRKVALID',
'ifMatch':
'data[0-9][0-9]_(cos|1beam|.*eV|comm)(?!.*DRAW.*)(.*MinBias.*|.*IDCosmic.*)'},
'outputDRAW_ZMUMUFile': {
'dstype':
'DRAW_ZMUMU',
'ifMatch':
'data[0-9][0-9]_(1beam|.*eV|comm)(?!.*DRAW.*)(.*physics_Main\\..*)'},
'outputDAOD_IDTIDEFile': {
'dstype':
'DAOD_IDTIDE',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputDRAW_TAUMUHFile': {
'dstype':
'DRAW_TAUMUH',
'ifMatch':
'data[0-9][0-9]_(1beam|.*eV|comm)(?!.*DRAW.*)(.*physics_Main\\..*)'},
'outputDESDM_MSPerfFile': {
'dstype':
'!replace RAW DESDM_MCP DDESDM_MCP_ZMUMU DESDM_ZMCP',
'ifMatch':
'data[0-9][0-9]_(1beam|.*eV|comm)(.*physics_Main\\..*)(.*\\.RAW\\.*|.*DRAW_ZMUMU.*)'},
'outputDESDM_EGAMMAFile': {
'dstype':
'DESDM_EGAMMA',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputDRAW_EMUFile': {
'dstype':
'DRAW_EMU',
'ifMatch':
'data[0-9][0-9]_(1beam|.*eV|comm)(?!.*DRAW.*)(.*physics_Main\\..*)'},
'outputDRAW_EGZFile': {
'dstype':
'DRAW_EGZ',
'ifMatch':
'data[0-9][0-9]_(1beam|.*eV|comm)(?!.*DRAW.*)(.*physics_Main\\..*)'},
'outputDESDM_PHOJETFile': {
'dstype':
'DESDM_PHOJET',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_Main.*)'},
'outputAODFile': {
'dstype':
'!replace RAW AOD',
'ifMatch':
'data[0-9][0-9]_(cos|1beam|.*eV|comm)'},
'outputDESDM_EOVERPFile': {
'dstype':
'DESDM_EOVERP',
'ifMatch':
'data[0-9][0-9]_.*eV(?!.*DRAW.*)(.*physics_MinBias.*)'},
'outputDESDM_ALLCELLSFile': {
'dstype':
'!replace RAW ESDM',
'ifMatch':
'data[0-9][0-9]_(1beam|.*eV|comm)(?!.*DRAW_TAUMUH.*)(.*DRAW.*)'},
'outputHISTFile': {
'dstype':
'HIST',
'ifMatch':
'(?!.(.*DRAW.*|.*debugrec.*))'}}
36 parser=OptionParser(usage=
"\n ./outputTest_v2 -s allStreams [-f <filename of file containing output dict>] \n")
37 parser.add_option(
"-s",
"--streams" ,type=
"string" ,dest=
"streams" ,default=
"physics_Main,express_express" ,help=
"comma seperated list of streams")
38 parser.add_option(
"-p",
"--project" ,type=
"string" ,dest=
"project" ,default=
"data15_13TeV" ,help=
"projects")
39 parser.add_option(
"-r",
"--runnumber" ,type=
"string" ,dest=
"runnumber" ,default=
"00267639" ,help=
"run number")
40 parser.add_option(
"-f",
"--filename" ,type=
"string" ,dest=
"filename" ,default=
"default_outputs.dict" ,help=
"run number")
42 (options,args)=parser.parse_args()
50 print (
"WARNING: file with dict %s not available... using default outputs dict" %(options.filename))
56 project = options.project
57 runnumber = options.runnumber
58 inStreams = options.streams.split(
",")
61 define list of streams
63 if "physicsStreams" in inStreams:
64 streams.extend(physicsStreams)
65 inStreams.remove(
"physicsStreams")
66 if "monitoringStreams" in inStreams:
67 streams.extend(monitoringStreams)
68 inStreams.remove(
"monitoringStreams")
69 if "otherStreams" in inStreams:
70 streams.extend(monitoringStreams)
71 inStreams.remove(
"otherStreams")
73 if "allStreams" in inStreams:
74 streams.extend(physicsStreams)
75 streams.extend(monitoringStreams)
76 streams.extend(monitoringStreams)
77 inStreams.remove(
"allStreams")
82 for stream
in inStreams:
83 if stream
in physicsStreams
or stream
in monitoringStreams
or stream
in otherStream:
84 streams.append(stream)
86 print (
"WARNING: %s is not defined in known stream" %(stream))
91 print (output types per stream)
93 for stream
in streams:
94 inputds = project+
"."+runnumber+
"."+stream+
".merge.RAW"
95 print (
"Primary outputs %s RAW \n" %(stream))
96 print (
"\t inputDS: %s \n" %(inputds) )
97 for k
in outputs.keys() :
98 if re.match(outputs[k][
'ifMatch'], inputds) :