print "" tiers = [ "Digi", "Hit" ] print "Provenance for: %s (dataTiers: %s)" % (otherDatasetPath, tiers) for parent in api.getDatasetProvenance(otherDatasetPath, tiers): print " %s" % parent # Get dataset contents, returning a list of blocks with event collections print "" print "Dataset contents for: %s" % otherDatasetPath for block in api.getDatasetContents(otherDatasetPath): print " File block name/id: %s/%d, %d event collections}" % \ (block.getBlockName(), block.getObjectId(), len(block.getEventCollectionList())) # Get dataset contents as a list of blocks with files print "" # print "Dataset files for: %s" % datasets[0] # for block in api.getDatasetFileBlocks (datasets[0]): print "Dataset files for: %s" % datasetPath for block in api.getDatasetFileBlocks (datasetPath): print " File block name/id: %s/%d, %d files}" % \ (block.getBlockName(), block.getObjectId(), len(block.getFileList())) except InvalidDataTier, ex: print "Caught InvalidDataTier API exception: %s" % (ex.getErrorMessage()) except DbsApiException, ex: print "Caught API exception %s: %s" % (ex.getClassName(), ex.getErrorMessage()) except DbsException, ex: print "Caught exception %s: %s" % (ex.getClassName(), ex.getErrorMessage()) print "Done"
print block.get('blockName') #print block['guid'] #print " File block name/id: %s/%d, %d event collections}" % \ # (block.get('blockName'), block.get('objectId'), len(block.get('eventCollectionList')) ) #for ev in block.get('eventCollectionList') : # print "evc ", ev except DbsCgiDatabaseError,e: print e #otherDatasetPath = "/PreProdR2Pion10GeV/SIM/GEN-SIM-DIGI" #otherDatasetPath = "/test_primary_anzar/DST/test_process_anzar" try: # Get dataset contents as a list of blocks with files print "" #print "Dataset files for: %s" % datasets[0] for block in api.getDatasetFileBlocks (otherDatasetPath): print " File block name/id: %s/%d, %d files}" % \ (block.get('blockName'), block.get('objectId'), len(block.get('fileList')) ) print "Status is ", block.get('blockStatus') for ev in block.get('eventCollectionList') : print "evc ", ev except DbsCgiDatabaseError,e: print e except InvalidDataTier, ex: print "Caught InvalidDataTier API exception: %s" % (ex.getErrorMessage()) except DbsApiException, ex: print "Caught API exception %s: %s" % (ex.getClassName(), ex.getErrorMessage()) except DbsException, ex: print "Caught exception %s: %s" % (ex.getClassName(), ex.getErrorMessage())