CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
visDQMUtils Namespace Reference

Functions

def classifyDQMFile
 

Variables

tuple RXDATASET = re.compile(r"^(/[-A-Za-z0-9_]+){3}$")
 
tuple RXOFFLINE = re.compile(r"^(?:.*/)?DQM_V(\d+)_R(\d+)((?:__[-A-Za-z0-9_]+){3})\.root$")
 
tuple RXONLINE = re.compile(r"^(?:.*/)?DQM_V(\d+)(_[A-Za-z0-9]+)?_R(\d+)\.root$")
 
tuple RXRELVALDATA = re.compile(r"^/[^/]+/(CMSSW(?:_[0-9]+)+(?:_pre[0-9]+)?)[-_].*$")
 
tuple RXRELVALMC = re.compile(r"^/RelVal[^/]+/(CMSSW(?:_[0-9]+)+(?:_pre[0-9]+)?)[-_].*$")
 
tuple RXRELVALRUNDEPMC = re.compile(r"^/RelVal[^/]+/(CMSSW(?:_[0-9]+)+(?:_pre[0-9]+)?)[-_].*rundepMC.*$")
 
tuple RXRUNDEPMC = re.compile(r"^/(?!RelVal)[^/]+/.*rundepMC.*$")
 

Function Documentation

def visDQMUtils.classifyDQMFile (   path)

Definition at line 29 of file visDQMUtils.py.

References print(), and python.rootplot.root2matplotlib.replace().

29 
30 def classifyDQMFile(path):
31  print(path)
32  try:
33  m = re.match(RXONLINE, path)
34  if m:
35  version = int(m.group(1))
36  runnr = int(m.group(3))
37  subsys = m.group(2) and m.group(2)[1:]
38  if version != 1:
39  return False, "file version is not 1"
40  elif runnr <= 10000:
41  return False, "online file has run number <= 10000"
42  else:
43  # online_data
44  return True, { 'class': 'online_data', 'version': version,
45  'subsystem': subsys, 'runnr': runnr,
46  'dataset': "/Global/Online/ALL" }
47 
48  m = re.match(RXOFFLINE, path)
49  if m:
50  version = int(m.group(1))
51  dataset = m.group(3).replace("__", "/")
52  if not re.match(RXDATASET, dataset):
53  return False, "Invalid dataset name"
54  relvalmc = re.match(RXRELVALMC, dataset)
55  relvaldata = re.match(RXRELVALDATA, dataset)
56  relvalrundepmc = re.match(RXRELVALRUNDEPMC, dataset)
57  rundepmc = re.match(RXRUNDEPMC, dataset)
58  runnr = int(m.group(2))
59  if version != 1:
60  return False, "file version is not 1"
61  if runnr < 1:
62  return False, "file matches offline naming, but run number is < 1"
63  elif rundepmc:
64  if runnr == 1:
65  return False, "file matches Run Dependent MonteCarlo naming, but run number is 1"
66  else:
67  # simulated_rundep
68  return True, { 'class': 'simulated_rundep', 'version': version,
69  'runnr': runnr, 'dataset': dataset }
70  elif relvalrundepmc:
71  if runnr == 1:
72  return False, "file matches Run Dependent MonteCarlo naming, but run number is 1"
73  else:
74  # relval_rundepmc
75  return True, { 'class': 'relval_rundepmc', 'version': version,
76  'runnr': runnr, 'dataset': dataset,
77  'release': relvalrundepmc.group(1)}
78  elif relvalmc:
79  if runnr != 1:
80  return False, "file matches relval mc naming, but run number != 1"
81  else:
82  # relval_mc
83  return True, { 'class': 'relval_mc', 'version': version,
84  'runnr': runnr, 'dataset': dataset,
85  'release': relvalmc.group(1) }
86  elif relvaldata:
87  if runnr == 1:
88  return False, "file matches relval data naming, but run number = 1"
89  else:
90  # relval_data
91  return True, { 'class': 'relval_data', 'version': version,
92  'runnr': runnr, 'dataset': dataset,
93  'release': relvaldata.group(1) }
94  elif dataset.find("CMSSW") >= 0:
95  return False, "non-relval dataset name contains 'CMSSW'"
96  elif runnr > 1:
97  # offline_data
98  return True, { 'class': 'offline_data', 'version': version,
99  'runnr': runnr, 'dataset': dataset }
100  else:
101  # simulated
102  return True, { 'class': 'simulated', 'version': int(m.group(1)),
103  'runnr': runnr, 'dataset': dataset }
104 
105  return False, "file matches no known naming convention"
106  except:
107  return False, "error while classifying file name"
108 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def classifyDQMFile
Definition: visDQMUtils.py:29

Variable Documentation

tuple visDQMUtils.RXDATASET = re.compile(r"^(/[-A-Za-z0-9_]+){3}$")

Definition at line 6 of file visDQMUtils.py.

tuple visDQMUtils.RXOFFLINE = re.compile(r"^(?:.*/)?DQM_V(\d+)_R(\d+)((?:__[-A-Za-z0-9_]+){3})\.root$")

Definition at line 17 of file visDQMUtils.py.

tuple visDQMUtils.RXONLINE = re.compile(r"^(?:.*/)?DQM_V(\d+)(_[A-Za-z0-9]+)?_R(\d+)\.root$")

Definition at line 14 of file visDQMUtils.py.

tuple visDQMUtils.RXRELVALDATA = re.compile(r"^/[^/]+/(CMSSW(?:_[0-9]+)+(?:_pre[0-9]+)?)[-_].*$")

Definition at line 10 of file visDQMUtils.py.

tuple visDQMUtils.RXRELVALMC = re.compile(r"^/RelVal[^/]+/(CMSSW(?:_[0-9]+)+(?:_pre[0-9]+)?)[-_].*$")

Definition at line 8 of file visDQMUtils.py.

tuple visDQMUtils.RXRELVALRUNDEPMC = re.compile(r"^/RelVal[^/]+/(CMSSW(?:_[0-9]+)+(?:_pre[0-9]+)?)[-_].*rundepMC.*$")

Definition at line 9 of file visDQMUtils.py.

tuple visDQMUtils.RXRUNDEPMC = re.compile(r"^/(?!RelVal)[^/]+/.*rundepMC.*$")

Definition at line 11 of file visDQMUtils.py.