Belle II Software development
SpaceResolutionCalibration Class Reference

Class for Space resolution calibration. More...

#include <SpaceResolutionCalibration.h>

Public Member Functions

 SpaceResolutionCalibration ()
 Constructor.
 
virtual ~SpaceResolutionCalibration ()
 Destructor.
 
virtual void setDebug (bool debug=false)
 Debug or not.
 
virtual void setUseDB (bool useDB=false)
 Use database or text mode.
 
virtual void setMinimumNDF (double minndf)
 minimum NDF required for track
 
virtual void setMinimumPval (double minPval)
 Minimum Pval required.
 
virtual void setBinWidth (double bw)
 Bin width of each slide.
 
virtual void BField (bool bfield)
 Work with B field or not;.
 
virtual void inputFileNames (std::string inputname)
 Input root file names, results of collector module.
 
virtual void setStoreHisto (bool storeHist=false)
 Store histograms during the calibration or not.
 
virtual void ProfileFileNames (std::string profileFileName)
 File name describe theta/alpha bin, if don't want to use default from input sigma.
 
virtual void useProfileFromInputSigma (bool useProfileFromInputSigma)
 use sigma bin profile form input sigma or new one from input file
 
virtual void setSigmaFileName (std::string name)
 Output sigma file name, for text mode.
 
void execute ()
 execute all, make the interface the same as CAF
 

Protected Member Functions

virtual bool calibrate ()
 Run algo on data.
 
virtual void createHisto ()
 create histogram
 
virtual void readProfile ()
 read sigma bining (alpha, theta bining)
 
virtual void readSigma ()
 read sigma from previous calibration, (input sigma)
 
virtual void readSigmaFromDB ()
 read sigma from DB
 
virtual void readSigmaFromText ()
 read sigma from text file
 
virtual void storeHisto ()
 store histogram
 
virtual void write ()
 save calibration, in text file or db
 

Private Member Functions

double getUpperBoundaryForFit (TGraphErrors *graph)
 search max point at boundary region
 

Private Attributes

double m_ndfmin = 5
 Minimum NDF.
 
double m_Pvalmin = 0.
 Minimum Prob(chi2) of track.
 
double m_binWidth = 0.05
 width of each bin, unit cm
 
bool m_debug = false
 Debug or not.
 
bool m_storeHisto = false
 Store histogram or not.
 
bool m_useDB = false
 use db or text mode
 
bool m_useProfileFromInputSigma = true
 Use binning from old sigma or new one form input.
 
bool m_BField = true
 Work with BField, fit range and initial parameters is different incase B and noB.
 
double sigma_old [56][2][18][7][8] = {}
 old sigma parameters.
 
double sigma_new [56][2][18][7][8] = {}
 new sigma parameters.
 
TGraphErrors * gfit [56][2][18][7] = {}
 sigma*sigma graph for fit
 
TGraphErrors * gr [56][2][18][7] = {}
 sigma graph.
 
TH2F * hist_b [56][2][Max_nalpha][Max_ntheta] = {}
 2D histogram of biased residual
 
TH2F * hist_u [56][2][Max_nalpha][Max_ntheta] = {}
 2D histogram of unbiased residual
 
TH1F * hu_m [56][2][Max_nalpha][Max_ntheta] = {}
 mean histogram biased residual
 
TH1F * hu_s [56][2][Max_nalpha][Max_ntheta] = {}
 sigma histogram of biased residual
 
TH1F * hb_m [56][2][Max_nalpha][Max_ntheta] = {}
 mean histogram of unbiased residual
 
TH1F * hb_s [56][2][Max_nalpha][Max_ntheta] = {}
 sigma histogram of ubiased residual
 
int m_fitflag [56][2][Max_nalpha][Max_ntheta] = {{{{0}}}}
 Fit flag; 1:OK ; 0:error.
 
std::string m_outputSigmaFileName = "sigma_new.dat"
 Output sigma file name.
 
std::string m_inputRootFileNames = "rootfile/output*"
 Input root file names.
 
std::string m_ProfileFileName = "sigma_profile"
 Profile file name.
 
DBObjPtr< CDCSpaceResols > * m_sResolFromDB = nullptr
 Database for sigma.
 
std::string m_sigmafile = "cdc/data/sigma.dat"
 Sigma file name, for text mode.
 
int m_nalpha = 0
 number of alpha bins
 
int m_ntheta = 0
 number of theta bins
 
double l_alpha [18] = {}
 Lower boundaries of alpha bins.
 
double u_alpha [18] = {}
 Upper boundaries of alpha bins.
 
double ialpha [18] = {}
 represented alphas of alpha bins.
 
double l_theta [7] = {}
 Lower boundaries of theta bins.
 
double u_theta [7] = {}
 Upper boundaries of theta bins.
 
double itheta [7] = {}
 represented alphas of theta bins.
 
int nalpha_old = 0
 number of alpha bins from input
 
int ntheta_old = 0
 number of theta bins from input
 
double l_alpha_old [18] = {}
 Lower boundaries of alpha bins from input.
 
double u_alpha_old [18] = {}
 Upper boundaries of alpha bins from input.
 
double ialpha_old [18] = {}
 represented alphas of alpha bins from input.
 
double l_theta_old [7] = {}
 Lower boundaries of theta bins from input.
 
double u_theta_old [7] = {}
 Upper boundaries of theta bins from input.
 
double itheta_old [7] = {}
 represented alphas of theta bins from input.
 
unsigned short m_sigmaParamMode_old = 0
 sigma mode from input.
 

Static Private Attributes

static const int Max_nalpha = 18
 Maximum alpha bin.
 
static const int Max_ntheta = 7
 maximum theta bin
 
static const unsigned short Max_np = 40
 Maximum number of point =1/binwidth.
 

Detailed Description

Class for Space resolution calibration.

Definition at line 25 of file SpaceResolutionCalibration.h.

Constructor & Destructor Documentation

◆ SpaceResolutionCalibration()

Constructor.

Definition at line 32 of file SpaceResolutionCalibration.cc.

34{
35 /*Space resolution calibration*/
36}

◆ ~SpaceResolutionCalibration()

virtual ~SpaceResolutionCalibration ( )
inlinevirtual

Destructor.

Definition at line 31 of file SpaceResolutionCalibration.h.

31{}

Member Function Documentation

◆ BField()

virtual void BField ( bool bfield)
inlinevirtual

Work with B field or not;.

Definition at line 43 of file SpaceResolutionCalibration.h.

43{m_BField = bfield;}

◆ calibrate()

bool calibrate ( )
protectedvirtual

Run algo on data.

Upper limit of fitting.

Definition at line 288 of file SpaceResolutionCalibration.cc.

289{
290 gROOT->SetBatch(1);
291 gErrorIgnoreLevel = 3001;
292 createHisto();
293 B2INFO("Start to calibrate");
294 gSystem->Exec("mkdir -p Sigma_Fit_Err"); //create a folder to store error histo
295
296 TF1* func = new TF1("func", "[0]/(x*x + [1])+[2]* x+[3]+[4]*exp([5]*(x-[6])*(x-[6]))", 0, 1.);
297 TH1F* hprob = new TH1F("h1", "", 20, 0, 1);
298 double upFit;
299 double intp6;
300
301 for (int i = 0; i < 56; ++i) {
302 for (int lr = 0; lr < 2; ++lr) {
303 for (int al = 0; al < m_nalpha; ++al) {
304 for (int th = 0; th < m_ntheta; ++th) {
305 if (m_fitflag[i][lr][al][th] != -1) { /*if graph exist, do fitting*/
306
307
308 upFit = getUpperBoundaryForFit(gfit[i][lr][al][th]);
309 intp6 = upFit + 0.2;
310 B2DEBUG(199, "xmax for fitting: " << upFit);
311 // func->SetLineColor(1 + lr + al * 2 + th * 3);
312 func->SetParameters(5E-6, 0.007, 1E-4, 1E-5, 0.00008, -30, intp6);
313 func->SetParLimits(0, 1E-7, 1E-4);
314 func->SetParLimits(1, 0.00001, 0.02);
315 func->SetParLimits(2, 1E-6, 0.0005);
316 func->SetParLimits(3, 1E-8, 0.0005);
317 func->SetParLimits(4, 0., 0.001);
318 func->SetParLimits(5, -40, 0.);
319 func->SetParLimits(6, intp6 - 0.5, intp6 + 0.3);
320 B2DEBUG(199, "FITTING for layer: " << i << "lr: " << lr << " ial" << al << " ith:" << th);
321 B2DEBUG(199, "Fit flag before fit:" << m_fitflag[i][lr][al][th]);
322 // if(!(gfit[i][lr][al][th]->isValid())) continue;
323 // m_fitflag[i][lr][al][th] = 0;
324 for (int j = 0; j < 10; j++) {
325
326 B2DEBUG(199, "loop: " << j);
327 B2DEBUG(199, "Int p6: " << intp6);
328 B2DEBUG(199, "Number of Point: " << gfit[i][lr][al][th]->GetN());
329 Int_t stat = gfit[i][lr][al][th]->Fit("func", "MQE", "", 0.05, upFit);
330 B2DEBUG(199, "stat of fit" << stat);
331 std::string Fit_status = gMinuit->fCstatu.Data();
332 B2DEBUG(199, "FIT STATUS: " << Fit_status);
333 // stat=gfit[i]->Fit(Form("ffit[%d]",i),"M "+Q,"",0.0,cellsize(i)+0.05+j*0.005);
334 if (Fit_status == "OK" ||
335 Fit_status == "SUCCESSFUL" ||
336 Fit_status == "CALL LIMIT" ||
337 Fit_status == "PROBLEMS") {
338 if (fabs(func->Eval(0.3)) > 0.00035 || func->Eval(0.3) < 0) {
339 func->SetParameters(5E-6, 0.007, 1E-4, 1E-7, 0.0007, -30, intp6 + 0.05 * j);
340 // func->SetParameters(defaultparsmall);
341 m_fitflag[i][lr][al][th] = 0;
342 } else {
343 B2DEBUG(199, "Prob of fit: " << func->GetProb());
344 m_fitflag[i][lr][al][th] = 1;
345 break;
346 }
347 } else {
348 m_fitflag[i][lr][al][th] = 0;
349 func->SetParameters(5E-6, 0.007, 1E-4, 1E-7, 0.0007, -30, intp6 + 0.05 * j);
350 // upFit += 0.025;
351 if (j == 9) {
352 TCanvas* c1 = new TCanvas("c1", "", 600, 600);
353 gfit[i][lr][al][th]->Draw();
354 c1->SaveAs(Form("Sigma_Fit_Err/%d_%d_al%d_th%d_%s.png", i, lr, al, th, Fit_status.c_str()));
355 B2WARNING("Fit error: " << i << " " << lr << " " << al << " " << th);
356 }
357 }
358 }
359 if (m_fitflag[i][lr][al][th] == 1) {
360 B2DEBUG(199, "ProbFit: Lay_lr_al_th: " << i << " " << lr << " " << al << " " << th << func->GetProb());
361 hprob->Fill(func->GetProb());
362 func->GetParameters(sigma_new[i][lr][al][th]);
363 }
364 }
365 }
366 }
367 }
368 }
369 storeHisto();
370 write();
371
372 return true;
373}
R E
internal precision of FFTW codelets
int m_fitflag[56][2][Max_nalpha][Max_ntheta]
Fit flag; 1:OK ; 0:error.
TGraphErrors * gfit[56][2][18][7]
sigma*sigma graph for fit
double getUpperBoundaryForFit(TGraphErrors *graph)
search max point at boundary region
virtual void write()
save calibration, in text file or db
double sigma_new[56][2][18][7][8]
new sigma parameters.

◆ createHisto()

void createHisto ( )
protectedvirtual

create histogram

Definition at line 37 of file SpaceResolutionCalibration.cc.

