41 A,B = ROOT.TVector3(),ROOT.TVector3()
42 ut.bookHist(h,
'slopesX',
'slope diffs',1000,-1.0,1.0)
43 ut.bookHist(h,
'slopesY',
'slope diffs',1000,-1.0,1.0)
44 ut.bookHist(h,
'clX',
'cluster size',10,0.5,10.5)
45 ut.bookHist(h,
'clY',
'cluster size',10,0.5,10.5)
47 if Nev < 0 : Nev = eventTree.GetEntries()
48 for event
in eventTree:
53 for k
in range(event.Digi_ScifiHits.GetEntries()):
54 d = event.Digi_ScifiHits[k]
55 if not d.isValid():
continue
56 hitDict[d.GetDetectorID()] = k
57 hitList = list(hitDict.keys())
64 hitlist = ROOT.std.vector(
"sndScifiHit*")()
65 for i
in range(len(hitList)):
66 if i==0
and len(hitList)>1:
continue
70 if (c-cprev)!=1
or c==hitList[last]:
74 for aHit
in tmp: hitlist.push_back( event.Digi_ScifiHits[hitDict[aHit]])
75 aCluster = ROOT.sndCluster(first,N,hitlist,scifiDet)
76 clusters.append(aCluster)
88 vertical =
int(aCl.GetFirst()/100000)%10==1
89 s =
int(aCl.GetFirst()/1000000)-1
91 xHits[s].append(ROOT.TVector3(A))
92 rc = h[
'clX'].Fill(aCl.GetN())
94 yHits[s].append(ROOT.TVector3(A))
95 rc = h[
'clY'].Fill(aCl.GetN())
96 proj = {
'X':xHits,
'Y':yHits}
100 if len(proj[p][s1]) !=1:
continue
102 for s2
in range(s1+1,5):
103 if len(proj[p][s2]) !=1:
continue
105 dz = abs(cl1[2]-cl2[2])
110 for ix1
in range(0,len(sls)-1):
111 for ix2
in range(ix1+1,len(sls)):
112 if p==
"X": rc = h[
'slopes'+p].Fill( sls[ix2][0]-sls[ix1][0])
113 if p==
"Y": rc = h[
'slopes'+p].Fill( sls[ix2][1]-sls[ix1][1])
114 ut.bookCanvas(h,
'slopes',
' ',1024,768,1,2)
116 h[
'slopesX'].GetXaxis().SetRangeUser(-0.2,0.2)
117 h[
'slopesX'].SetTitle(
'x projection; delta slope [rad]')
119 h[
'slopesX'].Fit(
'gaus',
'S',
'',-0.02,0.02)
121 stats = h[
'slopesX'].FindObject(
'stats')
124 h[
'slopesY'].GetXaxis().SetRangeUser(-0.2,0.2)
125 h[
'slopesY'].SetTitle(
'y projection; delta slope [rad]')
127 h[
'slopesY'].Fit(
'gaus',
'S',
'',-0.02,0.02)
129 stats = h[
'slopesY'].FindObject(
'stats')
131 for event
in eventTree:
136 for k
in range(event.Digi_ScifiHits.GetEntries()):
137 d = event.Digi_ScifiHits[k]
138 if not d.isValid():
continue
139 hitDict[d.GetDetectorID()] = k
140 hitList = list(hitDict.keys())
146 last = len(hitList)-1
147 hitlist = ROOT.std.vector(
"sndScifiHit*")()
148 for i
in range(len(hitList)):
149 if i==0
and len(hitList)>1:
continue
153 if (c-cprev)!=1
or c==hitList[last]:
157 for aHit
in tmp: hitlist.push_back( event.Digi_ScifiHits[hitDict[aHit]])
158 aCluster = ROOT.sndCluster(first,N,hitlist,scifiDet)
159 clusters.append(aCluster)
171 vertical =
int(aCl.GetFirst()/100000)%10==1
172 s =
int(aCl.GetFirst()/1000000)-1
174 xHits[s].append(ROOT.TVector3(A))
175 rc = h[
'clX'].Fill(aCl.GetN())
177 yHits[s].append(ROOT.TVector3(A))
178 rc = h[
'clY'].Fill(aCl.GetN())
179 proj = {
'X':xHits,
'Y':yHits}
182 for s1
in range(0,5):
183 if len(proj[p][s1]) !=1:
continue
185 for s2
in range(s1+1,5):
186 if len(proj[p][s2]) !=1:
continue
189 for mat
in range(30):
190 ut.bookHist(h,
'mat_'+
str(mat),
'hit map / mat',512,-0.5,511.5)
191 ut.bookHist(h,
'sig_'+
str(mat),
'signal / mat',150,0.0,150.)
193 if Nev < 0 : Nev = eventTree.GetEntries()
194 for event
in eventTree:
197 for aHit
in event.Digi_ScifiHits:
198 if not aHit.isValid():
continue
199 X =
xPos(aHit.GetDetectorID())
200 rc = h[
'mat_'+
str(X[0]*3+X[1])].Fill(X[2])
201 rc = h[
'sig_'+
str(X[0]*3+X[1])].Fill(aHit.GetSignal(0))
202 ut.bookCanvas(h,
'hitmaps',
' ',1024,768,6,5)
203 ut.bookCanvas(h,
'signal',
' ',1024,768,6,5)
204 for mat
in range(30):
205 tc = h[
'hitmaps'].cd(mat+1)
206 A = h[
'mat_'+
str(mat)].GetSumOfWeights()/512.
207 if h[
'mat_'+
str(mat)].GetMaximum()>10*A: h[
'mat_'+
str(mat)].SetMaximum(10*A)
208 h[
'mat_'+
str(mat)].Draw()
209 tc = h[
'signal'].cd(mat+1)
210 h[
'sig_'+
str(mat)].Draw()
249 A,B = ROOT.TVector3(),ROOT.TVector3()
250 ut.bookHist(h,
'bs',
'beam spot',100,-100.,10.,100,0.,80.)
251 for event
in eventTree:
255 for d
in event.Digi_ScifiHits:
256 detID = d.GetDetectorID()
257 s =
int(detID/1000000)
258 modules[
'Scifi'].GetSiPMPosition(detID,A,B)
259 vertical =
int(detID/100000)%10==1
260 if vertical: xMean+=A[0]
263 rc = h[
'bs'].Fill(xMean/w,yMean/w)