14 #include "FairField.h"
15 #include "FairRunAna.h"
16 #include "FairRuntimeDb.h"
23 #include <boost/assign/list_of.hpp>
27 using boost::assign::list_of;
47 , fMinZFieldIntegral(171.)
48 , fMaxZFieldIntegral(330.)
69 vector<Double_t> tmp = list_of(0.)(10.)(20.)(30.);
77 fField = FairRunAna::Instance()->GetField();
89 TDirectory* oldir = gDirectory;
90 TFile* outFile = FairRootManager::Instance()->GetOutFile();
91 if (outFile != NULL) {
95 gDirectory->cd(oldir->GetPath());
99 vector<vector<Double_t>>
pos = {
100 {0., 0., 170.}, {0., 80., 170.}, {50., 0., 170.}, {0., 0., 250.}};
101 for (Int_t
i = 0;
i <
pos.size();
i++) {
103 Double_t magB =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
104 cout <<
"B at (" <<
pos[
i][0] <<
", " <<
pos[
i][1] <<
", " <<
pos[
i][2]
105 <<
") = " << magB <<
" kGauss" << endl;
108 cout <<
"CbmLitFieldQa::Init() end" << endl;
118 string names[] = {
"Bx",
"By",
"Bz",
"Mod"};
120 "B_{x} [kGauss]",
"B_{y} [kGauss]",
"B_{z} [kGauss]",
"|B| [kGauss]"};
121 for (Int_t
v = 0;
v < 4;
v++) {
123 TGraph2D* graph =
new TGraph2D();
128 string title = name +
";X [cm];Y [cm];" + zTitle[
v];
129 graph->SetNameTitle(name.c_str(), title.c_str());
134 for (Int_t
v = 0;
v < 4;
v++) {
136 TGraph* graph =
new TGraph();
137 string name =
"hmf_" + names[
v] +
"AlongZAngle_Graph_"
139 string title = name +
";Z [cm];B [kGauss]";
140 graph->SetNameTitle(name.c_str(), title.c_str());
144 TGraph* graph =
new TGraph();
145 string name =
"hmf_" + names[
v] +
"AlongZXY_Graph_"
148 string title = name +
";Z [cm];B [kGauss]";
149 graph->SetNameTitle(name.c_str(), title.c_str());
153 TGraph* graph =
new TGraph();
154 string name =
"hmf_" + names[
v] +
"AlongZXYIntegral_Graph_"
157 string title = name +
";Z [cm];B_{Int_t} [kGauss*m]";
158 graph->SetNameTitle(name.c_str(), title.c_str());
163 for (Int_t p = 0; p < 2; p++) {
164 for (Int_t
v = 0;
v < 4;
v++) {
165 TGraph2D* graph =
new TGraph2D();
169 "hmf_" + names[
v] +
"_Rich_Pmt_" + ((p == 0) ?
"up" :
"down");
170 string title = name +
";X [cm];Y [cm];" + zTitle[
v];
171 graph->SetNameTitle(name.c_str(), title.c_str());
178 string names[] = {
"Bx",
"By",
"Bz",
"Mod"};
180 for (UInt_t iSlice = 0; iSlice <
fNofSlices; iSlice++) {
188 for (Int_t iX = 0; iX <
fNofBinsX; iX++) {
190 for (Int_t iY = 0; iY <
fNofBinsY; iY++) {
194 Double_t
pos[3] = {X, Y, Z};
198 B[3] =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
199 for (Int_t
v = 0;
v < 4;
v++) {
200 string name =
"hmf_" + names[
v] +
"_Graph2D_"
202 fHM->
G2(name)->SetPoint(cnt, X, Y, B[
v]);
212 for (Int_t istep = 0; istep < nofSteps; istep++) {
216 Double_t X = Z * tanXangle;
217 Double_t Y = Z * tanYangle;
220 Double_t
pos[3] = {X, Y, Z};
224 B[3] =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
225 for (Int_t
v = 0;
v < 4;
v++) {
226 string name =
"hmf_" + names[
v] +
"AlongZAngle_Graph_"
228 fHM->
G1(name)->SetPoint(istep, Z, B[
v]);
235 Double_t integralB[4] = {0., 0., 0., 0.};
236 for (Int_t istep = 0; istep < nofSteps; istep++) {
242 Double_t
pos[3] = {X, Y, Z};
246 B[3] =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
248 for (Int_t
v = 0;
v < 4;
v++) {
249 string name =
"hmf_" + names[
v] +
"AlongZXY_Graph_"
252 fHM->
G1(name)->SetPoint(istep, Z, B[
v]);
256 string name =
"hmf_" + names[
v] +
"AlongZXYIntegral_Graph_"
259 fHM->
G1(name)->SetPoint(istep, Z, integralB[
v]);
260 fHM->
G1(name)->SetMaximum(1.1 * integralB[
v]);
268 string names[] = {
"Bx",
"By",
"Bz",
"Mod"};
269 vector<Int_t> pixels =
271 if (pixels.size() == 0)
return;
273 Double_t maxModB = 0.;
275 for (Int_t
i = 0;
i < pixels.size();
i++) {
279 inPos.SetXYZ(pixelData->
fX, pixelData->
fY, pixelData->
fZ);
281 if (inPos.Y() < 0) ud =
"down";
287 Double_t
pos[3] = {inPos.X(), inPos.Y(), inPos.Z()};
292 B[3] =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
293 if (maxModB < B[3]) maxModB = B[3];
294 for (Int_t
v = 0;
v < 4;
v++) {
295 string name =
"hmf_" + names[
v] +
"_Rich_Pmt_" + ud;
297 fHM->
G2(name)->SetPoint(
298 fHM->
G2(name)->GetN(), outPos.X(), outPos.Y(), B[
v]);
302 cout <<
"Maximum Bmod onto RICH PMT:" << maxModB <<
" kGauss" << endl;