BOSS 8.0.0
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 17 of file UseEmc.h.

Constructor & Destructor Documentation

◆ UseEmc()

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

Definition at line 41 of file UseEmc.cxx.

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

Member Function Documentation

◆ execute()

StatusCode UseEmc::execute ( )

Definition at line 80 of file UseEmc.cxx.

80 {
81
82 MsgStream log( msgSvc(), name() );
83 int i;
84 std::vector<double> emccalib;
85 CalibData::EmcCalibData* emc = new CalibData::EmcCalibData;
86 // set emcCalibdata--------------------------------
87 for ( i = 0; i < 6000; i++ ) { emccalib.push_back( i ); }
88
89 emc->setDigiCalibConst( &emccalib );
90 emc->setrunfrm( 0 );
91 emc->setrunto( 0 );
92
93 // register the emcCalibData into the TCDS ; nelectable
94 std::string fullPath = "/Calib/EmcCal";
95 log << MSG::INFO << "execute() fullPath = " << fullPath << endmsg;
96 m_pCalibDataSvc->registerObject( fullPath, emc );
97
98 // write the EmcCalibData to the rootfile;
99 m_pRootSvc->writeToRoot( "./Emc_dat.root", fullPath );
100 // another way,write the EmcCalibData without TCDS
101 m_pRootSvc->writeToRoot( "./Emc_dat1.root", emc );
102 // retrieve DataObject from the TCDS-----------------
103 SmartDataPtr<CalibData::EmcCalibData> test( m_pCalibDataSvc, fullPath );
104 if ( !test )
105 ;
106 return StatusCode::SUCCESS;
107}
std::string test
IMessageSvc * msgSvc()
void setDigiCalibConst(const vector< double > *DigiCalibConst)

◆ finalize()

StatusCode UseEmc::finalize ( )

Definition at line 108 of file UseEmc.cxx.

108 {
109
110 MsgStream log( msgSvc(), name() );
111 log << MSG::INFO << " UseEmc FINALIZE!! " << endmsg;
112
113 return StatusCode::SUCCESS;
114}

◆ initialize()

StatusCode UseEmc::initialize ( )

Definition at line 46 of file UseEmc.cxx.

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