/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
PrintPMTMap::PrintPMTMap Class Reference
Inheritance diagram for PrintPMTMap::PrintPMTMap:
Inheritance graph
[legend]
Collaboration diagram for PrintPMTMap::PrintPMTMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def printPoolPMTMap
def printAdPMTMap
def execute
def finalize

Public Attributes

 pmtCount
 site
 detector
 timestamp
 detId_dict
 siteId_dict
 siteId
 detId
 t

Detailed Description

Definition at line 22 of file PrintPMTMap.py.


Constructor & Destructor Documentation

def PrintPMTMap::PrintPMTMap::__init__ (   self,
  name 
)

Definition at line 24 of file PrintPMTMap.py.

00025                             :
00026         DybPythonAlg.__init__(self, name)
00027         self.pmtCount = 0
00028         self.site = 'dayabay'
00029         self.detector = 'iws'
00030         self.timestamp = ''
00031         self.detId_dict = {
00032             'ad1' : DetectorId.kAD1,
00033             'ad2' : DetectorId.kAD2,
00034             'ad3' : DetectorId.kAD3,
00035             'ad4' : DetectorId.kAD4,
00036             'iws' : DetectorId.kIWS,
00037             'ows' : DetectorId.kOWS,
00038         }
00039         self.siteId_dict = {
00040             'dayabay' : Site.kDayaBay,
00041             'lingao' : Site.kLingAo,
00042             'far' : Site.kFar,
00043         }
    

Member Function Documentation

def PrintPMTMap::PrintPMTMap::initialize (   self)

Definition at line 48 of file PrintPMTMap.py.

00049                         :
00050         try:
00051             self.siteId = self.siteId_dict[self.site]
00052             self.detId = self.detId_dict[self.detector]
00053         except IndexError:
00054             self.error("Site:Detector not found: %s:%s" % (self.site, self.detector))
00055             return FAILURE
00056         
00057         if not self.timestamp:
00058             import time
00059             self.t = TimeStamp(time.time()) # now
00060         else:
00061             year, month, day = self.timestamp.split(':')
00062             self.t = TimeStamp(int(year), int(month), int(day), 0, 0, 0)
00063                         
00064         if (self.detId in (DetectorId.kIWS, DetectorId.kOWS)):
00065             self.printPoolPMTMap()                                        
00066         else:
00067             self.printAdPMTMap()
00068         return SUCCESS
        
def PrintPMTMap::PrintPMTMap::printPoolPMTMap (   self)

Definition at line 70 of file PrintPMTMap.py.

00071                              :
00072         Gaudi = PyCintex.makeNamespace('Gaudi')
00073         simFlag = SimFlag.kData
00074         context = Context(self.siteId, simFlag, self.t, self.detId)
00075         svcMode = ServiceMode(context, 0)
00076         
00077         de_dict = {
00078             'dayabay' : '/dd/Structure/Pool/db-ows',
00079             'lingao' : '/dd/Structure/Pool/la-ows',
00080             'far' : '/dd/Structure/Pool/far-ows',
00081         }  # center is center of ows
00082         de = self.getDet(de_dict[self.site]) 
00083         
00084         print "# id detector wall spot inward-facing board connector x[mm] y[mm] z[mm]"
00085         
00086         for pmtId in self.cableSvc.poolPmtSensors(svcMode):
00087             if pmtId.bogus(): continue
00088             channelId = self.cableSvc.feeChannelId(pmtId, svcMode)
00089             pmtGeomInfo = self.pmtGeomSvc.get(pmtId.fullPackedData())
00090             if (pmtGeomInfo):
00091                 globalVector = pmtGeomInfo.globalPosition()
00092                 globalXYZ = Gaudi.XYZPoint(globalVector.x(), globalVector.y(), globalVector.z())
00093                 localXYZ = de.geometry().toLocal(globalXYZ)
00094                 
00095                 print "%s %4d %4d %4d %4d %4d %10.1f %10.1f %10.1f" % (pmtId.asString(), 
00096                     pmtId.wallNumber(), pmtId.wallSpot(), pmtId.inwardFacing(), 
00097                     channelId.board(), channelId.connector(),
00098                     localXYZ.x(), localXYZ.y(), localXYZ.z())
00099                 self.pmtCount += 1
00100 
00101         # the other way around:
00102         # 
00103         # chanId = FeeChannelId(board, connector, self.siteId, self.detId)
00104         # pmtId = self.cableSvc.poolPmtSensor(chanId, svcMode)
00105 

def PrintPMTMap::PrintPMTMap::printAdPMTMap (   self)

Definition at line 107 of file PrintPMTMap.py.

00108                            :
00109         Gaudi = PyCintex.makeNamespace('Gaudi')
00110         simFlag = SimFlag.kData
00111         context = Context(self.siteId, simFlag, self.t, self.detId)
00112         svcMode = ServiceMode(context, 0)
00113         
00114         de_dict = {
00115             'dayabay' : '/dd/Structure/AD/db-'+self.detector.replace('ad', 'sst'),
00116             'lingao' : '/dd/Structure/AD/la-'+self.detector.replace('ad', 'sst'),
00117             'far' : '/dd/Structure/AD/far-'+self.detector.replace('ad', 'sst'),
00118         } # center is the center of sst
00119         de = self.getDet(de_dict[self.site]) 
00120                 
00121         print "# id detector ring column board connector x[mm] y[mm] z[mm]"
00122         
00123         for pmtId in self.cableSvc.adPmtSensors(svcMode):
00124             if pmtId.bogus(): continue
00125             channelId = self.cableSvc.feeChannelId(pmtId, svcMode)
00126             pmtGeomInfo = self.pmtGeomSvc.get(pmtId.fullPackedData())
00127             if (pmtGeomInfo):
00128                 globalVector = pmtGeomInfo.globalPosition()
00129                 globalXYZ = Gaudi.XYZPoint(globalVector.x(), globalVector.y(), globalVector.z())
00130                 localXYZ = de.geometry().toLocal(globalXYZ)
00131                 
00132                 print "%s %4d %4d %4d %4d %10.1f %10.1f %10.1f" % (pmtId.asString(), 
00133                     pmtId.ring(), pmtId.column(),
00134                     channelId.board(), channelId.connector(),
00135                     localXYZ.x(), localXYZ.y(), localXYZ.z())
00136                 self.pmtCount += 1                      
                    
def PrintPMTMap::PrintPMTMap::execute (   self)

Definition at line 138 of file PrintPMTMap.py.

00139                      :
00140         self.info("bogus execution")
00141         return SUCCESS
        
def PrintPMTMap::PrintPMTMap::finalize (   self)

Definition at line 144 of file PrintPMTMap.py.

00145                       :
00146         self.info("%s %s: Total PMT Count: %d" % (self.site.title(), self.detector.title(), self.pmtCount))
00147         return SUCCESS
00148 


Member Data Documentation

Definition at line 24 of file PrintPMTMap.py.

Definition at line 24 of file PrintPMTMap.py.

Definition at line 24 of file PrintPMTMap.py.

Definition at line 24 of file PrintPMTMap.py.

Definition at line 24 of file PrintPMTMap.py.

Definition at line 24 of file PrintPMTMap.py.

Definition at line 48 of file PrintPMTMap.py.

Definition at line 48 of file PrintPMTMap.py.

Definition at line 48 of file PrintPMTMap.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:54:33 for Quickstart by doxygen 1.7.4