Пример #1
0
from DBSAPI.dbsProcessedDataset import DbsProcessedDataset
from DBSAPI.dbsOptions import DbsOptionParser
from DBSAPI.dbsAnalysisDatasetDefinition import DbsAnalysisDatasetDefinition
from DBSAPI.dbsAnalysisDataset import DbsAnalysisDataset


optManager  = DbsOptionParser()
(opts,args) = optManager.getOpt()
api = DbsApi(opts.__dict__)

analysis=DbsAnalysisDataset(
	Type='TEST',
        Status='NEW',
        PhysicsGroup='RelVal',
        Path="/RelVal131QCD_pt15_20/CMSSW_1_3_1-1176201507/GEN-SIM-DIGI-RECO",
	Description="This is a test Analysis Dataset for /RelVal131QCD_pt15_20/CMSSW_1_3_1-1176201507/GEN-SIM-DIGI-RECO"
	)

try:
    api.createAnalysisDataset(analysis, "TestAnalysisDSDef")
    print "DONE", analysis

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"

Пример #2
0
                Type='TEST',
                Status='NEW',
                PhysicsGroup='ALLGROUP'
        )

analysis2 = DbsAnalysisDataset(
                Name="MTCC-070-RAW-Tracker-Noeding-AnalysisDS",
                Annotation="The Ana DS is for Carsten Noeding Tracker MTCC data",
                Type='TEST',
                Status='NEW',
                PhysicsGroup='ALLGROUP'
        )

try:
    api.createAnalysisDatasetDefinition (adsdef1)
    api.createAnalysisDataset (analysis1, "MTCC-090-RAW-Tracker-Noeding-AnalysisDS-Def")
    print "created analysis DS1"
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()


try:
    api.createAnalysisDatasetDefinition (adsdef2)
    api.createAnalysisDataset (analysis2, "MTCC-070-RAW-Tracker-Noeding-AnalysisDS-Def")
    print "created analysis DS2"
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
from DBSAPI.dbsPrimaryDataset import DbsPrimaryDataset
from DBSAPI.dbsProcessedDataset import DbsProcessedDataset
from DBSAPI.dbsOptions import DbsOptionParser
from DBSAPI.dbsAnalysisDatasetDefinition import DbsAnalysisDatasetDefinition
from DBSAPI.dbsAnalysisDataset import DbsAnalysisDataset

optManager = DbsOptionParser()
(opts, args) = optManager.getOpt()
api = DbsApi(opts.__dict__)

analysis = DbsAnalysisDataset(
    Type='TEST',
    Status='NEW',
    PhysicsGroup='RelVal',
    Path="/RelVal131QCD_pt15_20/CMSSW_1_3_1-1176201507/GEN-SIM-DIGI-RECO",
    Description=
    "This is a test Analysis Dataset for /RelVal131QCD_pt15_20/CMSSW_1_3_1-1176201507/GEN-SIM-DIGI-RECO"
)

try:
    api.createAnalysisDataset(analysis, "TestAnalysisDSDef")
    print "DONE", analysis

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
		else:
			adsdef = DbsAnalysisDatasetDefinition (
					Name=storequery,
					ProcessedDatasetPath=dataset,
					UserInput=escape(query),
					SQLQuery=escape(query),
					Description=storequery,
					)
			ads = DbsAnalysisDataset(
					Type='TEST',
					Status='NEW',
					PhysicsGroup='RelVal',
					#Path=dataset, NO NEED to provide PATH in CONCRETE definition
					#Description=desc
					)
		try:
			api.createAnalysisDatasetDefinition (adsdef)
		except DbsApiException, ex:
                	if ex.getErrorMessage().find("Already Exists") < 0:
				print ex
			print "WARNING ....ADS DEF ALREADY EXISTS, Will be RE USED from DBS..and query provided here will NOT be used..."	
                	print "Processing, please wait..."
		try:
			api.createAnalysisDataset(ads, storetemplatequery)	
		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()


Пример #5
0
                                 Description="scripted")
    else:
        adsdef = DbsAnalysisDatasetDefinition(
            Name=storequery,
            ProcessedDatasetPath=dataset,
            UserInput=escape(query),
            SQLQuery=escape(query),
            Description=storequery,
        )
        ads = DbsAnalysisDataset(
            Type='TEST',
            Status='NEW',
            PhysicsGroup='RelVal',
            #Path=dataset, NO NEED to provide PATH in CONCRETE definition
            #Description=desc
        )
    try:
        api.createAnalysisDatasetDefinition(adsdef)
    except DbsApiException, ex:
        if ex.getErrorMessage().find("Already Exists") < 0:
            print ex
        print "WARNING ....ADS DEF ALREADY EXISTS, Will be RE USED from DBS..and query provided here will NOT be used..."
        print "Processing, please wait..."
    try:
        api.createAnalysisDataset(ads, storetemplatequery)
    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()