26 def Init(self,options,monitor):
27 self.M = monitor
28 sdict = self.M.sdict
29 h = self.M.h
30 run = ROOT.FairRunAna.Instance()
31 self.trackTask = self.M.trackTask
32 if not self.trackTask: self.trackTask = run.GetTask('houghTransform')
33 ioman = ROOT.FairRootManager.Instance()
34 self.OT = ioman.GetSink().GetOutTree()
36
40
41
42 if self.M.fsdict or self.M.hasBunchInfo: self.xing = {'':True,'B1only':False,'B2noB1':False,'noBeam':False}
43 else: self.xing = {'':True}
44 for xi in self.xing:
45 ut.bookHist(h,detector+'Noise'+xi,'events with hits in single plane; s*10+l;',40,0.5,39.5)
46 for s in monitor.systemAndPlanes:
47 ut.bookHist(h,sdict[s]+'Mult'+xi,'QDCs vs nr hits; #hits; QDC [a.u.]',200,0.,800.,200,0.,300.)
48 for l in range(monitor.systemAndPlanes[s]):
49 ut.bookHist(h,detector+'hitmult_'+str(s*10+l)+xi,'hit mult / plane '+sdict[s]+str(l)+'; #hits',61,-0.5,60.5)
50 ut.bookHist(h,detector+'hit_'+str(s*10+l)+xi,'channel map / plane '+sdict[s]+str(l)+'; #channel',160,-0.5,159.5)
51 ut.bookHist(h,detector+'Xhit_'+str(s*10+l)+xi,'Xchannel map / plane '+sdict[s]+str(l)+'; #channel',160,-0.5,159.5)
52
53
54
55 note = ''
56 NSmallSiPMs = 0
57 if s==2:
58 note = ', large only'
59 NSmallSiPMs = 2
60 ut.bookHist(h,detector+'chanActiveRight_'+str(s*10+l),
61 sdict[s]+' '+str(l)+'R channel hit multiplicity; #channel; bar',
62 channelsPerSystem[s],-0.5,channelsPerSystem[s]-0.5,
63 monitor.systemAndBars[s],-0.5,monitor.systemAndBars[s]-0.5)
64 ut.bookHist(h,detector+'chanNfiredRight_'+str(s*10+l),
65 sdict[s]+' '+str(l)+'R number of fired channels '+note+'; N fired channels; bar',
66 channelsPerSystem[s]+1-NSmallSiPMs,-0.5,channelsPerSystem[s]+0.5-NSmallSiPMs,
67 monitor.systemAndBars[s],-0.5,monitor.systemAndBars[s]-0.5)
68 side = 'L'
69 if (s==1 and l==2) or (s==3 and (l%2==1 or l==6)):
70 side = 'T'
71 ut.bookHist(h,detector+'chanActiveLeft_'+str(s*10+l),
72 sdict[s]+' '+str(l)+side+' channel hit multiplicity; #channel; bar',
73 channelsPerSystem[s],-0.5,channelsPerSystem[s]-0.5,
74 monitor.systemAndBars[s],-0.5,monitor.systemAndBars[s]-0.5)
75 ut.bookHist(h,detector+'chanNfiredLeft_'+str(s*10+l),
76 sdict[s]+' '+str(l)+side+' number of fired channels '+note+'; N fired channels; bar',
77 channelsPerSystem[s]+1-NSmallSiPMs,-0.5,channelsPerSystem[s]+0.5-NSmallSiPMs,
78 monitor.systemAndBars[s],-0.5,monitor.systemAndBars[s]-0.5)
79
80 if s==3:
81 ut.bookHist(h,detector+'bar_'+str(s*10+l)+xi,'bar map / plane '+sdict[s]+str(l)+'; bar',60,-0.5,59.5)
82 ut.bookHist(h,detector+'dT_'+str(s*10+l)+xi,'dT with respect to first scifi '+sdict[s]+str(l)+'; dt [ns] ;# bar + channel', 100,-25.,5.,120,-0.5,2*60-0.5)
83 ut.bookHist(h,detector+'dTcor_'+str(s*10+l)+xi,'dTcor with respect to first scifi '+sdict[s]+str(l)+'; dt [ns] ;# bar + channel',100,-25.,5.,120,-0.5,2*60-0.5)
84 if l == 4:
85 for ss in range(1,6):
86 ut.bookHist(h,'deltaTScifiMufiHit_'+str(ss)+xi,'deltaT scifi earliest hit versus DS hit 2H',200,-25.,25.)
87 else:
88 ut.bookHist(h,detector+'bar_'+str(s*10+l)+xi,'bar map / plane '+sdict[s]+str(l)+'; bar',10,-0.5,9.5)
89 if s==1:
90 ut.bookHist(h,detector+'dT_'+str(s*10+l)+xi,'dT with respect to first scifi '+sdict[s]+str(l)+'; dt [ns] ;# bar + channel', 100,-25.,5.,120,-0.5,2*8*7-0.5)
91 ut.bookHist(h,detector+'dTcor_'+str(s*10+l)+xi,'dTcor with respect to first scifi '+sdict[s]+str(l)+'; dt [ns] ;# bar + channel',100,-25.,5.,120,-0.5,2*8*7-0.5)
92 ut.bookHist(h,detector+'sig_'+str(s*10+l)+xi,'signal / plane '+sdict[s]+str(l)+'; QDC [a.u.]',200,0.0,200.)
93 if s==2:
94 ut.bookHist(h,detector+'sigS_'+str(s*10+l)+xi,'signal / plane '+sdict[s]+str(l)+'; QDC [a.u.]',200,0.0,200.)
95 ut.bookHist(h,detector+'TsigS_'+str(s*10+l)+xi,'signal / plane '+sdict[s]+str(l)+'; QDC [a.u.]',200,0.0,200.)
96 tagL = US_gel_dict[s*10+l][0]+": "
97 tagR = US_gel_dict[s*10+l][1]+": "
98 else:
99 tagL = ""
100 tagR = ""
101 histo_title_helper = 'signal / plane '+sdict[s]+str(l)
102 ut.bookHist(h,detector+'sigL_'+str(s*10+l)+xi,tagL+histo_title_helper+'; QDC [a.u.]',200,0.0,200.)
103 ut.bookHist(h,detector+'sigR_'+str(s*10+l)+xi,tagR+histo_title_helper+'; QDC [a.u.]',200,0.0,200.)
104 ut.bookHist(h,detector+'Tsig_'+str(s*10+l)+xi,histo_title_helper+'; QDC [a.u.]',200,0.0,200.)
105 ut.bookHist(h,detector+'TsigL_'+str(s*10+l)+xi,tagL+histo_title_helper+'; QDC [a.u.]',200,0.0,200.)
106 ut.bookHist(h,detector+'TsigR_'+str(s*10+l)+xi,tagR+histo_title_helper+'; QDC [a.u.]',200,0.0,200.)
107
108 ut.bookHist(h,detector+'occ_'+str(s*10+l)+xi,'channel occupancy '+sdict[s]+str(l),100,0.0,200.)
109 ut.bookHist(h,detector+'occTag_'+str(s*10+l)+xi,'channel occupancy '+sdict[s]+str(l),100,0.0,200.)
110
111 ut.bookHist(h,detector+'leftvsright_1'+xi,'Veto hits in left / right; Left: # hits; Right: # hits',10,-0.5,9.5,10,-0.5,9.5)
112 ut.bookHist(h,detector+'leftvsright_2'+xi,'US hits in left / right; L: # hits; R: # hits',10,-0.5,9.5,10,-0.5,9.5)
113 ut.bookHist(h,detector+'leftvsright_3'+xi,'DS hits in left / right; L: # hits; R: # hits',2,-0.5,1.5,2,-0.5,1.5)
114 ut.bookHist(h,detector+'leftvsright_signal_1'+xi,'Veto signal in left / right; Left: QDC [a.u.]; Right: QDC [a.u.]',100,-0.5,200.,100,-0.5,200.)
115 ut.bookHist(h,detector+'leftvsright_signal_2'+xi,'US signal in left / right; L: QDC [a.u.]; R: QDC [a.u.]',100,-0.5,200.,100,-0.5,200.)
116 ut.bookHist(h,detector+'leftvsright_signal_3'+xi,'DS signal in left / right; L: QDC [a.u.]; R: QDC [a.u.]',100,-0.5,200.,100,-0.5,200.)
117
118 ut.bookHist(h,detector+'dtime'+xi,'delta event time; dt [ns]',100,0.0,1000.)
119 ut.bookHist(h,detector+'dtimeu'+xi,'delta event time; dt [us]',100,0.0,1000.)
120 ut.bookHist(h,detector+'dtimem'+xi,'delta event time; dt [ms]',100,0.0,1000.)
121
122 ut.bookHist(h,detector+'bs'+xi,'beam spot; x[cm]; y[cm]',100,-100.,10.,100,0.,80.)
123 ut.bookHist(h,detector+'bsDS'+xi,'beam spot,#bar X, #bar Y',60,-0.5,59.5,60,-0.5,59.5)
124 ut.bookHist(h,detector+'slopes'+xi,'muon DS track slopes; slope X [rad]; slope Y [rad]',150,-1.5,1.5,150,-1.5,1.5)
125 ut.bookHist(h,detector+'trackPos'+xi,'muon DS track pos; x [cm]; y [cm]',100,-90,10.,80,0.,80.)
126 ut.bookHist(h,detector+'trackPosBeam'+xi,'beam track pos slopes<0.1rad; x [cm]; y [cm]',100,-90,10.,80,0.,80.)
127
128 for bar in range(monitor.systemAndBars[s]):
129 ut.bookHist(h,detector+'chanmult_'+str(s*1000+100*l+bar)+xi,'channels firing per bar '+sdict[s]+str(l)+" bar "+str(bar)+'; fired channels',20,-0.5,19.5)
130
131 xmin = options.Mufixmin
132 xmax = -xmin
133 ut.bookHist(h,detector+'resX_'+sdict[s]+str(s*10+l)+xi,'residual X'+str(s*10+l)+'; [#cm]',
134 100,xmin,xmax,60,-60.,0.)
135 ut.bookHist(h,detector+'resY_'+sdict[s]+str(s*10+l)+xi,'residual Y'+str(s*10+l)+'; [#cm]',
136 100,xmin,xmax,70,2.,68.)
137
138 for x in h:
139 if isinstance(h[x], ROOT.TH2):
140 h[x].SetStats(0)
141
142 self.listOfHits = {1:[],2:[],3:[]}
Int_t GetConfParI(TString name)
Float_t GetConfParF(TString name)