CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
twikiExport.Constituent Class Reference

Public Member Functions

def __init__ (self, line, predefinedMaterials)
 
def __str__ (self)
 

Public Attributes

 theCount
 
 theDensity
 
 theDescription
 
 theL0
 
 theMass
 
 theName
 
 theType
 
 theVolume
 
 theX0
 

Detailed Description

Definition at line 6 of file twikiExport.py.

Constructor & Destructor Documentation

def twikiExport.Constituent.__init__ (   self,
  line,
  predefinedMaterials 
)

Definition at line 7 of file twikiExport.py.

References split.

7  def __init__(self, line, predefinedMaterials):
8  if len(line.split('"')) < 5 or len(line.split('"')[4].split()) < 3:
9  raise Exception("not a well formed Constituent: "+constString)
10  self.theDescription = line.split('"')[1]
11  self.theName = line.split('"')[3]
12  self.theCount = float(line.split('"')[4].split()[1])
13  self.theVolume = float(line.split('"')[4].split()[0]) * self.theCount
14  self.theType = line.split('"')[4].split()[2]
15  self.theDensity = float(predefinedMaterials[self.theName][2])
16  self.theX0 = float(predefinedMaterials[self.theName][3]) * self.theDensity
17  self.theL0 = float(predefinedMaterials[self.theName][4]) * self.theDensity
18  self.theMass = self.theVolume * self.theDensity
19 # print "%s\tX0: %.3f\trho: %.3f\tX0': %.3f"%(self.theName, float(predefinedMaterials[self.theName][3]), float(predefinedMaterials[self.theName][2]), self.theX0)
def __init__(self, line, predefinedMaterials)
Definition: twikiExport.py:7
double split
Definition: MVATrainer.cc:139

Member Function Documentation

def twikiExport.Constituent.__str__ (   self)

Member Data Documentation

twikiExport.Constituent.theCount

Definition at line 12 of file twikiExport.py.

Referenced by twikiExport.Constituent.__str__().

twikiExport.Constituent.theDensity

Definition at line 15 of file twikiExport.py.

twikiExport.Constituent.theDescription

Definition at line 10 of file twikiExport.py.

Referenced by twikiExport.Constituent.__str__(), and twikiExport.Material.__str__().

twikiExport.Constituent.theL0

Definition at line 17 of file twikiExport.py.

twikiExport.Constituent.theMass

Definition at line 18 of file twikiExport.py.

Referenced by twikiExport.Constituent.__str__().

twikiExport.Constituent.theName

Definition at line 11 of file twikiExport.py.

Referenced by twikiExport.Constituent.__str__(), and twikiExport.Material.__str__().

twikiExport.Constituent.theType

Definition at line 14 of file twikiExport.py.

Referenced by twikiExport.Constituent.__str__().

twikiExport.Constituent.theVolume

Definition at line 13 of file twikiExport.py.

twikiExport.Constituent.theX0

Definition at line 16 of file twikiExport.py.