CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes
CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData Struct Reference

Classes

struct  EffPlots
 

Public Member Functions

 ArmData ()
 
void UpdateOptics (const LHCInterpolatedOpticalFunctionsSetCollection &ofc)
 
void write () const
 

Public Attributes

double de_x_mean
 
double de_x_sigma
 
double de_y_mean
 
double de_y_sigma
 
std::map< unsigned int, std::map< unsigned int, EffPlots > > effPlots
 
std::unique_ptr< TH2D > h2_de_y_vs_de_x
 
std::unique_ptr< TH1D > h_de_x
 
std::unique_ptr< TH1D > h_de_y
 
unsigned int n_events_with_tracks
 
unsigned int n_exp_prot_max
 
std::vector< double > n_sigmas
 
unsigned int rpId_F
 
unsigned int rpId_N
 
std::shared_ptr< const TSpline3 > s_x_to_xi_N
 

Detailed Description

Definition at line 78 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Constructor & Destructor Documentation

◆ ArmData()

CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::ArmData ( )
inline

Definition at line 141 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References effPlots, n_exp_prot_max, and n_sigmas.

143 
144  h_de_x(new TH1D("", ";x_{F} - x_{N} (mm)", 200, -1., +1.)),
145  h_de_y(new TH1D("", ";y_{F} - y_{N} (mm)", 200, -1., +1.)),
146  h2_de_y_vs_de_x(new TH2D("", ";x_{F} - x_{N} (mm);y_{F} - y_{N} (mm)", 100, -1., +1., 100, -1., +1.)),
147 
148  de_x_mean(0.),
149  de_x_sigma(0.),
150  de_y_mean(0.),
151  de_y_sigma(0.) {
152  for (unsigned int nep = 0; nep <= n_exp_prot_max; ++nep) {
153  for (unsigned int nsi = 0; nsi < n_sigmas.size(); ++nsi) {
154  effPlots[nep][nsi] = EffPlots();
155  }
156  }
157  }

Member Function Documentation

◆ UpdateOptics()

void CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::UpdateOptics ( const LHCInterpolatedOpticalFunctionsSetCollection ofc)
inline

Definition at line 204 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References CTPPSDetId::arm(), protons_cff::decRPId, LHCOpticalFunctionsSet::exd, haddnano::of, AlCaHLTBitMon_ParallelJobs::p, CTPPSDetId::rp(), rpId_N, s_x_to_xi_N, and CTPPSDetId::station().

204  {
205  const LHCInterpolatedOpticalFunctionsSet *of = nullptr;
206 
207  for (const auto &p : ofc) {
208  CTPPSDetId rpId(p.first);
209  unsigned int decRPId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
210 
211  if (decRPId == rpId_N) {
212  of = &p.second;
213  break;
214  }
215  }
216 
217  if (!of) {
218  edm::LogError("ArmData::UpdateOptics") << "Cannot find optical functions for RP " << rpId_N;
219  return;
220  }
221 
222  std::vector<double> xiValues =
223  of->getXiValues(); // local copy made since the TSpline constructor needs non-const parameters
224  std::vector<double> xDValues = of->getFcnValues()[LHCOpticalFunctionsSet::exd];
225  s_x_to_xi_N = std::make_shared<TSpline3>("", xDValues.data(), xiValues.data(), xiValues.size());
226  }
Log< level::Error, false > LogError
Set of optical functions corresponding to one scoring plane along LHC, including splines for interpol...
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32

◆ write()

void CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::write ( ) const
inline

Definition at line 159 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References visDQMUpload::buf, de_x_mean, de_x_sigma, de_y_mean, de_y_sigma, effPlots, g, h2_de_y_vs_de_x, h_de_x, h_de_y, and n_sigmas.

159  {
160  h_de_x->Write("h_de_x");
161  h_de_y->Write("h_de_y");
162  h2_de_y_vs_de_x->Write("h2_de_y_vs_de_x");
163 
164  char buf[100];
165 
166  for (const auto &n_si : n_sigmas) {
167  sprintf(buf, "g_de_y_vs_de_x_n_si=%.1f", n_si);
168  TGraph *g = new TGraph();
169  g->SetName(buf);
170 
171  g->SetPoint(0, de_x_mean - n_si * de_x_sigma, de_y_mean - n_si * de_y_sigma);
172  g->SetPoint(1, de_x_mean + n_si * de_x_sigma, de_y_mean - n_si * de_y_sigma);
173  g->SetPoint(2, de_x_mean + n_si * de_x_sigma, de_y_mean + n_si * de_y_sigma);
174  g->SetPoint(3, de_x_mean - n_si * de_x_sigma, de_y_mean + n_si * de_y_sigma);
175  g->SetPoint(4, de_x_mean - n_si * de_x_sigma, de_y_mean - n_si * de_y_sigma);
176 
177  g->Write();
178  }
179 
180  TDirectory *d_top = gDirectory;
181 
182  for (const auto &nep_p : effPlots) {
183  if (nep_p.first == 0)
184  sprintf(buf, "exp prot all");
185  else
186  sprintf(buf, "exp prot %u", nep_p.first);
187 
188  TDirectory *d_nep = d_top->mkdir(buf);
189 
190  for (const auto &nsi_p : nep_p.second) {
191  sprintf(buf, "nsi = %.1f", n_sigmas[nsi_p.first]);
192 
193  TDirectory *d_nsi = d_nep->mkdir(buf);
194 
195  gDirectory = d_nsi;
196 
197  nsi_p.second.write();
198  }
199  }
200 
201  gDirectory = d_top;
202  }
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

Member Data Documentation

◆ de_x_mean

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_x_mean

Definition at line 88 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ de_x_sigma

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_x_sigma

Definition at line 88 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ de_y_mean

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_y_mean

Definition at line 89 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ de_y_sigma

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_y_sigma

Definition at line 89 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ effPlots

std::map<unsigned int, std::map<unsigned int, EffPlots> > CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::effPlots

Definition at line 139 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData(), and write().

◆ h2_de_y_vs_de_x

std::unique_ptr<TH2D> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::h2_de_y_vs_de_x

Definition at line 86 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ h_de_x

std::unique_ptr<TH1D> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::h_de_x

Definition at line 85 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ h_de_y

std::unique_ptr<TH1D> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::h_de_y

Definition at line 85 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

◆ n_events_with_tracks

unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_events_with_tracks

◆ n_exp_prot_max

unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_exp_prot_max

Definition at line 93 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData().

◆ n_sigmas

std::vector<double> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_sigmas

Definition at line 91 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData(), and write().

◆ rpId_F

unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::rpId_F

◆ rpId_N

unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::rpId_N

Definition at line 79 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by UpdateOptics().

◆ s_x_to_xi_N

std::shared_ptr<const TSpline3> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::s_x_to_xi_N

Definition at line 81 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by UpdateOptics().