BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
T0Calib Class Reference

#include <T0Calib.h>

+ Inheritance diagram for T0Calib:

Public Member Functions

 T0Calib ()
 
 ~T0Calib ()
 
void init (TObjArray *hlist, MdcCosGeom *pGeom)
 
void mergeHist (TFile *fhist)
 
void calib (MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)
 
- Public Member Functions inherited from CalibBase
 CalibBase ()
 
virtual ~CalibBase ()
 
virtual void init (TObjArray *hlist, MdcCosGeom *pGeom)=0
 
virtual void mergeHist (TFile *fhist)=0
 
virtual void calib (MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
 

Detailed Description

Definition at line 11 of file T0Calib.h.

Constructor & Destructor Documentation

◆ T0Calib()

T0Calib::T0Calib ( )

Definition at line 4 of file T0Calib.cpp.

4 {
5 cout << "Calibration type: T0Calib" << endl;
6}

◆ ~T0Calib()

T0Calib::~T0Calib ( )

Definition at line 8 of file T0Calib.cpp.

8 {
9}

Member Function Documentation

◆ calib()

void T0Calib::calib ( MdcCalibConst calconst,
TObjArray *  newXtList,
TObjArray *  r2tList 
)
virtual

Implements CalibBase.

Definition at line 61 of file T0Calib.cpp.

61 {
62 CalibBase::calib(calconst, newXtList, r2tList);
63
64 double vdr = 0.03;
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;
69
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;
73
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);
79
80 double t0 = calconst->getT0(i);
81 t0 += delt0;
82 calconst->resetT0(i, t0);
83 calconst->resetDelT0(i, delt0);
84 }
85 renameHist();
86}
virtual void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
Definition: CalibBase.cpp:711
double getT0(int wireid) const
void resetDelT0(int wireid, double val)
void resetT0(int wireid, double val)

◆ init()

void T0Calib::init ( TObjArray *  hlist,
MdcCosGeom pGeom 
)
virtual

Implements CalibBase.

Definition at line 11 of file T0Calib.cpp.

11 {
12 CalibBase::init(hlist, pGeom);
13
14 m_pGeom = pGeom;
15
16 m_fdT0 = new TFolder("fdt0","fdt0");
17 hlist->Add(m_fdT0);
18
19 m_fdResiWire = new TFolder("resiWire", "resiWire");
20 hlist->Add(m_fdResiWire);
21
22 char hname[200];
23 for(int i=0; i<NWIRE; i++){
24 int lay = pGeom -> getWire(i) -> getLayerId();
25 int cel = pGeom -> getWire(i) -> getCellId();
26
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]);
30
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]);
34 }
35 m_hLrResiSum = new TH1F("mLrResiSum", "", 200, -0.5, 0.5);
36 m_fdResiWire->Add(m_hLrResiSum);
37
38 m_hLrResiSub = new TH1F("mLrResiSub", "", 200, -0.5, 0.5);
39 m_fdResiWire->Add(m_hLrResiSub);
40}
virtual void init(TObjArray *hlist, MdcCosGeom *pGeom)=0
Definition: CalibBase.cpp:14

◆ mergeHist()

void T0Calib::mergeHist ( TFile *  fhist)
virtual

Implements CalibBase.

Definition at line 42 of file T0Calib.cpp.

42 {
44
45 char hname[200];
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();
50
51 sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
52 TH1F* hl = (TH1F*)fd->FindObjectAny(hname);
53 m_hleft[i]->Add(hl);
54
55 sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
56 TH1F* hr = (TH1F*)fd->FindObjectAny(hname);
57 m_hright[i]->Add(hr);
58 }
59}
virtual void mergeHist(TFile *fhist)=0
Definition: CalibBase.cpp:365

The documentation for this class was generated from the following files: