CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
dataset.CMSDataset Class Reference
Inheritance diagram for dataset.CMSDataset:
dataset.BaseDataset

Public Member Functions

def __init__ (self, name, run_range=None)
 
def buildListOfFiles (self, pattern='.*root')
 
def buildListOfFilesDBS (self, pattern, begin=-1, end=-1)
 
def getPrimaryDatasetEntries (self)
 
- Public Member Functions inherited from dataset.BaseDataset
def __init__ (self, name, user, pattern='.*root', run_range=None, dbsInstance=None)
 def init(self, name, user, pattern='. More...
 
def buildListOfBadFiles (self)
 
def buildListOfFiles (self, pattern)
 
def extractFileSizes (self)
 
def getPrimaryDatasetEntries (self)
 
def listOfFiles (self)
 
def listOfGoodFiles (self)
 
def listOfGoodFilesWithPrescale (self, prescale)
 
def printFiles (self, abspath=True, info=True)
 
def printInfo (self)
 

Static Public Member Functions

def findPrimaryDatasetEntries (dataset, runmin, runmax)
 
def findPrimaryDatasetNumFiles (dataset, runmin, runmax)
 

Public Attributes

 files
 
- Public Attributes inherited from dataset.BaseDataset
 bad_files
 
 dbsInstance
 MM. More...
 
 files
 
 filesAndSizes
 
 good_files
 
 name
 
 pattern
 
 primaryDatasetEntries
 MM. More...
 
 report
 
 run_range
 
 user
 

Detailed Description

Definition at line 130 of file dataset.py.

Constructor & Destructor Documentation

def dataset.CMSDataset.__init__ (   self,
  name,
  run_range = None 
)

Definition at line 132 of file dataset.py.

132  def __init__(self, name, run_range = None):
133  super(CMSDataset, self).__init__( name, 'CMS', run_range=run_range)
134 
def __init__(self, name, run_range=None)
Definition: dataset.py:132

Member Function Documentation

def dataset.CMSDataset.buildListOfFiles (   self,
  pattern = '.*root' 
)

Definition at line 164 of file dataset.py.

References dataset.CMSDataset.findPrimaryDatasetNumFiles(), dataset.int, and dataset.BaseDataset.run_range.

164  def buildListOfFiles(self, pattern='.*root'):
165  runs = (-1,-1)
166  if self.run_range is not None:
167  runs = self.run_range
168  num_files=self.findPrimaryDatasetNumFiles(self.name.rstrip('/'),
169  runs[0],runs[1])
170  limit = 10000
171  if num_files > limit:
172  num_steps = int(num_files/limit)+1
173  self.files = []
174  for i in range(num_steps):
175  DBSFiles=self.buildListOfFilesDBS(pattern,
176  i*limit,
177  ((i+1)*limit)-1)
178  self.files.extend(DBSFiles)
179  else:
180  self.files = self.buildListOfFilesDBS(pattern)
181 
def findPrimaryDatasetNumFiles(dataset, runmin, runmax)
Definition: dataset.py:206
def buildListOfFilesDBS(self, pattern, begin=-1, end=-1)
Definition: dataset.py:135
def buildListOfFiles(self, pattern='.*root')
Definition: dataset.py:164
def dataset.CMSDataset.buildListOfFilesDBS (   self,
  pattern,
  begin = -1,
  end = -1 
)

Definition at line 135 of file dataset.py.

References edm.print(), and dataset.BaseDataset.run_range.

135  def buildListOfFilesDBS(self, pattern, begin=-1, end=-1):
136  print('buildListOfFilesDBS',begin,end)
137  sampleName = self.name.rstrip('/')
138  query, qwhat = sampleName, "dataset"
139  if "#" in sampleName: qwhat = "block"
140  if self.run_range is not None and self.run_range != (-1,-1):
141  if self.run_range[0] == self.run_range[1]:
142  query += " run=%s" % self.run_range[0]
143  else:
144  print("WARNING: queries with run ranges are slow in DAS")
145  query += " run between [%s,%s]" % ( self.run_range[0],self.run_range[1] )
146  dbs='das_client.py --query="file %s=%s"'%(qwhat,query)
147  if begin >= 0:
148  dbs += ' --index %d' % begin
149  if end >= 0:
150  dbs += ' --limit %d' % (end-begin+1)
151  else:
152  dbs += ' --limit 0'
153  print('dbs\t: %s' % dbs)
154  dbsOut = os.popen(dbs)
155  files = []
156  for line in dbsOut:
157  if line.find('/store')==-1:
158  continue
159  line = line.rstrip()
160  # print 'line',line
161  files.append(line)
162  return files
163 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def buildListOfFilesDBS(self, pattern, begin=-1, end=-1)
Definition: dataset.py:135
def dataset.CMSDataset.findPrimaryDatasetEntries (   dataset,
  runmin,
  runmax 
)
static

Definition at line 183 of file dataset.py.

References dataset.int, and edm.print().

Referenced by dataset.CMSDataset.getPrimaryDatasetEntries(), and dataset.PrivateDataset.getPrimaryDatasetEntries().

183  def findPrimaryDatasetEntries(dataset, runmin, runmax):
184 
185  query, qwhat = dataset, "dataset"
186  if "#" in dataset: qwhat = "block"
187  if runmin >0 or runmax > 0:
188  if runmin == runmax:
189  query = "%s run=%d" % (query,runmin)
190  else:
191  print("WARNING: queries with run ranges are slow in DAS")
192  query = "%s run between [%d, %d]" % (query,runmin if runmin > 0 else 1, runmax if runmax > 0 else 999999)
193  dbs='das_client.py --query="summary %s=%s"'%(qwhat,query)
194  dbsOut = os.popen(dbs).readlines()
195 
196  entries = []
197  for line in dbsOut:
198  line = line.replace('\n','')
199  if "nevents" in line:
200  entries.append(int(line.split(":")[1]))
201  if entries:
202  return sum(entries)
203  return -1
204 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def findPrimaryDatasetEntries(dataset, runmin, runmax)
Definition: dataset.py:183
def dataset.CMSDataset.findPrimaryDatasetNumFiles (   dataset,
  runmin,
  runmax 
)
static

Definition at line 206 of file dataset.py.

References dataset.int, and edm.print().

Referenced by dataset.CMSDataset.buildListOfFiles(), and dataset.PrivateDataset.buildListOfFilesDBS().

206  def findPrimaryDatasetNumFiles(dataset, runmin, runmax):
207 
208  query, qwhat = dataset, "dataset"
209  if "#" in dataset: qwhat = "block"
210  if runmin >0 or runmax > 0:
211  if runmin == runmax:
212  query = "%s run=%d" % (query,runmin)
213  else:
214  print("WARNING: queries with run ranges are slow in DAS")
215  query = "%s run between [%d, %d]" % (query,runmin if runmin > 0 else 1, runmax if runmax > 0 else 999999)
216  dbs='das_client.py --query="summary %s=%s"'%(qwhat,query)
217  dbsOut = os.popen(dbs).readlines()
218 
219  entries = []
220  for line in dbsOut:
221  line = line.replace('\n','')
222  if "nfiles" in line:
223  entries.append(int(line.split(":")[1]))
224  if entries:
225  return sum(entries)
226  return -1
227 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def findPrimaryDatasetNumFiles(dataset, runmin, runmax)
Definition: dataset.py:206
def dataset.CMSDataset.getPrimaryDatasetEntries (   self)

Definition at line 228 of file dataset.py.

References dataset.CMSDataset.findPrimaryDatasetEntries(), ElectronMVAID.ElectronMVAID.name, average.Average.name, counter.Counter.name, AlignableObjectId::entry.name, histograms.Histograms.name, cond::persistency::TAG::NAME.name, TmModule.name, cond::persistency::GLOBAL_TAG::NAME.name, cond::persistency::RUN_INFO::RUN_NUMBER.name, cond::persistency::TAG::TIME_TYPE.name, cond::persistency::GLOBAL_TAG::VALIDITY.name, core.autovars.NTupleVariable.name, cond::persistency::RUN_INFO::START_TIME.name, cond::persistency::TAG::OBJECT_TYPE.name, cond::persistency::GLOBAL_TAG::DESCRIPTION.name, cond::persistency::RUN_INFO::END_TIME.name, cond::persistency::TAG::SYNCHRONIZATION.name, cond::persistency::GLOBAL_TAG::RELEASE.name, MEPSet.name, cond::persistency::TAG::END_OF_VALIDITY.name, cond::persistency::GLOBAL_TAG::SNAPSHOT_TIME.name, cond::persistency::TAG::DESCRIPTION.name, cond::persistency::GTEditorData.name, cond::persistency::GLOBAL_TAG::INSERTION_TIME.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, cond::persistency::TAG::INSERTION_TIME.name, nanoaod::MergeableCounterTable::SingleColumn< T >.name, cond::persistency::TAG::MODIFICATION_TIME.name, FWTGeoRecoGeometry::Info.name, preexistingValidation.PreexistingValidation.name, OutputMEPSet.name, dataset.BaseDataset.name, personalPlayback.Applet.name, Types._Untracked.name, ParameterSet.name, PixelDCSObject< T >::Item.name, DQMRivetClient::LumiOption.name, MagCylinder.name, analyzer.Analyzer.name, ParSet.name, edm::PathTimingSummary.name, DQMRivetClient::ScaleFactorOption.name, EgHLTOfflineSummaryClient::SumHistBinData.name, SingleObjectCondition.name, cond::persistency::GTProxyData.name, MyWatcher.name, core.autovars.NTupleObjectType.name, edm::PathSummary.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, alignment.Alignment.name, PixelEndcapLinkMaker::Item.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, perftools::EdmEventSize::BranchRecord.name, DQMGenericClient::EfficOption.name, FWTableViewManager::TableEntry.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, PixelBarrelLinkMaker::Item.name, EcalLogicID.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, MEtoEDM< T >::MEtoEDMObject.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, cms::DDAlgoArguments.name, ExpressionHisto< T >.name, XMLProcessor::_loaderBaseConfig.name, cond::persistency::PAYLOAD::HASH.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, cond::persistency::PAYLOAD::DATA.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, TreeCrawler.Package.name, cond::persistency::PAYLOAD::VERSION.name, genericValidation.GenericValidation.name, options.ConnectionHLTMenu.name, MagGeoBuilderFromDDD::volumeHandle.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, DQMGenericClient::ProfileOption.name, dqmoffline::l1t::HistDefinition.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, DQMGenericClient::NormOption.name, emtf::Node.name, FastHFShowerLibrary.name, h4DSegm.name, PhysicsTools::Calibration::Variable.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, DQMGenericClient::CDOption.name, CounterChecker.name, cond::TagInfo_t.name, TrackerSectorStruct.name, DQMGenericClient::NoFlowOption.name, looper.Looper.name, cond::persistency::IOV::TAG_NAME.name, EDMtoMEConverter.name, cond::persistency::IOV::SINCE.name, Mapper::definition< ScannerT >.name, cond::persistency::IOV::PAYLOAD_HASH.name, classes.MonitorData.name, cond::persistency::IOV::INSERTION_TIME.name, HistogramManager.name, MuonGeometrySanityCheckPoint.name, classes.OutputData.name, options.HLTProcessOptions.name, h2DSegm.name, core.TriggerBitAnalyzer.TriggerBitAnalyzer.name, nanoaod::FlatTable::Column.name, config.Analyzer.name, geometry.Structure.name, core.autovars.NTupleSubObject.name, DQMNet::WaitObject.name, AlpgenParameterName.name, SiStripMonitorDigi.name, core.autovars.NTupleObject.name, config.Service.name, cond::persistency::TAG_LOG::TAG_NAME.name, cond::persistency::TAG_LOG::EVENT_TIME.name, cond::persistency::TAG_LOG::USER_NAME.name, cond::persistency::TAG_LOG::HOST_NAME.name, cond::persistency::TAG_LOG::COMMAND.name, cond::persistency::TAG_LOG::ACTION.name, cond::persistency::TAG_LOG::USER_TEXT.name, core.autovars.NTupleCollection.name, BPHRecoBuilder::BPHRecoSource.name, BPHRecoBuilder::BPHCompSource.name, personalPlayback.FrameworkJob.name, plotscripts.SawTeethFunction.name, crabFunctions.CrabTask.name, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, SummaryOutputProducer::GenericSummary.name, BeautifulSoup.SoupStrainer.name, and dataset.BaseDataset.run_range.

229  runmin = -1
230  runmax = -1
231  if self.run_range is not None:
232  runmin = self.run_range[0]
233  runmax = self.run_range[1]
234  return self.findPrimaryDatasetEntries(self.name, runmin, runmax)
235 
def getPrimaryDatasetEntries(self)
Definition: dataset.py:228
def findPrimaryDatasetEntries(dataset, runmin, runmax)
Definition: dataset.py:183

Member Data Documentation

dataset.CMSDataset.files

Definition at line 173 of file dataset.py.