CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
CTPPSProtonReconstructionPlotter::MultiRPPlots Struct Reference

Public Member Functions

void fill (const reco::ForwardProton &p, unsigned int nTracks)
 
 MultiRPPlots ()
 
void write () const
 

Public Attributes

std::unique_ptr< TH2D > h2_t_vs_xi
 
std::unique_ptr< TH2D > h2_th_x_vs_xi
 
std::unique_ptr< TH2D > h2_th_y_vs_xi
 
std::unique_ptr< TH2D > h2_timing_tracks_vs_prot_mult
 
std::unique_ptr< TH2D > h2_vtx_y_vs_xi
 
std::unique_ptr< TH2D > h2_y_vs_x_tt0_ClCo
 
std::unique_ptr< TH2D > h2_y_vs_x_tt1_ClCo
 
std::unique_ptr< TH2D > h2_y_vs_x_ttm_ClCo
 
std::unique_ptr< TH1D > h_chi_sq
 
std::unique_ptr< TH1D > h_chi_sq_norm
 
std::unique_ptr< TH1D > h_de_x_match_timing_vs_tracking
 
std::unique_ptr< TH1D > h_de_x_rel_timing_vs_tracking
 
std::unique_ptr< TH1D > h_de_x_rel_timing_vs_tracking_ClCo
 
std::unique_ptr< TH1D > h_de_x_timing_vs_tracking
 
std::unique_ptr< TH1D > h_log_chi_sq
 
std::unique_ptr< TH1D > h_multiplicity
 
std::unique_ptr< TH1D > h_n_contrib_timing_tracks
 
std::unique_ptr< TH1D > h_n_contrib_tracking_tracks
 
std::unique_ptr< TH1D > h_t
 
std::unique_ptr< TH1D > h_t_unif
 
std::unique_ptr< TH1D > h_t_xi_range1
 
std::unique_ptr< TH1D > h_t_xi_range2
 
std::unique_ptr< TH1D > h_t_xi_range3
 
std::unique_ptr< TH1D > h_th_x
 
std::unique_ptr< TH1D > h_th_y
 
std::unique_ptr< TH1D > h_time
 
std::unique_ptr< TH1D > h_vtx_y
 
std::unique_ptr< TH1D > h_xi
 
std::map< unsigned int, TH1D * > m_h_xi_nTracks
 
std::unique_ptr< TProfile > p_th_x_vs_xi
 
std::unique_ptr< TProfile > p_th_y_vs_xi
 
std::unique_ptr< TProfile > p_vtx_y_vs_xi
 

Detailed Description

Definition at line 131 of file CTPPSProtonReconstructionPlotter.cc.

Constructor & Destructor Documentation

CTPPSProtonReconstructionPlotter::MultiRPPlots::MultiRPPlots ( )
inline

Definition at line 149 of file CTPPSProtonReconstructionPlotter.cc.

References gen::n, and lumiQTWidget::t.

