2#include "include/fun.h"
5 cout <<
"Calibration type: T0Calib" << endl;
16 m_fdT0 =
new TFolder(
"fdt0",
"fdt0");
19 m_fdResiWire =
new TFolder(
"resiWire",
"resiWire");
20 hlist->Add(m_fdResiWire);
23 for(
int i=0; i<
NWIRE; i++){
24 int lay = pGeom -> getWire(i) -> getLayerId();
25 int cel = pGeom -> getWire(i) -> getCellId();
27 sprintf(hname,
"mResi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
28 m_hleft[i] =
new TH1F(hname,
"", 400, -2.0, 2.0);
29 m_fdT0 ->
Add(m_hleft[i]);
31 sprintf(hname,
"mResi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
32 m_hright[i] =
new TH1F(hname,
"", 400, -2.0, 2.0);
33 m_fdT0 ->
Add(m_hright[i]);
35 m_hLrResiSum =
new TH1F(
"mLrResiSum",
"", 200, -0.5, 0.5);
36 m_fdResiWire->Add(m_hLrResiSum);
38 m_hLrResiSub =
new TH1F(
"mLrResiSub",
"", 200, -0.5, 0.5);
39 m_fdResiWire->Add(m_hLrResiSub);
46 TFolder* fd = (TFolder*)fhist->Get(
"fdT0");
47 for(
int i=0; i<
NWIRE; i++){
48 int lay = m_pGeom -> getWire(i) -> getLayerId();
49 int cel = m_pGeom -> getWire(i) -> getCellId();
51 sprintf(hname,
"Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
52 TH1F* hl = (TH1F*)fd->FindObjectAny(hname);
55 sprintf(hname,
"Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
56 TH1F* hr = (TH1F*)fd->FindObjectAny(hname);
65 for(
int i=0; i<
NWIRE; i++){
66 Stat_t entry_l = m_hleft[i] -> GetEntries();
67 double mean_l = m_hleft[i] -> GetMean();
68 if(entry_l < 50) mean_l = 0.0;
70 Stat_t entry_r = m_hright[i] -> GetEntries();
71 double mean_r = m_hright[i] -> GetMean();
72 if(entry_r < 50) mean_r = 0.0;
74 double delt0 = 0.5 * (mean_l + mean_r) / vdr;
75 double resiLrSum = 0.5 * (mean_l + mean_r);
76 double resiLrSub = 0.5 * (mean_l - mean_r);
77 m_hLrResiSum->Fill(resiLrSum);
78 m_hLrResiSub->Fill(resiLrSub);
80 double t0 = calconst->
getT0(i);
88void T0Calib::renameHist(){
90 m_fdT0->SetName(
"fdT0");
91 for(
int i=0; i<
NWIRE; i++){
92 int lay = m_pGeom -> getWire(i) -> getLayerId();
93 int cel = m_pGeom -> getWire(i) -> getCellId();
94 sprintf(hname,
"Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
95 m_hleft[i]->SetName(hname);
96 sprintf(hname,
"Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
97 m_hright[i]->SetName(hname);
100 m_fdResiWire->SetName(
"ResiWire");
101 m_hLrResiSum->SetName(
"LrResiSum");
102 m_hLrResiSub->SetName(
"LrResiSub");
virtual void init(TObjArray *hlist, MdcCosGeom *pGeom)=0
virtual void mergeHist(TFile *fhist)=0
virtual void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
double getT0(int wireid) const
void resetDelT0(int wireid, double val)
void resetT0(int wireid, double val)
void init(TObjArray *hlist, MdcCosGeom *pGeom)
void mergeHist(TFile *fhist)
void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)
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)