CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
validation.Sample Class Reference

Public Member Functions

def __init__
 
def datasetpattern
 
def dirname
 
def fastsim
 
def fastsimCorrespondingFullsimPileup
 
def filename
 
def fullsim
 
def hasOverrideGlobalTag
 
def hasPileup
 
def hasScenario
 
def name
 
def overrideGlobalTag
 
def pileup
 
def pileupType
 
def sample
 
def scenario
 
def version
 

Private Attributes

 _append
 
 _fastsim
 
 _fastsimCorrespondingFullsimPileup
 
 _midfix
 
 _overrideGlobalTag
 
 _putype
 
 _sample
 
 _scenario
 
 _version
 

Detailed Description

Represents a RelVal sample.

Definition at line 118 of file validation.py.

Constructor & Destructor Documentation

def validation.Sample.__init__ (   self,
  sample,
  append = None,
  midfix = None,
  putype = None,
  fastsim = False,
  fastsimCorrespondingFullsimPileup = None,
  version = "v1",
  scenario = None,
  overrideGlobalTag = None 
)
Constructor.

Arguments:
sample -- String for name of the sample

Keyword arguments
append  -- String for a variable name within the DWM file names, to be directly appended to sample name (e.g. "HS"; default None)
midfix  -- String for a variable name within the DQM file names, to be appended after underscore to "sample name+append" (e.g. "13", "UP15"; default None)
putype  -- String for pileup type (e.g. "25ns"/"50ns" for FullSim, "AVE20" for FastSim; default None)
fastsim -- Bool indicating the FastSim status (default False)
fastsimCorrespondingFullSimPileup -- String indicating what is the FullSim pileup sample corresponding this FastSim sample. Must be set if fastsim=True and putype!=None (default None)
version -- String for dataset/DQM file version (default "v1")
scenario -- Geometry scenario for upgrade samples (default None)
overrideGlobalTag -- GlobalTag obtained from release information (in the form of {"release": "actualRelease"}; default None)

Definition at line 122 of file validation.py.

123  version="v1", scenario=None, overrideGlobalTag=None):
124  """Constructor.
125 
126  Arguments:
127  sample -- String for name of the sample
128 
129  Keyword arguments
130  append -- String for a variable name within the DWM file names, to be directly appended to sample name (e.g. "HS"; default None)
131  midfix -- String for a variable name within the DQM file names, to be appended after underscore to "sample name+append" (e.g. "13", "UP15"; default None)
132  putype -- String for pileup type (e.g. "25ns"/"50ns" for FullSim, "AVE20" for FastSim; default None)
133  fastsim -- Bool indicating the FastSim status (default False)
134  fastsimCorrespondingFullSimPileup -- String indicating what is the FullSim pileup sample corresponding this FastSim sample. Must be set if fastsim=True and putype!=None (default None)
135  version -- String for dataset/DQM file version (default "v1")
136  scenario -- Geometry scenario for upgrade samples (default None)
137  overrideGlobalTag -- GlobalTag obtained from release information (in the form of {"release": "actualRelease"}; default None)
138  """
139  self._sample = sample
140  self._append = append
141  self._midfix = midfix
142  self._putype = putype
143  self._fastsim = fastsim
144  self._fastsimCorrespondingFullsimPileup = fastsimCorrespondingFullsimPileup
145  self._version = version
146  self._scenario = scenario
147  self._overrideGlobalTag = overrideGlobalTag
148 
149  if self._fastsim and self.hasPileup() and self._fastsimCorrespondingFullsimPileup is None:
150  raise Exception("If fastsim=True and putype!=None, also fastsimCorrespondingFullsimPileup must be != None")
_fastsimCorrespondingFullsimPileup
Definition: validation.py:143

Member Function Documentation

def validation.Sample.datasetpattern (   self,
  newRelease 
)
Return the dataset pattern

Arguments:
newRelease -- String for CMSSW release

