/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
MakeHistograms::TemplateAlg Class Reference
Inheritance diagram for MakeHistograms::TemplateAlg:
Inheritance graph
[legend]
Collaboration diagram for MakeHistograms::TemplateAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 some_option
 isFirstEvent

Detailed Description

Definition at line 24 of file MakeHistograms.py.


Constructor & Destructor Documentation

def MakeHistograms::TemplateAlg::__init__ (   self,
  name 
)

Definition at line 26 of file MakeHistograms.py.

00027                            :
00028         DybPythonAlg.__init__(self,name)
00029         self.some_option = None
00030         return


Member Function Documentation

def MakeHistograms::TemplateAlg::initialize (   self)

Definition at line 31 of file MakeHistograms.py.

00032                         :
00033         status = DybPythonAlg.initialize(self)
00034         if status.isFailure(): return status
00035         self.info("initializing")
00036         
00037         ADs = {1:[1,2], 2:[1,2], 3:[1,2,3,4]}
00038         for EH in [1,2,3]:
00039             for AD in ADs[EH]:
00040                 self.stats['file0/ESCalib/EH%d/AD%d/PESum' % (EH, AD)] = TH1D(
00041                         'PESum', 'PESum', 200, 0, 2000)
00042                 self.stats['file0/ESCalib/EH%d/AD%d/PESumBkg' % (EH, AD)] = TH1D(
00043                         'PESumBkg', 'PESumBkg', 200, 0, 2000)
00044         self.isFirstEvent = True
00045         return SUCCESS

def MakeHistograms::TemplateAlg::execute (   self)

Definition at line 46 of file MakeHistograms.py.

00047                      :
00048         #self.info("executing")
00049 
00050         evt = self.evtSvc()
00051 
00052         calibStats = evt["/Event/Data/CalibStats"] 
00053         if not calibStats:
00054             #self.error("Failed to get CalibStats")
00055             return SUCCESS
00056 
00057         detId = calibStats.context().GetDetId()
00058         siteId = calibStats.context().GetSite()
00059 
00060         if siteId == 4:
00061             hall = 3
00062         else:
00063             hall = siteId
00064 
00065         if self.isFirstEvent:
00066             timestamp = calibStats.context().GetTimeStamp()
00067             self.stats['file0/ESCalib/TimeStampSec'] = TParameter("int")(
00068                     "TimeStampSec", timestamp.GetSec())
00069             self.stats['file0/ESCalib/TimeStampNanoSec'] = TParameter("int")(
00070                     "TimeStampNanoSec", timestamp.GetNanoSec())
00071             self.isFirstEvent = False
00072 
00073         if hall >= 1 and hall <= 3 and detId >= 1 and detId <= 4:
00074             charge = calibStats.get("NominalCharge").value()
00075             # correction for dead PMT
00076             corr = 192.0 / calibStats.get('nActivePMTs').value()
00077 
00078             suffix = None
00079             if evt['/Event/UserTag/SpNeutron']:
00080                 suffix = ''
00081             elif evt['/Event/UserTag/SpNeutronBkg']:
00082                 suffix = 'Bkg'
00083 
00084             if suffix is not None:
00085                 self.stats['file0/ESCalib/EH%d/AD%d/PESum%s' %
00086                         (hall, detId, suffix)].Fill(charge*corr)
00087 
00088         return SUCCESS
        
def MakeHistograms::TemplateAlg::finalize (   self)

Definition at line 89 of file MakeHistograms.py.

00090                       :
00091         self.info("finalizing")
00092         status = DybPythonAlg.finalize(self)
00093         return status


Member Data Documentation

Definition at line 26 of file MakeHistograms.py.

Definition at line 31 of file MakeHistograms.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:55:35 for ESCalibSPN by doxygen 1.7.4