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 70 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Constructor & Destructor Documentation

CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::ArmData ( )
inline

Definition at line 114 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::EffPlots::EffPlots(), and n_exp_prot_max.

116 
117  h_de_x(new TH1D("", ";x_{F} - x_{N} (mm)", 200, -1., +1.)),
118  h_de_y(new TH1D("", ";y_{F} - y_{N} (mm)", 200, -1., +1.)),
119  h2_de_y_vs_de_x(new TH2D("", ";x_{F} - x_{N} (mm);y_{F} - y_{N} (mm)", 100, -1., +1., 100, -1., +1.)),
120 
121  de_x_mean(0.),
122  de_x_sigma(0.),
123  de_y_mean(0.),
124  de_y_sigma(0.) {
125  for (unsigned int nep = 0; nep <= n_exp_prot_max; ++nep) {
126  for (unsigned int nsi = 0; nsi < n_sigmas.size(); ++nsi) {
127  effPlots[nep][nsi] = EffPlots();
128  }
129  }
130  }

Member Function Documentation

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

Definition at line 177 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References CTPPSDetId::arm(), protons_cff::decRPId, LHCOpticalFunctionsSet::exd, LHCOpticalFunctionsSet::getFcnValues(), LHCOpticalFunctionsSet::getXiValues(), NULL, haddnano::of, AlCaHLTBitMon_ParallelJobs::p, CTPPSDetId::rp(), year_2016_postTS2_cff::rpId, rpId_N, and CTPPSDetId::station().

177  {
179 
180  for (const auto &p : ofc) {
181  CTPPSDetId rpId(p.first);
182  unsigned int decRPId = rpId.arm() * 100 + rpId.station() * 10 + rpId.rp();
183 
184  if (decRPId == rpId_N) {
185  of = &p.second;
186  break;
187  }
188  }
189 
190  if (!of) {
191  edm::LogError("ArmData::UpdateOptics") << "Cannot find optical functions for RP " << rpId_N;
192  return;
193  }
194 
195  std::vector<double> xiValues =
196  of->getXiValues(); // local copy made since the TSpline constructor needs non-const parameters
197  std::vector<double> xDValues = of->getFcnValues()[LHCOpticalFunctionsSet::exd];
198  s_x_to_xi_N = std::make_shared<TSpline3>("", xDValues.data(), xiValues.data(), xiValues.size());
199  }
#define NULL
Definition: scimark2.h:8
const std::vector< double > & getXiValues() const
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 132 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

References g.

132  {
133  h_de_x->Write("h_de_x");
134  h_de_y->Write("h_de_y");
135  h2_de_y_vs_de_x->Write("h2_de_y_vs_de_x");
136 
137  char buf[100];
138 
139  for (const auto &n_si : n_sigmas) {
140  sprintf(buf, "g_de_y_vs_de_x_n_si=%.1f", n_si);
141  TGraph *g = new TGraph();
142  g->SetName(buf);
143 
144  g->SetPoint(0, de_x_mean - n_si * de_x_sigma, de_y_mean - n_si * de_y_sigma);
145  g->SetPoint(1, de_x_mean + n_si * de_x_sigma, de_y_mean - n_si * de_y_sigma);
146  g->SetPoint(2, de_x_mean + n_si * de_x_sigma, de_y_mean + n_si * de_y_sigma);
147  g->SetPoint(3, de_x_mean - n_si * de_x_sigma, de_y_mean + n_si * de_y_sigma);
148  g->SetPoint(4, de_x_mean - n_si * de_x_sigma, de_y_mean - n_si * de_y_sigma);
149 
150  g->Write();
151  }
152 
153  TDirectory *d_top = gDirectory;
154 
155  for (const auto &nep_p : effPlots) {
156  if (nep_p.first == 0)
157  sprintf(buf, "exp prot all");
158  else
159  sprintf(buf, "exp prot %u", nep_p.first);
160 
161  TDirectory *d_nep = d_top->mkdir(buf);
162 
163  for (const auto &nsi_p : nep_p.second) {
164  sprintf(buf, "nsi = %.1f", n_sigmas[nsi_p.first]);
165 
166  TDirectory *d_nsi = d_nep->mkdir(buf);
167 
168  gDirectory = d_nsi;
169 
170  nsi_p.second.write();
171  }
172  }
173 
174  gDirectory = d_top;
175  }
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
double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_x_sigma
double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_y_mean
double CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::de_y_sigma
std::map<unsigned int, std::map<unsigned int, EffPlots> > CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::effPlots
std::unique_ptr<TH2D> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::h2_de_y_vs_de_x
std::unique_ptr<TH1D> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::h_de_x
std::unique_ptr<TH1D> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::h_de_y
unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_events_with_tracks
unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_exp_prot_max

Definition at line 85 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by ArmData().

std::vector<double> CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::n_sigmas
unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::rpId_F
unsigned int CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData::rpId_N

Definition at line 71 of file CTPPSProtonReconstructionEfficiencyEstimatorData.cc.

Referenced by UpdateOptics().

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