151 DOMElement* currRelBx =
m_doc->createElement(
X(
"bxData"));
152 currRelBx->setAttribute(
X(
"num"),
X(
IntToString(bx).c_str()));
166 for (
int tcNum = 0; tcNum <= 11; ++tcNum ) {
167 DOMElement* tc =
nullptr;
168 DOMElement* tcgs =
nullptr;
169 for (
int tbNum = 0; tbNum <= 10; ++tbNum ) {
170 DOMElement* tb =
nullptr;
171 DOMElement* tbgs =
nullptr;
172 for (
int PAC = 0; PAC <= 4; ++PAC ) {
174 DOMElement* pac =
nullptr;
176 std::vector< RPCMuonExtraStruct >::iterator it =
m_muons.begin();
178 int muSegment = it->_mu.getLogSegment();
187 (
int(it->_level) == 0 && tbNum == muTBno && muTC == tcNum && PAC == muPACChipNo)
188 || (
int(it->_level) == 1 && tbNum == muTBno && muTC == tcNum )
189 || (
int(it->_level) == 2 && muTC == tcNum )
203 tc =
m_doc->createElement(
X(
"tc"));
204 currRelBx->appendChild(tc);
207 tcgs =
m_doc->createElement(
X(
"tcgs"));
208 tc->appendChild(tcgs);
211 if (tb==
nullptr &&
int(it->_level) <= 1) {
212 tb =
m_doc->createElement(
X(
"tb"));
216 tbgs =
m_doc->createElement(
X(
"tbgs"));
217 tb->appendChild(tbgs);
220 if (pac ==
nullptr &&
int(it->_level) == 0) {
221 pac =
m_doc->createElement(
X(
"pac"));
222 tb->appendChild(pac);
223 pac->setAttribute(
X(
"num"),
X(
IntToString(muPACChipNo).c_str()));
226 DOMElement*
mu =
m_doc->createElement(
X(
"mu"));
227 mu->setAttribute(
X(
"pt"),
X(
IntToString(
int(it->_mu.getPtCode() ) ).c_str()));
228 mu->setAttribute(
X(
"qual"),
X(
IntToString(
int(it->_mu.getQuality() ) ).c_str()));
229 mu->setAttribute(
X(
"sign"),
X(
IntToString(
int(it->_mu.getSign() ) ).c_str()));
231 if (
int(it->_level) == 0 ) {
232 mu->setAttribute(
X(
"num"),
X(
IntToString( muSegment ).c_str()));
233 pac->appendChild(mu);
235 mu->setAttribute(
X(
"num"),
X(
IntToString(
int(it->_index) ).c_str()));
236 mu->setAttribute(
X(
"phi"),
X(
IntToString(
int(it->_mu.getPhiAddr() ) ).c_str()));
237 mu->setAttribute(
X(
"eta"),
X(
IntToString(
int(it->_mu.getEtaAddr() ) ).c_str()));
238 mu->setAttribute(
X(
"gbD"),
X(
IntToString(
int(it->_mu.getGBData() ) ).c_str()));
239 if (
int(it->_level) == 1 ) {
240 tbgs->appendChild(mu);
241 }
else if (
int(it->_level) == 2 ) {
242 tcgs->appendChild(mu);
244 throw cms::Exception(
"RPCMuonsGrabber") <<
"xx Unexpected level" << std::endl;
261 for (
int half =0; half <= 1; ++half){
262 for (
int be =0; be <= 1; ++be){
264 std::vector< RPCMuonExtraStruct >::iterator it =
m_muons.begin();
265 DOMElement* hs =
nullptr;
267 if ( (
int(it->_level) !=
level) ||
int(it->_hsHalf)!=half ||
int(it->_region)!=be ) {
274 hs =
m_doc->createElement(
X(
"hs"));
276 }
else if (
level ==4 ) {
277 hs =
m_doc->createElement(
X(
"fs"));
279 throw cms::Exception(
"RPCMuonsGrabber") <<
"Problem writing out muons - lvl " <<
level << std::endl;
282 currRelBx->appendChild(hs);
285 DOMElement* mu =
m_doc->createElement(
X(
"mu"));
287 mu->setAttribute(
X(
"num"),
X(
IntToString(
int(it->_index) ).c_str()));
288 mu->setAttribute(
X(
"pt"),
X(
IntToString(
int(it->_mu.getPtCode() ) ).c_str()));
289 mu->setAttribute(
X(
"qual"),
X(
IntToString(
int(it->_mu.getQuality() ) ).c_str()));
290 mu->setAttribute(
X(
"sign"),
X(
IntToString(
int(it->_mu.getSign() ) ).c_str()));
291 mu->setAttribute(
X(
"phi"),
X(
IntToString(
int(it->_mu.getPhiAddr() ) ).c_str()));
292 mu->setAttribute(
X(
"eta"),
X(
IntToString(
int(it->_mu.getEtaAddr() ) ).c_str()));
293 mu->setAttribute(
X(
"gbD"),
X(
IntToString(
int(it->_mu.getGBData() ) ).c_str()));
307 throw cms::Exception(
"RPCMuonsGrabber") <<
" There are still some muons in muons vec" << std::endl;
int getTCNum(const RPCConst::l1RpcConeCrdnts &coneCrdnts) override
Returns the index of TC that should run given LogCone.
std::string IntToString(int i)
RPCBasicTrigConfig * m_trigConfig
int getTBNum(const RPCConst::l1RpcConeCrdnts &coneCrdnts) override
Returns the index of TB (in TC) that should run given LogCone.
XERCES_CPP_NAMESPACE::DOMDocument * m_doc
std::vector< RPCMuonExtraStruct > m_muons
XERCES_CPP_NAMESPACE::DOMElement * m_currEvent
int getTowerNumOnTb(const RPCConst::l1RpcConeCrdnts &coneCrdnts) override