16 print(
"****************************************")
17 print(
"*** You are using PID version 18.1.0 ***")
18 print(
"****************************************")
21 if not self.
sTree.GetBranch(
"pid"):
26 self.
PDG = ROOT.TDatabasePDG.Instance()
27 fGeo = ROOT.gGeoManager
28 top = fGeo.GetTopVolume()
29 dv = top.GetNode(
'DecayVolume_1')
31 T1Lid = ns.FindObject(
"T1Lid_1").GetMatrix()
35 hadron = top.GetNode(
"Hcal_1")
36 hvol = hadron.GetVolume()
37 self.
zpositions[
'hcal'] = hadron.GetMatrix().GetTranslation()[2]
38 ecal = top.GetNode(
"Ecal_1")
39 evol = ecal.GetVolume()
40 self.
zpositions[
'ecal'] = ecal.GetMatrix().GetTranslation()[2]
41 x = sys.modules[
'__main__']
44 muonDet = top.GetNode(
'MuonDetector_'+str(i+1))
45 if muonDet: self.
zpositions[
'muon'+str(i)] = muonDet.GetMatrix().GetTranslation()[2]
46 else: self.
zpositions[
'muon'+str(i)] = ShipGeo[
'MuonStation'+str(i)].z
47 self.
hcal = sys.modules[
'__main__']. modules[
'Hcal']
66 self.
P_min00,self.
P_max00,self.
dx00_min,self.
dx00_max,self.
dy00_min,self.
dy00_max=-99,-99,-99,-99,-99,-99
67 self.
P_min01,self.
P_max01,self.
dx01_min,self.
dx01_max,self.
dy01_min,self.
dy01_max=-99,-99,-99,-99,-99,-99
68 self.
P_min02,self.
P_max02,self.
dx02_min,self.
dx02_max,self.
dy02_min,self.
dy02_max=-99,-99,-99,-99,-99,-99
69 self.
P_min03,self.
P_max03,self.
dx03_min,self.
dx03_max,self.
dy03_min,self.
dy03_max=-99,-99,-99,-99,-99,-99
71 self.
P_min10,self.
P_max10,self.
dx10_min,self.
dx10_max,self.
dy10_min,self.
dy10_max= 0, 8, -5, 5, -5, 5
72 self.
P_min11,self.
P_max11,self.
dx11_min,self.
dx11_max,self.
dy11_min,self.
dy11_max=-99,-99,-99,-99,-99,-99
73 self.
P_min12,self.
P_max12,self.
dx12_min,self.
dx12_max,self.
dy12_min,self.
dy12_max=-99,-99,-99,-99,-99,-99
74 self.
P_min13,self.
P_max13,self.
dx13_min,self.
dx13_max,self.
dy13_min,self.
dy13_max=-99,-99,-99,-99,-99,-99
76 self.
P_min20,self.
P_max20,self.
dx20_min,self.
dx20_max,self.
dy20_min,self.
dy20_max= 8, 13, -5, 5, -5, 5
77 self.
P_min21,self.
P_max21,self.
dx21_min,self.
dx21_max,self.
dy21_min,self.
dy21_max= 13, 20, -3, 3, -3, 3
78 self.
P_min22,self.
P_max22,self.
dx22_min,self.
dx22_max,self.
dy22_min,self.
dy22_max=-99,-99,-99,-99,-99,-99
80 self.
P_min30,self.
P_max30,self.
dx30_min,self.
dx30_max,self.
dy30_min,self.
dy30_max= 20,999, -4, 4, -4, 4
81 self.
P_min31,self.
P_max31,self.
dx31_min,self.
dx31_max,self.
dy31_min,self.
dy31_max=-99,-99,-99,-99,-99,-99
93 if not hasattr(self.
sTree,
'HcalPointLite'):
return
94 for chit
in self.
sTree.HcalPointLite:
95 if not chit.GetEnergyLoss()>0:
continue
96 detID = chit.GetDetectorID()
99 section = ctypes.c_int()
100 self.
hcal.GetCellCoordInf(detID,x,y,section)
101 ELoss = chit.GetEnergyLoss()/u.MeV
102 if ELoss>0: self.
hcal1.append([x.value,y.value,section.value,ELoss])
110 for ahit
in self.
sTree.muonPoint:
111 if not ahit.GetEnergyLoss()>0:
continue
112 detID = ahit.GetDetectorID()
120 if (pos_hit_x0<0
or pos_hit_x0>self.
ncells_x)
or (pos_hit_y0<0
or pos_hit_y0>self.
ncells_y):
continue
121 E = ahit.GetEnergyLoss()/u.MeV
131 if (pos_hit_x1<0
or pos_hit_x1>self.
ncells_x)
or (pos_hit_y1<0
or pos_hit_y1>self.
ncells_y):
continue
132 E1 = ahit.GetEnergyLoss()/u.MeV
142 if (pos_hit_x2<0
or pos_hit_x2>self.
ncells_x)
or (pos_hit_y2<0
or pos_hit_y2>self.
ncells_y):
continue
143 E2 = ahit.GetEnergyLoss()/u.MeV
153 if (pos_hit_x3<0
or pos_hit_x3>self.
ncells_x)
or (pos_hit_y3<0
or pos_hit_y3>self.
ncells_y):
continue
154 E3 = ahit.GetEnergyLoss()/u.MeV
157 for i
in range(len(self.
list1)):
158 E, E1, E2, E3, EE, E_tot=0,0,0,0,0,0
160 for j
in range(len(self.
list1)):
162 if x == xx
and y == yy
and mull == mulll: E_tot+=EE
165 if not mull==0: self.
list2.append([x,y,E_tot,mull])
167 for elem
in self.
list2:
180 for fT
in self.
sTree.FitTracks:
182 self.
pid00,self.
pid01,self.
pid02,self.
pid03,self.
pid10,self.
pid11,self.
pid12,self.
pid13=
False,
False,
False,
False,
False,
False,
False,
False
186 self.
pos_pad_x0,self.
pos_pad_y0,self.
pos_pad_x1,self.
pos_pad_y1,self.
pos_pad_x2,self.
pos_pad_y2,self.
pos_pad_x3,self.
pos_pad_y3=0,0,0,0,0,0,0,0
190 fst = fT.getFitStatus()
191 if not fst.isFitConverged()
or fst.getNdf() < self.
cutNdf:
193 pidObject.SetTrackID(i)
194 pidObject.SetTrackPID(-3)
195 nPID=ppid.GetEntries()
198 fittedState = fT.getFittedState()
199 self.
P = fittedState.getMomMag()
210 pidObject.SetTrackID(i)
212 pidObject.SetTrackPID(-1)
213 nPID=ppid.GetEntries()
220 pidObject.SetTrackPID(1)
223 pidObject.SetTrackPID(3)
227 pidObject.SetTrackPID(2)
230 pidObject.SetTrackPID(-2)
232 nPID=ppid.GetEntries()
245 if self.
det ==
'muon1':
253 if self.
det ==
'muon2':
261 if self.
det ==
'muon3':
271 for i
in range(len(self.
list2)):
315 if not self.
P>5
and (self.
pid10==
False and self.
pid20==
False and self.
pid21==
False and self.
pid30==
False):
318 if (chmu1<0.5
and chmu2<0.5):
325 if self.
det ==
'ecal':
331 for aClus
in self.
sTree.EcalReconstructed:
332 x1_Clus, y1_Clus, Ene1_Clus = aClus.X(), aClus.Y(), aClus.RecoE()
344 if self.
det ==
'hcal':
350 N1,N2,M,E_est,E_totale=0,0,0,0.,0.
352 for i
in range(len(self.
hcal1)):
356 if (m.pow(delta_x,2)+m.pow(delta_y,2))<2500
and s==0:
358 if (m.pow(delta_x,2)+m.pow(delta_y,2))<2500
and s==1: