25 m_fdXt =
new TFolder(
"mfdxt",
"fdxt");
28 m_haxis =
new TH2F(
"axis",
"", 50, 0, 300, 50, 0, 9);
29 m_haxis -> SetStats(0);
30 m_fdXt -> Add(m_haxis);
33 for(
int lay=0; lay<
NLAYER; lay++){
34 for(
int iEntr=0; iEntr<
NENTRXT; iEntr++){
35 for(
int lr=0; lr<
NLR; lr++){
36 m_nhitIn[lay][iEntr][lr] = 0;
37 m_nhitEd[lay][iEntr][lr] = 0;
39 sprintf(hname,
"mgrXt%02d_%02d_lr%01d", lay, iEntr, lr);
40 m_grxt[lay][iEntr][lr] =
new TGraph();
41 m_grxt[lay][iEntr][lr] -> SetName(hname);
44 m_fdXt -> Add(m_grxt[lay][iEntr][lr]);
55 TFolder* fd = (TFolder*)fhist->Get(
"fdXtGr");
56 for(
int lay=0; lay<
NLAYER; lay++){
57 for(
int iEntr=0; iEntr<
NENTRXT; iEntr++){
58 for(
int lr=0; lr<
NLR; lr++){
59 if((m_nhitIn[lay][iEntr][lr] > m_maxNhit) && (m_nhitEd[lay][iEntr][lr] > m_nMaxEd))
continue;
61 sprintf(hname,
"grXt%02d_%02d_lr%01d", lay, iEntr, lr);
62 TGraph*
gr = (TGraph*)fd->FindObjectAny(hname);
63 int nPoint =
gr->GetN();
64 for(
int i=0; i<nPoint; i++){
65 gr->GetPoint(i, tdr, doca);
66 if((tdr < m_tEd[lay]) && (m_nhitIn[lay][iEntr][lr] <= m_maxNhit)){
67 int np = m_grxt[lay][iEntr][lr]->GetN();
68 m_grxt[lay][iEntr][lr]->SetPoint(np, tdr, doca);
69 m_nhitIn[lay][iEntr][lr]++;
70 }
else if((tdr >= m_tEd[lay]) && (m_nhitEd[lay][iEntr][lr] <= m_nMaxEd)){
71 int np = m_grxt[lay][iEntr][lr]->GetN();
72 m_grxt[lay][iEntr][lr]->SetPoint(np, tdr, doca);
73 m_nhitEd[lay][iEntr][lr]++;
86 TF1* fxtDr =
new TF1(
"fxtDr",
xtFitFun, 0, 300, 6);
87 TF1* fxtEd =
new TF1(
"fxtEd",
xtFitEdge, 150, 500, 1);
88 if(1 ==
gfixXtC0) fxtDr -> FixParameter(0, 0);
90 for(
int lay=0; lay<
NLAYER; lay++){
91 for(
int iEntr=0; iEntr<
NENTRXT; iEntr++){
92 for(
int lr=0; lr<
NLR; lr++){
93 m_fgFit[lay][iEntr][lr] =
false;
96 if(m_nhitIn[lay][iEntr][lr] > 1000){
97 Tmax = calconst -> getXtpar(lay, iEntr, lr, 6);
99 m_grxt[lay][iEntr][lr] ->
Fit(
"fxtDr",
"Q+",
"", 0,
Tmax);
100 for(ord=0; ord<6; ord++){
101 xtpar[lay][iEntr][lr][ord] = fxtDr->GetParameter(ord);
103 xtpar[lay][iEntr][lr][6] =
Tmax;
106 for(ord=0; ord<6; ord++)
Dmax += xtpar[lay][iEntr][lr][ord] * pow(
Tmax, ord);
108 if(m_nhitEd[lay][iEntr][lr] > 300){
109 m_grxt[lay][iEntr][lr] ->
Fit(
"fxtEd",
"Q+",
"",
Tmax,
Tmax+300);
110 xtpar[lay][iEntr][lr][7] = fxtEd->GetParameter(0);
111 if(xtpar[lay][iEntr][lr][7] < 0.0) xtpar[lay][iEntr][lr][7] = 0.0;
113 xtpar[lay][iEntr][lr][7] = 0.0;
116 m_fgFit[lay][iEntr][lr] =
true;
123 ofstream fxtlog(
"xtlog");
124 for(
int lay=0; lay<
NLAYER; lay++){
125 for(
int iEntr=0; iEntr<
NENTRXT; iEntr++){
126 for(
int lr=0; lr<
NLR; lr++){
127 fxtlog << setw(3) << lay << setw(3) << iEntr << setw(3) << lr;
130 if(m_fgFit[lay][iEntr][lr]){
132 for(ord=0; ord<8; ord++) calconst->
resetXtpar(lay, iEntr, lr, ord, xtpar[lay][iEntr][lr][ord]);
134 int iEntrNew = findXtEntr(lay, iEntr, lr);
137 for(ord=0; ord<8; ord++){
138 calconst->
resetXtpar(lay, iEntr, lr, ord, xtpar[lay][iEntrNew][lr][ord]);
142 fxtlog << setw(3) << fgUpdate;
143 for(ord=0; ord<8; ord++){
144 double par = calconst -> getXtpar(lay, iEntr, lr, ord);
145 if(6==ord) fxtlog << setw(9) << par;
146 else fxtlog << setw(14) << par;
154 cout <<
"Xt update finished. File xtlog was written." << endl;