Commit 31bcbbfe authored by David Blyth's avatar David Blyth

Fix for eic proto2 model

parent 6e1d2046
...@@ -59,7 +59,7 @@ func main() { ...@@ -59,7 +59,7 @@ func main() {
continue continue
} }
hist.Fill(math.Log10(float64(eDep.Mean*1000)), 1) hist.Fill(math.Log10(float64(eDep.GetMean()*1000)), 1)
} }
} }
......
...@@ -121,7 +121,7 @@ func makeTrackEffPlotters(filename string, pTMin, pTMax, fracCut, etaLimit float ...@@ -121,7 +121,7 @@ func makeTrackEffPlotters(filename string, pTMin, pTMax, fracCut, etaLimit float
for _, sourceID := range eDep.Source { for _, sourceID := range eDep.Source {
simHit, ok := event.GetEntry(sourceID).(*eic.SimHit) simHit, ok := event.GetEntry(sourceID).(*eic.SimHit)
if ok { if ok {
partCandID[simHit.Particle]++ partCandID[simHit.GetParticle()]++
} }
_, ok = event.GetEntry(sourceID).(*eic.Particle) _, ok = event.GetEntry(sourceID).(*eic.Particle)
...@@ -149,14 +149,14 @@ func makeTrackEffPlotters(filename string, pTMin, pTMax, fracCut, etaLimit float ...@@ -149,14 +149,14 @@ func makeTrackEffPlotters(filename string, pTMin, pTMax, fracCut, etaLimit float
continue continue
} }
pMag := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2) + math.Pow(part.P.Z, 2)) pMag := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2) + math.Pow(part.GetP().GetZ(), 2))
eta := math.Atanh(part.P.Z / pMag) eta := math.Atanh(part.GetP().GetZ() / pMag)
pT := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2)) pT := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2))
chargeMag := math.Abs(float64(part.Charge)) chargeMag := math.Abs(float64(part.GetCharge()))
poqMag := pMag / chargeMag poqMag := pMag / chargeMag
diffMag := math.Sqrt(math.Pow(track.Segment[0].Poq.X-part.P.X/chargeMag, 2) + diffMag := math.Sqrt(math.Pow(track.Segment[0].GetPoq().GetX()-part.GetP().GetX()/chargeMag, 2) +
math.Pow(track.Segment[0].Poq.Y-part.P.Y/chargeMag, 2) + math.Pow(track.Segment[0].GetPoq().GetY()-part.GetP().GetY()/chargeMag, 2) +
math.Pow(track.Segment[0].Poq.Z-part.P.Z/chargeMag, 2)) math.Pow(track.Segment[0].GetPoq().GetZ()-part.GetP().GetZ()/chargeMag, 2))
fracDiff := diffMag / poqMag fracDiff := diffMag / poqMag
// cuts // cuts
...@@ -177,9 +177,9 @@ func makeTrackEffPlotters(filename string, pTMin, pTMax, fracCut, etaLimit float ...@@ -177,9 +177,9 @@ func makeTrackEffPlotters(filename string, pTMin, pTMax, fracCut, etaLimit float
continue continue
} }
pMag := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2) + math.Pow(part.P.Z, 2)) pMag := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2) + math.Pow(part.GetP().GetZ(), 2))
eta := math.Atanh(part.P.Z / pMag) eta := math.Atanh(part.GetP().GetZ() / pMag)
pT := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2)) pT := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2))
// cuts // cuts
if pT < pTMin || pT > pTMax { if pT < pTMin || pT > pTMax {
......
...@@ -83,7 +83,7 @@ func main() { ...@@ -83,7 +83,7 @@ func main() {
continue continue
} }
partCandID[simHit.Particle]++ partCandID[simHit.GetParticle()]++
} }
} }
...@@ -105,14 +105,14 @@ func main() { ...@@ -105,14 +105,14 @@ func main() {
continue continue
} }
pMag := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2) + math.Pow(part.P.Z, 2)) pMag := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2) + math.Pow(part.GetP().GetZ(), 2))
eta := math.Atanh(part.P.Z / pMag) eta := math.Atanh(part.GetP().GetZ() / pMag)
pT := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2)) pT := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2))
chargeMag := math.Abs(float64(part.Charge)) chargeMag := math.Abs(float64(part.GetCharge()))
poqMag := pMag / chargeMag poqMag := pMag / chargeMag
trackPoqMag := math.Sqrt(math.Pow(track.Segment[0].Poq.X, 2) + trackPoqMag := math.Sqrt(math.Pow(track.Segment[0].GetPoq().GetX(), 2) +
math.Pow(track.Segment[0].Poq.Y, 2) + math.Pow(track.Segment[0].GetPoq().GetY(), 2) +
math.Pow(track.Segment[0].Poq.Z, 2)) math.Pow(track.Segment[0].GetPoq().GetZ(), 2))
resGrid.Fill(eta, pT, trackPoqMag/poqMag) resGrid.Fill(eta, pT, trackPoqMag/poqMag)
} }
......
...@@ -83,7 +83,7 @@ func main() { ...@@ -83,7 +83,7 @@ func main() {
continue continue
} }
partCandID[simHit.Particle]++ partCandID[simHit.GetParticle()]++
} }
} }
...@@ -105,14 +105,14 @@ func main() { ...@@ -105,14 +105,14 @@ func main() {
continue continue
} }
pMag := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2) + math.Pow(part.P.Z, 2)) pMag := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2) + math.Pow(part.GetP().GetZ(), 2))
eta := math.Atanh(part.P.Z / pMag) eta := math.Atanh(part.GetP().GetZ() / pMag)
pT := math.Sqrt(math.Pow(part.P.X, 2) + math.Pow(part.P.Y, 2)) pT := math.Sqrt(math.Pow(part.GetP().GetX(), 2) + math.Pow(part.GetP().GetY(), 2))
chargeMag := math.Abs(float64(part.Charge)) chargeMag := math.Abs(float64(part.GetCharge()))
poqMag := pMag / chargeMag poqMag := pMag / chargeMag
trackPoqMag := math.Sqrt(math.Pow(track.Segment[0].Poq.X, 2) + trackPoqMag := math.Sqrt(math.Pow(track.Segment[0].GetPoq().GetX(), 2) +
math.Pow(track.Segment[0].Poq.Y, 2) + math.Pow(track.Segment[0].GetPoq().GetY(), 2) +
math.Pow(track.Segment[0].Poq.Z, 2)) math.Pow(track.Segment[0].GetPoq().GetZ(), 2))
resGrid.Fill(eta, pT, trackPoqMag/poqMag) resGrid.Fill(eta, pT, trackPoqMag/poqMag)
} }
...@@ -122,8 +122,8 @@ func main() { ...@@ -122,8 +122,8 @@ func main() {
img := vgimg.New(670, 400) img := vgimg.New(670, 400)
dc := draw.New(img) dc := draw.New(img)
dc0 := draw.Crop(dc, 0, -70, 0, 0) dc0 := draw.Crop(dc, 0, -70, 0, 0)
dc1 := draw.Crop(dc, 620, 0, 0, 0) dc1 := draw.Crop(dc, 620, 0, 0, 0)
colorMap := moreland.ExtendedBlackBody() colorMap := moreland.ExtendedBlackBody()
colorMap.SetMin(0) colorMap.SetMin(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment