CMS 3D CMS Logo

JanAlignmentAlgorithm.h
Go to the documentation of this file.
1 /****************************************************************************
2 * Authors:
3 * Jan Kašpar (jan.kaspar@gmail.com)
4 ****************************************************************************/
5 
6 #ifndef CalibPPS_AlignmentRelative_JanAlignmentAlgorithm_h
7 #define CalibPPS_AlignmentRelative_JanAlignmentAlgorithm_h
8 
11 
12 #include "TMatrixD.h"
13 #include "TVectorD.h"
14 #include "TH1D.h"
15 #include "TH2D.h"
16 #include "TGraph.h"
17 
18 #include <vector>
19 #include <map>
20 #include <string>
21 
26 public:
28  struct ScatterPlot {
29  TGraph *g;
30  TH2D *h;
31  };
32 
34  struct DetStat {
35  TH1D *m_dist;
36  TH1D *R_dist;
37  std::vector<TH1D *> coefHist;
38  std::vector<TGraph *> resVsCoef;
39  std::map<std::set<unsigned int>, ScatterPlot> resVsCoefRot_perRPSet;
40  };
41 
42 private:
45  TMatrixD **Sc;
46 
49  TVectorD *Mc;
50 
52  TMatrixD S;
53 
55  TVectorD M;
56 
58  TVectorD S_eigVal;
59 
61  TMatrixD S_eigVec;
62 
64  std::vector<SingularMode> singularModes;
65 
68 
70  double weakLimit;
71 
73  unsigned int events;
74 
76  std::map<unsigned int, DetStat> statistics;
77 
80 
81 public:
84 
87 
88  ~JanAlignmentAlgorithm() override;
89 
90  std::string getName() override { return "Jan"; }
91 
92  bool hasErrorEstimate() override { return true; }
93 
94  void begin(const CTPPSGeometry *geometryReal, const CTPPSGeometry *geometryMisaligned) override;
95 
96  void feed(const HitCollection &, const LocalTrackFit &) override;
97 
98  void saveDiagnostics(TDirectory *) override;
99 
100  void analyze() override;
101 
102  unsigned int solve(const std::vector<AlignmentConstraint> &,
103  std::map<unsigned int, AlignmentResult> &results,
104  TDirectory *dir) override;
105 
106  void end() override;
107 };
108 
109 #endif
JanAlignmentAlgorithm::getName
std::string getName() override
Definition: JanAlignmentAlgorithm.h:92
JanAlignmentAlgorithm::JanAlignmentAlgorithm
JanAlignmentAlgorithm()
dummy constructor (not to be used)
Definition: JanAlignmentAlgorithm.h:85
CTPPSGeometry
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:29
AlignmentTask
Represents an alignment task.
Definition: AlignmentTask.h:19
JanAlignmentAlgorithm::feed
void feed(const HitCollection &, const LocalTrackFit &) override
process one track
Definition: JanAlignmentAlgorithm.cc:92
JanAlignmentAlgorithm::analyze
void analyze() override
analyzes the data collected
Definition: JanAlignmentAlgorithm.cc:267
JanAlignmentAlgorithm::~JanAlignmentAlgorithm
~JanAlignmentAlgorithm() override
Definition: JanAlignmentAlgorithm.cc:37
bookConverter.results
results
Definition: bookConverter.py:144
JanAlignmentAlgorithm::begin
void begin(const CTPPSGeometry *geometryReal, const CTPPSGeometry *geometryMisaligned) override
prepare for processing
Definition: JanAlignmentAlgorithm.cc:41
JanAlignmentAlgorithm::DetStat::resVsCoef
std::vector< TGraph * > resVsCoef
Definition: JanAlignmentAlgorithm.h:40
JanAlignmentAlgorithm::events
unsigned int events
event count
Definition: JanAlignmentAlgorithm.h:75
JanAlignmentAlgorithm::S_eigVec
TMatrixD S_eigVec
matrix of S eigenvectors
Definition: JanAlignmentAlgorithm.h:63
JanAlignmentAlgorithm::DetStat::R_dist
TH1D * R_dist
Definition: JanAlignmentAlgorithm.h:38
JanAlignmentAlgorithm::Mc
TVectorD * Mc
Definition: JanAlignmentAlgorithm.h:51
JanAlignmentAlgorithm::solve
unsigned int solve(const std::vector< AlignmentConstraint > &, std::map< unsigned int, AlignmentResult > &results, TDirectory *dir) override
Definition: JanAlignmentAlgorithm.cc:380
JanAlignmentAlgorithm::weakLimit
double weakLimit
normalized eigen value below which the (CS) eigen vectors are considered as weak
Definition: JanAlignmentAlgorithm.h:72
AlignmentAlgorithm
Abstract parent for all (track-based) alignment algorithms.
Definition: AlignmentAlgorithm.h:31
JanAlignmentAlgorithm::DetStat::coefHist
std::vector< TH1D * > coefHist
Definition: JanAlignmentAlgorithm.h:39
JanAlignmentAlgorithm
Jan's alignment algorithm.
Definition: JanAlignmentAlgorithm.h:25
JanAlignmentAlgorithm::ScatterPlot
a scatter plot, with graph and histogram representations
Definition: JanAlignmentAlgorithm.h:30
JanAlignmentAlgorithm::stopOnSingularModes
bool stopOnSingularModes
whether to stop when singular modes are identified
Definition: JanAlignmentAlgorithm.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
JanAlignmentAlgorithm::DetStat
structure holding statistical information for one detector
Definition: JanAlignmentAlgorithm.h:36
edm::ParameterSet
Definition: ParameterSet.h:47
JanAlignmentAlgorithm::ScatterPlot::h
TH2D * h
Definition: JanAlignmentAlgorithm.h:34
JanAlignmentAlgorithm::Sc
TMatrixD ** Sc
Definition: JanAlignmentAlgorithm.h:47
JanAlignmentAlgorithm::DetStat::m_dist
TH1D * m_dist
Definition: JanAlignmentAlgorithm.h:37
JanAlignmentAlgorithm::DetStat::resVsCoefRot_perRPSet
std::map< std::set< unsigned int >, ScatterPlot > resVsCoefRot_perRPSet
Definition: JanAlignmentAlgorithm.h:41
JanAlignmentAlgorithm::S_eigVal
TVectorD S_eigVal
eigen values of the S matrix
Definition: JanAlignmentAlgorithm.h:60
JanAlignmentAlgorithm::statistics
std::map< unsigned int, DetStat > statistics
statistical data collection
Definition: JanAlignmentAlgorithm.h:78
AlignmentAlgorithm.h
HitCollection
std::vector< Hit > HitCollection
Definition: HitCollection.h:34
LocalTrackFit
Local (linear) track description (or a fit result). Uses global reference system.
Definition: LocalTrackFit.h:14
JanAlignmentAlgorithm::S
TMatrixD S
final S matrix
Definition: JanAlignmentAlgorithm.h:54
JanAlignmentAlgorithm::end
void end() override
cleans up after processing
Definition: JanAlignmentAlgorithm.cc:706
JanAlignmentAlgorithm::buildDiagnosticPlots
bool buildDiagnosticPlots
flag whether to build statistical plots
Definition: JanAlignmentAlgorithm.h:81
JanAlignmentAlgorithm::saveDiagnostics
void saveDiagnostics(TDirectory *) override
saves diagnostic histograms/plots
Definition: JanAlignmentAlgorithm.cc:717
JanAlignmentAlgorithm::hasErrorEstimate
bool hasErrorEstimate() override
returns whether this algorithm is capable of estimating result uncertainties
Definition: JanAlignmentAlgorithm.h:94
JanAlignmentAlgorithm::singularModes
std::vector< SingularMode > singularModes
a list of the singular modes of the S matrix
Definition: JanAlignmentAlgorithm.h:66
JanAlignmentAlgorithm::M
TVectorD M
final M vector
Definition: JanAlignmentAlgorithm.h:57
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
SingularMode.h
JanAlignmentAlgorithm::ScatterPlot::g
TGraph * g
Definition: JanAlignmentAlgorithm.h:33