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 126 of file dataset.py.

Constructor & Destructor Documentation

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

Definition at line 128 of file dataset.py.

128  def __init__(self, name, run_range = None):
129  super(CMSDataset, self).__init__( name, 'CMS', run_range=run_range)
130 
def __init__(self, name, run_range=None)
Definition: dataset.py:128

Member Function Documentation

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

Definition at line 160 of file dataset.py.

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

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

Definition at line 131 of file dataset.py.

References dataset.BaseDataset.run_range.

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

Definition at line 179 of file dataset.py.

References dataset.int.

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

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

Definition at line 202 of file dataset.py.

References dataset.int.

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

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

Definition at line 224 of file dataset.py.

References dataset.CMSDataset.findPrimaryDatasetEntries(), ElectronMVAID.ElectronMVAID.name, counter.Counter.name, average.Average.name, AlignableObjectId::entry.name, histograms.Histograms.name, cond::persistency::TAG::NAME.name, TmModule.name, core.autovars.NTupleVariable.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, 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, nanoaod::MergeableCounterTable::SingleColumn< T >.name, cond::persistency::TAG::LAST_VALIDATED_TIME.name, FWTGeoRecoGeometry::Info.name, Types._Untracked.name, cond::persistency::TAG::INSERTION_TIME.name, preexistingValidation.PreexistingValidation.name, dataset.BaseDataset.name, cond::persistency::TAG::MODIFICATION_TIME.name, OutputMEPSet.name, personalPlayback.Applet.name, ParameterSet.name, PixelDCSObject< T >::Item.name, analyzer.Analyzer.name, DQMRivetClient::LumiOption.name, MagCylinder.name, ParSet.name, DQMRivetClient::ScaleFactorOption.name, SingleObjectCondition.name, EgHLTOfflineSummaryClient::SumHistBinData.name, cond::persistency::GTProxyData.name, core.autovars.NTupleObjectType.name, Mapper::definition< ScannerT >.name, MyWatcher.name, edm::PathTimingSummary.name, nanoaod::MergeableCounterTable::VectorColumn< T >.name, alignment.Alignment.name, cond::TimeTypeSpecs.name, lumi::TriggerInfo.name, edm::PathSummary.name, PixelEndcapLinkMaker::Item.name, DQMGenericClient::EfficOption.name, perftools::EdmEventSize::BranchRecord.name, cond::persistency::GLOBAL_TAG_MAP::GLOBAL_TAG_NAME.name, FWTableViewManager::TableEntry.name, cond::persistency::GLOBAL_TAG_MAP::RECORD.name, PixelBarrelLinkMaker::Item.name, validateAlignments.ParallelMergeJob.name, EcalLogicID.name, cond::persistency::GLOBAL_TAG_MAP::LABEL.name, MEtoEDM< T >::MEtoEDMObject.name, cond::persistency::GLOBAL_TAG_MAP::TAG_NAME.name, ExpressionHisto< T >.name, XMLProcessor::_loaderBaseConfig.name, cond::persistency::PAYLOAD::HASH.name, TreeCrawler.Package.name, cond::persistency::PAYLOAD::OBJECT_TYPE.name, genericValidation.GenericValidation.name, cond::persistency::PAYLOAD::DATA.name, cond::persistency::PAYLOAD::STREAMER_INFO.name, cond::persistency::PAYLOAD::VERSION.name, MagGeoBuilderFromDDD::volumeHandle.name, cond::persistency::PAYLOAD::INSERTION_TIME.name, DQMGenericClient::ProfileOption.name, options.ConnectionHLTMenu.name, DQMGenericClient::NormOption.name, emtf::Node.name, h4DSegm.name, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.name, PhysicsTools::Calibration::Variable.name, FastHFShowerLibrary.name, DQMGenericClient::CDOption.name, CounterChecker.name, EDMtoMEConverter.name, cond::TagInfo_t.name, looper.Looper.name, cond::persistency::IOV::TAG_NAME.name, cond::persistency::IOV::SINCE.name, TrackerSectorStruct.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, hTMaxCell.name, cscdqm::ParHistoDef.name, BeautifulSoup.Tag.name, SummaryOutputProducer::GenericSummary.name, BeautifulSoup.SoupStrainer.name, and dataset.BaseDataset.run_range.

225  runmin = -1
226  runmax = -1
227  if self.run_range is not None:
228  runmin = self.run_range[0]
229  runmax = self.run_range[1]
230  return self.findPrimaryDatasetEntries(self.name, runmin, runmax)
231 
def getPrimaryDatasetEntries(self)
Definition: dataset.py:224
def findPrimaryDatasetEntries(dataset, runmin, runmax)
Definition: dataset.py:179

Member Data Documentation

dataset.CMSDataset.files

Definition at line 169 of file dataset.py.