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