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

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 hist
 outputstat
 nInGdLS
 nInIAV
 nInLSO
 nInOAV
 nInMO
 nCap
 nGen
 SpillIn_onGd
 IavSpillIn_onGd
 SpillOut
 SpillIn_onH
 OavSpillIn_onH
 SpillOut_onH
 onGdCap
 onGdGdsCap
 onGdCapPassCut
 onGdGdsCapPassCut
 nPassGdCut
 onGdCapCutUncertain
 nGdCutUncertain
 onGdGdsCapCutUncertain
 nonGdPassGdCut
 onHCap
 onHCapWithinLS
 onHCapWithinLSPassCut
 onHCapWithinLSCutUncertainL
 onHCapWithinLSCutUncertainU
 nonHCapWithinLSPassHCut
 nonHCapWithinLSHCutUncertainL
 nonHCapWithinLSHCutUncertainU
 onHCapBeyondLS
 onHCapBeyondLSPassCut
 onHCapBeyondLSCutUncertainL
 onHCapBeyondLSCutUncertainU
 nonHCapBeyondLSPassHCut
 nonHCapBeyondLSHCutUncertainL
 nonHCapBeyondLSHCutUncertainU
 onHCapOavMoPassCut
 onHCapOavMoCutUncertainL
 onHCapOavMoCutUncertainU
 onHCapLS
 onHCapMO
 onHCapOAV
 onHCapPassCut
 onHCapCutUncertainL
 onHCapCutUncertainU
 nPassHCut
 nHCutUncertainL
 nHCutUncertainU
 nGdPassHCut
 nGdHCutUncertainL
 nGdHCutUncertainU
 target_de_name
 gds_de_name
 lso_de_name
 coorSvc
 statsSvc

Detailed Description

Definition at line 22 of file __init__.py.


Constructor & Destructor Documentation

def chkIBD::plotIbdBasics::__init__ (   self,
  name 
)

Definition at line 24 of file __init__.py.

00025                            :
00026         GaudiAlgo.__init__(self,name)
00027         self.hist = {}
00028         # output file
00029         self.outputstat = open('IbdStat.txt', 'w')
00030         
00031         # Counters
00032         self.nInGdLS = 0
00033         self.nInIAV = 0
00034         self.nInLSO = 0
00035         self.nInOAV = 0
00036         self.nInMO = 0
00037         
00038         self.nCap = 0
00039         self.nGen = 0
00040         
00041         self.SpillIn_onGd = 0
00042         self.IavSpillIn_onGd = 0
00043         self.SpillOut = 0        
00044         self.SpillIn_onH = 0
00045         self.OavSpillIn_onH = 0
00046         self.SpillOut_onH = 0
00047         
00048         self.onGdCap = 0           # total on-Gd cap
00049         self.onGdGdsCap = 0        # total on-Gd cap in GDS
00050         
00051         self.onGdCapPassCut = 0    # total on-Gd cap pass Gd cut
00052         self.onGdGdsCapPassCut = 0 # total on-Gd cap in GDS pass Gd cut
00053         self.nPassGdCut = 0        # total pass Gd cut
00054 
00055         self.onGdCapCutUncertain = 0        
00056         self.nGdCutUncertain = 0
00057         self.onGdGdsCapCutUncertain = 0        
00058         
00059         self.nonGdPassGdCut = 0
00060 
00061         self.onHCap = 0
00062         self.onHCapWithinLS = 0
00063         self.onHCapWithinLSPassCut = 0
00064         self.onHCapWithinLSCutUncertainL = 0
00065         self.onHCapWithinLSCutUncertainU = 0
00066 
00067         self.nonHCapWithinLSPassHCut = 0
00068         self.nonHCapWithinLSHCutUncertainL = 0
00069         self.nonHCapWithinLSHCutUncertainU = 0
00070 
00071         self.onHCapBeyondLS = 0
00072         self.onHCapBeyondLSPassCut = 0
00073         self.onHCapBeyondLSCutUncertainL = 0
00074         self.onHCapBeyondLSCutUncertainU = 0
00075 
00076         self.nonHCapBeyondLSPassHCut = 0
00077         self.nonHCapBeyondLSHCutUncertainL = 0
00078         self.nonHCapBeyondLSHCutUncertainU = 0
00079 
00080         self.onHCapOavMoPassCut = 0
00081         self.onHCapOavMoCutUncertainL = 0
00082         self.onHCapOavMoCutUncertainU = 0
00083         self.onHCapLS = 0
00084         self.onHCapMO = 0
00085         self.onHCapOAV = 0
00086         
00087         self.onHCapPassCut = 0
00088         self.onHCapCutUncertainL = 0
00089         self.onHCapCutUncertainU = 0
00090         
00091         self.nPassHCut = 0
00092         self.nHCutUncertainL = 0
00093         self.nHCutUncertainU = 0
00094 
00095         self.nGdPassHCut = 0
00096         self.nGdHCutUncertainL = 0
00097         self.nGdHCutUncertainU = 0
00098 
00099         return
    

