25 #include "TProfile2D.h"
57 std::unique_ptr<TH1D>
h_x;
58 std::unique_ptr<TH1D>
h_y;
59 std::unique_ptr<TH1D>
h_time;
64 const double bin_size_x = (
pixel) ? pitch *
cos(18.4 / 180. *
M_PI) : 100E-3;
66 h2_y_vs_x = std::make_unique<TH2D>(
"",
"", 300, -10., +70., 600, -30., +30.);
67 p_y_vs_x = std::make_unique<TProfile>(
"",
"", 300, -10., +70.);
69 int n_mi =
ceil(10. / bin_size_x);
70 int n_pl =
ceil(70. / bin_size_x);
72 h_x = std::make_unique<TH1D>(
"",
"", n_mi + n_pl, -n_mi * bin_size_x, +n_pl * bin_size_x);
74 h_y = std::make_unique<TH1D>(
"",
"", 300, -15., +15.);
76 h_time = std::make_unique<TH1D>(
"",
";time", 500, -50., +50.);
98 std::map<unsigned int, RPPlots>
rpPlots;
113 std::map<unsigned int, std::map<unsigned int, Stat>>
m_stat;
116 :
h_de_x(new TH1D(
"",
";x^{F} - x^{N}", 100, -1., +1.)),
117 h_de_y(new TH1D(
"",
";y^{F} - y^{N}", 100, -1., +1.)),
118 p_de_x_vs_x(new TProfile(
"",
";x^{N};x^{F} - x^{N}", 40, 0., 40.)),
119 p_de_y_vs_x(new TProfile(
"",
";x^{N};y^{F} - y^{N}", 40, 0., 40.)),
121 p2_de_y_vs_x_y(new TProfile2D(
"",
";x;y", 40, 0., 40., 40, -20., +20.)),
122 h2_de_x_vs_x(new TH2D(
"",
";x^{N};x^{F} - x^{N}", 80, 0., 40., 100, -1., +1.)),
123 h2_de_y_vs_x(new TH2D(
"",
";x^{N};y^{F} - y^{N}", 80, 0., 40., 100, -1., +1.)),
124 h2_de_y_vs_de_x(new TH2D(
"",
";x^{F} - x^{N};y^{F} - y^{N}", 100, -1., +1., 100, -1., +1.)) {}
126 void fill(
double x_N,
double y_N,
double x_F,
double y_F) {
157 for (
const auto& rp :
m_stat) {
158 TGraph*
g =
new TGraph();
161 sprintf(
buf,
"g_mean_track_mult_run_%u", rp.first);
164 for (
const auto& lsp : rp.second) {
165 const int idx =
g->GetN();
166 const double m = (lsp.second.s1 > 0) ?
double(lsp.second.sN) / lsp.second.s1 : 0.;
167 g->SetPoint(
idx, lsp.first,
m);
175 std::map<unsigned int, ArmPlots>
armPlots;
182 x_pitch_pixels_(iConfig.getUntrackedParameter<double>(
"x_pitch_pixels", 150E-3)),
183 outputFile_(iConfig.getParameter<
std::
string>(
"outputFile")),
200 std::map<unsigned int, unsigned int> m_mult;
202 for (
const auto& trk : *
tracks) {
204 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
211 pl.fill(trk.x(), trk.y(), trk.time());
213 m_mult[
rpId.arm()]++;
216 for (
unsigned int arm = 0; arm < 2; ++arm) {
219 st.sN += m_mult[arm];
228 if (rpId1.arm() != rpId2.arm())
233 const unsigned int rpDecId1 = rpId1.arm() * 100 + rpId1.station() * 10 + rpId1.rp();
234 const unsigned int rpDecId2 = rpId2.arm() * 100 + rpId2.station() * 10 + rpId2.rp();
236 if (rpDecId1 == ap.rpId_N && rpDecId2 == ap.rpId_F)
237 ap.fill(
t1.x(),
t1.y(),
t2.x(),
t2.y());
258 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
260 for (
const auto& it :
rpPlots) {
261 gDirectory = f_out->mkdir(Form(
"RP %u", it.first));
266 gDirectory = f_out->mkdir(Form(
"arm %u", it.first));