File indexing completed on 2024-04-06 11:56:37
0001 #ifndef PEDESTEERERWEAKMODECONSTRAINTS_H
0002 #define PEDESTEERERWEAKMODECONSTRAINTS_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <list>
0014 #include <vector>
0015 #include <map>
0016 #include <set>
0017 #include <string>
0018
0019 #include <iosfwd>
0020
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 #include "Alignment/CommonAlignment/interface/Utilities.h"
0023 #include "Alignment/MillePedeAlignmentAlgorithm/src/PedeSteerer.h"
0024
0025 #include <DataFormats/GeometryVector/interface/GlobalPoint.h>
0026 #include <CondFormats/Alignment/interface/Definitions.h>
0027
0028 class Alignable;
0029 class PedeLabelerBase;
0030
0031
0032
0033
0034
0035 class GeometryConstraintConfigData {
0036 public:
0037 GeometryConstraintConfigData(const std::vector<double> &co,
0038 const std::string &c,
0039 const std::vector<std::pair<Alignable *, std::string> > &alisFile,
0040 const int sd,
0041 const align::Alignables &ex,
0042 const int instance,
0043 const bool downToLowestLevel);
0044 const std::vector<double> coefficients_;
0045 const std::string constraintName_;
0046 const std::vector<std::pair<Alignable *, std::string> > levelsFilenames_;
0047 const align::Alignables excludedAlignables_;
0048 std::map<std::string, std::ofstream *> mapFileName_;
0049 std::list<std::pair<Alignable *, std::list<Alignable *> > >
0050 HLSsubdets_;
0051 const int sysdeformation_;
0052 const int instance_;
0053 const bool downToLowestLevel_;
0054 };
0055
0056 class PedeSteererWeakModeConstraints {
0057 public:
0058 ~PedeSteererWeakModeConstraints();
0059 PedeSteererWeakModeConstraints(AlignableTracker *aliTracker,
0060 const PedeLabelerBase *labels,
0061 const std::vector<edm::ParameterSet> &config,
0062 std::string sf);
0063
0064
0065
0066 unsigned int constructConstraints(const align::Alignables &);
0067
0068
0069 std::list<GeometryConstraintConfigData> &getConfigData() { return ConstraintsConfigContainer_; }
0070
0071 private:
0072
0073 unsigned int createAlignablesDataStructure();
0074
0075
0076 void writeOutput(const std::list<std::pair<unsigned int, double> > &output,
0077 const GeometryConstraintConfigData &it,
0078 const Alignable *iHLS,
0079 double sum_xi_x0);
0080
0081
0082 std::ofstream *getFile(const GeometryConstraintConfigData &it, const Alignable *iHLS) const;
0083
0084
0085 void closeOutputfiles();
0086
0087
0088 bool checkMother(const Alignable *const lowleveldet, const Alignable *const HLS) const;
0089
0090 std::pair<align::GlobalPoint, align::GlobalPoint> getDoubleSensorPosition(const Alignable *ali) const;
0091
0092 double getPhase(const std::vector<double> &coefficients) const;
0093
0094
0095
0096 double getX(const int sysdeformation, const align::GlobalPoint &pos, const double phase) const;
0097
0098 double getX0(const std::pair<Alignable *, std::list<Alignable *> > &iHLS,
0099 const GeometryConstraintConfigData &it) const;
0100
0101
0102
0103 double getCoefficient(const int sysdeformation,
0104 const align::GlobalPoint &pos,
0105 const GlobalPoint gUDirection,
0106 const GlobalPoint gVDirection,
0107 const GlobalPoint gWDirection,
0108 const int iParameter,
0109 const double &x0,
0110 const std::vector<double> &constraintparameters) const;
0111
0112
0113 bool checkSelectionShiftParameter(const Alignable *ali, unsigned int iParameter) const;
0114
0115
0116 void verifyParameterNames(const edm::ParameterSet &pset, unsigned int psetnr) const;
0117
0118
0119 const std::vector<std::pair<Alignable *, std::string> > makeLevelsFilenames(
0120 std::set<std::string> &steerFilePrefixContainer,
0121 const align::Alignables &alis,
0122 const std::string &steerFilePrefix) const;
0123
0124
0125 int verifyDeformationName(const std::string &name, const std::vector<double> &coefficients) const;
0126
0127
0128 std::list<align::ID> deadmodules_;
0129
0130
0131 std::list<GeometryConstraintConfigData> ConstraintsConfigContainer_;
0132
0133 const PedeLabelerBase *myLabels_;
0134
0135 const std::vector<edm::ParameterSet> myConfig_;
0136
0137 const std::string steerFile_;
0138
0139 const AlignableObjectId alignableObjectId_;
0140
0141 enum SystematicDeformations {
0142 kUnknown = 0,
0143 kTwist,
0144 kZexpansion,
0145 kSagitta,
0146 kRadial,
0147 kTelescope,
0148 kLayerRotation,
0149 kElliptical,
0150 kBowing,
0151 kSkew
0152 };
0153 };
0154
0155 #endif