BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
UseEmc Class Reference

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

#include <UseEmc.h>

+ Inheritance diagram for UseEmc:

Public Member Functions

 UseEmc (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 18 of file UseEmc.h.

Constructor & Destructor Documentation

◆ UseEmc()

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

Definition at line 42 of file UseEmc.cxx.

44 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
45{
46 // Declare properties here.
47
48}

Member Function Documentation

◆ execute()

StatusCode UseEmc::execute ( )

Definition at line 90 of file UseEmc.cxx.

90 {
91
92 MsgStream log(msgSvc(), name());
93 int i;
94 std::vector<double> emccalib;
96 //set emcCalibdata--------------------------------
97 for(i=0;i<6000;i++)
98 { emccalib.push_back(i);
99 }
100
101 emc->setDigiCalibConst(&emccalib);
102 emc->setrunfrm(0);
103 emc->setrunto(0);
104
105 //register the emcCalibData into the TCDS ; nelectable
106 std::string fullPath = "/Calib/EmcCal";
107 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq;
108 m_pCalibDataSvc->registerObject(fullPath,emc);
109
110 //write the EmcCalibData to the rootfile;
111 m_pRootSvc->writeToRoot("./Emc_dat.root", fullPath);
112 //another way,write the EmcCalibData without TCDS
113 m_pRootSvc->writeToRoot("./Emc_dat1.root", emc);
114 //retrieve DataObject from the TCDS-----------------
115 SmartDataPtr<CalibData::EmcCalibData> test(m_pCalibDataSvc, fullPath);
116 if(!test);
117 return StatusCode::SUCCESS;
118}
std::string test
Definition: CalibModel.cxx:43
void setDigiCalibConst(const vector< double > *DigiCalibConst)
virtual StatusCode writeToRoot(const std::string &outputFile, const std::string &tdsPath)=0

◆ finalize()

StatusCode UseEmc::finalize ( )

Definition at line 119 of file UseEmc.cxx.

119 {
120
121 MsgStream log(msgSvc(), name());
122 log << MSG::INFO
123 << " UseEmc FINALIZE!! "
124 << endreq;
125
126 return StatusCode::SUCCESS;
127}

◆ initialize()

StatusCode UseEmc::initialize ( )

Definition at line 51 of file UseEmc.cxx.

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

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