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

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

213  def payload2xml(self, session, payload):
214 
215  if not self._pl2xml_isPrepared:
216  xmlConverter = self.prepPayload2xml(session, payload)
217  if not xmlConverter:
218  msg = "Error preparing code for "+payload
219  raise Exception(msg)
220  self._pl2xml_isPrepared = True
221 
222 
223  # get payload from DB:
224  result = session.query(self.conddb.Payload.data, self.conddb.Payload.object_type).filter(self.conddb.Payload.hash == payload).one()
225  data, plType = result
226 
227  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  # get payload from DB:
167  result = session.query(self.conddb.Payload.data, self.conddb.Payload.object_type).filter(self.conddb.Payload.hash == payload).one()
168  data, plType = result
169 
170  info = { "mdName" : "pl2xmlComp",
171  'plType' : plType,
172  'plTypeSan' : sanitize(plType),
173  }
174 
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 187 of file cond2xml.py.

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

Definition at line 204 of file cond2xml.py.

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

Definition at line 199 of file cond2xml.py.

cond2xml.CondXmlProcessor.code = payload2xmlCodeTemplate%info
static

Definition at line 177 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 228 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 198 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 181 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 229 of file cond2xml.py.

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

Definition at line 201 of file cond2xml.py.

cond2xml.CondXmlProcessor.tmpDir = self._pl2xml_tmpDir
static

Definition at line 179 of file cond2xml.py.

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

Definition at line 192 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.