47double xtFun(
double t,
double xtpar[]){
53 for(ord=0; ord<=5; ord++){
54 dist += xtpar[ord] * pow(
t, ord);
57 for(ord=0; ord<=5; ord++){
58 dist += xtpar[ord] * pow(tm, ord);
60 dist += xtpar[7] * (
t - tm);
66void fcnXT(Int_t &npar, Double_t *gin, Double_t &
f, Double_t *par, Int_t iflag){
73 for(i=0; i<
TBINCEN.size(); i++){
75 for(ord=0; ord<=5; ord++){
76 dfit += par[ord] * pow(
TBINCEN[i], ord);
85void fcnXtEdge(Int_t &npar, Double_t *gin, Double_t &
f, Double_t *par, Int_t iflag){
102 for(Int_t ord=0; ord<6; ord++){
103 val += par[ord] * pow(
x[0], ord);
109 double val =
Dmax + (
x[0] -
Tmax) * par[0];
114 TFile fout(
"MdcCalibConst_new.root",
"recreate");
118 TTree *xttree =
new TTree(
"XtTree",
"XtTree");
119 xttree ->
Branch(
"xtkey", &
key,
"key/I");
120 xttree ->
Branch(
"xtpar", &xtpar,
"xtpar/D");
121 for(
int lay=0; lay<43; lay++){
122 for(
int entr=0; entr<18; entr++){
123 for(
int lr=0; lr<3; lr++){
124 for(
int ord=0; ord<8; ord++){
126 xtpar = calconst->
getXtpar(lay, entr, lr, ord);
135 TTree *t0tree =
new TTree(
"T0Tree",
"T0Tree");
136 t0tree ->
Branch(
"t0", &t0,
"t0/D");
137 t0tree ->
Branch(
"delt0", &delt0,
"delt0/D");
138 for(
int wid=0; wid<6796; wid++){
139 t0 = calconst->
getT0(wid);
145 TTree *qttree =
new TTree(
"QtTree",
"QtTree");
146 qttree ->
Branch(
"qtpar0", &(qtval[0]),
"qtpar0/D");
147 qttree ->
Branch(
"qtpar1", &(qtval[1]),
"qtpar1/D");
148 for(
int lay=0; lay<43; lay++){
155 TTree *sdtree =
new TTree(
"SdTree",
"SdTree");
156 sdtree ->
Branch(
"sdkey", &
key,
"key/I");
157 sdtree ->
Branch(
"sdpar", &sdpar,
"sdpar/D");
158 for(
int lay=0; lay<43; lay++){
159 for(
int entr=0; entr<6; entr++){
160 for(
int lr=0; lr<2; lr++){
175 if((newXtList->GetEntries()) > 0) newXtList ->
Write();
176 if((r2tList->GetEntries()) > 0) r2tList ->
Write();
182 vector<string> fnames;
185 "JobOutputDir=`/bin/ls -dt1 joboutput-* 2>/dev/null | head -1`\n"
186 "if [ -d \"${JobOutputDir}\" ]; then\n"
187 " find ${JobOutputDir} -name hist.root\n"
191 stringstream fnstream;
193 char* fnbuf =
new char[1024];
194 FILE* fstream = popen(command.c_str(),
"r");
196 while ( fgets(fnbuf, 1024, fstream) !=
NULL ) {
201 while ( ! (fnstream>>fname).eof() ) {
202 fnames.push_back(fname);
208 if ( fnames.empty() ) {
209 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", newpath.c_str());
224 string command1(com1);
226 "if [ -d \"${JobOutputDir}\" ]; then\n"
227 " find ${JobOutputDir} -name hist.root\n"
230 string command = command1 + command2;
231 stringstream fnstream;
233 char* fnbuf =
new char[1024];
234 FILE* fstream = popen(command.c_str(),
"r");
236 while ( fgets(fnbuf, 1024, fstream) !=
NULL ) {
241 while ( ! (fnstream>>fname).eof() ) {
242 fnames.push_back(fname);
248 if ( fnames.empty() ) {
249 cout <<
"ERROR: Failed to retrieve hist files!" << endl;
curve Branch("CurveSize",&CurveSize,"CurveSize/I")
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