BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
add_lorShift.C
Go to the documentation of this file.
1void add_lorShift(Int_t run = 6)
2{
3 bool return_error = false;
4
5 const int nStats = (run == 5) ? 7 : (run == 6) ? 6 : -1;
6 vector<UniValue*> lorShiftValues;
7
8 for (int iStat = 0; iStat < nStats; iStat++) {
10 pValue->number = iStat;
11
12 // Normal voltage, RUN5
13 if (run == 5) {
14 if (iStat == 0) {
15 pValue->ls[0] = 0.;
16 pValue->ls[1] = 0.;
17 pValue->ls[2] = 0.;
18 } else if (iStat == 1) {
19 pValue->ls[0] = 2.0164;
20 pValue->ls[1] = -0.5504;
21 pValue->ls[2] = 0.0399;
22
23 } else if (iStat == 2) {
24 pValue->ls[0] = -2.9895;
25 pValue->ls[1] = 0.9824;
26 pValue->ls[2] = -0.0563;
27
28 } else if (iStat == 3) {
29 pValue->ls[0] = 0.0011;
30 pValue->ls[1] = 0.0194;
31 pValue->ls[2] = -0.0006;
32
33 } else if (iStat == 4) {
34 pValue->ls[0] = 0.0940;
35 pValue->ls[1] = 0.0204;
36 pValue->ls[2] = 0.0024;
37
38 } else if (iStat == 5) {
39 pValue->ls[0] = 0.0023;
40 pValue->ls[1] = 0.0559;
41 pValue->ls[2] = -0.0016;
42
43 } else if (iStat == 6) {
44 pValue->ls[0] = 0.1027;
45 pValue->ls[1] = -0.0195;
46 pValue->ls[2] = 0.0026;
47 }
48 }
49
50 // Normal voltage, RUN6
51 if (run == 6) {
52 pValue->ls[0] = 0.000250;
53 pValue->ls[1] = 0.019198;
54 pValue->ls[2] = 0.000051;
55
56 // Low voltage
57 // pValue->ls[0] = 0.024322;
58 // pValue->ls[1] = 0.019031;
59 // pValue->ls[2] = 0.000505;
60 }
61
62 lorShiftValues.push_back(pValue);
63 }
64
65 // UniDetectorParameter* pDetectorParameter = UniDetectorParameter::DeleteDetectorParameter("GEM",
66 // "lorentz_shift", 6, 1208, 6, 1992);
67
68 // Low voltage
69 // UniDetectorParameter* pDetectorParameter = UniDetectorParameter::CreateDetectorParameter("GEM",
70 // "lorentz_shift", 6, 1208, 6, 1217, lorShiftValues);
71
72 // Normal voltage, RUN5
73 // UniDetectorParameter* pDetectorParameter = UniDetectorParameter::CreateDetectorParameter("GEM", "lorentz_shift",
74 // 5, 430, 5, 1014, lorShiftValues);
75
76 // Normal voltage, RUN6
77 UniDetectorParameter* pDetectorParameter =
78 UniDetectorParameter::CreateDetectorParameter("GEM", "lorentz_shift", 6, 1219, 6, 1992, lorShiftValues);
79 if (pDetectorParameter == nullptr)
80 return_error = true;
81
82 // clean memory after work
83 for (int i = 0; i < lorShiftValues.size(); i++)
84 delete lorShiftValues[i];
85 if (pDetectorParameter)
86 delete pDetectorParameter;
87
88 if (return_error)
89 cout << "\nMacro finished with errors" << endl;
90 else
91 cout << "\nMacro finished successfully" << endl;
92}
int i
Definition P4_F32vec4.h:22
int Int_t
void add_lorShift(Int_t run=6)
Definition add_lorShift.C:1
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, int parameter_id, int start_period, int start_run, int end_period, int end_run, int value_key, unsigned char *parameter_value, Long_t size_parameter_value, TDatime *expiry_date)
add new detector parameter to the database