CMS 3D CMS Logo

Classes | Functions | Variables
edmPickEvents Namespace Reference

Classes

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

Functions

def fullCPMpath ()
 
def getFileNames (event, client=None)
 Subroutines ##. More...
 
def getFileNames_das_client (event)
 
def getFileNames_dasgoclient (event)
 
def guessEmail ()
 
def setupCrabDict (options)
 

Variables

 action
 
 args
 
 colonRE
 
 command
 
 commentRE
 
 crab
 
 crabDict
 
 crabTemplate
 
 das_cli
 
 dataset
 
 default
 
 description
 
 dest
 
 email
 

Main Program

More...
 
 event
 
 eventFiles
 
 eventList
 
 eventPurgeList
 
 eventsToProcess
 
 files
 Interactive ##. More...
 
 fileSet
 
 help
 
 json
 
 line
 
 lumis
 
 options
 
 parser
 
 runsAndLumis
 CRAB ##. More...
 
 source
 
 target
 
 type
 
 uniqueFiles
 

Function Documentation

def edmPickEvents.fullCPMpath ( )

Definition at line 138 of file edmPickEvents.py.

Referenced by setupCrabDict().

139  base = os.environ.get ('CMSSW_BASE')
140  if not base:
141  raise RuntimeError("CMSSW Environment not set")
142  retval = "%s/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py" \
143  % base
144  if os.path.exists (retval):
145  return retval
146  base = os.environ.get ('CMSSW_RELEASE_BASE')
147  retval = "%s/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py" \
148  % base
149  if os.path.exists (retval):
150  return retval
151  raise RuntimeError("Could not find copyPickMerge_cfg.py")
152 
def edmPickEvents.getFileNames (   event,
  client = None 
)

Subroutines ##.

Return files for given DAS query

Definition at line 86 of file edmPickEvents.py.

References getFileNames_das_client(), getFileNames_dasgoclient(), and split.

86 def getFileNames(event, client=None):
87  """Return files for given DAS query"""
88  if client == 'das_client':
89  return getFileNames_das_client(event)
90  elif client == 'dasgoclient':
91  return getFileNames_dasgoclient(event)
92  # default action
93  for path in os.getenv('PATH').split(':'):
94  if os.path.isfile(os.path.join(path, 'dasgoclient')):
95  return getFileNames_dasgoclient(event)
96  return getFileNames_das_client(event)
97 
def getFileNames_dasgoclient(event)
def getFileNames(event, client=None)
Subroutines ##.
def getFileNames_das_client(event)
double split
Definition: MVATrainer.cc:139
def edmPickEvents.getFileNames_das_client (   event)
Return files for given DAS query via das_client

Definition at line 98 of file edmPickEvents.py.

References edm.print().

Referenced by getFileNames().

99  """Return files for given DAS query via das_client"""
100  files = []
101 
102  query = "file dataset=%(dataset)s run=%(run)i lumi=%(lumi)i | grep file.name" % event
103  jsondict = das_client.get_data(query)
104  status = jsondict['status']
105  if status != 'ok':
106  print("DAS query status: %s"%(status))
107  return files
108 
109  mongo_query = jsondict['mongo_query']
110  filters = mongo_query['filters']
111  data = jsondict['data']
112 
113  files = []
114  for row in data:
115  file = [r for r in das_client.get_value(row, filters['grep'])][0]
116  if len(file) > 0 and not file in files:
117  files.append(file)
118 
119  return files
120 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def getFileNames_das_client(event)
def edmPickEvents.getFileNames_dasgoclient (   event)
Return files for given DAS query via dasgoclient

Definition at line 121 of file edmPickEvents.py.

References edm.print().

Referenced by getFileNames().

122  """Return files for given DAS query via dasgoclient"""
123  query = "file dataset=%(dataset)s run=%(run)i lumi=%(lumi)i" % event
124  cmd = ['dasgoclient', '-query', query, '-json']
125  proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
126  files = []
127  err = proc.stderr.read()
128  if err:
129  print("DAS error: %s" % err)
130  else:
131  for row in json.load(proc.stdout):
132  for rec in row.get('file', []):
133  fname = rec.get('name', '')
134  if fname:
135  files.append(fname)
136  return files
137 
def getFileNames_dasgoclient(event)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def edmPickEvents.guessEmail ( )

Definition at line 153 of file edmPickEvents.py.

References join(), and split.

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

Definition at line 157 of file edmPickEvents.py.

References fullCPMpath().

157 def setupCrabDict (options):
158  date = datetime.now().strftime('%Y%m%d_%H%M%S')
159  crab = {}
160  base = options.base
161  crab['runEvent'] = '%s_runEvents.txt' % base
162  crab['copyPickMerge'] = fullCPMpath()
163  crab['output'] = '%s.root' % base
164  crab['crabcfg'] = '%s_crab.py' % base
165  crab['json'] = '%s.json' % base
166  crab['dataset'] = Event.dataset
167  crab['email'] = options.email
168  crab['WorkArea'] = date
169  if options.crabCondor:
170  crab['scheduler'] = 'condor'
171 # crab['useServer'] = ''
172  else:
173  crab['scheduler'] = 'remoteGlidein'
174 # crab['useServer'] = 'use_server = 1'
175  crab['useServer'] = ''
176  return crab
177 
178 # crab template
def setupCrabDict(options)

Variable Documentation

edmPickEvents.action

Definition at line 237 of file edmPickEvents.py.

edmPickEvents.args

Definition at line 255 of file edmPickEvents.py.

edmPickEvents.colonRE

Definition at line 267 of file edmPickEvents.py.