38{
39
40 B2INFO("createHisto");
41 readSigma();
43 const int m_np = floor(1 / m_binWidth);
44
45 TChain* tree = new TChain("tree");
46 tree->Add(m_inputRootFileNames.c_str());
47 B2INFO(" Open file name: " << m_inputRootFileNames.c_str());
48 if (!tree->GetBranch("ndf")) {
49 B2FATAL("input data do not exits, please check!");
50 gSystem->Exec("echo rootfile do not exits or something wrong >> error");
51 return;
52 }
53
54 int lay;
55 double w;
56 double x_u;
57 double x_b;
58 double x_mea;
59 double Pval;
60 double alpha;
61 double theta;
62 double ndf;
63 double absRes_u;
64 double absRes_b;
65 tree->SetBranchAddress("lay", &lay);
66 tree->SetBranchAddress("ndf", &ndf);
67 tree->SetBranchAddress("Pval", &Pval);
68 tree->SetBranchAddress("x_u", &x_u);
69 tree->SetBranchAddress("x_b", &x_b);
70 tree->SetBranchAddress("x_mea", &x_mea);
71 tree->SetBranchAddress("weight", &w);
72 tree->SetBranchAddress("alpha", &alpha);
73 tree->SetBranchAddress("theta", &theta);
74
75 /* Disable unused branch */
76 std::vector<TString> list_vars = {"lay", "ndf", "Pval", "x_u", "x_b", "x_mea", "weight", "alpha", "theta"};
77 tree->SetBranchStatus("*", 0);
78
79 for (TString brname : list_vars) {
80 tree->SetBranchStatus(brname, 1);
81 }
82
83
84 vector<double> yu;
85 vector <double> yb;
86 for (int i = 0; i < 50; ++i) {
87 yb.push_back(-0.07 + i * (0.14 / 50));
88 }
89 for (int i = 0; i < 50; ++i) {
90 yu.push_back(-0.08 + i * (0.16 / 50));
91 }
92
93 vector<double> xbin;
94 xbin.push_back(0.);
95 xbin.push_back(0.02);
96 for (int i = 1; i < m_np; ++i) {
97 xbin.push_back(i * m_binWidth);
98 }
99
100 for (int il = 0; il < 56; ++il) {
101 for (int lr = 0; lr < 2; ++lr) {
102 for (int al = 0; al < m_nalpha; ++al) {
103 for (int th = 0; th < m_ntheta; ++th) {
104 hist_b[il][lr][al][th] = new TH2F(Form("hb_%d_%d_%d_%d", il, lr, al, th),
105 Form("lay_%d_lr%d_al_%3.0f_th_%3.0f;Drift Length [cm];#DeltaX", il, lr, ialpha[al], itheta[th]),
106 xbin.size() - 1, &xbin.at(0), yb.size() - 1, &yb.at(0));
107 hist_u[il][lr][al][th] = new TH2F(Form("hu_%d_%d_%d_%d", il, lr, al, th),
108 Form("lay_%d_lr%d_al_%3.0f_th_%3.0f;Drift Length [cm];#DeltaX", il, lr, ialpha[al], itheta[th]),
109 xbin.size() - 1, &xbin.at(0), yu.size() - 1, &yu.at(0));
110 }
111 }
112 }
113 }
114
115
116 const int nEntries = tree->GetEntries();
117 B2INFO("Number of entries: " << nEntries);
118 int ith = -99;
119 int ial = -99;
120 int ilr = -99;
121 for (int i = 0; i < nEntries; ++i) {
122 tree->GetEntry(i);
123 //cut
124 if (std::fabs(x_b) < 0.02 || std::fabs(x_u) < 0.02) continue;
125 if (Pval < m_Pvalmin) continue;
126 if (ndf < m_ndfmin) continue;
127 for (int k = 0; k < m_nalpha; ++k) {
128 if (alpha < u_alpha[k]) {
129 ial = k;
130 break;
131 }
132 }
133
134 for (int j = 0; j < m_ntheta; ++j) {
135 if (theta < u_theta[j]) {
136 ith = j;
137 break;
138 }
139 }
140
141 ilr = x_u > 0 ? 1 : 0;
142
143 if (ial == -99 || ith == -99 || ilr == -99) {
144 TString command = Form("Error in alpha=%3.2f and theta = %3.2f>> error", alpha, theta);
145 // gSystem->Exec(command);
146 B2FATAL("ERROR" << command);
147 }
148 absRes_u = fabs(x_mea) - fabs(x_u);
149 absRes_b = fabs(x_mea) - fabs(x_b);
150
151 hist_u[lay][ilr][ial][ith]->Fill(fabs(x_u), absRes_u, w);
152 hist_b[lay][ilr][ial][ith]->Fill(fabs(x_b), absRes_b, w);
153
154 }
155
156 B2INFO("Finish reading data");
157
158 TF1* gb = new TF1("gb", "gaus", -0.05, 0.05);
159 TF1* gu = new TF1("gu", "gaus", -0.06, 0.06);
160 TF1* g0b = new TF1("g0b", "gaus", -0.015, 0.07);
161 TF1* g0u = new TF1("g0u", "gaus", -0.015, 0.08);
162 g0b->SetParLimits(1, -0.01, 0.004);
163 g0u->SetParLimits(1, -0.01, 0.004);
164
165 std::vector<double> sigma;
166 std::vector<double> dsigma;
167 std::vector<double> s2;
168 std::vector<double> ds2;
169 std::vector<double> xl;
170 std::vector<double> dxl;
171 std::vector<double> dxl0;
172
173 const int ib1 = int(0.1 / m_binWidth) + 1;
174 int firstbin = 1;
175 int minEntry = 10;
176 for (int il = 0; il < 56; ++il) {
177 for (int lr = 0; lr < 2; ++lr) {
178 for (int al = 0; al < m_nalpha; ++al) {
179 for (int th = 0; th < m_ntheta; ++th) {
180 //fit half gaus for first range near sense wire
181 B2DEBUG(199, "layer-lr-al-th " << il << " - " << lr << " - " << al << " - " << th);
182 if (hist_b[il][lr][al][th]->GetEntries() < 20000) {
183 m_fitflag[il][lr][al][th] = -1;
184 continue;
185 }
186 B2DEBUG(199, "Nentries: " << hist_b[il][lr][al][th]->GetEntries());
187 hist_b[il][lr][al][th]->SetDirectory(0);
188 hist_u[il][lr][al][th]->SetDirectory(0);
189
190 hist_b[il][lr][al][th]->FitSlicesY(g0b, firstbin, ib1, minEntry);
191
192 TH1F* hm1 = static_cast<TH1F*>(gDirectory->Get(Form("hb_%d_%d_%d_%d_1", il, lr, al, th)));
193 TH1F* hs1 = static_cast<TH1F*>(gDirectory->Get(Form("hb_%d_%d_%d_%d_2", il, lr, al, th)));
194 if (!hm1 || !hs1) {
195 m_fitflag[il][lr][al][th] = -1;
196 continue;
197 }
198
199 hb_m[il][lr][al][th] = static_cast<TH1F*>(hm1->Clone(Form("hb_%d_%d_%d_%d_m", il, lr, al, th)));
200 hb_s[il][lr][al][th] = static_cast<TH1F*>(hs1->Clone(Form("hb_%d_%d_%d_%d_s", il, lr, al, th)));//sigma
201
202 hb_m[il][lr][al][th]->SetDirectory(0);
203 hb_s[il][lr][al][th]->SetDirectory(0);
204
205
206 //slice other bin with full gaus func
207 hist_b[il][lr][al][th]->FitSlicesY(gb, ib1 + 1, m_np, minEntry);
208 hb_m[il][lr][al][th]->Add(static_cast<TH1F*>(gDirectory->Get(Form("hb_%d_%d_%d_%d_1", il, lr, al, th)))); //mean
209 hb_s[il][lr][al][th]->Add(static_cast<TH1F*>(gDirectory->Get(Form("hb_%d_%d_%d_%d_2", il, lr, al, th)))); //sigma
210 B2DEBUG(199, "entries (2nd): " << hb_s[il][lr][al][th]->GetEntries());
211
212 //fit half gaus for first range near sense wire
213 hist_u[il][lr][al][th]->FitSlicesY(g0u, firstbin, ib1, minEntry);
214 hu_m[il][lr][al][th] = static_cast<TH1F*>(gDirectory->Get(Form("hu_%d_%d_%d_%d_1", il, lr, al, th))->Clone(Form("hu_%d_%d_%d_%d_m",
215 il, lr, al,
216 th)));//mean
217 hu_s[il][lr][al][th] = static_cast<TH1F*>(gDirectory->Get(Form("hu_%d_%d_%d_%d_2", il, lr, al, th))->Clone(Form("hu_%d_%d_%d_%d_s",
218 il, lr, al,
219 th)));//sigma
220 hu_m[il][lr][al][th]->SetDirectory(0);
221 hu_s[il][lr][al][th]->SetDirectory(0);
222
223 //slice other bin with full gaus func
224 hist_u[il][lr][al][th]->FitSlicesY(gu, ib1 + 1, m_np, minEntry);
225 hu_m[il][lr][al][th]->Add(static_cast<TH1F*>(gDirectory->Get(Form("hu_%d_%d_%d_%d_1", il, lr, al, th)))); //mean
226 hu_s[il][lr][al][th]->Add(static_cast<TH1F*>(gDirectory->Get(Form("hu_%d_%d_%d_%d_2", il, lr, al, th)))); //sigma
227 if (!hu_s[il][lr][al][th] || !hb_s[il][lr][al][th]) {
228 B2WARNING("slice histo do not found");
229 m_fitflag[il][lr][al][th] = -1;
230 continue;
231 }
232 //clean up container before adding new values
233 xl.clear(); dxl.clear(); dxl0.clear(); sigma.clear(); dsigma.clear(); s2.clear(); ds2.clear();
234 for (Int_t j = 1; j < hu_s[il][lr][al][th]->GetNbinsX(); j++) {
235 if (hu_s[il][lr][al][th]->GetBinContent(j) == 0) continue;
236 if (hb_s[il][lr][al][th]->GetBinContent(j) == 0) continue;
237 double sb = hb_s[il][lr][al][th]->GetBinContent(j);
238 double su = hu_s[il][lr][al][th]->GetBinContent(j);
239
240 double dsb = hb_s[il][lr][al][th]->GetBinError(j);
241 double dsu = hu_s[il][lr][al][th]->GetBinError(j);
242 double XL = hb_s[il][lr][al][th]->GetXaxis()->GetBinCenter(j);
243 double dXL = (hb_s[il][lr][al][th]->GetXaxis()->GetBinWidth(j)) / 2;
244 double s_int = std::sqrt(sb * su);
245 double ds_int = 0.5 * s_int * (dsb / sb + dsu / su);
246 if (ds_int > 0.02) continue;
247 xl.push_back(XL);
248 dxl.push_back(dXL);
249 dxl0.push_back(0.);
250 sigma.push_back(s_int);
251 dsigma.push_back(ds_int);
252 s2.push_back(s_int * s_int);
253 ds2.push_back(2 * s_int * ds_int);
254 }
255
256 if (xl.size() < 7 || xl.size() > Max_np) {
257 m_fitflag[il][lr][al][th] = -1;
258 B2WARNING("number of element might out of range"); continue;
259 }
260
261 //Intrinsic resolution
262 B2DEBUG(199, "Create Histo for layer-lr: " << il << " " << lr);
263 gr[il][lr][al][th] = new TGraphErrors(xl.size(), &xl.at(0), &sigma.at(0), &dxl.at(0), &dsigma.at(0));
264 gr[il][lr][al][th]->SetMarkerSize(0.5);
265 gr[il][lr][al][th]->SetMarkerStyle(8);
266 // gr[il][lr][al][th]->SetMarkerColor(kBlack);
267 //gr[il][lr][al][th]->SetLineColor(1 + lr + al * 2 + th * 3);
268 gr[il][lr][al][th]->SetTitle(Form("Layer_%d_lr%d | #alpha = %3.0f | #theta = %3.0f", il, lr, ialpha[al], itheta[th]));
269 gr[il][lr][al][th]->SetName(Form("lay%d_lr%d_al%d_th%d", il, lr, al, th));
270
271 //s2 for fitting
272 gfit[il][lr][al][th] = new TGraphErrors(xl.size(), &xl.at(0), &s2.at(0), &dxl0.at(0), &ds2.at(0));
273 gfit[il][lr][al][th]->SetMarkerSize(0.5);
274 gfit[il][lr][al][th]->SetMarkerStyle(8);
275 // gfit[il][lr][al][th]->SetMarkerColor(1 + lr + al * 2 + th * 3);
276 //gfit[il][lr][al][th]->SetLineColor(1 + lr + al * 2 + th * 3);
277 gfit[il][lr][al][th]->SetTitle(Form("L%d-lr%d | #alpha = %3.0f | #theta = %3.0f ", il, lr, ialpha[al], itheta[th]));
278 gfit[il][lr][al][th]->SetName(Form("sigma2_lay%d_lr%d_al%d_th%d", il, lr, al, th));
279
280
281 gDirectory->Delete("hu_%d_%d_%d_%d_0");
282 }
283 }
284 }
285 }
286}
double ialpha[18]
represented alphas of alpha bins.
std::string m_inputRootFileNames
Input root file names.
TH1F * hb_s[56][2][Max_nalpha][Max_ntheta]
sigma histogram of ubiased residual
TGraphErrors * gr[56][2][18][7]
sigma graph.
TH2F * hist_u[56][2][Max_nalpha][Max_ntheta]
2D histogram of unbiased residual
TH1F * hu_m[56][2][Max_nalpha][Max_ntheta]
mean histogram biased residual
double u_alpha[18]
Upper boundaries of alpha bins.
virtual void readProfile()
read sigma bining (alpha, theta bining)
TH2F * hist_b[56][2][Max_nalpha][Max_ntheta]
2D histogram of biased residual
TH1F * hu_s[56][2][Max_nalpha][Max_ntheta]
sigma histogram of biased residual
TH1F * hb_m[56][2][Max_nalpha][Max_ntheta]
mean histogram of unbiased residual
static const unsigned short Max_np
Maximum number of point =1/binwidth.
double itheta[7]
represented alphas of theta bins.
double m_Pvalmin
Minimum Prob(chi2) of track.
virtual void readSigma()
read sigma from previous calibration, (input sigma)
double u_theta[7]
Upper boundaries of theta bins.

