CMS 3D CMS Logo

SurveyPxbDicer.h
Go to the documentation of this file.
1 #ifndef GUARD_surveypxbdicer_h
2 #define GUARD_surveypxbdicer_h
3 
4 #include <vector>
5 #include <functional>
6 #include <utility>
7 #include <fstream>
10 #include "Math/SMatrix.h"
11 #include "Math/SVector.h"
12 #include "CLHEP/Random/RandGauss.h"
13 #include "CLHEP/Random/Random.h"
15 
16 #include <iostream>
17 #include <stdexcept>
18 
22 public:
24  typedef double value_t;
25  typedef std::vector<coord_t> fidpoint_t;
26  typedef unsigned int count_t;
28  typedef std::pair<id_t, id_t> idPair_t;
29 
30  // Constructors
32  // Constructor from VPSet
33  SurveyPxbDicer(const std::vector<edm::ParameterSet> &pars, unsigned int seed);
34 
38  std::string doDice(const fidpoint_t &fidpointvec, const idPair_t &id, const bool rotate = false);
39  void doDice(const fidpoint_t &fidpointvec, const idPair_t &id, std::ofstream &outfile, const bool rotate = false);
40 
41 private:
45  value_t ranGauss(value_t mean, value_t sigma) { return CLHEP::RandGauss::shoot(mean, sigma); };
46 
53 
58  value_t getParByName(const std::string &name, const std::string &par, const std::vector<edm::ParameterSet> &pars);
59 
66  coord_t transform(const coord_t &x, const value_t &a0, const value_t &a1, const value_t &a2, const value_t &a3);
67 
69  struct findParByName {
70  bool operator()(const std::string &name, const edm::ParameterSet &parset) const {
71  return (parset.getParameter<std::string>("name") == name);
72  }
73  };
74 };
75 
76 #endif
SurveyPxbDicer::mean_a0
value_t mean_a0
Definition: SurveyPxbDicer.h:45
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
SurveyPxbDicer::mean_x
value_t mean_x
Definition: SurveyPxbDicer.h:51
SurveyPxbImage.h
SurveyPxbDicer::sigma_phi
value_t sigma_phi
Definition: SurveyPxbDicer.h:50
SurveyPxbDicer::SurveyPxbDicer
SurveyPxbDicer()
Definition: SurveyPxbDicer.h:31
Point3DBase.h
DDAxes::x
SurveyPxbDicer::fidpoint_t
std::vector< coord_t > fidpoint_t
Definition: SurveyPxbDicer.h:25
SurveyPxbDicer::transform
coord_t transform(const coord_t &x, const value_t &a0, const value_t &a1, const value_t &a2, const value_t &a3)
Definition: SurveyPxbDicer.cc:70
SurveyPxbDicer::idPair_t
std::pair< id_t, id_t > idPair_t
Definition: SurveyPxbDicer.h:28
svgfig.rotate
def rotate(angle, cx=0, cy=0)
Definition: svgfig.py:705
SurveyPxbDicer::doDice
std::string doDice(const fidpoint_t &fidpointvec, const idPair_t &id, const bool rotate=false)
Definition: SurveyPxbDicer.cc:37
testProducerWithPsetDescEmpty_cfi.a2
a2
Definition: testProducerWithPsetDescEmpty_cfi.py:35
SurveyPxbDicer::mean_a1
value_t mean_a1
Definition: SurveyPxbDicer.h:48
SurveyPxbDicer::sigma_y
value_t sigma_y
Definition: SurveyPxbDicer.h:52
SurveyPxbImage::id_t
unsigned int id_t
Definition: SurveyPxbImage.h:15
SurveyPxbDicer::sigma_x
value_t sigma_x
Definition: SurveyPxbDicer.h:51
SurveyPxbDicer::mean_scale
value_t mean_scale
Definition: SurveyPxbDicer.h:49
Point3DBase
Definition: Point3DBase.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SurveyPxbDicer::coord_t
SurveyPxbImage::coord_t coord_t
Definition: SurveyPxbDicer.h:23
SurveyPxbDicer::sigma_a1
value_t sigma_a1
Definition: SurveyPxbDicer.h:48
SurveyPxbDicer::id_t
SurveyPxbImage::id_t id_t
Definition: SurveyPxbDicer.h:27
edm::ParameterSet
Definition: ParameterSet.h:36
SurveyPxbDicer::ranGauss
value_t ranGauss(value_t mean, value_t sigma)
Definition: SurveyPxbDicer.h:45
SurveyPxbDicer::findParByName::operator()
bool operator()(const std::string &name, const edm::ParameterSet &parset) const
Definition: SurveyPxbDicer.h:70
SurveyPxbDicer::mean_phi
value_t mean_phi
Definition: SurveyPxbDicer.h:50
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SurveyPxbDicer
Definition: SurveyPxbDicer.h:21
SurveyPxbDicer::count_t
unsigned int count_t
Definition: SurveyPxbDicer.h:26
SurveyPxbDicer::findParByName
Function object for searching for a parameter in the VPSet.
Definition: SurveyPxbDicer.h:69
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
timingPdfMaker.outfile
outfile
Definition: timingPdfMaker.py:351
ParameterSet.h
SurveyPxbDicer::sigma_a0
value_t sigma_a0
Definition: SurveyPxbDicer.h:45
SurveyPxbDicer::sigma_scale
value_t sigma_scale
Definition: SurveyPxbDicer.h:49
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:81
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
SurveyPxbDicer::mean_y
value_t mean_y
Definition: SurveyPxbDicer.h:52
SurveyPxbDicer::getParByName
value_t getParByName(const std::string &name, const std::string &par, const std::vector< edm::ParameterSet > &pars)
Definition: SurveyPxbDicer.cc:75
SurveyPxbDicer::value_t
double value_t
Definition: SurveyPxbDicer.h:24