1 | #include <iostream>
|
---|
2 | #include <sstream>
|
---|
3 |
|
---|
4 | #include <TString.h>
|
---|
5 |
|
---|
6 | #include "SolGeom.h"
|
---|
7 | #include "SolTrack.h"
|
---|
8 |
|
---|
9 | using namespace std;
|
---|
10 |
|
---|
11 | SolGeom::SolGeom()
|
---|
12 | {
|
---|
13 | //
|
---|
14 | // Magnetic field
|
---|
15 | //
|
---|
16 | fB = 2.0;
|
---|
17 | //
|
---|
18 | // Create arrays
|
---|
19 | //
|
---|
20 | ftyLay = new Int_t[fNlMax]; // Layer type 1 = R (barrel) or 2 = z (forward/backward)
|
---|
21 | fLyLabl = new TString[fNlMax]; // Layer label
|
---|
22 | fxMin = new Double_t[fNlMax]; // Minimum dimension z for barrel or R for forward
|
---|
23 | fxMax = new Double_t[fNlMax]; // Maximum dimension z for barrel or R for forward
|
---|
24 | frPos = new Double_t[fNlMax]; // R/z location of layer
|
---|
25 | fthLay = new Double_t[fNlMax]; // Thickness (meters)
|
---|
26 | frlLay = new Double_t[fNlMax]; // Radiation length (meters)
|
---|
27 | fnmLay = new Int_t[fNlMax]; // Number of measurements in layers (1D or 2D)
|
---|
28 | fstLayU = new Double_t[fNlMax]; // Stereo angle (rad) - 0(pi/2) = axial(z) layer - Upper side
|
---|
29 | fstLayL = new Double_t[fNlMax]; // Stereo angle (rad) - 0(pi/2) = axial(z) layer - Lower side
|
---|
30 | fsgLayU = new Double_t[fNlMax]; // Resolution Upper side (meters) - 0 = no measurement
|
---|
31 | fsgLayL = new Double_t[fNlMax]; // Resolution Lower side (meters) - 0 = no measurement
|
---|
32 | fflLay = new Bool_t[fNlMax]; // measurement flag = T, scattering only = F
|
---|
33 | //
|
---|
34 | // Load geometry info in SolGeom.h
|
---|
35 | //
|
---|
36 | fNlay = 0; // Actual number of layers
|
---|
37 | fBlay = 0; // Nr. of barrel layers
|
---|
38 | fFlay = 0; // Nr. of forward/backward layers
|
---|
39 | fNm = 0; // Nr. of measuring layers
|
---|
40 | }
|
---|
41 |
|
---|
42 | void SolGeom::Read(const char *data)
|
---|
43 | {
|
---|
44 | Int_t tyLay;
|
---|
45 | string LyLabl;
|
---|
46 | Double_t xMin;
|
---|
47 | Double_t xMax;
|
---|
48 | Double_t rPos;
|
---|
49 | Double_t thLay;
|
---|
50 | Double_t rlLay;
|
---|
51 | Int_t nmLay;
|
---|
52 | Double_t stLayU;
|
---|
53 | Double_t stLayL;
|
---|
54 | Double_t sgLayU;
|
---|
55 | Double_t sgLayL;
|
---|
56 | Int_t flLay;
|
---|
57 |
|
---|
58 | stringstream data_stream(data);
|
---|
59 | string line;
|
---|
60 |
|
---|
61 | fNlay = 0;
|
---|
62 | while(getline(data_stream, line))
|
---|
63 | {
|
---|
64 | stringstream line_stream(line);
|
---|
65 |
|
---|
66 | line_stream >> tyLay >> LyLabl >> xMin >> xMax >> rPos >> thLay >> rlLay >> nmLay >> stLayU >> stLayL >> sgLayU >> sgLayL >> flLay;
|
---|
67 |
|
---|
68 | if(line_stream.fail()) continue;
|
---|
69 |
|
---|
70 | ftyLay[fNlay] = tyLay;
|
---|
71 | fLyLabl[fNlay] = LyLabl;
|
---|
72 | fxMin[fNlay] = xMin;
|
---|
73 | fxMax[fNlay] = xMax;
|
---|
74 | frPos[fNlay] = rPos;
|
---|
75 | fthLay[fNlay] = thLay;
|
---|
76 | frlLay[fNlay] = rlLay;
|
---|
77 | fnmLay[fNlay] = nmLay;
|
---|
78 | fstLayU[fNlay] = stLayU;
|
---|
79 | fstLayL[fNlay] = stLayL;
|
---|
80 | fsgLayU[fNlay] = sgLayU;
|
---|
81 | fsgLayL[fNlay] = sgLayL;
|
---|
82 | fflLay[fNlay] = flLay;
|
---|
83 |
|
---|
84 | fNlay++;
|
---|
85 | if (tyLay == 1) fBlay++;
|
---|
86 | if (tyLay == 2) fFlay++;
|
---|
87 | if (flLay == 1) fNm++;
|
---|
88 | }
|
---|
89 | }
|
---|
90 |
|
---|
91 | SolGeom::~SolGeom()
|
---|
92 | {
|
---|
93 | delete[] ftyLay;
|
---|
94 | delete[] fxMin;
|
---|
95 | delete[] fxMax;
|
---|
96 | delete[] frPos;
|
---|
97 | delete[] fthLay;
|
---|
98 | delete[] frlLay;
|
---|
99 | delete[] fnmLay;
|
---|
100 | delete[] fstLayU;
|
---|
101 | delete[] fstLayL;
|
---|
102 | delete[] fsgLayU;
|
---|
103 | delete[] fsgLayL;
|
---|
104 | delete[] fflLay;
|
---|
105 | }
|
---|