9#include "GaudiKernel/MsgStream.h"
15 Algorithm(name, pSvcLocator), m_fFecOrder(1)
18 declareProperty(
"FecOrder", m_fFecOrder);
19 declareProperty(
"ChainMap", m_sFileName[0]);
20 declareProperty(
"FecMap", m_sFileName[1]);
21 declareProperty(
"OutputOption", m_sOutputOption);
27 MsgStream log(
msgSvc(), name());
28 log << MSG::INFO << endreq <<
"In initialize()" << endreq;
29 log << MSG::INFO <<
"Fec order:\t\t" << m_fFecOrder << endreq;
30 log << MSG::INFO <<
"Chain map:\t" << m_sFileName[0] << endreq;
31 log << MSG::INFO <<
"Output map:\t\t" << m_sFileName[1] << endreq;
32 log << MSG::INFO <<
"Output option:\t\t" << m_sOutputOption << endreq;
34 ifstream fin(m_sFileName[0].c_str(), ios::in);
36 log << MSG::INFO <<
"-------Chain map--------" << endreq;
37 if( m_sFileName[0].size() == 0 || fin.bad() )
40 log << MSG::INFO << endreq <<
"Load default map!" << endreq;
48 log << MSG::INFO << m_sChainMap[i][j] <<
"\t";
51 log << MSG::INFO << endreq;
65 log << MSG::INFO << endreq
66 <<
"Mark:\t" <<
"Module\t" << i <<
"Socket\t" << j <<
"\t"
67 << tempMark <<
"\terror!"<< endreq;
71 m_sChainMap[i][j] = tempMark;
73 log << MSG::INFO << m_sChainMap[i][j] <<
"\t";
75 log << MSG::INFO << endreq;
80 log << MSG::INFO <<
"------------------------" << endreq;
81 return StatusCode::SUCCESS;
87 MsgStream log(
msgSvc(), name());
88 log << MSG::INFO << endreq <<
"In execute()" << endreq;
91 return StatusCode::SUCCESS;
98 MsgStream log(
msgSvc(), name());
99 log << MSG::INFO << endreq <<
"In finalize()" << endreq << endreq;
101 ofstream fout(m_sFileName[1].c_str(), ios::out);
104 log << MSG::INFO <<
"Output file created error!" << endreq;
110 if( m_sOutputOption[i] ==
'1' )
117 log << MSG::INFO <<
"----------------------Module [ " << i <<
" ]----------------------" << endreq;
121 m_mucChain[id] =
new MucChain(
id, m_sChainMap[i][j], i, j, m_fFecOrder );
123 for(
int k=0; k<m_mucChain[id]->
GetFecTotal(); k++ )
126 if( m_sOutputOption[0] ==
'1' )
128 if( m_sOutputOption[1] ==
'1' )
130 if( m_sOutputOption[2] ==
'1' )
132 if( m_sOutputOption[3] ==
'1' )
134 if( m_sOutputOption[4] ==
'1' )
136 if( m_sOutputOption[5] ==
'1' )
138 if( m_sOutputOption[6] ==
'1' )
139 fout << aFec->
GetPart() <<
"\t";
140 if( m_sOutputOption[7] ==
'1' )
142 if( m_sOutputOption[8] ==
'1' )
144 if( m_sOutputOption[9] ==
'1' )
146 if( m_sOutputOption[10] ==
'1' )
148 if( m_sOutputOption[11] ==
'1' )
150 if( m_sOutputOption[12] ==
'1' )
152 if( m_sOutputOption[13] ==
'1' )
157 log << MSG::INFO <<
"Chain ID: " <<
id <<
"\tName: " << m_sChainMap[i][j];
158 log << MSG::INFO <<
"\tSocket: " << j <<
"\tFecTotal: " << m_mucChain[id]->
GetFecTotal()
159 <<
"\tFecOrder: " << m_fFecOrder <<
"\tdone!" << endreq;
165 return StatusCode::SUCCESS;
const std::string DEFAULT_MAP[MODULE_MAX][SOCKET_MAX]
const std::string DATA_NAME[DATA_NUM]
const unsigned int MARK_NUM
MucFec * GetFec(int fecId)
unsigned short GetGeoAddress()
unsigned short GetVmeAddress()
MucMappingAlg(const std::string &name, ISvcLocator *pSvcLocator)