BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Alignment.h
Go to the documentation of this file.
1#ifndef ALIGNMENT_H
2#define ALIGNMENT_H
3
4#include <string>
5#include <vector>
6
7namespace Alignment {
8
9 /* exterior product */
10 void expd( double veca[3], double vecb[3], double val[3] );
11
12 /* distance of two lines */
13 int dist2Line( double sta[3], double stb[3], double veca[3], double vecb[3], double& d,
14 double& za, double& zb, int fgZcal = 1 );
15
16 /* doca of straight track and wire(line) */
17 double docaLineWire( double trkpar[], double wirest[], double wirev[], double& zwire,
18 int fgZcal = 1 );
19
20 /* doca of helix track and wire(line) */
21 double docaHelixWireNewton( double trkpar[], double wirest[], double wirev[], double& zwire,
22 double zini );
23 double docaHelixWire( double trkpar[], double wirest[], double wirev[], double& zwire,
24 double zini );
25
26 bool getDoca( double trkpar[], double wpos[], double& doca, double whitPos[], double zini );
27 double getPhiIni( double trkpar[], double rLayer, double pos[] );
28
29 int getEpId( int lay, int iEnd ); /* get index of the endplate */
30
31 /* global variables */
32 extern bool gFlagMag; /* w/o magnetic field */
33
34 /* number of iteration in doca calculation */
35 extern int gNiter;
36
37 const double CC = 2.99792458E10; // cm/sec, light velocity
38 const double PI = 3.141592653;
39 const double PI2 = 6.283185307;
40 const double HFPI = 1.570796327;
41
42 const int WIRENMAX = 6796;
43 const int LAYERNMAX = 43;
44 const int CELLNMAX = 288;
45 const int INNERNMAX = 8;
46 const int NEP = 16; /* number of endplates */
47 const int NTRKPAR = 5; /* number of track parameters */
48 const int NTRKPARALL = 10; /* number of track parameters and errors */
49
50 const double BFIELD = 1.0; /* Tesla */
51
52 /* the following definition is for Millepede */
53
54 const std::string MSG_DEBUG( "DEBUG: " );
55 const std::string MSG_INFO( "INFO: " );
56 const std::string MSG_WARNING( "WARNING: " );
57 const std::string MSG_ERROR( "ERROR: " );
58 const std::string MSG_FATAL( "FATAL: " );
59
60 const int NDOFALIGN = 3; /* dx, dy, rz */
61 /* const int NDOFALIGN = 2; /\* dx, rz *\/ */
62
63 /* the following 4 statements are moved from Millepede.h by wulh on 06/08/29 */
64 const bool m_iteration = true;
65 const bool debug_mode = false; // More printouts
66 const bool verbose_mode = false; // Definitely more printouts (matrices,...)
67 const bool verbose_reject = false; /* added by wulh on 06/08/28 */
68
69 const bool g_dofs[3] = { 1, 1,
70 1 }; // Degrees of freedom to take into account (Boolean version)
71 /* const bool g_dofs[] = {1, 1}; // Degrees of freedom to take into account (Boolean
72 * version) */
73
74 // Individual constraint on alignment constants (set via ParSig in Millepede)
75
76 /* const double g_Sigm[3] = {0.1, 0.1, 0.25}; /\* for dx, dy, rz *\/ */
77 const double g_Sigm[3] = { 0.1, 0.01, 0.05 }; /* for dx, dy, rz */
78 /* const double g_Sigm[] = {0.1, 0.25}; /\* for dx, rz *\/ */
79
80 // Cuts on residuals (when fitting the tracks) (in mm)
81 // !!! Adapt them to your situation !!!
82
83 const double g_res_cut = 1.2;
84 const double g_res_cut_init = 3.; // Larger for the first iteration (you are misaligned !!!)
85 const double g_start_chi_cut = 100.;
86
87 const int gNsamLC = 100;
88 const int gNsamGB = 100;
89 /* const double gStepLC[5] = {0.00001, 0.000001, 0.00001, 0.0001, 0.00001}; /\*
90 * units of dr&dz are cm *\/ */
91 const double gStepLC[5] = { 0.001, 0.001, 0.00001, 0.0001,
92 0.0001 }; /* units of dr&dz are cm */
93 const double gStepGB[48] = {
94 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, /* dx */
95 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
96 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, /* dy */
97 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
98 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, /*rz, mrad*/
99 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001 };
100
101 /* const double gStepGB[32] = {0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
102 * 0.0001, /\* dx *\/ */
103 /* 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
104 */
105 /* 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, /\* rz
106 * *\/ */
107 /* 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001}; */
108
109 /* const int gNsamLC = 50; */
110 /* const int gNsamGB = 50; */
111 /* const double gStepLC[5] = {0.00002, 0.000002, 0.00002, 0.0002, 0.00002}; /\*
112 * units of dr&dz are cm *\/ */
113 /* const double gStepGB[48] = {0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002,
114 * 0.0002, /\* dx *\/ */
115 /* 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002,
116 */
117 /* 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002,
118 * /\* dy *\/ */
119 /* 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002,
120 */
121 /* 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002,
122 * 0.000002, 0.000002, /\* rz *\/ */
123 /* 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002,
124 * 0.000002, 0.000002}; */
125
126} // namespace Alignment
127
128#endif /* ALIGNMENT_H */
bool getDoca(double trkpar[], double wpos[], double &doca, double whitPos[], double zini)
const bool verbose_reject
Definition Alignment.h:67
const std::string MSG_FATAL("FATAL: ")
const double PI2
Definition Alignment.h:39
const double g_res_cut_init
Definition Alignment.h:84
const std::string MSG_DEBUG("DEBUG: ")
const bool verbose_mode
Definition Alignment.h:66
const int gNsamGB
Definition Alignment.h:88
const int CELLNMAX
Definition Alignment.h:44
const int INNERNMAX
Definition Alignment.h:45
const bool debug_mode
Definition Alignment.h:65
const int LAYERNMAX
Definition Alignment.h:43
const double BFIELD
Definition Alignment.h:50
const double gStepGB[48]
Definition Alignment.h:93
const int NEP
Definition Alignment.h:46
int dist2Line(double sta[3], double stb[3], double veca[3], double vecb[3], double &d, double &za, double &zb, int fgZcal=1)
Definition Alignment.cxx:41
const int NTRKPAR
Definition Alignment.h:47
const bool m_iteration
Definition Alignment.h:64
const double gStepLC[5]
Definition Alignment.h:91
double docaHelixWire(double trkpar[], double wirest[], double wirev[], double &zwire, double zini)
const std::string MSG_INFO("INFO: ")
const double HFPI
Definition Alignment.h:40
int getEpId(int lay, int iEnd)
Definition Alignment.cxx:18
double docaHelixWireNewton(double trkpar[], double wirest[], double wirev[], double &zwire, double zini)
double docaLineWire(double trkpar[], double wirest[], double wirev[], double &zwire, int fgZcal=1)
const int NTRKPARALL
Definition Alignment.h:48
const double g_res_cut
Definition Alignment.h:83
double getPhiIni(double trkpar[], double rLayer, double pos[])
const int gNsamLC
Definition Alignment.h:87
bool gFlagMag
Definition Alignment.cxx:15
void expd(double veca[3], double vecb[3], double val[3])
Definition Alignment.cxx:35
const int NDOFALIGN
Definition Alignment.h:60
const double PI
Definition Alignment.h:38
const std::string MSG_ERROR("ERROR: ")
const double g_Sigm[3]
Definition Alignment.h:77
const bool g_dofs[3]
Definition Alignment.h:69
const std::string MSG_WARNING("WARNING: ")
const int WIRENMAX
Definition Alignment.h:42
const double CC
Definition Alignment.h:37
const double g_start_chi_cut
Definition Alignment.h:85