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
 
 ArgumentDefaultsHelpFormatter
 
 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
 
 formatter_class
 
 help
 
 json
 
 line
 
 lumis
 
 metavar
 
 nargs
 
 options
 
 parser
 
 runsAndLumis
 CRAB ##. More...
 
 source
 
 str
 
 target
 
 type
 
 uniqueFiles
 

Function Documentation

◆ fullCPMpath()

def edmPickEvents.fullCPMpath ( )

Definition at line 144 of file edmPickEvents.py.

Referenced by setupCrabDict().

144 def fullCPMpath():
145  base = os.environ.get ('CMSSW_BASE')
146  if not base:
147  raise RuntimeError("CMSSW Environment not set")
148  retval = "%s/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py" \
149  % base
150  if os.path.exists (retval):
151  return retval
152  base = os.environ.get ('CMSSW_RELEASE_BASE')
153  retval = "%s/src/PhysicsTools/Utilities/configuration/copyPickMerge_cfg.py" \
154  % base
155  if os.path.exists (retval):
156  return retval
157  raise RuntimeError("Could not find copyPickMerge_cfg.py")
158 

◆ getFileNames()

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 submitPVValidationJobs.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)

◆ getFileNames_das_client()

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

Definition at line 97 of file edmPickEvents.py.

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

Referenced by getFileNames().

97 def getFileNames_das_client(event):
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 get_value(data, filters, base=10)
Definition: das_client.py:248
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:276
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def getFileNames_das_client(event)

◆ getFileNames_dasgoclient()

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

Definition at line 120 of file edmPickEvents.py.

References print().

Referenced by getFileNames().

120 def getFileNames_dasgoclient(event):
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  print(proc.stdout.read())
130  sys.exit(1)
131  else:
132  dasout = proc.stdout.read()
133  try:
134  for row in json.loads(dasout):
135  for rec in row.get('file', []):
136  fname = rec.get('name', '')
137  if fname:
138  files.append(fname)
139  except:
140  print(dasout)
141  sys.exit(1)
142  return files
143 
def getFileNames_dasgoclient(event)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ guessEmail()

def edmPickEvents.guessEmail ( )

Definition at line 159 of file edmPickEvents.py.

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

159 def guessEmail():
160  return '%s@%s' % (subprocess.getoutput ('whoami'),
161  '.'.join(subprocess.getoutput('hostname').split('.')[-2:]))
162 
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

◆ setupCrabDict()

def edmPickEvents.setupCrabDict (   options)

Definition at line 163 of file edmPickEvents.py.

References fullCPMpath().

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

Variable Documentation

◆ action

edmPickEvents.action

Definition at line 243 of file edmPickEvents.py.

◆ ArgumentDefaultsHelpFormatter

edmPickEvents.ArgumentDefaultsHelpFormatter

Definition at line 237 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 185 of file edmPickEvents.py.

◆ das_cli

edmPickEvents.das_cli

Definition at line 257 of file edmPickEvents.py.

◆ dataset

edmPickEvents.dataset

Definition at line 265 of file edmPickEvents.py.

◆ default

edmPickEvents.default

Definition at line 241 of file edmPickEvents.py.

◆ description

edmPickEvents.description

Definition at line 237 of file edmPickEvents.py.

◆ dest

edmPickEvents.dest

Definition at line 240 of file edmPickEvents.py.

◆ email

edmPickEvents.email

Main Program

Definition at line 236 of file edmPickEvents.py.

◆ event

edmPickEvents.event

Definition at line 273 of file edmPickEvents.py.

