CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Alignment/SurveyAnalysis/interface/SurveyPxbDicer.h

Go to the documentation of this file.
00001 #ifndef GUARD_surveypxbdicer_h
00002 #define GUARD_surveypxbdicer_h
00003 
00004 #include <vector>
00005 #include <functional>
00006 #include <utility>
00007 #include <fstream>
00008 #include "DataFormats/GeometryVector/interface/Point3DBase.h"
00009 #include "Alignment/SurveyAnalysis/interface/SurveyPxbImage.h"
00010 #include "Math/SMatrix.h"
00011 #include "Math/SVector.h"
00012 #include <CLHEP/Random/RandGauss.h>
00013 #include <CLHEP/Random/Random.h>
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 
00016 #include <iostream>
00017 #include <stdexcept>
00018 
00021 class SurveyPxbDicer
00022 {
00023 public:
00024         typedef SurveyPxbImage::coord_t coord_t;
00025         typedef double value_t;
00026         typedef std::vector<coord_t> fidpoint_t;
00027         typedef unsigned int count_t;
00028         typedef SurveyPxbImage::id_t id_t;
00029         typedef std::pair<id_t,id_t> idPair_t;
00030 
00031         // Constructors
00032         SurveyPxbDicer() {};
00033         // Constructor from VPSet
00034         SurveyPxbDicer(std::vector<edm::ParameterSet> pars, unsigned int seed);
00035 
00039         std::string doDice(const fidpoint_t &fidpointvec, const idPair_t &id, const bool rotate=false);
00040         void doDice(const fidpoint_t &fidpointvec, const idPair_t &id, std::ofstream &outfile, const bool rotate=false);
00041 
00042 private:
00046         value_t ranGauss(value_t mean, value_t sigma) {return CLHEP::RandGauss::shoot(mean,sigma);};
00047 
00048         value_t mean_a0, sigma_a0;
00049         value_t mean_a1, sigma_a1;
00050         value_t mean_scale, sigma_scale;
00051         value_t mean_phi, sigma_phi;
00052         value_t mean_x, sigma_x;
00053         value_t mean_y, sigma_y;
00054 
00059         value_t getParByName(const std::string &name, const std::string &par, const std::vector<edm::ParameterSet>& pars);
00060 
00067         coord_t transform(const coord_t &x, const value_t &a0, const value_t &a1, const value_t &a2, const value_t &a3);
00068 
00070         struct findParByName: public std::binary_function< std::string, edm::ParameterSet, bool >
00071         {
00072                 bool operator () ( const std::string &name, const edm::ParameterSet &parset )
00073                         const { return (parset.getParameter<std::string>("name") == name);}
00074         };
00075 
00076 };
00077 
00078 #endif
00079