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
 
 event
 
 eventFiles
 
 eventList
 
 eventPurgeList
 
 eventsToProcess
 
 files
 Interactive ##. More...
 
 fileSet
 
 help
 
 json
 
 line
 
 lumis
 
 options
 
 parser
 
 runsAndLumis
 CRAB ##. More...
 
 source
 
 target
 
 type
 
 uniqueFiles
 

Function Documentation

◆ fullCPMpath()

def edmPickEvents.fullCPMpath ( )

Definition at line 138 of file edmPickEvents.py.

138 def fullCPMpath():
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 

Referenced by setupCrabDict().

◆ getFileNames()

def edmPickEvents.getFileNames (   event,
  client = None 
)

Subroutines ##.

Return files for given DAS query

Definition at line 86 of file edmPickEvents.py.

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 

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

◆ getFileNames_das_client()

def edmPickEvents.getFileNames_das_client (   event)
Return files for given DAS query via das_client

Definition at line 98 of file edmPickEvents.py.

98 def getFileNames_das_client(event):
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 

References das_client.get_data(), das_client.get_value(), and print().

Referenced by getFileNames().

◆ getFileNames_dasgoclient()

def edmPickEvents.getFileNames_dasgoclient (   event)
Return files for given DAS query via dasgoclient

Definition at line 121 of file edmPickEvents.py.

121 def getFileNames_dasgoclient(event):
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 

References print().

Referenced by getFileNames().

◆ guessEmail()

def edmPickEvents.guessEmail ( )

Definition at line 153 of file edmPickEvents.py.

153 def guessEmail():
154  return '%s@%s' % (commands.getoutput ('whoami'),
155  '.'.join(commands.getoutput('hostname').split('.')[-2:]))
156 

References join(), and submitPVValidationJobs.split().

◆ setupCrabDict()

def edmPickEvents.setupCrabDict (   options)

Definition at line 157 of file edmPickEvents.py.

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

References fullCPMpath().

Variable Documentation

◆ action

edmPickEvents.action

Definition at line 237 of file edmPickEvents.py.

◆ args

edmPickEvents.args

Definition at line 255 of file edmPickEvents.py.

◆ colonRE

edmPickEvents.colonRE

Definition at line 267 of file edmPickEvents.py.

◆ command

edmPickEvents.command

Definition at line 351 of file edmPickEvents.py.

◆ commentRE

edmPickEvents.commentRE

Definition at line 266 of file edmPickEvents.py.

◆ crab

edmPickEvents.crab

Definition at line 295 of file edmPickEvents.py.

◆ crabDict

edmPickEvents.crabDict

Definition at line 308 of file edmPickEvents.py.

◆ crabTemplate

edmPickEvents.crabTemplate

Definition at line 179 of file edmPickEvents.py.

◆ das_cli

edmPickEvents.das_cli

Definition at line 251 of file edmPickEvents.py.

◆ dataset

edmPickEvents.dataset

Definition at line 265 of file edmPickEvents.py.

◆ default

edmPickEvents.default

Definition at line 235 of file edmPickEvents.py.

◆ description

edmPickEvents.description

Definition at line 231 of file edmPickEvents.py.

◆ dest

edmPickEvents.dest

Definition at line 234 of file edmPickEvents.py.

◆ email

edmPickEvents.email

Main Program

Definition at line 230 of file edmPickEvents.py.

◆ event

edmPickEvents.event

Definition at line 273 of file edmPickEvents.py.

