CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
edmPickEvents Namespace Reference

Classes

class  Event
 Event helper class ##. More...
 

Functions

def fullCPMpath
 
def getFileNames
 Subroutines ##. More...
 
def guessEmail
 
def setupCrabDict
 

Variables

tuple colonRE = re.compile(r':')
 
string command = 'edmCopyPickMerge outputFile=%s.root \\\n eventsToProcess=%s \\\n inputFiles=%s'
 
tuple commentRE = re.compile(r'#.+$')
 
tuple crabDict = setupCrabDict(options)
 
string crabTemplate
 
string default = 'pickevents'
 
tuple email = guessEmail()
 

Main Program

More...
 
tuple event = Event(piece)
 
list eventList = []
 
string eventsToProcess = '\n'
 
list files = []
 Interactive ##. More...
 
tuple fileSet = set()
 
string help
 
tuple json = LumiList(lumis = runsAndLumis)
 
tuple line = commentRE.sub('', line)
 
tuple parser
 
list runsAndLumis = [ (event.run, event.lumi) for event in eventList]
 CRAB ##. More...
 
tuple source = open(args[0], 'r')
 
tuple target = open(crabDict['runEvent'], 'w')
 
list uniqueFiles = []
 

Function Documentation

def edmPickEvents.fullCPMpath ( )

Definition at line 108 of file edmPickEvents.py.

Referenced by setupCrabDict().

109 def fullCPMpath():
110  base = os.environ.get ('CMSSW_BASE')
111  if not base:
112  raise RuntimeError, "CMSSW Environment not set"
113  retval = "%s/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py" \
114  % base
115  if os.path.exists (retval):
116  return retval
117  base = os.environ.get ('CMSSW_RELEASE_BASE')
118  retval = "%s/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py" \
119  % base
120  if os.path.exists (retval):
121  return retval
122  raise RuntimeError, "Could not find copyPickMerge_cfg.py"
def edmPickEvents.getFileNames (   event)

Subroutines ##.

Definition at line 85 of file edmPickEvents.py.

85 
86 def getFileNames (event):
87  files = []
88  # Query DAS
89  query = "file dataset=%(dataset)s run=%(run)i lumi=%(lumi)i | grep file.name" % event
90  jsondict = das_client.get_data('https://cmsweb.cern.ch', query, 0, 0, False)
91  status = jsondict['status']
92  if status != 'ok':
93  print "DAS query status: %s"%(status)
94  return files
95 
96  mongo_query = jsondict['mongo_query']
97  filters = mongo_query['filters']
98  data = jsondict['data']
99 
100  files = []
101  for row in data:
102  file = [r for r in das_client.get_value(row, filters['grep'])][0]
103  if len(file) > 0 and not file in files:
104  files.append(file)
105 
106  return files
107 
def getFileNames
Subroutines ##.
def edmPickEvents.guessEmail ( )

Definition at line 123 of file edmPickEvents.py.

References join(), and split.

124 def guessEmail():
125  return '%s@%s' % (commands.getoutput ('whoami'),
126  '.'.join(commands.getoutput('hostname').split('.')[-2:]))
127 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
double split
Definition: MVATrainer.cc:139
def edmPickEvents.setupCrabDict (   options)

Definition at line 128 of file edmPickEvents.py.

References fullCPMpath().

129 def setupCrabDict (options):
130  crab = {}
131  base = options.base
132  crab['runEvent'] = '%s_runEvents.txt' % base
133  crab['copyPickMerge'] = fullCPMpath()
134  crab['output'] = '%s.root' % base
135  crab['crabcfg'] = '%s_crab.config' % base
136  crab['json'] = '%s.json' % base
137  crab['dataset'] = Event.dataset
138  crab['email'] = options.email
139  if options.crabCondor:
140  crab['scheduler'] = 'condor'
141 # crab['useServer'] = ''
142  else:
143  crab['scheduler'] = 'remoteGlidein'
144 # crab['useServer'] = 'use_server = 1'
145  crab['useServer'] = ''
146  return crab
147 
148 
# crab template

Variable Documentation

tuple edmPickEvents.colonRE = re.compile(r':')

Definition at line 221 of file edmPickEvents.py.

string edmPickEvents.command = 'edmCopyPickMerge outputFile=%s.root \\\n eventsToProcess=%s \\\n inputFiles=%s'

Definition at line 295 of file edmPickEvents.py.

Referenced by optutl::CommandLineParser._runVariableCommandFromString(), TagProbeFitter.createPdf(), SiStripHistoPlotter.createStaticPlot(), RunManagerMTWorker.initializeThread(), makePSetsFromFile(), makePSetsFromString(), GenParticlePruner.parse(), TrackerMap.printall(), TrackerMap.printonline(), edm.pythonFileToConfigure(), PythonProcessDesc.readFile(), FWConfigurationManager.readFromOldFile(), PythonProcessDesc.readString(), PedeSteerer.runPede(), TrackerMap.save(), TrackerMap.save_as_fectrackermap(), TrackerMap.save_as_fedtrackermap(), TrackerMap.save_as_HVtrackermap(), TrackerMap.save_as_psutrackermap(), L1RCTLutWriter.writeEicLutFile(), L1RCTLutWriter.writeJscLutFile(), and L1RCTLutWriter.writeRcLutFile().

tuple edmPickEvents.commentRE = re.compile(r'#.+$')

Definition at line 220 of file edmPickEvents.py.

tuple edmPickEvents.crabDict = setupCrabDict(options)

Definition at line 258 of file edmPickEvents.py.

string edmPickEvents.crabTemplate

Definition at line 149 of file edmPickEvents.py.

string edmPickEvents.default = 'pickevents'

Definition at line 196 of file edmPickEvents.py.

tuple edmPickEvents.email = guessEmail()

Main Program

Definition at line 191 of file edmPickEvents.py.

tuple edmPickEvents.event = Event(piece)

Definition at line 227 of file edmPickEvents.py.

list edmPickEvents.eventList = []

Definition at line 222 of file edmPickEvents.py.

string edmPickEvents.eventsToProcess = '\n'

Definition at line 256 of file edmPickEvents.py.

list edmPickEvents.files = []

Interactive ##.

Definition at line 278 of file edmPickEvents.py.

tuple edmPickEvents.fileSet = set()

Definition at line 285 of file edmPickEvents.py.

Referenced by TauDQMFileLoader.endRun(), and TauDQMFileLoader.TauDQMFileLoader().

string edmPickEvents.help

Definition at line 19 of file edmPickEvents.py.

tuple edmPickEvents.json = LumiList(lumis = runsAndLumis)

Definition at line 255 of file edmPickEvents.py.

tuple edmPickEvents.line = commentRE.sub('', line)

Definition at line 235 of file edmPickEvents.py.

tuple edmPickEvents.parser
Initial value:
1 = optparse.OptionParser("Usage: %prog [options] dataset events_or_events.txt", description='''This program
2 facilitates picking specific events from a data set. For full details, please visit
3 https://twiki.cern.ch/twiki/bin/view/CMS/PickEvents ''')

Definition at line 192 of file edmPickEvents.py.

list edmPickEvents.runsAndLumis = [ (event.run, event.lumi) for event in eventList]

CRAB ##.

Definition at line 254 of file edmPickEvents.py.

string edmPickEvents.source = open(args[0], 'r')

Definition at line 233 of file edmPickEvents.py.

tuple edmPickEvents.target = open(crabDict['runEvent'], 'w')

Definition at line 260 of file edmPickEvents.py.

list edmPickEvents.uniqueFiles = []

Definition at line 286 of file edmPickEvents.py.