edmPickEvents.command

Definition at line 351 of file edmPickEvents.py.

edmPickEvents.commentRE

Definition at line 266 of file edmPickEvents.py.

edmPickEvents.crab

Definition at line 295 of file edmPickEvents.py.

edmPickEvents.crabDict

Definition at line 308 of file edmPickEvents.py.

edmPickEvents.crabTemplate

Definition at line 179 of file edmPickEvents.py.

edmPickEvents.das_cli

Definition at line 251 of file edmPickEvents.py.

edmPickEvents.dataset

Definition at line 265 of file edmPickEvents.py.

edmPickEvents.default

Definition at line 235 of file edmPickEvents.py.

edmPickEvents.description

Definition at line 231 of file edmPickEvents.py.

edmPickEvents.dest

Definition at line 234 of file edmPickEvents.py.

edmPickEvents.email

Main Program

Definition at line 230 of file edmPickEvents.py.

edmPickEvents.event

Definition at line 273 of file edmPickEvents.py.

edmPickEvents.eventFiles

Definition at line 331 of file edmPickEvents.py.

edmPickEvents.eventList

Definition at line 268 of file edmPickEvents.py.

edmPickEvents.eventPurgeList

Definition at line 329 of file edmPickEvents.py.

edmPickEvents.eventsToProcess

Definition at line 306 of file edmPickEvents.py.

edmPickEvents.files

Interactive ##.

Definition at line 328 of file edmPickEvents.py.

edmPickEvents.fileSet

Definition at line 341 of file edmPickEvents.py.

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

edmPickEvents.help

Definition at line 21 of file edmPickEvents.py.

edmPickEvents.json
edmPickEvents.line

Definition at line 281 of file edmPickEvents.py.

edmPickEvents.lumis

Definition at line 305 of file edmPickEvents.py.

edmPickEvents.options

Definition at line 255 of file edmPickEvents.py.

edmPickEvents.parser

Definition at line 231 of file edmPickEvents.py.

edmPickEvents.runsAndLumis

CRAB ##.

Definition at line 304 of file edmPickEvents.py.

edmPickEvents.source

Definition at line 279 of file edmPickEvents.py.

edmPickEvents.target

Definition at line 310 of file edmPickEvents.py.

Referenced by GroupedCkfTrajectoryBuilder.advanceOneLayer(), emtf::Node.calcOptimumSplit(), edm::PathsAndConsumesOfModules.doModuleDescription(), PhysicsTools::TrainProcessor.doTrainData(), KDTreeLinkerBase.fieldType(), edm::RootFile.fillEventHistory(), PhysicsTools::MVATrainer.fillInputVars(), TopDecaySubset.fillListing(), PythiaDauVFilterMatchID.filter(), HadronicProcessHelper.finalState(), find(), cond::persistency::RunInfoProxy.find(), BinomialNoncentralInterval< FeldmanCousinsSorter >.find_rho_set(), HcalDcsMap.findByDcsId(), HcalFrontEndMap.findById(), CastorElectronicsMap.findById(), HcalElectronicsMap.findById(), HcalDcsMap.findById(), HcalObjectAddons.findByT(), CastorElectronicsMap.findByTrigId(), HcalElectronicsMap.findByTrigId(), G4ProcessHelper.G4ProcessHelper(), PhysicsTools::TrainProcessor.getCalibration(), CastorCalibrationsSet.getCalibrations(), CastorCalibrationWidthsSet.getCalibrationWidths(), edm::service::RandomNumberGeneratorService.getEngine(), XMLProcessor.getInstance(), CastorRawGains.getValues(), HcalRawGains.getValues(), CachedTrajectory.getWideTrajectory(), DDHtmlFormatter.h3(), HadronicProcessHelper.HadronicProcessHelper(), fwlite::Event.history(), dqmstorepb::ROOTFilePB_Histo.InternalSerializeWithCachedSizesToArray(), dqmstorepb::ROOTFilePB.InternalSerializeWithCachedSizesToArray(), cond::Iov_t.Iov_t(), DDHtmlFormatter.lnk(), HcalFrontEndMapAddons::Helper.loadObject(), HcalSiPMCharacteristicsAddons::Helper.loadObject(), PlotCompareUtility.makeHTML(), HcalDcsMapAddons::Helper.mapGeomId2DcsId(), MatcherUsingTracksAlgorithm.match(), edm::PathsAndConsumesOfModules.moduleIndex(), LStoreFile::MutexWrapper.MutexWrapper(), dqmstorepb::ROOTFilePB_Histo.New(), dqmstorepb::ROOTFilePB.New(), GenericTriggerEventFlag.off(), edm::ThinnedAssociationsHelper.parentBegin(), edm::ThinnedAssociationsHelper.parentEnd(), cond::persistency::BasePayloadProxy.payloadId(), edm::service::RandomNumberGeneratorService.postModuleStreamCheck(), edm::service::RandomNumberGeneratorService.preModuleStreamCheck(), TopDecaySubset.produce(), CachedTrajectory.propagateForward(), L1MuDTSEU.run(), L1MuBMSEU.run(), PhysicsTools.stdStringPrintf(), edm::EDConsumerBase.throwConsumesCallAfterFrozen(), L1MuDTExtrapolationUnit.which_ext(), L1MuBMExtrapolationUnit.which_ext(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.~MVAModuleHelper(), and XMLDocument.~XMLDocument().

edmPickEvents.type

Definition at line 234 of file edmPickEvents.py.

edmPickEvents.uniqueFiles

Definition at line 342 of file edmPickEvents.py.