10 Bool_t misalignX = kTRUE;
11 Bool_t misalignY = kTRUE;
12 Bool_t misalignZ = kFALSE;
17 Float_t* ShiftX =
new Float_t[nrOfDetLayers];
18 Float_t* ShiftY =
new Float_t[nrOfDetLayers];
19 Float_t* ShiftZ =
new Float_t[nrOfDetLayers];
20 Float_t* RotX =
new Float_t[nrOfDetLayers];
21 Float_t* RotY =
new Float_t[nrOfDetLayers];
22 Float_t* RotZ =
new Float_t[nrOfDetLayers];
24 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
33 Int_t lastEntry = nrOfDetLayers - 1;
35 for (Int_t iLayer = 1; iLayer < lastEntry; ++iLayer) {
37 Float_t shiftx = gRandom->Uniform(-1., 1.);
38 Float_t shifty = gRandom->Uniform(-1., 1.);
39 Float_t shiftz = gRandom->Uniform(-1., 1.);
40 Float_t rotx = gRandom->Uniform(-1., 1.);
41 Float_t roty = gRandom->Uniform(-1., 1.);
42 Float_t rotz = gRandom->Uniform(-1., 1.);
45 ShiftX[iLayer] = shiftx;
47 ShiftY[iLayer] = shifty;
49 ShiftZ[iLayer] = shiftz;
59 myfile.open(
"example.par");
61 myfile <<
"##############################################################################" << endl;
62 myfile <<
"# Class: FairTutorialDetMissallignPar" << endl;
63 myfile <<
"# Context: TestDefaultContext" << endl;
64 myfile <<
"##############################################################################" << endl;
65 myfile <<
"[FairTutorialDetMissallignPar]" << endl;
66 myfile <<
"//----------------------------------------------------------------------------" << endl;
67 myfile <<
"NrOfDetectors: Int_t " << nrOfDetLayers << endl;
68 myfile <<
"ShiftX: Double_t \\ " << endl;
73 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
74 if ((9 == counter) && (1 != nrOfDetLayers - iLayer)) {
75 myfile << ShiftX[iLayer] <<
" \\" << endl;
79 myfile << ShiftX[iLayer] <<
" ";
85 myfile <<
"ShiftY: Double_t \\ " << endl;
90 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
91 if ((9 == counter) && (1 != nrOfDetLayers - iLayer)) {
92 myfile << ShiftY[iLayer] <<
" \\" << endl;
96 myfile << ShiftY[iLayer] <<
" ";
102 myfile <<
"ShiftZ: Double_t \\ " << endl;
107 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
108 if ((9 == counter) && (1 != nrOfDetLayers - iLayer)) {
109 myfile << ShiftZ[iLayer] <<
" \\" << endl;
113 myfile << ShiftZ[iLayer] <<
" ";
119 myfile <<
"RotationX: Double_t \\ " << endl;
124 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
125 if ((9 == counter) && (1 != nrOfDetLayers - iLayer)) {
126 myfile << RotX[iLayer] <<
" \\" << endl;
130 myfile << RotX[iLayer] <<
" ";
136 myfile <<
"RotationY: Double_t \\ " << endl;
141 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
142 if ((9 == counter) && (1 != nrOfDetLayers - iLayer)) {
143 myfile << RotY[iLayer] <<
" \\" << endl;
147 myfile << RotY[iLayer] <<
" ";
153 myfile <<
"RotationZ: Double_t \\ " << endl;
158 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
159 if ((9 == counter) && (1 != nrOfDetLayers - iLayer)) {
160 myfile << RotZ[iLayer] <<
" \\" << endl;
164 myfile << RotZ[iLayer] <<
" ";
170 myfile <<
"##############################################################################" << endl;
175 myfile.open(
"shifts.txt");
177 for (Int_t iLayer = 0; iLayer < nrOfDetLayers; ++iLayer) {
179 myfile << iLayer + 1 <<
" " << ShiftX[iLayer] << endl;
181 myfile << iLayer + 101 <<
" " << ShiftY[iLayer] << endl;
183 myfile << iLayer + 201 <<
" " << ShiftZ[iLayer] << endl;
185 myfile << iLayer + 301 <<
" " << RotX[iLayer] << endl;
187 myfile << iLayer + 401 <<
" " << RotY[iLayer] << endl;
189 myfile << iLayer + 501 <<
" " << RotZ[iLayer] << endl;
void create_misalign_parameter(Int_t nrOfDetLayers=40)