diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 09568aa6a63e73ceb9afcd13a15e11dc4c1dc795..06bf368eba38b8e721122d6941eb72f56a4a0c49 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -727,8 +727,6 @@ void CbmL1::Reconstruct(CbmEvent* event) //LOG(info) << "CHECK: hit ids = " << fvExternalHits.size() << ", hits = " << fpIODataManager->GetNofHits() //<< ", dbg hits = " << fvHitDebugInfo.size(); - // FieldApproxCheck(); - // FieldIntegralCheck(); fpAlgo->SetMonitorData(monitorData); if (nullptr != event) { @@ -809,6 +807,8 @@ void CbmL1::Reconstruct(CbmEvent* event) void CbmL1::Finish() { if (fPerformance) { + // FieldApproxCheck(); + // FieldIntegralCheck(); EfficienciesPerformance(kTRUE); } diff --git a/reco/L1/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx index 3449bf4656639f9d40bb3dd92f0e465b044f014d..6a43c542099cb4d0b6653bdea1c0efb17b2b19d4 100644 --- a/reco/L1/CbmL1Performance.cxx +++ b/reco/L1/CbmL1Performance.cxx @@ -1587,69 +1587,35 @@ void CbmL1::FieldApproxCheck() double Xmax = st.Xmax[0]; double Ymax = st.Ymax[0]; - // float step = 1.; - - int NbinsX = 100; //static_cast<int>(2*Xmax/step); - int NbinsY = 100; //static_cast<int>(2*Ymax/step); - float ddx = 2 * Xmax / NbinsX; - float ddy = 2 * Ymax / NbinsY; - - TH2F* stB = new TH2F(Form("station %i, dB", ist + 1), Form("station %i, dB, z = %0.f cm", ist + 1, z), - static_cast<int>(NbinsX + 1), -(Xmax + ddx / 2.), (Xmax + ddx / 2.), - static_cast<int>(NbinsY + 1), -(Ymax + ddy / 2.), (Ymax + ddy / 2.)); - TH2F* stBx = new TH2F(Form("station %i, dBx", ist + 1), Form("station %i, dBx, z = %0.f cm", ist + 1, z), - static_cast<int>(NbinsX + 1), -(Xmax + ddx / 2.), (Xmax + ddx / 2.), - static_cast<int>(NbinsY + 1), -(Ymax + ddy / 2.), (Ymax + ddy / 2.)); - TH2F* stBy = new TH2F(Form("station %i, dBy", ist + 1), Form("station %i, dBy, z = %0.f cm", ist + 1, z), - static_cast<int>(NbinsX + 1), -(Xmax + ddx / 2.), (Xmax + ddx / 2.), - static_cast<int>(NbinsY + 1), -(Ymax + ddy / 2.), (Ymax + ddy / 2.)); - TH2F* stBz = new TH2F(Form("station %i, dBz", ist + 1), Form("station %i, dBz, z = %0.f cm", ist + 1, z), - static_cast<int>(NbinsX + 1), -(Xmax + ddx / 2.), (Xmax + ddx / 2.), - static_cast<int>(NbinsY + 1), -(Ymax + ddy / 2.), (Ymax + ddy / 2.)); - - Double_t r[3], B[3]; - ca::FieldSlice<fvec> FSl; - ca::FieldValue<fvec> B_L1; - Double_t bbb, bbb_L1; - - const int M = 5; // polinom order - const int N = (M + 1) * (M + 2) / 2; - - for (int i = 0; i < N; i++) { - FSl.cx[i] = st.fieldSlice.cx[i][0]; - FSl.cy[i] = st.fieldSlice.cy[i][0]; - FSl.cz[i] = st.fieldSlice.cz[i][0]; - } - - Int_t i = 1, j = 1; - - double x, y; - for (int ii = 1; ii <= NbinsX + 1; ii++) { - j = 1; - x = -Xmax + (ii - 1) * ddx; - for (int jj = 1; jj <= NbinsY + 1; jj++) { - y = -Ymax + (jj - 1) * ddy; - double rrr = sqrt(fabs(x * x / Xmax / Xmax + y / Ymax * y / Ymax)); - if (rrr > 1.) { - j++; - continue; - } - r[2] = z; - r[0] = x; - r[1] = y; + int NbinsX = 101; + int NbinsY = 101; + + TH2F* stB = new TH2F(Form("station_%i_dB", ist), Form("station %i, dB, z = %0.f cm", ist, z), // + NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax); + TH2F* stBx = new TH2F(Form("station_%i_dBx", ist), Form("station %i, dBx, z = %0.f cm", ist, z), // + NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax); + TH2F* stBy = new TH2F(Form("station_%i_dBy", ist), Form("station %i, dBy, z = %0.f cm", ist, z), // + NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax); + TH2F* stBz = new TH2F(Form("station_%i_dBz", ist), Form("station %i, dBz, z = %0.f cm", ist, z), // + NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax); + + for (int i = 0; i < stB->GetXaxis()->GetNbins(); i++) { + double x = stB->GetXaxis()->GetBinCenter(i); + for (int j = 0; j < stB->GetYaxis()->GetNbins(); j++) { + double y = stB->GetYaxis()->GetBinCenter(j); + double r[] = {x, y, z}; + double B[] = {0., 0., 0.}; MF->GetFieldValue(r, B); - bbb = sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]); - B_L1 = FSl.GetFieldValue(x, y); - bbb_L1 = B_L1.GetAbs()[0]; + double bbb = sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]); - stB->SetBinContent(ii, jj, (bbb - bbb_L1)); - stBx->SetBinContent(ii, jj, (B[0] - B_L1.GetBx()[0])); - stBy->SetBinContent(ii, jj, (B[1] - B_L1.GetBy()[0])); - stBz->SetBinContent(ii, jj, (B[2] - B_L1.GetBz()[0])); - j++; + ca::FieldValue<fvec> B_L1 = st.fieldSlice.GetFieldValue(x, y); + + stB->SetBinContent(i, j, (bbb - B_L1.GetAbs()[0])); + stBx->SetBinContent(i, j, (B[0] - B_L1.GetBx()[0])); + stBy->SetBinContent(i, j, (B[1] - B_L1.GetBy()[0])); + stBz->SetBinContent(i, j, (B[2] - B_L1.GetBz()[0])); } - i++; } stB->GetXaxis()->SetTitle("X, cm"); @@ -1693,6 +1659,7 @@ void CbmL1::FieldApproxCheck() gDirectory = curr; } // void CbmL1::FieldApproxCheck() + #include "TMath.h" void CbmL1::FieldIntegralCheck() {