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 |
Public Attributes | |
statsSvc | |
coordSvc | |
simTree | |
count | |
pdgidMuon | |
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 |
Definition at line 19 of file genTree.py.
def genTree::BkgTreeAlg::__init__ | ( | self, | ||
name | ||||
) |
Definition at line 21 of file genTree.py.
00021 : 00022 DybPythonAlg.__init__(self,name) 00023 return 00024 def initialize(self):
def genTree::BkgTreeAlg::initialize | ( | self | ) |
Definition at line 25 of file genTree.py.
00025 : 00026 status = DybPythonAlg.initialize(self) 00027 if status.isFailure(): return status 00028 self.info("initializing") 00029 00030 # Initialize services 00031 # Statistics Service: Use for histograms, graphs, trees 00032 self.statsSvc = self.svc('IStatisticsSvc','StatisticsSvc') 00033 if self.statsSvc == None: 00034 self.error("Failed to initialize statistics service.") 00035 return FAILURE 00036 00037 self.coordSvc = self.svc('ICoordSysSvc','CoordSysSvc') 00038 if not self.coordSvc: 00039 print 'Failed to get CoordSysSvc or StatisticsSvc or CableSvc' 00040 return FAILURE 00041 00042 00043 # Make a tree 00044 self.simTree= TTree("simTree","Tree of Simulated Hits") 00045 00046 # Make branch addresses for single-numbers. 'i'=int, 'd'=double 00047 00048 self.count=array('i',[0]) 00049 00050 ### Unobserved Statistics 00051 self.pdgidMuon=array('d',[0]) 00052 self.tMuon=array('d',[0]) 00053 self.xMuon=array('d',[0]) 00054 self.yMuon=array('d',[0]) 00055 self.zMuon=array('d',[0]) 00056 self.eMuon=array('d',[0]) 00057 self.pMuon=array('d',[0]) 00058 self.keMuon=array('d',[0]) 00059 self.vxMuon=array('d',[0]) 00060 self.vyMuon=array('d',[0]) 00061 self.vzMuon=array('d',[0]) 00062 self.gdMuon=array('d',[0]) 00063 self.lsMuon=array('d',[0]) 00064 self.avMuon=array('d',[0]) 00065 self.oilMuon=array('d',[0]) 00066 self.MuonInOws=array('d',[0]) 00067 self.MuonInIws=array('d',[0]) 00068 self.MuonInLs=array('d',[0]) 00069 self.MuonInGdls=array('d',[0]) 00070 self.MuonInOil=array('d',[0]) 00071 self.MuonInAv=array('d',[0]) 00072 self.MuonStop=array('d',[0]) 00073 self.NeutronInOws=array('d',[0]) 00074 self.NeutronInIws=array('d',[0]) 00075 self.NeutronInLs=array('d',[0]) 00076 self.NeutronInGdls=array('d',[0]) 00077 self.NeutronInOil=array('d',[0]) 00078 self.NeutronInAv=array('d',[0]) 00079 self.NeutronStop=array('d',[0]) 00080 00081 ##AD tracks 00082 00083 self.nAdTrksNonMuon = array('i',[0]) 00084 self.nAdTrks = array('i',[0]) 00085 self.nAdMuons = array('i',[0]) 00086 self.nAdNeutrons = array('i',[0]) 00087 00088 00089 self.maxTrks= array('i',[0]) 00090 self.maxTrks[0]=10000 00091 self.MuonE = array('d',self.maxTrks[0]*[0]) 00092 self.NeutronE = array('d',self.maxTrks[0]*[0]) 00093 self.trkPdgID = array('i',self.maxTrks[0]*[0]) 00094 00095 ##AD vertices 00096 self.Interesting = array('i',[0]) 00097 self.nallVtxs = array('i',[0]) 00098 self.nAdVtxs = array('i',[0]) 00099 self.nAdMuonVtxs = array('i',[0]) 00100 self.nAdNeutronVtxs = array('i',[0]) 00101 00102 00103 self.maxVtxs=array('i',[0]) 00104 self.maxVtxs[0]=100000 00105 self.AdMuonE = array('d',self.maxVtxs[0]*[0]) 00106 self.AdNeutronE = array('d',self.maxVtxs[0]*[0]) 00107 self.daughMuon = array('i',self.maxVtxs[0]*[0]) 00108 self.daughNeutron = array('i',self.maxVtxs[0]*[0]) 00109 self.NeutronProcName = array('i',self.maxVtxs[0]*[0]) 00110 00111 00112 00113 ##Hits Info 00114 00115 self.simTime = array('d',[0]) 00116 self.nSimHits = array('i',[0]) 00117 self.nSimIwsHits = array('i',[0]) 00118 self.nSimOwsHits = array('i',[0]) 00119 self.nSimAd1Hits = array('i',[0]) 00120 self.nSimAd2Hits = array('i',[0]) 00121 self.nSimAd3Hits = array('i',[0]) 00122 self.nSimAd4Hits = array('i',[0]) 00123 self.nSimUnknownHits = array('i',[0]) 00124 self.nSimIwsPmts = array('i',[0]) 00125 self.nSimOwsPmts = array('i',[0]) 00126 self.nSimAd1Pmts = array('i',[0]) 00127 self.nSimAd2Pmts = array('i',[0]) 00128 self.nSimAd3Pmts = array('i',[0]) 00129 self.nSimAd4Pmts = array('i',[0]) 00130 self.nSimUnknownPmts = array('i',[0]) 00131 00132 # Make branch addresses for array branches 00133 self.maxSimHits = array('i',[0]) 00134 self.maxSimHits[0]=100000 00135 self.simHitPmtId = array('i',self.maxSimHits[0]*[0]) 00136 self.simHitTime = array('d',self.maxSimHits[0]*[0]) 00137 00138 # Make Branches 00139 00140 self.simTree.Branch('count',self.count,' count/I') 00141 00142 self.simTree.Branch('pdgidMuon',self.pdgidMuon,' pdgidMuon/D') 00143 self.simTree.Branch('tMuon',self.tMuon,' tMuon/D') 00144 self.simTree.Branch('xMuon',self.xMuon,' xMuon/D') 00145 self.simTree.Branch('yMuon',self.yMuon,' yMuon/D') 00146 self.simTree.Branch('zMuon',self.zMuon,' zMuon/D') 00147 self.simTree.Branch('eMuon',self.eMuon,' eMuon/D') 00148 self.simTree.Branch('pMuon',self.pMuon,' pMuon/D') 00149 self.simTree.Branch('keMuon',self.keMuon,' keMuon/D') 00150 self.simTree.Branch('vxMuon',self.vxMuon,' vxMuon/D') 00151 self.simTree.Branch('vyMuon',self.vyMuon,' vyMuon/D') 00152 self.simTree.Branch('vzMuon',self.vzMuon,' vzMuon/D') 00153 self.simTree.Branch('gdMuon',self.gdMuon,' gdMuon/D') 00154 self.simTree.Branch('lsMuon',self.lsMuon,' lsMuon/D') 00155 self.simTree.Branch('avMuon',self.avMuon,' avMuon/D') 00156 self.simTree.Branch('oilMuon',self.oilMuon,' oilMuon/D') 00157 self.simTree.Branch('MuonInOws',self.MuonInOws,'MuonInOws/D') 00158 self.simTree.Branch('MuonInIws',self.MuonInIws,' MuonInIws/D') 00159 self.simTree.Branch('MuonInLs',self.MuonInLs,' MuonInLs/D') 00160 self.simTree.Branch('MuonInGdls',self.MuonInGdls,' MuonInGdls/D') 00161 self.simTree.Branch('MuonInOil',self.MuonInOil,' MuonInOil/D') 00162 self.simTree.Branch('MuonInAv',self.MuonInAv,' MuonInAv/D') 00163 self.simTree.Branch('MuonStop',self.MuonStop,' MuonStop/D') 00164 self.simTree.Branch('NeutronInOws',self.NeutronInOws,' NeutronInOws/D') 00165 self.simTree.Branch('NeutronInIws',self.NeutronInIws,' NeutronInIws/D') 00166 self.simTree.Branch('NeutronInLs',self.NeutronInLs,' NeutronInLs/D') 00167 self.simTree.Branch('NeutronInGdls',self.NeutronInGdls,' NeutronInGdls/D') 00168 self.simTree.Branch('NeutronInOil',self.NeutronInOil,' NeutronInOil/D') 00169 self.simTree.Branch('NeutronInAv',self.NeutronInAv,' NeutronInAv/D') 00170 self.simTree.Branch('NeutronStop',self.NeutronStop,' NeutronStop/D') 00171 00172 00173 self.simTree.Branch('nAdTrksNonMuon', self.nAdTrksNonMuon ,'nAdTrksNonMuon/I') 00174 self.simTree.Branch('maxTrks', self.maxTrks ,'maxTrks/I') 00175 self.simTree.Branch('nAdTrks', self.nAdTrks ,'nAdTrks/I') 00176 self.simTree.Branch('nAdMuons', self.nAdMuons ,'nAdMuons/I') 00177 self.simTree.Branch('nAdNeutrons', self.nAdNeutrons ,'nAdNeutrons/I') 00178 self.simTree.Branch('MuonE', self.MuonE ,'MuonE[maxTrks]/D') 00179 self.simTree.Branch('NeutronE', self.NeutronE ,'NeutronE[maxTrks]/D') 00180 self.simTree.Branch('trkPdgID ', self.trkPdgID ,'trkPdgID[maxTrks]/I') 00181 00182 self.simTree.Branch('Interesting', self.Interesting ,'Interesting/I') 00183 self.simTree.Branch('nallVtxs', self.nallVtxs ,'nallVtxs/I') 00184 self.simTree.Branch('maxVtxs', self.maxVtxs ,'maxVtxs/I') 00185 self.simTree.Branch('nAdVtxs', self.nAdVtxs ,'nAdVtxs/I') 00186 self.simTree.Branch('nAdMuonVtxs', self.nAdMuonVtxs ,'nAdMuonVtxs/I') 00187 self.simTree.Branch('nAdNeutronVtxs', self.nAdNeutronVtxs ,'nAdNeutronVtxs/I') 00188 self.simTree.Branch('AdMuonE', self.AdMuonE ,'AdMuonE[nAdVtxs]/D') 00189 self.simTree.Branch('AdNeutronE', self.AdNeutronE ,'AdNeutronE[maxVtxs]/D') 00190 self.simTree.Branch('daughMuon', self.daughMuon ,'daughMuon[maxVtxs]/I') 00191 self.simTree.Branch('daughNeutron', self.daughNeutron ,'daughNeutron[maxVtxs]/I') 00192 self.simTree.Branch('NeutronProcName', self.NeutronProcName ,'NeutronProcName[maxVtxs]/I') 00193 00194 00195 00196 self.simTree.Branch('simTime',self.simTime,'simTimeSec/D') 00197 self.simTree.Branch('maxSimHits',self.maxSimHits,'maxSimHits/I') 00198 self.simTree.Branch('nSimHits',self.nSimHits,'nSimHits/I') 00199 self.simTree.Branch('nSimIwsHits',self.nSimIwsHits,'nSimIwsHits/I') 00200 self.simTree.Branch('nSimOwsHits',self.nSimOwsHits,'nSimOwsHits/I') 00201 self.simTree.Branch('nSimAd1Hits',self.nSimAd1Hits,'nSimAd1Hits/I') 00202 self.simTree.Branch('nSimAd2Hits',self.nSimAd2Hits,'nSimAd2Hits/I') 00203 self.simTree.Branch('nSimAd3Hits',self.nSimAd3Hits,'nSimAd3Hits/I') 00204 self.simTree.Branch('nSimAd4Hits',self.nSimAd4Hits,'nSimAd4Hits/I') 00205 self.simTree.Branch('nSimUnknownHits',self.nSimUnknownHits,'nSimUnknownHits/I') 00206 self.simTree.Branch('nSimIwsPmts',self.nSimIwsPmts,'nSimIwsPmts/I') 00207 self.simTree.Branch('nSimOwsPmts',self.nSimOwsPmts,'nSimOwsPmts/I') 00208 self.simTree.Branch('nSimAd1Pmts',self.nSimAd1Pmts,'nSimAd1Pmts/I') 00209 self.simTree.Branch('nSimAd2Pmts',self.nSimAd2Pmts,'nSimAd2Pmts/I') 00210 self.simTree.Branch('nSimAd3Pmts',self.nSimAd3Pmts,'nSimAd3Pmts/I') 00211 self.simTree.Branch('nSimAd4Pmts',self.nSimAd4Pmts,'nSimAd4Pmts/I') 00212 self.simTree.Branch('nSimUnknownPmts',self.nSimUnknownPmts,'nSimUnknownPmts/I') 00213 self.simTree.Branch('simHitPmtId',self.simHitPmtId, 00214 'simHitPmtId[maxSimHits]/I') 00215 self.simTree.Branch('simHitTime',self.simHitTime, 00216 'simHitTime[maxSimHits]/D') 00217 00218 status = self.statsSvc.put('/file0/sim/simTree', self.simTree) 00219 if status.isFailure(): return status 00220 00221 return SUCCESS 00222 def execute(self):
def genTree::BkgTreeAlg::execute | ( | self | ) |
Definition at line 223 of file genTree.py.
00223 : 00224 self.info("executing") 00225 00226 self.count[0] = 1 00227 00228 evt = self.evtSvc() 00229 hdr = evt["/Event/Sim/SimHeader"] 00230 if hdr == None: 00231 self.error("Failed to get current sim header") 00232 return FAILURE 00233 00234 shhis=hdr.particleHistory() 00235 00236 00237 00238 shunob=hdr.unobservableStatistics() 00239 unomap=shunob.stats() 00240 for unopair in irange(unomap.begin(),unomap.end()): 00241 unowhat=unopair.first 00242 unocont=unopair.second 00243 if unowhat== "pdgId_Trk1": 00244 self.pdgidMuon[0]=unocont.sum() 00245 if unowhat=="t_Trk1": 00246 self.tMuon[0]=unocont.sum() 00247 if unowhat=="x_Trk1": 00248 self.xMuon[0]=unocont.sum()/1000 00249 if unowhat== "y_Trk1": 00250 self.yMuon[0]=unocont.sum()/1000 00251 if unowhat=="z_Trk1": 00252 self.zMuon[0]=unocont.sum()/1000 00253 if unowhat=="e_Trk1": 00254 self.eMuon[0]=unocont.sum()/1000 00255 if unowhat=="p_Trk1": 00256 self.pMuon[0]=unocont.sum()/1000 00257 if unowhat=="vx_Trk1": 00258 self.vxMuon[0]=unocont.sum()/1000 00259 if unowhat== "vy_Trk1": 00260 self.vyMuon[0]=unocont.sum()/1000 00261 if unowhat=="vz_Trk1": 00262 self.vzMuon[0]=unocont.sum()/1000 00263 if unowhat=="ke_Trk1": 00264 self.keMuon[0]=unocont.sum()/1000 00265 if unowhat=="TrkLength_GD_Trk1": 00266 self.gdMuon[0]=unocont.sum()/1000 00267 if unowhat=="TrkLength_LS_Trk1": 00268 self.lsMuon[0]=unocont.sum()/1000 00269 if unowhat=="TrkLength_AV_Trk1": 00270 self.avMuon[0]=unocont.sum()/1000 00271 if unowhat=="TrkLength_Oil_Trk1": 00272 self.oilMuon[0]=unocont.sum()/1000 00273 if unowhat=="MuonTrkLengthInOws": 00274 self.MuonInOws[0]=unocont.sum()/1000 00275 if unowhat=="MuonTrkLengthInIws": 00276 self.MuonInIws[0]=unocont.sum()/1000 00277 if unowhat=="MuonTrkLengthInLS": 00278 self.MuonInLs[0]=unocont.sum()/1000 00279 if unowhat=="MuonTrkLengthInGdLS": 00280 self.MuonInGdls[0]=unocont.sum()/1000 00281 if unowhat=="MuonTrkLengthInOil": 00282 self.MuonInOil[0]=unocont.sum()/1000 00283 if unowhat=="MuonTrkLengthInAV": 00284 self.MuonInAv[0]=unocont.sum()/1000 00285 if unowhat== "MuonStop": 00286 self.MuonStop[0]=unocont.sum() 00287 if unowhat=="NeutronTrkLengthInOws": 00288 self.NeutronInOws[0]=unocont.sum()/1000 00289 if unowhat=="NeutronTrkLengthInIws": 00290 self.NeutronInIws[0]=unocont.sum()/1000 00291 if unowhat=="NeutronTrkLengthInLS": 00292 self.NeutronInLs[0]=unocont.sum()/1000 00293 if unowhat=="NeutronTrkLengthInGdLS": 00294 self.NeutronInGdls[0]=unocont.sum()/1000 00295 if unowhat=="NeutronTrkLengthInOil": 00296 self.NeutronInOil[0]=unocont.sum()/1000 00297 if unowhat=="NeutronTrkLengthInAV": 00298 self.NeutronInAv[0]=unocont.sum()/1000 00299 if unowhat=="NeutronStop": 00300 self.NeutronStop[0]=unocont.sum() 00301 00302 00303 print "Iws TrkLeng: ",self.MuonInIws[0],"Ows TrkLeng: ",self.MuonInOws[0] 00304 00305 ###AD Trk info 00306 realtrksinad=0 ##Number of tracks interesting, not counting the primary muon tracks 00307 trksinad=0 00308 muons=0 00309 neutrons=0 00310 00311 ###Tracks in the AD 00312 phtk=shhis.trackVector() 00313 trksinad=phtk.size() 00314 print "Number of Trks in AD: ",trksinad 00315 for ind in range(0,trksinad): 00316 tkpdg=phtk[ind].particle() 00317 trkvtx=phtk[ind].vertices() 00318 if ind<self.maxTrks[0]: 00319 self.trkPdgID[ind] = tkpdg 00320 00321 ### muons in the AD, all the muons will be saved as the primary track 00322 if abs(tkpdg)==13: 00323 if trkvtx.size()>0: 00324 if ind<self.maxTrks[0]: 00325 self.MuonE[ind] =trkvtx[0].totalEnergy() 00326 for kk in range(0,trkvtx.size()): 00327 trkvtxpos=trkvtx[kk].position() 00328 trkde=self.coordSvc.coordSysDE(trkvtxpos) 00329 if trkde: 00330 trkginfo=trkde.geometry() 00331 if trkginfo: 00332 #lp=trkginfo.toLocal(trkvtxpos) 00333 #lpx=lp.x()/1000. 00334 #lpy=lp.y()/1000. 00335 #lpz=lp.z()/1000. 00336 trklv=trkginfo.lvolume() 00337 if trklv: 00338 trkmatname=trklv.materialName() 00339 if trkmatname=="/dd/Materials/MineralOil" or trkmatname=="/dd/Materials/GdDopedLS" or trkmatname=="/dd/Materials/LiquidScintillator" or trkmatname=="/dd/Materials/Acrylic": 00340 muons=muons+1 00341 00342 else: 00343 realtrksinad+=1 00344 ### neutrons in the AD 00345 if tkpdg==2112: 00346 neutrons = neutrons+1 00347 print 'neutron found in AD' 00348 if trkvtx.size()>0: 00349 if ind<self.maxTrks[0]: 00350 self.NeutronE[ind] =trkvtx[0].totalEnergy() 00351 print "Get neutronE:", trkvtx[0].totalEnergy() 00352 00353 ####if muon hit AD, add the track numbers by 1 00354 if muons>0: 00355 print "Muon Hits AD" 00356 realtrksinad+=1 00357 00358 self.nAdTrksNonMuon[0] = realtrksinad 00359 self.nAdTrks[0] = trksinad 00360 self.nAdMuons[0] = muons 00361 self.nAdNeutrons[0] = neutrons 00362 00363 00364 ############Vertices in AD ########## 00365 Interesting=0 00366 muonvtxs=0 00367 neutronvtxs=0 00368 getmuon=0 00369 getneutron=0 00370 00371 ##How to judge a stopped muon or neutron? 00372 ####Vertecies recorded, not only in the AD 00373 phvt=shhis.vertexVector() 00374 vtxsall=phvt.size() 00375 self.nallVtxs[0] = vtxsall 00376 print "Number of Vtxs: ", vtxsall 00377 nvtxs=0 00378 for ind in range(0,vtxsall): 00379 vtxpos=phvt[ind].position() 00380 vtxproctype=phvt[ind].process().type() 00381 vtxproc=phvt[ind].process().name() 00382 vtxe=phvt[ind].totalEnergy() 00383 vtxsec=phvt[ind].secondaries() 00384 de=self.coordSvc.coordSysDE(vtxpos) 00385 # print "EEEE", vtxpos,vtxsec.size() 00386 if de: 00387 ginfo=de.geometry() 00388 if ginfo: 00389 lv=ginfo.lvolume() 00390 if lv: 00391 matname=lv.materialName() 00392 if matname=="/dd/Materials/MineralOil" or matname=="/dd/Materials/GdDopedLS" or matname=="/dd/Materials/LiquidScintillator" or matname=="/dd/Materials/Acrylic": 00393 partrk=phvt[ind].track().track().particle() ##parent track 00394 #print "HHHHHHH", partrk 00395 if vtxproc !="Cerenkov": 00396 Interesting+=1 00397 if abs(partrk)==13: 00398 muonvtxs +=1 00399 if nvtxs<self.maxVtxs[0]: 00400 self.AdMuonE[nvtxs] =vtxe 00401 if partrk==2112: 00402 neutronvtxs +=1 00403 if nvtxs<self.maxVtxs[0]: 00404 self.AdNeutronE[nvtxs] =vtxe 00405 self.NeutronProcName[nvtxs] = vtxproctype 00406 print "Neutron ProcessName: ",vtxproc, " Type: ",vtxproctype 00407 #print "haha", matname," ",vtxproc, "" , vtxsec.size(), " ", partrk 00408 getneutron=0 00409 getmuon=0 00410 if vtxsec.size()>0: 00411 for pind in range(0,vtxsec.size()): ## loop over daughters 00412 #print "KKK", vtxsec[pind].track().particle() 00413 if abs(vtxsec[pind].track().particle())==13: 00414 getmuon+=1 00415 if abs(vtxsec[pind].track().particle())==2112: 00416 getneutron+=1 00417 00418 if nvtxs<self.maxVtxs[0]: 00419 self.daughMuon[nvtxs] = getmuon 00420 self.daughNeutron[nvtxs] = getneutron 00421 nvtxs +=1 00422 00423 print "Number of AD vertices: ",nvtxs 00424 self.nAdVtxs[0] = nvtxs 00425 self.Interesting[0] = Interesting 00426 self.nAdMuonVtxs[0] = muonvtxs 00427 self.nAdNeutronVtxs[0] = neutronvtxs 00428 00429 ###Count the hits in different valume 00430 AD1=0 00431 AD2=0 00432 AD3=0 00433 AD4=0 00434 Iws=0 00435 Ows=0 00436 unknown=0 00437 Ad1Pmt=[] 00438 Ad2Pmt=[] 00439 Ad3Pmt=[] 00440 Ad4Pmt=[] 00441 pmtinn=[] 00442 pmtout=[] 00443 pmtunknown=[] 00444 00445 #### Hits from Water and AD 00446 shh=hdr.hits() 00447 hitCollectionMap=shh.hitCollection() 00448 hdv = shh.hitDetectors() 00449 00450 self.simTime[0] = hdr.timeStamp().GetSeconds() 00451 nHits = 0 00452 00453 for shcPair in irange(hitCollectionMap.begin(), 00454 hitCollectionMap.end()): 00455 detectorId = shcPair.first 00456 hitCollection = shcPair.second 00457 self.info( "Found %d hits for detector %d" 00458 % ( hitCollection.collection().size(), 00459 detectorId ) 00460 ) 00461 sdetid=detectorId&0x00FF 00462 ###print "KKKKKK",sdetid 00463 if sdetid==1: 00464 AD1=hitCollection.collection().size() 00465 elif sdetid==2: 00466 AD2=hitCollection.collection().size() 00467 elif sdetid==3: 00468 AD3=hitCollection.collection().size() 00469 elif sdetid==4: 00470 AD4=hitCollection.collection().size() 00471 elif sdetid==5: 00472 Iws=hitCollection.collection().size() 00473 elif sdetid==6: 00474 Ows=hitCollection.collection().size() 00475 else: 00476 unknown=hitCollection.collection().size(); 00477 print "Unknow Detector", unknown 00478 00479 for hit in hitCollection.collection(): 00480 pmtid = hit.sensDetId() 00481 if sdetid==1: 00482 if pmtid not in Ad1Pmt: 00483 Ad1Pmt.append(pmtid) 00484 elif sdetid==2: 00485 if pmtid not in Ad2Pmt: 00486 Ad2Pmt.append(pmtid) 00487 elif sdetid==3: 00488 if pmtid not in Ad3Pmt: 00489 Ad3Pmt.append(pmtid) 00490 elif sdetid==4: 00491 if pmtid not in Ad4Pmt: 00492 Ad4Pmt.append(pmtid) 00493 elif sdetid==5: 00494 if pmtid not in pmtinn: 00495 pmtinn.append(pmtid) 00496 elif sdetid==6: 00497 if pmtid not in pmtout: 00498 pmtout.append(pmtid) 00499 else: 00500 print "Unknown PmtID: ", pmtid 00501 if pmtid not in pmtunknown: 00502 pmtunknown.append(pmtid) 00503 if nHits<self.maxSimHits[0]: 00504 self.simHitPmtId[nHits] = pmtid 00505 self.simHitTime[nHits] = hit.hitTime() 00506 nHits += 1 00507 00508 00509 00510 self.nSimHits[0] = nHits 00511 self.nSimIwsHits[0] = Iws 00512 self.nSimOwsHits[0] = Ows 00513 self.nSimAd1Hits[0] = AD1 00514 self.nSimAd2Hits[0] = AD2 00515 self.nSimAd3Hits[0] = AD3 00516 self.nSimAd4Hits[0] = AD4 00517 self.nSimUnknownHits[0] = unknown 00518 self.nSimIwsPmts[0] = len(pmtinn) 00519 self.nSimOwsPmts[0] = len(pmtout) 00520 self.nSimAd1Pmts[0] = len(Ad1Pmt) 00521 self.nSimAd2Pmts[0] = len(Ad2Pmt) 00522 self.nSimAd3Pmts[0] = len(Ad3Pmt) 00523 self.nSimAd4Pmts[0] = len(Ad4Pmt) 00524 self.nSimUnknownPmts[0] = len(pmtunknown) 00525 00526 print " Inn PMTs: ",len(pmtinn)," Out PMTs:",len(pmtout) 00527 00528 00529 # Fill the tree with current branch values 00530 self.simTree.Fill() 00531 00532 return SUCCESS 00533 def finalize(self):
def genTree::BkgTreeAlg::finalize | ( | self | ) |
Definition at line 534 of file genTree.py.
00534 : 00535 self.info("finalizing") 00536 00537 #self.MuonE = 0 00538 #self.NeutronE = 0 00539 #self.trkPdgID = 0 00540 #self.AdMuonE = 0 00541 #self.AdNeutronE = 0 00542 #self.daughMuon = 0 00543 #self.daughNeutron = 0 00544 #self.NeutronProcName = 0 00545 #self.simHitPmtId = 0 00546 #self.simHitTime = 0 00547 00548 status = DybPythonAlg.finalize(self) 00549 return status 00550 00551 ##### Job Configuration for nuwa.py ########################################
Definition at line 32 of file genTree.py.
Definition at line 37 of file genTree.py.
Definition at line 44 of file genTree.py.
Definition at line 48 of file genTree.py.
Definition at line 51 of file genTree.py.
Definition at line 52 of file genTree.py.
Definition at line 53 of file genTree.py.
Definition at line 54 of file genTree.py.
Definition at line 55 of file genTree.py.
Definition at line 56 of file genTree.py.
Definition at line 57 of file genTree.py.
Definition at line 58 of file genTree.py.
Definition at line 59 of file genTree.py.
Definition at line 60 of file genTree.py.
Definition at line 61 of file genTree.py.
Definition at line 62 of file genTree.py.
Definition at line 63 of file genTree.py.
Definition at line 64 of file genTree.py.
Definition at line 65 of file genTree.py.
Definition at line 66 of file genTree.py.
Definition at line 67 of file genTree.py.
Definition at line 68 of file genTree.py.
Definition at line 69 of file genTree.py.
Definition at line 70 of file genTree.py.
Definition at line 71 of file genTree.py.
Definition at line 72 of file genTree.py.
Definition at line 73 of file genTree.py.
Definition at line 74 of file genTree.py.
Definition at line 75 of file genTree.py.
Definition at line 76 of file genTree.py.
Definition at line 77 of file genTree.py.
Definition at line 78 of file genTree.py.
Definition at line 79 of file genTree.py.
Definition at line 84 of file genTree.py.
Definition at line 85 of file genTree.py.
Definition at line 86 of file genTree.py.
Definition at line 89 of file genTree.py.
Definition at line 91 of file genTree.py.
Definition at line 92 of file genTree.py.
Definition at line 93 of file genTree.py.
Definition at line 97 of file genTree.py.
Definition at line 98 of file genTree.py.
Definition at line 99 of file genTree.py.
Definition at line 100 of file genTree.py.
Definition at line 103 of file genTree.py.
Definition at line 105 of file genTree.py.
Definition at line 106 of file genTree.py.
Definition at line 107 of file genTree.py.
Definition at line 108 of file genTree.py.
Definition at line 109 of file genTree.py.
Definition at line 116 of file genTree.py.
Definition at line 117 of file genTree.py.
Definition at line 118 of file genTree.py.
Definition at line 119 of file genTree.py.
Definition at line 120 of file genTree.py.
Definition at line 121 of file genTree.py.
Definition at line 122 of file genTree.py.
Definition at line 123 of file genTree.py.
Definition at line 124 of file genTree.py.
Definition at line 125 of file genTree.py.
Definition at line 126 of file genTree.py.
Definition at line 127 of file genTree.py.
Definition at line 128 of file genTree.py.
Definition at line 129 of file genTree.py.
Definition at line 130 of file genTree.py.
Definition at line 133 of file genTree.py.
Definition at line 135 of file genTree.py.
Definition at line 136 of file genTree.py.