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

List of all members.

Public Member Functions

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

Public Attributes

 statsSvc
 coordSvc
 simTree
 count
 pdgidMuon
 Unobserved Statistics.
 tMuon
 xMuon
 yMuon
 zMuon
 eMuon
 pMuon
 keMuon
 vxMuon
 vyMuon
 vzMuon
 gdMuon
 lsMuon
 avMuon
 oilMuon
 MuonInOws
 MuonInIws
 MuonInLs
 MuonInGdls
 MuonInOil
 MuonInAv
 MuonStop
 NeutronInOws
 NeutronInIws
 NeutronInLs
 NeutronInGdls
 NeutronInOil
 NeutronInAv
 NeutronStop
 nAdTrksNonMuon
 AD tracks.
 nAdTrks
 nAdMuons
 nAdNeutrons
 maxTrks
 MuonE
 NeutronE
 trkPdgID
 Interesting
 AD vertices.
 nallVtxs
 nAdVtxs
 nAdMuonVtxs
 nAdNeutronVtxs
 maxVtxs
 AdMuonE
 AdNeutronE
 daughMuon
 daughNeutron
 NeutronProcName
 simTime
 Hits Info.
 nSimHits
 nSimIwsHits
 nSimOwsHits
 nSimAd1Hits
 nSimAd2Hits
 nSimAd3Hits
 nSimAd4Hits
 nSimUnknownHits
 nSimIwsPmts
 nSimOwsPmts
 nSimAd1Pmts
 nSimAd2Pmts
 nSimAd3Pmts
 nSimAd4Pmts
 nSimUnknownPmts
 maxSimHits
 simHitPmtId
 simHitTime
 msgSvc
 archiveSvc
 stats
 defaultInputLocation
 execNumber
 currentJobId

Detailed Description

Definition at line 19 of file genTree.py.


Constructor & Destructor Documentation

def genTree::BkgTreeAlg::__init__ (   self,
  name 
)

Definition at line 21 of file genTree.py.

00022                            :
00023         DybPythonAlg.__init__(self,name)
00024         return


Member Function Documentation

def genTree::BkgTreeAlg::initialize (   self)

Definition at line 25 of file genTree.py.

