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

In This Package:

Classes | Public Member Functions | Public Attributes
GenDecay::Histogram::DecayEnergy Class Reference
Inheritance diagram for GenDecay::Histogram::DecayEnergy:
Inheritance graph
[legend]
Collaboration diagram for GenDecay::Histogram::DecayEnergy:
Collaboration graph
[legend]

List of all members.

Classes

class  ParentHist

Public Member Functions

def __init__
def initialize
def execute
def finalize
def __init__
def initialize
def finalize
def __setitem__
def __getitem__
def execute
def verbose
def debug
def info
def warning
def error
def fatal
def getAES
def initializeHeader
def finalizeHeader

Public Attributes

 dk_type
 parentHist
 lastRefTime
 default_path
 data
 statsSvc
 msgSvc
 archiveSvc
 stats
 defaultInputLocation
 execNumber
 currentJobId

Detailed Description

Histogram radioactive decays by parent

Definition at line 100 of file Histogram.py.


Constructor & Destructor Documentation

def GenDecay::Histogram::DecayEnergy::__init__ (   self,
  name,
  dk_type 
)

Reimplemented from GenDecay::Histogram::MyPythonAlg.

Definition at line 148 of file Histogram.py.

00149                                    :
00150         MyPythonAlg.__init__(self,name,'/file1/%s/%s'%(name,dk_type))
00151         self.dk_type = dk_type
00152         self.parentHist = {}    # map pdgid to ParentHist
00153         self.lastRefTime = 0.0
00154         return


Member Function Documentation

StatusCode GtDecayerator::initialize (   self)

Reimplemented from GenDecay::Histogram::MyPythonAlg.

Definition at line 155 of file Histogram.py.

00156                         :
00157         status = MyPythonAlg.initialize(self)
00158         if status.isFailure(): return status
00159         self.info("initializing")
00160         self['ngamma'] = TH1F("ngamma","Number of Gammas",100,0,100)
00161         self['necap'] = TH1F("necap","Number of Electron Captures",100,0,100)
00162         self['alphabeta'] = TH1F("alphabeta","Alpha(<0) or Beta(>0)",2,-1,1)
00163         self['Ealpha'] = TH1F("Ealpha","Alpha kinetic energy (MeV)",2000,0,10)
00164         self['Ebeta'] = TH1F("Ebeta","Beta kinetic energy (MeV)",2000,0,10)
00165         self['Egamma'] = TH1F("Egamma","Gamma kinetic energy (MeV)",2000,0,10)
00166         self['Ecap'] = TH1F("Ecap","Energy from electron capture (MeV)",2000,0,10)
00167         self['deltaT'] = TH1F("deltaT","Time between parents (sec)",1000,0,100)
00168         '''
00169         histograms to add:  
00170 
00171         * parent nuclide specie
00172         * per parent alpha, beta & gamma spectra
00173         * time between parents
00174         * per parent time from parent to alpha, beta, gamma
00175 
00176         code to add:
00177 
00178         * GenEvent should hold daughter nuclides, take care with
00179           corelated decays, save only last daughter.
00180 
00181         '''
00182         return status

def GenDecay::Histogram::DecayEnergy::execute (   self)

Definition at line 183 of file Histogram.py.

