18 CanvasName.push_back(
static_cast<string>(
"Most Probable Value of Q0 vs TOF counter Number (Barrel part)") );
19 CanvasName.push_back(
static_cast<string>(
"Sigma of Q0 vs TOF Counter Number (Barrel part)") );
23 m_name = string(
"calib_barrel_q0");
28 numGraphs = numGraphs + (*iter);
31 cout <<
"tofcalgsec::calib_barrel_q0: the number of Graphs is NOT reasonable!!!" << endl;
36 const double qbegin = 0.0;
37 const double qend = 5000.0;
41 for(
unsigned int i=0; i<
NBarrel; i++ ) {
44 sprintf( hname,
"Q0-tofid-%i", i );
45 m_histograms.push_back(
new TH1F( hname, hname, qbin, qbegin, qend ) );
47 m_fitresult.push_back( HepVector(
nParQ0,0) );
53 for(
unsigned int i=0; i<
NBarrel; i++ ) {
69 std::cout << setiosflags(ios::left) << setw(10) << icounter << setw(8) << data->size() << setw(30) <<
name() << std::endl;
71 if( data->size() > 0 ) {
72 std::vector<Record*>::iterator
iter = data->begin();
74 fillRecord( (*
iter), icounter );
77 fitHistogram( icounter );
88void calib_barrel_q0::fillRecord(
const Record* r,
unsigned int icounter ) {
90 (*iter)->Fill( r->
q0() );
95void calib_barrel_q0::fitHistogram(
unsigned int icounter ) {
96 TF1* ld =
new TF1(
"ld",
"landau");
100 std::vector<TH1F*>::iterator iter1 =
m_histograms.begin() + icounter;
101 std::vector<HepVector>::iterator iter2 = m_fitresult.begin() + icounter;
102 (*iter1)->Fit( ld,
"Q");
103 (*iter2)[0] = ld->GetParameter(1);
104 (*iter2)[1] = ld->GetParError(1);
105 (*iter2)[2] = ld->GetParameter(2);
106 (*iter2)[3] = ld->GetParError(2);
112void calib_barrel_q0::fillGraph() {
114 std::vector<double> qmean, qmeanerr;
115 std::vector<double> qsig, qsigerr;
122 graph1->SetMarkerSize(1.5);
123 graph1->SetMarkerStyle(20);
124 graph1->SetMarkerColor(2);
127 graph2->SetMarkerSize(1.5);
128 graph2->SetMarkerStyle(20);
129 graph2->SetMarkerColor(4);
131 std::vector<HepVector>::iterator
iter = m_fitresult.begin();
133 qmean[i] = (*iter)[0];
134 qmeanerr[i] = (*iter)[1];
135 qsig[i] = (*iter)[2];
136 qsigerr[i] = (*iter)[3];
137 graph1->SetBinContent( i+1, qmean[i] );
138 graph1->SetBinError( i+1, qmeanerr[i] );
139 graph2->SetBinContent( i+1, qsig[i] );
140 graph2->SetBinError( i+1, qsigerr[i] );
150void calib_barrel_q0::fitGraph() {
151 unsigned int number = 0;
152 std::vector<HepVector>::iterator iter1 =
m_result.begin();
153 std::vector<HepVector>::iterator iter2 = m_fitresult.begin();
154 for( ; iter1!=
m_result.end(); iter1++, number++ ) {
155 (*iter1)[0] = (*(iter2+number))[0]/ (*iter2)[0];
156 (*iter1)[1] = (*(iter2+number))[0];
157 (*iter1)[2] = (*(iter2+number))[2];
std::vector< Record * > RecordSet
const unsigned int NBarrel
std::vector< HepVector > m_result
std::vector< TH1F * > m_histograms
unsigned int nBinPerCounter
unsigned int nCanvasPerCounter
unsigned int nHistPerCounter
const string & name() const
std::vector< unsigned int > nGraphPerCanvas
std::vector< string > CanvasName
std::vector< TH1F * > m_graphs
void calculate(RecordSet *&data, unsigned int icounter)
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)