Definition at line 256 of file validation.py.

References validation.Sample._fastsim, validation._getGlobalTag(), validation.Sample._sample, validation.Sample.hasPileup(), ora::OraMainTable.version(), pos::PixelVersionAlias.version(), SiPixelFedCabling.version(), PixelToFEDAssociate.version(), SiPixelFedCablingTree.version(), PixelToFEDAssociateFromAscii.version(), PixelToLNKAssociateFromAscii.version(), DTRecoUncertainties.version(), FEDHeader.version(), SiPixelFedCablingMap.version(), FWConfigurableParameterizable.version(), LTCDigi.version(), MagFieldConfig.version, Phase2Tracker::FEDDAQHeader.version(), lumi::Lumi2DB::LumiSource.version, DTRecoConditions.version(), RPCReadOutMapping.version(), BeamSpotOnline.version(), L1TriggerScalers.version(), ora::PoolMainTable.version(), MatrixInjector.MatrixInjector.version, HcalTrigTowerDetId.version(), LumiScalers.version(), SiPixelTemplateDBObject::Reader.version(), Level1TriggerScalers.version(), FWConfiguration.version(), confdbOfflineConverter.OfflineConverter.version, SiPixelCPEGenericErrorParm.version(), L1TriggerRates.version(), options.ConnectionHLTMenu.version, L1CaloGeometry.version(), Level1TriggerRates.version(), TrackerInteractionGeometry.version, SiPixel2DTemplateDBObject.version(), SiPixelGenErrorDBObject.version(), npstat::StorableMultivariateFunctor.version(), ora::MappingTree.version(), ora::MappingRawData.version, DcsStatus.version(), npstat::UniformAxis.version(), MatacqTBRawEvent::matacqHeader_t.version, DTCCBConfig.version(), Vispa.Main.Application.Application.version(), DQMNet::CoreObject.version, DTLVStatus.version(), DTT0.version(), npstat::NUHistoAxis.version(), npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >.version(), DTTPGParameters.version(), DTRangeT0.version(), npstat::DualAxis.version(), SiPixelTemplateDBObject.version(), EcalMatacqDigi.version(), npstat::GridAxis.version(), DTHVStatus.version(), npstat::HistoAxis.version(), FRDEventMsgView.version(), XMLProcessor::_DBConfig.version, npstat::DualHistoAxis.version(), DTTtrig.version(), DTPerformance.version(), DTStatusFlag.version(), npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >.version(), npstat::BoxND< Numeric >.version(), DTDeadFlag.version(), DTMtime.version(), validation.Sample.version(), sistrip::FEDDAQHeader.version(), ScalersEventRecordRaw_v1.version, ScalersEventRecordRaw_v2.version, conddblib.Payload.version, npstat::LinInterpolatedTableND< Numeric, Axis >.version(), ScalersEventRecordRaw_v3.version, ScalersEventRecordRaw_v4.version, ScalersEventRecordRaw_v5.version, ScalersEventRecordRaw_v6.version, pos::PixelAliasList.version(), cmsHarvester.CMSHarvester.version, npstat::HistoND< Numeric, Axis >.version(), python.rootplot.argparse._VersionAction.version, npstat::ArrayND< Numeric, StackLen, StackDim >.version(), TiXmlDeclaration.version, argparse.ArgumentParser.version, and python.rootplot.argparse.ArgumentParser.version.

257  def datasetpattern(self, newRelease):
258  """Return the dataset pattern
259 
260  Arguments:
261  newRelease -- String for CMSSW release
262  """
263  pileup = ""
264  fastsim = ""
265  digi = ""
266  if self.hasPileup():
267  pileup = "-PU_"
268  if self._fastsim:
269  fastsim = "_FastSim-"
270  digi = "DIGI-"
271  else:
272  fastsim = "*"
273  globalTag = _getGlobalTag(self, newRelease)
274  return "{sample}/{newrelease}-{pileup}{globaltag}{fastsim}{version}/GEN-SIM-{digi}RECO".format(
275  sample=self._sample, newrelease=newRelease,
276  pileup=pileup, globaltag=globalTag, fastsim=fastsim, digi=digi,
277  version=self.version(newRelease)
278  )
def _getGlobalTag
Definition: validation.py:70
def validation.Sample.dirname (   self,
  newRepository,
  newRelease,
  newSelection 
)
Return the output directory name

