Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-08 23:57:42

0001 /****************************************************************************

0002  *

0003  *  This class is obsolete! Use PPSAlignmentConfiguration instead.

0004  *

0005  *  Authors:

0006  *  - Jan Kašpar

0007  *  - Mateusz Kocot

0008  *

0009  ****************************************************************************/
0010 
0011 #ifndef CondFormats_PPSObjects_PPSAlignmentConfig_h
0012 #define CondFormats_PPSObjects_PPSAlignmentConfig_h
0013 
0014 #include "CondFormats/Serialization/interface/Serializable.h"
0015 
0016 #include <vector>
0017 #include <string>
0018 #include <map>
0019 
0020 //---------------------------------------------------------------------------------------------

0021 
0022 struct PointErrors {
0023   double x_;
0024   double y_;
0025   double ex_;  // error x

0026   double ey_;  // error y

0027 
0028   COND_SERIALIZABLE;
0029 };
0030 
0031 //---------------------------------------------------------------------------------------------

0032 
0033 struct SelectionRange {
0034   double x_min_;
0035   double x_max_;
0036 
0037   COND_SERIALIZABLE;
0038 };
0039 
0040 //---------------------------------------------------------------------------------------------

0041 
0042 struct RPConfig {
0043   std::string name_;
0044   unsigned int id_;
0045   std::string position_;
0046   double slope_;
0047   double sh_x_;
0048 
0049   double x_min_fit_mode_, x_max_fit_mode_;
0050   double y_max_fit_mode_;
0051   double y_cen_add_;
0052   double y_width_mult_;
0053 
0054   int x_slice_n_;
0055   double x_slice_min_, x_slice_w_;
0056 
0057   COND_SERIALIZABLE;
0058 };
0059 std::ostream &operator<<(std::ostream &os, RPConfig &rc);
0060 
0061 //---------------------------------------------------------------------------------------------

0062 
0063 struct SectorConfig {
0064   std::string name_;
0065   RPConfig rp_N_, rp_F_;
0066   double slope_;
0067 
0068   bool cut_h_apply_;
0069   double cut_h_a_, cut_h_c_, cut_h_si_;
0070 
0071   bool cut_v_apply_;
0072   double cut_v_a_, cut_v_c_, cut_v_si_;
0073 
0074   COND_SERIALIZABLE;
0075 };
0076 std::ostream &operator<<(std::ostream &os, SectorConfig &sc);
0077 
0078 //---------------------------------------------------------------------------------------------

0079 
0080 struct Binning {
0081   double bin_size_x_;  // mm

0082   unsigned int n_bins_x_;
0083 
0084   double pixel_x_offset_;
0085 
0086   unsigned int n_bins_y_;
0087   double y_min_, y_max_;
0088 
0089   COND_SERIALIZABLE;
0090 };
0091 std::ostream &operator<<(std::ostream &os, Binning &b);
0092 
0093 //---------------------------------------------------------------------------------------------

0094 
0095 class PPSAlignmentConfig {
0096 public:
0097   // Getters

0098   const std::vector<std::string> &sequence() const;
0099   const std::string &resultsDir() const;
0100 
0101   const SectorConfig &sectorConfig45() const;
0102   const SectorConfig &sectorConfig56() const;
0103 
0104   double x_ali_sh_step() const;
0105 
0106   double y_mode_sys_unc() const;
0107   double chiSqThreshold() const;
0108   double y_mode_unc_max_valid() const;
0109   double y_mode_max_valid() const;
0110 
0111   double maxRPTracksSize() const;
0112   double n_si() const;
0113 
0114   const std::map<unsigned int, std::vector<PointErrors>> &matchingReferencePoints() const;
0115   const std::map<unsigned int, SelectionRange> &matchingShiftRanges() const;
0116 
0117   const std::map<unsigned int, SelectionRange> &alignment_x_meth_o_ranges() const;
0118   unsigned int fitProfileMinBinEntries() const;
0119   unsigned int fitProfileMinNReasonable() const;
0120   unsigned int methOGraphMinN() const;
0121   double methOUncFitRange() const;
0122 
0123   const std::map<unsigned int, SelectionRange> &alignment_x_relative_ranges() const;
0124   unsigned int nearFarMinEntries() const;
0125 
0126   const std::map<unsigned int, SelectionRange> &alignment_y_ranges() const;
0127   unsigned int modeGraphMinN() const;
0128   unsigned int multSelProjYMinEntries() const;
0129 
0130   const Binning &binning() const;
0131 
0132   // Setters

0133   void setSequence(std::vector<std::string> &sequence);
0134   void setResultsDir(std::string &resultsDir);
0135 
0136   void setSectorConfig45(SectorConfig &sectorConfig45);
0137   void setSectorConfig56(SectorConfig &sectorConfig56);
0138 
0139   void setX_ali_sh_step(double x_ali_sh_step);
0140 
0141   void setY_mode_sys_unc(double y_mode_sys_unc);
0142   void setChiSqThreshold(double chiSqThreshold);
0143   void setY_mode_unc_max_valid(double y_mode_unc_max_valid);
0144   void setY_mode_max_valid(double y_mode_max_valid);
0145 
0146   void setMaxRPTracksSize(unsigned int maxRPTracksSize);
0147   void setN_si(double n_si);
0148 
0149   void setMatchingReferencePoints(std::map<unsigned int, std::vector<PointErrors>> &matchingReferencePoints);
0150   void setMatchingShiftRanges(std::map<unsigned int, SelectionRange> &matchingShiftRanges);
0151 
0152   void setAlignment_x_meth_o_ranges(std::map<unsigned int, SelectionRange> &alignment_x_meth_o_ranges);
0153   void setFitProfileMinBinEntries(unsigned int fitProfileMinBinEntries);
0154   void setFitProfileMinNReasonable(unsigned int fitProfileMinNReasonable);
0155   void setMethOGraphMinN(unsigned int methOGraphMinN);
0156   void setMethOUncFitRange(double methOUncFitRange);
0157 
0158   void setAlignment_x_relative_ranges(std::map<unsigned int, SelectionRange> &alignment_x_relative_ranges);
0159   void setNearFarMinEntries(unsigned int nearFarMinEntries);
0160 
0161   void setAlignment_y_ranges(std::map<unsigned int, SelectionRange> &alignment_y_ranges);
0162   void setModeGraphMinN(unsigned int modeGraphMinN);
0163   void setMultSelProjYMinEntries(unsigned int multSelProjYMinEntries);
0164 
0165   void setBinning(Binning &binning);
0166 
0167   // << operator

0168   friend std::ostream &operator<<(std::ostream &os, PPSAlignmentConfig c);
0169 
0170 private:
0171   std::vector<std::string> sequence_;
0172   std::string resultsDir_;
0173 
0174   SectorConfig sectorConfig45_, sectorConfig56_;
0175 
0176   double x_ali_sh_step_;  // mm

0177 
0178   double y_mode_sys_unc_;
0179   double chiSqThreshold_;
0180   double y_mode_unc_max_valid_;
0181   double y_mode_max_valid_;
0182 
0183   unsigned int maxRPTracksSize_;
0184   double n_si_;
0185 
0186   std::map<unsigned int, std::vector<PointErrors>> matchingReferencePoints_;
0187   std::map<unsigned int, SelectionRange> matchingShiftRanges_;
0188 
0189   std::map<unsigned int, SelectionRange> alignment_x_meth_o_ranges_;
0190   unsigned int fitProfileMinBinEntries_;
0191   unsigned int fitProfileMinNReasonable_;
0192   unsigned int methOGraphMinN_;
0193   double methOUncFitRange_;  // mm

0194 
0195   std::map<unsigned int, SelectionRange> alignment_x_relative_ranges_;
0196   unsigned int nearFarMinEntries_;
0197 
0198   std::map<unsigned int, SelectionRange> alignment_y_ranges_;
0199   unsigned int modeGraphMinN_;
0200   unsigned int multSelProjYMinEntries_;
0201 
0202   Binning binning_;
0203 
0204   COND_SERIALIZABLE;
0205 };
0206 
0207 std::ostream &operator<<(std::ostream &os, PPSAlignmentConfig c);
0208 
0209 #endif