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 111 of file cond2xml.py.

Constructor & Destructor Documentation

def cond2xml.CondXmlProcessor.__init__ (   self,
  condDBIn 
)

Definition at line 113 of file cond2xml.py.

114  def __init__(self, condDBIn):
115  self.conddb = condDBIn
116  self._pl2xml_isPrepared = False
def cond2xml.CondXmlProcessor.__del__ (   self)

Definition at line 125 of file cond2xml.py.

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

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

Member Function Documentation

def cond2xml.CondXmlProcessor.discover (   self,
  payloadType 
)

Definition at line 132 of file cond2xml.py.

Referenced by cond2xml.CondXmlProcessor.prepPayload2xml().

133  def discover(self, payloadType):
134 
135  # print "discover> checking for plugin of type %s" % payloadType
136 
# first search in developer area:
def cond2xml.CondXmlProcessor.payload2xml (   self,
  session,
  payload 
)

Definition at line 213 of file cond2xml.py.

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

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

Definition at line 161 of file cond2xml.py.

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

Referenced by cond2xml.CondXmlProcessor.payload2xml().

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

Member Data Documentation

cond2xml.CondXmlProcessor._pl2xml_isPrepared
private

Definition at line 115 of file cond2xml.py.

Referenced by cond2xml.CondXmlProcessor.payload2xml().

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

Definition at line 188 of file cond2xml.py.

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

Definition at line 205 of file cond2xml.py.

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

Definition at line 200 of file cond2xml.py.

cond2xml.CondXmlProcessor.code = payload2xmlCodeTemplate%info
static

Definition at line 178 of file cond2xml.py.

cond2xml.CondXmlProcessor.conddb

Definition at line 114 of file cond2xml.py.

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

Definition at line 230 of file cond2xml.py.

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

Definition at line 137 of file cond2xml.py.

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

Definition at line 199 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 182 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 138 of file cond2xml.py.

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

Definition at line 231 of file cond2xml.py.

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

Definition at line 202 of file cond2xml.py.

cond2xml.CondXmlProcessor.tmpDir = self._pl2xml_tmpDir
static

Definition at line 180 of file cond2xml.py.

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

Definition at line 193 of file cond2xml.py.

cond2xml.CondXmlProcessor.xmlConverter = None
static

Definition at line 150 of file cond2xml.py.

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

Definition at line 155 of file cond2xml.py.