00026                         :
00027         status = DybPythonAlg.initialize(self)
00028         if status.isFailure(): return status
00029         self.info("initializing")
00030 
00031         # Initialize services
00032         #  Statistics Service: Use for histograms, graphs, trees
00033         self.statsSvc = self.svc('IStatisticsSvc','StatisticsSvc')
00034         if self.statsSvc == None:
00035             self.error("Failed to initialize statistics service.")
00036             return FAILURE       
00037 
00038         self.coordSvc = self.svc('ICoordSysSvc','CoordSysSvc')
00039         if not self.coordSvc:
00040             print 'Failed to get CoordSysSvc or StatisticsSvc or CableSvc'
00041             return FAILURE
00042 
00043 
00044         # Make a tree
00045         self.simTree= TTree("simTree","Tree of Simulated Hits")
00046 
00047         # Make branch addresses for single-numbers. 'i'=int, 'd'=double
00048 
00049         self.count=array('i',[0])
00050 
00051         ### Unobserved Statistics
00052         self.pdgidMuon=array('d',[0])
00053         self.tMuon=array('d',[0])
00054         self.xMuon=array('d',[0])
00055         self.yMuon=array('d',[0])
00056         self.zMuon=array('d',[0])
00057         self.eMuon=array('d',[0])
00058         self.pMuon=array('d',[0])
00059         self.keMuon=array('d',[0])
00060         self.vxMuon=array('d',[0])
00061         self.vyMuon=array('d',[0])
00062         self.vzMuon=array('d',[0])
00063         self.gdMuon=array('d',[0])
00064         self.lsMuon=array('d',[0])
00065         self.avMuon=array('d',[0])
00066         self.oilMuon=array('d',[0])
00067         self.MuonInOws=array('d',[0])
00068         self.MuonInIws=array('d',[0])
00069         self.MuonInLs=array('d',[0])
00070         self.MuonInGdls=array('d',[0])
00071         self.MuonInOil=array('d',[0])
00072         self.MuonInAv=array('d',[0])
00073         self.MuonStop=array('d',[0])
00074         self.NeutronInOws=array('d',[0])
00075         self.NeutronInIws=array('d',[0])
00076         self.NeutronInLs=array('d',[0])
00077         self.NeutronInGdls=array('d',[0])
00078         self.NeutronInOil=array('d',[0])
00079         self.NeutronInAv=array('d',[0])
00080         self.NeutronStop=array('d',[0])
00081         
00082         ##AD tracks
00083 
00084         self.nAdTrksNonMuon = array('i',[0])
00085         self.nAdTrks = array('i',[0])
00086         self.nAdMuons = array('i',[0])
00087         self.nAdNeutrons = array('i',[0])
00088 
00089 
00090         self.maxTrks= array('i',[0])
00091         self.maxTrks[0]=10000
00092         self.MuonE = array('d',self.maxTrks[0]*[0])
00093         self.NeutronE = array('d',self.maxTrks[0]*[0])
00094         self.trkPdgID  = array('i',self.maxTrks[0]*[0])
00095 
00096         ##AD vertices
00097         self.Interesting = array('i',[0])
00098         self.nallVtxs = array('i',[0])
00099         self.nAdVtxs = array('i',[0])
00100         self.nAdMuonVtxs = array('i',[0])
00101         self.nAdNeutronVtxs = array('i',[0])
00102 
00103 
00104         self.maxVtxs=array('i',[0])
00105         self.maxVtxs[0]=100000
00106         self.AdMuonE = array('d',self.maxVtxs[0]*[0])
00107         self.AdNeutronE = array('d',self.maxVtxs[0]*[0])
00108         self.daughMuon = array('i',self.maxVtxs[0]*[0])
00109         self.daughNeutron = array('i',self.maxVtxs[0]*[0])
00110         self.NeutronProcName = array('i',self.maxVtxs[0]*[0])
00111 
00112 
00113 
00114         ##Hits Info
00115         
00116         self.simTime = array('d',[0])
00117         self.nSimHits = array('i',[0])
00118         self.nSimIwsHits = array('i',[0])
00119         self.nSimOwsHits = array('i',[0])
00120         self.nSimAd1Hits = array('i',[0])
00121         self.nSimAd2Hits = array('i',[0])
00122         self.nSimAd3Hits = array('i',[0])
00123         self.nSimAd4Hits = array('i',[0])
00124         self.nSimUnknownHits = array('i',[0])
00125         self.nSimIwsPmts = array('i',[0])
00126         self.nSimOwsPmts = array('i',[0])
00127         self.nSimAd1Pmts = array('i',[0])
00128         self.nSimAd2Pmts = array('i',[0])
00129         self.nSimAd3Pmts = array('i',[0])
00130         self.nSimAd4Pmts = array('i',[0])
00131         self.nSimUnknownPmts = array('i',[0])
00132 
00133         # Make branch addresses for array branches
00134         self.maxSimHits = array('i',[0])
00135         self.maxSimHits[0]=100000
00136         self.simHitPmtId = array('i',self.maxSimHits[0]*[0])
00137         self.simHitTime = array('d',self.maxSimHits[0]*[0])
00138 
00139         # Make Branches
00140 
00141         self.simTree.Branch('count',self.count,' count/I')
00142         
00143         self.simTree.Branch('pdgidMuon',self.pdgidMuon,' pdgidMuon/D')
00144         self.simTree.Branch('tMuon',self.tMuon,' tMuon/D')
00145         self.simTree.Branch('xMuon',self.xMuon,' xMuon/D')
00146         self.simTree.Branch('yMuon',self.yMuon,' yMuon/D')
00147         self.simTree.Branch('zMuon',self.zMuon,' zMuon/D')
00148         self.simTree.Branch('eMuon',self.eMuon,' eMuon/D')
00149         self.simTree.Branch('pMuon',self.pMuon,' pMuon/D')
00150         self.simTree.Branch('keMuon',self.keMuon,' keMuon/D')
00151         self.simTree.Branch('vxMuon',self.vxMuon,' vxMuon/D')
00152         self.simTree.Branch('vyMuon',self.vyMuon,' vyMuon/D')
00153         self.simTree.Branch('vzMuon',self.vzMuon,' vzMuon/D')
00154         self.simTree.Branch('gdMuon',self.gdMuon,' gdMuon/D')
00155         self.simTree.Branch('lsMuon',self.lsMuon,' lsMuon/D')
00156         self.simTree.Branch('avMuon',self.avMuon,' avMuon/D')
00157         self.simTree.Branch('oilMuon',self.oilMuon,' oilMuon/D')
00158         self.simTree.Branch('MuonInOws',self.MuonInOws,'MuonInOws/D')
00159         self.simTree.Branch('MuonInIws',self.MuonInIws,' MuonInIws/D')
00160         self.simTree.Branch('MuonInLs',self.MuonInLs,' MuonInLs/D')
00161         self.simTree.Branch('MuonInGdls',self.MuonInGdls,' MuonInGdls/D')
00162         self.simTree.Branch('MuonInOil',self.MuonInOil,' MuonInOil/D')
00163         self.simTree.Branch('MuonInAv',self.MuonInAv,' MuonInAv/D')
00164         self.simTree.Branch('MuonStop',self.MuonStop,' MuonStop/D')
00165         self.simTree.Branch('NeutronInOws',self.NeutronInOws,' NeutronInOws/D')
00166         self.simTree.Branch('NeutronInIws',self.NeutronInIws,' NeutronInIws/D')
00167         self.simTree.Branch('NeutronInLs',self.NeutronInLs,' NeutronInLs/D')
00168         self.simTree.Branch('NeutronInGdls',self.NeutronInGdls,' NeutronInGdls/D')
00169         self.simTree.Branch('NeutronInOil',self.NeutronInOil,' NeutronInOil/D')
00170         self.simTree.Branch('NeutronInAv',self.NeutronInAv,' NeutronInAv/D')
00171         self.simTree.Branch('NeutronStop',self.NeutronStop,' NeutronStop/D')
00172         
00173 
00174         self.simTree.Branch('nAdTrksNonMuon', self.nAdTrksNonMuon ,'nAdTrksNonMuon/I')
00175         self.simTree.Branch('maxTrks', self.maxTrks ,'maxTrks/I')
00176         self.simTree.Branch('nAdTrks', self.nAdTrks ,'nAdTrks/I')
00177         self.simTree.Branch('nAdMuons', self.nAdMuons ,'nAdMuons/I')
00178         self.simTree.Branch('nAdNeutrons', self.nAdNeutrons ,'nAdNeutrons/I')
00179         self.simTree.Branch('MuonE', self.MuonE ,'MuonE[maxTrks]/D')
00180         self.simTree.Branch('NeutronE', self.NeutronE ,'NeutronE[maxTrks]/D')
00181         self.simTree.Branch('trkPdgID ', self.trkPdgID ,'trkPdgID[maxTrks]/I')
00182 
00183         self.simTree.Branch('Interesting', self.Interesting ,'Interesting/I')
00184         self.simTree.Branch('nallVtxs', self.nallVtxs ,'nallVtxs/I')
00185         self.simTree.Branch('maxVtxs', self.maxVtxs ,'maxVtxs/I')
00186         self.simTree.Branch('nAdVtxs', self.nAdVtxs ,'nAdVtxs/I')
00187         self.simTree.Branch('nAdMuonVtxs', self.nAdMuonVtxs ,'nAdMuonVtxs/I')
00188         self.simTree.Branch('nAdNeutronVtxs', self.nAdNeutronVtxs ,'nAdNeutronVtxs/I')
00189         self.simTree.Branch('AdMuonE', self.AdMuonE ,'AdMuonE[nAdVtxs]/D')
00190         self.simTree.Branch('AdNeutronE', self.AdNeutronE ,'AdNeutronE[maxVtxs]/D')
00191         self.simTree.Branch('daughMuon', self.daughMuon ,'daughMuon[maxVtxs]/I')
00192         self.simTree.Branch('daughNeutron', self.daughNeutron ,'daughNeutron[maxVtxs]/I')
00193         self.simTree.Branch('NeutronProcName', self.NeutronProcName ,'NeutronProcName[maxVtxs]/I')
00194 
00195 
00196 
00197         self.simTree.Branch('simTime',self.simTime,'simTimeSec/D')
00198         self.simTree.Branch('maxSimHits',self.maxSimHits,'maxSimHits/I')
00199         self.simTree.Branch('nSimHits',self.nSimHits,'nSimHits/I')
00200         self.simTree.Branch('nSimIwsHits',self.nSimIwsHits,'nSimIwsHits/I')
00201         self.simTree.Branch('nSimOwsHits',self.nSimOwsHits,'nSimOwsHits/I')
00202         self.simTree.Branch('nSimAd1Hits',self.nSimAd1Hits,'nSimAd1Hits/I')
00203         self.simTree.Branch('nSimAd2Hits',self.nSimAd2Hits,'nSimAd2Hits/I')
00204         self.simTree.Branch('nSimAd3Hits',self.nSimAd3Hits,'nSimAd3Hits/I')
00205         self.simTree.Branch('nSimAd4Hits',self.nSimAd4Hits,'nSimAd4Hits/I')
00206         self.simTree.Branch('nSimUnknownHits',self.nSimUnknownHits,'nSimUnknownHits/I')
00207         self.simTree.Branch('nSimIwsPmts',self.nSimIwsPmts,'nSimIwsPmts/I')
00208         self.simTree.Branch('nSimOwsPmts',self.nSimOwsPmts,'nSimOwsPmts/I')
00209         self.simTree.Branch('nSimAd1Pmts',self.nSimAd1Pmts,'nSimAd1Pmts/I')
00210         self.simTree.Branch('nSimAd2Pmts',self.nSimAd2Pmts,'nSimAd2Pmts/I')
00211         self.simTree.Branch('nSimAd3Pmts',self.nSimAd3Pmts,'nSimAd3Pmts/I')
00212         self.simTree.Branch('nSimAd4Pmts',self.nSimAd4Pmts,'nSimAd4Pmts/I')
00213         self.simTree.Branch('nSimUnknownPmts',self.nSimUnknownPmts,'nSimUnknownPmts/I')
00214         self.simTree.Branch('simHitPmtId',self.simHitPmtId,
00215                             'simHitPmtId[maxSimHits]/I')
00216         self.simTree.Branch('simHitTime',self.simHitTime,
00217                             'simHitTime[maxSimHits]/D')
00218 
00219         status = self.statsSvc.put('/file0/sim/simTree', self.simTree)
00220         if status.isFailure(): return status
00221 
00222         return SUCCESS

def genTree::BkgTreeAlg::execute (   self)

Definition at line 223 of file genTree.py.

00224                      :
00225         self.info("executing")
00226 
00227         self.count[0] = 1
00228         
00229         evt = self.evtSvc()
00230         hdr = evt["/Event/Sim/SimHeader"]
00231         if hdr == None:
00232             self.error("Failed to get current sim header")
00233             return FAILURE
00234 
00235         shhis=hdr.particleHistory()
00236         
00237 
00238         
00239         shunob=hdr.unobservableStatistics()
00240         unomap=shunob.stats()
00241         for unopair in irange(unomap.begin(),unomap.end()):
00242             unowhat=unopair.first
00243             unocont=unopair.second
00244             if unowhat== "pdgId_Trk1":
00245                 self.pdgidMuon[0]=unocont.sum()
00246             if unowhat=="t_Trk1":
00247                 self.tMuon[0]=unocont.sum()
00248             if unowhat=="x_Trk1":
00249                 self.xMuon[0]=unocont.sum()/1000
00250             if unowhat== "y_Trk1":
00251                 self.yMuon[0]=unocont.sum()/1000
00252             if unowhat=="z_Trk1":
00253                 self.zMuon[0]=unocont.sum()/1000
00254             if unowhat=="e_Trk1":
00255                 self.eMuon[0]=unocont.sum()/1000
00256             if unowhat=="p_Trk1":
00257                 self.pMuon[0]=unocont.sum()/1000
00258             if unowhat=="vx_Trk1":
00259                 self.vxMuon[0]=unocont.sum()/1000
00260             if unowhat== "vy_Trk1":
00261                 self.vyMuon[0]=unocont.sum()/1000
00262             if unowhat=="vz_Trk1":
00263                 self.vzMuon[0]=unocont.sum()/1000
00264             if unowhat=="ke_Trk1":
00265                 self.keMuon[0]=unocont.sum()/1000
00266             if unowhat=="TrkLength_GD_Trk1":
00267                 self.gdMuon[0]=unocont.sum()/1000
00268             if unowhat=="TrkLength_LS_Trk1":
00269                 self.lsMuon[0]=unocont.sum()/1000
00270             if unowhat=="TrkLength_AV_Trk1":
00271                 self.avMuon[0]=unocont.sum()/1000
00272             if unowhat=="TrkLength_Oil_Trk1":
00273                 self.oilMuon[0]=unocont.sum()/1000
00274             if unowhat=="MuonTrkLengthInOws":
00275                 self.MuonInOws[0]=unocont.sum()/1000
00276             if unowhat=="MuonTrkLengthInIws":
00277                 self.MuonInIws[0]=unocont.sum()/1000
00278             if unowhat=="MuonTrkLengthInLS":
00279                 self.MuonInLs[0]=unocont.sum()/1000
00280             if unowhat=="MuonTrkLengthInGdLS":
00281                 self.MuonInGdls[0]=unocont.sum()/1000
00282             if unowhat=="MuonTrkLengthInOil":
00283                 self.MuonInOil[0]=unocont.sum()/1000
00284             if unowhat=="MuonTrkLengthInAV":
00285                 self.MuonInAv[0]=unocont.sum()/1000
00286             if unowhat== "MuonStop":
00287                 self.MuonStop[0]=unocont.sum()
00288             if unowhat=="NeutronTrkLengthInOws":
00289                 self.NeutronInOws[0]=unocont.sum()/1000
00290             if unowhat=="NeutronTrkLengthInIws":
00291                 self.NeutronInIws[0]=unocont.sum()/1000
00292             if unowhat=="NeutronTrkLengthInLS":
00293                 self.NeutronInLs[0]=unocont.sum()/1000
00294             if unowhat=="NeutronTrkLengthInGdLS":
00295                 self.NeutronInGdls[0]=unocont.sum()/1000
00296             if unowhat=="NeutronTrkLengthInOil":
00297                 self.NeutronInOil[0]=unocont.sum()/1000
00298             if unowhat=="NeutronTrkLengthInAV":
00299                 self.NeutronInAv[0]=unocont.sum()/1000
00300             if unowhat=="NeutronStop":
00301                 self.NeutronStop[0]=unocont.sum()
00302 
00303 
00304         print "Iws TrkLeng: ",self.MuonInIws[0],"Ows TrkLeng: ",self.MuonInOws[0]
00305 
00306         ###AD Trk info
00307         realtrksinad=0  ##Number of tracks interesting, not counting the primary muon tracks
00308         trksinad=0
00309         muons=0
00310         neutrons=0
00311 
00312         ###Tracks in the AD
00313         phtk=shhis.trackVector()
00314         trksinad=phtk.size()
00315         print "Number of Trks in AD: ",trksinad
00316         for ind in range(0,trksinad):
00317             tkpdg=phtk[ind].particle()
00318             trkvtx=phtk[ind].vertices()
00319             if ind<self.maxTrks[0]:
00320                 self.trkPdgID[ind] = tkpdg
00321                     
00322             ### muons in the AD, all the muons will be saved as the primary track
00323             if   abs(tkpdg)==13:      
00324                 if trkvtx.size()>0:
00325                     if ind<self.maxTrks[0]:
00326                         self.MuonE[ind] =trkvtx[0].totalEnergy()
00327                 for kk in range(0,trkvtx.size()):
00328                     trkvtxpos=trkvtx[kk].position()
00329                     trkde=self.coordSvc.coordSysDE(trkvtxpos)
00330                     if trkde:
00331                         trkginfo=trkde.geometry()
00332                         if trkginfo:
00333                             #lp=trkginfo.toLocal(trkvtxpos)
00334                             #lpx=lp.x()/1000.
00335                             #lpy=lp.y()/1000.
00336                             #lpz=lp.z()/1000.
00337                             trklv=trkginfo.lvolume()
00338                             if trklv:
00339                                 trkmatname=trklv.materialName()
00340                                 if trkmatname=="/dd/Materials/MineralOil" or trkmatname=="/dd/Materials/GdDopedLS" or trkmatname=="/dd/Materials/LiquidScintillator" or trkmatname=="/dd/Materials/Acrylic":
00341                                     muons=muons+1
00342 
00343             else:
00344                 realtrksinad+=1
00345             ### neutrons in the AD
00346                 if tkpdg==2112:
00347                     neutrons = neutrons+1 
00348                     print 'neutron found in AD'
00349                     if trkvtx.size()>0:
00350                         if ind<self.maxTrks[0]:
00351                             self.NeutronE[ind] =trkvtx[0].totalEnergy()
00352                             print "Get neutronE:", trkvtx[0].totalEnergy()
00353                  
00354         ####if muon hit AD, add the track numbers by 1
00355         if muons>0:
00356             print "Muon Hits AD"
00357             realtrksinad+=1
00358 
00359         self.nAdTrksNonMuon[0] = realtrksinad
00360         self.nAdTrks[0] = trksinad
00361         self.nAdMuons[0] = muons
00362         self.nAdNeutrons[0] = neutrons
00363 
00364 
00365         ############Vertices in AD ##########
00366         Interesting=0
00367         muonvtxs=0
00368         neutronvtxs=0
00369         getmuon=0
00370         getneutron=0
00371 
00372         ##How to judge a stopped muon or neutron?
00373         ####Vertecies recorded, not only in the AD        
00374         phvt=shhis.vertexVector()
00375         vtxsall=phvt.size()
00376         self.nallVtxs[0] = vtxsall
00377         print "Number of Vtxs: ", vtxsall
00378         nvtxs=0
00379         for ind in range(0,vtxsall):
00380             vtxpos=phvt[ind].position()
00381             vtxproctype=phvt[ind].process().type()
00382             vtxproc=phvt[ind].process().name()
00383             vtxe=phvt[ind].totalEnergy()
00384             vtxsec=phvt[ind].secondaries()
00385             de=self.coordSvc.coordSysDE(vtxpos)
00386 #            print "EEEE", vtxpos,vtxsec.size()
00387             if de:
00388                 ginfo=de.geometry()
00389                 if ginfo:
00390                     lv=ginfo.lvolume()
00391                     if lv:
00392                         matname=lv.materialName()
00393                         if matname=="/dd/Materials/MineralOil" or matname=="/dd/Materials/GdDopedLS" or matname=="/dd/Materials/LiquidScintillator" or matname=="/dd/Materials/Acrylic":
00394                             partrk=phvt[ind].track().track().particle()  ##parent track
00395                             #print "HHHHHHH", partrk
00396                             if vtxproc !="Cerenkov":
00397                                 Interesting+=1
00398                                 if abs(partrk)==13:
00399                                     muonvtxs +=1
00400                                     if nvtxs<self.maxVtxs[0]:
00401                                         self.AdMuonE[nvtxs] =vtxe
00402                                 if partrk==2112:
00403                                     neutronvtxs +=1
00404                                     if nvtxs<self.maxVtxs[0]:
00405                                         self.AdNeutronE[nvtxs] =vtxe
00406                                         self.NeutronProcName[nvtxs] = vtxproctype
00407                                         print "Neutron ProcessName: ",vtxproc, " Type: ",vtxproctype
00408                                 #print "haha", matname," ",vtxproc, "" , vtxsec.size(), " ", partrk
00409                                 getneutron=0
00410                                 getmuon=0
00411                                 if vtxsec.size()>0:
00412                                     for pind in range(0,vtxsec.size()):   ## loop over daughters
00413                                         #print "KKK", vtxsec[pind].track().particle()
00414                                         if abs(vtxsec[pind].track().particle())==13:
00415                                             getmuon+=1
00416                                         if abs(vtxsec[pind].track().particle())==2112:
00417                                             getneutron+=1
00418 
00419                                 if nvtxs<self.maxVtxs[0]:            
00420                                     self.daughMuon[nvtxs] = getmuon
00421                                     self.daughNeutron[nvtxs] = getneutron
00422                                 nvtxs +=1
00423 
00424         print "Number of AD vertices: ",nvtxs
00425         self.nAdVtxs[0] = nvtxs
00426         self.Interesting[0] = Interesting
00427         self.nAdMuonVtxs[0] = muonvtxs
00428         self.nAdNeutronVtxs[0] = neutronvtxs
00429 
00430         ###Count the hits in different valume
00431         AD1=0
00432         AD2=0
00433         AD3=0
00434         AD4=0
00435         Iws=0
00436         Ows=0
00437         unknown=0
00438         Ad1Pmt=[]
00439         Ad2Pmt=[]
00440         Ad3Pmt=[]
00441         Ad4Pmt=[]
00442         pmtinn=[]
00443         pmtout=[]
00444         pmtunknown=[]
00445         
00446         #### Hits from Water and AD
00447         shh=hdr.hits()
00448         hitCollectionMap=shh.hitCollection()
00449         hdv = shh.hitDetectors()
00450 
00451         self.simTime[0] = hdr.timeStamp().GetSeconds()
00452         nHits = 0
00453 
00454         for shcPair in irange(hitCollectionMap.begin(),
00455                               hitCollectionMap.end()):
00456             detectorId = shcPair.first
00457             hitCollection = shcPair.second
00458             self.info( "Found %d hits for detector %d"
00459                        % ( hitCollection.collection().size(),
00460                            detectorId )
00461                        )
00462             sdetid=detectorId&0x00FF
00463             ###print "KKKKKK",sdetid
00464             if sdetid==1:
00465                 AD1=hitCollection.collection().size()
00466             elif sdetid==2:
00467                 AD2=hitCollection.collection().size()
00468             elif sdetid==3:
00469                 AD3=hitCollection.collection().size()
00470             elif sdetid==4:
00471                 AD4=hitCollection.collection().size()
00472             elif sdetid==5:
00473                 Iws=hitCollection.collection().size()
00474             elif sdetid==6:
00475                 Ows=hitCollection.collection().size()
00476             else:
00477                 unknown=hitCollection.collection().size();
00478                 print "Unknow Detector", unknown
00479 
00480             for hit in hitCollection.collection():
00481                 pmtid = hit.sensDetId()
00482                 if sdetid==1:
00483                     if pmtid not in Ad1Pmt:
00484                         Ad1Pmt.append(pmtid)
00485                 elif sdetid==2:
00486                     if pmtid not in Ad2Pmt:
00487                         Ad2Pmt.append(pmtid)
00488                 elif sdetid==3:
00489                     if pmtid not in Ad3Pmt:
00490                         Ad3Pmt.append(pmtid)
00491                 elif sdetid==4:
00492                     if pmtid not in Ad4Pmt:
00493                         Ad4Pmt.append(pmtid)
00494                 elif sdetid==5:
00495                     if pmtid not in pmtinn:
00496                         pmtinn.append(pmtid)
00497                 elif sdetid==6:
00498                     if pmtid not in pmtout:
00499                         pmtout.append(pmtid)
00500                 else:
00501                     print "Unknown PmtID: ", pmtid
00502                     if pmtid not in pmtunknown:
00503                         pmtunknown.append(pmtid)
00504                 if nHits<self.maxSimHits[0]:
00505                     self.simHitPmtId[nHits] = pmtid
00506                     self.simHitTime[nHits] = hit.hitTime()
00507                 nHits += 1
00508 
00509 
00510 
00511         self.nSimHits[0] = nHits
00512         self.nSimIwsHits[0] =  Iws
00513         self.nSimOwsHits[0] =  Ows
00514         self.nSimAd1Hits[0] =  AD1
00515         self.nSimAd2Hits[0] =  AD2
00516         self.nSimAd3Hits[0] =  AD3
00517         self.nSimAd4Hits[0] =  AD4
00518         self.nSimUnknownHits[0] =  unknown
00519         self.nSimIwsPmts[0] =  len(pmtinn)
00520         self.nSimOwsPmts[0] =  len(pmtout)
00521         self.nSimAd1Pmts[0] =  len(Ad1Pmt)
00522         self.nSimAd2Pmts[0] =  len(Ad2Pmt)
00523         self.nSimAd3Pmts[0] =  len(Ad3Pmt)
00524         self.nSimAd4Pmts[0] =  len(Ad4Pmt)
00525         self.nSimUnknownPmts[0] =  len(pmtunknown)
00526 
00527         print " Inn PMTs: ",len(pmtinn)," Out PMTs:",len(pmtout)
00528 
00529 
00530         # Fill the tree with current branch values
00531         self.simTree.Fill()
00532 
00533         return SUCCESS
       
StatusCode DetSimVali::finalize (   self)

Definition at line 534 of file genTree.py.

00535                       :
00536         self.info("finalizing")
00537 
00538         #self.MuonE = 0
00539         #self.NeutronE = 0
00540         #self.trkPdgID  = 0
00541         #self.AdMuonE = 0
00542         #self.AdNeutronE = 0
00543         #self.daughMuon = 0
00544         #self.daughNeutron = 0
00545         #self.NeutronProcName = 0
00546         #self.simHitPmtId = 0
00547         #self.simHitTime = 0
00548 
00549         status = DybPythonAlg.finalize(self)
00550         return status
00551 


Member Data Documentation

Definition at line 25 of file genTree.py.

Definition at line 25 of file genTree.py.

Definition at line 25 of file genTree.py.

Definition at line 25 of file genTree.py.

Unobserved Statistics.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

Definition at line 26 of file genTree.py.

AD tracks.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

Definition at line 27 of file genTree.py.

AD vertices.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Definition at line 28 of file genTree.py.

Hits Info.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.py.

Definition at line 29 of file genTree.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:19:12 for DetSimValidation by doxygen 1.7.4