Member Function Documentation

def chkIBD::plotIbdBasics::initialize (   self)

Definition at line 100 of file __init__.py.

00101                         :
00102         print "Initializing the IBD basic ploter", self.name()
00103         status = GaudiAlgo.initialize(self)
00104         if status.isFailure(): return status
00105         self.target_de_name = '/dd/Structure/AD/db-ade1/db-sst1/db-oil1'
00106         self.gds_de_name = '/dd/Structure/AD/db-gds1'
00107         self.lso_de_name = '/dd/Structure/AD/db-lso1'
00108 
00109         # What services do you need?
00110         self.coorSvc = self.svc('ICoordSysSvc', 'CoordSysSvc')
00111         if not self.coorSvc:
00112             print 'Failed to get CoordSysSvc'
00113             return FAILURE
00114 
00115 #        self.histSvc = self.svc('ITHistSvc', 'THistSvc')
00116 
00117         self.statsSvc = self.svc('IStatisticsSvc','StatisticsSvc')
00118         if self.statsSvc == None:
00119             self.error("Failed to initialize IStat service.")
00120             return FAILURE        
00121 
00122         self.hist["genRZ"] = TH2F("genRZ", "Generation Vertex R-Z",
00123                                   100, 0.0, 6.190144, 100, -2.48, 2.48)
00124         status = self.statsSvc.put('/file1/basics/genRZ', 
00125                                       self.hist["genRZ"])
00126         if status.isFailure(): return status
00127         
00128         self.hist["genXY"] = TH2F("genXY", "Generation Vertex X-Y", 
00129                                   100, -2.48, 2.48, 100, -2.48, 2.48)
00130         status = self.statsSvc.put('/file1/basics/genXY', 
00131                                       self.hist["genXY"])
00132         if status.isFailure(): return status
00133         
00134         self.hist["HitTime"] = TH1F("HitTime", "Hit Time [#mus]",
00135                                     500, 0.0, 2000)
00136         status = self.statsSvc.put('/file1/basics/HitTime', 
00137                                       self.hist["HitTime"])
00138         if status.isFailure(): return status
00139 
00140         self.hist["GdCapHitTime"] = TH1F("GdCapHitTime",
00141                                          "Gd Capture Hit Time [#mus]",
00142                                          500, 0.0, 2000)
00143         status = self.statsSvc.put('/file1/basics/GdCapHitTime', 
00144                                       self.hist["GdCapHitTime"])
00145         if status.isFailure(): return status
00146         
00147         self.hist["HCapHitTime"] = TH1F("HCapHitTime",
00148                                         "H Capture Hit Time [#mus]",
00149                                         500, 0.0, 2000)
00150         status = self.statsSvc.put('/file1/basics/HCapHitTime', 
00151                                       self.hist["HCapHitTime"])
00152         if status.isFailure(): return status
00153         
00154         self.hist["pe_E"] = TH2F("pe_E", "PE vs visible E (e+ within GdLS)",
00155                                  100, 0, 10, 700, 0, 1400)
00156         status = self.statsSvc.put('/file1/basics/pe_E', 
00157                                       self.hist["pe_E"])
00158         if status.isFailure(): return status
00159         
00160         self.hist["pe_E_inLS"] = TH2F("pe_E_inLS",
00161                                       "PE vs visible E (e+ within LS)", 
00162                                       100, 0, 10, 700, 0, 1400)
00163         status = self.statsSvc.put('/file1/basics/pe_E_inLS', 
00164                                       self.hist["pe_E_inLS"])
00165         if status.isFailure(): return status
00166 
00167         self.hist["pe_E_LS"] = TH2F("pe_E_LS",
00168                                     "PE vs visible E (e+ in LS)",
00169                                     100, 0, 10, 700, 0, 1400)
00170         status = self.statsSvc.put('/file1/basics/pe_E_LS', 
00171                                       self.hist["pe_E_LS"])
00172         if status.isFailure(): return status
00173 
00174         self.hist["pe_E_all"] = TH2F("pe_E_all", "PE vs visible E (all e+)",
00175                                      100, 0, 10, 700, 0, 1400)
00176         status = self.statsSvc.put('/file1/basics/pe_E_all', 
00177                                       self.hist["pe_E_all"])
00178         if status.isFailure(): return status
00179         
00180         self.hist["nHits_LS"] = TH1F("nHits_LS", 
00181                                      "nCap Hits in LS",
00182                                      100, 0, 1400)
00183         status = self.statsSvc.put('/file1/basics/nHits_LS', 
00184                                       self.hist["nHits_LS"])
00185         if status.isFailure(): return status
00186         
00187         self.hist["nHits_MO"] = TH1F("nHits_MO", 
00188                                      "nCap Hits in MO",
00189                                      100, 0, 1400)
00190         status = self.statsSvc.put('/file1/basics/nHits_MO', 
00191                                       self.hist["nHits_MO"])
00192         if status.isFailure(): return status
00193         
00194         self.hist["nHits_onGd"] = TH1F("nHits_onGd",
00195                                        "on-Gd nCap Hits",
00196                                        100, 0, 1400)
00197         status = self.statsSvc.put('/file1/basics/nHits_onGd', 
00198                                       self.hist["nHits_onGd"])
00199         if status.isFailure(): return status
00200         
00201         self.hist["nHits_onH"] = TH1F("nHits_onH", 
00202                                       "on-H nCap Hits", 
00203                                       100, 0, 1400)
00204         status = self.statsSvc.put('/file1/basics/nHits_onH', 
00205                                       self.hist["nHits_onH"])
00206         if status.isFailure(): return status
00207         
00208         self.hist["nHits"] = TH1F("nHits", "Neutron Capture Hits in GdLS",
00209                                   100, 0, 1400)
00210         status = self.statsSvc.put('/file1/basics/nHits', 
00211                                       self.hist["nHits"])
00212         if status.isFailure(): return status
00213         
00214         self.hist["nHits_all"] = TH1F("nHits_all", "Neutron Capture Hits",
00215                                   100, 0, 1400)
00216         status = self.statsSvc.put('/file1/basics/nHits_all', 
00217                                       self.hist["nHits_all"])
00218         if status.isFailure(): return status
00219 
00220         self.hist["nGdCapGenPos"] = TH1F("nGdCapGenPos",
00221                                          "Neutron Gd Capture Generation Position",
00222                                          310, 0, 6.190144)
00223         status = self.statsSvc.put('/file1/basics/nGdCapGenPos',
00224                                       self.hist["nGdCapGenPos"])
00225         if status.isFailure(): return status
00226         
00227         self.hist["nGdGdsCapGenPos"] = TH1F("nGdGdsCapGenPos",
00228                                             "Neutron Gd Capture in Gds Generation Position",
00229                                             310, 0, 6.190144)
00230         status = self.statsSvc.put('/file1/basics/nGdGdsCapGenPos',
00231                                       self.hist["nGdGdsCapGenPos"])
00232         if status.isFailure(): return status
00233         
00234         self.hist["nGdCapPos"] = TH3F("nGdCapPos",
00235                                       "Neutron Gd Capture Position",
00236                                       100, -2.5, 2.5,
00237                                       100, -2.5, 2.5,
00238                                       100, -2.5, 2.5)
00239         status = self.statsSvc.put('/file1/basics/nGdCapPos',
00240                                       self.hist["nGdCapPos"])
00241         if status.isFailure(): return status
00242 
00243         self.hist["nHCapGenPos"] = TH1F("nHCapGenPos",
00244                                         "Neutron H Capture Generation Position",
00245                                         310, 0, 6.190144)
00246         status = self.statsSvc.put('/file1/basics/nHCapGenPos',
00247                                       self.hist["nHCapGenPos"])
00248         if status.isFailure(): return status
00249 
00250 
00251         self.hist["nHOilCapGenPos"] = TH1F("nHOilCapGenPos",
00252                                            "Neutron H Capture Generation Position",
00253                                            310, 0, 6.190144)
00254         status = self.statsSvc.put('/file1/basics/nHOilCapGenPos',
00255                                       self.hist["nHOilCapGenPos"])
00256         if status.isFailure(): return status
00257 
00258         self.hist["nHLsoCapGenPos"] = TH1F("nHLsoCapGenPos",
00259                                            "Neutron H Capture Generation Position",
00260                                            310, 0, 6.190144)
00261         status = self.statsSvc.put('/file1/basics/nHLsoCapGenPos',
00262                                       self.hist["nHLsoCapGenPos"])
00263         if status.isFailure(): return status
00264 
00265 
00266         self.hist["eDepInGdLS"] = TH1F("eDepInGdLS", "Deposited Energy [MeV]",
00267                                        20, 0, 20)
00268         status = self.statsSvc.put('/file1/basics/eDepInGdLS', 
00269                                       self.hist["eDepInGdLS"])
00270         if status.isFailure(): return status
00271 
00272         self.hist["eDepInLS"] = TH1F("eDepInLS", "Deposited Energy [MeV]",
00273                                        20, 0, 20)
00274         status = self.statsSvc.put('/file1/basics/eDepInLS', 
00275                                       self.hist["eDepInLS"])
00276         if status.isFailure(): return status
00277 
00278         self.hist["drift_GdLS"] = TH1F("drift_GdLS",
00279                                       "Neutron Drift Distance in GdLS [cm]",
00280                                        200, 0, 50)
00281         status = self.statsSvc.put('/file1/basics/drift_GdLS', 
00282                                       self.hist["drift_GdLS"])
00283         if status.isFailure(): return status
00284 
00285         self.hist["drift_LS"] = TH1F("drift_LS",
00286                                       "Neutron Drift Distance in LS [cm]",
00287                                        200, 0, 50)
00288         status = self.statsSvc.put('/file1/basics/drift_LS', 
00289                                       self.hist["drift_LS"])
00290         if status.isFailure(): return status
00291         
00292         self.hist["time_GdLS"] = TH1F("time_GdLS",
00293                                       "Neutron Capture time in GdLS [#mus]",
00294                                        400, 0, 400)
00295         status = self.statsSvc.put('/file1/basics/time_GdLS', 
00296                                    self.hist["time_GdLS"])
00297         if status.isFailure(): return status
00298 
00299         self.hist["time_LS"] = TH1F("time_LS",
00300                                       "Neutron Capture Time in LS [#mus]",
00301                                        400, 0, 2000)
00302         status = self.statsSvc.put('/file1/basics/time_LS', 
00303                                    self.hist["time_LS"])
00304         if status.isFailure(): return status
00305 
00306         return SUCCESS

