BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
DedxSaveWireGain Class Reference

#include <DedxSaveWireGain.h>

+ Inheritance diagram for DedxSaveWireGain:

Public Member Functions

 DedxSaveWireGain (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~DedxSaveWireGain ()
 
void initializing ()
 
void BookHists ()
 
void genNtuple ()
 
void FillHists ()
 
void AnalyseHists ()
 
void WriteHists ()
 
- Public Member Functions inherited from DedxCalib
 DedxCalib (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~DedxCalib ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual void genNtuple ()=0
 
virtual void initializing ()=0
 
virtual void BookHists ()=0
 
virtual void FillHists ()=0
 
virtual void AnalyseHists ()=0
 
virtual void WriteHists ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from DedxCalib
double cal_dedx_bitrunc (float truncate, std::vector< double > phlist)
 
double cal_dedx (float truncate, std::vector< double > phlist)
 
void getCurvePar ()
 
void set_dEdx (int landau, float dEdx, int trkalg, int runflag, int dedxhit_use, float ptrk, float theta, float pl_rp, int vflag[3], double t0)
 
void ReadRecFileList ()
 
- Protected Attributes inherited from DedxCalib
IMdcGeomSvcgeosvc
 
IDedxCorrecSvcexsvc
 
float truncate
 
vector< double > Curve_Para
 
vector< double > Sigma_Para
 
int vFlag [3]
 
double m_dedx_exp [5]
 
double m_ex_sigma [5]
 
double m_pid_prob [5]
 
double m_chi_ex [5]
 
vector< string > m_recFileVector
 
int ParticleFlag
 
int m_calibflag
 
int m_phShapeFlag
 
std::string m_eventType
 
std::string m_recFileList
 
std::string m_rootfile
 
std::string m_curvefile
 

Detailed Description

Definition at line 9 of file DedxSaveWireGain.h.

Constructor & Destructor Documentation

◆ DedxSaveWireGain()

DedxSaveWireGain::DedxSaveWireGain ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 16 of file DedxSaveWireGain.cxx.

16 : DedxCalib(name, pSvcLocator){
17 declareProperty("PMin", pMin=0.2);
18 declareProperty("PMax", pMax=2.3);
19 f_save = new TFile("wiregain.root", "recreate");
20 m_wiregain = new TTree("wiregain", "wiregain");
21}

◆ ~DedxSaveWireGain()

DedxSaveWireGain::~DedxSaveWireGain ( )
inline

Definition at line 13 of file DedxSaveWireGain.h.

13{};

Member Function Documentation

◆ AnalyseHists()

void DedxSaveWireGain::AnalyseHists ( )
inlinevirtual

Implements DedxCalib.

Definition at line 18 of file DedxSaveWireGain.h.

18{}

◆ BookHists()

void DedxSaveWireGain::BookHists ( )
virtual

Implements DedxCalib.

Definition at line 24 of file DedxSaveWireGain.cxx.

25{
26 MsgStream log(msgSvc(), name());
27 log<<MSG::INFO<<"DedxSaveWireGain::BookHists()"<<endreq;
28
30}
IMessageSvc * msgSvc()
void ReadRecFileList()
Definition: DedxCalib.cxx:89

◆ FillHists()

void DedxSaveWireGain::FillHists ( )
virtual

Implements DedxCalib.

Definition at line 32 of file DedxSaveWireGain.cxx.

33{
34 MsgStream log(msgSvc(), name());
35 log<<MSG::INFO<<"DedxSaveWireGain::FillHists()"<<endreq;
36 int run, evt;
37 double gain;
38 m_wiregain->Branch("run", &run, "run/I");
39 m_wiregain->Branch("evt", &evt, "evt/I");
40 m_wiregain->Branch("gain", &gain, "gain/D");
41
42 TFile* f;
43 TTree* n102;
44 string runlist;
45
46 double dedx=0;
47 float runNO=0,evtNO=0,runFlag=0,pathlength=0,wid=0,layid=0,dd_in=0,driftdist=0,eangle=0,zhit=0,costheta=0,tes=0,ptrk=0;
48 cout<<"m_recFileVector.size()= "<<m_recFileVector.size()<<endl;
49 for(int i=0; i<m_recFileVector.size(); i++)
50 {
51 runlist = m_recFileVector[i];
52 cout<<"runlist: "<<runlist.c_str()<<endl;
53 f = new TFile(runlist.c_str());
54 n102 = (TTree*)f->Get("n102");
55 n102-> SetBranchAddress("adc_raw",&dedx);
56 n102-> SetBranchAddress("path_rphi",&pathlength);
57 n102-> SetBranchAddress("wire",&wid);
58 n102-> SetBranchAddress("layer",&layid);
59 n102-> SetBranchAddress("doca_in",&dd_in);
60 n102-> SetBranchAddress("driftdist",&driftdist);
61 n102-> SetBranchAddress("eangle",&eangle);
62 n102-> SetBranchAddress("zhit",&zhit);
63 n102-> SetBranchAddress("runNO",&runNO);
64 n102-> SetBranchAddress("evtNO",&evtNO);
65 n102-> SetBranchAddress("runFlag",&runFlag);
66 n102-> SetBranchAddress("costheta1",&costheta);
67 n102-> SetBranchAddress("t01",&tes);
68 n102->SetBranchAddress("ptrk1",&ptrk);
69
70 cout <<"entries in this file" << n102->GetEntries() << endl;
71 for(int j=0;j<n102->GetEntries();j++)
72 {
73 n102->GetEntry(j);
74 if(tes>1400) continue;
75 if(ptrk>pMax || ptrk<pMin) continue;
76 if(layid <8)
77 {if(dedx<MinADCValuecut || dedx>MaxADCValuecut || pathlength>RPhi_PathMaxCut || pathlength<Iner_RPhi_PathMinCut || driftdist>Iner_DriftDistCut) continue;}
78 else
79 {if(dedx<MinADCValuecut || dedx>MaxADCValuecut || pathlength>RPhi_PathMaxCut || pathlength<Out_RPhi_PathMinCut || driftdist>Out_DriftDistCut) continue;}
80 dedx = exsvc->StandardHitCorrec(0,runFlag,2,runNO,evtNO,pathlength,wid,layid,dedx,dd_in,eangle,costheta);
81 dedx = exsvc->StandardTrackCorrec(0, runFlag, 2, runNO, evtNO, dedx, costheta, tes);
82 run = (int)runNO;
83 evt = (int)evtNO;
84 gain = dedx;
85 // cout << "run " << run << " evt " << evt << " gain " << gain << endl;
86 m_wiregain->Fill();
87 }// end of loop in n102 entries
88 }// end of loop in rec files
89}// end of this function
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
data SetBranchAddress("time",&time)
#define MaxADCValuecut
#define Iner_DriftDistCut
#define RPhi_PathMaxCut
#define Out_DriftDistCut
IDedxCorrecSvc * exsvc
Definition: DedxCalib.h:30
vector< string > m_recFileVector
Definition: DedxCalib.h:48
virtual double StandardHitCorrec(int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double costheta) const =0
virtual double StandardTrackCorrec(int calib_rec_Flag, int typFlag, int ntpFlag, int runNO, int evtNO, double ex, double costheta, double t0) const =0
float costheta
float ptrk

◆ genNtuple()

void DedxSaveWireGain::genNtuple ( )
inlinevirtual

Implements DedxCalib.

Definition at line 16 of file DedxSaveWireGain.h.

16{}

◆ initializing()

void DedxSaveWireGain::initializing ( )
inlinevirtual

Implements DedxCalib.

Definition at line 14 of file DedxSaveWireGain.h.

14{}

◆ WriteHists()

void DedxSaveWireGain::WriteHists ( )
virtual

Implements DedxCalib.

Definition at line 92 of file DedxSaveWireGain.cxx.

93{
94 f_save->cd();
95 m_wiregain->Write();
96 f_save->Save();
97 f_save->Close();
98}

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