47double xtFun(
double t,
double xtpar[] ) {
54 for ( ord = 0; ord <= 5; ord++ ) { dist += xtpar[ord] * pow(
t, ord ); }
58 for ( ord = 0; ord <= 5; ord++ ) { dist += xtpar[ord] * pow( tm, ord ); }
59 dist += xtpar[7] * (
t - tm );
65void fcnXT( Int_t& npar, Double_t* gin, Double_t&
f, Double_t* par, Int_t iflag ) {
72 for ( i = 0; i <
TBINCEN.size(); i++ )
75 for ( ord = 0; ord <= 5; ord++ ) { dfit += par[ord] * pow(
TBINCEN[i], ord ); }
83void fcnXtEdge( Int_t& npar, Double_t* gin, Double_t&
f, Double_t* par, Int_t iflag ) {
99Double_t
xtFitFun( Double_t* x, Double_t par[] ) {
101 for ( Int_t ord = 0; ord < 6; ord++ ) { val += par[ord] * pow( x[0], ord ); }
106 double val =
Dmax + ( x[0] -
Tmax ) * par[0];
111 TFile fout(
"MdcCalibConst_new.root",
"recreate" );
115 TTree* xttree =
new TTree(
"XtTree",
"XtTree" );
116 xttree->Branch(
"xtkey", &
key,
"key/I" );
117 xttree->Branch(
"xtpar", &xtpar,
"xtpar/D" );
118 for (
int lay = 0; lay < 43; lay++ )
120 for (
int entr = 0; entr < 18; entr++ )
122 for (
int lr = 0; lr < 3; lr++ )
124 for (
int ord = 0; ord < 8; ord++ )
127 xtpar = calconst->
getXtpar( lay, entr, lr, ord );
136 TTree* t0tree =
new TTree(
"T0Tree",
"T0Tree" );
137 t0tree->Branch(
"t0", &t0,
"t0/D" );
138 t0tree->Branch(
"delt0", &delt0,
"delt0/D" );
139 for (
int wid = 0; wid < 6796; wid++ )
141 t0 = calconst->
getT0( wid );
147 TTree* qttree =
new TTree(
"QtTree",
"QtTree" );
148 qttree->Branch(
"qtpar0", &( qtval[0] ),
"qtpar0/D" );
149 qttree->Branch(
"qtpar1", &( qtval[1] ),
"qtpar1/D" );
150 for (
int lay = 0; lay < 43; lay++ )
158 TTree* sdtree =
new TTree(
"SdTree",
"SdTree" );
159 sdtree->Branch(
"sdkey", &
key,
"key/I" );
160 sdtree->Branch(
"sdpar", &sdpar,
"sdpar/D" );
161 for (
int lay = 0; lay < 43; lay++ )
163 for (
int entr = 0; entr < 6; entr++ )
165 for (
int lr = 0; lr < 2; lr++ )
182 if ( ( newXtList->GetEntries() ) > 0 ) newXtList->Write();
183 if ( ( r2tList->GetEntries() ) > 0 ) r2tList->Write();
188 vector<string> fnames;
190 string command(
"JobOutputDir=`/bin/ls -dt1 joboutput-* 2>/dev/null | head -1`\n"
191 "if [ -d \"${JobOutputDir}\" ]; then\n"
192 " find ${JobOutputDir} -name hist.root\n"
195 stringstream fnstream;
197 char* fnbuf =
new char[1024];
198 FILE* fstream = popen( command.c_str(),
"r" );
200 while ( fgets( fnbuf, 1024, fstream ) != NULL ) { fnstream << fnbuf; }
203 while ( !( fnstream >> fname ).eof() ) { fnames.push_back( fname ); }
208 if ( fnames.empty() )
210 cout <<
"WARNING: Failed to retrieve hist files in the current directory!" << endl;
217 vector<string> fnames;
218 string newpath = path;
219 string::size_type strl = newpath.length();
220 if ( ( strl > 1 ) && (
'/' == newpath[strl - 1] ) ) newpath.erase( strl - 1 );
223 sprintf( com1,
"JobOutputDir=`/bin/ls -dt1 %s/joboutput-* 2>/dev/null | head -1`\n",
225 string command1( com1 );
226 string command2(
"if [ -d \"${JobOutputDir}\" ]; then\n"
227 " find ${JobOutputDir} -name hist.root\n"
229 string command = command1 + command2;
230 stringstream fnstream;
232 char* fnbuf =
new char[1024];
233 FILE* fstream = popen( command.c_str(),
"r" );
235 while ( fgets( fnbuf, 1024, fstream ) != NULL ) { fnstream << fnbuf; }
238 while ( !( fnstream >> fname ).eof() ) { fnames.push_back( fname ); }
243 if ( fnames.empty() )
245 cout <<
"ERROR: Failed to retrieve hist files!" << endl;
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
*******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 xtFun(double t, double xtpar[])
Double_t xtFitEdge(Double_t *x, Double_t par[])
void fcnXT(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
double gTminFitRange[NLAYER][2]
double gTmaxFitRange[NLAYER][2]
void fcnXtEdge(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
Double_t xtFitFun(Double_t *x, Double_t par[])
void writeConst(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)
vector< string > getHistList()
vector< double > TBINCENED
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
int getXtKey(int lay, int entr, int lr, int order) const
double getT0(int wireid) const
double getXtpar(int lay, int entr, int lr, int order)
double getSdpar(int lay, int entr, int lr, int bin)
int getSdKey(int lay, int entr, int lr, int bin) const
double getDelT0(int wireid) const
double getQtpar1(int lay) const
double getQtpar0(int lay) const