def chkIBD::plotIbdBasics::execute (   self)

Definition at line 307 of file __init__.py.

00308                      :
00309         print "Executing plotIbdBasics", self.name()
00310         evt = self.evtSvc()
00311         simhdr = evt['/Event/Sim/SimHeader']
00312 #        print "SimHeader: ", simhdr
00313         if simhdr == None:
00314             print "No SimHeader in this ReadOut"
00315             return SUCCESS
00316 
00317         det = self.detSvc(self.target_de_name)
00318         det_gds = self.detSvc(self.gds_de_name)
00319         det_lso = self.detSvc(self.lso_de_name)
00320 
00321         # Unobservables
00322         statshdr = simhdr.unobservableStatistics()
00323         stats = statshdr.stats()
00324 
00325         PID_trk1 = stats["pdgId_Trk1"].sum()
00326         PID_trk2 = stats["pdgId_Trk2"].sum()
00327 
00328         if PID_trk1 != -11 or PID_trk2 != 2112:
00329             print "PID of track 1 is", PID_trk1
00330             print "PID of track 2 is", PID_trk2
00331             print "Not an IBD event."
00332             return SUCCESS
00333 
00334         tGen = stats["t_Trk2"].sum()
00335         xGen = stats["x_Trk2"].sum()
00336         yGen = stats["y_Trk2"].sum()
00337         zGen = stats["z_Trk2"].sum()
00338         
00339         tCap = stats["tEnd_Trk2"].sum()
00340         xCap = stats["xEnd_Trk2"].sum()
00341         yCap = stats["yEnd_Trk2"].sum()
00342         zCap = stats["zEnd_Trk2"].sum()
00343         
00344         # Get underlying DE object
00345         de = self.getDet(self.target_de_name)
00346         de_lso = self.getDet(self.lso_de_name)
00347         de_gds = self.getDet(self.gds_de_name)
00348         if not de:
00349             print 'Failed to get DE',self.target_de_name
00350             return FAILURE
00351         
00352         if not de_lso:
00353             print 'Failed to get DE',self.lso_de_name
00354             return FAILURE
00355         
00356         if not de_gds:
00357             print 'Failed to get DE',self.gds_de_name
00358             return FAILURE
00359         
00360         # Get the AD coordinates of the vertexes
00361         import PyCintex
00362         Gaudi = PyCintex.makeNamespace('Gaudi')
00363         genGlbPoint = Gaudi.XYZPoint(xGen, yGen, zGen)
00364         capGlbPoint = Gaudi.XYZPoint(xCap, yCap, zCap)
00365 #        point = de.geometry().toGlobal(point)
00366         genLclPoint = de.geometry().toLocal(genGlbPoint)
00367         capLclPoint = de.geometry().toLocal(capGlbPoint)
00368         genLclPointLso = de_lso.geometry().toLocal(genGlbPoint)
00369         capLclPointLso = de_lso.geometry().toLocal(capGlbPoint)
00370         genLclPointGds = de_gds.geometry().toLocal(genGlbPoint)
00371         capLclPointGds = de_gds.geometry().toLocal(capGlbPoint)
00372 #        print 'In global coordinate [',gpoint.x(),gpoint.y(),gpoint.z(),']'
00373 
00374         ndrift = ROOT.TVector3(xCap-xGen, yCap-yGen, zCap-zGen)
00375         
00376         capTime = tCap - tGen
00377         capDis = ndrift.Mag()
00378 
00379         R2 = genLclPoint.x()/units.meter * genLclPoint.x()/units.meter + \
00380             genLclPoint.y()/units.meter * genLclPoint.y()/units.meter
00381         
00382         self.hist["genRZ"].Fill(R2, genLclPoint.z()/units.meter)
00383 
00384         self.hist["genXY"].Fill(genLclPoint.x()/units.meter,genLclPoint.y()/units.meter)
00385 
00386         # Find the interesting volumes
00387         genDE = self.coorSvc.coordSysDE(genGlbPoint)
00388         capDE = self.coorSvc.coordSysDE(capGlbPoint)
00389         if not genDE:
00390             print 'Failed to find coordinate system DE for generation'\
00391                 '[',genGlbPoint.x(),genGlbPoint.y(),genGlbPoint.z(),']'
00392             print 'Local: [',genLclPoint.x(),genLclPoint.y(),genLclPoint.z(),']'
00393             return FAILURE
00394         else:
00395             self.nGen += 1
00396             gendmvol = genDE.geometry().belongsToPath(genGlbPoint,-1)
00397 
00398         if not capDE:
00399             print 'Failed to find coordinate system DE for capture'\
00400                 '[',capGlbPoint.x(),capGlbPoint.y(),capGlbPoint.z(),']'
00401             return FAILURE
00402         else:
00403             self.nCap += 1
00404             capdmvol = capDE.geometry().belongsToPath(capGlbPoint,-1)
00405 
00406         import re
00407         genDM = re.split('/', gendmvol).pop()
00408         capDM = re.split('/', capdmvol).pop()
00409         print "Generated in ", genDM
00410         print "Captured in ", capDM
00411         
00412         positronHits = 0
00413         neutronHits = 0
00414         positronTimeCut = 500.
00415 
00416         positronCut = 126.5  # 1 MeV
00417         positronCutL = 124.0 # 1 MeV
00418         positronCutR = 129.0 # 1 MeV
00419 
00420         onHLowerCut = 194.   # 1.5 MeV
00421         onHLowerCutL = 190.1 # 194 (1 - 2%)
00422         onHLowerCutR = 197.9 # 194 (1 + 2%)
00423                 
00424         onHUpperCut = 453.  # 3.5 MeV
00425         onHUpperCutL = 443.9 # 453 (1 - 2%)
00426         onHUpperCutR = 462.1 # 453 (1 + 2%)
00427 
00428         onGdCut = 811.9  # 6MeV
00429         onGdCutL = 803.8 # 811.9 (1 - 1%)
00430         onGdCutR = 820.0 # 811.9 (1 + 1%)
00431 
00432         # Visible energy
00433         vis_trk1 = 1.022 + stats['ke_Trk1'].sum()/units.MeV
00434         self.hist["pe_E_all"].Fill(vis_trk1, positronHits)
00435 
00436         # Capture target
00437         capTarget = stats["capTarget"].sum()
00438         print "The capture target is ", capTarget
00439 
00440         # Deposit energy
00441         eDepInGdLS = stats["EDepInGdLS"].sum()
00442         self.hist["eDepInGdLS"].Fill(eDepInGdLS/units.MeV)
00443         eDepInLS = stats["EDepInLS"].sum()
00444         self.hist["eDepInLS"].Fill(eDepInLS/units.MeV)
00445         
00446         simhits = simhdr.hits()
00447         for detector in simhits.hitDetectors():
00448             hitCollection = simhits.hitsByDetector(detector)
00449             if hitCollection == None:
00450                 print "No hits in ", detector
00451             hits = hitCollection.collection()
00452             for hit in hits:
00453 #                print " PMT", hit.sensDetId(), "hit @ time: ", hit.hitTime()
00454                 self.hist["HitTime"].Fill(hit.hitTime()/units.microsecond)
00455                 if capTarget == 1:
00456                     self.hist["HCapHitTime"].Fill(hit.hitTime()/units.microsecond)
00457                 if capTarget == 64:
00458                     self.hist["GdCapHitTime"].Fill(hit.hitTime()/units.microsecond)
00459                 if hit.hitTime()/units.nanosecond<positronTimeCut and \
00460                         hit.hitTime()/units.nanosecond<capTime/units.nanosecond:
00461                     positronHits += 1
00462                 else:
00463                     neutronHits += 1
00464 
00465         self.hist["nHits_all"].Fill(neutronHits)
00466 
00467         if genDM == 'db-gds1':
00468             self.nInGdLS += 1
00469             self.hist["pe_E"].Fill(vis_trk1, positronHits)
00470             if capDM == 'db-gds1':
00471                 self.hist["nHits"].Fill(neutronHits)
00472                 self.hist["time_GdLS"].Fill(capTime/units.microsecond)
00473                 self.hist["drift_GdLS"].Fill(capDis/units.cm)
00474             else:
00475                 self.SpillOut += 1
00476                 
00477         if genDM == 'db-iav1':
00478             self.nInIAV += 1
00479             if capTarget == 64:
00480                 self.IavSpillIn_onGd += 1
00481 
00482         if genDM == 'db-lso1':
00483             self.nInLSO += 1
00484             self.hist["pe_E_LS"].Fill(vis_trk1, positronHits)
00485             if capDM == 'db-lso1':
00486                 self.hist["time_LS"].Fill(capTime/units.microsecond)
00487                 self.hist["drift_LS"].Fill(capDis/units.cm)
00488             if capDM == 'db-oil1' or capDM == 'db-oav1':
00489                 self.SpillOut_onH += 1
00490             if capTarget == 64:
00491                 self.SpillIn_onGd += 1
00492 
00493         if genDM == 'db-oav1':
00494             self.nInOAV += 1
00495             if re.search('db-lso1', capdmvol) and capTarget == 1:
00496                 self.OavSpillIn_onH += 1
00497                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00498                     self.onHCapOavMoPassCut += 1
00499                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00500                     self.onHCapOavMoCutUncertainL += 1
00501                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00502                     self.onHCapOavMoCutUncertainU += 1
00503 
00504         if genDM == 'db-oil1':
00505             self.nInMO  += 1
00506             if re.search('db-lso1', capdmvol) and capTarget == 1:
00507                 self.SpillIn_onH += 1
00508                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00509                     self.onHCapOavMoPassCut += 1
00510                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00511                     self.onHCapOavMoCutUncertainL += 1
00512                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00513                     self.onHCapOavMoCutUncertainU += 1
00514 
00515         if re.search('db-lso1',gendmvol):
00516             self.hist["pe_E_inLS"].Fill(vis_trk1, positronHits)
00517 
00518         if re.search('db-lso1',capdmvol):
00519             if capTarget == 1:
00520                 self.onHCapWithinLS += 1
00521                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00522                     self.onHCapWithinLSPassCut += 1
00523                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00524                     self.onHCapWithinLSCutUncertainL += 1
00525                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00526                     self.onHCapWithinLSCutUncertainU += 1
00527             else:
00528                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00529                     self.nonHCapWithinLSPassHCut += 1
00530                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00531                     self.nonHCapWithinLSHCutUncertainL += 1
00532                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00533                     self.nonHCapWithinLSHCutUncertainU += 1
00534                 
00535         else:
00536             if capTarget == 1:
00537                 self.onHCapBeyondLS += 1
00538                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00539                     self.onHCapBeyondLSPassCut += 1
00540                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00541                     self.onHCapBeyondLSCutUncertainL += 1
00542                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00543                     self.onHCapBeyondLSCutUncertainU += 1
00544             else:
00545                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00546                     self.nonHCapBeyondLSPassHCut += 1
00547                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00548                     self.nonHCapBeyondLSHCutUncertainL += 1
00549                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00550                     self.nonHCapBeyondLSHCutUncertainU += 1
00551             
00552         # Passing on-Gd neutron cuts
00553         if neutronHits > onGdCut:
00554             self.nPassGdCut += 1
00555             if capTarget != 64:
00556                 print "non-Gd capture pass Gd cut: ", capTarget
00557                 self.nonGdPassGdCut += 1
00558                 value = ('Non-Gd capTarget: ', capTarget)
00559                 theline = str(value)
00560                 self.outputstat.write(theline)
00561                 self.outputstat.write('\n')
00562                 
00563         if neutronHits > onGdCutL and neutronHits < onGdCutR:
00564             self.nGdCutUncertain += 1
00565 
00566         # Passing on-H neutron cuts
00567         if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00568             self.nPassHCut += 1
00569             if capTarget == 64:
00570                 self.nGdPassHCut += 1
00571         if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00572             self.nHCutUncertainL += 1
00573             if capTarget == 64:
00574                 self.nGdHCutUncertainL += 1                
00575         if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00576             self.nHCutUncertainU += 1
00577             if capTarget == 64:
00578                 self.nGdHCutUncertainU += 1
00579         
00580         if capTarget == 64:
00581             self.onGdCap += 1
00582             self.hist["nHits_onGd"].Fill(neutronHits)
00583             self.hist["nGdCapPos"].Fill(capLclPoint.x()/units.meter,capLclPoint.y()/units.meter,capLclPoint.z()/units.meter)            
00584             if capDM == 'db-gds1':
00585                 self.onGdGdsCap += 1
00586                 if neutronHits > onGdCut:
00587                     self.onGdGdsCapPassCut += 1
00588                 if neutronHits > onGdCutL and neutronHits < onGdCutR:
00589                     self.onGdGdsCapCutUncertain += 1
00590 
00591             if genLclPoint.z()/units.m < 1. and genLclPoint.z()/units.m > -1.:
00592                 self.hist["nGdCapGenPos"].Fill(R2)
00593                 if capDM == 'db-gds1':
00594                     self.hist["nGdGdsCapGenPos"].Fill(R2)
00595                     
00596             if neutronHits > onGdCut:
00597                 self.onGdCapPassCut += 1
00598             if neutronHits > onGdCutL and neutronHits < onGdCutR:
00599                 self.onGdCapCutUncertain += 1
00600             
00601         if capTarget == 1:
00602             self.onHCap += 1
00603             self.hist["nHits_onH"].Fill(neutronHits)
00604             
00605             if genLclPoint.z()/units.m < 1. and genLclPoint.z()/units.m > -1.:
00606                 self.hist["nHCapGenPos"].Fill(R2)
00607                 if capDM == 'db-lso1':
00608                     self.hist["nHLsoCapGenPos"].Fill(R2)
00609                 if capDM == 'db-oil1' or capDM == 'db-oav1':
00610                     self.hist["nHOilCapGenPos"].Fill(R2)
00611                     
00612             if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00613                 self.onHCapPassCut += 1
00614             if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00615                 self.onHCapCutUncertainL += 1
00616             if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00617                 self.onHCapCutUncertainU += 1
00618 
00619         if capDM == 'db-lso1':
00620             self.hist["nHits_LS"].Fill(neutronHits)
00621             if capTarget == 1:
00622                 self.onHCapLS += 1
00623                 
00624         if capDM == 'db-oav1':
00625             if capTarget == 1:
00626                 self.onHCapOAV += 1
00627                 
00628         if capDM == 'db-oil1':
00629             self.hist["nHits_MO"].Fill(neutronHits)
00630             if capTarget == 1:
00631                 self.onHCapMO += 1
00632 
00633         return SUCCESS
    