◆ execute()

void execute ( )
inline

execute all, make the interface the same as CAF

Definition at line 65 of file SpaceResolutionCalibration.h.

66 {
67 calibrate();
68 }

◆ getUpperBoundaryForFit()

double getUpperBoundaryForFit ( TGraphErrors * graph)
inlineprivate

search max point at boundary region

Definition at line 151 of file SpaceResolutionCalibration.h.

152 {
153 double ymax = 0;
154 double xmax = 0;
155 int imax = 0;
156 double x, y;
157 int unCount = floor(0.05 / m_binWidth);
158 int N = graph->GetN();
159 int Nstart = floor(0.5 * (N - unCount));
160 int Nend = N - unCount;
161 for (int i = Nstart; i < Nend; ++i) {
162 graph->GetPoint(i, x, y);
163 if (graph->GetErrorY(i) > 0.06E-3) continue;
164 if (y > ymax) {
165 xmax = x; ymax = y;
166 imax = i;
167 }
168 }
169 if (imax <= Nstart) {
170 graph->GetPoint(Nend, x, y);
171 xmax = x;
172 }
173 return xmax;
174 }

◆ inputFileNames()

virtual void inputFileNames ( std::string inputname)
inlinevirtual

Input root file names, results of collector module.

Definition at line 45 of file SpaceResolutionCalibration.h.

