Пример #1
0
        if opts['run'] in ('', None):
            print "You must specify a valid run number, use --run= or --help"
            sys.exit(0)

        if opts['flag'] in ('', None):
            print "You must specify a valid QIM, use --flag= or --help"
            sys.exit(0)

        if opts['value'] in ('', None):
            print "You must specify a valid value: GOOD, BAD, UNKNOWN or a INTEGER value, use --value= or --help"
            sys.exit(0)

        flag = DbsDQFlag(
            Name=opts['flag'],
            Value=opts['value'],
        )
        run_dq = DbsRunLumiDQ(
            RunNumber=opts['run'],
            #LumiSectionNumber=123,
            DQFlagList=[flag])

        api = DbsApi(opts)

        api.insertRunLumiDQ(opts['dataset'], [run_dq])

    except DbsApiException, ex:
        print "Caught API Exception %s: %s " % (ex.getClassName(),
                                                ex.getErrorMessage())
        if ex.getErrorCode() not in (None, ""):
            print "DBS Exception Error Code: ", ex.getErrorCode()
Пример #2
0
                if opts['flag'] in ('', None):
                        print "You must specify a valid QIM, use --flag= or --help"
                        sys.exit(0)

                if opts['value'] in ('', None):
                        print "You must specify a valid value: GOOD, BAD, UNKNOWN or a INTEGER value, use --value= or --help"
                        sys.exit(0)

		flag = DbsDQFlag (
			Name = opts['flag'],
			Value = opts['value'],
			)
		run_dq = DbsRunLumiDQ (
			RunNumber=opts['run'],
			#LumiSectionNumber=123,
			DQFlagList = [flag]
			)

		api = DbsApi(opts)

		api.insertRunLumiDQ( opts['dataset'], [run_dq] )

		
	except DbsApiException, ex:
  		print "Caught API Exception %s: %s "  % (ex.getClassName(), ex.getErrorMessage() )
  		if ex.getErrorCode() not in (None, ""):
    			print "DBS Exception Error Code: ", ex.getErrorCode()


Пример #3
0
flag_nosub = DbsDQFlag(
    Name="NOSUB",
    Value="BAD",
)
#-------------------------------------------------------------------------------

#Create RunDQ Object, for RunNumber 1, RunNumber 1 already exists in DBS

lumi_dq1 = DbsRunLumiDQ(RunNumber=1,
                        LumiSectionNumber=123,
                        DQFlagList=[flag1, flag2, flag_nosub])

run_dq1 = DbsRunLumiDQ(
    RunNumber=1,
    #LumiSectionNumber=123,
    DQFlagList=[flag1, flag2, flag_nosub])

try:
    # Single Run, Multiple Flags (Some sub systems have sub-sub systems, some don't)
    api.insertRunLumiDQ([run_dq1])
    # Single LumiSection, with in a Run (Some sub systems have sub-sub systems, some don't)
    api.insertRunLumiDQ([lumi_dq1])

except DbsApiException, ex:
    print "Caught API Exception %s: %s " % (ex.getClassName(),
                                            ex.getErrorMessage())
    if ex.getErrorCode() not in (None, ""):
        print "DBS Exception Error Code: ", ex.getErrorCode()

print "Done"
Пример #4
0
# Sub System Flag (Including sub-sub system flags)
flag2 = DbsDQFlag(Name="ECAL", Value="GOOD", SubSysFlagList=[flag21, flag22])
# -------------------------------------------------------------------------------

# Sub System Flag (Including sub-sub system flags)
flag_nosub = DbsDQFlag(Name="NOSUB", Value="BAD")
# -------------------------------------------------------------------------------

# Create RunDQ Object, for RunNumber 1, RunNumber 1 already exists in DBS

lumi_dq1 = DbsRunLumiDQ(RunNumber=1, LumiSectionNumber=123, DQFlagList=[flag1, flag2, flag_nosub])

run_dq1 = DbsRunLumiDQ(
    RunNumber=1,
    # LumiSectionNumber=123,
    DQFlagList=[flag1, flag2, flag_nosub],
)

try:
    # Single Run, Multiple Flags (Some sub systems have sub-sub systems, some don't)
    api.insertRunLumiDQ([run_dq1])
    # Single LumiSection, with in a Run (Some sub systems have sub-sub systems, some don't)
    api.insertRunLumiDQ([lumi_dq1])

except DbsApiException, ex:
    print "Caught API Exception %s: %s " % (ex.getClassName(), ex.getErrorMessage())
    if ex.getErrorCode() not in (None, ""):
        print "DBS Exception Error Code: ", ex.getErrorCode()

print "Done"
Пример #5
0
run_dq_int_list=[]

for aTag in tag_int_dqs:
    flag_int=DbsDQFlag(
           Name=aTag,
           Value="99"
         )
    run_dq_list.append(flag_int)

for aTag in tagList:
    flag=DbsDQFlag(
           Name=aTag,
           Value="GOOD"
         )

    run_dq_list.append(flag)

for aRun in range (23201, 24000):

         run_dq = DbsRunLumiDQ (
                  RunNumber=aRun,
                  DQFlagList = run_dq_list
                 )

         # Single Run, Multiple Flags (Some sub systems have sub-sub systems, some don't)
         api.insertRunLumiDQ(dataset, [run_dq] )
	 print aRun