CMS 3D CMS Logo

Classes | Functions
ConfigBuilder Namespace Reference

Classes

class  ConfigBuilder
 
class  Options
 

Functions

def anyOf (listOfKeys, dict, opt=None)
 
def dumpPython (process, name)
 
def filesFromDASQuery (query, option="", s=None)
 
def filesFromList (fileName, s=None)
 

Function Documentation

def ConfigBuilder.anyOf (   listOfKeys,
  dict,
  opt = None 
)

Definition at line 179 of file ConfigBuilder.py.

References join().

179 def anyOf(listOfKeys,dict,opt=None):
180  for k in listOfKeys:
181  if k in dict:
182  toReturn=dict[k]
183  dict.pop(k)
184  return toReturn
185  if opt!=None:
186  return opt
187  else:
188  raise Exception("any of "+','.join(listOfKeys)+" are mandatory entries of --output options")
189 
def anyOf(listOfKeys, dict, opt=None)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def ConfigBuilder.dumpPython (   process,
  name 
)

Definition at line 89 of file ConfigBuilder.py.

Referenced by htmlCreator.create(), pdfCreator.create(), EgammaHLTValidationUtils.getResult(), EnablePSetHistory.new_recurseDumpModifications_(), ConfigBuilder.ConfigBuilder.prepare(), SequenceTypes.TestModuleCommand.testCopyAndExclude(), and Config.TestModuleCommand.testDelete().

89 def dumpPython(process,name):
90  theObject = getattr(process,name)
91  if isinstance(theObject,cms.Path) or isinstance(theObject,cms.EndPath) or isinstance(theObject,cms.Sequence):
92  return "process."+name+" = " + theObject.dumpPython("process")
93  elif isinstance(theObject,_Module) or isinstance(theObject,cms.ESProducer):
94  return "process."+name+" = " + theObject.dumpPython()+"\n"
95  else:
96  return "process."+name+" = " + theObject.dumpPython()+"\n"
def dumpPython(process, name)
def ConfigBuilder.filesFromDASQuery (   query,
  option = "",
  s = None 
)

Definition at line 131 of file ConfigBuilder.py.

References list(), and split.

Referenced by ConfigBuilder.ConfigBuilder.filesFromOption(), and ConfigBuilder.ConfigBuilder.prepare_DATAMIX().

131 def filesFromDASQuery(query,option="",s=None):
132  import os,time
133  import FWCore.ParameterSet.Config as cms
134  prim=[]
135  sec=[]
136  print "the query is",query
137  eC=5
138  count=0
139  while eC!=0 and count<3:
140  if count!=0:
141  print 'Sleeping, then retrying DAS'
142  time.sleep(100)
143  p = Popen('dasgoclient %s --query "%s"'%(option,query), stdout=PIPE,shell=True)
144  pipe=p.stdout.read()
145  tupleP = os.waitpid(p.pid, 0)
146  eC=tupleP[1]
147  count=count+1
148  if eC==0:
149  print "DAS succeeded after",count,"attempts",eC
150  else:
151  print "DAS failed 3 times- I give up"
152  for line in pipe.split('\n'):
153  if line.count(".root")>=2:
154  #two files solution...
155  entries=line.replace("\n","").split()
156  prim.append(entries[0])
157  sec.append(entries[1])
158  elif (line.find(".root")!=-1):
159  entry=line.replace("\n","")
160  prim.append(entry)
161  # remove any duplicates
162  prim = sorted(list(set(prim)))
163  sec = sorted(list(set(sec)))
164  if s:
165  if not hasattr(s,"fileNames"):
166  s.fileNames=cms.untracked.vstring(prim)
167  else:
168  s.fileNames.extend(prim)
169  if len(sec)!=0:
170  if not hasattr(s,"secondaryFileNames"):
171  s.secondaryFileNames=cms.untracked.vstring(sec)
172  else:
173  s.secondaryFileNames.extend(sec)
174  print "found files: ",prim
175  if len(sec)!=0:
176  print "found parent files:",sec
177  return (prim,sec)
178 
def filesFromDASQuery(query, option="", s=None)
double split
Definition: MVATrainer.cc:139
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def ConfigBuilder.filesFromList (   fileName,
  s = None 
)

Definition at line 97 of file ConfigBuilder.py.

References list(), and split.

Referenced by ConfigBuilder.ConfigBuilder.filesFromOption(), and ConfigBuilder.ConfigBuilder.prepare_DATAMIX().

97 def filesFromList(fileName,s=None):
98  import os
99  import FWCore.ParameterSet.Config as cms
100  prim=[]
101  sec=[]
102  for line in open(fileName,'r'):
103  if line.count(".root")>=2:
104  #two files solution...
105  entries=line.replace("\n","").split()
106  prim.append(entries[0])
107  sec.append(entries[1])
108  elif (line.find(".root")!=-1):
109  entry=line.replace("\n","")
110  prim.append(entry)
111  # remove any duplicates
112  prim = sorted(list(set(prim)))
113  sec = sorted(list(set(sec)))
114  if s:
115  if not hasattr(s,"fileNames"):
116  s.fileNames=cms.untracked.vstring(prim)
117  else:
118  s.fileNames.extend(prim)
119  if len(sec)!=0:
120  if not hasattr(s,"secondaryFileNames"):
121  s.secondaryFileNames=cms.untracked.vstring(sec)
122  else:
123  s.secondaryFileNames.extend(sec)
124  print "found files: ",prim
125  if len(prim)==0:
126  raise Exception("There are not files in input from the file list")
127  if len(sec)!=0:
128  print "found parent files:",sec
129  return (prim,sec)
130 
def filesFromList(fileName, s=None)
double split
Definition: MVATrainer.cc:139
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run