CMS 3D CMS Logo

MillePedeFileReader.h
Go to the documentation of this file.
1 #ifndef ALIGNMENT_MILLEPEDEALIGNMENTALGORITHM_INTERFACE_MILLEPEDEFILEREADER_H_
2 #define ALIGNMENT_MILLEPEDEALIGNMENTALGORITHM_INTERFACE_MILLEPEDEFILEREADER_H_
3 
4 /*** system includes ***/
5 #include <array>
6 #include <string>
7 #include <iostream>
8 
9 /*** core framework functionality ***/
11 
12 /*** Alignment ***/
15 
17 
18  //========================== PUBLIC METHODS ==================================
19  public: //====================================================================
20 
21  explicit MillePedeFileReader(const edm::ParameterSet&,
22  const std::shared_ptr<const PedeLabelerBase>&,
23  const std::shared_ptr<const AlignPCLThresholds>&);
24 
25  virtual ~MillePedeFileReader() = default;
26 
27  void read();
28  bool storeAlignments();
29 
30  const std::array<double, 6>& getXobs() const { return Xobs_; }
31  const std::array<double, 6>& getXobsErr() const { return XobsErr_; }
32  const std::array<double, 6>& getTXobs() const { return tXobs_; }
33  const std::array<double, 6>& getTXobsErr() const { return tXobsErr_; }
34 
35  const std::array<double, 6>& getYobs() const { return Yobs_; }
36  const std::array<double, 6>& getYobsErr() const { return YobsErr_; }
37  const std::array<double, 6>& getTYobs() const { return tYobs_; }
38  const std::array<double, 6>& getTYobsErr() const { return tYobsErr_; }
39 
40  const std::array<double, 6>& getZobs() const { return Zobs_; }
41  const std::array<double, 6>& getZobsErr() const { return ZobsErr_; }
42  const std::array<double, 6>& getTZobs() const { return tZobs_; }
43  const std::array<double, 6>& getTZobsErr() const { return tZobsErr_; }
44 
45  const AlignPCLThresholds::threshold_map getThresholdMap() const {return theThresholds_.get()->getThreshold_Map (); }
46 
47  private:
48  //========================= PRIVATE ENUMS ====================================
49  //============================================================================
50 
51  enum class PclHLS : int { NotInPCL = -1,
58 
59  //========================= PRIVATE METHODS ==================================
60  //============================================================================
61 
62  void readMillePedeLogFile();
64  PclHLS getHLS(const Alignable*);
66 
67  //========================== PRIVATE DATA ====================================
68  //============================================================================
69 
70  // pede labeler plugin
71  const std::shared_ptr<const PedeLabelerBase> pedeLabeler_;
72 
73  // thresholds from DB
74  const std::shared_ptr<const AlignPCLThresholds> theThresholds_;
75 
76  // file-names
79 
80  // conversion factors: cm to um & rad to urad
81  static constexpr std::array<double, 6> multiplier_ = {{ 10000., // X
82  10000., // Y
83  10000., // Z
84  1000000., // tX
85  1000000., // tY
86  1000000. }}; // tZ
87 
88  bool updateDB_{false};
89  int Nrec_{0};
90 
91  std::array<double, 6> Xobs_ = {{0.,0.,0.,0.,0.,0.}};
92  std::array<double, 6> XobsErr_ = {{0.,0.,0.,0.,0.,0.}};
93  std::array<double, 6> tXobs_ = {{0.,0.,0.,0.,0.,0.}};
94  std::array<double, 6> tXobsErr_ = {{0.,0.,0.,0.,0.,0.}};
95 
96  std::array<double, 6> Yobs_ = {{0.,0.,0.,0.,0.,0.}};
97  std::array<double, 6> YobsErr_ = {{0.,0.,0.,0.,0.,0.}};
98  std::array<double, 6> tYobs_ = {{0.,0.,0.,0.,0.,0.}};
99  std::array<double, 6> tYobsErr_ = {{0.,0.,0.,0.,0.,0.}};
100 
101  std::array<double, 6> Zobs_ = {{0.,0.,0.,0.,0.,0.}};
102  std::array<double, 6> ZobsErr_ = {{0.,0.,0.,0.,0.,0.}};
103  std::array<double, 6> tZobs_ = {{0.,0.,0.,0.,0.,0.}};
104  std::array<double, 6> tZobsErr_ = {{0.,0.,0.,0.,0.,0.}};
105 
106 };
107 
108 const std::array<std::string,8> coord_str = {{"X", "Y", "Z", "theta_X", "theta_Y", "theta_Z", "extra_DOF", "none"}};
109 inline std::ostream & operator<<(std::ostream & os, const AlignPCLThresholds::coordType& c) {
110  if (c >= AlignPCLThresholds::endOfTypes || c < 0) return os << "unrecongnized coordinate";
111  return os << coord_str[c];
112 }
113 
114 #endif /* ALIGNMENT_MILLEPEDEALIGNMENTALGORITHM_INTERFACE_MILLEPEDEFILEREADER_H_ */
std::array< double, 6 > tYobs_
std::array< double, 6 > tXobs_
const std::array< double, 6 > & getTYobs() const
const std::array< double, 6 > & getTZobsErr() const
std::array< double, 6 > YobsErr_
std::ostream & operator<<(std::ostream &os, const AlignPCLThresholds::coordType &c)
PclHLS getHLS(const Alignable *)
virtual ~MillePedeFileReader()=default
const std::array< double, 6 > & getZobs() const
#define constexpr
const std::array< double, 6 > & getTXobs() const
const std::shared_ptr< const AlignPCLThresholds > theThresholds_
std::array< double, 6 > tZobs_
const std::string millePedeLogFile_
std::array< double, 6 > tXobsErr_
const std::array< double, 6 > & getTYobsErr() const
std::array< double, 6 > tYobsErr_
std::array< double, 6 > Yobs_
MillePedeFileReader(const edm::ParameterSet &, const std::shared_ptr< const PedeLabelerBase > &, const std::shared_ptr< const AlignPCLThresholds > &)
std::array< double, 6 > tZobsErr_
const std::array< double, 6 > & getYobs() const
const std::array< double, 6 > & getZobsErr() const
const std::array< double, 6 > & getTXobsErr() const
const std::array< double, 6 > & getXobsErr() const
std::string getStringFromHLS(PclHLS HLS)
const AlignPCLThresholds::threshold_map getThresholdMap() const
const std::string millePedeResFile_
std::array< double, 6 > Zobs_
std::array< double, 6 > Xobs_
std::map< std::string, AlignPCLThreshold > threshold_map
const std::shared_ptr< const PedeLabelerBase > pedeLabeler_
std::array< double, 6 > ZobsErr_
const std::array< double, 6 > & getXobs() const
const std::array< double, 6 > & getYobsErr() const
const std::array< std::string, 8 > coord_str
const std::array< double, 6 > & getTZobs() const
std::array< double, 6 > XobsErr_
static std::array< double, 6 > multiplier_