BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofElecData.cxx
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/CalibData/src/Tof/TofElecData.cxx,v 1.1 2009/09/22
2// 07:28:05 huangb Exp $
3
4/** @class Mdctxpar
5 * Implementation of Mdcspres calibration TCDS class
6 */
7
8#include "CalibData/Tof/TofElecData.h"
9#include "GaudiKernel/MsgStream.h"
10namespace CalibData {
11
12 TofElecData::TofElecData( std::vector<BarrelElec>* bTofCal,
13 std::vector<EndcapElec>* eTofCal ) {
14 if ( bTofCal ) { m_bTofElecData = new std::vector<BarrelElec>( *bTofCal ); }
15 if ( eTofCal ) { m_eTofElecData = new std::vector<EndcapElec>( *eTofCal ); }
16 }
17
18 StatusCode TofElecData::update( CalibBase1& other, MsgStream* log ) {
19 TofElecData& other1 = dynamic_cast<TofElecData&>( other );
20 std::cout << "========================================"
21 << "\n"
22 << "here is the update in the TofElecData"
23 << "\n"
24 << "==================================================" << std::endl;
25 CalibBase1::update( other, log );
26 delete m_bTofElecData;
27 m_bTofElecData = new std::vector<BarrelElec>( *( other1.m_bTofElecData ) );
28 delete m_eTofElecData;
29 m_eTofElecData = new std::vector<EndcapElec>( *( other1.m_eTofElecData ) );
30 return StatusCode::SUCCESS;
31 }
32
33 void TofElecData::sim( TofElecData* other1 ) {
34 // if(!m_bTofElecData->empty()) delete m_bTofElecData;
35 if ( m_bTofElecData ) delete m_bTofElecData;
36 m_bTofElecData = new std::vector<BarrelElec>( *( other1->m_bTofElecData ) );
37 if ( m_eTofElecData ) delete m_eTofElecData;
38 m_eTofElecData = new std::vector<EndcapElec>( *( other1->m_eTofElecData ) );
39 }
40
41 // get the CalibData
42
44 std::vector<BarrelElec>::iterator it = m_bTofElecData->begin();
45 for ( int i = 0; i != cnt; i++, it++ ) {}
46 return *it;
47 }
48
50 std::vector<EndcapElec>::iterator it = m_eTofElecData->begin();
51 for ( int i = 0; i != cnt; i++, it++ ) {}
52 return *it;
53 }
54
55} // namespace CalibData
virtual StatusCode update(CalibBase1 &obj, MsgStream *)
virtual StatusCode update(CalibBase1 &other, MsgStream *log)
void sim(TofElecData *other1)
EndcapElec getETof(int cnt) const
BarrelElec getBTof(int cnt) const