StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fitHisto.C
1 void fitHisto(){
2 
3 
4  for (int i=0; i<3; i++)// have to be consistent with StPidProbabilityConst.hh
5  for (int j=0; j<2; j++)
6  for (int k=0; k<2; k++) fit(i,j,k);
7 
8 
9 }
10 
11 
12 void fit(int i, int j, int k){ //mult, dca, charge
13 
14  gROOT->Reset();
15 
16  char* sigmaOfSigmTrialInputName = new char[80];
17  sprintf(sigmaOfSigmTrialInputName,"PidHisto_%d00.root",i);
18 
19  char* sigmaOfSigmTrialOutputName = new char[80];
20  sprintf(sigmaOfSigmTrialOutputName,"PidSigmaOfSingleTrail_%d%d%d_basedOn_%d00.txt",i,j,k,i);
21 
22  char* phaseSpaceCalibInputName = new char[80];
23  sprintf(phaseSpaceCalibInputName,"./PidHisto_%d01.root",i);
24 
25  char* phaseSpaceCalibOutputName = new char[80];
26  sprintf(phaseSpaceCalibOutputName, "./PhaseSpaceCalib%d%d%dButItisbasedOn_%d01.txt",i,j,k,i);
27 
28  char* gausFitInputName = new char[80];
29  sprintf(gausFitInputName,"./PidHisto_%d%d%d.root",i,j,k);
30 
31  char* gausFitOutputName = new char[80];
32  sprintf(gausFitOutputName,"./PidHistoFitted_%d%d%d.root",i,j,k);
33 
34  char* ampFitOutputName = new char[80];
35  sprintf(ampFitOutputName,"./PidHistoAmp_%d%d%d.root",i,j,k);
36 
37  gSystem->Load("St_base");
38  gSystem->Load("StChain");
39 
40  gSystem->Load("libgen_Tables");
41  gSystem->Load("libsim_Tables");
42  gSystem->Load("libglobal_Tables");
43 
44  gSystem->Load("StUtilities");
45  gSystem->Load("StIOMaker");
46  gSystem->Load("StTreeMaker");
47  gSystem->Load("StarClassLibrary");
48  gSystem->Load("StEvent");
49  gSystem->Load("StEventUtilities");
50  gSystem->Load("StMagF");
51 
52  gSystem->Load("StFlowMaker");
53 
54  gSystem->Load("PIDFitter");
55 
56  PIDFitter myfitter;
57 
58 
59 
60  myfitter.Process( sigmaOfSigmTrialInputName,
61  sigmaOfSigmTrialOutputName,
62  phaseSpaceCalibInputName,
63  phaseSpaceCalibOutputName,
64  gausFitInputName,
65  gausFitOutputName,
66  ampFitOutputName );
67 
68 
69 
70 
71  // myfitter.Init();
72  // myfitter.GetSigmaOfSingleTrail(sigmaOfSigmTrialInputName,sigmaOfSigmTrialOutputName);
73  // myfitter.DoPhaseSpaceCalibration(phaseSpaceCalibInputName,phaseSpaceCalibOutputName);
74  // myfitter.FitMultiGaus(gausFitInputName,gausFitOutputName);
75  // myfitter.FitMultiGaus(gausFitInputName,gausFitOutputName);
76  // myfitter.ExtrapAmp(gausFitOutputName,ampFitOutputName);
77 
78 }