CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
cond2xml.CondXmlProcessor Class Reference
Inheritance diagram for cond2xml.CondXmlProcessor:

Public Member Functions

def __del__ (self)
 
def __init__ (self, condDBIn)
 
def discover (self, payloadType)
 
def payload2xml (self, session, payload)
 
def prepPayload2xml (self, session, payload)
 

Public Attributes

 conddb
 

Private Attributes

 _pl2xml_isPrepared
 

Detailed Description

Definition at line 112 of file cond2xml.py.

Constructor & Destructor Documentation

def cond2xml.CondXmlProcessor.__init__ (   self,
  condDBIn 
)

Definition at line 114 of file cond2xml.py.

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

Definition at line 126 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
132 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Function Documentation

def cond2xml.CondXmlProcessor.discover (   self,
  payloadType 
)

Definition at line 133 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 
137  # first search in developer area:
def discover(self, payloadType)
Definition: cond2xml.py:133
def cond2xml.CondXmlProcessor.payload2xml (   self,
  session,
  payload 
)

Definition at line 214 of file cond2xml.py.

References cond2xml.CondXmlProcessor._pl2xml_isPrepared, ALCARECOTkAlBeamHalo_cff.filter, RecoEcal_EventContent_cff.func, cond2xml.CondXmlProcessor.prepPayload2xml(), cond2xml.sanitize(), and harvestTrackValidationPlots.str.

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'
230  sys.path.append('.')
def sanitize(typeName)
Definition: cond2xml.py:109
def prepPayload2xml(self, session, payload)
Definition: cond2xml.py:162
def payload2xml(self, session, payload)
Definition: cond2xml.py:214
def cond2xml.CondXmlProcessor.prepPayload2xml (   self,
  session,
  payload 
)

Definition at line 162 of file cond2xml.py.

References cond2xml.CondXmlProcessor.discover(), PhysicsTools::MVATrainer.doCleanup, ALCARECOTkAlBeamHalo_cff.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 
176  converter = self.discover(plType)
def sanitize(typeName)
Definition: cond2xml.py:109
def discover(self, payloadType)
Definition: cond2xml.py:133
def prepPayload2xml(self, session, payload)
Definition: cond2xml.py:162

Member Data Documentation

cond2xml.CondXmlProcessor._pl2xml_isPrepared
private

Definition at line 116 of file cond2xml.py.

Referenced by cond2xml.CondXmlProcessor.payload2xml().

cond2xml.CondXmlProcessor.conddb

Definition at line 115 of file cond2xml.py.