47 TFolder* fdPreXt = (TFolder*)fhist->Get(
"PreXt");
48 TFolder* fdNhit = (TFolder*)fhist->Get(
"XtNhit");
52 for(
int lay=0; lay<
NLAYER; lay++){
53 sprintf(hname,
"trec%02d", lay);
54 hist = (TH1F*)fdPreXt->FindObjectAny(hname);
55 m_htrec[lay]->Add(hist);
57 sprintf(hname,
"nhitBin%02d", lay);
58 hist = (TH1F*)fdNhit->FindObjectAny(hname);
59 m_nhitBin[lay]->Add(hist);
62 hist = (TH1F*)fdNhit->FindObjectAny(
"nhitTot");
67 double pi = 3.141592653;
68 double dist[NPreXtBin];
72 TF1* funXt =
new TF1(
"funXt", xtfun, 0, 300, 6);
73 funXt -> FixParameter(0, 0.0);
74 funXt -> SetParameter(1, 0.03);
75 funXt -> SetParameter(2, 0.0);
76 funXt -> SetParameter(3, 0.0);
77 funXt -> SetParameter(4, 0.0);
78 funXt -> SetParameter(5, 0.0);
80 ofstream fxtlog(
"preXtpar.dat");
81 for(
int lay=0; lay<
NLAYER; lay++){
82 sprintf(hname,
"mgrPreXt%02d", lay);
83 m_grXt[lay] =
new TGraph();
84 m_grXt[lay] -> SetName(hname);
86 m_fdPreXt -> Add(m_grXt[lay]);
88 double layRad = m_pGeom -> getLayer(lay) -> getLayerRad();
89 int ncel = m_pGeom -> getLayer(lay) -> getNcell();
90 double dm =
pi * layRad / (double)ncel;
91 Double_t nTot = m_nhitTot->GetBinContent(lay+1);
92 double tm = calconst->
getXtpar(lay, 0, 0, 6);
94 fxtlog <<
"layer " << lay << endl;
96 Double_t nhitBin = m_nhitBin[lay]->GetBinContent(
bin+1);
97 dist[
bin] = dm * nhitBin / nTot;
98 m_grXt[lay] -> SetPoint(
bin, m_tbin[
bin], dist[
bin]);
99 fxtlog << setw(4) <<
bin << setw(15) << m_tbin[
bin]
100 << setw(15) << dist[
bin] << setw(15) << dm
101 << setw(10) << nhitBin
102 << setw(10) << nTot << endl;
104 if(m_tbin[
bin] >= tm)
break;
108 m_grXt[lay] ->
Fit(funXt,
"Q",
"", 0.0, tm);
109 for(
int ord=0; ord<6; ord++) xtpar[ord] = funXt -> GetParameter(ord);
111 for(
int iEntr=0; iEntr<
NENTRXT; iEntr++){
112 for(
int iLR=0; iLR<
NLR; iLR++){
113 for(
int ord=0; ord<6; ord++){
114 calconst -> resetXtpar(lay, iEntr, iLR, ord, xtpar[ord]);
119 for(
int ord=0; ord<6; ord++) xtpar[ord] = calconst->
getXtpar(lay, 0, 0, ord);
122 for(
int ord=0; ord<6; ord++) fxtlog << setw(14) << xtpar[ord];
123 fxtlog << setw(10) << tm <<
" 0" << endl;
126 cout <<
"preXt.dat was written." << endl;