CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 76 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Constructor & Destructor Documentation

CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::ArmData ( )
inline

Definition at line 139 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References effPlots, n_exp_prot_max, and n_sigmas.

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

Member Function Documentation

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

Definition at line 202 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

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

202  {
203  const LHCInterpolatedOpticalFunctionsSet *of = nullptr;
204 
205  for (const auto &p : ofc) {
206  CTPPSDetId rpId(p.first);
207  unsigned int decRPId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
208 
209  if (decRPId == rpId_N) {
210  of = &p.second;
211  break;
212  }
213  }
214 
215  if (!of) {
216  edm::LogError("ArmData::UpdateOptics") << "Cannot find optical functions for RP " << rpId_N;
217  return;
218  }
219 
220  std::vector<double> xiValues =
221  of->getXiValues(); // local copy made since the TSpline constructor needs non-const parameters
222  std::vector<double> xDValues = of->getFcnValues()[LHCOpticalFunctionsSet::exd];
223  s_x_to_xi_N = std::make_shared<TSpline3>("", xDValues.data(), xiValues.data(), xiValues.size());
224  }
const std::vector< double > & getXiValues() const
Log< level::Error, false > LogError
tuple of
Definition: haddnano.py:40
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
const std::vector< std::vector< double > > & getFcnValues() const
void CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::write ( ) const
inline

Definition at line 157 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.

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

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_x_mean

Definition at line 86 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_x_sigma

Definition at line 86 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_y_mean

Definition at line 87 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_y_sigma

Definition at line 87 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

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

Definition at line 137 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData(), and write().

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

Definition at line 84 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

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

Definition at line 83 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

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

Definition at line 83 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by write().

unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_events_with_tracks
unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_exp_prot_max

Definition at line 91 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData().

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

Definition at line 89 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData(), and write().

unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::rpId_F
unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::rpId_N

Definition at line 77 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by UpdateOptics().

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

Definition at line 79 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by UpdateOptics().