BOSS 7.0.8
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 23 of file UseMuc.h.

Constructor & Destructor Documentation

◆ UseMuc()

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

Definition at line 49 of file UseMuc.cxx.

51 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
52{
53 // Declare properties here.
54
55}

Member Function Documentation

◆ execute()

StatusCode UseMuc::execute ( )

Definition at line 99 of file UseMuc.cxx.

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

◆ finalize()

StatusCode UseMuc::finalize ( )

Definition at line 180 of file UseMuc.cxx.

180 {
181
182 MsgStream log(msgSvc(), name());
183 log << MSG::INFO
184 << " UseMuc FINALIZE!! "
185 << endreq;
186
187 return StatusCode::SUCCESS;
188}

◆ initialize()

StatusCode UseMuc::initialize ( )

Definition at line 58 of file UseMuc.cxx.

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

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