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

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 target_de_name
 gds_de_name
 lso_de_name
 coorSvc
 statsSvc
 outputstat
 counter
 hist

Detailed Description

Definition at line 25 of file AdPerformance.py.


Constructor & Destructor Documentation

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

Definition at line 27 of file AdPerformance.py.

00028                            :
00029         GaudiAlgo.__init__(self,name)
00030 
00031         return
    

Member Function Documentation

def chkIBD::AdPerformance::plotIbdBasics::initialize (   self)

Definition at line 32 of file AdPerformance.py.

00033                         :
00034         print "Initializing the IBD basic ploter", self.name()
00035         status = GaudiAlgo.initialize(self)
00036         if status.isFailure(): return status
00037 
00038         self.target_de_name = '/dd/Structure/AD/db-ade1/db-sst1/db-oil1'
00039         self.gds_de_name = '/dd/Structure/AD/db-gds1'
00040         self.lso_de_name = '/dd/Structure/AD/db-lso1'
00041 
00042         # What services do you need?
00043         self.coorSvc = self.svc('ICoordSysSvc', 'CoordSysSvc')
00044         if not self.coorSvc:
00045             print 'Failed to get CoordSysSvc'
00046             return FAILURE
00047         
00048         self.statsSvc = self.svc('IStatisticsSvc','StatisticsSvc')
00049         if self.statsSvc == None:
00050             self.error("Failed to initialize IStat service.")
00051             return FAILURE        
00052 
00053         # output file
00054         self.outputstat = open('IbdStat.txt', 'w')
00055         
00056         # Counters
00057         self.counter = {}
00058         self.counter["nInGdLS"] = 0.
00059         
00060         self.counter["nInIAV"] = 0.
00061         self.counter["nInLSO"] = 0.
00062         self.counter["nInOAV"] = 0.
00063         self.counter["nInMO"] = 0.
00064         
00065         
00066         self.counter["nCap"] = 0.
00067         self.counter["nGen"] = 0.
00068         
00069         self.counter["SpillIn_onGd"] = 0.
00070         self.counter["LSSpillIn_onGd"] = 0.
00071         self.counter["IavSpillIn_onGd"] = 0.
00072         self.counter["SpillOut"] = 0.
00073         self.counter["OilSpillIn_onH"] = 0.
00074         self.counter["OavSpillIn_onH"] = 0.
00075         self.counter["SpillOut_onH"] = 0.
00076         
00077         self.counter["onGdCap"] = 0.           # total on-Gd cap
00078         self.counter["onGdGdsCap"] = 0.        # total on-Gd cap in GDS
00079 
00080         # Add ratios of capture target in GdLS, Liang Zhan 
00081         ###########################################################
00082         self.counter["onHCapGds"] = 0.        # total on-H cap in GDS
00083         self.counter["onCCapGds"] = 0.        # total on-C cap in GDS
00084         self.counter["onOtherCapGds"] = 0.        # total other cap in GDS
00085         ###########################################################
00086 
00087         # Add coincidence time cut, Liang Zhan
00088         ################################################
00089         self.counter["nGdsCapTime"] = 0.
00090         self.counter["nGdsCapTimePassCut"] = 0.
00091         self.counter["nGdsCapTimeL"] = 0.
00092         self.counter["nGdsCapTimeUncertainL"] = 0.
00093         self.counter["nGdsCapTimeH"] = 0.
00094         self.counter["nGdsCapTimeUncertainH"] = 0.
00095 
00096         self.counter["nLSCapTime"] = 0.
00097         self.counter["nLSCapTimePassCut"] = 0.
00098         self.counter["nLSCapTimeL"] = 0.
00099         self.counter["nLSCapTimeUncertainL"] = 0.
00100         self.counter["nLSCapTimeH"] = 0.
00101         self.counter["nLSCapTimeUncertainH"] = 0.
00102         ################################################
00103         
00104         self.counter["onGdCapPassCut"] = 0.    # total on-Gd cap pass Gd cut
00105         self.counter["onGdGdsCapPassCut"] = 0. # total on-Gd cap in GDS pass Gd cut
00106         self.counter["onGdGdsCapPassEdepCut"] = 0. # total on-Gd cap in GDS pass Gd cut (6 MeV true deposit energy)
00107         self.counter["nPassGdCut"] = 0.        # total pass Gd cut
00108 
00109         self.counter["GdCapDetEff"] = 0.
00110         self.counter["GdCapDetEffUncertain"] = 0.
00111 
00112         self.counter["onGdCapCutUncertain"] = 0.     
00113         self.counter["nGdCutUncertain"] = 0.
00114         self.counter["onGdGdsCapCutUncertain"] = 0.
00115 
00116         self.counter["positronPassCut"] = 0.
00117         self.counter["positronCutUncertain"] = 0.
00118         
00119         self.counter["nonGdPassGdCut"] = 0.
00120 
00121         self.counter["onHCap"] = 0.
00122         self.counter["onHCapWithinLS"] = 0.
00123         self.counter["onHCapWithinLSPassCut"] = 0.
00124         self.counter["onHCapWithinLSCutUncertainL"] = 0.
00125         self.counter["onHCapWithinLSCutUncertainU"] = 0.
00126 
00127         self.counter["HCapDetEff"] = 0.
00128         self.counter["HCapDetEffUncertainL"] = 0.
00129         self.counter["HCapDetEffUncertainU"] = 0.
00130 
00131         self.counter["HCapCanoDetEff"] = 0.
00132         self.counter["HCapCanoDetEffUncertainL"] = 0.
00133         self.counter["HCapCanoDetEffUncertainU"] = 0.
00134 
00135         self.counter["HCapDetContamination"] = 0.
00136         self.counter["HCapDetEffContaminationUncertainL"] = 0.
00137         self.counter["HCapDetEffContaminationUncertainU"] = 0.
00138 
00139         self.counter["nonHCapWithinLSPassHCut"] = 0.
00140         self.counter["nonHCapWithinLSHCutUncertainL"] = 0.
00141         self.counter["nonHCapWithinLSHCutUncertainU"] = 0.
00142 
00143         self.counter["onHCapBeyondLS"] = 0.
00144         self.counter["onHCapBeyondLSPassCut"] = 0.
00145         self.counter["onHCapBeyondLSCutUncertainL"] = 0.
00146         self.counter["onHCapBeyondLSCutUncertainU"] = 0.
00147 
00148         self.counter["nonHCapBeyondLSPassHCut"] = 0.
00149         self.counter["nonHCapBeyondLSHCutUncertainL"] = 0.
00150         self.counter["nonHCapBeyondLSHCutUncertainU"] = 0.
00151 
00152         self.counter["onHCapOavMoPassCut"] = 0.
00153         self.counter["onHCapOavMoCutUncertainL"] = 0.
00154         self.counter["onHCapOavMoCutUncertainU"] = 0.
00155         self.counter["onHCapLS"] = 0.
00156         self.counter["onHCapMO"] = 0.
00157         self.counter["onHCapOAV"] = 0.
00158         
00159         self.counter["onHCapPassCut"] = 0.
00160         self.counter["onHCapCutUncertainL"] = 0.
00161         self.counter["onHCapCutUncertainU"] = 0.
00162         
00163         self.counter["nPassHCut"] = 0.
00164         self.counter["nHCutUncertainL"] = 0.
00165         self.counter["nHCutUncertainU"] = 0.
00166 
00167         self.counter["nGdPassHCut"] = 0.
00168         self.counter["nGdHCutUncertainL"] = 0.
00169         self.counter["nGdHCutUncertainU"] = 0.
00170 
00171         # Histograms
00172         self.hist = {}
00173         
00174         self.hist["genRZ"] = TH2F("genRZ", "Generation Vertex R-Z",
00175                                   100, 0.0, 6.190144, 100, -2.48, 2.48)
00176         status = self.statsSvc.put('/file1/basics/genRZ', 
00177                                       self.hist["genRZ"])
00178         if status.isFailure(): return status
00179         
00180         self.hist["genXY"] = TH2F("genXY", "Generation Vertex X-Y", 
00181                                   100, -2.48, 2.48, 100, -2.48, 2.48)
00182         status = self.statsSvc.put('/file1/basics/genXY', 
00183                                       self.hist["genXY"])
00184         if status.isFailure(): return status
00185         
00186         self.hist["HitTime"] = TH1F("HitTime", "Hit Time [#mus]",
00187                                     10000, 0.0, 10.0)
00188         status = self.statsSvc.put('/file1/basics/HitTime', 
00189                                       self.hist["HitTime"])
00190         if status.isFailure(): return status
00191 
00192         self.hist["LongHitTime"] = TH1F("LongHitTime", "Hit Time [#mus]",
00193                                         2000, 0.0, 2000.)
00194         status = self.statsSvc.put('/file1/basics/LongHitTime', 
00195                                       self.hist["LongHitTime"])
00196         if status.isFailure(): return status
00197 
00198         self.hist["GdCapHitTime"] = TH1F("GdCapHitTime",
00199                                          "Gd n-Capture Hit Time [#mus]",
00200                                          2000, 0.0, 2000)
00201         status = self.statsSvc.put('/file1/basics/GdCapHitTime', 
00202                                       self.hist["GdCapHitTime"])
00203         if status.isFailure(): return status
00204         
00205         self.hist["HCapHitTime"] = TH1F("HCapHitTime",
00206                                         "H n-Capture Hit Time [#mus]",
00207                                         2000, 0.0, 2000)
00208         status = self.statsSvc.put('/file1/basics/HCapHitTime', 
00209                                       self.hist["HCapHitTime"])
00210         if status.isFailure(): return status
00211       
00212         
00213         self.hist["hCapTarget"] = TH1F("hCapTarget",
00214                                         "n-Capture Target-Z",
00215                                         100, 0, 100)
00216         status = self.statsSvc.put('/file1/basics/hCapTarget', 
00217                                       self.hist["hCapTarget"])
00218         if status.isFailure(): return status
00219         
00220         # Add time response, Liang Zhan
00221         #################################################################
00222         self.hist["event_span_time"] = TH1F("event_span_time",
00223                                             "Hit span time for one event [ns]",
00224                                             500, 0, 500)
00225         status = self.statsSvc.put('/file1/basics/event_span_time', 
00226                                       self.hist["event_span_time"])
00227         if status.isFailure(): return status
00228         self.hist["pmt_span_time"] = TH1F("pmt_span_time",
00229                                             "Hit span time for one pmt [ns]",
00230                                             500, 0, 500)
00231         status = self.statsSvc.put('/file1/basics/pmt_span_time', 
00232                                       self.hist["pmt_span_time"])
00233         if status.isFailure(): return status
00234         self.hist["pmt_hit_time"] = TH1F("pmt_hit_time",
00235                                             "pmt first hit time [ns]",
00236                                             500, 0, 500)
00237         status = self.statsSvc.put('/file1/basics/pmt_hit_time', 
00238                                       self.hist["pmt_hit_time"])
00239         if status.isFailure(): return status
00240         #################################################################
00241         
00242         self.hist["pe_E"] = TH2F("pe_E", "PE vs visible E (e+ within GdLS)",
00243                                  100, 0, 10, 700, 0, 1400)
00244         status = self.statsSvc.put('/file1/basics/pe_E', 
00245                                       self.hist["pe_E"])
00246         if status.isFailure(): return status
00247         
00248         self.hist["pe_E_inLS"] = TH2F("pe_E_inLS",
00249                                       "PE vs visible E (e+ within LS)", 
00250                                       100, 0, 10, 700, 0, 1400)
00251         status = self.statsSvc.put('/file1/basics/pe_E_inLS', 
00252                                       self.hist["pe_E_inLS"])
00253         if status.isFailure(): return status
00254 
00255         self.hist["pe_E_LS"] = TH2F("pe_E_LS",
00256                                     "PE vs visible E (e+ in LS)",
00257                                     100, 0, 10, 700, 0, 1400)
00258         status = self.statsSvc.put('/file1/basics/pe_E_LS', 
00259                                       self.hist["pe_E_LS"])
00260         if status.isFailure(): return status
00261 
00262         self.hist["pe_E_all"] = TH2F("pe_E_all", "PE vs visible E (all e+)",
00263                                      100, 0, 10, 700, 0, 1400)
00264         status = self.statsSvc.put('/file1/basics/pe_E_all', 
00265                                       self.hist["pe_E_all"])
00266         if status.isFailure(): return status
00267         
00268         # Add response on position, Liang Zhan
00269         #############################################################
00270         self.hist["pe_yield_R2"] = TH2F("pe_yield_R2", "PE/Evis vs. R2",
00271                                         620, 0, 6.190144, 300, 0, 300) 
00272         status = self.statsSvc.put('/file1/basics/pe_yield_R2', 
00273                                       self.hist["pe_yield_R2"])
00274         if status.isFailure(): return status
00275         self.hist["pe_yield_Z"] = TH2F("pe_yield_Z", "PE/Evis vs. Z",
00276                                         200, -2.5, 2.5, 300, 0, 300) 
00277         status = self.statsSvc.put('/file1/basics/pe_yield_Z', 
00278                                       self.hist["pe_yield_Z"])
00279         if status.isFailure(): return status
00280         self.hist["pe_yield_RZ"] = TH3F("pe_yield_RZ", "PE/Evis vs. RZ",
00281                                        4, 0, 1.55, 8, -1.55, 1.55, 300, 0, 300) 
00282         status = self.statsSvc.put('/file1/basics/pe_yield_RZ', 
00283                                       self.hist["pe_yield_RZ"])
00284         if status.isFailure(): return status
00285         #############################################################
00286         
00287         self.hist["nHits_LS"] = TH1F("nHits_LS", 
00288                                      "nCap Hits in LS",
00289                                      700, 0, 1400)
00290         status = self.statsSvc.put('/file1/basics/nHits_LS', 
00291                                       self.hist["nHits_LS"])
00292         if status.isFailure(): return status
00293         
00294         self.hist["nHits_MO"] = TH1F("nHits_MO", 
00295                                      "nCap Hits in MO",
00296                                      700, 0, 1400)
00297         status = self.statsSvc.put('/file1/basics/nHits_MO', 
00298                                       self.hist["nHits_MO"])
00299         if status.isFailure(): return status
00300         
00301         self.hist["nHits_onGd"] = TH1F("nHits_onGd",
00302                                        "on-Gd nCap Hits",
00303                                        700, 0, 1400)
00304         status = self.statsSvc.put('/file1/basics/nHits_onGd', 
00305                                       self.hist["nHits_onGd"])
00306         if status.isFailure(): return status
00307         
00308         self.hist["nHits_onH"] = TH1F("nHits_onH", 
00309                                       "on-H nCap Hits", 
00310                                       700, 0, 1400)
00311         status = self.statsSvc.put('/file1/basics/nHits_onH', 
00312                                       self.hist["nHits_onH"])
00313         if status.isFailure(): return status
00314         
00315         self.hist["nHits"] = TH1F("nHits", "Neutron Capture Hits in GdLS",
00316                                   700, 0, 1400)
00317         status = self.statsSvc.put('/file1/basics/nHits', 
00318                                       self.hist["nHits"])
00319         if status.isFailure(): return status
00320         
00321         self.hist["nHits_all"] = TH1F("nHits_all", "Neutron Capture Hits",
00322                                   700, 0, 1400)
00323         status = self.statsSvc.put('/file1/basics/nHits_all', 
00324                                       self.hist["nHits_all"])
00325         if status.isFailure(): return status
00326 
00327         self.hist["nGdCapGenPos"] = TH1F("nGdCapGenPos",
00328                                          "Neutron Gd Capture Generation Position",
00329                                          620, 0, 6.190144)
00330         status = self.statsSvc.put('/file1/basics/nGdCapGenPos',
00331                                       self.hist["nGdCapGenPos"])
00332         if status.isFailure(): return status
00333         
00334         self.hist["nGdGdsCapGenPos"] = TH1F("nGdGdsCapGenPos",
00335                                             "Neutron Gd Capture in Gds Generation Position",
00336                                             620, 0, 6.190144)
00337         status = self.statsSvc.put('/file1/basics/nGdGdsCapGenPos',
00338                                       self.hist["nGdGdsCapGenPos"])
00339         if status.isFailure(): return status
00340         
00341         self.hist["nGdCapPos"] = TH3F("nGdCapPos",
00342                                       "Neutron Gd Capture Position",
00343                                       100, -2.5, 2.5,
00344                                       100, -2.5, 2.5,
00345                                       100, -2.5, 2.5)
00346         status = self.statsSvc.put('/file1/basics/nGdCapPos',
00347                                       self.hist["nGdCapPos"])
00348         if status.isFailure(): return status
00349 
00350         self.hist["nGdCapOilPos"] = TH3F("nGdCapOilPos",
00351                                          "Neutron Gd Capture beyond GdLS Position",
00352                                          100, -2.5, 2.5,
00353                                          100, -2.5, 2.5,
00354                                          100, -2.5, 2.5)
00355         status = self.statsSvc.put('/file1/basics/nGdCapOilPos',
00356                                       self.hist["nGdCapOilPos"])
00357         if status.isFailure(): return status
00358 
00359         self.hist["nGdCapOilPos_RZ"] = TH2F("nGdCapOilPos_RZ",
00360                                             "Gd Cap beyond GdLS R-Z",
00361                                             100, 0.0, 6.25,
00362                                             100, -2.5, 2.5)
00363         status = self.statsSvc.put('/file1/basics/nGdCapOilPos_RZ',
00364                                       self.hist["nGdCapOilPos_RZ"])
00365         if status.isFailure(): return status
00366 
00367         # Add Gd and H capture position, Liang Zhan.
00368         ##########################################################
00369         self.hist["nGdGdsCapPos_R"] = TH1F("nGdGdsCapPos_R",
00370                                            "Gd Cap R^{2} position in GdLS",
00371                                            620, 0, 6.190144)
00372         status = self.statsSvc.put('/file1/basics/nGdGdsCapPos_R',
00373                                       self.hist["nGdGdsCapPos_R"])
00374         if status.isFailure(): return status
00375 
00376         self.hist["nHCapPos_R"] = TH1F("nHCapPos_R",
00377                                            "H Cap R^{2} position",
00378                                            620, 0, 6.190144)
00379         status = self.statsSvc.put('/file1/basics/nHCapPos_R',
00380                                       self.hist["nHCapPos_R"])
00381         if status.isFailure(): return status
00382         ##########################################################
00383 
00384         self.hist["nHCapGenPos"] = TH1F("nHCapGenPos",
00385                                         "Neutron H Capture Generation Position",
00386                                         620, 0, 6.190144)
00387         status = self.statsSvc.put('/file1/basics/nHCapGenPos',
00388                                       self.hist["nHCapGenPos"])
00389         if status.isFailure(): return status
00390 
00391 
00392         self.hist["nHOilCapGenPos"] = TH1F("nHOilCapGenPos",
00393                                            "Neutron H Capture Generation Position",
00394                                            620, 0, 6.190144)
00395         status = self.statsSvc.put('/file1/basics/nHOilCapGenPos',
00396                                       self.hist["nHOilCapGenPos"])
00397         if status.isFailure(): return status
00398 
00399         self.hist["nHLsoCapGenPos"] = TH1F("nHLsoCapGenPos",
00400                                            "Neutron H Capture Generation Position",
00401                                            620, 0, 6.190144)
00402         status = self.statsSvc.put('/file1/basics/nHLsoCapGenPos',
00403                                       self.hist["nHLsoCapGenPos"])
00404         if status.isFailure(): return status
00405 
00406 
00407         self.hist["eDepInGdLS"] = TH1F("eDepInGdLS", "Deposited Energy [MeV]",
00408                                        200, 0, 20)
00409         status = self.statsSvc.put('/file1/basics/eDepInGdLS', 
00410                                       self.hist["eDepInGdLS"])
00411         if status.isFailure(): return status
00412 
00413         self.hist["eDepInLS"] = TH1F("eDepInLS", "Deposited Energy [MeV]",
00414                                        200, 0, 20)
00415         status = self.statsSvc.put('/file1/basics/eDepInLS', 
00416                                       self.hist["eDepInLS"])
00417         if status.isFailure(): return status
00418 
00419         self.hist["drift_GdLS"] = TH1F("drift_GdLS",
00420                                       "Neutron Drift Distance in GdLS [cm]",
00421                                        200, 0, 50)
00422         status = self.statsSvc.put('/file1/basics/drift_GdLS', 
00423                                       self.hist["drift_GdLS"])
00424         if status.isFailure(): return status
00425 
00426         self.hist["drift_LS"] = TH1F("drift_LS",
00427                                       "Neutron Drift Distance in LS [cm]",
00428                                        200, 0, 50)
00429         status = self.statsSvc.put('/file1/basics/drift_LS', 
00430                                       self.hist["drift_LS"])
00431         if status.isFailure(): return status
00432         
00433         self.hist["time_GdLS"] = TH1F("time_GdLS",
00434                                       "Neutron Capture time in GdLS [#mus]",
00435                                        400, 0, 400)
00436         status = self.statsSvc.put('/file1/basics/time_GdLS', 
00437                                       self.hist["time_GdLS"])
00438         if status.isFailure(): return status
00439 
00440         self.hist["time_LS"] = TH1F("time_LS",
00441                                       "Neutron Capture Time in LS [#mus]",
00442                                        400, 0, 2000)
00443         status = self.statsSvc.put('/file1/basics/time_LS', 
00444                                       self.hist["time_LS"])
00445         if status.isFailure(): return status
00446 
00447         #sub-volume eff
00448         self.hist["countR"] = TH1F("countR",
00449                                    "counts in each sub-R",
00450                                    16,0, 2.4);
00451         status = self.statsSvc.put('/file1/basics/countR', 
00452                                    self.hist["countR"])
00453         if status.isFailure(): return status
00454         
00455         self.hist["countCutR"] = TH1F("countCutR",
00456                                       "counts above cut in each sub-R",
00457                                       16, 0, 2.4)
00458         status = self.statsSvc.put('/file1/basics/countCutR', 
00459                                    self.hist["countCutR"])
00460         if status.isFailure(): return status
00461         
00462         self.hist["countZ"] = TH1F("countZ",
00463                                    "counts in each sub-Z",
00464                                    16, -1.55, 1.55)
00465         status = self.statsSvc.put('/file1/basics/countZ', 
00466                                    self.hist["countZ"])
00467         if status.isFailure(): return status
00468         
00469         self.hist["countCutZ"] = TH1F("countCutZ",
00470                                       "counts above cut in each sub-Z",
00471                                       16, -1.55, 1.55)
00472         status = self.statsSvc.put('/file1/basics/countCutZ', 
00473                                    self.hist["countCutZ"])
00474         if status.isFailure(): return status
00475         
00476         self.hist["count"] = TH2F("count",
00477                                   "counts in each sub-volume",
00478                                   10, 0, 2.4, 10, -1.55, 1.55 )
00479         status = self.statsSvc.put('/file1/basics/count', 
00480                                    self.hist["count"])
00481         if status.isFailure(): return status
00482         
00483         self.hist["countCut"] = TH2F("countCut",
00484                                      "counts above cut in each sub-volume",
00485                                      10, 0, 2.4, 10, -1.55, 1.55 )
00486         status = self.statsSvc.put('/file1/basics/countCut', 
00487                                    self.hist["countCut"])
00488         if status.isFailure(): return status
00489         
00490         self.hist["countPECut"] = TH2F("countPECut",
00491                                        "counts above PE cut in each sub-volume",
00492                                        10, 0, 2.4, 10, -1.55, 1.55 )
00493         status = self.statsSvc.put('/file1/basics/countPECut', 
00494                                    self.hist["countPECut"])
00495         if status.isFailure(): return status
00496         
00497         self.hist["eff"] = TH2F("eff", "efficiency in each sub-volume",
00498                                 10, 0, 2.4, 10, -1.55, 1.55 )
00499         status = self.statsSvc.put('/file1/basics/eff', 
00500                                    self.hist["eff"])
00501         if status.isFailure(): return status        
00502 
00503         self.hist["effR"] = TH1F("effR", "efficiency in each sub-volume",
00504                                  16, 0, 2.4)
00505         status = self.statsSvc.put('/file1/basics/effR', 
00506                                    self.hist["effR"])
00507         if status.isFailure(): return status
00508         
00509         self.hist["effZ"] = TH1F("effZ", "efficiency in each sub-volume",
00510                                  16, -1.55, 1.55)
00511         
00512         status = self.statsSvc.put('/file1/basics/effZ', 
00513                                    self.hist["effZ"])
00514         if status.isFailure(): return status        
00515 
00516         #sub-volume eff H
00517         self.hist["HcountR"] = TH1F("HcountR",
00518                                     "counts in each sub-R",
00519                                     26, 0, 3.92);
00520         status = self.statsSvc.put('/file1/basics/HcountR', 
00521                                    self.hist["HcountR"])
00522         if status.isFailure(): return status
00523         
00524         self.hist["HcountCutR"] = TH1F("HcountCutR",
00525                                        "counts above cut in each sub-R",
00526                                        26, 0, 3.92)
00527         status = self.statsSvc.put('/file1/basics/HcountCutR', 
00528                                    self.hist["HcountCutR"])
00529         if status.isFailure(): return status
00530         
00531         self.hist["HcountZ"] = TH1F("HcountZ",
00532                                     "counts in each sub-Z",
00533                                     26, -1.98, 1.98)
00534         status = self.statsSvc.put('/file1/basics/HcountZ', 
00535                                    self.hist["HcountZ"])
00536         if status.isFailure(): return status
00537         
00538         self.hist["HcountCutZ"] = TH1F("HcountCutZ",
00539                                       "counts above cut in each sub-Z",
00540                                       26, -1.98, 1.98)
00541         status = self.statsSvc.put('/file1/basics/HcountCutZ', 
00542                                    self.hist["HcountCutZ"])
00543         if status.isFailure(): return status
00544         
00545         self.hist["Hcount"] = TH2F("Hcount",
00546                                    "counts in each sub-volume",
00547                                    12, 0, 3.92, 12, -1.98, 1.98)
00548         status = self.statsSvc.put('/file1/basics/Hcount', 
00549                                    self.hist["Hcount"])
00550         if status.isFailure(): return status
00551         
00552         self.hist["HcountCut"] = TH2F("HcountCut",
00553                                       "counts above cut in each sub-volume",
00554                                       12, 0, 3.92, 12, -1.98, 1.98)
00555         status = self.statsSvc.put('/file1/basics/HcountCut', 
00556                                    self.hist["HcountCut"])
00557         if status.isFailure(): return status
00558         
00559         self.hist["HcountPECut"] = TH2F("HcountPECut",
00560                                         "counts above PE cut in each sub-volume",
00561                                         12, 0, 3.92, 12, -1.98, 1.98)
00562         status = self.statsSvc.put('/file1/basics/HcountPECut', 
00563                                    self.hist["HcountPECut"])
00564         if status.isFailure(): return status
00565         
00566         return SUCCESS

def chkIBD::AdPerformance::plotIbdBasics::execute (   self)

Definition at line 567 of file AdPerformance.py.

00568                      :
00569         print "Executing plotIbdBasics", self.name()
00570         evt = self.evtSvc()
00571         simhdr = evt['/Event/Sim/SimHeader']
00572 #        print "SimHeader: ", simhdr
00573         if simhdr == None:
00574             print "No SimHeader in this ReadOut. Skip."
00575             return SUCCESS
00576 
00577 #        det = self.detSvc(self.target_de_name)
00578 #        det_gds = self.detSvc(self.gds_de_name)
00579 #        det_lso = self.detSvc(self.lso_de_name)
00580 
00581         # Unobservables
00582         statshdr = simhdr.unobservableStatistics()
00583         stats = statshdr.stats()
00584 
00585         PID_trk1 = stats["pdgId_Trk1"].sum()
00586         PID_trk2 = stats["pdgId_Trk2"].sum()
00587 
00588         if PID_trk1 != -11 or PID_trk2 != 2112:
00589             print "PID of track 1 is", PID_trk1
00590             print "PID of track 2 is", PID_trk2
00591             print "Not an IBD event."
00592             return SUCCESS
00593 
00594         tGen = stats["t_Trk2"].sum()
00595         xGen = stats["x_Trk2"].sum()
00596         yGen = stats["y_Trk2"].sum()
00597         zGen = stats["z_Trk2"].sum()
00598         
00599         tCap = stats["tEnd_Trk2"].sum()
00600         xCap = stats["xEnd_Trk2"].sum()
00601         yCap = stats["yEnd_Trk2"].sum()
00602         zCap = stats["zEnd_Trk2"].sum()
00603         
00604         # Get underlying DE object
00605         de = self.getDet(self.target_de_name)
00606         if not de:
00607             print 'Failed to get DE',self.target_de_name
00608             return FAILURE
00609         
00610 #        de_lso = self.getDet(self.lso_de_name)
00611 #        de_gds = self.getDet(self.gds_de_name)
00612 #        if not de_lso:
00613 #            print 'Failed to get DE',self.lso_de_name
00614 #            return FAILURE        
00615 #        if not de_gds:
00616 #            print 'Failed to get DE',self.gds_de_name
00617 #            return FAILURE
00618         
00619         # Get the AD coordinates of the vertexes
00620         Gaudi = PyCintex.makeNamespace('Gaudi')
00621         genGlbPoint = Gaudi.XYZPoint(xGen, yGen, zGen)
00622         capGlbPoint = Gaudi.XYZPoint(xCap, yCap, zCap)
00623 #        point = de.geometry().toGlobal(point)
00624         genLclPoint = de.geometry().toLocal(genGlbPoint)
00625         capLclPoint = de.geometry().toLocal(capGlbPoint)
00626 #        genLclPointLso = de_lso.geometry().toLocal(genGlbPoint)
00627 #        capLclPointLso = de_lso.geometry().toLocal(capGlbPoint)
00628 #        genLclPointGds = de_gds.geometry().toLocal(genGlbPoint)
00629 #        capLclPointGds = de_gds.geometry().toLocal(capGlbPoint)
00630 #        print 'In global coordinate [',gpoint.x(),gpoint.y(),gpoint.z(),']'
00631 
00632         ndrift = ROOT.TVector3(xCap-xGen, yCap-yGen, zCap-zGen)
00633         
00634         capTime = tCap - tGen
00635         capDis = ndrift.Mag()
00636 
00637         R2 = genLclPoint.x()/units.meter * genLclPoint.x()/units.meter + \
00638              genLclPoint.y()/units.meter * genLclPoint.y()/units.meter
00639         
00640         R2Cap = capLclPoint.x()/units.meter * capLclPoint.x()/units.meter + \
00641                 capLclPoint.y()/units.meter * capLclPoint.y()/units.meter
00642 
00643         self.hist["genRZ"].Fill(R2, genLclPoint.z()/units.meter)
00644 
00645         self.hist["genXY"].Fill(genLclPoint.x()/units.meter,genLclPoint.y()/units.meter)
00646 
00647         # Find the interesting volumes
00648         genDE = self.coorSvc.coordSysDE(genGlbPoint)
00649         capDE = self.coorSvc.coordSysDE(capGlbPoint)
00650         if not genDE:
00651             print 'Failed to find coordinate system DE for generation'\
00652                 '[',genGlbPoint.x(),genGlbPoint.y(),genGlbPoint.z(),']'
00653             print 'Local: [',genLclPoint.x(),genLclPoint.y(),genLclPoint.z(),']'
00654             return FAILURE
00655         else:
00656             self.counter["nGen"] += 1
00657             gendmvol = genDE.geometry().belongsToPath(genGlbPoint,-1)
00658 
00659         if not capDE:
00660             print 'Failed to find coordinate system DE for capture'\
00661                 '[',capGlbPoint.x(),capGlbPoint.y(),capGlbPoint.z(),']'
00662             return FAILURE
00663         else:
00664             self.counter["nCap"] += 1
00665             capdmvol = capDE.geometry().belongsToPath(capGlbPoint,-1)
00666 
00667         genDM = re.split('/', gendmvol).pop()
00668         capDM = re.split('/', capdmvol).pop()
00669         print "Generated in ", genDM
00670         print "Captured in ", capDM
00671         
00672         positronHits = 0.
00673         neutronHits = 0.
00674         positronTimeCut = 500.
00675 
00676         # Add coincidence time cut, Liang Zhan
00677         ################################################
00678         timeCutL = 1 #mus
00679         timeCutH = 200 #mus
00680         timeCutUncertain = 0.01 #mus, 10ns
00681         ################################################
00682  
00683         positronCut = 126.2  # 1 MeV
00684         positronCutL = 123.7 # 1 MeV
00685         positronCutR = 128.7 # 1 MeV
00686 
00687 #        onHLowerCut = 194.   # 1.5 MeV
00688 #        onHLowerCutL = 190.1 # 194 (1 - 2%)
00689 #        onHLowerCutR = 197.9 # 194 (1 + 2%)
00690                 
00691 #        onHUpperCut = 453.  # 3.5 MeV
00692 #        onHUpperCutL = 443.9 # 453 (1 - 2%)
00693 #        onHUpperCutR = 462.1 # 453 (1 + 2%)
00694 
00695         onHLowerCut = 175.   # ? MeV
00696         onHLowerCutL = 171.5 # x (1 - 2%)
00697         onHLowerCutR = 178.5 # x (1 + 2%)
00698 
00699         onHUpperCut = 481.4  # 3.5 MeV
00700         onHUpperCutL = 471.8 # x (1 - 2%)
00701         onHUpperCutR = 491.0 # x (1 + 2%)
00702 
00703         onGdCut = 811.  # 6MeV
00704         onGdCutL = 802.9 # 811 (1 - 1%)
00705         onGdCutR = 819.1 # 811 (1 + 1%)
00706 
00707         # Capture target
00708         capTarget = stats["capTarget"].sum()
00709         print "The capture target is ", capTarget
00710 
00711         # Deposit energy
00712         eDepInGdLS = stats["EDepInGdLS"].sum()
00713         self.hist["eDepInGdLS"].Fill(eDepInGdLS/units.MeV)
00714         eDepInLS = stats["EDepInLS"].sum()
00715         self.hist["eDepInLS"].Fill(eDepInLS/units.MeV)
00716 
00717         # For PE hit time, Liang Zhan
00718         firstHit = {} #dictionary for PMT first hit, key is PMT id
00719         lastHit = {} #dictionary for PMT last hit, key is PMT id
00720         hitMap = {} #pmt hit map
00721         firstT = 501 # time of first hit in one event 
00722         lastT = -1 # time of last hit in one event
00723 
00724         simhits = simhdr.hits()
00725         for detector in simhits.hitDetectors():
00726             hitCollection = simhits.hitsByDetector(detector)
00727             if hitCollection == None:
00728                 print "No hits in ", detector
00729             hits = hitCollection.collection()
00730             for hit in hits:
00731 #                print " PMT", hit.sensDetId(), "hit @ time: ", hit.hitTime()
00732                 pmtId = hit.sensDetId() 
00733                 self.hist["HitTime"].Fill(hit.hitTime()/units.microsecond)
00734                 self.hist["LongHitTime"].Fill(hit.hitTime()/units.microsecond)
00735                 if hit.hitTime()/units.nanosecond<positronTimeCut and \
00736                         hit.hitTime()/units.nanosecond<capTime/units.nanosecond:
00737                     positronHits += 1
00738                     hitTime = hit.hitTime()/units.nanosecond
00739                     if hitMap.has_key(pmtId):
00740                         hitMap[pmtId] += 1
00741                     else:
00742                         hitMap[pmtId] = 1.
00743                     if firstT > hitTime:
00744                         firstT = hitTime
00745                     if lastT < hitTime:
00746                         lastT = hitTime
00747                     if not firstHit.has_key(pmtId):
00748                         firstHit[pmtId] = hitTime                     
00749                         lastHit[pmtId] = hitTime                     
00750                     else:
00751                         if firstHit[pmtId] > hitTime:
00752                             firstHit[pmtId] = hitTime   
00753                         if lastHit[pmtId] < hitTime:
00754                             lastHit[pmtId] = hitTime   
00755                 else:
00756                     neutronHits += 1.
00757                     if capTarget == 1:
00758                         self.hist["HCapHitTime"].Fill(hit.hitTime()/units.microsecond)
00759                     if capTarget == 64:
00760                         self.hist["GdCapHitTime"].Fill(hit.hitTime()/units.microsecond)
00761 
00762         # Fill time
00763         if positronHits > 1.5:  # 2 hits at least
00764             self.hist["event_span_time"].Fill(lastT-firstT)
00765         for id in firstHit.keys():
00766             self.hist["pmt_hit_time"].Fill(firstHit[id]-firstT)
00767             if hitMap[id] > 1.5:  # 2 hits at least
00768                 self.hist["pmt_span_time"].Fill(lastHit[id]-firstHit[id])
00769 
00770         # Visible energy
00771         vis_trk1 = 1.022 + stats['ke_Trk1'].sum()/units.MeV
00772         self.hist["pe_E_all"].Fill(vis_trk1, positronHits)
00773 
00774         if genLclPoint.z()/units.m < 1. and genLclPoint.z()/units.m > -1.:
00775             self.hist["pe_yield_R2"].Fill(R2, positronHits/vis_trk1)
00776         if R2 < 1.:
00777             self.hist["pe_yield_Z"].Fill(genLclPoint.z()/units.m, positronHits/vis_trk1)
00778 
00779         self.hist["nHits_all"].Fill(neutronHits)
00780 
00781         if genDM == 'db-gds1':
00782             self.counter["nInGdLS"] += 1
00783             self.hist["pe_E"].Fill(vis_trk1, positronHits)
00784             self.hist["pe_yield_RZ"].Fill(ROOT.sqrt(R2), genLclPoint.z()/units.m, positronHits/vis_trk1)
00785             if capDM == 'db-gds1':
00786                 self.hist["nHits"].Fill(neutronHits)
00787                 self.hist["drift_GdLS"].Fill(capDis/units.cm)
00788                 self.hist["time_GdLS"].Fill(capTime/units.microsecond)
00789                 self.counter["nGdsCapTime"] += 1
00790                 if(capTime/units.microsecond > timeCutL and capTime/units.microsecond < timeCutH):
00791                     self.counter["nGdsCapTimePassCut"] += 1
00792                 if(capTime/units.microsecond < timeCutL):
00793                     self.counter["nGdsCapTimeL"] += 1
00794                 if(capTime/units.microsecond > timeCutH):
00795                     self.counter["nGdsCapTimeH"] += 1
00796                 if(capTime/units.microsecond > timeCutL-timeCutUncertain/2 and capTime/units.microsecond < timeCutL+timeCutUncertain/2):
00797                     self.counter["nGdsCapTimeUncertainL"] += 1
00798                 if(capTime/units.microsecond > timeCutH-timeCutUncertain/2 and capTime/units.microsecond < timeCutH+timeCutUncertain/2):
00799                     self.counter["nGdsCapTimeUncertainH"] += 1
00800             else:
00801                 self.counter["SpillOut"] += 1
00802         
00803         if genDM != 'db-gds1':
00804             if capTarget == 64:
00805                 self.counter["SpillIn_onGd"] += 1
00806                 
00807         if genDM == 'db-iav1':
00808             self.counter["nInIAV"] += 1
00809             if capTarget == 64:
00810                 self.counter["IavSpillIn_onGd"] += 1
00811 
00812         if genDM == 'db-lso1':
00813             self.counter["nInLSO"] += 1
00814             self.hist["pe_E_LS"].Fill(vis_trk1, positronHits)
00815             if capDM == 'db-lso1':
00816                 self.hist["drift_LS"].Fill(capDis/units.cm)
00817                 self.hist["time_LS"].Fill(capTime/units.microsecond)
00818                 self.counter["nLSCapTime"] += 1
00819                 if(capTime/units.microsecond > timeCutL and capTime/units.microsecond < timeCutH):
00820                     self.counter["nLSCapTimePassCut"] += 1
00821                 if(capTime/units.microsecond < timeCutL):
00822                     self.counter["nLSCapTimeL"] += 1
00823                 if(capTime/units.microsecond > timeCutH):
00824                     self.counter["nLSCapTimeH"] += 1
00825                 if(capTime/units.microsecond > timeCutL-timeCutUncertain/2 and capTime/units.microsecond < timeCutL+timeCutUncertain/2):
00826                     self.counter["nLSCapTimeUncertainL"] += 1
00827                 if(capTime/units.microsecond > timeCutH-timeCutUncertain/2 and capTime/units.microsecond < timeCutH+timeCutUncertain/2):
00828                     self.counter["nLSCapTimeUncertainH"] += 1
00829             if capDM == 'db-oil1' or capDM == 'db-oav1':
00830                 self.counter["SpillOut_onH"] += 1
00831             if capTarget == 64:
00832                 self.counter["LSSpillIn_onGd"] += 1
00833 
00834         if genDM == 'db-oav1':
00835             self.counter["nInOAV"] += 1
00836             if re.search('db-lso1', capdmvol) and capTarget == 1:
00837                 self.counter["OavSpillIn_onH"] += 1
00838                 
00839                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00840                     self.counter["onHCapOavMoPassCut"] += 1
00841                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00842                     self.counter["onHCapOavMoCutUncertainL"] += 1
00843                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00844                     self.counter["onHCapOavMoCutUncertainU"] += 1
00845                     
00846         if genDM == 'db-oil1':
00847             self.counter["nInMO"] += 1
00848             if re.search('db-lso1', capdmvol) and capTarget == 1:
00849                 self.counter["OilSpillIn_onH"] += 1
00850                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00851                     self.counter["onHCapOavMoPassCut"] += 1
00852                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00853                     self.counter["onHCapOavMoCutUncertainL"] += 1
00854                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00855                     self.counter["onHCapOavMoCutUncertainU"] += 1
00856 
00857         if re.search('db-lso1',gendmvol):
00858             self.hist["pe_E_inLS"].Fill(vis_trk1, positronHits)
00859 
00860         if re.search('db-lso1',capdmvol):
00861             if capTarget == 1:
00862                 self.counter["onHCapWithinLS"] += 1
00863                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00864                     self.counter["onHCapWithinLSPassCut"] += 1
00865                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00866                     self.counter["onHCapWithinLSCutUncertainL"] += 1
00867                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00868                     self.counter["onHCapWithinLSCutUncertainU"] += 1
00869             else:
00870                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00871                     self.counter["nonHCapWithinLSPassHCut"] += 1
00872                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00873                     self.counter["nonHCapWithinLSHCutUncertainL"] += 1
00874                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00875                     self.counter["nonHCapWithinLSHCutUncertainU"] += 1
00876                 
00877         else:
00878             if capTarget == 1:
00879                 self.counter["onHCapBeyondLS"] += 1
00880                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00881                     self.counter["onHCapBeyondLSPassCut"] += 1
00882                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00883                     self.counter["onHCapBeyondLSCutUncertainL"] += 1
00884                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00885                     self.counter["onHCapBeyondLSCutUncertainU"] += 1
00886             else:
00887                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00888                     self.counter["nonHCapBeyondLSPassHCut"] += 1
00889                 if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00890                     self.counter["nonHCapBeyondLSHCutUncertainL"] += 1
00891                 if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00892                     self.counter["nonHCapBeyondLSHCutUncertainU"] += 1
00893             
00894         # Passing on-Gd neutron cuts
00895         if neutronHits > onGdCut:
00896             self.counter["nPassGdCut"] += 1
00897             if capTarget != 64:
00898                 print "non-Gd capture pass Gd cut: ", capTarget
00899                 self.counter["nonGdPassGdCut"] += 1
00900                 value = ('Non-Gd capTarget: ', capTarget)
00901                 theline = str(value)
00902                 self.outputstat.write(theline)
00903                 self.outputstat.write('\n')
00904                 
00905         if neutronHits > onGdCutL and neutronHits < onGdCutR:
00906             self.counter["nGdCutUncertain"] += 1
00907 
00908         # Passing on-H neutron cuts
00909         if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00910             self.counter["nPassHCut"] += 1
00911             if capTarget == 64:
00912                 self.counter["nGdPassHCut"] += 1
00913         if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00914             self.counter["nHCutUncertainL"] += 1
00915             if capTarget == 64:
00916                 self.counter["nGdHCutUncertainL"] += 1                
00917         if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00918             self.counter["nHCutUncertainU"] += 1
00919             if capTarget == 64:
00920                 self.counter["nGdHCutUncertainU"] += 1
00921         
00922         if capTarget == 64:
00923             self.counter["onGdCap"] += 1
00924             self.hist["nHits_onGd"].Fill(neutronHits)
00925             self.hist["nGdCapPos"].Fill(capLclPoint.x()/units.meter,capLclPoint.y()/units.meter,capLclPoint.z()/units.meter)
00926             if capDM == 'db-gds1':
00927                 self.counter["onGdGdsCap"] += 1
00928                 self.hist["count"].Fill(R2Cap, capLclPoint.z()/units.meter)
00929                 if (eDepInLS/units.MeV + eDepInGdLS/units.MeV) > 6.:
00930                     self.hist["countCut"].Fill(R2Cap, capLclPoint.z()/units.meter)
00931                     self.counter["onGdGdsCapPassEdepCut"] += 1
00932                 
00933                 if capLclPoint.z()/units.m < 1. and capLclPoint.z()/units.m > -1.:
00934                     self.hist["nGdGdsCapPos_R"].Fill(R2Cap)
00935                     self.hist["countR"].Fill(R2Cap)
00936                     if (eDepInLS/units.MeV + eDepInGdLS/units.MeV) > 6.:
00937                         self.hist["countCutR"].Fill(R2Cap)
00938                     
00939                 if R2Cap < 0.64:
00940                     self.hist["countZ"].Fill(capLclPoint.z()/units.m)
00941                     if (eDepInLS/units.MeV + eDepInGdLS/units.MeV) > 6.:
00942                         self.hist["countCutZ"].Fill(capLclPoint.z()/units.m)
00943                         
00944                 if neutronHits > onGdCut:
00945                     self.counter["onGdGdsCapPassCut"] += 1
00946                     self.hist["countPECut"].Fill(R2Cap, capLclPoint.z()/units.meter)
00947                 if neutronHits > onGdCutL and neutronHits < onGdCutR:
00948                     self.counter["onGdGdsCapCutUncertain"] += 1
00949                 if positronHits > positronCut:
00950                     self.counter["positronPassCut"] += 1
00951                 if positronHits > positronCutL and positronHits < positronCutR:
00952                     self.counter["positronCutUncertain"] += 1
00953             else:
00954                 self.hist["nGdCapOilPos"].Fill(capLclPoint.x()/units.meter,capLclPoint.y()/units.meter,capLclPoint.z()/units.meter)
00955                 self.hist["nGdCapOilPos_RZ"].Fill(R2Cap, capLclPoint.z()/units.meter)
00956 
00957             if genLclPoint.z()/units.m < 1. and genLclPoint.z()/units.m > -1.:
00958                 self.hist["nGdCapGenPos"].Fill(R2)
00959                 if capDM == 'db-gds1':
00960                     self.hist["nGdGdsCapGenPos"].Fill(R2)
00961                     
00962             if neutronHits > onGdCut:
00963                 self.counter["onGdCapPassCut"] += 1
00964             if neutronHits > onGdCutL and neutronHits < onGdCutR:
00965                 self.counter["onGdCapCutUncertain"] += 1
00966             
00967         if capTarget == 1:
00968             self.counter["onHCap"] += 1
00969             self.hist["nHits_onH"].Fill(neutronHits)
00970             
00971             if capLclPoint.z()/units.m < 1. and capLclPoint.z()/units.m > -1.:
00972                 self.hist["nHCapPos_R"].Fill(R2Cap)
00973 
00974             if genLclPoint.z()/units.m < 1. and genLclPoint.z()/units.m > -1.:
00975                 self.hist["nHCapGenPos"].Fill(R2)
00976                 if capDM == 'db-lso1':
00977                     self.hist["nHLsoCapGenPos"].Fill(R2)
00978                 if capDM == 'db-oil1' or capDM == 'db-oav1':
00979                     self.hist["nHOilCapGenPos"].Fill(R2)
00980                     
00981             if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00982                 self.counter["onHCapPassCut"] += 1
00983             if neutronHits > onHLowerCutL and neutronHits < onHLowerCutR:
00984                 self.counter["onHCapCutUncertainL"] += 1
00985             if neutronHits > onHUpperCutL and neutronHits < onHUpperCutR:
00986                 self.counter["onHCapCutUncertainU"] += 1
00987 
00988             if re.search('db-lso1', capdmvol):
00989                 self.hist["Hcount"].Fill(R2Cap, capLclPoint.z()/units.meter)
00990                 if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00991                     self.hist["HcountCut"].Fill(R2Cap, capLclPoint.z()/units.meter)
00992                     
00993                 if capLclPoint.z()/units.m < 1. and capLclPoint.z()/units.m > -1.:
00994                     self.hist["HcountR"].Fill(R2Cap)
00995                     if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
00996                         self.hist["HcountCutR"].Fill(R2Cap)
00997                     
00998                 if R2Cap < 0.64:
00999                     self.hist["HcountZ"].Fill(capLclPoint.z()/units.m)
01000                     if neutronHits > onHLowerCut and neutronHits < onHUpperCut:
01001                         self.hist["HcountCutZ"].Fill(capLclPoint.z()/units.m)
01002                         
01003         if capDM == 'db-gds1':
01004             self.hist["hCapTarget"].Fill(capTarget)
01005             if capTarget == 1:
01006                 self.counter["onHCapGds"] += 1
01007             elif capTarget == 6:
01008                 self.counter["onCCapGds"] += 1
01009             elif capTarget == 64:
01010                 pass
01011             else:
01012                 self.counter["onOtherCapGds"] += 1
01013 
01014         if capDM == 'db-lso1':
01015             self.hist["nHits_LS"].Fill(neutronHits)
01016             if capTarget == 1:
01017                 self.counter["onHCapLS"] += 1
01018                 
01019         if capDM == 'db-oav1':
01020             if capTarget == 1:
01021                 self.counter["onHCapOAV"] += 1
01022                 
01023         if capDM == 'db-oil1':
01024             self.hist["nHits_MO"].Fill(neutronHits)
01025             if capTarget == 1:
01026                 self.counter["onHCapMO"] += 1
01027 
01028         return SUCCESS
    
def chkIBD::AdPerformance::plotIbdBasics::finalize (   self)

Definition at line 1029 of file AdPerformance.py.

01030                       :
01031         
01032         self.counter["GdCapDetEff"] = self.counter["onGdGdsCapPassCut"]/self.counter["onGdGdsCap"]
01033         self.counter["GdCapDetEffUncertain"] = self.counter["onGdGdsCapCutUncertain"]/self.counter["onGdGdsCap"]/2.
01034         
01035         self.counter["HCapDetEff"] = self.counter["nPassHCut"]/self.counter["onHCapWithinLS"]
01036         self.counter["HCapDetEffUncertainL"] = self.counter["nHCutUncertainL"]/self.counter["onHCapWithinLS"]/2.
01037         self.counter["HCapDetEffUncertainU"] = self.counter["nHCutUncertainU"]/self.counter["onHCapWithinLS"]/2.
01038         
01039         self.counter["HCapCanoDetEff"] = self.counter["onHCapWithinLSPassCut"]/self.counter["onHCapWithinLS"]
01040         self.counter["HCapCanoDetEffUncertainL"] = self.counter["onHCapWithinLSCutUncertainL"]/self.counter["onHCapWithinLS"]/2.
01041         self.counter["HCapCanoDetEffUncertainU"] = self.counter["onHCapWithinLSCutUncertainU"]/self.counter["onHCapWithinLS"]/2.
01042         
01043         self.counter["HCapDetEffContaminationUncertainL"] = (self.counter["nonHCapWithinLSHCutUncertainL"]+self.counter["nonHCapBeyondLSHCutUncertainL"])/self.counter["onHCapWithinLS"]/2.
01044         self.counter["HCapDetEffContaminationUncertainU"] = (self.counter["nonHCapWithinLSHCutUncertainU"]+self.counter["nonHCapBeyondLSHCutUncertainU"])/self.counter["onHCapWithinLS"]/2.
01045         
01046         self.counter["HCapDetContamination"] = (self.counter["nonHCapWithinLSPassHCut"]+self.counter["nonHCapBeyondLSPassHCut"])/self.counter["nPassHCut"]
01047         
01048         self.outputstat.close()
01049 
01050         # register all the counters as TParameters
01051         for name, counter in self.counter.iteritems():
01052             temp = TParameter('double')(name, counter)
01053             status = self.statsSvc.put("/file1/counters/"+name, temp)
01054             if status.isFailure(): return status
01055             print "Final value of "+name+": ", temp.GetVal()
01056 
01057         print ""
01058         print "Total n generation: ", self.counter["nGen"]
01059         print "Total n gen in GdLS: ", self.counter["nInGdLS"]
01060         print "Total n gen in IAV: ", self.counter["nInIAV"]
01061         print "Total n gen in LSO: ", self.counter["nInLSO"]
01062         print "Total n gen in OAV: ", self.counter["nInOAV"]
01063         print "Total n gen in MO: ", self.counter["nInMO"]
01064         print ""
01065 
01066         print "Total n capture: ", self.counter["nCap"]
01067         print "Total n-capture on Gd: ", self.counter["onGdCap"]
01068         print "Total n-capture on Gd in Gds: ", self.counter["onGdGdsCap"]
01069         print "Total n-H capture in GdLS: ", self.counter["onHCapGds"]
01070         print "Total n-C capture in GdLS: ", self.counter["onCCapGds"]
01071         print "Total other capture in GdLS: ", self.counter["onOtherCapGds"]
01072         print ""
01073         
01074         print "Spill-In on Gd n from LS: ", self.counter["LSSpillIn_onGd"]
01075         print "Spill-In on Gd from IAV: ", self.counter["IavSpillIn_onGd"]
01076         print "Spill-Out of n from Gd-LS: ", self.counter["SpillOut"]
01077         print ""
01078         
01079         print "On Gd capture pass on-Gd cut: ", self.counter["onGdCapPassCut"]
01080         print "On Gd capture on-Gd cut uncertainty: ", self.counter["onGdCapCutUncertain"]
01081         print "On Gd capture in GDS pass on-Gd cut: ", self.counter["onGdGdsCapPassCut"]
01082         print "On Gd capture in GDS pass on-Gd cut(true deposit energy): ", self.counter["onGdGdsCapPassEdepCut"]
01083         print "On Gd capture in GDS on-Gd cut uncertainty: ", self.counter["onGdGdsCapCutUncertain"]
01084         print "Total non-Gd capture pass Gd cut: ", self.counter["nonGdPassGdCut"]
01085         print "Total pass Gd cut: ", self.counter["nPassGdCut"]
01086         print "Overall Gd cut uncertainty: ", self.counter["nGdCutUncertain"]
01087         print ""
01088 
01089         print "positron pass cut for Gd capture in GDS: ", self.counter["positronPassCut"]
01090         print "positron pass cut uncertainty for Gd capture in GDS: ", self.counter["positronCutUncertain"]
01091         print ""
01092 
01093         print "on Gd Detection Efficiency: ", self.counter["GdCapDetEff"]
01094         print "on Gd Detection Efficiency Uncertainty: ", self.counter["GdCapDetEffUncertain"]
01095         print ""
01096 
01097         print "Number of capture time in GdLS: ", self.counter["nGdsCapTime"]
01098         print "Number of capture time pass cut (1-200mus) in GdLS: ", self.counter["nGdsCapTimePassCut"]
01099         print "Number of capture time less than 1mus in GdLS: ", self.counter["nGdsCapTimeL"]
01100         print "Uncertain number of capture time less than 1mus in GdLS: ", self.counter["nGdsCapTimeUncertainL"]
01101         print "Number of capture time larger than 200mus in GdLS: ", self.counter["nGdsCapTimeH"]
01102         print "Uncertain number of capture time larger than 200mus in GdLS: ", self.counter["nGdsCapTimeUncertainH"]
01103         print ""
01104 
01105         print "Number of capture time in LS: ", self.counter["nLSCapTime"]
01106         print "Number of capture time pass cut (1-200mus) in LS: ", self.counter["nLSCapTimePassCut"]
01107         print "Number of capture time less than 1mus in LS: ", self.counter["nLSCapTimeL"]
01108         print "Uncertain number of capture time less than 1mus in LS: ", self.counter["nLSCapTimeUncertainL"]
01109         print "Number of capture time larger than 200mus in LS: ", self.counter["nLSCapTimeH"]
01110         print "Uncertain number of capture time larger than 200mus in LS: ", self.counter["nLSCapTimeUncertainH"]
01111         print ""
01112         
01113         print "Total n-capture on H: ", self.counter["onHCap"]
01114         print "Total n-capture on H in LS: ", self.counter["onHCapLS"]
01115         print "Total n-capture on H within LS: ", self.counter["onHCapWithinLS"]
01116         print ""
01117         
01118         print "Spill-In of n from OIL to LSO: ", self.counter["OilSpillIn_onH"]
01119         print "Spill-In of n from OAV to LSO: ", self.counter["OavSpillIn_onH"]
01120         print "Spill-Out of n from LSO to OAV or OIL: ", self.counter["SpillOut_onH"]
01121         print ""
01122         
01123         print "n capture pass on-H cut: ", self.counter["nPassHCut"]
01124         print "n capture pass lower on-H cut uncertainty: ", self.counter["nHCutUncertainL"]
01125         print "n capture pass upper on-H cut uncertainty: ", self.counter["nHCutUncertainU"]
01126         print ""
01127 
01128         print "On H capture pass on-H cut: ", self.counter["onHCapPassCut"]
01129         print "On H capture lower on-H cut uncertainty: ", self.counter["onHCapCutUncertainL"]
01130         print "On H capture upper on-H cut uncertainty: ", self.counter["onHCapCutUncertainU"]
01131         print ""
01132         
01133         print "on H nCap within LS pass H cut: ", self.counter["onHCapWithinLSPassCut"]
01134         print "on H nCap within LS pass lower H cut uncertainty: ", self.counter["onHCapWithinLSCutUncertainL"]
01135         print "on H nCap within LS pass upper H cut uncertainty: ", self.counter["onHCapWithinLSCutUncertainU"]
01136         print ""
01137 
01138         print "non H nCap within LS pass H cut: ", self.counter["nonHCapWithinLSPassHCut"]
01139         print "non H nCap within LS pass lower H cut uncertainty: ", self.counter["nonHCapWithinLSHCutUncertainL"]
01140         print "non H nCap within LS pass upper H cut uncertainty: ", self.counter["nonHCapWithinLSHCutUncertainU"]
01141         print ""
01142 
01143         print "on H nCap beyond LS pass on-H cut: ", self.counter["onHCapBeyondLSPassCut"]
01144         print "on H nCap beyond LS pass lower on-H cut uncertainty: ", self.counter["onHCapBeyondLSCutUncertainL"]
01145         print "on H nCap bdyond LS pass upper on-H cut uncertainty: ", self.counter["onHCapBeyondLSCutUncertainU"]
01146         print ""
01147 
01148         print "non H nCap beyond LS pass H cut: ", self.counter["nonHCapBeyondLSPassHCut"]
01149         print "non H nCap beyond LS pass lower H cut uncertainty: ", self.counter["nonHCapBeyondLSHCutUncertainL"]
01150         print "non H nCap beyond LS pass upper H cut uncertainty: ", self.counter["nonHCapBeyondLSHCutUncertainU"]
01151         print ""
01152 
01153         print "On Gd capture pass on-H cut: ", self.counter["nGdPassHCut"]
01154         print "On Gd capture pass lower on-H cut uncertainty: ", self.counter["nGdHCutUncertainL"]
01155         print "On Gd capture pass upper on-H cut uncertainty: ", self.counter["nGdHCutUncertainU"]
01156         print ""
01157 
01158         print "Total n-capture on H in MO: ", self.counter["onHCapMO"]
01159         print "Total n-capture on H in OAV: ", self.counter["onHCapOAV"]
01160         print "on H nCap in OAV&MO pass on-H cut: ", self.counter["onHCapOavMoPassCut"]
01161         print "on H nCap in OAV&MO pass lower on-H cut uncertainty: ", self.counter["onHCapOavMoCutUncertainL"]
01162         print "on H nCap in OAV&MO pass upper on-H cut uncertainty: ", self.counter["onHCapOavMoCutUncertainU"]
01163         print ""
01164         
01165         print "on H capture detection efficiency: ", self.counter["HCapDetEff"]
01166         print "on H capture detection uncertainty L: ", self.counter["HCapDetEffUncertainL"]
01167         print "on H capture detection uncertainy U: ", self.counter["HCapDetEffUncertainU"]
01168         print ""
01169         
01170         print "on H capture detection efficiency(canonical): ", self.counter["HCapCanoDetEff"]
01171         print "on H capture detection uncertainty(L:canonical):", self.counter["HCapCanoDetEffUncertainL"]
01172         print "on H capture detection uncertainty(U:canonical):", self.counter["HCapCanoDetEffUncertainU"]
01173         
01174         print "non H capture contamination uncertainty(L): ", self.counter["HCapDetEffContaminationUncertainL"]
01175         print "non H capture contamination uncertainty(U): ", self.counter["HCapDetEffContaminationUncertainU"]
01176         
01177         print "non H capture contamination:", self.counter["HCapDetContamination"]
01178 
01179         print "Finalizing ", self.name()
01180         status = GaudiAlgo.finalize(self)
01181         return status


Member Data Documentation

Definition at line 32 of file AdPerformance.py.

Definition at line 32 of file AdPerformance.py.

Definition at line 32 of file AdPerformance.py.

Definition at line 32 of file AdPerformance.py.

Definition at line 32 of file AdPerformance.py.

Definition at line 32 of file AdPerformance.py.

Definition at line 32 of file AdPerformance.py.

Definition at line 36 of file AdPerformance.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