Referenced by DTVDriftSegmentCalibration.analyze(), PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.analyze(), DTTTrigOffsetCalibration.analyze(), DTResidualCalibration.analyze(), DTChamberEfficiency.analyze(), fwlite::AnalyzerWrapper< T >.analyze(), GsfElectronAlgo.beginEvent(), TopologyWorker.CalcSqrts(), HltDiff.compare(), CSCFileDumper.CSCFileDumper(), BiasedTauDecayer.decay(), edm::EDLooperBase.doDuringLoop(), FWFFMetadataManager.doUpdate(), HGCalValidator.dqmAnalyze(), fwlite::EventHistoryGetter.EventHistoryGetter(), CSCValHists.fill2DHistByEvent(), edm::IndexIntoFile.fillEventNumbersOrEntries(), Py8toJetInputHEPEVT.fillJetAlgoInput(), FWHLTTriggerTableView.fillTable(), edm::GeneratorFilter< HAD, DEC >.filter(), edm::HadronizerFilter< HAD, DEC >.filter(), edm::ConcurrentGeneratorFilter< HAD, DEC >.filter(), edm::ConcurrentHadronizerFilter< HAD, DEC >.filter(), PhotonConversionTrajectorySeedProducerFromSingleLegAlgo.find(), edm::IndexIntoFile.findPosition(), cms::cuda::EventCache.get(), sistrip::SpyEventMatcher.getCollections(), sistrip::SpyEventMatcher.getCounters(), PrimaryVertexAnalyzer4PUSlimmed.getSimPVs(), PrescaleEventFilter.globalEndJob(), HLTPrescaler.globalEndJob(), CmsShowNavigator.goTo(), FWGLEventHandler.HandleKey(), HFShowerLibrary.HFShowerLibrary(), HcalSignalGenerator< HBHEDigitizerTraits >.initializeEvent(), EcalSignalGenerator< EEDigitizerTraits >.initializeEvent(), main(), gen::TauolappInterface.make_simple_tau_event(), TSToSCAssociatorByEnergyScoreImpl.makeConnections(), LCToSCAssociatorByEnergyScoreImpl.makeConnections(), cms::cuda::EventCache.makeOrGet(), helper::MasterCollection< edm::View< T > >.MasterCollection(), edm::SetRunHelper.overrideRunNumber(), edm::SetRunForEachLumiHelper.overrideRunNumber(), edm::FirstLuminosityBlockForEachRunHelper.overrideRunNumber(), edm::service::CheckTransitions.postEndJob(), edm::service::MessageLogger.preEvent(), VariableHelper.printValues(), TFWLiteSelectorBasic.Process(), NtpProducer< C >.produce(), RPCUnpackingModule.produce(), TotemVFATRawToDigi.produce(), edm::ThinningProducer< Collection, Selector >.produce(), EgammaHLTExtraProducer.produce(), EgammaHLTPhase2ExtraProducer.produce(), HLTCaloObjInRegionsProducer< CaloObjType, CaloObjCollType >.produce(), HLTRecHitInAllL1RegionsProducer< RecHitType >.produce(), edm::PoolSource.readIt(), edm::RootEmbeddedFileSequence.readOneSpecified(), removeCPFromPU(), fwlite::Scanner< Collection >.scan(), CosmicTrackingParticleSelector.select(), FWFFNavigator.setCurrentEvent(), CompositeTSG.setEvent(), TrackerSeedGenerator.setEvent(), MuonTrackingRegionBuilder.setEvent(), GlobalTrajectoryBuilderBase.setEvent(), GlobalMuonRefitter.setEvent(), MTDDetLayerMeasurements.setEvent(), MuonDetLayerMeasurements.setEvent(), AliDaqEventHeader.SetRunEvt(), MuonsGrabber.startNewEvent(), TB06TreeH2.store(), TB06Tree.store(), fwlite::MultiChainEvent.to(), fwlite::Event.to(), pat::helper::TriggerMatchHelper.triggerMatchCandidates(), pat::helper::TriggerMatchHelper.triggerMatchObject(), pat::helper::TriggerMatchHelper.triggerMatchObjects(), and L1TdeStage2CaloLayer1.updateMismatch().

◆ eventFiles

edmPickEvents.eventFiles

Definition at line 331 of file edmPickEvents.py.

◆ eventList

edmPickEvents.eventList

Definition at line 268 of file edmPickEvents.py.

◆ eventPurgeList

edmPickEvents.eventPurgeList

Definition at line 329 of file edmPickEvents.py.

◆ eventsToProcess

edmPickEvents.eventsToProcess

Definition at line 306 of file edmPickEvents.py.

◆ files

edmPickEvents.files

Interactive ##.

Definition at line 328 of file edmPickEvents.py.

◆ fileSet

edmPickEvents.fileSet

Definition at line 341 of file edmPickEvents.py.

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

◆ help

edmPickEvents.help

Definition at line 21 of file edmPickEvents.py.

◆ json

edmPickEvents.json

Definition at line 305 of file edmPickEvents.py.

◆ line

edmPickEvents.line

Definition at line 281 of file edmPickEvents.py.

◆ lumis

edmPickEvents.lumis

Definition at line 305 of file edmPickEvents.py.

◆ options

edmPickEvents.options

Definition at line 255 of file edmPickEvents.py.

◆ parser

edmPickEvents.parser

Definition at line 231 of file edmPickEvents.py.

◆ runsAndLumis

edmPickEvents.runsAndLumis

CRAB ##.

Definition at line 304 of file edmPickEvents.py.

◆ source

edmPickEvents.source

Definition at line 279 of file edmPickEvents.py.

◆ target

edmPickEvents.target

Definition at line 310 of file edmPickEvents.py.

◆ type

edmPickEvents.type

Definition at line 234 of file edmPickEvents.py.

◆ uniqueFiles

edmPickEvents.uniqueFiles

Definition at line 342 of file edmPickEvents.py.

edmPickEvents.getFileNames_dasgoclient
def getFileNames_dasgoclient(event)
Definition: edmPickEvents.py:121
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
submitPVValidationJobs.split
def split(sequence, size)
Definition: submitPVValidationJobs.py:352
edmPickEvents.getFileNames
def getFileNames(event, client=None)
Subroutines ##.
Definition: edmPickEvents.py:86
edmPickEvents.guessEmail
def guessEmail()
Definition: edmPickEvents.py:153
edmPickEvents.fullCPMpath
def fullCPMpath()
Definition: edmPickEvents.py:138
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
das_client.get_value
def get_value(data, filters, base=10)
Definition: das_client.py:248
das_client.get_data
def get_data(host, query, idx, limit, debug, threshold=300, ckey=None, cert=None, capath=None, qcache=0, das_headers=True)
Definition: das_client.py:275
edmPickEvents.setupCrabDict
def setupCrabDict(options)
Definition: edmPickEvents.py:157
edmPickEvents.getFileNames_das_client
def getFileNames_das_client(event)
Definition: edmPickEvents.py:98