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

In This Package:

IBD.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 '''
00003   Configure background generators 
00004 
00005   Examples for how to use.
00006   For Fifteen package usage:
00007 
00008     from SourceRate.IBD import dyb_ibd_lso
00009     ibd_lso =dyb_ibd_lso()
00010 
00011     from Gnrtr.GnrtrConf import Gnrtr
00012     gnrtrIBDlso = Gnrtr("gnrtrIBDlso");
00013     gnrtrIBDlso.GenTools = ibd_lso.tools()
00014     gnrtrIBDlso.ThisStageName = "Kinematic"
00015     gnrtrIBDlso.TimeStamp = int(wallTime)
00016     stageCfg.KinematicSequence.Members.append(gnrtrIBDlso)
00017 
00018   For Single usage:
00019 
00020     from SourceRate.IBD import dyb_ibd_lso
00021     ibd_lso=dyb_ibd_lso()
00022 
00023     import GenTools
00024     gtc = GenTools.Configure(genname="IBD_lso")
00025     gtc.generator.TimeStamp = int(wallTime)
00026     gtc.register(ibd_lso)
00027 
00028 '''
00029 from GaudiKernel import SystemOfUnits as units
00030 
00031 class EvtGenerator:
00032     '''
00033     set up the kinematic generator in the given volume with chosen options
00034     using the InvBetaDecay generator.
00035     '''
00036 
00037     def __init__(self,
00038                  name="IBD",
00039                  seed = 99999,
00040                  finalstate = 'FullIbd',
00041                  volume='/dd/Structure/AD/db-gds1',
00042                  material = 'GdDopedLS',
00043                  strategy = 'FullVolume',
00044                  mode = 'Uniform',
00045                  lifetime = 9*units.second):
00046 
00047         print name+"'s strategy is: ", strategy
00048         print name+"'s seed is: ignored"
00049         print name+"'s volume is: ", volume
00050         print name+"'s Material is: ", material
00051         
00052         # set up each tools
00053         from GaudiKernel import SystemOfUnits as units
00054         from InvBetaDecay.Helpers import Decay
00055         
00056         decay=Decay(name)
00057         if finalstate == 'PositronOnly':
00058             decay.decay.PositronOnly = 1
00059         elif finalstate == 'NeutronOnly':
00060             decay.decay.NeutronOnly = 1
00061         decay.positioner.Volume = volume
00062         decay.positioner.Strategy = strategy
00063         if decay.positioner.Strategy == 'Material':
00064             decay.positioner.FillMaterials = [material]
00065         decay.positioner.Mode = mode
00066         decay.positioner.Position = [0,0,0]
00067         decay.positioner.Spread = 10*units.m
00068         decay.timerator.LifeTime = lifetime
00069         decay.transformer.Volume = volume
00070         
00071         self.ibd = decay
00072 
00073     def tools(self):
00074         return self.ibd.tools()
00075     
00076     pass
00077 
00078     
00079 #The following rates are based on daya bay site
00080 class dyb_ibd_oil:
00081     ''' IBD in oil '''
00082 
00083     def __init__(self,
00084                  seed=99999):    
00085 
00086         ibd = EvtGenerator(name     = 'IBD_oil',
00087                            seed     = seed,
00088                            volume   = '/dd/Structure/AD/db-oil1',
00089                            strategy = 'AvoidDaughters',
00090                            #strategy = 'Material',
00091                            material = 'MineralOil',
00092                            mode     = 'Uniform',
00093                            lifetime = 36.3*units.second #daya bay site
00094                           )
00095         
00096         self.ibd = ibd
00097 
00098     def tools(self):
00099         return self.ibd.tools()
00100     
00101     pass
00102 
00103 class dyb_ibd_gds:
00104     ''' IBD in gds '''
00105 
00106     def __init__(self,
00107                  seed=99999):    
00108 
00109         ibd = EvtGenerator(name     = 'IBD_gds',
00110                            seed     = seed,
00111                            volume   = '/dd/Structure/AD/db-oil1',
00112                            strategy = 'Material',
00113                            material = 'GdDopedLS',
00114                            mode     = 'Uniform',
00115                            lifetime = 78.4*units.second, #daya bay site
00116                            )
00117         
00118         self.ibd = ibd
00119 
00120     def tools(self):
00121         return self.ibd.tools()
00122     
00123     pass
00124 
00125 class dyb_ibd_lso:
00126     ''' IBD in lso '''
00127 
00128     def __init__(self,
00129                  seed=99999):    
00130 
00131         ibd = EvtGenerator(name     = 'IBD_lso',
00132                            seed     = seed,
00133                            volume   = '/dd/Structure/AD/db-oil1',
00134                            strategy = 'Material',
00135                            material = 'LiquidScintillator',
00136                            mode     = 'Uniform',
00137                            lifetime = 73.0*units.second #daya bay site
00138                            )
00139         
00140         self.ibd = ibd
00141 
00142     def tools(self):
00143         return self.ibd.tools()
00144     
00145     pass
00146 
00147 class dyb_ibd_acrylic:
00148     ''' IBD in acrylic '''
00149 
00150     def __init__(self,
00151                  seed=99999):    
00152 
00153         ibd = EvtGenerator(name     = 'IBD_acrylic',
00154                            seed     = seed,
00155                            volume   = '/dd/Structure/AD/db-oil1',
00156                            strategy = 'Material',
00157                            material = 'Acrylic',
00158                            mode     = 'Uniform',
00159                            lifetime = 901.6*units.second #daya bay site
00160                            )
00161         
00162         self.ibd = ibd
00163 
00164     def tools(self):
00165         return self.ibd.tools()
00166     
00167     pass
00168 
00169 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:54:48 for SourceRate by doxygen 1.7.4