T0Calib Class Reference

#include <T0Calib.h>

Inheritance diagram for T0Calib:

CalibBase List of all members.

Public Member Functions

 T0Calib ()
 ~T0Calib ()
void init (TObjArray *hlist, MdcCosGeom *pGeom)
void mergeHist (TFile *fhist)
void calib (MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)

Private Member Functions

void renameHist ()

Private Attributes

MdcCosGeomm_pGeom
TFolder * m_fdT0
TFolder * m_fdResiWire
TH1F * m_hleft [NWIRE]
TH1F * m_hright [NWIRE]
TH1F * m_hLrResiSum
TH1F * m_hLrResiSub

Detailed Description

Definition at line 11 of file T0Calib.h.


Constructor & Destructor Documentation

T0Calib::T0Calib (  ) 

Definition at line 4 of file T0Calib.cpp.

00004                 {
00005      cout << "Calibration type: T0Calib" << endl;
00006 }

T0Calib::~T0Calib (  ) 

Definition at line 8 of file T0Calib.cpp.

00008                  {
00009 }


Member Function Documentation

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

Implements CalibBase.

Definition at line 61 of file T0Calib.cpp.

References CalibBase::calib(), MdcCalibConst::getT0(), genRecEmupikp::i, m_hleft, m_hLrResiSub, m_hLrResiSum, m_hright, NWIRE, renameHist(), MdcCalibConst::resetDelT0(), and MdcCalibConst::resetT0().

00061                                                                                     {
00062      CalibBase::calib(calconst, newXtList, r2tList);
00063 
00064      double vdr = 0.03;
00065      for(int i=0; i<NWIRE; i++){
00066           Stat_t entry_l = m_hleft[i] -> GetEntries();
00067           double mean_l = m_hleft[i] -> GetMean();
00068           if(entry_l < 50) mean_l = 0.0;
00069 
00070           Stat_t entry_r = m_hright[i] -> GetEntries();
00071           double mean_r = m_hright[i] -> GetMean();
00072           if(entry_r < 50) mean_r = 0.0;
00073 
00074           double delt0 = 0.5 * (mean_l + mean_r) / vdr;
00075           double resiLrSum = 0.5 * (mean_l + mean_r);
00076           double resiLrSub = 0.5 * (mean_l - mean_r);
00077           m_hLrResiSum->Fill(resiLrSum);
00078           m_hLrResiSub->Fill(resiLrSub);
00079 
00080           double t0 = calconst->getT0(i);
00081           t0 += delt0;
00082           calconst->resetT0(i, t0);
00083           calconst->resetDelT0(i, delt0);
00084      }
00085      renameHist();
00086 }

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

Implements CalibBase.

Definition at line 11 of file T0Calib.cpp.

References genRecEmupikp::i, CalibBase::init(), m_fdResiWire, m_fdT0, m_hleft, m_hLrResiSub, m_hLrResiSum, m_hright, m_pGeom, and NWIRE.

00011                                                      {
00012      CalibBase::init(hlist, pGeom);
00013 
00014      m_pGeom = pGeom;
00015 
00016      m_fdT0 = new TFolder("fdt0","fdt0");
00017      hlist->Add(m_fdT0);
00018 
00019      m_fdResiWire = new TFolder("resiWire", "resiWire");
00020      hlist->Add(m_fdResiWire);
00021 
00022      char hname[200];
00023      for(int i=0; i<NWIRE; i++){
00024           int lay = pGeom -> getWire(i) -> getLayerId();
00025           int cel = pGeom -> getWire(i) -> getCellId();
00026 
00027           sprintf(hname, "mResi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
00028           m_hleft[i] = new TH1F(hname, "", 400, -2.0, 2.0);
00029           m_fdT0 -> Add(m_hleft[i]);
00030 
00031           sprintf(hname, "mResi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
00032           m_hright[i] = new TH1F(hname, "", 400, -2.0, 2.0);
00033           m_fdT0 -> Add(m_hright[i]);
00034      }
00035      m_hLrResiSum = new TH1F("mLrResiSum", "", 200, -0.5, 0.5);
00036      m_fdResiWire->Add(m_hLrResiSum);
00037 
00038      m_hLrResiSub = new TH1F("mLrResiSub", "", 200, -0.5, 0.5);
00039      m_fdResiWire->Add(m_hLrResiSub);
00040 }

void T0Calib::mergeHist ( TFile *  fhist  )  [virtual]

Implements CalibBase.

Definition at line 42 of file T0Calib.cpp.

References genRecEmupikp::i, m_hleft, m_hright, m_pGeom, CalibBase::mergeHist(), and NWIRE.

00042                                    {
00043      CalibBase::mergeHist(fhist);
00044 
00045      char hname[200];
00046      TFolder* fd = (TFolder*)fhist->Get("fdT0");
00047      for(int i=0; i<NWIRE; i++){
00048           int lay = m_pGeom -> getWire(i) -> getLayerId();
00049           int cel = m_pGeom -> getWire(i) -> getCellId();
00050 
00051           sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
00052           TH1F* hl = (TH1F*)fd->FindObjectAny(hname);
00053           m_hleft[i]->Add(hl);
00054 
00055           sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
00056           TH1F* hr = (TH1F*)fd->FindObjectAny(hname);
00057           m_hright[i]->Add(hr);
00058      }
00059 }

void T0Calib::renameHist (  )  [private]

Reimplemented from CalibBase.

Definition at line 88 of file T0Calib.cpp.

References genRecEmupikp::i, m_fdResiWire, m_fdT0, m_hleft, m_hLrResiSub, m_hLrResiSum, m_hright, m_pGeom, and NWIRE.

Referenced by calib().

00088                         {
00089      char hname[200];
00090      m_fdT0->SetName("fdT0");
00091      for(int i=0; i<NWIRE; i++){
00092           int lay = m_pGeom -> getWire(i) -> getLayerId();
00093           int cel = m_pGeom -> getWire(i) -> getCellId();
00094           sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel);
00095           m_hleft[i]->SetName(hname);
00096           sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel);
00097           m_hright[i]->SetName(hname);
00098      }
00099 
00100      m_fdResiWire->SetName("ResiWire");
00101      m_hLrResiSum->SetName("LrResiSum");
00102      m_hLrResiSub->SetName("LrResiSub");
00103 }


Member Data Documentation

TFolder* T0Calib::m_fdResiWire [private]

Definition at line 24 of file T0Calib.h.

Referenced by init(), and renameHist().

TFolder* T0Calib::m_fdT0 [private]

Definition at line 23 of file T0Calib.h.

Referenced by init(), and renameHist().

TH1F* T0Calib::m_hleft[NWIRE] [private]

Definition at line 25 of file T0Calib.h.

Referenced by calib(), init(), mergeHist(), and renameHist().

TH1F* T0Calib::m_hLrResiSub [private]

Definition at line 28 of file T0Calib.h.

Referenced by calib(), init(), and renameHist().

TH1F* T0Calib::m_hLrResiSum [private]

Definition at line 27 of file T0Calib.h.

Referenced by calib(), init(), and renameHist().

TH1F* T0Calib::m_hright[NWIRE] [private]

Definition at line 26 of file T0Calib.h.

Referenced by calib(), init(), mergeHist(), and renameHist().

MdcCosGeom* T0Calib::m_pGeom [private]

Definition at line 21 of file T0Calib.h.

Referenced by init(), mergeHist(), and renameHist().


Generated on Tue Nov 29 23:35:55 2016 for BOSS_7.0.2 by  doxygen 1.4.7