File indexing completed on 2024-04-06 11:58:32
0001
0002
0003
0004
0005
0006 #ifndef CalibPPS_AlignmentRelative_JanAlignmentAlgorithm_h
0007 #define CalibPPS_AlignmentRelative_JanAlignmentAlgorithm_h
0008
0009 #include "CalibPPS/AlignmentRelative/interface/AlignmentAlgorithm.h"
0010 #include "CalibPPS/AlignmentRelative/interface/SingularMode.h"
0011
0012 #include "TMatrixD.h"
0013 #include "TVectorD.h"
0014 #include "TH1D.h"
0015 #include "TH2D.h"
0016 #include "TGraph.h"
0017
0018 #include <vector>
0019 #include <map>
0020 #include <string>
0021
0022
0023
0024
0025 class JanAlignmentAlgorithm : public AlignmentAlgorithm {
0026 public:
0027
0028 struct ScatterPlot {
0029 TGraph *g;
0030 TH2D *h;
0031 };
0032
0033
0034 struct DetStat {
0035 TH1D *m_dist;
0036 TH1D *R_dist;
0037 std::vector<TH1D *> coefHist;
0038 std::vector<TGraph *> resVsCoef;
0039 std::map<std::set<unsigned int>, ScatterPlot> resVsCoefRot_perRPSet;
0040 };
0041
0042 private:
0043
0044
0045 TMatrixD **Sc;
0046
0047
0048
0049 TVectorD *Mc;
0050
0051
0052 TMatrixD S;
0053
0054
0055 TVectorD M;
0056
0057
0058 TVectorD S_eigVal;
0059
0060
0061 TMatrixD S_eigVec;
0062
0063
0064 std::vector<SingularMode> singularModes;
0065
0066
0067 bool stopOnSingularModes;
0068
0069
0070 double weakLimit;
0071
0072
0073 unsigned int events;
0074
0075
0076 std::map<unsigned int, DetStat> statistics;
0077
0078
0079 bool buildDiagnosticPlots;
0080
0081 public:
0082
0083 JanAlignmentAlgorithm() {}
0084
0085
0086 JanAlignmentAlgorithm(const edm::ParameterSet &ps, AlignmentTask *_t);
0087
0088 ~JanAlignmentAlgorithm() override;
0089
0090 std::string getName() override { return "Jan"; }
0091
0092 bool hasErrorEstimate() override { return true; }
0093
0094 void begin(const CTPPSGeometry *geometryReal, const CTPPSGeometry *geometryMisaligned) override;
0095
0096 void feed(const HitCollection &, const LocalTrackFit &) override;
0097
0098 void saveDiagnostics(TDirectory *) override;
0099
0100 void analyze() override;
0101
0102 unsigned int solve(const std::vector<AlignmentConstraint> &,
0103 std::map<unsigned int, AlignmentResult> &results,
0104 TDirectory *dir) override;
0105
0106 void end() override;
0107 };
0108
0109 #endif