66 {
67 double pi = 3.141592653;
68 double dist[NPreXtBin];
69 double xtpar[6];
70 char hname[200];
71
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);
79
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]);
87
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);
93
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;
103
104 if(m_tbin[
bin] >= tm)
break;
105 }
106
108 m_grXt[lay] ->
Fit(funXt,
"Q",
"", 0.0, tm);
109 for(int ord=0; ord<6; ord++) xtpar[ord] = funXt -> GetParameter(ord);
110
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]);
115 }
116 }
117 }
118 } else{
119 for(
int ord=0; ord<6; ord++) xtpar[ord] = calconst->
getXtpar(lay, 0, 0, ord);
120 }
121
122 for(int ord=0; ord<6; ord++) fxtlog << setw(14) << xtpar[ord];
123 fxtlog << setw(10) << tm << " 0" << endl;
124 }
125 fxtlog.close();
126 cout << "preXt.dat was written." << endl;
127
128 renameHist();
129 delete funXt;
130}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
double getXtpar(int lay, int entr, int lr, int order)