3 from __future__
import print_function
7 from array
import array
13 return xset[ss], yset[ss], nset[ss]
21 print (
"Number of points ", len(xset), len(yset))
23 histXY = ROOT.TH2F(
'clusE',
'clusE', 2000, -800.0, 800.0, 2000, -800., 800. )
26 for i
in range(0,len(xset)):
28 print (
'nrun %3d xCryo %5d yTable %5d nev %5d' % (i+1,xset[i], yset[i], nset[i]))
29 nevtot = nevtot + nset[i]
30 dist = sqrt(xset[i]*xset[i] + (70-yset[i])*(70-yset[i]))
32 nevinwin = nevinwin + nset[i]
34 histXY.Fill(xset[i], yset[i])
35 c0 = ROOT.TCanvas(
'c0',
'c0', 800, 800 )
40 ROOT.gPad.SetLeftMargin(0.12)
41 ROOT.gPad.SetRightMargin(0.12)
42 ROOT.gPad.SetTopMargin(0.12)
43 ROOT.gPad.SetBottomMargin(0.12)
44 tc = ROOT.TEllipse(0,70,300)
47 histXY.SetMarkerStyle(20)
48 histXY.SetLineColor(2)
49 histXY.SetMarkerColor(2)
56 poly_x =
array(
'd',[0, 500, 700, 60, -60, -700, -500, 0])
57 poly_y =
array(
'd',[700, 600, 400, -400, -400, 400, 600, 700])
58 myPoly = ROOT.TPolyLine(poly_np, poly_x, poly_y)
59 myPoly.SetLineColor(4)
60 myPoly.SetLineWidth(2)
67 print (
"nevtot:",nevtot,
"in win:",nevinwin)
68 return c0, histXY, tc, myPoly
85 poly_x =
array(
'i',[0, 500, 700, 60, -60, -700, -500, 0])
86 poly_y =
array(
'i',[700, 600, 400, -400, -400, 400, 600, 700])
101 print (
"Initial number of events:", nev0,
"y_Ytop:",y_Ytop,
"n_Ytop:",n_Ytop,
"y_Ybot:",y_Ybot,
"n_Ybot:",n_Ybot)
114 nset.append( (n_Ybot+(y0-y_Ybot)*(n_Ytop-n_Ybot)/(y_Ytop-y_Ybot))/10*10 )
115 for iRound
in range(1,1000):
117 nPoints = (boxSide-1)*4
121 for iPoint
in range(0, nPoints):
122 boxSideNum = iPoint/(boxSide-1)
123 boxSideStep = iPoint%(boxSide-1)
126 iY = y0 - iRound*dy + dy*boxSideStep
128 iX = x0 - iRound*dx + dx*boxSideStep
132 iY = y0 + iRound*dy - dy*boxSideStep
134 iX = x0 + iRound*dx - dx*boxSideStep
137 result = mt.IsInside(iX, iY, poly_np, poly_x, poly_y)
143 nset.append( (n_Ybot+(iY-y_Ybot)*(n_Ytop-n_Ybot)/(y_Ytop-y_Ybot))/10*10 )
148 return xset, yset, nset