Skip to content

Instantly share code, notes, and snippets.

@mmusich mmusich/blocks.py
Created Oct 26, 2018

Embed
What would you like to do?
import os,sys
import getopt
import commands
import time
import ROOT
import urllib
import string
from optparse import OptionParser
filesToKeep=[]
ds="/EGamma/Tier0_REPLAY_vocms047-SiStripCalSmallBiasScan-PromptReco-v267/ALCARECO"
files = commands.getstatusoutput("dasgoclient -query='file dataset="+ds+"'")[1].split("\n")
for file in files:
lumis = commands.getstatusoutput("dasgoclient -query='lumi file="+file+"'")[1].replace('[','').replace(']','').split(",")
for lumi in lumis:
if(int(lumi)>=895 and int(lumi)<=1067):
#print lumi,file
filesToKeep.append(file)
for file in filesToKeep:
block = commands.getstatusoutput("dasgoclient -query='block file="+file+"'")[1].split("\n")
print block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.