25 #include "TProfile2D.h"
56 std::unique_ptr<TH1D>
h_x;
57 std::unique_ptr<TH1D>
h_y;
58 std::unique_ptr<TH1D>
h_time;
63 const double bin_size_x = (
pixel) ? pitch *
cos(18.4 / 180. *
M_PI) : 100E-3;
65 h2_y_vs_x.reset(
new TH2D(
"",
"", 300, -10., +70., 600, -30., +30.));
66 p_y_vs_x.reset(
new TProfile(
"",
"", 300, -10., +70.));
68 int n_mi =
ceil(10. / bin_size_x);
69 int n_pl =
ceil(70. / bin_size_x);
71 h_x.reset(
new TH1D(
"",
"", n_mi + n_pl, -n_mi * bin_size_x, +n_pl * bin_size_x));
73 h_y.reset(
new TH1D(
"",
"", 300, -15., +15.));
75 h_time.reset(
new TH1D(
"",
";time", 500, -50., +50.));
97 std::map<unsigned int, RPPlots>
rpPlots;
112 std::map<unsigned int, std::map<unsigned int, Stat>>
m_stat;
115 :
h_de_x(new TH1D(
"",
";x^{F} - x^{N}", 100, -1., +1.)),
116 h_de_y(new TH1D(
"",
";y^{F} - y^{N}", 100, -1., +1.)),
117 p_de_x_vs_x(new TProfile(
"",
";x^{N};x^{F} - x^{N}", 40, 0., 40.)),
118 p_de_y_vs_x(new TProfile(
"",
";x^{N};y^{F} - y^{N}", 40, 0., 40.)),
120 p2_de_y_vs_x_y(new TProfile2D(
"",
";x;y", 40, 0., 40., 40, -20., +20.)),
121 h2_de_x_vs_x(new TH2D(
"",
";x^{N};x^{F} - x^{N}", 80, 0., 40., 100, -1., +1.)),
122 h2_de_y_vs_x(new TH2D(
"",
";x^{N};y^{F} - y^{N}", 80, 0., 40., 100, -1., +1.)),
123 h2_de_y_vs_de_x(new TH2D(
"",
";x^{F} - x^{N};y^{F} - y^{N}", 100, -1., +1., 100, -1., +1.)) {}
125 void fill(
double x_N,
double y_N,
double x_F,
double y_F) {
156 for (
const auto& rp :
m_stat) {
157 TGraph*
g =
new TGraph();
160 sprintf(
buf,
"g_mean_track_mult_run_%u", rp.first);
163 for (
const auto& lsp : rp.second) {
164 const int idx =
g->GetN();
165 const double m = (lsp.second.s1 > 0) ?
double(lsp.second.sN) / lsp.second.s1 : 0.;
166 g->SetPoint(
idx, lsp.first,
m);
174 std::map<unsigned int, ArmPlots>
armPlots;
181 x_pitch_pixels_(iConfig.getUntrackedParameter<double>(
"x_pitch_pixels", 150E-3)),
182 outputFile_(iConfig.getParameter<
std::
string>(
"outputFile")),
199 std::map<unsigned int, unsigned int> m_mult;
201 for (
const auto& trk : *
tracks) {
203 unsigned int rpDecId =
rpId.arm() * 100 +
rpId.station() * 10 +
rpId.rp();
210 pl.fill(trk.x(), trk.y(), trk.time());
212 m_mult[
rpId.arm()]++;
215 for (
unsigned int arm = 0; arm < 2; ++arm) {
218 st.sN += m_mult[arm];
227 if (rpId1.arm() != rpId2.arm())
232 const unsigned int rpDecId1 = rpId1.arm() * 100 + rpId1.station() * 10 + rpId1.rp();
233 const unsigned int rpDecId2 = rpId2.arm() * 100 + rpId2.station() * 10 + rpId2.rp();
235 if (rpDecId1 == ap.rpId_N && rpDecId2 == ap.rpId_F)
236 ap.fill(
t1.x(),
t1.y(),
t2.x(),
t2.y());
257 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
259 for (
const auto& it :
rpPlots) {
260 gDirectory = f_out->mkdir(Form(
"RP %u", it.first));
265 gDirectory = f_out->mkdir(Form(
"arm %u", it.first));