FairRoot/PandaRoot
SensorAligner.h
Go to the documentation of this file.
1 /*
2  * SensorAligner.h
3  *
4  * Created on: Jul 29, 2013
5  * Author: roman
6  *
7  * This object is responsible for the actual alignment determination.
8  * That means, this object needs to know which CVD it is supposed to handle, and
9  * then collects all pair files neccesary (it must get exactly 9 pair files).
10  * It is responsible for the actual alignment stage, so sorting, filtering
11  * etc of the root file must occur earlier. This object needs refined pair files!
12  *
13  * After alignment is done, it writes the transformation matrices, makes error
14  * estimation based on bootstrapped pair bunches (see below) and writes a complete
15  * log of the alignment procedure for this specific CVD. That log will contain
16  * the number of iterations for each overlapping area, the bootstrap error for
17  * each overlapping area and maybe time needed.
18  *
19  * Error determination by bootstapping: collect HitPairs at random from pool and
20  * into bunches, make ICP determination for every bunch (at leat 100 times, maybe more),
21  * and calculate dx, dy and dR with sigmas for every overlapping area. This provides
22  * error for overlapping areas only! Error for calculated matrices must come from
23  * gaussian error calculation. This will come later.
24  *
25  * Reminder: the notation frontSensorID to BackSensorID is local only! Real
26  * position comes from information of half, plane, cvd!
27  *
28  */
29 
30 #ifndef SensorAligner_H_
31 #define SensorAligner_H_
32 
33 /*
34  * The class that does all the actual work. It reads hit pairs from pair files and alignes every sensor module using these pair files.
35  * Normal mode: create SensorAligner, collect files from directory, align and write Matrices to Disk.
36  * Single mode: set to single mode and load one pair file, align only this one area.
37  *
38  * getPairs: after pair files are read from disk, this method gets a pointer to that boost vector of hit pairs.
39  * beware: sensor aligner deletes this vector, if deleteOnDestruction is true (default).
40  * setPairs: provide Sensor aligner with vector of pairs that you got elsewhere. useful for RMS rounds.
41  * beware: you must provide all nine pair vectors and set dataReady to true manually, or sensor aligner will
42  * not work at all.
43  */
44 
45 #include <TROOT.h>
46 #include <matrix.h>
47 #include <PndLmdDim.h>
48 #include <PndLmdHitPair.h>
49 
50 #include <vector>
51 
53 private:
55 
56  //center of pixel correction matrices
61 
62 public:
63 
64  //ClassDef(SensorAligner, 1);
65  SensorAligner();
67  virtual ~SensorAligner();
68 
69  //quick and dirty! supply nice hit pairs!
70  Matrix getMatrixFromHitPairs(vector<PndLmdHitPair> &pairs);
71 
72  Matrix getIdealMatrixOfficialGeometry(Int_t fromSensor, Int_t toSensor, bool misaligned=false);
73 
74  void demoICP();
75 
76 };
77 
78 #endif /* SensorAligner_H_ */
Matrix matrixactiveEdgeToCenter
Definition: SensorAligner.h:58
Matrix matrixpixelEdgeToCenter
Definition: SensorAligner.h:57
Matrix getMatrixFromHitPairs(vector< PndLmdHitPair > &pairs)
Matrix newSensorInCmToPixels
Definition: SensorAligner.h:60
virtual ~SensorAligner()
Matrix newPixelsToSensorInCm
Definition: SensorAligner.h:60
Matrix getIdealMatrixOfficialGeometry(Int_t fromSensor, Int_t toSensor, bool misaligned=false)
Definition: matrix.h:50
PndLmdDim * dimension
Definition: SensorAligner.h:54
Matrix matrixscaleActiveToSensor
Definition: SensorAligner.h:59