Referenced by PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.analyze(), DTVDriftSegmentCalibration.analyze(), DTTTrigOffsetCalibration.analyze(), DTResidualCalibration.analyze(), DTChamberEfficiency.analyze(), Rivet::CMS_2013_I1224539_DIJET.analyze(), fwlite::AnalyzerWrapper< T >.analyze(), Rivet::RivetAnalysis.analyze(), GsfElectronAlgo.beginEvent(), FWMagField.checkFieldInfo(), Rivet::HiggsTemplateCrossSections.classifyEvent(), HltDiff.compare(), emtf::phase2::SectorProcessor.configureEvent(), CSCFileDumper.CSCFileDumper(), BiasedTauDecayer.decay(), edm::EDLooperBase.doDuringLoop(), FWFFMetadataManager.doUpdate(), HGCalValidator.dqmAnalyze(), fwlite::EventHistoryGetter.EventHistoryGetter(), CSCValHists.fill2DHistByEvent(), edm::IndexIntoFile.fillEventNumbersOrEntries(), Py8toJetInputHEPEVT.fillJetAlgoInput(), FWHLTTriggerTableView.fillTable(), edm::FilterWrapper< T >.filter(), 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(), cms::alpakatools::EventCache< Event >.get(), sistrip::SpyEventMatcher.getCollections(), sistrip::SpyEventMatcher.getCounters(), sistrip::SpyEventMatcher.getProduct(), PrimaryVertexAnalyzer4PUSlimmed.getSimPVs(), PrescaleEventFilter.globalEndJob(), HLTPrescaler.globalEndJob(), CmsShowNavigator.goTo(), FWGLEventHandler.HandleKey(), HFShowerLibrary.HFShowerLibrary(), hgcal::econd::HGCalModuleTreeReader.HGCalModuleTreeReader(), HcalSignalGenerator< HBHEDigitizerTraits >.initializeEvent(), TrackingTruthAccumulator.initializeEvent(), EcalSignalGenerator< EEDigitizerTraits >.initializeEvent(), main(), gen::TauolappInterface.make_simple_tau_event(), TSToSCAssociatorByEnergyScoreImpl.makeConnections(), LCToSCAssociatorByEnergyScoreImpl< HIT >.makeConnections(), DataModeScoutingRun3.makeEvents(), cms::cuda::EventCache.makeOrGet(), helper::MasterCollection< edm::View< T > >.MasterCollection(), edm::SetRunHelper.overrideRunNumber(), edm::SetRunForEachLumiHelper.overrideRunNumber(), edm::FirstLuminosityBlockForEachRunHelper.overrideRunNumber(), edm::service::MessageLogger.preEvent(), PrescaleWeightProvider.prescaleWeight(), VariableHelper.printValues(), TFWLiteSelectorBasic.Process(), NtpProducer< C >.produce(), LowPtGsfElectronIDProducer.produce(), edmtest::AssociationMapProducer.produce(), RPCUnpackingModule.produce(), CSCDigiFilter.produce(), TotemVFATRawToDigi.produce(), MuonProducer.produce(), TriggerMatcherToHLTDebug.produce(), edm::ThinningProducer< Collection, Selector >.produce(), CSCChamberMasker.produce(), EgammaHLTPhase2ExtraProducer.produce(), EgammaHLTExtraProducer.produce(), HLTCaloObjInRegionsProducer< CaloObjType, CaloObjCollType >.produce(), HLTRecHitInAllL1RegionsProducer< RecHitType >.produce(), hgcal::HGCalFrameGenerator.produceECONEvent(), edm::PoolSource.readIt(), edm::RootEmbeddedFileSequence.readOneSpecified(), removeCPFromPU(), fwlite::Scanner< Collection >.scan(), CosmicTrackingParticleSelector.select(), edm::streamer::StreamerOutputMsgBuilders.serializeEventCommon(), FWFFNavigator.setCurrentEvent(), CompositeTSG.setEvent(), TrackerSeedGenerator.setEvent(), MuonTrackingRegionByPtBuilder.setEvent(), MuonTrackingRegionBuilder.setEvent(), GlobalTrajectoryBuilderBase.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(), L1TdeStage2CaloLayer1.updateMismatch(), and MuIsolatorResultProducer< BT >.writeOut().

◆ 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().

◆ formatter_class

edmPickEvents.formatter_class

Definition at line 237 of file edmPickEvents.py.

◆ help

edmPickEvents.help

Definition at line 20 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.

◆ metavar

edmPickEvents.metavar

Definition at line 262 of file edmPickEvents.py.

◆ nargs

edmPickEvents.nargs

Definition at line 262 of file edmPickEvents.py.

◆ options

edmPickEvents.options

Definition at line 263 of file edmPickEvents.py.

◆ parser

edmPickEvents.parser

Definition at line 237 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.

◆ str

edmPickEvents.str

Definition at line 262 of file edmPickEvents.py.

◆ target

edmPickEvents.target

Definition at line 310 of file edmPickEvents.py.

◆ type

edmPickEvents.type

Definition at line 240 of file edmPickEvents.py.

◆ uniqueFiles

edmPickEvents.uniqueFiles

Definition at line 342 of file edmPickEvents.py.