#!/usr/bin/env python # Make plots of a detector """ Usage print_event.py -d input detector file Plots the positions of the doms options: -d : input detector file default=/afs/in2p3.fr/home/throng/km3net/detectors/km3net_jul13_90m.det -h : this help message and exit default=False -i : Python interative mode (prompt when done) default=True """ from __future__ import print_function import sys, aa from ROOT import gStyle, TCanvas, TH2D, Det, TMarker, SetOwnership gStyle.SetOptStat(0) options = aa.Options( __doc__, sys.argv[1:] ) c = TCanvas("c","c",1000,500) c.Divide(2,1) hxy = TH2D("hxy","top view;x(m);y(m)", 10,-550,550, 10,-550,550); hxz = TH2D("hxz","side view;x(m);z(m)", 10,-550,550, 10, 0,1000); d = Det( options.d ) c.cd(1) hxy.Draw() for dum,dom in d.doms : M = TMarker( dom.pos.x, dom.pos.y , 20 ) M.Draw() SetOwnership( M, False ) c.cd(2) hxz.Draw() for dum,dom in d.doms : M = TMarker( dom.pos.x, dom.pos.z , 20 ) M.Draw() SetOwnership( M, False ) c.Update()