00184                      :
00185         evt = self.evtSvc()
00186         path = "/Event/Gen/GenHeader"
00187         hdr = evt[path]
00188 
00189         refTimestamp = hdr.timeStamp()
00190         refSeconds = refTimestamp.GetSeconds()
00191         #print 'refSeconds=',refSeconds,'self.lastRefTme',self.lastRefTime
00192         deltaRefSeconds = refSeconds - self.lastRefTime
00193         self.lastRefTime = refSeconds
00194 
00195         event = hdr.event()
00196         if event is None:
00197             error('Failed to get %s'%path)
00198             return FAILURE
00199 
00200 
00201         sigvtx = event.signal_process_vertex()
00202         if sigvtx is None: 
00203             error('No signal vertex')
00204             return FAILURE
00205 
00206         if sigvtx.particles_in_size() == 0:
00207             error('No input particles in signal process vertex')
00208             return FAILURE
00209 
00210         parent = sigvtx.particles_in_const_begin().__deref__()
00211         if parent is None:
00212             fatal('Unable to deref iterator')
00213             return FAILURE
00214 
00215         parent_pos = sigvtx.position()
00216         thisRelSeconds = parent_pos.t()/units.second
00217 
00218         # to fix: get times consistent between More and Gaudi side of things.
00219 
00220         dT = deltaRefSeconds + thisRelSeconds
00221         #print 'dT=',dT,'(sec) deltaRefSeconds=',deltaRefSeconds,'thisRelSeconds=',thisRelSeconds,'refSeconds=',refSeconds,'self.lastRefTime=',self.lastRefTime
00222         if dT <= 0.0: logT = 0.0
00223         else: logT = math.log10(dT)
00224         self['deltaT'].Fill(logT)
00225 
00226         try:
00227             parentHist = self.parentHist[parent.pdg_id()]
00228         except KeyError:
00229             parentHist = DecayEnergy.ParentHist(parent,self)
00230             self.parentHist[parent.pdg_id()] = parentHist
00231             pass            
00232 
00233         #parentName = pdgid2name(parent.pdg_id())
00234 
00235         ndecay = 0
00236         ngamma = 0
00237         necap = 0
00238         nvertex = 0
00239         #print "%s has %d vertices:" % (parentName, event.vertices_size())
00240         for vertex in irange(event.vertices_begin(),
00241                              event.vertices_end()):
00242 
00243             nvertex += 1
00244 
00245             pos = vertex.position()
00246             # print "vertex position = (%f, %f, %f, %e s) %d particles:"%\
00247             #        (pos.x(), pos.y(), pos.z(), pos.t()/units.second, vertex.particles_out_size())
00248 
00249             deltaT = pos.t()/units.ns
00250 
00251             for particle in irange(vertex.particles_out_const_begin(),
00252                                    vertex.particles_out_const_end()):
00253                 id = particle.pdg_id()
00254                 mom = particle.momentum()
00255                 mass = particle.generated_mass()
00256                 # print "\t%s 4 momentum = (%f, %f, %f, %f)"%(pdgid2name(id), mom.px(), mom.py(), mom.pz(), mom.e())
00257                 
00258                 ndecay += 1
00259 
00260                 ke = (mom.e()-mass)/units.MeV
00261                 # Alphas
00262                 if id == 1000020040: 
00263                     self['Ealpha'].Fill(ke)
00264                     parentHist.Ealpha.Fill(ke)
00265                     parentHist.Talpha.Fill(deltaT)
00266                     self['alphabeta'].Fill(-0.5)
00267                     #if ke > 7.0:
00268                     #    print "BIG ALPHA"
00269                     pass
00270                 # Betas
00271                 if id == 11 or id == -11: 
00272                     self['Ebeta'].Fill(ke)
00273                     parentHist.Ebeta.Fill(ke)
00274                     parentHist.Tbeta.Fill(deltaT)
00275                     self['alphabeta'].Fill(+0.5)
00276                     pass
00277                 # Gammas
00278                 if id == 22: 
00279                     self['Egamma'].Fill(ke)
00280                     parentHist.Egamma.Fill(ke)
00281                     parentHist.Tgamma.Fill(deltaT)
00282                     ngamma += 1
00283                     pass
00284                 # EleCapture
00285                 if id == 0:
00286                     self['Ecap'].Fill(ke)
00287                     parentHist.Ecap.Fill(ke)
00288                     parentHist.Tecap.Fill(deltaT)
00289                     necap += 1
00290                     pass
00291                 continue
00292             continue
00293         #print ngamma,'gammas'
00294         self['ngamma'].Fill(ngamma)
00295         self['necap'].Fill(necap)
00296         parentHist.nDecay.Fill(ndecay)
00297         parentHist.nVertex.Fill(nvertex)
00298 
00299         return SUCCESS

StatusCode GtDecayerator::finalize (   self)

Reimplemented from GenDecay::Histogram::MyPythonAlg.

Definition at line 300 of file Histogram.py.

00301                       :
00302         return MyPythonAlg.finalize(self)

def GenDecay::Histogram::MyPythonAlg::__setitem__ (   self,
  key,
  value 
) [inherited]

Definition at line 42 of file Histogram.py.

00043                                    :
00044         #self.info('MyPthonAlg.__setitem__(%s,%s)'%(key,value))
00045         key = self._key2path(key)
00046         if self.data.has_key(key):
00047             raise KeyError, 'key "%s" already set'%key
00048         self.statsSvc.put(key,value)
00049         self.data[key] = value
00050         return

def GenDecay::Histogram::MyPythonAlg::__getitem__ (   self,
  key 
) [inherited]

Definition at line 51 of file Histogram.py.

00052                              :
00053         return self.data[self._key2path(key)]


Member Data Documentation

Definition at line 148 of file Histogram.py.

Definition at line 148 of file Histogram.py.

Definition at line 148 of file Histogram.py.

Definition at line 18 of file Histogram.py.

Definition at line 18 of file Histogram.py.

Definition at line 25 of file Histogram.py.


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

Generated on Fri May 16 2014 10:21:06 for GenDecay by doxygen 1.7.4