BOSS 7.0.8
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],
14 double vecb[3],double &d, double &za, double &zb, int fgZcal = 1);
15
16 /* doca of straight track and wire(line) */
17 double docaLineWire(double trkpar[], double wirest[],
18 double wirev[], double &zwire, int fgZcal = 1);
19
20 /* doca of helix track and wire(line) */
21 double docaHelixWireNewton(double trkpar[], double wirest[],
22 double wirev[], double &zwire, double zini);
23 double docaHelixWire(double trkpar[], double wirest[],
24 double wirev[], double &zwire, double zini);
25
26 bool getDoca(double trkpar[], double wpos[], double &doca,
27 double whitPos[], double zini);
28 double getPhiIni(double trkpar[], double rLayer, double pos[]);
29
30 int getEpId(int lay, int iEnd); /* get index of the endplate */
31
32
33 /* global variables */
34 extern bool gFlagMag; /* w/o magnetic field */
35
36 /* number of iteration in doca calculation */
37 extern int gNiter;
38
39 const double CC = 2.99792458E10; // cm/sec, light velocity
40 const double PI = 3.141592653;
41 const double PI2 = 6.283185307;
42 const double HFPI = 1.570796327;
43
44 const int WIRENMAX = 6796;
45 const int LAYERNMAX = 43;
46 const int CELLNMAX = 288;
47 const int INNERNMAX = 8;
48 const int NEP = 16; /* number of endplates */
49 const int NTRKPAR = 5; /* number of track parameters */
50 const int NTRKPARALL = 10; /* number of track parameters and errors */
51
52 const double BFIELD = 1.0; /* Tesla */
53
54 /* the following definition is for Millepede */
55
56 const std::string MSG_DEBUG("DEBUG: ");
57 const std::string MSG_INFO("INFO: ");
58 const std::string MSG_WARNING("WARNING: ");
59 const std::string MSG_ERROR("ERROR: ");
60 const std::string MSG_FATAL("FATAL: ");
61
62 const int NDOFALIGN = 3; /* dx, dy, rz */
63 /* const int NDOFALIGN = 2; /\* dx, rz *\/ */
64
65 /* the following 4 statements are moved from Millepede.h by wulh on 06/08/29 */
66 const bool m_iteration = true;
67 const bool debug_mode = false; // More printouts
68 const bool verbose_mode = false; // Definitely more printouts (matrices,...)
69 const bool verbose_reject = false; /* added by wulh on 06/08/28 */
70
71 const bool g_dofs[3] = {1, 1, 1}; // Degrees of freedom to take into account (Boolean version)
72 /* const bool g_dofs[] = {1, 1}; // Degrees of freedom to take into account (Boolean 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}; /\* units of dr&dz are cm *\/ */
90 const double gStepLC[5] = {0.001, 0.001, 0.00001, 0.0001, 0.0001}; /* units of dr&dz are cm */
91 const double gStepGB[48] = {0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, /* dx */
92 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
93 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, /* dy */
94 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
95 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, /*rz, mrad*/
96 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001};
97
98/* const double gStepGB[32] = {0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, /\* dx *\/ */
99/* 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, */
100/* 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, /\* rz *\/ */
101/* 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001}; */
102
103/* const int gNsamLC = 50; */
104/* const int gNsamGB = 50; */
105/* const double gStepLC[5] = {0.00002, 0.000002, 0.00002, 0.0002, 0.00002}; /\* units of dr&dz are cm *\/ */
106/* const double gStepGB[48] = {0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, /\* dx *\/ */
107/* 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, */
108/* 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, /\* dy *\/ */
109/* 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, */
110/* 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, /\* rz *\/ */
111/* 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002, 0.000002}; */
112
113}
114
115#endif/* ALIGNMENT_H */
116
bool getDoca(double trkpar[], double wpos[], double &doca, double whitPos[], double zini)
Definition: Alignment.cxx:366
const bool verbose_reject
Definition: Alignment.h:69
const std::string MSG_FATAL("FATAL: ")
const double PI2
Definition: Alignment.h:41
const double g_res_cut_init
Definition: Alignment.h:84
int gNiter
Definition: Alignment.cxx:16
const std::string MSG_DEBUG("DEBUG: ")
const bool verbose_mode
Definition: Alignment.h:68
const int gNsamGB
Definition: Alignment.h:88
const int CELLNMAX
Definition: Alignment.h:46
const int INNERNMAX
Definition: Alignment.h:47
const bool debug_mode
Definition: Alignment.h:67
const int LAYERNMAX
Definition: Alignment.h:45
const double BFIELD
Definition: Alignment.h:52
const double gStepGB[48]
Definition: Alignment.h:91
const int NEP
Definition: Alignment.h:48
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:49
const bool m_iteration
Definition: Alignment.h:66
const double gStepLC[5]
Definition: Alignment.h:90
double docaHelixWire(double trkpar[], double wirest[], double wirev[], double &zwire, double zini)
Definition: Alignment.cxx:247
const std::string MSG_INFO("INFO: ")
const double HFPI
Definition: Alignment.h:42
int getEpId(int lay, int iEnd)
Definition: Alignment.cxx:18
double docaHelixWireNewton(double trkpar[], double wirest[], double wirev[], double &zwire, double zini)
Definition: Alignment.cxx:122
double docaLineWire(double trkpar[], double wirest[], double wirev[], double &zwire, int fgZcal=1)
Definition: Alignment.cxx:101
const int NTRKPARALL
Definition: Alignment.h:50
const double g_res_cut
Definition: Alignment.h:83
double getPhiIni(double trkpar[], double rLayer, double pos[])
Definition: Alignment.cxx:434
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:62
const double PI
Definition: Alignment.h:40
const std::string MSG_ERROR("ERROR: ")
const double g_Sigm[3]
Definition: Alignment.h:77
const bool g_dofs[3]
Definition: Alignment.h:71
const std::string MSG_WARNING("WARNING: ")
const int WIRENMAX
Definition: Alignment.h:44
const double CC
Definition: Alignment.h:39
const double g_start_chi_cut
Definition: Alignment.h:85