CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
cond2xml.CondXmlProcessor Class Reference
Inheritance diagram for cond2xml.CondXmlProcessor:

Public Member Functions

def __del__
 
def __init__
 
def discover
 
def payload2xml
 
def prepPayload2xml
 

Public Attributes

 conddb
 

Static Public Attributes

string buildFileName = "%s/BuildFile.xml"
 
tuple buildTime = time.time()
 
string cmd = "source /afs/cern.ch/cms/cmsset_default.sh;"
 
 code = payload2xmlCodeTemplate%info
 
tuple func = getattr(xmlConverter, convFuncName)
 
tuple libDir = os.path.join( os.environ["CMSSW_BASE"], 'lib', os.environ["SCRAM_ARCH"] )
 
string libName = libDir+'/lib%s.so'
 
string msg = '\nERROR: %s already exists, please remove if you did not create that manually !!'
 
tuple pluginList = glob.glob( libDir + '/plugin%s_toXML.so' % sanitize(payloadType) )
 
tuple resultXML = func( str(data), str(plType) )
 
tuple ret = os.system(cmd)
 
 tmpDir = self._pl2xml_tmpDir
 
string tmpFileName = "%s/src/%s"
 
 xmlConverter = None
 
tuple xmlConverter = importlib.import_module( libName.replace('.so', '') )
 

Private Attributes

 _pl2xml_isPrepared
 

Detailed Description

Definition at line 115 of file cond2xml.py.

Constructor & Destructor Documentation

def cond2xml.CondXmlProcessor.__init__ (   self,
  condDBIn 
)

Definition at line 117 of file cond2xml.py.

118  def __init__(self, condDBIn):
119  self.conddb = condDBIn
120  self._pl2xml_isPrepared = False
def cond2xml.CondXmlProcessor.__del__ (   self)

Definition at line 129 of file cond2xml.py.

References PhysicsTools::MVATrainer.doCleanup, and join().

130  def __del__(self):
131 
132  if self.doCleanup:
133  shutil.rmtree( '/'.join( self._pl2xml_tmpDir.split('/')[:-1] ) )
134  os.unlink( os.path.join( os.environ['CMSSW_BASE'], 'src', './pl2xmlComp.so') )
135  return
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Function Documentation

def cond2xml.CondXmlProcessor.discover (   self,
  payloadType 
)

Definition at line 136 of file cond2xml.py.

Referenced by cond2xml.CondXmlProcessor.prepPayload2xml().

137  def discover(self, payloadType):
138 
139  # print "discover> checking for plugin of type %s" % payloadType
140 
# first search in developer area:
def cond2xml.CondXmlProcessor.payload2xml (   self,
  session,
  payload 
)

Definition at line 216 of file cond2xml.py.

References cond2xml.CondXmlProcessor._pl2xml_isPrepared, alcazmumu_cfi.filter, cond2xml.CondXmlProcessor.prepPayload2xml(), and cond2xml.sanitize().

217  def payload2xml(self, session, payload):
218 
219  if not self._pl2xml_isPrepared:
220  xmlConverter = self.prepPayload2xml(session, payload)
221  if not xmlConverter:
222  msg = "Error preparing code for "+payload
223  raise Exception(msg)
224  self._pl2xml_isPrepared = True
225 
226 
227  # get payload from DB:
228  result = session.query(self.conddb.Payload.data, self.conddb.Payload.object_type).filter(self.conddb.Payload.hash == payload).one()
229  data, plType = result
230 
231  convFuncName = sanitize(plType)+'2xml'
sys.path.append('.')
def sanitize
Definition: cond2xml.py:112
def cond2xml.CondXmlProcessor.prepPayload2xml (   self,
  session,
  payload 
)

Definition at line 165 of file cond2xml.py.

References cond2xml.CondXmlProcessor.discover(), alcazmumu_cfi.filter, and cond2xml.sanitize().

Referenced by cond2xml.CondXmlProcessor.payload2xml().

166  def prepPayload2xml(self, session, payload):
167 
168  startTime = time.time()
169 
170  # get payload from DB:
171  result = session.query(self.conddb.Payload.data, self.conddb.Payload.object_type).filter(self.conddb.Payload.hash == payload).one()
172  data, plType = result
173 
174  info = { "mdName" : "pl2xmlComp",
175  'plType' : plType,
176  'plTypeSan' : sanitize(plType),
177  }
178 
converter = self.discover(plType)
def sanitize
Definition: cond2xml.py:112

Member Data Documentation

cond2xml.CondXmlProcessor._pl2xml_isPrepared
private

Definition at line 119 of file cond2xml.py.

Referenced by cond2xml.CondXmlProcessor.payload2xml().

string cond2xml.CondXmlProcessor.buildFileName = "%s/BuildFile.xml"
static

Definition at line 191 of file cond2xml.py.

tuple cond2xml.CondXmlProcessor.buildTime = time.time()
static

Definition at line 208 of file cond2xml.py.

string cond2xml.CondXmlProcessor.cmd = "source /afs/cern.ch/cms/cmsset_default.sh;"
static

Definition at line 203 of file cond2xml.py.

cond2xml.CondXmlProcessor.code = payload2xmlCodeTemplate%info
static

Definition at line 181 of file cond2xml.py.

cond2xml.CondXmlProcessor.conddb

Definition at line 118 of file cond2xml.py.

tuple cond2xml.CondXmlProcessor.func = getattr(xmlConverter, convFuncName)
static

Definition at line 232 of file cond2xml.py.

tuple cond2xml.CondXmlProcessor.libDir = os.path.join( os.environ["CMSSW_BASE"], 'lib', os.environ["SCRAM_ARCH"] )
static

Definition at line 141 of file cond2xml.py.

string cond2xml.CondXmlProcessor.libName = libDir+'/lib%s.so'
static

Definition at line 202 of file cond2xml.py.

string cond2xml.CondXmlProcessor.msg = '\nERROR: %s already exists, please remove if you did not create that manually !!'
static

Definition at line 185 of file cond2xml.py.

Referenced by MatrixReader.MatrixException.__str__(), cmsHarvester.Usage.__str__(), and cmsHarvester.Error.__str__().

tuple cond2xml.CondXmlProcessor.pluginList = glob.glob( libDir + '/plugin%s_toXML.so' % sanitize(payloadType) )
static

Definition at line 142 of file cond2xml.py.

tuple cond2xml.CondXmlProcessor.resultXML = func( str(data), str(plType) )
static

Definition at line 233 of file cond2xml.py.

tuple cond2xml.CondXmlProcessor.ret = os.system(cmd)
static

Definition at line 205 of file cond2xml.py.

cond2xml.CondXmlProcessor.tmpDir = self._pl2xml_tmpDir
static

Definition at line 183 of file cond2xml.py.

string cond2xml.CondXmlProcessor.tmpFileName = "%s/src/%s"
static

Definition at line 196 of file cond2xml.py.

cond2xml.CondXmlProcessor.xmlConverter = None
static

Definition at line 154 of file cond2xml.py.

tuple cond2xml.CondXmlProcessor.xmlConverter = importlib.import_module( libName.replace('.so', '') )
static

Definition at line 159 of file cond2xml.py.