BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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 16 of file UseDedx.h.

Constructor & Destructor Documentation

◆ UseDedx()

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

Definition at line 40 of file UseDedx.cxx.

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

Member Function Documentation

◆ execute()

StatusCode UseDedx::execute ( )

Definition at line 80 of file UseDedx.cxx.

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

◆ finalize()

StatusCode UseDedx::finalize ( )

Definition at line 176 of file UseDedx.cxx.

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

◆ initialize()

StatusCode UseDedx::initialize ( )

Definition at line 45 of file UseDedx.cxx.

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

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