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)
 
 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_vtx_y_vs_xi
 
std::unique_ptr< TH1D > h_chi_sq
 
std::unique_ptr< TH1D > h_chi_sq_norm
 
std::unique_ptr< TH1D > h_n_timing_RPs
 
std::unique_ptr< TH1D > h_n_tracking_RPs
 
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_vtx_y
 
std::unique_ptr< TH1D > h_xi
 
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 106 of file CTPPSProtonReconstructionPlotter.cc.

Constructor & Destructor Documentation

CTPPSProtonReconstructionPlotter::MultiRPPlots::MultiRPPlots ( )
inline

Definition at line 114 of file CTPPSProtonReconstructionPlotter.cc.

References lumiQTWidget::t.

114  :
115  h_xi(new TH1D("", ";#xi", 100, 0., 0.3)),
116  h_th_x(new TH1D("", ";#theta_{x} (rad)", 100, -500E-6, +500E-6)),
117  h_th_y(new TH1D("", ";#theta_{y} (rad)", 100, -500E-6, +500E-6)),
118  h_vtx_y(new TH1D("", ";vtx_{y} (cm)", 100, -2., +2.)),
119  h_chi_sq(new TH1D("", ";#chi^{2}", 100, 0., 0.)),
120  h_chi_sq_norm(new TH1D("", ";#chi^{2}/ndf", 100, 0., 5.)),
121  h_n_tracking_RPs(new TH1D("", ";n of tracking RPs", 4, -0.5, +3.5)),
122  h_n_timing_RPs(new TH1D("", ";n of timing RPs", 4, -0.5, +3.5)),
123  h2_th_x_vs_xi(new TH2D("", ";#xi;#theta_{x} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
124  h2_th_y_vs_xi(new TH2D("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3, 100, -500E-6, +500E-6)),
125  h2_vtx_y_vs_xi(new TH2D("", ";#xi;vtx_{y} (cm)", 100, 0., 0.3, 100, -500E-3, +500E-3)),
126  p_th_x_vs_xi(new TProfile("", ";#xi;#theta_{x} (rad)", 100, 0., 0.3)),
127  p_th_y_vs_xi(new TProfile("", ";#xi;#theta_{y} (rad)", 100, 0., 0.3)),
128  p_vtx_y_vs_xi(new TProfile("", ";#xi;vtx_{y} (cm)", 100, 0., 0.3))
129  {
130  std::vector<double> v_t_bin_edges;
131  for (double t = 0; t <= 5.; ) {
132  v_t_bin_edges.push_back(t);
133  const double de_t = 0.05 + 0.09 * t + 0.02 * t*t;
134  t += de_t;
135  }
136  h_t_unif.reset(new TH1D("", ";|t| (GeV^2)", 100, 0., 5.));
137  h_t.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
138  h_t_xi_range1.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
139  h_t_xi_range2.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
140  h_t_xi_range3.reset(new TH1D("", ";|t| (GeV^2)", v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
141  h2_t_vs_xi.reset(new TH2D("", ";#xi;|t| (GeV^2)", 100, 0., 0.3, v_t_bin_edges.size() - 1, v_t_bin_edges.data()));
142  }

Member Function Documentation

void CTPPSProtonReconstructionPlotter::MultiRPPlots::fill ( const reco::ForwardProton p)
inline

Definition at line 144 of file CTPPSProtonReconstructionPlotter.cc.

References reco::ForwardProton::chi2(), reco::ForwardProton::contributingLocalTracks(), 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::validFit(), reco::ForwardProton::vertex(), and reco::ForwardProton::xi().

145  {
146  if (!p.validFit())
147  return;
148 
149  unsigned int n_tracking_RPs=0, n_timing_RPs=0;
150  for (const auto &tr : p.contributingLocalTracks())
151  {
152  CTPPSDetId detId(tr->getRPId());
153  if (detId.subdetId() == CTPPSDetId::sdTrackingStrip || detId.subdetId() == CTPPSDetId::sdTrackingPixel)
154  n_tracking_RPs++;
155  if (detId.subdetId() == CTPPSDetId::sdTimingDiamond || detId.subdetId() == CTPPSDetId::sdTimingFastSilicon)
156  n_timing_RPs++;
157  }
158 
159  const double th_x = p.thetaX();
160  const double th_y = p.thetaY();
161  const double mt = - p.t();
162 
163  h_chi_sq->Fill(p.chi2());
164  if (p.ndof() > 0)
165  h_chi_sq_norm->Fill(p.normalizedChi2());
166 
167  h_n_tracking_RPs->Fill(n_tracking_RPs);
168  h_n_timing_RPs->Fill(n_timing_RPs);
169 
170  h_xi->Fill(p.xi());
171 
172  h_th_x->Fill(th_x);
173  h_th_y->Fill(th_y);
174 
175  h_vtx_y->Fill(p.vertex().y());
176 
177  h_t_unif->Fill(mt);
178  h_t->Fill(mt);
179  if (p.xi() > 0.04 && p.xi() < 0.07) h_t_xi_range1->Fill(mt);
180  if (p.xi() > 0.07 && p.xi() < 0.10) h_t_xi_range2->Fill(mt);
181  if (p.xi() > 0.10 && p.xi() < 0.13) h_t_xi_range3->Fill(mt);
182 
183  h2_th_x_vs_xi->Fill(p.xi(), th_x);
184  h2_th_y_vs_xi->Fill(p.xi(), th_y);
185  h2_vtx_y_vs_xi->Fill(p.xi(), p.vertex().y());
186  h2_t_vs_xi->Fill(p.xi(), mt);
187 
188  p_th_x_vs_xi->Fill(p.xi(), th_x);
189  p_th_y_vs_xi->Fill(p.xi(), th_y);
190  p_vtx_y_vs_xi->Fill(p.xi(), p.vertex().y());
191  }
const Point & vertex() const
fitted vertex position
Definition: ForwardProton.h:46
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
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 193 of file CTPPSProtonReconstructionPlotter.cc.

References CTPPSProtonReconstructionPlotter::profileToRMSGraph().

194  {
195  h_chi_sq->Write("h_chi_sq");
196  h_chi_sq_norm->Write("h_chi_sq_norm");
197 
198  h_n_tracking_RPs->Write("h_n_tracking_RPs");
199  h_n_timing_RPs->Write("h_n_timing_RPs");
200 
201  h_xi->Write("h_xi");
202 
203  h_th_x->Write("h_th_x");
204  h2_th_x_vs_xi->Write("h2_th_x_vs_xi");
205  p_th_x_vs_xi->Write("p_th_x_vs_xi");
206  auto g_th_x_RMS_vs_xi = std::make_unique<TGraphErrors>();
207  profileToRMSGraph(p_th_x_vs_xi.get(), g_th_x_RMS_vs_xi.get());
208  g_th_x_RMS_vs_xi->Write("g_th_x_RMS_vs_xi");
209 
210  h_th_y->Write("h_th_y");
211  h2_th_y_vs_xi->Write("h2_th_y_vs_xi");
212  p_th_y_vs_xi->Write("p_th_y_vs_xi");
213  auto g_th_y_RMS_vs_xi = std::make_unique<TGraphErrors>();
214  profileToRMSGraph(p_th_y_vs_xi.get(), g_th_y_RMS_vs_xi.get());
215  g_th_y_RMS_vs_xi->Write("g_th_y_RMS_vs_xi");
216 
217  h_vtx_y->Write("h_vtx_y");
218  h2_vtx_y_vs_xi->Write("h2_vtx_y_vs_xi");
219  p_vtx_y_vs_xi->Write("p_vtx_y_vs_xi");
220  auto g_vtx_y_RMS_vs_xi = std::make_unique<TGraphErrors>();
221  profileToRMSGraph(p_vtx_y_vs_xi.get(), g_vtx_y_RMS_vs_xi.get());
222  g_vtx_y_RMS_vs_xi->Write("g_vtx_y_RMS_vs_xi");
223 
224  h_t->Scale(1., "width");
225 
226  h_t_unif->Write("h_t_unif");
227  h_t->Write("h_t");
228  h_t_xi_range1->Write("h_t_xi_range1");
229  h_t_xi_range2->Write("h_t_xi_range2");
230  h_t_xi_range3->Write("h_t_xi_range3");
231 
232  h2_t_vs_xi->Write("h2_t_vs_xi");
233  }
static void profileToRMSGraph(TProfile *p, TGraphErrors *g)

Member Data Documentation

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

Definition at line 111 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 111 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 111 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 111 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 110 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 110 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 109 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 109 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 109 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 108 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 112 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 112 of file CTPPSProtonReconstructionPlotter.cc.

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

Definition at line 112 of file CTPPSProtonReconstructionPlotter.cc.