CGEM BOSS 6.6.5.f
BESIII Offline Software System
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UseDedx Class Reference

Simple algorithm to test functioning of "the other" TDS. More...

#include <UseDedx.h>

+ Inheritance diagram for UseDedx:

Public Member Functions

 UseDedx (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 

Detailed Description

Simple algorithm to test functioning of "the other" TDS.

Definition at line 15 of file UseDedx.h.

Constructor & Destructor Documentation

◆ UseDedx()

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

Definition at line 39 of file UseDedx.cxx.

41 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
42{
43 // Declare properties here.
44
45}

Member Function Documentation

◆ execute()

StatusCode UseDedx::execute ( )

Definition at line 88 of file UseDedx.cxx.

88 {
89
90 MsgStream log(msgSvc(), name());
91
92
93 std::string fullPath = "/Calib/DedxCal";
94
95 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
96
97 SmartDataPtr<CalibData::DedxCalibData> test(m_pCalibDataSvc, fullPath);
98 int i;
99 int j;
100 double ddg;
101 double ggs;
102 double wireg;
103 double gain;
104 double zdep;
105 double resol;
106 double layerg;
107 double m_id_doca;
108 double m_iner_chi;
109 double m_iner_gain;
110 double m_iner_hits;
111 double m_ip_eangle;
112 double m_out_chi;
113 double m_out_gain;
114 double m_out_hits;
115
116 for(i=0;i<4;i++){
117 for(j=0;j<43;j++){
118 ddg = test->getddg(i,j);
119 ggs = test->getggs(i,j);
120 zdep = test->getzdep(i,j);
121// std::cout<<"ddg["<<i<<"]["<<j<<"]="<<ddg;
122// std::cout<<" ggs["<<i<<"]["<<j<<"]="<<ggs;
123// std::cout<<" zdep["<<i<<"]["<<j<<"]="<<zdep;
124// std::cout<<"\n";
125 }
126 }
127
128 for(int i=0;i<1600;i++){
129 m_id_doca = test->get_id_doca(i);
130 m_iner_chi= test->get_iner_chi(i);
131 m_iner_gain= test->get_iner_gain(i);
132 m_iner_hits= test->get_iner_hits(i);
133 m_ip_eangle= test->get_ip_eangle(i);
134 m_out_chi= test->get_out_chi(i);
135 m_out_gain= test->get_out_gain(i);
136 m_out_hits= test->get_out_hits(i);
137 std::cout<<"m_id_doca: "<<m_id_doca<<" m_iner_chi: "<<m_iner_chi<<" m_iner_gain: "<<m_iner_gain<<" m_iner_hits:"<<m_iner_hits<<" m_ip_eangle:"<<m_ip_eangle<<" m_out_chi="<<m_out_chi<<" m_out_gain:"<<m_out_gain<<" m_out_hits="<<m_out_hits<<std::endl;
138 }
139 gain = test->getgain();
140// std::cout<<"gain="<<gain<<"\n";
141 double m_costheta;
142 for(int i=0;i<80;i++){
143 m_costheta = test->get_costheta(i);
144 std::cout<<" m_costheta="<<m_costheta;
145 if(i%5==0) std::cout<<"\n"<<std::endl;
146 }
147 double t0,dedx;
148 for(int i=0;i<35;i++){
149 t0=test->get_t0(i);
150 dedx=test->get_dedx(i);
151 std::cout<<"t0 ="<<t0<<" dedx="<<dedx;
152 if(i%5==0) std::cout<<"\n"<<std::endl;
153 }
154
155 resol = test->getresol();
156 // std::cout<<"resol="<<resol<<"\n";
157
158 for(i=0;i<43;i++)
159 { layerg = test -> getlayerg(i);
160 // std::cout<<"layerg["<<i<<"]="<<layerg;
161 }
162
163 for(i=0;i<60;i++)
164 { wireg = test -> getwireg(i);
165 // std::cout<<"wireg["<<i<<"]="<<wireg<<"\n";
166 }
167
168 for(i=0;i<20;i++){
169 std::cout<<"hadron "<<i<<" = "<<test->get_hadron(i);
170 }
171
172 //for pah is error
173 //m_pRootSvc->writeToRoot("/home/huangb/2.root", fullPath);
174 return StatusCode::SUCCESS;
175}
std::string test
Definition: CalibModel.cxx:43

◆ finalize()

StatusCode UseDedx::finalize ( )

Definition at line 177 of file UseDedx.cxx.

177 {
178
179 MsgStream log(msgSvc(), name());
180 log << MSG::INFO
181 << " UseDedx FINALIZE!! "
182 << endreq;
183
184 return StatusCode::SUCCESS;
185}

◆ initialize()

StatusCode UseDedx::initialize ( )

Definition at line 48 of file UseDedx.cxx.

48 {
49 StatusCode sc;
50 MsgStream log(msgSvc(), name());
51 log << MSG::INFO << "Initialize()" << endreq;
52
53 // So far don't have any properties, but in case we do some day..
54// setProperties();
55
56 log<<MSG::INFO << "setProperties()" << endreq;
57
58 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
59
60 if ( !sc.isSuccess() ) {
61 log << MSG::ERROR
62 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
63 << endreq;
64 return sc;
65 } else {
66 log << MSG::DEBUG
67 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
68 << endreq;
69 }
70
71sc = service("CalibRootCnvSvc", m_pRootSvc, true);
72 if ( !sc.isSuccess() ) {
73 log << MSG::ERROR
74 << "Could not get ICalibRootSvc interface of CalibRootCnvSvc"
75 << endreq;
76 return sc;
77 }
78
79 // Get properties from the JobOptionsSvc
80
81 sc = setProperties();
82
83 return StatusCode::SUCCESS;
84
85}

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