46 {
47 m_inputRootFileNames.assign(inputname);
48 }

◆ ProfileFileNames()

virtual void ProfileFileNames ( std::string profileFileName)
inlinevirtual

File name describe theta/alpha bin, if don't want to use default from input sigma.

Definition at line 52 of file SpaceResolutionCalibration.h.

53 {
54 m_ProfileFileName.assign(profileFileName);
55 }

◆ readProfile()

void readProfile ( )
protectedvirtual

read sigma bining (alpha, theta bining)

Definition at line 614 of file SpaceResolutionCalibration.cc.

615{
616 B2INFO("readProfile");
617 /*Read profile for xt*/
619 B2INFO("use Sigma bining from input Sigma");
622 B2INFO("Number of alpha bins: " << m_nalpha);
623 for (int i = 0; i < m_nalpha; ++i) {
624 l_alpha[i] = l_alpha_old[i]; u_alpha[i] = u_alpha_old[i]; ialpha[i] = ialpha_old[i];
625 B2INFO("" << i << " | " << l_alpha[i] << " " << u_alpha[i] << " " << ialpha[i]);
626 }
627 B2INFO("Number of theta bins: " << m_ntheta);
628 for (int i = 0; i < m_ntheta; ++i) {
629 l_theta[i] = l_theta_old[i]; u_theta[i] = u_theta_old[i]; itheta[i] = itheta_old[i];
630 B2INFO("" << i << " |" << l_theta[i] << " " << u_theta[i] << " " << itheta[i]);
631 }
632 } else {
633 B2INFO("use Sigma bining from profile file");
634 ifstream proxt(m_ProfileFileName.c_str());
635 if (!proxt) {
636 B2FATAL("file not found: " << m_ProfileFileName);
637 }
638 double dumy1, dumy2, dumy3;
639 proxt >> m_nalpha;
640 B2INFO("Number of alpha bins: " << m_nalpha);
641 if (m_nalpha > Max_nalpha) {B2FATAL("number of alpha bin excess limit; please increase uplimit: " << m_nalpha << " > " << Max_nalpha);}
642 for (int i = 0; i < m_nalpha; ++i) {
643 proxt >> dumy1 >> dumy2 >> dumy3;
644 l_alpha[i] = dumy1; u_alpha[i] = dumy2; ialpha[i] = dumy3;
645 B2INFO("" << i << " | " << l_alpha[i] << " " << u_alpha[i] << " " << ialpha[i]);
646 }
647 proxt >> m_ntheta;
648 B2INFO("Number of theta bins: " << m_ntheta);
649 if (m_ntheta > Max_ntheta) {B2FATAL("number of theta bin excess limit; please increase uplimit: " << m_ntheta << " > " << Max_ntheta);}
650 for (int i = 0; i < m_ntheta; ++i) {
651 proxt >> dumy1 >> dumy2 >> dumy3;
652 l_theta[i] = dumy1; u_theta[i] = dumy2; itheta[i] = dumy3;
653 B2INFO("" << i << " |" << l_theta[i] << " " << u_theta[i] << " " << itheta[i]);
654 }
655 }
656 B2INFO("Finish assign sigma bining");
657}
static const int Max_ntheta
maximum theta bin
bool m_useProfileFromInputSigma
Use binning from old sigma or new one form input.
double l_theta_old[7]
Lower boundaries of theta bins from input.
double l_alpha[18]
Lower boundaries of alpha bins.
int nalpha_old
number of alpha bins from input
double itheta_old[7]
represented alphas of theta bins from input.
double l_alpha_old[18]
Lower boundaries of alpha bins from input.
double u_theta_old[7]
Upper boundaries of theta bins from input.
double ialpha_old[18]
represented alphas of alpha bins from input.
double l_theta[7]
Lower boundaries of theta bins.
static const int Max_nalpha
Maximum alpha bin.
double u_alpha_old[18]
Upper boundaries of alpha bins from input.
int ntheta_old
number of theta bins from input

◆ readSigma()

void readSigma ( )
protectedvirtual

read sigma from previous calibration, (input sigma)

Definition at line 473 of file SpaceResolutionCalibration.cc.

474{
475 B2INFO("readSigma");
476 if (m_useDB) {
477 B2INFO("reading sigma from DB");
478 m_sResolFromDB = new DBObjPtr<CDCSpaceResols>;
480 B2INFO("Number of theta bins from input sigma: " << ntheta_old);
481 } else {
482 B2INFO("Read sigma from text");
484 B2INFO("number of alpha bins from input sigma: " << nalpha_old);
485 }
486}
DBObjPtr< CDCSpaceResols > * m_sResolFromDB
Database for sigma.
virtual void readSigmaFromText()
read sigma from text file

◆ readSigmaFromDB()

void readSigmaFromDB ( )
protectedvirtual

read sigma from DB

< angle bin info.

Definition at line 572 of file SpaceResolutionCalibration.cc.

