64 TH1F* efficiencyHistogram =
65 new TH1F(
"plane_efficiency",
"KLM plane efficiency",
66 nPlanes, -0.5,
double(nPlanes) - 0.5);
67 std::shared_ptr<TH1F> matchedDigitsInPlane;
69 m_Results.m_MatchedDigits = matchedDigitsInPlane->Integral();
70 std::shared_ptr<TH1F> allExtHitsInPlane;
72 m_Results.m_ExtHits = allExtHitsInPlane->Integral();
73 matchedDigitsInPlane.get()->Sumw2();
74 allExtHitsInPlane.get()->Sumw2();
75 efficiencyHistogram->Divide(matchedDigitsInPlane.get(),
76 allExtHitsInPlane.get(), 1, 1,
"B");
77 for (
int i = 0; i < nPlanes; ++i) {
78 m_Results.m_Efficiency[i] = efficiencyHistogram->GetBinContent(i + 1);
79 m_Results.m_ExtHitsPlane[i] = allExtHitsInPlane->GetBinContent(i + 1);
82 bool notEnoughData =
false;
88 int extHits = allExtHitsInPlane->GetBinContent(planeIndex + 1);
89 float efficiencyError = efficiencyHistogram->GetBinError(planeIndex + 1);
90 if (efficiencyError >
m_Results.m_AchievedPrecision)
91 m_Results.m_AchievedPrecision = efficiencyError;
103 notEnoughData =
true;
117 int subdetector = klmChannel.getSubdetector();
118 int section = klmChannel.getSection();
119 int sector = klmChannel.getSector();
120 int layer = klmChannel.getLayer();
121 int plane = klmChannel.getPlane();
122 int strip = klmChannel.getStrip();
126 section, sector, layer, plane);
129 section, sector, layer, plane);
132 float efficiency = efficiencyHistogram->GetBinContent(planeIndex + 1);
133 float efficiencyError = efficiencyHistogram->GetBinError(planeIndex + 1);
137 section, sector, layer, plane, strip, efficiency, efficiencyError);
140 section, sector, layer, plane, strip, efficiency, efficiencyError);
148 matchedDigitsInPlane.get()->Write();
149 allExtHitsInPlane.get()->Write();
150 efficiencyHistogram->Write();
151 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...