Arguments:
newRepository -- String for base directory for output files
newRelease    -- String for CMSSW release
newSelection  -- String for histogram selection

Definition at line 206 of file validation.py.

References validation.Sample._fastsim, validation.Sample._putype, and validation.Sample.hasPileup().

207  def dirname(self, newRepository, newRelease, newSelection):
208  """Return the output directory name
209 
210  Arguments:
211  newRepository -- String for base directory for output files
212  newRelease -- String for CMSSW release
213  newSelection -- String for histogram selection
214  """
215  pileup = ""
216  if self.hasPileup() and not self._fastsim:
217  pileup = "_"+self._putype
218  return "{newRepository}/{newRelease}/{newSelection}{pileup}/{sample}".format(
219  newRepository=newRepository, newRelease=newRelease, newSelection=newSelection,
220  pileup=pileup, sample=sample)
def validation.Sample.fastsim (   self)
Return True for FastSim sample

Definition at line 195 of file validation.py.

References validation.Sample._fastsim.

196  def fastsim(self):
197  """Return True for FastSim sample"""
198  return self._fastsim
def validation.Sample.fastsimCorrespondingFullsimPileup (   self)

Definition at line 203 of file validation.py.

References validation.Sample._fastsimCorrespondingFullsimPileup.

_fastsimCorrespondingFullsimPileup
Definition: validation.py:143
def fastsimCorrespondingFullsimPileup
Definition: validation.py:203
def validation.Sample.filename (   self,
  newRelease 
)
Return the DQM file name

Arguments:
newRelease -- String for CMSSW release

Definition at line 221 of file validation.py.

References validation.Sample._append, validation.Sample._fastsim, validation._getGlobalTag(), validation.Sample._midfix, validation.Sample._sample, validation.Sample._scenario, validation._stripRelease(), validation.Sample.hasPileup(), validation.Sample.pileupType(), ora::OraMainTable.version(), pos::PixelVersionAlias.version(), SiPixelFedCabling.version(), PixelToFEDAssociate.version(), SiPixelFedCablingTree.version(), PixelToFEDAssociateFromAscii.version(), PixelToLNKAssociateFromAscii.version(), FEDHeader.version(), DTRecoUncertainties.version(), SiPixelFedCablingMap.version(), LTCDigi.version(), FWConfigurableParameterizable.version(), MagFieldConfig.version, Phase2Tracker::FEDDAQHeader.version(), lumi::Lumi2DB::LumiSource.version, DTRecoConditions.version(), RPCReadOutMapping.version(), BeamSpotOnline.version(), HcalTrigTowerDetId.version(), L1TriggerScalers.version(), ora::PoolMainTable.version(), MatrixInjector.MatrixInjector.version, LumiScalers.version(), SiPixelTemplateDBObject::Reader.version(), Level1TriggerScalers.version(), FWConfiguration.version(), confdbOfflineConverter.OfflineConverter.version, SiPixelCPEGenericErrorParm.version(), L1TriggerRates.version(), options.ConnectionHLTMenu.version, L1CaloGeometry.version(), Level1TriggerRates.version(), TrackerInteractionGeometry.version, SiPixel2DTemplateDBObject.version(), SiPixelGenErrorDBObject.version(), npstat::StorableMultivariateFunctor.version(), ora::MappingTree.version(), ora::MappingRawData.version, DcsStatus.version(), npstat::UniformAxis.version(), MatacqTBRawEvent::matacqHeader_t.version, DTCCBConfig.version(), Vispa.Main.Application.Application.version(), DQMNet::CoreObject.version, DTLVStatus.version(), DTT0.version(), npstat::NUHistoAxis.version(), npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >.version(), DTTPGParameters.version(), DTRangeT0.version(), npstat::DualAxis.version(), SiPixelTemplateDBObject.version(), EcalMatacqDigi.version(), npstat::GridAxis.version(), DTHVStatus.version(), npstat::HistoAxis.version(), FRDEventMsgView.version(), XMLProcessor::_DBConfig.version, npstat::DualHistoAxis.version(), DTTtrig.version(), DTPerformance.version(), DTStatusFlag.version(), npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >.version(), npstat::BoxND< Numeric >.version(), DTDeadFlag.version(), DTMtime.version(), validation.Sample.version(), sistrip::FEDDAQHeader.version(), ScalersEventRecordRaw_v1.version, ScalersEventRecordRaw_v2.version, conddblib.Payload.version, npstat::LinInterpolatedTableND< Numeric, Axis >.version(), ScalersEventRecordRaw_v3.version, ScalersEventRecordRaw_v4.version, ScalersEventRecordRaw_v5.version, ScalersEventRecordRaw_v6.version, pos::PixelAliasList.version(), cmsHarvester.CMSHarvester.version, npstat::HistoND< Numeric, Axis >.version(), python.rootplot.argparse._VersionAction.version, npstat::ArrayND< Numeric, StackLen, StackDim >.version(), TiXmlDeclaration.version, argparse.ArgumentParser.version, and python.rootplot.argparse.ArgumentParser.version.

Referenced by cuy.ValElement.__init__().

222  def filename(self, newRelease):
223  """Return the DQM file name
224 
225  Arguments:
226  newRelease -- String for CMSSW release
227  """
228  pileup = ""
229  fastsim = ""
230  midfix = ""
231  scenario = ""
232  if self._append is not None:
233  midfix += self._append
234  if self._midfix is not None:
235  midfix += "_"+self._midfix
236  if self.hasPileup():
237  if self._fastsim:
238  pileup = "PU_"
239  midfix += "_"+self.pileupType(newRelease)
240  else:
241  pileup = "PU"+self.pileupType(newRelease)+"_"
242  if self._fastsim:
243  fastsim = "_FastSim"
244  if self._scenario is not None:
245  scenario = "_"+self._scenario
246 
247  globalTag = _getGlobalTag(self, newRelease)
248 
249  fname = 'DQM_V0001_R000000001__{sample}{midfix}__{newrelease}-{pileup}{globaltag}{scenario}{fastsim}-{version}__DQMIO.root'.format(
250  sample=self._sample, midfix=midfix, newrelease=_stripRelease(newRelease),
251  pileup=pileup, globaltag=globalTag, scenario=scenario, fastsim=fastsim,
252  version=self.version(newRelease)
253  )
254 
255  return fname
def _getGlobalTag
Definition: validation.py:70
def _stripRelease
Definition: validation.py:63
def validation.Sample.fullsim (   self)
Return True for FullSim sample

Definition at line 199 of file validation.py.

References validation.Sample._fastsim.

200  def fullsim(self):
201  """Return True for FullSim sample"""
202  return not self._fastsim
def validation.Sample.hasOverrideGlobalTag (   self)

Definition at line 189 of file validation.py.

References validation.Sample._overrideGlobalTag.

190  def hasOverrideGlobalTag(self):
191  return self._overrideGlobalTag is not None
def validation.Sample.hasPileup (   self)
Return True if sample has pileup

Definition at line 159 of file validation.py.

References validation.Sample._putype.

Referenced by validation.Sample.datasetpattern(), validation.Sample.dirname(), validation.Sample.filename(), and validation.Sample.pileup().

160  def hasPileup(self):
161  """Return True if sample has pileup"""
162  return self._putype is not None
def validation.Sample.hasScenario (   self)

Definition at line 183 of file validation.py.

References validation.Sample._scenario.

184  def hasScenario(self):
185  return self._scenario is not None
def validation.Sample.name (   self)
Get the sample name

Definition at line 155 of file validation.py.

References validation.Sample._sample.

Referenced by cuy.divideElement.__init__(), cuy.plotElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), and config.CFG.__str__().

156  def name(self):
157  """Get the sample name"""
158  return self._sample
def validation.Sample.overrideGlobalTag (   self)

Definition at line 192 of file validation.py.

References validation.Sample._overrideGlobalTag.

Referenced by confdb.HLTProcess.customize().

193  def overrideGlobalTag(self):
194  return self._overrideGlobalTag
def validation.Sample.pileup (   self)
Return "PU"/"noPU" corresponding the pileup status

Definition at line 163 of file validation.py.

References validation.Sample.hasPileup().

164  def pileup(self):
165  """Return "PU"/"noPU" corresponding the pileup status"""
166  if self.hasPileup():
167  return "PU"
168  else:
169  return "noPU"
def validation.Sample.pileupType (   self,
  release = None 
)
Return the pileup type

Definition at line 170 of file validation.py.

References validation.Sample._putype.

Referenced by validation.Sample.filename().

171  def pileupType(self, release=None):
172  """Return the pileup type"""
173  if isinstance(self._putype, dict):
174  return self._putype.get(release, self._putype["default"])
175  else:
176  return self._putype
def validation.Sample.sample (   self)
Get the sample name

Definition at line 151 of file validation.py.

References validation.Sample._sample.

152  def sample(self):
153  """Get the sample name"""
154  return self._sample
def validation.Sample.scenario (   self)

Definition at line 186 of file validation.py.

References validation.Sample._scenario.

187  def scenario(self):
188  return self._scenario
def validation.Sample.version (   self,
  release = None 
)

Definition at line 177 of file validation.py.

References Vispa.Main.Application.Application._version, and validation.Sample._version.

Referenced by validation.Sample.datasetpattern(), and validation.Sample.filename().

178  def version(self, release=None):
179  if isinstance(self._version, dict):
180  return self._version.get(release, self._version["default"])
181  else:
182  return self._version

Member Data Documentation

validation.Sample._append
private

Definition at line 139 of file validation.py.

Referenced by validation.Sample.filename().

validation.Sample._fastsim
private

Definition at line 142 of file validation.py.

Referenced by validation.Sample.datasetpattern(), validation.Sample.dirname(), validation.Sample.fastsim(), validation.Sample.filename(), and validation.Sample.fullsim().

validation.Sample._fastsimCorrespondingFullsimPileup
private

Definition at line 143 of file validation.py.

Referenced by validation.Sample.fastsimCorrespondingFullsimPileup().

validation.Sample._midfix
private

Definition at line 140 of file validation.py.

Referenced by validation.Sample.filename().

validation.Sample._overrideGlobalTag
private

Definition at line 146 of file validation.py.

Referenced by validation.Sample.hasOverrideGlobalTag(), and validation.Sample.overrideGlobalTag().

validation.Sample._putype
private

Definition at line 141 of file validation.py.

Referenced by validation.Sample.dirname(), validation.Sample.hasPileup(), and validation.Sample.pileupType().

validation.Sample._sample
private

Definition at line 138 of file validation.py.

Referenced by validation.Sample.datasetpattern(), validation.Sample.filename(), validation.Sample.name(), and validation.Sample.sample().

validation.Sample._scenario
private

Definition at line 145 of file validation.py.

Referenced by validation.Sample.filename(), validation.Sample.hasScenario(), and validation.Sample.scenario().

validation.Sample._version
private

Definition at line 144 of file validation.py.

Referenced by validation.Sample.version().