CMS 3D CMS Logo

CTPPSProtonReconstructionPlotter.cc
Go to the documentation of this file.
1 /****************************************************************************
2 * Authors:
3 * Jan Kašpar (jan.kaspar@gmail.com)
4 ****************************************************************************/
5 
6 #include <memory>
7 
16 
18 
22 
25 
26 #include "TFile.h"
27 #include "TGraphErrors.h"
28 #include "TH1D.h"
29 #include "TH2D.h"
30 #include "TProfile.h"
31 
32 //----------------------------------------------------------------------------------------------------
33 
35 public:
38 
39 private:
40  void analyze(const edm::Event &, const edm::EventSetup &) override;
41 
42  void endJob() override;
43 
48 
49  unsigned int rpId_45_N_, rpId_45_F_;
50  unsigned int rpId_56_N_, rpId_56_F_;
51 
52  struct AssociationCuts {
53  double ti_tr_min;
54  double ti_tr_max;
55 
56  void load(const edm::ParameterSet &ps) {
57  ti_tr_min = ps.getParameter<double>("ti_tr_min");
58  ti_tr_max = ps.getParameter<double>("ti_tr_max");
59  }
60  };
61 
62  std::map<unsigned int, AssociationCuts> association_cuts_;
63 
65 
66  signed int maxNonEmptyEvents_;
67 
68  static void profileToRMSGraph(TProfile *p, TGraphErrors *g) {
69  for (int bi = 1; bi <= p->GetNbinsX(); ++bi) {
70  double c = p->GetBinCenter(bi);
71 
72  double N = p->GetBinEntries(bi);
73  double Sy = p->GetBinContent(bi) * N;
74  double Syy = p->GetSumw2()->At(bi);
75 
76  double si_sq = Syy / N - Sy * Sy / N / N;
77  double si = (si_sq >= 0.) ? sqrt(si_sq) : 0.;
78  double si_unc_sq = si_sq / 2. / N; // Gaussian approximation
79  double si_unc = (si_unc_sq >= 0.) ? sqrt(si_unc_sq) : 0.;
80 
81  int idx = g->GetN();
82  g->SetPoint(idx, c, si);
83  g->SetPointError(idx, 0., si_unc);
84  }
85  }
86 
88  const CTPPSLocalTrackLite &tr,
89  const CTPPSGeometry &geometry,
90  double &x_tr,
91  double &x_ti,
92  double &de_x,
93  double &de_x_unc);
94 
95  struct SingleRPPlots {
96  std::unique_ptr<TH1D> h_multiplicity;
97  std::unique_ptr<TH1D> h_xi;
98  std::unique_ptr<TH2D> h2_th_y_vs_xi;
99  std::unique_ptr<TProfile> p_th_y_vs_xi;
100 
101  std::map<unsigned int, TH1D *> m_h_xi_nTracks;
102  std::unique_ptr<TH1D> h_xi_n1f1;
103 
104  SingleRPPlots()
105  : h_multiplicity(new TH1D("", ";reconstructed protons", 11, -0.5, 10.5)),
106  h_xi(new TH1D("", ";#xi", 100, 0., 0.3)),
107  h2_th_y_vs_xi(new TH2D("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
108  p_th_y_vs_xi(new TProfile("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3)),
109  h_xi_n1f1(new TH1D("", ";#xi", 100, 0., 0.3)) {
110  for (unsigned int n = 2; n <= 10; ++n)
111  m_h_xi_nTracks[n] = new TH1D(*h_xi);
112  }
113 
114  void fill(const reco::ForwardProton &p, unsigned int nTracks, bool n1f1) {
115  if (p.validFit()) {
116  h_xi->Fill(p.xi());
117 
118  const double th_y = p.thetaY();
119  h2_th_y_vs_xi->Fill(p.xi(), th_y);
120  p_th_y_vs_xi->Fill(p.xi(), th_y);
121 
122  auto it = m_h_xi_nTracks.find(nTracks);
123  if (it != m_h_xi_nTracks.end())
124  it->second->Fill(p.xi());
125 
126  if (n1f1)
127  h_xi_n1f1->Fill(p.xi());
128  }
129  }
130 
131  void write() const {
132  h_multiplicity->Write("h_multiplicity");
133  h_xi->Write("h_xi");
134 
135  h2_th_y_vs_xi->Write("h2_th_y_vs_xi");
136  p_th_y_vs_xi->Write("p_th_y_vs_xi");
137 
138  TDirectory *d_top = gDirectory;
139 
140  gDirectory = d_top->mkdir("h_xi_nTracks");
141  for (const auto p : m_h_xi_nTracks) {
142  char buf[100];
143  sprintf(buf, "h_xi_nTracks_%u", p.first);
144  p.second->Write(buf);
145  }
146 
147  gDirectory = d_top;
148 
149  h_xi_n1f1->Write("h_xi_n1f1");
150  }
151  };
152 
153  std::map<unsigned int, SingleRPPlots> singleRPPlots_;
154 
155  struct MultiRPPlots {
156  std::unique_ptr<TH1D> h_multiplicity;
158  std::unique_ptr<TH1D> h_t_xi_range1, h_t_xi_range2, h_t_xi_range3;
159  std::unique_ptr<TH1D> h_time, h_time_unc;
160  std::unique_ptr<TProfile> p_time_unc_vs_x_ClCo, p_time_unc_vs_xi;
163  std::unique_ptr<TProfile> p_th_x_vs_xi, p_th_y_vs_xi, p_vtx_y_vs_xi;
164 
165  std::unique_ptr<TH2D> h2_timing_tracks_vs_prot_mult;
166 
167  std::map<unsigned int, TH1D *> m_h_xi_nTracks;
168  std::unique_ptr<TH1D> h_xi_n1f1;
169 
170  std::unique_ptr<TH2D> h2_x_timing_vs_x_tracking_ClCo;
171 
175 
177 
178  MultiRPPlots()
179  : h_multiplicity(new TH1D("", ";reconstructed protons per event", 11, -0.5, 10.5)),
180  h_xi(new TH1D("", ";#xi", 100, 0., 0.3)),
181  h_th_x(new TH1D("", ";#theta_{x} (rad)", 250, -500E-6, +500E-6)),
182  h_th_y(new TH1D("", ";#theta_{y} (rad)", 500, -1000E-6, +1000E-6)),
183  h_vtx_y(new TH1D("", ";vtx_{y} (cm)", 100, -100E-3, +100E-3)),
184  h_chi_sq(new TH1D("", ";#chi^{2}", 100, 0., 10.)),
185  h_log_chi_sq(new TH1D("", ";log_{10} #chi^{2}", 100, -20., 5.)),
186  h_chi_sq_norm(new TH1D("", ";#chi^{2}/ndf", 100, 0., 5.)),
187  h_time(new TH1D("", ";time (ns)", 100, -2., +2.)),
188  h_time_unc(new TH1D("", ";time unc (ns)", 100, -1., +1.)),
189  p_time_unc_vs_x_ClCo(new TProfile("", ";x_tracking (mm);time unc (ns)", 100, 0., 30.)),
190  p_time_unc_vs_xi(new TProfile("", ";xi;time unc (ns)", 100, 0., 0.3)),
191  h_n_contrib_tracking_tracks(new TH1D("", ";n of contrib. tracking tracks per reco proton", 4, -0.5, +3.5)),
192  h_n_contrib_timing_tracks(new TH1D("", ";n of contrib. timing tracks per reco proton", 4, -0.5, +3.5)),
193  h2_th_x_vs_xi(new TH2D("", ";#xi;#theta_{x} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
194  h2_th_y_vs_xi(new TH2D("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
195  h2_vtx_y_vs_xi(new TH2D("", ";#xi;vtx_{y} (cm)", 100, 0., 0.3, 100, -100E-3, +100E-3)),
196  p_th_x_vs_xi(new TProfile("", ";#xi;#theta_{x} (rad)", 100, 0., 0.3)),
197  p_th_y_vs_xi(new TProfile("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3)),
198  p_vtx_y_vs_xi(new TProfile("", ";#xi;vtx_{y} (cm)", 100, 0., 0.3)),
200  new TH2D("", ";reco protons per event;timing tracks per event", 11, -0.5, 10.5, 11, -0.5, 10.5)),
201  h_xi_n1f1(new TH1D("", ";#xi", 100, 0., 0.3)),
202 
204  new TH2D("", ";x_tracking (mm);x_timing (mm)", 100, 0., 20., 100, 0., 20.)),
205  h_de_x_timing_vs_tracking(new TH1D("", ";#Delta x (mm)", 200, -1., +1.)),
206  h_de_x_rel_timing_vs_tracking(new TH1D("", ";#Delta x / #sigma(x)", 200, -20., +20.)),
207  h_de_x_match_timing_vs_tracking(new TH1D("", ";match between tracking and timing tracks", 2, -0.5, +1.5)),
208  h_de_x_timing_vs_tracking_ClCo(new TH1D("", ";#Delta x (mm)", 200, -1., +1.)),
209  h_de_x_rel_timing_vs_tracking_ClCo(new TH1D("", ";#Delta x / #sigma(x)", 200, -20., +20.)),
211  new TH1D("", ";match between tracking and timing tracks", 2, -0.5, +1.5)),
212 
213  h2_y_vs_x_tt0_ClCo(new TH2D("", ";x (mm);y (mm)", 100, -5., 25., 100, -15., +15.)),
214  h2_y_vs_x_tt1_ClCo(new TH2D("", ";x (mm);y (mm)", 100, -5., 25., 100, -15., +15.)),
215  h2_y_vs_x_ttm_ClCo(new TH2D("", ";x (mm);y (mm)", 100, -5., 25., 100, -15., +15.)) {
216  std::vector<double> v_t_bin_edges;
217  for (double t = 0; t <= 5.;) {
218  v_t_bin_edges.push_back(t);
219  const double de_t = 0.05 + 0.09 * t + 0.02 * t * t;
220  t += de_t;
221  }
222  h_t_unif = std::make_unique<TH1D>("", ";|t| (GeV^2)", 100, 0., 5.);
223  h_t = std::make_unique<TH1D>("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data());
224  h_t_xi_range1 = std::make_unique<TH1D>("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data());
225  h_t_xi_range2 = std::make_unique<TH1D>("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data());
226  h_t_xi_range3 = std::make_unique<TH1D>("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data());
227  h2_t_vs_xi = std::make_unique<TH2D>(
228  "", ";#xi;|t| (GeV^2)", 100, 0., 0.3, v_t_bin_edges.size() - 1, v_t_bin_edges.data());
229 
230  for (unsigned int n = 2; n <= 10; ++n)
231  m_h_xi_nTracks[n] = new TH1D(*h_xi);
232  }
233 
234  void fill(const reco::ForwardProton &p, unsigned int nTracks, bool n1f1) {
235  if (!p.validFit())
236  return;
237 
238  unsigned int n_contrib_tracking_tracks = 0, n_contrib_timing_tracks = 0;
239  for (const auto &tr : p.contributingLocalTracks()) {
240  CTPPSDetId detId(tr->rpId());
241  if (detId.subdetId() == CTPPSDetId::sdTrackingStrip || detId.subdetId() == CTPPSDetId::sdTrackingPixel)
242  n_contrib_tracking_tracks++;
243  if (detId.subdetId() == CTPPSDetId::sdTimingDiamond || detId.subdetId() == CTPPSDetId::sdTimingFastSilicon)
244  n_contrib_timing_tracks++;
245  }
246 
247  const double th_x = p.thetaX();
248  const double th_y = p.thetaY();
249  const double mt = -p.t();
250 
251  h_chi_sq->Fill(p.chi2());
252  h_log_chi_sq->Fill(log10(p.chi2()));
253  if (p.ndof() > 0)
254  h_chi_sq_norm->Fill(p.normalizedChi2());
255 
256  h_n_contrib_tracking_tracks->Fill(n_contrib_tracking_tracks);
257  h_n_contrib_timing_tracks->Fill(n_contrib_timing_tracks);
258 
259  h_xi->Fill(p.xi());
260 
261  h_th_x->Fill(th_x);
262  h_th_y->Fill(th_y);
263 
264  h_vtx_y->Fill(p.vertex().y());
265 
266  h_t_unif->Fill(mt);
267  h_t->Fill(mt);
268  if (p.xi() > 0.04 && p.xi() < 0.07)
269  h_t_xi_range1->Fill(mt);
270  if (p.xi() > 0.07 && p.xi() < 0.10)
271  h_t_xi_range2->Fill(mt);
272  if (p.xi() > 0.10 && p.xi() < 0.13)
273  h_t_xi_range3->Fill(mt);
274 
275  if (p.timeError() > 0.) {
276  h_time->Fill(p.time());
277  h_time_unc->Fill(p.timeError());
278  //p_time_unc_vs_x_ClCo filled in ClCo code below
279  p_time_unc_vs_xi->Fill(p.xi(), p.timeError());
280  }
281 
282  h2_th_x_vs_xi->Fill(p.xi(), th_x);
283  h2_th_y_vs_xi->Fill(p.xi(), th_y);
284  h2_vtx_y_vs_xi->Fill(p.xi(), p.vertex().y());
285  h2_t_vs_xi->Fill(p.xi(), mt);
286 
287  p_th_x_vs_xi->Fill(p.xi(), th_x);
288  p_th_y_vs_xi->Fill(p.xi(), th_y);
289  p_vtx_y_vs_xi->Fill(p.xi(), p.vertex().y());
290 
291  auto it = m_h_xi_nTracks.find(nTracks);
292  if (it != m_h_xi_nTracks.end())
293  it->second->Fill(p.xi());
294 
295  if (n1f1)
296  h_xi_n1f1->Fill(p.xi());
297  }
298 
299  void write() const {
300  h_multiplicity->Write("h_multiplicity");
301 
302  h_chi_sq->Write("h_chi_sq");
303  h_log_chi_sq->Write("h_log_chi_sq");
304  h_chi_sq_norm->Write("h_chi_sq_norm");
305 
306  h_n_contrib_tracking_tracks->Write("h_n_contrib_tracking_tracks");
307  h_n_contrib_timing_tracks->Write("h_n_contrib_timing_tracks");
308 
309  h2_timing_tracks_vs_prot_mult->Write("h2_timing_tracks_vs_prot_mult");
310 
311  h_xi->Write("h_xi");
312 
313  h_th_x->Write("h_th_x");
314  h2_th_x_vs_xi->Write("h2_th_x_vs_xi");
315  p_th_x_vs_xi->Write("p_th_x_vs_xi");
316  auto g_th_x_RMS_vs_xi = std::make_unique<TGraphErrors>();
317  profileToRMSGraph(p_th_x_vs_xi.get(), g_th_x_RMS_vs_xi.get());
318  g_th_x_RMS_vs_xi->Write("g_th_x_RMS_vs_xi");
319 
320  h_th_y->Write("h_th_y");
321  h2_th_y_vs_xi->Write("h2_th_y_vs_xi");
322  p_th_y_vs_xi->Write("p_th_y_vs_xi");
323  auto g_th_y_RMS_vs_xi = std::make_unique<TGraphErrors>();
324  profileToRMSGraph(p_th_y_vs_xi.get(), g_th_y_RMS_vs_xi.get());
325  g_th_y_RMS_vs_xi->Write("g_th_y_RMS_vs_xi");
326 
327  h_vtx_y->Write("h_vtx_y");
328  h2_vtx_y_vs_xi->Write("h2_vtx_y_vs_xi");
329  p_vtx_y_vs_xi->Write("p_vtx_y_vs_xi");
330  auto g_vtx_y_RMS_vs_xi = std::make_unique<TGraphErrors>();
331  profileToRMSGraph(p_vtx_y_vs_xi.get(), g_vtx_y_RMS_vs_xi.get());
332  g_vtx_y_RMS_vs_xi->Write("g_vtx_y_RMS_vs_xi");
333 
334  h_t->Scale(1., "width");
335 
336  h_t_unif->Write("h_t_unif");
337  h_t->Write("h_t");
338  h_t_xi_range1->Write("h_t_xi_range1");
339  h_t_xi_range2->Write("h_t_xi_range2");
340  h_t_xi_range3->Write("h_t_xi_range3");
341 
342  h2_t_vs_xi->Write("h2_t_vs_xi");
343 
344  h_time->Write("h_time");
345  h_time_unc->Write("h_time_unc");
346  p_time_unc_vs_x_ClCo->Write("p_time_unc_vs_x_ClCo");
347  p_time_unc_vs_xi->Write("p_time_unc_vs_xi");
348 
349  TDirectory *d_top = gDirectory;
350 
351  gDirectory = d_top->mkdir("h_xi_nTracks");
352  for (const auto p : m_h_xi_nTracks) {
353  char buf[100];
354  sprintf(buf, "h_xi_nTracks_%u", p.first);
355  p.second->Write(buf);
356  }
357 
358  gDirectory = d_top;
359 
360  h_xi_n1f1->Write("h_xi_n1f1");
361 
362  h2_x_timing_vs_x_tracking_ClCo->Write("h2_x_timing_vs_x_tracking_ClCo");
363 
364  h_de_x_timing_vs_tracking->Write("h_de_x_timing_vs_tracking");
365  h_de_x_rel_timing_vs_tracking->Write("h_de_x_rel_timing_vs_tracking");
366  h_de_x_match_timing_vs_tracking->Write("h_de_x_match_timing_vs_tracking");
367 
368  h_de_x_timing_vs_tracking_ClCo->Write("h_de_x_timing_vs_tracking_ClCo");
369  h_de_x_rel_timing_vs_tracking_ClCo->Write("h_de_x_rel_timing_vs_tracking_ClCo");
370  h_de_x_match_timing_vs_tracking_ClCo->Write("h_de_x_match_timing_vs_tracking_ClCo");
371 
372  h2_y_vs_x_tt0_ClCo->Write("h2_y_vs_x_tt0_ClCo");
373  h2_y_vs_x_tt1_ClCo->Write("h2_y_vs_x_tt1_ClCo");
374  h2_y_vs_x_ttm_ClCo->Write("h2_y_vs_x_ttm_ClCo");
375  }
376  };
377 
378  std::map<unsigned int, MultiRPPlots> multiRPPlots_;
379 
381  std::unique_ptr<TH2D> h2_xi_mu_vs_xi_si;
382  std::unique_ptr<TH1D> h_xi_diff_mu_si, h_xi_diff_si_mu;
383 
384  std::unique_ptr<TH2D> h2_xi_diff_si_mu_vs_xi_mu;
385  std::unique_ptr<TProfile> p_xi_diff_si_mu_vs_xi_mu;
386 
387  std::unique_ptr<TH2D> h2_th_y_mu_vs_th_y_si;
388 
390  : h2_xi_mu_vs_xi_si(new TH2D("", ";#xi_{single};#xi_{multi}", 100, 0., 0.3, 100, 0., 0.3)),
391  h_xi_diff_mu_si(new TH1D("", ";#xi_{multi} - #xi_{single}", 100, -0.1, +0.1)),
392  h_xi_diff_si_mu(new TH1D("", ";#xi_{single} - #xi_{multi}", 100, -0.1, +0.1)),
394  new TH2D("", ";#xi_{multi};#xi_{single} - #xi_{multi}", 100, 0., 0.3, 100, -0.10, 0.10)),
395  p_xi_diff_si_mu_vs_xi_mu(new TProfile("", ";#xi_{multi};#xi_{single} - #xi_{multi}", 100, 0., 0.3)),
397  new TH2D("", ";#theta^{*}_{y,si};#theta^{*}_{y,mu}", 100, -500E-6, +500E-6, 100, -500E-6, +500E-6)) {}
398 
399  void fill(const reco::ForwardProton &p_single, const reco::ForwardProton &p_multi) {
400  if (p_single.validFit() && p_multi.validFit()) {
401  h2_xi_mu_vs_xi_si->Fill(p_single.xi(), p_multi.xi());
402  h_xi_diff_mu_si->Fill(p_multi.xi() - p_single.xi());
403  h_xi_diff_si_mu->Fill(p_single.xi() - p_multi.xi());
404 
405  h2_xi_diff_si_mu_vs_xi_mu->Fill(p_multi.xi(), p_single.xi() - p_multi.xi());
406  p_xi_diff_si_mu_vs_xi_mu->Fill(p_multi.xi(), p_single.xi() - p_multi.xi());
407 
408  const double th_y_si = p_single.thetaY();
409  const double th_y_mu = p_multi.thetaY();
410 
411  h2_th_y_mu_vs_th_y_si->Fill(th_y_si, th_y_mu);
412  }
413  }
414 
415  void write() const {
416  h2_xi_mu_vs_xi_si->Write("h2_xi_mu_vs_xi_si");
417  h_xi_diff_mu_si->Write("h_xi_diff_mu_si");
418  h_xi_diff_si_mu->Write("h_xi_diff_si_mu");
419 
420  h2_xi_diff_si_mu_vs_xi_mu->Write("h2_xi_diff_si_mu_vs_xi_mu");
421  p_xi_diff_si_mu_vs_xi_mu->Write("p_xi_diff_si_mu_vs_xi_mu");
422 
423  h2_th_y_mu_vs_th_y_si->Write("h2_th_y_mu_vs_th_y_si");
424  }
425  };
426 
427  std::map<unsigned int, SingleMultiCorrelationPlots> singleMultiCorrelationPlots_;
428 
429  struct ArmCorrelationPlots {
430  std::unique_ptr<TH1D> h_xi_si_diffNF;
431  std::unique_ptr<TH2D> h2_xi_si_diffNF_vs_xi_mu;
432  std::unique_ptr<TProfile> p_xi_si_diffNF_vs_xi_mu;
433 
434  std::unique_ptr<TH1D> h_th_y_si_diffNF;
435  std::unique_ptr<TProfile> p_th_y_si_diffNF_vs_xi_mu;
436 
438  : h_xi_si_diffNF(new TH1D("", ";#xi_{sF} - #xi_{sN}", 100, -0.02, +0.02)),
439  h2_xi_si_diffNF_vs_xi_mu(new TH2D("", ";#xi_{m};#xi_{sF} - #xi_{sN}", 100, 0., 0.3, 100, -0.02, +0.02)),
440  p_xi_si_diffNF_vs_xi_mu(new TProfile("", ";#xi_{m};#xi_{sF} - #xi_{sN}", 100, 0., 0.3)),
441  h_th_y_si_diffNF(new TH1D("", ";#theta_{y,sF} - #theta_{y,sN}", 100, -100E-6, +100E-6)),
442  p_th_y_si_diffNF_vs_xi_mu(new TProfile("", ";#xi_{m};#theta_{y,sF} - #theta_{y,sN}", 100, 0., 0.3)) {}
443 
444  void fill(const reco::ForwardProton &p_s_N, const reco::ForwardProton &p_s_F, const reco::ForwardProton &p_m) {
445  if (!p_s_N.validFit() || !p_s_F.validFit() || !p_m.validFit())
446  return;
447 
448  const double th_y_s_N = p_s_N.thetaY();
449  const double th_y_s_F = p_s_F.thetaY();
450 
451  h_xi_si_diffNF->Fill(p_s_F.xi() - p_s_N.xi());
452  h2_xi_si_diffNF_vs_xi_mu->Fill(p_m.xi(), p_s_F.xi() - p_s_N.xi());
453  p_xi_si_diffNF_vs_xi_mu->Fill(p_m.xi(), p_s_F.xi() - p_s_N.xi());
454 
455  h_th_y_si_diffNF->Fill(th_y_s_F - th_y_s_N);
456  p_th_y_si_diffNF_vs_xi_mu->Fill(p_m.xi(), th_y_s_F - th_y_s_N);
457  }
458 
459  void write() const {
460  h_xi_si_diffNF->Write("h_xi_si_diffNF");
461  h2_xi_si_diffNF_vs_xi_mu->Write("h2_xi_si_diffNF_vs_xi_mu");
462  p_xi_si_diffNF_vs_xi_mu->Write("p_xi_si_diffNF_vs_xi_mu");
463 
464  h_th_y_si_diffNF->Write("h_th_y_si_diffNF");
465  p_th_y_si_diffNF_vs_xi_mu->Write("p_th_y_si_diffNF_vs_xi_mu");
466  }
467  };
468 
469  std::map<unsigned int, ArmCorrelationPlots> armCorrelationPlots_;
470 
471  std::unique_ptr<TProfile> p_x_L_diffNF_vs_x_L_N_, p_x_R_diffNF_vs_x_R_N_;
472  std::unique_ptr<TProfile> p_y_L_diffNF_vs_y_L_N_, p_y_R_diffNF_vs_y_R_N_;
473 
474  signed int n_non_empty_events_;
475 };
476 
477 //----------------------------------------------------------------------------------------------------
478 
479 using namespace std;
480 using namespace edm;
481 
482 //----------------------------------------------------------------------------------------------------
483 
485  : tokenTracks_(consumes<CTPPSLocalTrackLiteCollection>(ps.getParameter<edm::InputTag>("tagTracks"))),
486  tokenRecoProtonsSingleRP_(
487  consumes<reco::ForwardProtonCollection>(ps.getParameter<InputTag>("tagRecoProtonsSingleRP"))),
488  tokenRecoProtonsMultiRP_(
489  consumes<reco::ForwardProtonCollection>(ps.getParameter<InputTag>("tagRecoProtonsMultiRP"))),
490  geometryESToken_(esConsumes()),
491 
492  rpId_45_N_(ps.getParameter<unsigned int>("rpId_45_N")),
493  rpId_45_F_(ps.getParameter<unsigned int>("rpId_45_F")),
494  rpId_56_N_(ps.getParameter<unsigned int>("rpId_56_N")),
495  rpId_56_F_(ps.getParameter<unsigned int>("rpId_56_F")),
496 
497  outputFile_(ps.getParameter<string>("outputFile")),
498  maxNonEmptyEvents_(ps.getUntrackedParameter<signed int>("maxNonEmptyEvents", -1)),
499 
500  p_x_L_diffNF_vs_x_L_N_(new TProfile("p_x_L_diffNF_vs_x_L_N", ";x_{LN};x_{LF} - x_{LN}", 100, 0., +20.)),
501  p_x_R_diffNF_vs_x_R_N_(new TProfile("p_x_R_diffNF_vs_x_R_N", ";x_{RN};x_{RF} - x_{RN}", 100, 0., +20.)),
502 
503  p_y_L_diffNF_vs_y_L_N_(new TProfile("p_y_L_diffNF_vs_y_L_N", ";y_{LN};y_{LF} - y_{LN}", 100, -20., +20.)),
504  p_y_R_diffNF_vs_y_R_N_(new TProfile("p_y_R_diffNF_vs_y_R_N", ";y_{RN};y_{RF} - y_{RN}", 100, -20., +20.)),
505 
506  n_non_empty_events_(0) {
507  for (const std::string &sector : {"45", "56"}) {
508  const unsigned int arm = (sector == "45") ? 0 : 1;
509  association_cuts_[arm].load(ps.getParameterSet("association_cuts_" + sector));
510  }
511 }
512 
513 //----------------------------------------------------------------------------------------------------
514 
516  const CTPPSLocalTrackLite &tr_ti,
517  const CTPPSGeometry &geometry,
518  double &x_tr,
519  double &x_ti,
520  double &de_x,
521  double &de_x_unc) {
522  // identify tracking-RP tracks
523  const auto &tr_i = *proton.contributingLocalTracks().at(0);
524  const auto &tr_j = *proton.contributingLocalTracks().at(1);
525 
526  const double z_i = geometry.rpTranslation(tr_i.rpId()).z();
527  const double z_j = geometry.rpTranslation(tr_j.rpId()).z();
528 
529  // interpolation from tracking RPs
530  const double z_ti = -geometry.rpTranslation(tr_ti.rpId()).z(); // the minus sign fixes a bug in the diamond geometry
531  const double f_i = (z_ti - z_j) / (z_i - z_j), f_j = (z_i - z_ti) / (z_i - z_j);
532  const double x_inter = f_i * tr_i.x() + f_j * tr_j.x();
533  const double x_inter_unc_sq = f_i * f_i * tr_i.xUnc() * tr_i.xUnc() + f_j * f_j * tr_j.xUnc() * tr_j.xUnc();
534 
535  // save distance
536  x_tr = x_inter;
537  x_ti = tr_ti.x();
538 
539  de_x = tr_ti.x() - x_inter;
540  de_x_unc = sqrt(tr_ti.xUnc() * tr_ti.xUnc() + x_inter_unc_sq);
541 }
542 
543 //----------------------------------------------------------------------------------------------------
544 
546  // get input
548  event.getByToken(tokenTracks_, hTracks);
549 
550  Handle<reco::ForwardProtonCollection> hRecoProtonsSingleRP;
551  event.getByToken(tokenRecoProtonsSingleRP_, hRecoProtonsSingleRP);
552 
553  Handle<reco::ForwardProtonCollection> hRecoProtonsMultiRP;
554  event.getByToken(tokenRecoProtonsMultiRP_, hRecoProtonsMultiRP);
555 
556  if (!hRecoProtonsSingleRP->empty())
558 
560  throw cms::Exception("CTPPSProtonReconstructionPlotter") << "Number of non empty events reached maximum.";
561 
562  // get conditions
563  const auto &geometry = iSetup.getData(geometryESToken_);
564 
565  // track plots
566  const CTPPSLocalTrackLite *tr_L_N = nullptr;
567  const CTPPSLocalTrackLite *tr_L_F = nullptr;
568  const CTPPSLocalTrackLite *tr_R_N = nullptr;
569  const CTPPSLocalTrackLite *tr_R_F = nullptr;
570  std::map<unsigned int, unsigned int> armTrackCounter, armTimingTrackCounter;
571  std::map<unsigned int, unsigned int> armTrackCounter_N, armTrackCounter_F;
572 
573  for (const auto &tr : *hTracks) {
574  CTPPSDetId rpId(tr.rpId());
575  unsigned int decRPId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
576 
577  if (decRPId == rpId_45_N_) {
578  tr_L_N = &tr;
579  armTrackCounter_N[0]++;
580  }
581  if (decRPId == rpId_45_F_) {
582  tr_L_F = &tr;
583  armTrackCounter_F[0]++;
584  }
585  if (decRPId == rpId_56_N_) {
586  tr_R_N = &tr;
587  armTrackCounter_N[1]++;
588  }
589  if (decRPId == rpId_56_F_) {
590  tr_R_F = &tr;
591  armTrackCounter_F[1]++;
592  }
593 
594  armTrackCounter[rpId.arm()]++;
595 
596  const bool trackerRP =
597  (rpId.subdetId() == CTPPSDetId::sdTrackingStrip || rpId.subdetId() == CTPPSDetId::sdTrackingPixel);
598  if (!trackerRP)
599  armTimingTrackCounter[rpId.arm()]++;
600  }
601 
602  if (tr_L_N && tr_L_F) {
603  p_x_L_diffNF_vs_x_L_N_->Fill(tr_L_N->x(), tr_L_F->x() - tr_L_N->x());
604  p_y_L_diffNF_vs_y_L_N_->Fill(tr_L_N->y(), tr_L_F->y() - tr_L_N->y());
605  }
606 
607  if (tr_R_N && tr_R_F) {
608  p_x_R_diffNF_vs_x_R_N_->Fill(tr_R_N->x(), tr_R_F->x() - tr_R_N->x());
609  p_y_R_diffNF_vs_y_R_N_->Fill(tr_R_N->y(), tr_R_F->y() - tr_R_N->y());
610  }
611 
612  // initialise multiplicity counters
613  std::map<unsigned int, unsigned int> singleRPMultiplicity, multiRPMultiplicity;
614  singleRPMultiplicity[rpId_45_N_] = singleRPMultiplicity[rpId_45_F_] = singleRPMultiplicity[rpId_56_N_] =
615  singleRPMultiplicity[rpId_56_F_] = 0;
616  multiRPMultiplicity[0] = multiRPMultiplicity[1] = 0;
617 
618  // make single-RP-reco plots
619  for (const auto &proton : *hRecoProtonsSingleRP) {
620  CTPPSDetId rpId((*proton.contributingLocalTracks().begin())->rpId());
621  unsigned int decRPId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
622 
623  const bool n1f1 = (armTrackCounter_N[rpId.arm()] == 1 && armTrackCounter_F[rpId.arm()] == 1);
624 
625  singleRPPlots_[decRPId].fill(proton, armTrackCounter[rpId.arm()], n1f1);
626 
627  if (proton.validFit())
628  singleRPMultiplicity[decRPId]++;
629  }
630 
631  for (const auto it : singleRPMultiplicity)
632  singleRPPlots_[it.first].h_multiplicity->Fill(it.second);
633 
634  // make multi-RP-reco plots
635  for (const auto &proton : *hRecoProtonsMultiRP) {
636  CTPPSDetId rpId((*proton.contributingLocalTracks().begin())->rpId());
637  unsigned int armId = rpId.arm();
638 
639  const bool n1f1 = (armTrackCounter_N[armId] == 1 && armTrackCounter_F[armId] == 1);
640 
641  multiRPPlots_[armId].fill(proton, armTrackCounter[armId], n1f1);
642 
643  if (proton.validFit())
644  multiRPMultiplicity[armId]++;
645  }
646 
647  for (const auto it : multiRPMultiplicity) {
648  const auto &pl = multiRPPlots_[it.first];
649  pl.h_multiplicity->Fill(it.second);
650  pl.h2_timing_tracks_vs_prot_mult->Fill(it.second, armTimingTrackCounter[it.first]);
651  }
652 
653  // define "clean condition" for each arm
654  map<unsigned int, bool> clCo;
655  clCo[0] = (singleRPMultiplicity[rpId_45_N_] && singleRPMultiplicity[rpId_45_F_] && multiRPMultiplicity[0] == 1);
656  clCo[1] = (singleRPMultiplicity[rpId_56_N_] && singleRPMultiplicity[rpId_56_F_] && multiRPMultiplicity[1] == 1);
657 
658  // plot distances between multi-RP protons and timing tracks in the same arm
659  for (const auto &proton : *hRecoProtonsMultiRP) {
660  if (!proton.validFit())
661  continue;
662 
663  CTPPSDetId rpId_proton((*proton.contributingLocalTracks().begin())->rpId());
664  unsigned int armId = rpId_proton.arm();
665  const auto &pl = multiRPPlots_[armId];
666 
667  for (const auto &tr : *hTracks) {
668  CTPPSDetId rpId_tr(tr.rpId());
669  if (rpId_tr.arm() != armId)
670  continue;
671 
672  const bool trackerRP =
673  (rpId_tr.subdetId() == CTPPSDetId::sdTrackingStrip || rpId_tr.subdetId() == CTPPSDetId::sdTrackingPixel);
674  if (trackerRP)
675  continue;
676 
677  double x_tr = -1., x_ti = -1.;
678  double de_x = 0., de_x_unc = 0.;
679  CalculateTimingTrackingDistance(proton, tr, geometry, x_tr, x_ti, de_x, de_x_unc);
680 
681  const double rd = (de_x_unc > 0.) ? de_x / de_x_unc : -1E10;
682  const auto &ac = association_cuts_[armId];
683  const bool match = (ac.ti_tr_min <= fabs(rd) && fabs(rd) <= ac.ti_tr_max);
684 
685  pl.h_de_x_timing_vs_tracking->Fill(de_x);
686  pl.h_de_x_rel_timing_vs_tracking->Fill(rd);
687  pl.h_de_x_match_timing_vs_tracking->Fill(match ? 1. : 0.);
688 
689  if (clCo[armId] && armTimingTrackCounter[armId] == 1) {
690  pl.h2_x_timing_vs_x_tracking_ClCo->Fill(x_tr, x_ti);
691 
692  pl.h_de_x_timing_vs_tracking_ClCo->Fill(de_x);
693  pl.h_de_x_rel_timing_vs_tracking_ClCo->Fill(rd);
694  pl.h_de_x_match_timing_vs_tracking_ClCo->Fill(match ? 1. : 0.);
695 
696  pl.p_time_unc_vs_x_ClCo->Fill(x_tr, proton.timeError());
697  }
698  }
699  }
700 
701  // plot xy maps
702  for (const auto &proton : *hRecoProtonsMultiRP) {
703  if (!proton.validFit())
704  continue;
705 
706  CTPPSDetId rpId((*proton.contributingLocalTracks().begin())->rpId());
707  unsigned int armId = rpId.arm();
708  const auto &pl = multiRPPlots_[armId];
709  const auto &nTimingTracks = armTimingTrackCounter[armId];
710 
711  if (!clCo[armId])
712  continue;
713 
714  double x_ref = 0., y_ref = 0.;
715  if (armId == 0) {
716  x_ref = tr_L_N->x();
717  y_ref = tr_L_N->y();
718  }
719  if (armId == 1) {
720  x_ref = tr_R_N->x();
721  y_ref = tr_R_N->y();
722  }
723 
724  if (nTimingTracks == 0)
725  pl.h2_y_vs_x_tt0_ClCo->Fill(x_ref, y_ref);
726  if (nTimingTracks == 1)
727  pl.h2_y_vs_x_tt1_ClCo->Fill(x_ref, y_ref);
728  if (nTimingTracks > 1)
729  pl.h2_y_vs_x_ttm_ClCo->Fill(x_ref, y_ref);
730  }
731 
732  // make correlation plots
733  for (const auto &proton_m : *hRecoProtonsMultiRP) {
734  CTPPSDetId rpId_m((*proton_m.contributingLocalTracks().begin())->rpId());
735  unsigned int arm = rpId_m.arm();
736 
737  const reco::ForwardProton *p_s_N = nullptr, *p_s_F = nullptr;
738 
739  for (const auto &proton_s : *hRecoProtonsSingleRP) {
740  // skip if source of single-RP reco not included in multi-RP reco
741  const auto key_s = proton_s.contributingLocalTracks()[0].key();
742  bool compatible = false;
743  for (const auto &tr_m : proton_m.contributingLocalTracks()) {
744  if (tr_m.key() == key_s) {
745  compatible = true;
746  break;
747  }
748  }
749 
750  if (!compatible)
751  continue;
752 
753  // fill single-multi plots
754  CTPPSDetId rpId_s((*proton_s.contributingLocalTracks().begin())->rpId());
755  const unsigned int idx = rpId_s.arm() * 1000 + rpId_s.station() * 100 + rpId_s.rp() * 10 + rpId_s.arm();
756  singleMultiCorrelationPlots_[idx].fill(proton_s, proton_m);
757 
758  // select protons for arm-correlation plots
759  const unsigned int rpDecId_s = rpId_s.arm() * 100 + rpId_s.station() * 10 + rpId_s.rp();
760  if (rpDecId_s == rpId_45_N_ || rpDecId_s == rpId_56_N_)
761  p_s_N = &proton_s;
762  if (rpDecId_s == rpId_45_F_ || rpDecId_s == rpId_56_F_)
763  p_s_F = &proton_s;
764  }
765 
766  // fill arm-correlation plots
767  if (p_s_N && p_s_F)
768  armCorrelationPlots_[arm].fill(*p_s_N, *p_s_F, proton_m);
769  }
770 }
771 
772 //----------------------------------------------------------------------------------------------------
773 
775  LogInfo("CTPPSProtonReconstructionPlotter") << "n_non_empty_events = " << n_non_empty_events_;
776 
777  auto f_out = std::make_unique<TFile>(outputFile_.c_str(), "recreate");
778 
779  p_x_L_diffNF_vs_x_L_N_->Write();
780  p_x_R_diffNF_vs_x_R_N_->Write();
781 
782  p_y_L_diffNF_vs_y_L_N_->Write();
783  p_y_R_diffNF_vs_y_R_N_->Write();
784 
785  TDirectory *d_singleRPPlots = f_out->mkdir("singleRPPlots");
786  for (const auto &it : singleRPPlots_) {
787  gDirectory = d_singleRPPlots->mkdir(Form("rp%u", it.first));
788  it.second.write();
789  }
790 
791  TDirectory *d_multiRPPlots = f_out->mkdir("multiRPPlots");
792  for (const auto &it : multiRPPlots_) {
793  gDirectory = d_multiRPPlots->mkdir(Form("arm%u", it.first));
794  it.second.write();
795  }
796 
797  TDirectory *d_singleMultiCorrelationPlots = f_out->mkdir("singleMultiCorrelationPlots");
798  for (const auto &it : singleMultiCorrelationPlots_) {
799  unsigned int si_rp = it.first / 10;
800  unsigned int mu_arm = it.first % 10;
801 
802  gDirectory = d_singleMultiCorrelationPlots->mkdir(Form("si_rp%u_mu_arm%u", si_rp, mu_arm));
803  it.second.write();
804  }
805 
806  TDirectory *d_armCorrelationPlots = f_out->mkdir("armCorrelationPlots");
807  for (const auto &it : armCorrelationPlots_) {
808  gDirectory = d_armCorrelationPlots->mkdir(Form("arm%u", it.first));
809  it.second.write();
810  }
811 }
812 
813 //----------------------------------------------------------------------------------------------------
814 
CTPPSLocalTrackLite
Local (=single RP) track with essential information only.
Definition: CTPPSLocalTrackLite.h:18
CTPPSProtonReconstructionPlotter::armCorrelationPlots_
std::map< unsigned int, ArmCorrelationPlots > armCorrelationPlots_
Definition: CTPPSProtonReconstructionPlotter.cc:470
CTPPSLocalTrackLiteCollection
std::vector< CTPPSLocalTrackLite > CTPPSLocalTrackLiteCollection
Collection of CTPPSLocalTrackLite objects.
Definition: CTPPSLocalTrackLiteFwd.h:18
EDAnalyzer.h
CTPPSLocalTrackLite::rpId
uint32_t rpId() const
returns the RP id
Definition: CTPPSLocalTrackLite.h:71
CTPPSLocalTrackLite::xUnc
float xUnc() const
returns the horizontal track position uncertainty
Definition: CTPPSLocalTrackLite.h:77
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_xi_range2
std::unique_ptr< TH1D > h_t_xi_range2
Definition: CTPPSProtonReconstructionPlotter.cc:159
CTPPSGeometry
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:29
CTPPSProtonReconstructionPlotter::SingleRPPlots::h2_th_y_vs_xi
std::unique_ptr< TH2D > h2_th_y_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:99
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_xi_range1
std::unique_ptr< TH1D > h_t_xi_range1
Definition: CTPPSProtonReconstructionPlotter.cc:159
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots
Definition: CTPPSProtonReconstructionPlotter.cc:381
ESHandle.h
edm::EDGetTokenT< CTPPSLocalTrackLiteCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_time
std::unique_ptr< TH1D > h_time
Definition: CTPPSProtonReconstructionPlotter.cc:160
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_multiplicity
std::unique_ptr< TH1D > h_multiplicity
Definition: CTPPSProtonReconstructionPlotter.cc:157
reco::ForwardProton::thetaY
float thetaY() const
horizontal scattering angle, in rad
Definition: ForwardProton.h:88
geometry
Definition: geometry.py:1
CTPPSProtonReconstructionPlotter::SingleRPPlots::h_xi
std::unique_ptr< TH1D > h_xi
Definition: CTPPSProtonReconstructionPlotter.cc:98
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_y_vs_x_tt1_ClCo
std::unique_ptr< TH2D > h2_y_vs_x_tt1_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:177
CTPPSProtonReconstructionPlotter::MultiRPPlots::write
void write() const
Definition: CTPPSProtonReconstructionPlotter.cc:300
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_rel_timing_vs_tracking_ClCo
std::unique_ptr< TH1D > h_de_x_rel_timing_vs_tracking_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:174
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_th_x
std::unique_ptr< TH1D > h_th_x
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_xi_range3
std::unique_ptr< TH1D > h_t_xi_range3
Definition: CTPPSProtonReconstructionPlotter.cc:159
CTPPSProtonReconstructionPlotter::outputFile_
std::string outputFile_
Definition: CTPPSProtonReconstructionPlotter.cc:65
CTPPSProtonReconstructionPlotter::MultiRPPlots::MultiRPPlots
MultiRPPlots()
Definition: CTPPSProtonReconstructionPlotter.cc:179
reco::ForwardProton
Definition: ForwardProton.h:21
CTPPSProtonReconstructionPlotter::MultiRPPlots::p_th_y_vs_xi
std::unique_ptr< TProfile > p_th_y_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:164
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::write
void write() const
Definition: CTPPSProtonReconstructionPlotter.cc:460
CTPPSProtonReconstructionPlotter::AssociationCuts::ti_tr_min
double ti_tr_min
Definition: CTPPSProtonReconstructionPlotter.cc:54
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_th_x_vs_xi
std::unique_ptr< TH2D > h2_th_x_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:163
CTPPSProtonReconstructionPlotter::SingleRPPlots::SingleRPPlots
SingleRPPlots()
Definition: CTPPSProtonReconstructionPlotter.cc:105
CTPPSProtonReconstructionPlotter::SingleRPPlots::m_h_xi_nTracks
std::map< unsigned int, TH1D * > m_h_xi_nTracks
Definition: CTPPSProtonReconstructionPlotter.cc:102
CTPPSDetId::sdTimingFastSilicon
Definition: CTPPSDetId.h:44
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_y_vs_x_ttm_ClCo
std::unique_ptr< TH2D > h2_y_vs_x_ttm_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:177
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots
Definition: CTPPSProtonReconstructionPlotter.cc:430
CTPPSLocalTrackLite.h
CTPPSProtonReconstructionPlotter::CTPPSProtonReconstructionPlotter
CTPPSProtonReconstructionPlotter(const edm::ParameterSet &)
Definition: CTPPSProtonReconstructionPlotter.cc:483
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
CTPPSProtonReconstructionPlotter::SingleRPPlots::fill
void fill(const reco::ForwardProton &p, unsigned int nTracks, bool n1f1)
Definition: CTPPSProtonReconstructionPlotter.cc:115
BeamSpotPI::nTracks
Definition: BeamSpotPayloadInspectorHelper.h:42
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSProtonReconstructionPlotter::SingleRPPlots::write
void write() const
Definition: CTPPSProtonReconstructionPlotter.cc:132
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_vtx_y
std::unique_ptr< TH1D > h_vtx_y
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::fill
void fill(const reco::ForwardProton &p_s_N, const reco::ForwardProton &p_s_F, const reco::ForwardProton &p_m)
Definition: CTPPSProtonReconstructionPlotter.cc:445
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_t_vs_xi
std::unique_ptr< TH2D > h2_t_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:163
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_y_vs_x_tt0_ClCo
std::unique_ptr< TH2D > h2_y_vs_x_tt0_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:177
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_unif
std::unique_ptr< TH1D > h_t_unif
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::SingleMultiCorrelationPlots
SingleMultiCorrelationPlots()
Definition: CTPPSProtonReconstructionPlotter.cc:390
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
CTPPSProtonReconstructionPlotter::MultiRPPlots::fill
void fill(const reco::ForwardProton &p, unsigned int nTracks, bool n1f1)
Definition: CTPPSProtonReconstructionPlotter.cc:235
CTPPSProtonReconstructionPlotter::p_x_L_diffNF_vs_x_L_N_
std::unique_ptr< TProfile > p_x_L_diffNF_vs_x_L_N_
Definition: CTPPSProtonReconstructionPlotter.cc:472
CTPPSProtonReconstructionPlotter::singleMultiCorrelationPlots_
std::map< unsigned int, SingleMultiCorrelationPlots > singleMultiCorrelationPlots_
Definition: CTPPSProtonReconstructionPlotter.cc:428
CTPPSProtonReconstructionPlotter::tokenRecoProtonsMultiRP_
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtonsMultiRP_
Definition: CTPPSProtonReconstructionPlotter.cc:47
CTPPSProtonReconstructionPlotter::CalculateTimingTrackingDistance
void CalculateTimingTrackingDistance(const reco::ForwardProton &proton, const CTPPSLocalTrackLite &tr, const CTPPSGeometry &geometry, double &x_tr, double &x_ti, double &de_x, double &de_x_unc)
Definition: CTPPSProtonReconstructionPlotter.cc:514
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_log_chi_sq
std::unique_ptr< TH1D > h_log_chi_sq
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::h2_xi_mu_vs_xi_si
std::unique_ptr< TH2D > h2_xi_mu_vs_xi_si
Definition: CTPPSProtonReconstructionPlotter.cc:382
CTPPSProtonReconstructionPlotter::association_cuts_
std::map< unsigned int, AssociationCuts > association_cuts_
Definition: CTPPSProtonReconstructionPlotter.cc:63
CTPPSProtonReconstructionPlotter::~CTPPSProtonReconstructionPlotter
~CTPPSProtonReconstructionPlotter() override
Definition: CTPPSProtonReconstructionPlotter.cc:38
CTPPSDetId::sdTrackingStrip
Definition: CTPPSDetId.h:44
CTPPSGeometry.h
MakerMacros.h
CTPPSLocalTrackLite::x
float x() const
returns the horizontal track position
Definition: CTPPSLocalTrackLite.h:74
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::p_xi_si_diffNF_vs_xi_mu
std::unique_ptr< TProfile > p_xi_si_diffNF_vs_xi_mu
Definition: CTPPSProtonReconstructionPlotter.cc:433
CTPPSProtonReconstructionPlotter::MultiRPPlots::p_vtx_y_vs_xi
std::unique_ptr< TProfile > p_vtx_y_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:164
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_time_unc
std::unique_ptr< TH1D > h_time_unc
Definition: CTPPSProtonReconstructionPlotter.cc:160
CTPPSProtonReconstructionPlotter::tokenTracks_
edm::EDGetTokenT< CTPPSLocalTrackLiteCollection > tokenTracks_
Definition: CTPPSProtonReconstructionPlotter.cc:45
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CTPPSProtonReconstructionPlotter::rpId_56_N_
unsigned int rpId_56_N_
Definition: CTPPSProtonReconstructionPlotter.cc:51
CTPPSProtonReconstructionPlotter::maxNonEmptyEvents_
signed int maxNonEmptyEvents_
Definition: CTPPSProtonReconstructionPlotter.cc:67
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::p_xi_diff_si_mu_vs_xi_mu
std::unique_ptr< TProfile > p_xi_diff_si_mu_vs_xi_mu
Definition: CTPPSProtonReconstructionPlotter.cc:386
CTPPSProtonReconstructionPlotter::singleRPPlots_
std::map< unsigned int, SingleRPPlots > singleRPPlots_
Definition: CTPPSProtonReconstructionPlotter.cc:154
DDAxes::z
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::h_xi_diff_mu_si
std::unique_ptr< TH1D > h_xi_diff_mu_si
Definition: CTPPSProtonReconstructionPlotter.cc:383
N
#define N
Definition: blowfish.cc:9
CTPPSDetId::sdTimingDiamond
Definition: CTPPSDetId.h:44
CTPPSProtonReconstructionPlotter::AssociationCuts::load
void load(const edm::ParameterSet &ps)
Definition: CTPPSProtonReconstructionPlotter.cc:57
ForwardProtonFwd.h
CTPPSProtonReconstructionPlotter::multiRPPlots_
std::map< unsigned int, MultiRPPlots > multiRPPlots_
Definition: CTPPSProtonReconstructionPlotter.cc:379
CTPPSProtonReconstructionPlotter::MultiRPPlots::p_time_unc_vs_x_ClCo
std::unique_ptr< TProfile > p_time_unc_vs_x_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:161
CTPPSDetId::sdTrackingPixel
Definition: CTPPSDetId.h:44
reco::ForwardProton::contributingLocalTracks
const CTPPSLocalTrackLiteRefVector & contributingLocalTracks() const
list of RP tracks that contributed to this global track
Definition: ForwardProton.h:136
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSDetId::arm
uint32_t arm() const
Definition: CTPPSDetId.h:55
CTPPSProtonReconstructionPlotter
Definition: CTPPSProtonReconstructionPlotter.cc:33
CTPPSProtonReconstructionPlotter::rpId_45_F_
unsigned int rpId_45_F_
Definition: CTPPSProtonReconstructionPlotter.cc:50
reco::ForwardProtonCollection
std::vector< ForwardProton > ForwardProtonCollection
Collection of ForwardProton objects.
Definition: ForwardProtonFwd.h:25
CTPPSProtonReconstructionPlotter::SingleRPPlots::h_xi_n1f1
std::unique_ptr< TH1D > h_xi_n1f1
Definition: CTPPSProtonReconstructionPlotter.cc:103
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_match_timing_vs_tracking
std::unique_ptr< TH1D > h_de_x_match_timing_vs_tracking
Definition: CTPPSProtonReconstructionPlotter.cc:173
Event.h
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t
std::unique_ptr< TH1D > h_t
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::MultiRPPlots::m_h_xi_nTracks
std::map< unsigned int, TH1D * > m_h_xi_nTracks
Definition: CTPPSProtonReconstructionPlotter.cc:168
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::h2_xi_si_diffNF_vs_xi_mu
std::unique_ptr< TH2D > h2_xi_si_diffNF_vs_xi_mu
Definition: CTPPSProtonReconstructionPlotter.cc:432
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
ForwardProton.h
CTPPSProtonReconstructionPlotter::MultiRPPlots
Definition: CTPPSProtonReconstructionPlotter.cc:156
CTPPSProtonReconstructionPlotter::tokenRecoProtonsSingleRP_
edm::EDGetTokenT< reco::ForwardProtonCollection > tokenRecoProtonsSingleRP_
Definition: CTPPSProtonReconstructionPlotter.cc:46
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
reco::ForwardProton::xi
float xi() const
longitudinal fractional momentum loss
Definition: ForwardProton.h:84
createfilelist.int
int
Definition: createfilelist.py:10
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_n_contrib_tracking_tracks
std::unique_ptr< TH1D > h_n_contrib_tracking_tracks
Definition: CTPPSProtonReconstructionPlotter.cc:162
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_xi
std::unique_ptr< TH1D > h_xi
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::h_xi_si_diffNF
std::unique_ptr< TH1D > h_xi_si_diffNF
Definition: CTPPSProtonReconstructionPlotter.cc:431
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_chi_sq_norm
std::unique_ptr< TH1D > h_chi_sq_norm
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::fill
void fill(const reco::ForwardProton &p_single, const reco::ForwardProton &p_multi)
Definition: CTPPSProtonReconstructionPlotter.cc:400
edm::EventSetup
Definition: EventSetup.h:58
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::write
void write() const
Definition: CTPPSProtonReconstructionPlotter.cc:416
VeryForwardRealGeometryRecord.h
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord >
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_th_y
std::unique_ptr< TH1D > h_th_y
Definition: CTPPSProtonReconstructionPlotter.cc:158
CTPPSProtonReconstructionPlotter::rpId_56_F_
unsigned int rpId_56_F_
Definition: CTPPSProtonReconstructionPlotter.cc:51
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_x_timing_vs_x_tracking_ClCo
std::unique_ptr< TH2D > h2_x_timing_vs_x_tracking_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:171
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
CTPPSProtonReconstructionPlotter::geometryESToken_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryESToken_
Definition: CTPPSProtonReconstructionPlotter.cc:48
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_vtx_y_vs_xi
std::unique_ptr< TH2D > h2_vtx_y_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:163
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_timing_vs_tracking_ClCo
std::unique_ptr< TH1D > h_de_x_timing_vs_tracking_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:174
reco::ForwardProton::validFit
bool validFit() const
flag for the fit validity
Definition: ForwardProton.h:126
protons_cff.arm
arm
Definition: protons_cff.py:43
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_th_y_vs_xi
std::unique_ptr< TH2D > h2_th_y_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:163
profile_2016_postTS2_cff.rpId
rpId
Definition: profile_2016_postTS2_cff.py:21
CTPPSProtonReconstructionPlotter::p_y_R_diffNF_vs_y_R_N_
std::unique_ptr< TProfile > p_y_R_diffNF_vs_y_R_N_
Definition: CTPPSProtonReconstructionPlotter.cc:473
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::ArmCorrelationPlots
ArmCorrelationPlots()
Definition: CTPPSProtonReconstructionPlotter.cc:438
CTPPSProtonReconstructionPlotter::profileToRMSGraph
static void profileToRMSGraph(TProfile *p, TGraphErrors *g)
Definition: CTPPSProtonReconstructionPlotter.cc:69
std
Definition: JetResolutionObject.h:76
CTPPSProtonReconstructionPlotter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CTPPSProtonReconstructionPlotter.cc:544
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::h_th_y_si_diffNF
std::unique_ptr< TH1D > h_th_y_si_diffNF
Definition: CTPPSProtonReconstructionPlotter.cc:435
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_xi_n1f1
std::unique_ptr< TH1D > h_xi_n1f1
Definition: CTPPSProtonReconstructionPlotter.cc:169
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::h2_xi_diff_si_mu_vs_xi_mu
std::unique_ptr< TH2D > h2_xi_diff_si_mu_vs_xi_mu
Definition: CTPPSProtonReconstructionPlotter.cc:385
CTPPSLocalTrackLite::y
float y() const
returns the vertical track position
Definition: CTPPSLocalTrackLite.h:80
Frameworkfwd.h
CTPPSProtonReconstructionPlotter::AssociationCuts::ti_tr_max
double ti_tr_max
Definition: CTPPSProtonReconstructionPlotter.cc:55
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_n_contrib_timing_tracks
std::unique_ptr< TH1D > h_n_contrib_timing_tracks
Definition: CTPPSProtonReconstructionPlotter.cc:162
Exception
Definition: hltDiff.cc:245
alignCSCRings.de_x
de_x
Definition: alignCSCRings.py:85
protons_cff.decRPId
decRPId
Definition: protons_cff.py:60
CTPPSProtonReconstructionPlotter::n_non_empty_events_
signed int n_non_empty_events_
Definition: CTPPSProtonReconstructionPlotter.cc:475
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::h_xi_diff_si_mu
std::unique_ptr< TH1D > h_xi_diff_si_mu
Definition: CTPPSProtonReconstructionPlotter.cc:383
CTPPSProtonReconstructionPlotter::AssociationCuts
Definition: CTPPSProtonReconstructionPlotter.cc:53
TtSemiLepEvtBuilder_cfi.mt
mt
Definition: TtSemiLepEvtBuilder_cfi.py:47
EventSetup.h
CTPPSProtonReconstructionPlotter::p_y_L_diffNF_vs_y_L_N_
std::unique_ptr< TProfile > p_y_L_diffNF_vs_y_L_N_
Definition: CTPPSProtonReconstructionPlotter.cc:473
CTPPSProtonReconstructionPlotter::SingleRPPlots::p_th_y_vs_xi
std::unique_ptr< TProfile > p_th_y_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:100
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CTPPSDetId.h
Exception.h
CTPPSProtonReconstructionPlotter::MultiRPPlots::p_time_unc_vs_xi
std::unique_ptr< TProfile > p_time_unc_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:161
CTPPSProtonReconstructionPlotter::ArmCorrelationPlots::p_th_y_si_diffNF_vs_xi_mu
std::unique_ptr< TProfile > p_th_y_si_diffNF_vs_xi_mu
Definition: CTPPSProtonReconstructionPlotter.cc:436
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_rel_timing_vs_tracking
std::unique_ptr< TH1D > h_de_x_rel_timing_vs_tracking
Definition: CTPPSProtonReconstructionPlotter.cc:173
CTPPSProtonReconstructionPlotter::MultiRPPlots::p_th_x_vs_xi
std::unique_ptr< TProfile > p_th_x_vs_xi
Definition: CTPPSProtonReconstructionPlotter.cc:164
CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_timing_tracks_vs_prot_mult
std::unique_ptr< TH2D > h2_timing_tracks_vs_prot_mult
Definition: CTPPSProtonReconstructionPlotter.cc:166
ParameterSet.h
edm::RefVector::at
const value_type at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:83
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_timing_vs_tracking
std::unique_ptr< TH1D > h_de_x_timing_vs_tracking
Definition: CTPPSProtonReconstructionPlotter.cc:173
event
Definition: event.py:1
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
CTPPSProtonReconstructionPlotter::SingleMultiCorrelationPlots::h2_th_y_mu_vs_th_y_si
std::unique_ptr< TH2D > h2_th_y_mu_vs_th_y_si
Definition: CTPPSProtonReconstructionPlotter.cc:388
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_match_timing_vs_tracking_ClCo
std::unique_ptr< TH1D > h_de_x_match_timing_vs_tracking_ClCo
Definition: CTPPSProtonReconstructionPlotter.cc:174
CTPPSProtonReconstructionPlotter::MultiRPPlots::h_chi_sq
std::unique_ptr< TH1D > h_chi_sq
Definition: CTPPSProtonReconstructionPlotter.cc:158
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
CTPPSProtonReconstructionPlotter::p_x_R_diffNF_vs_x_R_N_
std::unique_ptr< TProfile > p_x_R_diffNF_vs_x_R_N_
Definition: CTPPSProtonReconstructionPlotter.cc:472
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
CTPPSProtonReconstructionPlotter::endJob
void endJob() override
Definition: CTPPSProtonReconstructionPlotter.cc:773
CTPPSProtonReconstructionPlotter::SingleRPPlots::h_multiplicity
std::unique_ptr< TH1D > h_multiplicity
Definition: CTPPSProtonReconstructionPlotter.cc:97
CTPPSProtonReconstructionPlotter::rpId_45_N_
unsigned int rpId_45_N_
Definition: CTPPSProtonReconstructionPlotter.cc:50