104 nav = ROOT.gGeoManager.GetCurrentNavigator()
106 for MuonTaggerHit
in self.
sTree.MuonTaggerPoint:
108 detID = MuonTaggerHit.GetDetectorID()
109 s = str(detID//10000)
110 nav.cd(
'/VMuonBox_1/VSensitive'+s+
'_'+s)
113 MuonTaggerHit.GetX(),
114 MuonTaggerHit.GetY(),
115 MuonTaggerHit.GetZ(), 1])
117 point_local = array(
'd', [0, 0, 0, 1])
118 nav.MasterToLocal(point, point_local)
120 xcoord = point_local[0]
121 ycoord = point_local[1]
124 station = detID//10000
125 if station
not in range(1, 6):
126 print(
"WARNING: Invalid RPC number, something's wrong with the geometry ",station)
135 detectorid = station*10000 + direction*1000 + strip
136 DetectorID.add(detectorid)
138 s = ROOT.gRandom.Poisson(2)
139 if ROOT.gRandom.Rndm() < 0.5: strip = strip - int(s/2)
140 else: strip = strip + int(s/2)
141 for i
in range(0, s):
142 detectorid = station*10000 + direction*1000 + strip + i
143 DetectorID.add(detectorid)
151 detectorid = station*10000 + direction*1000 + strip
152 DetectorID.add(detectorid)
154 s = ROOT.gRandom.Poisson(2)
155 if ROOT.gRandom.Rndm() < 0.5: strip = strip - int(s/2)
156 else: strip = strip + int(s/2)
157 for i
in range(0, s):
158 detectorid = station*10000 + direction*1000 + strip + i
159 DetectorID.add(detectorid)
162 for index, detID
in enumerate(DetectorID):
163 hit = ROOT.MuonTaggerHit(detID, 0)
168 cluster_size = list()
169 DetectorID_list = list(DetectorID)
170 DetectorID_list.sort()
171 if len(DetectorID_list) > 1:
172 clusters = [[DetectorID_list[0]]]
173 for x
in DetectorID_list[1:]:
174 if abs(x - clusters[-1][-1]) <= 1:
175 clusters[-1].append(x)
178 cluster_size = [len(x)
for x
in clusters]
186 for aMCPoint
in self.
sTree.MufluxSpectrometerPoint:
187 aHit = ROOT.MufluxSpectrometerHit(aMCPoint,self.
sTree.t0)
191 detID = aHit.GetDetectorID()
192 if detID
in hitsPerDetId:
196 hitsPerDetId[detID] = index
198 hitsPerDetId[detID] = index
199 if aMCPoint.GetDetectorID()
in deadChannelsForMC: aHit.setInvalid()
200 station = int(aMCPoint.GetDetectorID()//10000000)
201 if ROOT.gRandom.Rndm() < ineffiency[station]: aHit.setInvalid()