def chkIBD::plotIbdBasics::finalize (   self)

Definition at line 634 of file __init__.py.

00635                       :
00636         self.outputstat.close()
00637 
00638         print "Total n generation: ", self.nGen
00639         print "Total n gen in GdLS: ", self.nInGdLS
00640         print "Total n gen in IAV: ", self.nInIAV
00641         print "Total n gen in LSO: ", self.nInLSO
00642         print "Total n gen in OAV: ", self.nInOAV
00643         print "Total n gen in MO: ", self.nInMO
00644         print "Total n capture: ", self.nCap
00645         print ""
00646         
00647         print "Total n-capture on Gd: ", self.onGdCap
00648         print "Total n-capture on Gd in Gds: ", self.onGdGdsCap
00649         print "Spill-In on Gd n from LS: ", self.SpillIn_onGd
00650         print "Spill-In on Gd from IAV: ", self.IavSpillIn_onGd
00651         print "Spill-Out of n from Gd-LS: ", self.SpillOut
00652         print ""
00653         
00654         print "On Gd capture pass on-Gd cut: ", self.onGdCapPassCut
00655         print "On Gd capture on-Gd cut uncertainty: ", self.onGdCapCutUncertain
00656         print "On Gd capture in GDS pass on-Gd cut: ", self.onGdGdsCapPassCut
00657         print "On Gd capture in GDS on-Gd cut uncertainty: ", self.onGdGdsCapCutUncertain
00658         print "Total non-Gd capture pass Gd cut: ", self.nonGdPassGdCut
00659         print "Total pass Gd cut: ", self.nPassGdCut
00660         print "Overall Gd cut uncertainty: ", self.nGdCutUncertain
00661         print ""
00662         
00663         print "Total n-capture on H: ", self.onHCap
00664         print "Total n-capture on H in LS: ", self.onHCapLS
00665         print "Total n-capture on H within LS: ", self.onHCapWithinLS
00666         print ""
00667         
00668         print "Spill-In of n from OIL to LSO: ", self.SpillIn_onH
00669         print "Spill-In of n from OAV to LSO: ", self.OavSpillIn_onH
00670         print "Spill-Out of n from LSO to OAV or OIL: ", self.SpillOut_onH
00671         print ""
00672         
00673         print "n capture pass on-H cut: ", self.nPassHCut
00674         print "n capture pass lower on-H cut uncertainty: ", self.nHCutUncertainL
00675         print "n capture pass upper on-H cut uncertainty: ", self.nHCutUncertainU
00676         print ""
00677 
00678         print "On H capture pass on-H cut: ", self.onHCapPassCut
00679         print "On H capture lower on-H cut uncertainty: ", self.onHCapCutUncertainL
00680         print "On H capture upper on-H cut uncertainty: ", self.onHCapCutUncertainU
00681         print ""
00682         
00683         print "on H nCap within LS pass H cut: ", self.onHCapWithinLSPassCut
00684         print "on H nCap within LS pass lower H cut uncertainty: ", self.onHCapWithinLSCutUncertainL
00685         print "on H nCap within LS pass upper H cut uncertainty: ", self.onHCapWithinLSCutUncertainU
00686         print ""
00687 
00688         print "non H nCap within LS pass H cut: ", self.nonHCapWithinLSPassHCut
00689         print "non H nCap within LS pass lower H cut uncertainty: ", self.nonHCapWithinLSHCutUncertainL
00690         print "non H nCap within LS pass upper H cut uncertainty: ", self.nonHCapWithinLSHCutUncertainU
00691         print ""
00692 
00693         print "on H nCap beyond LS pass on-H cut: ", self.onHCapBeyondLSPassCut
00694         print "on H nCap beyond LS pass lower on-H cut uncertainty: ", self.onHCapBeyondLSCutUncertainL
00695         print "on H nCap bdyond LS pass upper on-H cut uncertainty: ", self.onHCapBeyondLSCutUncertainU
00696         print ""
00697 
00698         print "non H nCap beyond LS pass H cut: ", self.nonHCapBeyondLSPassHCut
00699         print "non H nCap beyond LS pass lower H cut uncertainty: ", self.nonHCapBeyondLSHCutUncertainL
00700         print "non H nCap beyond LS pass upper H cut uncertainty: ", self.nonHCapBeyondLSHCutUncertainU
00701         print ""
00702 
00703         print "On Gd capture pass on-H cut: ", self.nGdPassHCut
00704         print "On Gd capture pass lower on-H cut uncertainty: ", self.nGdHCutUncertainL
00705         print "On Gd capture pass upper on-H cut uncertainty: ", self.nGdHCutUncertainU
00706         print ""
00707 
00708         print "Total n-capture on H in MO: ", self.onHCapMO
00709         print "Total n-capture on H in OAV: ", self.onHCapOAV
00710         print "on H nCap in OAV&MO pass on-H cut: ", self.onHCapOavMoPassCut
00711         print "on H nCap in OAV&MO pass lower on-H cut uncertainty: ", self.onHCapOavMoCutUncertainL
00712         print "on H nCap in OAV&MO pass upper on-H cut uncertainty: ", self.onHCapOavMoCutUncertainU
00713         print ""
00714 
00715         print "Finalizing ", self.name()
00716         status = GaudiAlgo.finalize(self)
00717         return status


Member Data Documentation

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 24 of file __init__.py.

Definition at line 100 of file __init__.py.

Definition at line 100 of file __init__.py.

Definition at line 100 of file __init__.py.

Definition at line 100 of file __init__.py.

Definition at line 100 of file __init__.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:05 for MDC09a by doxygen 1.7.4