66 TH1F* efficiencyHistogram =
67 new TH1F(
"plane_efficiency",
"KLM plane efficiency",
68 nPlanes, -0.5,
double(nPlanes) - 0.5);
69 std::shared_ptr<TH1F> matchedDigitsInPlane;
71 m_Results.m_MatchedDigits = matchedDigitsInPlane->Integral();
72 std::shared_ptr<TH1F> allExtHitsInPlane;
74 m_Results.m_ExtHits = allExtHitsInPlane->Integral();
75 matchedDigitsInPlane.get()->Sumw2();
76 allExtHitsInPlane.get()->Sumw2();
77 efficiencyHistogram->Divide(matchedDigitsInPlane.get(),
78 allExtHitsInPlane.get(), 1, 1,
"B");
79 for (
int i = 0; i < nPlanes; ++i) {
80 m_Results.m_Efficiency[i] = efficiencyHistogram->GetBinContent(i + 1);
81 m_Results.m_ExtHitsPlane[i] = allExtHitsInPlane->GetBinContent(i + 1);
84 bool notEnoughData =
false;
90 int extHits = allExtHitsInPlane->GetBinContent(planeIndex + 1);
91 float efficiencyError = efficiencyHistogram->GetBinError(planeIndex + 1);
92 if (efficiencyError >
m_Results.m_AchievedPrecision)
93 m_Results.m_AchievedPrecision = efficiencyError;
101 notEnoughData =
true;
105 notEnoughData =
true;
119 int subdetector = klmChannel.getSubdetector();
120 int section = klmChannel.getSection();
121 int sector = klmChannel.getSector();
122 int layer = klmChannel.getLayer();
123 int plane = klmChannel.getPlane();
124 int strip = klmChannel.getStrip();
128 section, sector, layer, plane);
131 section, sector, layer, plane);
134 float efficiency = efficiencyHistogram->GetBinContent(planeIndex + 1);
135 float efficiencyError = efficiencyHistogram->GetBinError(planeIndex + 1);
139 section, sector, layer, plane, strip, efficiency, efficiencyError);
142 section, sector, layer, plane, strip, efficiency, efficiencyError);
150 matchedDigitsInPlane.get()->Write();
151 allExtHitsInPlane.get()->Write();
152 efficiencyHistogram->Write();
153 delete efficiencyHistogram;
std::shared_ptr< T > getObjectPtr(const std::string &name, const std::vector< Calibration::ExpRun > &requestedRuns)
Get calibration data object by name and list of runs, the Merge function will be called to generate t...