BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
UseMuc Class Reference

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

#include <UseMuc.h>

Inheritance diagram for UseMuc:

Public Member Functions

 UseMuc (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 21 of file UseMuc.h.

Constructor & Destructor Documentation

◆ UseMuc()

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

Definition at line 48 of file UseMuc.cxx.

49 : Algorithm( name, pSvcLocator ), m_pCalibDataSvc( 0 ) {
50 // Declare properties here.
51}

Member Function Documentation

◆ execute()

StatusCode UseMuc::execute ( )

Definition at line 89 of file UseMuc.cxx.

89 {
90
91 MsgStream log( msgSvc(), name() );
92 /* std::vector<double> emccalib;
93 CalibData::MucCalibData* emc = new CalibData::MucCalibData;
94 //set emcCalibdata--------------------------------
95 for(i=0;i<6000;i++)
96 { emccalib.push_back(i);
97 }
98
99 emc->setDigiCalibConst(&emccalib);
100 emccalib.clear();
101 //set EnCoeff
102 for(i=0;i<43;i++)
103 { emccalib.push_back(1);
104 }
105 emc->setEnCoeff(&emccalib);
106 emccalib.clear();
107 //set PosCoeff
108 for(i=0;i<15;i++)
109 { emccalib.push_back(0);
110 }
111 emc->setPosCoeff(&emccalib);
112 emc->setrunfrm(0);
113 emc->setrunto(0);
114 */
115 // register the emcCalibData into the TCDS ; nelectable
116 std::string fullPath = "/Calib/MucCal";
117 log << MSG::INFO << "execute() fullPath = " << fullPath << endmsg;
118 // m_pCalibDataSvc->registerObject(fullPath,emc);
119
120 // write the MucCalibData to the rootfile;
121 // m_pRootSvc->writeToRoot("./Muc_dat.root", fullPath);
122 // another way,write the MucCalibData without TCDS
123 // m_pRootSvc->writeToRoot("./Muc_dat1.root", emc);
124 // retrieve DataObject from the TCDS-----------------
125 SmartDataPtr<CalibData::MucCalibData> test( m_pCalibDataSvc, fullPath );
126 if ( !test )
127 ;
128 std::cout << "m_uniformEff=" << test->getUniformEff() << std::endl;
129 std::cout << "m_UniformNos=" << test->getUniformNos() << std::endl;
130 std::cout << "m_UniformClst=" << test->getUniformClst() << std::endl;
131 for ( int i = 0; i < LAYER_MAX; i++ )
132 {
133 std::cout << "m_layerEff[" << i << "]=" << test->getLayerEff( i ) << " m_layerNos[" << i
134 << "]=" << test->getLayerNos( i ) << std::endl;
135 for ( int j = 0; j < CLST_MAX; j++ )
136 {
137 std::cout << "m_layerClstPro[" << i << "][" << j << "]=" << test->getLayerClstPro( i, j )
138 << std::endl;
139 }
140 }
141
142 for ( int i = 0; i < PART_MAX; i++ )
143 {
144 for ( int j = 0; j < ( ( i == 1 ) ? B_SEG_NUM : E_SEG_NUM ); j++ )
145 {
146 for ( int k = 0; k < ( ( i == 1 ) ? B_LAY_NUM : E_LAY_NUM ); k++ )
147 {
148 std::cout << "Box: " << i << "\t" << j << "\t" << k << "\t"
149 << test->getBoxEff( i, j, k ) << endl;
150 }
151 }
152 }
153 /*
154 int strip_max;
155 for(int i=0; i<PART_MAX; i++)
156 {
157 for(int j=0; j<((i==1)?B_SEG_NUM:E_SEG_NUM); j++)
158 {
159 for(int k=0; k<((i==1)?B_LAY_NUM:E_LAY_NUM); k++)
160 {
161 strip_max = m_pIdTr->GetStripMax(i, j, k);
162 for(int n=0; n<strip_max; n++)
163 {
164 std::cout << "Strip: " << i << "\t" << j << "\t" << k << "\t"
165 << "\t" << n << "\t" << test->getStripEff(i, j, k, n) << endl;
166 }
167 }
168 }
169 }
170 */
171
172 return StatusCode::SUCCESS;
173}
std::string test
IMessageSvc * msgSvc()

◆ finalize()

StatusCode UseMuc::finalize ( )

Definition at line 175 of file UseMuc.cxx.

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

◆ initialize()

StatusCode UseMuc::initialize ( )

Definition at line 53 of file UseMuc.cxx.

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

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