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