Skip to content

Instantly share code, notes, and snippets.

@mmusich
Created June 4, 2018 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmusich/ea8d9458e4aaad906a63bd80b23bbd32 to your computer and use it in GitHub Desktop.
Save mmusich/ea8d9458e4aaad906a63bd80b23bbd32 to your computer and use it in GitHub Desktop.
import os,sys
import getopt
import commands
import time
import ROOT
import urllib
import string
from optparse import OptionParser
totalEvents=0
for run in xrange(305745,305758):
eventsForRun=0
dataset = commands.getstatusoutput("dasgoclient -query='dataset dataset=/ZeroBias*/Run2017F-SiStripCalMinBias-PromptReco-v1/ALCARECO run="+str(run)+"'")[1].split("\n")
#print run,dataset
for i in xrange(1,10):
#print run,i
ds="/ZeroBias%s/Run2017F-SiStripCalMinBias-PromptReco-v1/ALCARECO" % i
events = commands.getstatusoutput("dasgoclient -query='file dataset="+ds+" run="+str(run)+" | grep file.nevents'")[1].split("\n")
for entry in events:
eventsForRun+=int(entry)
print run,eventsForRun
totalEvents+=eventsForRun
print totalEvent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment