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 137 of file edmPickEvents.py.

Referenced by setupCrabDict().

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

Subroutines ##.

Return files for given DAS query

Definition at line 85 of file edmPickEvents.py.

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

85 def getFileNames(event, client=None):
86  """Return files for given DAS query"""
87  if client == 'das_client':
88  return getFileNames_das_client(event)
89  elif client == 'dasgoclient':
90  return getFileNames_dasgoclient(event)
91  # default action
92  for path in os.getenv('PATH').split(':'):
93  if os.path.isfile(os.path.join(path, 'dasgoclient')):
94  return getFileNames_dasgoclient(event)
95  return getFileNames_das_client(event)
96 
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 97 of file edmPickEvents.py.

Referenced by getFileNames().

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

Definition at line 120 of file edmPickEvents.py.

References edm.print().

Referenced by getFileNames().

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

Definition at line 152 of file edmPickEvents.py.

References join(), and split.

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

Definition at line 156 of file edmPickEvents.py.

References fullCPMpath().

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

Variable Documentation

edmPickEvents.action

Definition at line 236 of file edmPickEvents.py.

edmPickEvents.args

Definition at line 254 of file edmPickEvents.py.

edmPickEvents.colonRE

Definition at line 266 of file edmPickEvents.py.

edmPickEvents.command

Definition at line 350 of file edmPickEvents.py.

edmPickEvents.commentRE

Definition at line 265 of file edmPickEvents.py.

edmPickEvents.crab

Definition at line 294 of file edmPickEvents.py.

edmPickEvents.crabDict

Definition at line 307 of file edmPickEvents.py.

edmPickEvents.crabTemplate

Definition at line 178 of file edmPickEvents.py.

edmPickEvents.das_cli

Definition at line 250 of file edmPickEvents.py.

edmPickEvents.dataset

Definition at line 264 of file edmPickEvents.py.

edmPickEvents.default

Definition at line 234 of file edmPickEvents.py.

edmPickEvents.description

Definition at line 230 of file edmPickEvents.py.

edmPickEvents.dest

Definition at line 233 of file edmPickEvents.py.

edmPickEvents.email

Main Program

Definition at line 229 of file edmPickEvents.py.

edmPickEvents.event

Definition at line 272 of file edmPickEvents.py.

edmPickEvents.eventFiles

Definition at line 330 of file edmPickEvents.py.

edmPickEvents.eventList

Definition at line 267 of file edmPickEvents.py.

edmPickEvents.eventPurgeList

Definition at line 328 of file edmPickEvents.py.

edmPickEvents.eventsToProcess

Definition at line 305 of file edmPickEvents.py.

edmPickEvents.files

Interactive ##.

Definition at line 327 of file edmPickEvents.py.

edmPickEvents.fileSet

Definition at line 340 of file edmPickEvents.py.

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

edmPickEvents.help

Definition at line 20 of file edmPickEvents.py.

edmPickEvents.json
edmPickEvents.line

Definition at line 280 of file edmPickEvents.py.

edmPickEvents.lumis

Definition at line 304 of file edmPickEvents.py.

edmPickEvents.options

Definition at line 254 of file edmPickEvents.py.

edmPickEvents.parser

Definition at line 230 of file edmPickEvents.py.

edmPickEvents.runsAndLumis

CRAB ##.

Definition at line 303 of file edmPickEvents.py.

edmPickEvents.source

Definition at line 278 of file edmPickEvents.py.

edmPickEvents.target

Definition at line 309 of file edmPickEvents.py.

Referenced by GroupedCkfTrajectoryBuilder.advanceOneLayer(), emtf::Node.calcOptimumSplit(), DeepFlavourJetTagsProducer.DeepFlavourJetTagsProducer(), 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(), HcalSiPMCharacteristics.findByType(), 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(), L1MuBMSEU.run(), L1MuDTSEU.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 233 of file edmPickEvents.py.

edmPickEvents.uniqueFiles

Definition at line 341 of file edmPickEvents.py.