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' % 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 
# first search in developer area:
def cond2xml.CondXmlProcessor.payload2xml (   self,
  session,
  payload 
)

Definition at line 206 of file cond2xml.py.

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

207  def payload2xml(self, session, payload):
208 
209  if not self._pl2xml_isPrepared:
210  xmlConverter = self.prepPayload2xml(session, payload)
211  if not xmlConverter:
212  msg = "Error preparing code for "+payload
213  raise Exception(msg)
214  self._pl2xml_isPrepared = True
215 
216 
217  # get payload from DB:
218  result = session.query(self.conddb.Payload.data, self.conddb.Payload.object_type).filter(self.conddb.Payload.hash == payload).one()
219  data, plType = result
220 
221  convFuncName = plType+'2xml'
sys.path.append('.')
def cond2xml.CondXmlProcessor.prepPayload2xml (   self,
  session,
  payload 
)

Definition at line 156 of file cond2xml.py.

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

Referenced by cond2xml.CondXmlProcessor.payload2xml().

157  def prepPayload2xml(self, session, payload):
158 
159  startTime = time.time()
160 
161  # get payload from DB:
162  result = session.query(self.conddb.Payload.data, self.conddb.Payload.object_type).filter(self.conddb.Payload.hash == payload).one()
163  data, plType = result
164 
165  info = { "mdName" : "pl2xmlComp",
166  'plType' : plType,
167  }
168 
converter = self.discover(plType)

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

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

Definition at line 198 of file cond2xml.py.

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

Definition at line 193 of file cond2xml.py.

cond2xml.CondXmlProcessor.code = payload2xmlCodeTemplate%info
static

Definition at line 171 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 222 of file cond2xml.py.

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

Definition at line 135 of file cond2xml.py.

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

Definition at line 192 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 175 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' % payloadType )
static

Definition at line 136 of file cond2xml.py.

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

Definition at line 223 of file cond2xml.py.

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

Definition at line 195 of file cond2xml.py.

cond2xml.CondXmlProcessor.tmpDir = self._pl2xml_tmpDir
static

Definition at line 173 of file cond2xml.py.

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

Definition at line 186 of file cond2xml.py.

cond2xml.CondXmlProcessor.xmlConverter = None
static

Definition at line 145 of file cond2xml.py.

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

Definition at line 150 of file cond2xml.py.