150  : h_multiplicity(new TH1D("", ";reconstructed protons per event", 11, -0.5, 10.5)),
151  h_xi(new TH1D("", ";#xi", 100, 0., 0.3)),
152  h_th_x(new TH1D("", ";#theta_{x} (rad)", 250, -500E-6, +500E-6)),
153  h_th_y(new TH1D("", ";#theta_{y} (rad)", 250, -500E-6, +500E-6)),
154  h_vtx_y(new TH1D("", ";vtx_{y} (cm)", 100, -100E-3, +100E-3)),
155  h_chi_sq(new TH1D("", ";#chi^{2}", 100, 0., 10.)),
156  h_log_chi_sq(new TH1D("", ";log_{10} #chi^{2}", 100, -20., 5.)),
157  h_chi_sq_norm(new TH1D("", ";#chi^{2}/ndf", 100, 0., 5.)),
158  h_time(new TH1D("", ";time", 100, -2., +2.)),
159  h_n_contrib_tracking_tracks(new TH1D("", ";n of contrib. tracking tracks per reco proton", 4, -0.5, +3.5)),
160  h_n_contrib_timing_tracks(new TH1D("", ";n of contrib. timing tracks per reco proton", 4, -0.5, +3.5)),
161  h2_th_x_vs_xi(new TH2D("", ";#xi;#theta_{x} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
162  h2_th_y_vs_xi(new TH2D("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
163  h2_vtx_y_vs_xi(new TH2D("", ";#xi;vtx_{y} (cm)", 100, 0., 0.3, 100, -100E-3, +100E-3)),
164  p_th_x_vs_xi(new TProfile("", ";#xi;#theta_{x} (rad)", 100, 0., 0.3)),
165  p_th_y_vs_xi(new TProfile("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3)),
166  p_vtx_y_vs_xi(new TProfile("", ";#xi;vtx_{y} (cm)", 100, 0., 0.3)),
168  new TH2D("", ";reco protons per event;timing tracks per event", 11, -0.5, 10.5, 11, -0.5, 10.5)),
169  h_de_x_timing_vs_tracking(new TH1D("", ";#Delta x (mm)", 200, -1., +1.)),
170  h_de_x_rel_timing_vs_tracking(new TH1D("", ";#Delta x / #sigma(x)", 200, -20., +20.)),
171  h_de_x_match_timing_vs_tracking(new TH1D("", ";match between tracking and timing tracks", 2, -0.5, +1.5)),
172  h_de_x_rel_timing_vs_tracking_ClCo(new TH1D("", ";#Delta x / #sigma(x)", 200, -20., +20.)),
173  h2_y_vs_x_tt0_ClCo(new TH2D("", ";x (mm);y (mm)", 100, -5., 25., 100, -15., +15.)),
174  h2_y_vs_x_tt1_ClCo(new TH2D("", ";x (mm);y (mm)", 100, -5., 25., 100, -15., +15.)),
175  h2_y_vs_x_ttm_ClCo(new TH2D("", ";x (mm);y (mm)", 100, -5., 25., 100, -15., +15.)) {
176  std::vector<double> v_t_bin_edges;
177  for (double t = 0; t <= 5.;) {
178  v_t_bin_edges.push_back(t);
179  const double de_t = 0.05 + 0.09 * t + 0.02 * t * t;
180  t += de_t;
181  }
182  h_t_unif.reset(new TH1D("", ";|t| (GeV^2)", 100, 0., 5.));
183  h_t.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
184  h_t_xi_range1.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
185  h_t_xi_range2.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
186  h_t_xi_range3.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
187  h2_t_vs_xi.reset(
188  new TH2D("", ";#xi;|t| (GeV^2)", 100, 0., 0.3, v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
189 
190  for (unsigned int n = 2; n <= 10; ++n)
191  m_h_xi_nTracks[n] = new TH1D(*h_xi);
192  }

Member Function Documentation

void CTPPSProtonReconstructionPlotter::MultiRPPlots::fill ( const reco::ForwardProton p,
unsigned int  nTracks 
)
inline

Definition at line 194 of file CTPPSProtonReconstructionPlotter.cc.

References reco::ForwardProton::chi2(), reco::ForwardProton::contributingLocalTracks(), CTPPSLocalTrackLite::getRPId(), TtSemiLepEvtBuilder_cfi::mt, reco::ForwardProton::ndof(), reco::ForwardProton::normalizedChi2(), CTPPSDetId::sdTimingDiamond, CTPPSDetId::sdTimingFastSilicon, CTPPSDetId::sdTrackingPixel, CTPPSDetId::sdTrackingStrip, reco::ForwardProton::t(), reco::ForwardProton::thetaX(), reco::ForwardProton::thetaY(), reco::ForwardProton::time(), reco::ForwardProton::validFit(), reco::ForwardProton::vertex(), and reco::ForwardProton::xi().

194  {
195  if (!p.validFit())
196  return;
197 
198  unsigned int n_contrib_tracking_tracks = 0, n_contrib_timing_tracks = 0;
199  for (const auto &tr : p.contributingLocalTracks()) {
200  CTPPSDetId detId(tr->getRPId());
201  if (detId.subdetId() == CTPPSDetId::sdTrackingStrip || detId.subdetId() == CTPPSDetId::sdTrackingPixel)
202  n_contrib_tracking_tracks++;
203  if (detId.subdetId() == CTPPSDetId::sdTimingDiamond || detId.subdetId() == CTPPSDetId::sdTimingFastSilicon)
204  n_contrib_timing_tracks++;
205  }
206 
207  const double th_x = p.thetaX();
208  const double th_y = p.thetaY();
209  const double mt = -p.t();
210 
211  h_chi_sq->Fill(p.chi2());
212  h_log_chi_sq->Fill(log10(p.chi2()));
213  if (p.ndof() > 0)
214  h_chi_sq_norm->Fill(p.normalizedChi2());
215 
216  h_n_contrib_tracking_tracks->Fill(n_contrib_tracking_tracks);
217  h_n_contrib_timing_tracks->Fill(n_contrib_timing_tracks);
218 
219  h_xi->Fill(p.xi());
220 
221  h_th_x->Fill(th_x);
222  h_th_y->Fill(th_y);
223 
224  h_vtx_y->Fill(p.vertex().y());
225 
226  h_t_unif->Fill(mt);
227  h_t->Fill(mt);
228  if (p.xi() > 0.04 && p.xi() < 0.07)
229  h_t_xi_range1->Fill(mt);
230  if (p.xi() > 0.07 && p.xi() < 0.10)
231  h_t_xi_range2->Fill(mt);
232  if (p.xi() > 0.10 && p.xi() < 0.13)
233  h_t_xi_range3->Fill(mt);
234 
235  h_time->Fill(p.time());
236 
237  h2_th_x_vs_xi->Fill(p.xi(), th_x);
238  h2_th_y_vs_xi->Fill(p.xi(), th_y);
239  h2_vtx_y_vs_xi->Fill(p.xi(), p.vertex().y());
240  h2_t_vs_xi->Fill(p.xi(), mt);
241 
242  p_th_x_vs_xi->Fill(p.xi(), th_x);
243  p_th_y_vs_xi->Fill(p.xi(), th_y);
244  p_vtx_y_vs_xi->Fill(p.xi(), p.vertex().y());
245 
246  auto it = m_h_xi_nTracks.find(nTracks);
247  if (it != m_h_xi_nTracks.end())
248  it->second->Fill(p.xi());
249  }
const Point & vertex() const
fitted vertex position
Definition: ForwardProton.h:46
const unsigned int nTracks(const reco::Vertex &sv)
float t() const
four-momentum transfer squared, in GeV^2
float chi2() const
chi-squared of the fit
Definition: ForwardProton.h:67
float thetaX() const
vertical scattering angle, in rad
Definition: ForwardProton.h:78
float normalizedChi2() const
chi-squared divided by ndof (or chi-squared * 1e6 if ndof is zero)
Definition: ForwardProton.h:71
float xi() const
longitudinal fractional momentum loss
Definition: ForwardProton.h:76
const CTPPSLocalTrackLiteRefVector & contributingLocalTracks() const
list of RP tracks that contributed to this global track
bool validFit() const
flag for the fit validity
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
float thetaY() const
horizontal scattering angle, in rad
Definition: ForwardProton.h:80
float time() const
time of proton arrival at forward stations
unsigned int ndof() const
number of degrees of freedom for the track fit
Definition: ForwardProton.h:69
void CTPPSProtonReconstructionPlotter::MultiRPPlots::write ( ) const
inline

Definition at line 251 of file CTPPSProtonReconstructionPlotter.cc.

References AlCaHLTBitMon_ParallelJobs::p, and CTPPSProtonReconstructionPlotter::profileToRMSGraph().

251  {
252  h_multiplicity->Write("h_multiplicity");
253 
254  h_chi_sq->Write("h_chi_sq");
255  h_log_chi_sq->Write("h_log_chi_sq");
256  h_chi_sq_norm->Write("h_chi_sq_norm");
257 
258  h_n_contrib_tracking_tracks->Write("h_n_contrib_tracking_tracks");
259  h_n_contrib_timing_tracks->Write("h_n_contrib_timing_tracks");
260 
261  h2_timing_tracks_vs_prot_mult->Write("h2_timing_tracks_vs_prot_mult");
262 
263  h_xi->Write("h_xi");
264 
265  h_th_x->Write("h_th_x");
266  h2_th_x_vs_xi->Write("h2_th_x_vs_xi");
267  p_th_x_vs_xi->Write("p_th_x_vs_xi");
268  auto g_th_x_RMS_vs_xi = std::make_unique<TGraphErrors>();
269  profileToRMSGraph(p_th_x_vs_xi.get(), g_th_x_RMS_vs_xi.get());
270  g_th_x_RMS_vs_xi->Write("g_th_x_RMS_vs_xi");
271 
272  h_th_y->Write("h_th_y");
273  h2_th_y_vs_xi->Write("h2_th_y_vs_xi");
274  p_th_y_vs_xi->Write("p_th_y_vs_xi");
275  auto g_th_y_RMS_vs_xi = std::make_unique<TGraphErrors>();
276  profileToRMSGraph(p_th_y_vs_xi.get(), g_th_y_RMS_vs_xi.get());
277  g_th_y_RMS_vs_xi->Write("g_th_y_RMS_vs_xi");
278 
279  h_vtx_y->Write("h_vtx_y");
280  h2_vtx_y_vs_xi->Write("h2_vtx_y_vs_xi");
281  p_vtx_y_vs_xi->Write("p_vtx_y_vs_xi");
282  auto g_vtx_y_RMS_vs_xi = std::make_unique<TGraphErrors>();
283  profileToRMSGraph(p_vtx_y_vs_xi.get(), g_vtx_y_RMS_vs_xi.get());
284  g_vtx_y_RMS_vs_xi->Write("g_vtx_y_RMS_vs_xi");
285 
286  h_t->Scale(1., "width");
287 
288  h_t_unif->Write("h_t_unif");
289  h_t->Write("h_t");
290  h_t_xi_range1->Write("h_t_xi_range1");
291  h_t_xi_range2->Write("h_t_xi_range2");
292  h_t_xi_range3->Write("h_t_xi_range3");
293 
294  h2_t_vs_xi->Write("h2_t_vs_xi");
295 
296  h_time->Write("h_time");
297 
298  TDirectory *d_top = gDirectory;
299 
300  gDirectory = d_top->mkdir("h_xi_nTracks");
301  for (const auto p : m_h_xi_nTracks) {
302  char buf[100];
303  sprintf(buf, "h_xi_nTracks_%u", p.first);
304  p.second->Write(buf);
305  }
306 
307  gDirectory = d_top;
308 
309  h_de_x_timing_vs_tracking->Write("h_de_x_timing_vs_tracking");
310  h_de_x_rel_timing_vs_tracking->Write("h_de_x_rel_timing_vs_tracking");
311  h_de_x_match_timing_vs_tracking->Write("h_de_x_match_timing_vs_tracking");
312  h_de_x_rel_timing_vs_tracking_ClCo->Write("h_de_x_rel_timing_vs_tracking_ClCo");
313 
314  h2_y_vs_x_tt0_ClCo->Write("h2_y_vs_x_tt0_ClCo");
315  h2_y_vs_x_tt1_ClCo->Write("h2_y_vs_x_tt1_ClCo");
316  h2_y_vs_x_ttm_ClCo->Write("h2_y_vs_x_ttm_ClCo");
317  }
static void profileToRMSGraph(TProfile *p, TGraphErrors *g)

Member Data Documentation

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_t_vs_xi

Definition at line 137 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_th_x_vs_xi

Definition at line 137 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_th_y_vs_xi

Definition at line 137 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_timing_tracks_vs_prot_mult

Definition at line 140 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_vtx_y_vs_xi

Definition at line 137 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_y_vs_x_tt0_ClCo

Definition at line 147 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_y_vs_x_tt1_ClCo

Definition at line 147 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH2D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h2_y_vs_x_ttm_ClCo

Definition at line 147 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_chi_sq

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_chi_sq_norm

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_match_timing_vs_tracking

Definition at line 144 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_rel_timing_vs_tracking

Definition at line 144 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_rel_timing_vs_tracking_ClCo

Definition at line 145 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_de_x_timing_vs_tracking

Definition at line 144 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_log_chi_sq

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_multiplicity

Definition at line 132 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_n_contrib_timing_tracks

Definition at line 136 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_n_contrib_tracking_tracks

Definition at line 136 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_unif

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_xi_range1

Definition at line 134 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_xi_range2

Definition at line 134 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_t_xi_range3

Definition at line 134 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_th_x

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_th_y

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_time

Definition at line 135 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_vtx_y

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TH1D> CTPPSProtonReconstructionPlotter::MultiRPPlots::h_xi

Definition at line 133 of file CTPPSProtonReconstructionPlotter.cc.

std::map<unsigned int, TH1D *> CTPPSProtonReconstructionPlotter::MultiRPPlots::m_h_xi_nTracks

Definition at line 142 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TProfile> CTPPSProtonReconstructionPlotter::MultiRPPlots::p_th_x_vs_xi

Definition at line 138 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TProfile> CTPPSProtonReconstructionPlotter::MultiRPPlots::p_th_y_vs_xi

Definition at line 138 of file CTPPSProtonReconstructionPlotter.cc.

std::unique_ptr<TProfile> CTPPSProtonReconstructionPlotter::MultiRPPlots::p_vtx_y_vs_xi

Definition at line 138 of file CTPPSProtonReconstructionPlotter.cc.