Commit ff717781 authored by Vladimir Gligorov's avatar Vladimir Gligorov
Browse files

more conflict fixing

parents 158bb13c 14ca1f56
Pipeline #933197 passed with stage
in 1 minute and 35 seconds
......@@ -31,7 +31,7 @@ def ghostHistoDict():
basedict = {"eta": {}, "nPV": {}}
basedict["eta"]["xTitle"] = "#eta"
basedict["eta"]["variable"] = "Eta"
basedict["eta"]["variable"] = "eta"
basedict["nPV"]["xTitle"] = "# of PVs"
basedict["nPV"]["variable"] = "nPV"
......@@ -41,6 +41,7 @@ def ghostHistoDict():
def getCuts():
basedict = {"Velo": {}, "Upstream": {}, "Forward": {}}
# basedict["Forward"] = [
# "Long_eta25", "LongFromB_eta25"
# ]
......
......@@ -44,7 +44,7 @@ def setLHCbStyle():
# set the paper & margin sizes
lhcbStyle.SetPaperSize(20, 26)
lhcbStyle.SetPadTopMargin(0.05)
lhcbStyle.SetPadRightMargin(0.08) # increase for colz plots
lhcbStyle.SetPadRightMargin(0.10) # increase for colz plots
lhcbStyle.SetPadBottomMargin(0.16)
lhcbStyle.SetPadLeftMargin(0.14)
......
......@@ -116,7 +116,7 @@ def place_legend(canvas,
return canvas.BuildLegend(0.5, 0.67, 0.88, 0.88, header, option)
def find_place(canvas, x1=None, y1=None, x2=None, y2=None):
def find_place(canvas, default=3, x1=None, y1=None, x2=None, y2=None):
# Make sure all objects are correctly registered
canvas.Update()
......@@ -135,7 +135,7 @@ def find_place(canvas, x1=None, y1=None, x2=None, y2=None):
continue
return place
return PLACES[3] # fallback solution
return PLACES[default] # fallback solution
# Monkey patch ROOT objects to make it all work
......
......@@ -16,6 +16,7 @@ import ROOT
from ROOT import gStyle
from ROOT import gROOT
from ROOT import TStyle
from ROOT import TLegend
from ROOT import gPad
from ROOT import TMultiGraph
......@@ -100,7 +101,33 @@ for category in muonCategories:
g_efficiency.GetYaxis().SetTitle(muonCatDict[category]["title"])
g_efficiency.GetYaxis().SetRangeUser(0, 1)
# draw variable distribution in same canvas
norm = 0.9 / numerator.GetMaximum()
numerator.Scale(norm)
numerator.SetTitle(efficiencyHistoDict[histo]["title"] +
" distribution")
numerator.SetFillColorAlpha(ROOT.kBlack, 0.2)
numerator.SetLineColor(ROOT.kWhite)
numerator.Draw("hist bar same")
if (category == "matched_isMuon"):
place = find_place(canvas, 3)
else:
place = PLACES[0]
#place = find_place(canvas, 0)
legend = TLegend(place[0], place[1], place[2], place[3])
legend.AddEntry(g_efficiency, muonCatDict[category]["title"], "ep")
legend.AddEntry(numerator,
efficiencyHistoDict[histo]["title"] + " distribution",
"f")
legend.SetFillColorAlpha(ROOT.kWhite, 0.)
legend.Draw("same")
canvas.Write()
cleantitle = muonCatDict[category]["title"].replace(" ", "").replace(
",", "_").replace("<", "_")
canvas.SaveAs("../../../plotsfornote/muonID_isMuon_" + histo + "_" +
cleantitle + ".pdf")
# ghost histos
for histo in ghostHistos:
......@@ -127,6 +154,21 @@ for histo in ghostHistos:
g_efficiency.Draw("ap")
g_efficiency.GetYaxis().SetRangeUser(0, 1)
# draw variable distribution in same canvas
norm = 0.9 / numerator.GetMaximum()
numerator.Scale(norm)
numerator.SetTitle(efficiencyHistoDict[histo]["title"] + " distribution")
numerator.SetFillColorAlpha(ROOT.kBlack, 0.2)
numerator.SetLineColor(ROOT.kWhite)
numerator.Draw("hist bar same")
place = find_place(canvas, 0)
legend = TLegend(place[0], place[1], place[2], place[3])
legend.AddEntry(g_efficiency, "muon ID in ghost tracks", "ep")
legend.AddEntry(numerator,
efficiencyHistoDict[histo]["title"] + " distribution", "f")
legend.Draw("same")
canvas.Write()
canvas.SaveAs("../../../plotsfornote/muonID_isMuon_ghosts_" + histo +
".pdf")
......
......@@ -21,6 +21,7 @@ from ROOT import TLegend
from ROOT import gPad
from ROOT import TMultiGraph
from ROOT import THStack
from ROOT import TMath
sys.path.append('../')
from common.LHCbStyle import *
......@@ -39,7 +40,7 @@ def getTrackers():
def getGhostHistoNames():
# return ["eta", "nPV"] # currently no eta information available from track
#return ["nPV", "eta"] # currently no eta information available from track
return ["nPV"]
......@@ -160,7 +161,7 @@ for tracker in trackers:
else:
variable.SetTitle(efficiencyHistoDict[histo]["title"] +
" distribution")
variable.SetLineColor(ROOT.kBlack)
variable.SetLineColor(ROOT.kWhite)
variable.SetFillColorAlpha(ROOT.kBlack, 0.2)
variable.Draw("hist bar same")
......@@ -175,11 +176,11 @@ for tracker in trackers:
variable_electrons.Scale(norm)
variable_electrons.SetTitle(efficiencyHistoDict[histo]["title"]
+ " distribution, electrons")
variable_electrons.SetLineColor(ROOT.kAzure - 3)
variable_electrons.SetLineColor(ROOT.kWhite)
variable_electrons.SetFillColorAlpha(ROOT.kAzure - 3, 0.2)
variable_electrons.Draw("hist bar same")
place = find_place(canvas)
place = find_place(canvas, 3)
legend = TLegend(place[0], place[1], place[2], place[3])
if categories[tracker][cut]["plotElectrons"]:
legend.AddEntry(g_efficiency_notElectrons,
......@@ -202,8 +203,6 @@ for tracker in trackers:
" distribution, electrons", "f")
legend.SetFillColorAlpha(ROOT.kWhite, 0.)
legend.Draw("same")
#canvas.PlaceLegend("f")
#place_legend(canvas)
canvas.Write()
cleantitle = categories[tracker][cut]["title"].replace(
......@@ -242,6 +241,26 @@ for tracker in trackers:
g_efficiency.GetYaxis().SetTitle("ghost rate")
g_efficiency.Draw("ap")
# draw variable distribution in same canvas
max_point = TMath.MaxElement(g_efficiency.GetN(), g_efficiency.GetY())
norm = max_point / numerator.GetMaximum()
print("norm:")
print(norm)
numerator.Scale(norm)
numerator.SetTitle(efficiencyHistoDict[histo]["title"] +
" distribution")
numerator.SetFillColorAlpha(ROOT.kBlack, 0.2)
numerator.SetLineColor(ROOT.kWhite)
numerator.Draw("hist bar same")
place = find_place(canvas)
legend = TLegend(place[0], place[1], place[2], place[3])
legend.AddEntry(g_efficiency, "ghost rate", "ep")
legend.AddEntry(numerator,
efficiencyHistoDict[histo]["title"] + " distribution",
"f")
legend.Draw("same")
canvas.Write()
canvas.SaveAs("../../../plotsfornote/" + tracker + "GhostRate.pdf")
#canvas.Print("../../../output/checkerplots/forreviewdoc/"+histoBaseName.replace("/","_")+ghostHistoDict[histo]["variable"]+"_ghost.pdf")
......
......@@ -16,6 +16,8 @@ from ROOT import TStyle
from ROOT import gPad
from ROOT import TGraphErrors
from array import array
from ROOT import TMath
from ROOT import TLegend
sys.path.append('../')
from common.LHCbStyle import *
......@@ -100,9 +102,7 @@ def getResolutionInSlices(histo2D, var, var_dict):
gr.SetTitle("")
gr.SetName(name)
gr.Write()
canvas.Write()
canvas.SaveAs("../../../plotsfornote/" + tracker + "MomResVsP.pdf")
#gr.Write()
#name = "dp_vs_p_rms"
#title = "dp vs p, histogram RMS"
......@@ -121,6 +121,19 @@ def getResolutionInSlices(histo2D, var, var_dict):
# overall momentum resolution
histo1D = histo2D.ProjectionY("_py")
histo1D.Write()
# plot distribution in same canvas
max_point = TMath.MaxElement(gr.GetN(), gr.GetY())
norm = max_point / histo1D.GetMaximum()
histo1D.Scale(norm)
histo1D.SetFillColorAlpha(ROOT.kBlack, 0.2)
histo1D.SetLineColor(ROOT.kWhite)
#histo1D.Draw("hist bar same")
canvas.Write()
canvas.SaveAs("../../../plotsfornote/" + tracker + "MomResVs" + var +
".pdf")
histo1D.Fit("gaus")
sigma_p = histo1D.GetFunction("gaus").GetParameter(2)
delta_sigma_p = histo1D.GetFunction("gaus").GetParError(2)
......
......@@ -95,15 +95,10 @@ TrackCheckerHistos::TrackCheckerHistos(const std::vector<HistoCategory>& histo_c
std::make_unique<TH1D>("matched_isMuon_P_reconstructed", "matched_isMuon_P_reconstructed", 10, 0., 100000.);
h_not_matched_isMuon_P_reconstructed =
std::make_unique<TH1D>("not_matched_isMuon_P_reconstructed", "not_matched_isMuon_P_reconstructed", 10, 0., 100000.);
h_muon_Pt_reconstructible =
std::make_unique<TH1D>("muon_Pt_reconstructible", "muon_Pt_reconstructible", 30, 0., 100000.);
h_not_muon_Pt_reconstructible =
std::make_unique<TH1D>("not_muon_Pt_reconstructible", "not_muon_Pt_reconstructible", 30, 0., 100000.);
h_matched_isMuon_Pt_reconstructed =
std::make_unique<TH1D>("matched_isMuon_Pt_reconstructed", "matched_isMuon_Pt_reconstructed", 30, 0., 100000.);
h_not_matched_isMuon_Pt_reconstructed = std::make_unique<TH1D>(
"not_matched_isMuon_Pt_reconstructed", "not_matched_isMuon_Pt_reconstructed", 30, 0., 100000.);
h_muon_Pt_reconstructible = std::make_unique<TH1D>("muon_Pt_reconstructible", "muon_Pt_reconstructible", 30, 0., 5000.);
h_not_muon_Pt_reconstructible = std::make_unique<TH1D>("not_muon_Pt_reconstructible", "not_muon_Pt_reconstructible", 30, 0., 5000.);
h_matched_isMuon_Pt_reconstructed = std::make_unique<TH1D>("matched_isMuon_Pt_reconstructed", "matched_isMuon_Pt_reconstructed", 30, 0., 5000.);
h_not_matched_isMuon_Pt_reconstructed = std::make_unique<TH1D>("not_matched_isMuon_Pt_reconstructed", "not_matched_isMuon_Pt_reconstructed", 30, 0., 5000.);
h_muon_Phi_reconstructible =
std::make_unique<TH1D>("muon_Phi_reconstructible", "muon_Phi_reconstructible", 15, -3.142, 3.142);
......
......@@ -363,7 +363,7 @@ __device__ void save_track(
}
const float evalParams[3] = {p, pt, finalParams[3]};
const float discriminant = evaluateLinearDiscriminant(evalParams, nHits);
if (discriminant < UT::Constants::LD3Hits) return;
if( discriminant < UT::Constants::LD3Hits ) return;
// the track will be added
int n_tracks = atomicAdd(n_veloUT_tracks, 1);
......
......@@ -44,10 +44,11 @@ __host__ __device__ float fastfitter(
{
const float ty = velo_state.ty;
const float zKink = UT::Constants::magFieldParams[0] - ty*ty*UT::Constants::magFieldParams[1] - ty*ty*ty*ty*UT::Constants::magFieldParams[2];
const float xMidField = velo_state.x + velo_state.tx*(zKink-velo_state.z);
const float zKink = UT::Constants::magFieldParams[0] - ty * ty * UT::Constants::magFieldParams[1] -
ty * ty * ty * ty * UT::Constants::magFieldParams[2];
const float xMidField = velo_state.x + velo_state.tx * (zKink - velo_state.z);
const float zDiff = 0.001f * (zKink - UT::Constants::zMidUT);
const float zDiff = 0.001f * (zKink - UT::Constants::zMidUT);
// -- This is to avoid division by zero...
const float pHelper = std::max( float(std::abs(best_params.qp * qpxz2p)), float(1e-9));
......@@ -79,15 +80,15 @@ __host__ __device__ float fastfitter(
const float t = ut_hits.sinT(hit, dxDy);
mat[0] += w;
mat[1] += w * dz;
mat[2] += w * dz * dz;
mat[3] += w * t;
mat[4] += w * dz * t;
mat[5] += w * t * t;
rhs[0] += w * ui;
rhs[1] += w * ui * dz;
rhs[2] += w * ui * t;
mat[1] += w * dz;
mat[2] += w * dz * dz;
mat[3] += w * t;
mat[4] += w * dz * t;
mat[5] += w * t * t;
rhs[0] += w * ui;
rhs[1] += w * ui * dz;
rhs[2] += w * ui * t;
}
}
......
......@@ -40,13 +40,19 @@ namespace Consumers {
struct UTLookupTables final : public Allen::NonEventData::Consumer {
public:
<<<<<<< HEAD
=======
>>>>>>> 14ca1f567707df93f55218f870f1d2808083af3d
UTLookupTables(UTMagnetTool*& tool);
void consume(std::vector<char> const& data) override;
private:
<<<<<<< HEAD
=======
>>>>>>> 14ca1f567707df93f55218f870f1d2808083af3d
std::reference_wrapper<UTMagnetTool*> m_tool;
size_t m_size = 0;
};
......
......@@ -9,8 +9,7 @@ namespace {
using std::to_string;
} // namespace
Consumers::UTLookupTables::UTLookupTables(UTMagnetTool*& tool)
: m_tool{tool} {}
Consumers::UTLookupTables::UTLookupTables(UTMagnetTool*& tool) : m_tool {tool} {}
void Consumers::UTLookupTables::consume(std::vector<char> const& data)
{
......@@ -54,7 +53,7 @@ void Consumers::UTLookupTables::consume(std::vector<char> const& data)
throw StrException {string {"sizes don't match: "} + to_string(m_size) + " " + to_string(data.size())};
}
UTMagnetTool host_tool{deflection, bdl};
UTMagnetTool host_tool {deflection, bdl};
// deflection table
cudaCheck(cudaMemcpy(m_tool.get(), &host_tool, sizeof(UTMagnetTool), cudaMemcpyHostToDevice));
......
Supports Markdown
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