573{
574 typedef std::array<float, 3> array3;
575 // std::cout <<"setSResol called" << std::endl;
576 nalpha_old = (*m_sResolFromDB)->getNoOfAlphaBins();
577 double rad2deg = 180 / M_PI;
578 for (unsigned short i = 0; i < nalpha_old; ++i) {
579 // m_alphaPoints[i] = (*dbXT_old)->getAlphaPoint(i);
580 array3 alpha = (*m_sResolFromDB)->getAlphaBin(i);
581 l_alpha_old[i] = alpha[0] * rad2deg;
582 u_alpha_old[i] = alpha[1] * rad2deg;
583 ialpha_old[i] = alpha[2] * rad2deg;
584 // std::cout << m_alphaPoints[i]*180./M_PI << std::endl;
585 }
586
587 ntheta_old = (*m_sResolFromDB)->getNoOfThetaBins();
588 B2INFO("Ntheta: " << ntheta_old);
589 for (unsigned short i = 0; i < ntheta_old; ++i) {
590 // m_thetaPoints[i] = (*dbXT_old).getThetaPoint(i);
591 array3 theta = (*m_sResolFromDB)->getThetaBin(i);
592 l_theta_old[i] = theta[0] * rad2deg;
593 u_theta_old[i] = theta[1] * rad2deg;
594 itheta_old[i] = theta[2] * rad2deg;
595 }
596 m_sigmaParamMode_old = (*m_sResolFromDB)->getSigmaParamMode();
597
598 for (unsigned short iCL = 0; iCL < c_maxNSenseLayers; ++iCL) {
599 for (unsigned short iLR = 0; iLR < 2; ++iLR) {
600 for (unsigned short iA = 0; iA < nalpha_old; ++iA) {
601 for (unsigned short iT = 0; iT < ntheta_old; ++iT) {
602 const std::vector<float> params = (*m_sResolFromDB)->getSigmaParams(iCL, iLR, iA, iT);
603 unsigned short np = params.size();
604 // std::cout <<"np4sigma= " << np << std::endl;
605 for (unsigned short i = 0; i < np; ++i) {
606 sigma_old[iCL][iLR][iA][iT][i] = params[i];
607 }
608 }
609 }
610 }
611 }
612
613}
double sigma_old[56][2][18][7][8]
old sigma parameters.
unsigned short m_sigmaParamMode_old
sigma mode from input.

◆ readSigmaFromText()

void readSigmaFromText ( )
protectedvirtual

read sigma from text file

Definition at line 488 of file SpaceResolutionCalibration.cc.

489{
490 ifstream ifs;
491 std::string fileName1 = "/data/cdc" + m_sigmafile;
492 std::string fileName = FileSystem::findFile(fileName1);
493 if (fileName == "") {
495 }
496 if (fileName == "") {
497 cout << "CDCGeometryPar: " << fileName << " not exist!" << endl;
498 } else {
499 cout << "CDCGeometryPar: " << fileName << " exists." << endl;
500 ifs.open(fileName);
501 if (!ifs) cout << "CDCGeometryPar: cannot open " << fileName << " !" << endl;
502 }
503
504 //read alpha bin info.
505 if (ifs >> nalpha_old) {
506 if (nalpha_old == 0 || nalpha_old > 18) cout << "Fail to read alpha bins !" << endl;
507 } else {
508 cout << "Fail to read alpha bins !" << endl; return;
509 }
510 double alpha0, alpha1, alpha2;
511 for (unsigned short i = 0; i < nalpha_old; ++i) {
512 ifs >> alpha0 >> alpha1 >> alpha2;
513 l_alpha_old[i] = alpha0;
514 u_alpha_old[i] = alpha1;
515 ialpha_old[i] = alpha2;
516 }
517
518 //read theta bin info.
519 if (ifs >> ntheta_old) {
520 if (ntheta_old == 0 || ntheta_old > 7) cout << "CDCGeometryPar: fail to read theta bins !" << endl;
521 } else {
522 cout << "CDCGeometryPar: fail to read theta bins !" << endl;
523 }
524 double theta0, theta1, theta2;
525 for (unsigned short i = 0; i < ntheta_old; ++i) {
526 ifs >> theta0 >> theta1 >> theta2;
527 l_theta_old[i] = theta0;
528 u_theta_old[i] = theta1;
529 itheta_old[i] = theta2;
530 }
531
532 unsigned short np = 0;
533 unsigned short iCL, iLR;
534 double theta, alpha;
535
536 ifs >> m_sigmaParamMode_old >> np;
537 double sigma[8];
538 // if (m_sigmaParamMode < 0 || m_sigmaParamMode > 1) cout<<"CDCGeometryPar: invalid sigma-parameterization mode read !"<<endl;
539 //if (m_sigmaParamMode == 1) cout<<"CDCGeometryPar: sigma-parameterization mode=1 not ready yet"<<endl;
540 // if (np <= 0 || np > nSigmaParams) cout<<"CDCGeometryPar: no. of sigma-params. outside limits !"<<endl;
541 const double epsi = 0.1;
542 while (ifs >> iCL) {
543 ifs >> theta >> alpha >> iLR;
544 for (int i = 0; i < np; ++i) {
545 ifs >> sigma[i];
546 }
547
548 int ith = -99;
549 for (unsigned short i = 0; i < ntheta_old; ++i) {
550 if (fabs(theta - itheta_old[i]) < epsi) {
551 ith = i;
552 break;
553 }
554 }
555 if (ith < 0) cout << "CDCGeometryPar: thetas in sigma.dat are inconsistent !" << endl;
556
557 int ial = -99;
558 for (unsigned short i = 0; i < nalpha_old; ++i) {
559 if (fabs(alpha - ialpha_old[i]) < epsi) {
560 ial = i;
561 break;
562 }
563 }
564 if (ial < 0) cout << "CDCGeometryPar: alphas in sigma.dat are inconsistent !" << endl;
565
566 for (int i = 0; i < np; ++i) {
567 sigma_old[iCL][iLR][ial][ith][i] = sigma[i];
568 }
569 } //end of while loop
570 ifs.close();
571}
std::string m_sigmafile
Sigma file name, for text mode.
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...

◆ setBinWidth()

virtual void setBinWidth ( double bw)
inlinevirtual

Bin width of each slide.

Definition at line 41 of file SpaceResolutionCalibration.h.

41{m_binWidth = bw;}

◆ setDebug()

virtual void setDebug ( bool debug = false)
inlinevirtual

Debug or not.

Definition at line 33 of file SpaceResolutionCalibration.h.

33{m_debug = debug; }

◆ setMinimumNDF()

virtual void setMinimumNDF ( double minndf)
inlinevirtual

minimum NDF required for track

Definition at line 37 of file SpaceResolutionCalibration.h.

37{m_ndfmin = minndf;}

◆ setMinimumPval()

virtual void setMinimumPval ( double minPval)
inlinevirtual

Minimum Pval required.

Definition at line 39 of file SpaceResolutionCalibration.h.

39{m_Pvalmin = minPval;}

◆ setSigmaFileName()

virtual void setSigmaFileName ( std::string name)
inlinevirtual

Output sigma file name, for text mode.

Definition at line 62 of file SpaceResolutionCalibration.h.

62{m_sigmafile.assign(name);}

◆ setStoreHisto()

virtual void setStoreHisto ( bool storeHist = false)
inlinevirtual

Store histograms during the calibration or not.

Definition at line 50 of file SpaceResolutionCalibration.h.

50{m_storeHisto = storeHist;}

◆ setUseDB()

virtual void setUseDB ( bool useDB = false)
inlinevirtual

Use database or text mode.

Definition at line 35 of file SpaceResolutionCalibration.h.

35{m_useDB = useDB; }

◆ storeHisto()

void storeHisto ( )
protectedvirtual

store histogram

Definition at line 374 of file SpaceResolutionCalibration.cc.

375{
376 B2INFO("storeHisto");
377 TFile* ff = new TFile("sigma_histo.root", "RECREATE");
378 TDirectory* top = gDirectory;
379 TDirectory* Direct[56];
380
381 for (int il = 0; il < 56; ++il) {
382 top->cd();
383 Direct[il] = gDirectory->mkdir(Form("lay_%d", il));
384 Direct[il]->cd();
385 for (int lr = 0; lr < 2; ++lr) {
386 for (int al = 0; al < m_nalpha; ++al) {
387 for (int th = 0; th < m_ntheta; ++th) {
388 if (!gr[il][lr][al][th]) continue;
389 if (!gfit[il][lr][al][th]) continue;
390 if (m_fitflag[il][lr][al][th] == 1) {
391 hist_b[il][lr][al][th]->Write();
392 hist_u[il][lr][al][th]->Write();
393 hb_m[il][lr][al][th]->Write();
394 hb_s[il][lr][al][th]->Write();
395 hu_m[il][lr][al][th]->Write();
396 hu_s[il][lr][al][th]->Write();
397 gr[il][lr][al][th]->Write();
398 gfit[il][lr][al][th]->Write();
399 }
400 }
401 }
402 }
403 }
404 ff->Close();
405 B2INFO("Finish store histogram");
406}

◆ useProfileFromInputSigma()

virtual void useProfileFromInputSigma ( bool useProfileFromInputSigma)
inlinevirtual

use sigma bin profile form input sigma or new one from input file

Definition at line 57 of file SpaceResolutionCalibration.h.

58 {
59 m_useProfileFromInputSigma = useProfileFromInputSigma;
60 }

◆ write()

void write ( )
protectedvirtual

save calibration, in text file or db

Definition at line 407 of file SpaceResolutionCalibration.cc.

408{
409
410 B2INFO("Exporting parameters...");
411 int nfitted = 0;
412 int nfailure = 0;
413 /* Write the fit params*/
414
415 ofstream ofs(m_outputSigmaFileName.c_str());
416 ofs << m_nalpha << endl;
417 for (int i = 0; i < m_nalpha; ++i) {
418 ofs << std::setprecision(4) << l_alpha[i] << " " << std::setprecision(4) << u_alpha[i] << " " << std::setprecision(
419 4) << ialpha[i] << endl;
420 }
421
422 ofs << m_ntheta << endl;
423 for (int i = 0; i < m_ntheta; ++i) {
424 ofs << std::setprecision(4) << l_theta[i] << " " << std::setprecision(4) << u_theta[i] << " " << std::setprecision(
425 4) << itheta[i] << endl;
426 }
427
428 ofs << 0 << " " << 7 << endl; //mode and number of params;
429 for (int al = 0; al < m_nalpha; ++al) {
430 for (int th = 0; th < m_ntheta; ++th) {
431 for (int i = 0; i < 56; ++i) {
432 for (int lr = 1; lr >= 0; --lr) {
433 // ffit[i][lr][al][th]->GetParameters(par);
434 ofs << i << std::setw(4) << itheta[th] << std::setw(4) << ialpha[al] << std::setw(4) << lr << std::setw(15);
435 if (m_fitflag[i][lr][al][th] == 1) {
436 nfitted += 1;
437 for (int p = 0; p < 7; ++p) {
438 if (p != 6) { ofs << std::setprecision(7) << sigma_new[i][lr][al][th][p] << std::setw(15);}
439 if (p == 6) { ofs << std::setprecision(7) << sigma_new[i][lr][al][th][p] << std::endl;}
440 }
441 } else {
442 B2WARNING("Fitting error and old sigma will be used. (Layer " << i << ") (lr = " << lr << ") (al = " << al << ") (th = " << th <<
443 ")");
444 nfailure += 1;
445 int ial_old = 0;
446 int ith_old = 0;
447 for (int k = 0; k < nalpha_old; ++k) {
448 if (ialpha[al] < u_alpha_old[k]) {ial_old = k; break;}
449 }
450 for (int j = 0; j < ntheta_old; ++j) {
451 if (itheta[th] < u_theta_old[j]) {ith_old = j; break;}
452 }
453 for (int p = 0; p < 7; ++p) {
454 if (p != 6) { ofs << std::setprecision(7) << sigma_old[i][lr][ial_old][ith_old][p] << std::setw(15);}
455 if (p == 6) { ofs << std::setprecision(7) << sigma_old[i][lr][ial_old][ith_old][p] << std::endl;}
456 }
457 }
458 }
459 }
460 }
461 }
462 ofs.close();
463 B2RESULT("Number of histogram: " << 56 * 2 * m_nalpha * m_ntheta);
464 B2RESULT("Histos successfully fitted: " << nfitted);
465 B2RESULT("Histos fit failure: " << nfailure);
466 if (m_useDB) {
467 CDCDatabaseImporter import(0, 0, -1, -1);
468 import.importSigma(m_outputSigmaFileName.c_str());
469 }
470
471
472}
std::string m_outputSigmaFileName
Output sigma file name.

Member Data Documentation

◆ gfit

TGraphErrors* gfit[56][2][18][7] = {}
private

sigma*sigma graph for fit

Definition at line 106 of file SpaceResolutionCalibration.h.

106{};

◆ gr

TGraphErrors* gr[56][2][18][7] = {}
private

sigma graph.

Definition at line 107 of file SpaceResolutionCalibration.h.

107{};

◆ hb_m

TH1F* hb_m[56][2][Max_nalpha][Max_ntheta] = {}
private

mean histogram of unbiased residual

Definition at line 112 of file SpaceResolutionCalibration.h.

112{};

◆ hb_s

TH1F* hb_s[56][2][Max_nalpha][Max_ntheta] = {}
private

sigma histogram of ubiased residual

Definition at line 113 of file SpaceResolutionCalibration.h.

113{};

◆ hist_b

TH2F* hist_b[56][2][Max_nalpha][Max_ntheta] = {}
private

2D histogram of biased residual

Definition at line 108 of file SpaceResolutionCalibration.h.

108{};

◆ hist_u

TH2F* hist_u[56][2][Max_nalpha][Max_ntheta] = {}
private

2D histogram of unbiased residual

Definition at line 109 of file SpaceResolutionCalibration.h.

109{};

◆ hu_m

TH1F* hu_m[56][2][Max_nalpha][Max_ntheta] = {}
private

mean histogram biased residual

Definition at line 110 of file SpaceResolutionCalibration.h.

110{};

◆ hu_s

TH1F* hu_s[56][2][Max_nalpha][Max_ntheta] = {}
private

sigma histogram of biased residual

Definition at line 111 of file SpaceResolutionCalibration.h.

111{};

◆ ialpha

double ialpha[18] = {}
private

represented alphas of alpha bins.

Definition at line 130 of file SpaceResolutionCalibration.h.

130{};

◆ ialpha_old

double ialpha_old[18] = {}
private

represented alphas of alpha bins from input.

Definition at line 140 of file SpaceResolutionCalibration.h.

140{};

◆ itheta

double itheta[7] = {}
private

represented alphas of theta bins.

Definition at line 133 of file SpaceResolutionCalibration.h.

133{};

◆ itheta_old

double itheta_old[7] = {}
private

represented alphas of theta bins from input.

Definition at line 143 of file SpaceResolutionCalibration.h.

143{};

◆ l_alpha

double l_alpha[18] = {}
private

Lower boundaries of alpha bins.

Definition at line 128 of file SpaceResolutionCalibration.h.

128{};

◆ l_alpha_old

double l_alpha_old[18] = {}
private

Lower boundaries of alpha bins from input.

Definition at line 138 of file SpaceResolutionCalibration.h.

138{};

◆ l_theta

double l_theta[7] = {}
private

Lower boundaries of theta bins.

Definition at line 131 of file SpaceResolutionCalibration.h.

131{};

◆ l_theta_old

double l_theta_old[7] = {}
private

Lower boundaries of theta bins from input.

Definition at line 141 of file SpaceResolutionCalibration.h.

141{};

◆ m_BField

bool m_BField = true
private

Work with BField, fit range and initial parameters is different incase B and noB.

Definition at line 101 of file SpaceResolutionCalibration.h.

◆ m_binWidth

double m_binWidth = 0.05
private

width of each bin, unit cm

Definition at line 95 of file SpaceResolutionCalibration.h.

◆ m_debug

bool m_debug = false
private

Debug or not.

Definition at line 96 of file SpaceResolutionCalibration.h.

◆ m_fitflag

int m_fitflag[56][2][Max_nalpha][Max_ntheta] = {{{{0}}}}
private

Fit flag; 1:OK ; 0:error.

Definition at line 114 of file SpaceResolutionCalibration.h.

114{{{{0}}}} ;

◆ m_inputRootFileNames

std::string m_inputRootFileNames = "rootfile/output*"
private

Input root file names.

Definition at line 117 of file SpaceResolutionCalibration.h.

◆ m_nalpha

int m_nalpha = 0
private

number of alpha bins

Definition at line 126 of file SpaceResolutionCalibration.h.

◆ m_ndfmin

double m_ndfmin = 5
private

Minimum NDF.

Definition at line 93 of file SpaceResolutionCalibration.h.

◆ m_ntheta

int m_ntheta = 0
private

number of theta bins

Definition at line 127 of file SpaceResolutionCalibration.h.

◆ m_outputSigmaFileName

std::string m_outputSigmaFileName = "sigma_new.dat"
private

Output sigma file name.

Definition at line 116 of file SpaceResolutionCalibration.h.

◆ m_ProfileFileName

std::string m_ProfileFileName = "sigma_profile"
private

Profile file name.

Definition at line 118 of file SpaceResolutionCalibration.h.

◆ m_Pvalmin

double m_Pvalmin = 0.
private

Minimum Prob(chi2) of track.

Definition at line 94 of file SpaceResolutionCalibration.h.

◆ m_sigmafile

std::string m_sigmafile = "cdc/data/sigma.dat"
private

Sigma file name, for text mode.

Definition at line 120 of file SpaceResolutionCalibration.h.

◆ m_sigmaParamMode_old

unsigned short m_sigmaParamMode_old = 0
private

sigma mode from input.

Definition at line 145 of file SpaceResolutionCalibration.h.

◆ m_sResolFromDB

DBObjPtr<CDCSpaceResols>* m_sResolFromDB = nullptr
private

Database for sigma.

Definition at line 119 of file SpaceResolutionCalibration.h.

◆ m_storeHisto

bool m_storeHisto = false
private

Store histogram or not.

Definition at line 98 of file SpaceResolutionCalibration.h.

◆ m_useDB

bool m_useDB = false
private

use db or text mode

Definition at line 99 of file SpaceResolutionCalibration.h.

◆ m_useProfileFromInputSigma

bool m_useProfileFromInputSigma = true
private

Use binning from old sigma or new one form input.

Definition at line 100 of file SpaceResolutionCalibration.h.

◆ Max_nalpha

const int Max_nalpha = 18
staticprivate

Maximum alpha bin.

Definition at line 89 of file SpaceResolutionCalibration.h.

◆ Max_np

const unsigned short Max_np = 40
staticprivate

Maximum number of point =1/binwidth.

Definition at line 91 of file SpaceResolutionCalibration.h.

◆ Max_ntheta

const int Max_ntheta = 7
staticprivate

maximum theta bin

Definition at line 90 of file SpaceResolutionCalibration.h.

◆ nalpha_old

int nalpha_old = 0
private

number of alpha bins from input

Definition at line 136 of file SpaceResolutionCalibration.h.

◆ ntheta_old

int ntheta_old = 0
private

number of theta bins from input

Definition at line 137 of file SpaceResolutionCalibration.h.

◆ sigma_new

double sigma_new[56][2][18][7][8] = {}
private

new sigma parameters.

Definition at line 104 of file SpaceResolutionCalibration.h.

104{};

◆ sigma_old

double sigma_old[56][2][18][7][8] = {}
private

old sigma parameters.

Definition at line 103 of file SpaceResolutionCalibration.h.

103{};

◆ u_alpha

double u_alpha[18] = {}
private

Upper boundaries of alpha bins.

Definition at line 129 of file SpaceResolutionCalibration.h.

129{};

◆ u_alpha_old

double u_alpha_old[18] = {}
private

Upper boundaries of alpha bins from input.

Definition at line 139 of file SpaceResolutionCalibration.h.

139{};

◆ u_theta

double u_theta[7] = {}
private

Upper boundaries of theta bins.

Definition at line 132 of file SpaceResolutionCalibration.h.

132{};

◆ u_theta_old

double u_theta_old[7] = {}
private

Upper boundaries of theta bins from input.

Definition at line 142 of file SpaceResolutionCalibration.h.

142{};

The documentation for this class was generated from the following files: