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

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 SaveHistograms
 figures

Detailed Description

Definition at line 761 of file Tools.py.


Constructor & Destructor Documentation

def DataQuality::Tools::DiagnosticAlg::__init__ (   self,
  name 
)

Definition at line 763 of file Tools.py.

00764                            :
00765         DybPythonAlg.__init__(self,name)
00766         self.SaveHistograms = True
00767         return


Member Function Documentation

def DataQuality::Tools::DiagnosticAlg::initialize (   self)

Definition at line 768 of file Tools.py.

00769                         :
00770         status = DybPythonAlg.initialize(self)
00771         if status.isFailure(): return status
00772         self.info("initialize")
00773 
00774         self.figures = [{"name"    :"genTime",
00775                          "title"   :"Generator Time",
00776                          "draw"    :"genTimeSec+(genTimeNanoSec*1e-9)",
00777                          "cut"     :"hasGen",
00778                          "options" :"",
00779                          "xaxis"   :"time [s]",
00780                          "yaxis"   :"Generated Events",
00781                          "filename":"genTime.png"
00782                          },
00783                         {"name"    :"nGenParticles",
00784                          "title"   :"Number of Generated Particles",
00785                          "draw"    :"nGenParticles>>htemp(20,0,20)",
00786                          "cut"     :"hasGen",
00787                          "options" :"",
00788                          "xaxis"   :"Number of particles",
00789                          "yaxis"   :"Generated Events",
00790                          "filename":"nGenParticles.png"
00791                          },
00792                         {"name"    :"genPdgid",
00793                          "title"   :"PDG ID",
00794                          "draw"    :"genPdgid",
00795                          "cut"     :"hasGen",
00796                          "options" :"",
00797                          "xaxis"   :"PDG ID",
00798                          "yaxis"   :"Generated Particles",
00799                          "filename":"genPdgid.png"
00800                          },
00801                         {"name"    :"genPosition",
00802                          "title"   :"Generated Position",
00803                          "draw"    :"genZ:genY:genX",
00804                          "cut"     :"hasGen",
00805                          "options" :"",
00806                          "xaxis"   :"x [mm]",
00807                          "yaxis"   :"y [mm]",
00808                          "zaxis"   :"z [mm]",
00809                          "filename":"genPosition.png"
00810                          },
00811                         {"name"    :"genE",
00812                          "title"   :"Generated Particle Energy",
00813                          "draw"    :"genE",
00814                          "cut"     :"hasGen",
00815                          "options" :"",
00816                          "xaxis"   :"Energy [MeV]",
00817                          "yaxis"   :"Generated Particles",
00818                          "filename":"genE.png"
00819                          },
00820                         {"name"    :"genT",
00821                          "title"   :"Generated Particle Time Offset",
00822                          "draw"    :"genT",
00823                          "cut"     :"hasGen",
00824                          "options" :"",
00825                          "xaxis"   :"Time Offset [ns]",
00826                          "yaxis"   :"Generated Particles",
00827                          "filename":"genT.png"
00828                          },
00829                         {"name"    :"nSimHits",
00830                          "title"   :"Number of Simulated Hits",
00831                          "draw"    :"nSimHits>>htemp(2000,0,2000)",
00832                          "cut"     :"hasSim",
00833                          "options" :"",
00834                          "xaxis"   :"Number of hits on detectors",
00835                          "yaxis"   :"Number of Simulated Events",
00836                          "filename":"nSimHits.png"
00837                          },
00838                         {"name"    :"simHitTime",
00839                          "title"   :"Simulated Hit Time",
00840                          "draw"    :"simHitTime>>htemp(1000,0,500)",
00841                          "cut"     :"hasSim",
00842                          "options" :"",
00843                          "xaxis"   :"time [ns]",
00844                          "yaxis"   :"Number of hits",
00845                          "filename":"simHitTime.png"
00846                          },
00847                         {"name"    :"simHitPosition",
00848                          "title"   :"Simulated Hit Position on PMT",
00849                          "draw"    :"simHitZ:simHitY:simHitX>>htemp(100,-100,100,100,-100,100,150,0,150)",
00850                          "cut"     :"hasSim",
00851                          "options" :"",
00852                          "xaxis"   :"x [mm]",
00853                          "yaxis"   :"y [mm]",
00854                          "zaxis"   :"z [mm]",
00855                          "filename":"simHitPosition.png"
00856                          },
00857                         {"name"    :"simHitPmt",
00858                          "title"   :"Simulated Hits on AD PMTs",
00859                          "draw"    :"simHitRing:simHitColumn>>htemp(25,0,25,9,0,9)",
00860                          "cut"     :"hasSim",
00861                          "options" :"colz",
00862                          "xaxis"   :"PMT column",
00863                          "yaxis"   :"PMT ring",
00864                          "filename":"simHitPmt.png"
00865                          },
00866                         {"name"    :"simQuenchedEnergyGdLS",
00867                          "title"   :"Quenched energy deposition in GdLS",
00868                          "draw"    :"simUnobs_QEDepInGdLS_sum>>htemp(2000,0,20)",
00869                          "cut"     :"",
00870                          "options" :"",
00871                          "xaxis"   :"Quenched Energy [MeV]",
00872                          "yaxis"   :"Number of Simulated Events",
00873                          "filename":"simQuenchedEnergyGdLS.png"
00874                          },
00875                         {"name"    :"simQuenchedEnergyLS",
00876                          "title"   :"Quenched energy deposition in LS",
00877                          "draw"    :"simUnobs_QEDepInLS_sum>>htemp(2000,0,20)",
00878                          "cut"     :"",
00879                          "options" :"",
00880                          "xaxis"   :"Quenched Energy [MeV]",
00881                          "yaxis"   :"Number of Simulated Events",
00882                          "filename":"simQuenchedEnergyLS.png"
00883                          },
00884                         {"name"    :"simQuenchedEnergyOil",
00885                          "title"   :"Quenched energy deposition in Buffer Oil",
00886                          "draw"    :"simUnobs_QEDepInOIL_sum>>htemp(2000,0,20)",
00887                          "cut"     :"",
00888                          "options" :"",
00889                          "xaxis"   :"Quenched Energy [MeV]",
00890                          "yaxis"   :"Number of Simulated Events",
00891                          "filename":"simQuenchedEnergyOil.png"
00892                          },
00893                         {"name"    :"hasReadout",
00894                          "title"   :"Detector Triggered?",
00895                          "draw"    :"hasReadout>>htemp(2,0,2)",
00896                          "cut"     :"hasRo",
00897                          "options" :"",
00898                          "xaxis"   :"False=0, True=1",
00899                          "yaxis"   :"Number of Events",
00900                          "filename":"hasReadout.png"
00901                          },
00902                         {"name"    :"readoutDetector",
00903                          "title"   :"Triggered Detector",
00904                          "draw"    :"roSite:roDetector>>htemp(10,0,10,10,0,10)",
00905                          "cut"     :"hasReadout",
00906                          "options" :"colz",
00907                          "xaxis"   :"Detector ID",
00908                          "yaxis"   :"Site ID",
00909                          "filename":"readoutDetector.png"
00910                          },
00911                         {"name"    :"readoutTime",
00912                          "title"   :"Trigger Time",
00913                          "draw"    :"roTriggerTimeSec+(roTriggerTimeNanoSec*1e-9)",
00914                          "cut"     :"hasReadout",
00915                          "options" :"",
00916                          "xaxis"   :"Time [s]",
00917                          "yaxis"   :"Number of Readouts",
00918                          "filename":"readoutTime.png"
00919                          },
00920                         {"name"    :"nRoChannels",
00921                          "title"   :"Number of Channels in Readout",
00922                          "draw"    :"nRoChannels>>htemp(300,0,300)",
00923                          "cut"     :"hasReadout",
00924                          "options" :"",
00925                          "xaxis"   :"Number of Channels",
00926                          "yaxis"   :"Number of Readouts",
00927                          "filename":"nRoChannels.png"
00928                          },
00929                         {"name"    :"roChannel",
00930                          "title"   :"Readout Channels in Crate",
00931                          "draw"    :"roConnector:roBoard>>htemp(17,0,17,17,0,17)",
00932                          "cut"     :"hasReadout",
00933                          "options" :"colz",
00934                          "xaxis"   :"FEE Board",
00935                          "yaxis"   :"FEE Connector",
00936                          "filename":"roChannel.png"
00937                          },
00938                         {"name"    :"tdc",
00939                          "title"   :"Readout TDC Spectrum",
00940                          "draw"    :"roTdc>>htemp(400,0,400)",
00941                          "cut"     :"hasReadout",
00942                          "options" :"",
00943                          "xaxis"   :"TDC value",
00944                          "yaxis"   :"Number of TDCs",
00945                          "filename":"tdc.png"
00946                          },
00947                         {"name"    :"adc",
00948                          "title"   :"Readout ADC Spectrum",
00949                          "draw"    :"roAdc>>htemp(1000,0,1000)",
00950                          "cut"     :"hasReadout",
00951                          "options" :"",
00952                          "xaxis"   :"ADC value",
00953                          "yaxis"   :"Number of ADCs",
00954                          "filename":"adc.png"
00955                          },
00956                         {"name"    :"adcClock",
00957                          "title"   :"Clock Offset of ADC value",
00958                          "draw"    :"roAdcClock>>htemp(16,0,16)",
00959                          "cut"     :"hasReadout",
00960                          "options" :"",
00961                          "xaxis"   :"ADC clock (40 MHz)",
00962                          "yaxis"   :"Number of ADCs",
00963                          "filename":"adcClock.png"
00964                          },
00965                         {"name"    :"calibTdc",
00966                          "title"   :"Calibrated TDC values",
00967                          "draw"    :"croTdc>>htemp(500,-500,0)",
00968                          "cut"     :"hasCro && hasCalibReadout",
00969                          "options" :"",
00970                          "xaxis"   :"Calibrated TDC value [ns]",
00971                          "yaxis"   :"Number of TDC values",
00972                          "filename":"calibTdc.png"
00973                          },
00974                         {"name"    :"calibAdc",
00975                          "title"   :"Calibrated ADC values",
00976                          "draw"    :"croAdc>>htemp(500,0,50)",
00977                          "cut"     :"hasCro && hasCalibReadout",
00978                          "options" :"",
00979                          "xaxis"   :"Calibrated ADC values [Number of Photoelectrons]",
00980                          "yaxis"   :"Number of ADC values",
00981                          "filename":"calibAdc.png"
00982                          },
00983                         {"name"    :"calibAdcSum",
00984                          "title"   :"Sum of Calibrated ADC values in Readout",
00985                          "draw"    :"Sum$(croAdc)>>htemp(1000,0,2000)",
00986                          "cut"     :"hasCro && hasCalibReadout",
00987                          "options" :"",
00988                          "xaxis"   :"ADC Sum [Number of Photoelectrons]",
00989                          "yaxis"   :"Number of Readouts",
00990                          "filename":"calibAdcSum.png"
00991                          },
00992                         {"name"    :"reconEnergy",
00993                          "title"   :"Reconstucted Energy",
00994                          "draw"    :"rec_AdSimple_energy>>htemp(1000,0,20)",
00995                          "cut"     :"hasRecTrigger && rec_AdSimple_energyStatus==1",
00996                          "options" :"",
00997                          "xaxis"   :"Visible Energy [MeV]",
00998                          "yaxis"   :"Number of Readouts",
00999                          "fit"     :"gaus",
01000                          "filename":"reconEnergy.png"
01001                          },
01002                         {"name"    :"reconEnergyStatus",
01003                          "title"   :"Reconstucted Energy Status",
01004                          "draw"    :"rec_AdSimple_energyStatus>>htemp(10,0,10)",
01005                          "cut"     :"hasRecTrigger",
01006                          "options" :"",
01007                          "xaxis"   :"Status: Unknown=0, Good=1, Bad>1",
01008                          "yaxis"   :"Number of Readouts",
01009                          "filename":"reconEnergyStatus.png"
01010                          },
01011                         {"name"    :"reconEnergyQuality",
01012                          "title"   :"Reconstucted Energy Quality",
01013                          "draw"    :"rec_AdSimple_energyQuality>>htemp(200,0,10)",
01014                          "cut"     :"hasRecTrigger && rec_AdSimple_energyStatus==1",
01015                          "options" :"",
01016                          "xaxis"   :"Quality Measure",
01017                          "yaxis"   :"Number of Readouts",
01018                          "filename":"reconEnergyQuality.png"
01019                          },
01020                         {"name"    :"reconPosition",
01021                          "title"   :"Reconstucted Position",
01022                          "draw"    :"rec_AdSimple_position[2]:sqrt(rec_AdSimple_position[0]*rec_AdSimple_position[0]+rec_AdSimple_position[1]*rec_AdSimple_position[1])>>htemp(100,0,3000.,1000,-3000.,3000.)",
01023                          "cut"     :"hasRecTrigger && rec_AdSimple_positionStatus==1",
01024                          "options" :"colz",
01025                          "xaxis"   :"#rho [mm]",
01026                          "yaxis"   :"z [mm]",
01027                          "filename":"reconPosition.png"
01028                          },
01029                         {"name"    :"reconPositionX",
01030                          "title"   :"Reconstucted X Position",
01031                          "draw"    :"rec_AdSimple_position[0]>>htemp(1000,-3000.,3000.)",
01032                          "cut"     :"hasRecTrigger && rec_AdSimple_positionStatus==1",
01033                          "options" :"colz",
01034                          "xaxis"   :"x [mm]",
01035                          "yaxis"   :"Entries",
01036                          "fit"     :"gaus",
01037                          "filename":"reconPositionX.png"
01038                          },
01039                         {"name"    :"reconPositionY",
01040                          "title"   :"Reconstucted Y Position",
01041                          "draw"    :"rec_AdSimple_position[1]>>htemp(1000,-3000.,3000.)",
01042                          "cut"     :"hasRecTrigger && rec_AdSimple_positionStatus==1",
01043                          "options" :"colz",
01044                          "xaxis"   :"y [mm]",
01045                          "yaxis"   :"Entries",
01046                          "fit"     :"gaus",
01047                          "filename":"reconPositionY.png"
01048                          },
01049                         {"name"    :"reconPositionZ",
01050                          "title"   :"Reconstucted Z Position",
01051                          "draw"    :"rec_AdSimple_position[2]>>htemp(1000,-3000.,3000.)",
01052                          "cut"     :"hasRecTrigger && rec_AdSimple_positionStatus==1",
01053                          "options" :"colz",
01054                          "xaxis"   :"z [mm]",
01055                          "yaxis"   :"Entries",
01056                          "fit"     :"gaus",
01057                          "filename":"reconPositionZ.png"
01058                          },
01059                         {"name"    :"reconPositionStatus",
01060                          "title"   :"Reconstucted Position Status",
01061                          "draw"    :"rec_AdSimple_positionStatus>>htemp(10,0,10)",
01062                          "cut"     :"hasRecTrigger",
01063                          "options" :"",
01064                          "xaxis"   :"Status: Unknown=0, Good=1, Bad>1",
01065                          "yaxis"   :"Number of Readouts",
01066                          "filename":"reconPositionStatus.png"
01067                          },
01068                         {"name"    :"reconPositionQuality",
01069                          "title"   :"Reconstucted Position Quality",
01070                          "draw"    :"rec_AdSimple_positionQuality>>htemp(200,0,5000)",
01071                          "cut"     :"hasRecTrigger && rec_AdSimple_positionStatus==1",
01072                          "options" :"",
01073                          "xaxis"   :"Quality measure",
01074                          "yaxis"   :"Number of Readouts",
01075                          "filename":"reconPositionQuality.png"
01076                          }
01077                         #{"title"   :"",
01078                         # "draw"    :"",
01079                         # "cut"     :"",
01080                         # "options" :"",
01081                         # "xaxis"   :"",
01082                         # "yaxis"   :"",
01083                         # "zaxis"   :"",
01084                         # "filename":""
01085                         # },
01086                         ]
01087         return SUCCESS

def DataQuality::Tools::DiagnosticAlg::execute (   self)

Definition at line 1088 of file Tools.py.

01089                      :
01090         return SUCCESS
        
def DataQuality::Tools::DiagnosticAlg::finalize (   self)

Definition at line 1091 of file Tools.py.

01091                       :        
01092         self.info("finalize")
01093         tesTree = self.stats['/file0/tes/tesTree']
01094         if tesTree == None:
01095             self.error("Failed to retrieve tree of TES data")
01096             return FAILURE
01097         # Make figures
01098         canvas = TCanvas()
01099         failedFigs = []
01100         for figure in self.figures:
01101             self.info("Making figure "+figure["title"])
01102             nEntries = tesTree.Draw(figure["draw"], figure["cut"], figure["options"])
01103             hist = canvas.FindObject("htemp")
01104             if nEntries < 1 or hist == None:
01105                 self.warning("Failed to generate figure: "+figure["title"])
01106                 failedFigs.append( figure["name"] )
01107                 continue
01108             hist.SetTitle(figure["title"])
01109             hist.SetLineColor(4)
01110             if figure.has_key("xaxis"):
01111                 hist.GetXaxis().SetTitle(figure["xaxis"])
01112             if figure.has_key("yaxis"):
01113                 hist.GetYaxis().SetTitle(figure["yaxis"])
01114             if figure.has_key("zaxis"):
01115                 hist.GetZaxis().SetTitle(figure["zaxis"])
01116             if figure.has_key("fit"):
01117                 hist.Fit(figure["fit"])
01118             canvas.SaveAs(figure["filename"])
01119             if self.SaveHistograms:
01120                 hist.SetName(figure["name"])
01121                 self.stats["/file1/diagnostics/"+figure["name"]] = hist.Clone()
01122         # Generate html page
01123         htmlList = []
01124         htmlList.append("<HTML>")
01125         htmlList.append("<HEAD>")
01126         htmlList.append("<TITLE>")
01127         htmlList.append(" Diagnostics Figures")
01128         htmlList.append("</TITLE>")
01129         htmlList.append("</HEAD>")
01130         htmlList.append("<BODY>")
01131         htmlList.append(" <H1>Diagnostics Figures</H1>")
01132         htmlList.append(' <P>Histogram file: <A HREF="diagnostics.root">diagnostics.root</A></P>')
01133         htmlList.append(' <P>Diagnostics <A HREF="log/">logs</A></P>')
01134         htmlList.append(" <TABLE>")
01135         for figureIdx in range(len(self.figures)):
01136             figure = self.figures[figureIdx]
01137             if figureIdx % 2 == 0:
01138                 htmlList.append("  <TR>")
01139             figString ="     <TD><H3>"+figure["title"]+"</H3>"
01140             if figure["name"] in failedFigs:
01141                 figString += "<P>No Data for this figure</P>"
01142             else:
01143                 figString += "<IMG SRC=\""+figure["filename"]+"\" WIDTH=70%>"
01144             figString += "</TD>"
01145             htmlList.append(figString)
01146             if figureIdx % 2 != 0:
01147                 htmlList.append("  </TR>")
01148             elif figureIdx == len(self.figures):
01149                 htmlList.append("    <TD></TD>")
01150                 htmlList.append("  </TR>")
01151         htmlList.append(" </TABLE>")
01152         htmlList.append("</BODY>")
01153         htmlList.append("</HTML>")
01154         htmlFile = open("index.html","w")
01155         htmlFile.write("\n".join(htmlList))
01156         htmlFile.close()
01157         status = DybPythonAlg.finalize(self)
01158         return status
01159 
01160 
01161 

Member Data Documentation

Definition at line 763 of file Tools.py.

Definition at line 768 of file Tools.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 10:06:20 for DataQuality by doxygen 1.7.4