from Plotter import Plotter
from Sample import Sample
from Logging import *
import array

test = True

if test:

    x = Sample( FileName = 'rootFiles/mtestReadoutAnalysis_siliconDigitPlots.root', Type = 'h', Sumw2 = False, Label = 'ReadoutAna_siliconTruthSanityPlots')

    print x

    x.Type2D = 'COLZ'
    x.LineColour = 4

    samples = [x]
    
    plots = Plotter(samples)
    plots.PlotLegend = False

    # PER EVENT HISTOS

    fname = "plots/mtestReadoutAnalysis/siliconDigitPlots"

# h_firstSiliconHitLayer
    plots.Print("rawTime",  xtitle='time', ytitle='events', outname = fname + '/rawTime')

# h_firstSiliconHitView
    plots.Print("f_scintTime",  xtitle='hitTime', ytitle='events', outname = fname + '/f_scintTime')
from Plotter import Plotter
from Sample import Sample
from Logging import *
import array

test = True


if test:

    StrawSanity = Sample( FileName = 'rootFiles/mtestGunAnalysis_strawTruthSanityPlots.root', Type = 'h', Sumw2 = False, Label = 'straws')

    print StrawSanity

    StrawSanity.Type2D = 'COLZ'
    StrawSanity.LineColour = 4

    samples = [StrawSanity]
    
    plots = Plotter(samples)
    plots.PlotLegend = False
    
    # PER EVENT HISTOS

    fname = "plots/mtestGunAnalysis/StrawSanity"


## h_strawHitProtonSecondaries

# Hit times
    plots.Print("h_strawHitTimes",  xtitle='Hit time [ms]', ytitle='events', outname = fname + '/HitTimes')