File indexing completed on 2024-09-07 04:34:42
0001 #ifndef GUARD_surveypxbdicer_h
0002 #define GUARD_surveypxbdicer_h
0003
0004 #include <vector>
0005 #include <functional>
0006 #include <utility>
0007 #include <fstream>
0008 #include "DataFormats/GeometryVector/interface/Point3DBase.h"
0009 #include "Alignment/SurveyAnalysis/interface/SurveyPxbImage.h"
0010 #include "Math/SMatrix.h"
0011 #include "Math/SVector.h"
0012 #include "CLHEP/Random/RandGauss.h"
0013 #include "CLHEP/Random/Random.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015
0016 #include <iostream>
0017 #include <stdexcept>
0018
0019
0020
0021 class SurveyPxbDicer {
0022 public:
0023 typedef SurveyPxbImage::coord_t coord_t;
0024 typedef double value_t;
0025 typedef std::vector<coord_t> fidpoint_t;
0026 typedef unsigned int count_t;
0027 typedef SurveyPxbImage::id_t id_t;
0028 typedef std::pair<id_t, id_t> idPair_t;
0029
0030
0031 SurveyPxbDicer() {}
0032
0033 SurveyPxbDicer(const std::vector<edm::ParameterSet> &pars, unsigned int seed);
0034
0035
0036
0037
0038 std::string doDice(const fidpoint_t &fidpointvec, const idPair_t &id, const bool rotate = false);
0039 void doDice(const fidpoint_t &fidpointvec, const idPair_t &id, std::ofstream &outfile, const bool rotate = false);
0040
0041 private:
0042
0043
0044
0045 value_t ranGauss(value_t mean, value_t sigma) { return CLHEP::RandGauss::shoot(mean, sigma); };
0046
0047 value_t mean_a0, sigma_a0;
0048 value_t mean_a1, sigma_a1;
0049 value_t mean_scale, sigma_scale;
0050 value_t mean_phi, sigma_phi;
0051 value_t mean_x, sigma_x;
0052 value_t mean_y, sigma_y;
0053
0054
0055
0056
0057
0058 value_t getParByName(const std::string &name, const std::string &par, const std::vector<edm::ParameterSet> &pars);
0059
0060
0061
0062
0063
0064
0065
0066 coord_t transform(const coord_t &x, const value_t &a0, const value_t &a1, const value_t &a2, const value_t &a3);
0067
0068
0069 struct findParByName {
0070 bool operator()(const std::string &name, const edm::ParameterSet &parset) const {
0071 return (parset.getParameter<std::string>("name") == name);
0072 }
0073 };
0074 };
0075
0076 #endif