41 m_xmlErrHandler(nullptr),
42 m_triggerMenuInterface(
"NULL"),
43 m_triggerMenuName(
"NULL"),
44 m_triggerMenuImplementation(
"NULL"),
114 const std::vector<std::vector<L1GtEnergySumTemplate> >& vecEnergySumTempl) {
119 const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTempl) {
124 const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTempl) {
129 const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTempl) {
134 const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTempl) {
143 const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTempl) {
148 const std::vector<std::vector<L1GtCorrelationTemplate> >& vecCorrelationTempl) {
163 const std::vector<std::vector<L1GtEnergySumTemplate> >& corEnergySumTempl) {
217 LogTrace(
"L1GtTriggerMenuXmlParser") <<
"\nOpening XML-File: \n " << defXmlFile << std::endl;
264 }
catch (
const XMLException& toCatch) {
265 char* message = XMLString::transcode(toCatch.getMessage());
267 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error during Xerces-c initialization! :" << message << std::endl;
273 XercesDOMParser*
parser =
new XercesDOMParser();
274 parser->setValidationScheme(XercesDOMParser::Val_Always);
275 parser->setDoNamespaces(
false);
286 parser->parse(xmlFile.c_str());
287 }
catch (
const XMLException& toCatch) {
288 char* message = XMLString::transcode(toCatch.getMessage());
290 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Exception while parsing XML: \n" << message << std::endl;
297 }
catch (
const DOMException& toCatch) {
298 char* message = XMLString::transcode(toCatch.msg);
300 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"DOM-Exception while parsing XML: \n" << message << std::endl;
308 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Unexpected Exception while parsing XML!" << std::endl;
326 char* nodeName =
nullptr;
328 DOMNode* n1 = startChild;
334 nodeName = XMLString::transcode(n1->getNodeName());
338 while (XMLString::compareIString(nodeName,
tagName.c_str())) {
340 n1 = n1->getNextSibling();
345 nodeName = XMLString::transcode(n1->getNodeName());
349 while (XMLString::compareNIString(nodeName,
tagName.c_str(),
tagName.length())) {
351 n1 = n1->getNextSibling();
356 nodeName = XMLString::transcode(n1->getNodeName());
358 if (n1 !=
nullptr &&
rest !=
nullptr) {
363 while (n1->getNodeType() != DOMNode::ELEMENT_NODE) {
364 n1 = n1->getNextSibling();
369 if (n1 !=
nullptr &&
rest !=
nullptr) {
370 nodeName = XMLString::transcode(n1->getNodeName());
396 DOMNamedNodeMap* attributes = node->getAttributes();
397 if (attributes ==
nullptr) {
402 XMLCh* attrName = XMLString::transcode(
name.c_str());
403 DOMNode* attribNode = attributes->getNamedItem(attrName);
406 if (attribNode ==
nullptr) {
410 char* retCstr = XMLString::transcode(attribNode->getNodeValue());
435 const XMLCh* retXmlCh = n1->getTextContent();
436 if (retXmlCh ==
nullptr) {
440 char* retCstr = XMLString::transcode(retXmlCh);
461 static const std::string valid_hex_start(
"0123456789ABCDEFabcdef");
464 static const std::string valid_hex_end(
"0123456789ABCDEFabcdef");
469 unsigned int hexStart = tempStr.find_first_of(valid_hex_start);
470 unsigned int hexEnd = tempStr.find_first_not_of(valid_hex_end, hexStart);
472 if (hexStart == hexEnd) {
473 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"No hex value found in: " << tempStr << std::endl;
478 tempStr = tempStr.substr(hexStart, hexEnd - hexStart);
480 if (tempStr.empty()) {
481 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Empty value in " << __PRETTY_FUNCTION__ << std::endl;
489 if (tempStr.length() > 16) {
490 tempStrL = tempStr.substr(tempStr.length() - 16, 16);
491 tempStrH = tempStr.substr(0, tempStr.length() - 16);
498 char* endPtr = (
char*)tempStrL.c_str();
499 uint64_t tempUIntL = strtoull(tempStrL.c_str(), &endPtr, 16);
502 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Unable to convert " << tempStr <<
" to hex." << std::endl;
508 endPtr = (
char*)tempStrH.c_str();
509 uint64_t tempUIntH = strtoull(tempStrH.c_str(), &endPtr, 16);
512 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Unable to convert " << tempStr <<
" to hex." << std::endl;
536 if (node ==
nullptr) {
537 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
575 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
601 if (node ==
nullptr) {
602 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
607 DOMNode* n1 =
findXMLChild(node->getFirstChild(), childName);
610 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Child of condition not found ( " << childName <<
")" << std::endl;
618 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"No value tag found for child " << childName <<
" in "
619 << __PRETTY_FUNCTION__ << std::endl;
627 if (maxString.empty()) {
630 if (maxString.empty()) {
631 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"No Max value found for " << childName << std::endl;
655 while (maxBitsL != 0) {
657 if ((maxBitsL & 1) == 0) {
658 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Confused by not continous set bits for max value "
659 << maxString <<
"(child=" << childName <<
")" << std::endl;
668 if ((maxBitsH != 0) && (
counter != 64)) {
669 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Confused by not continous set bits for max value " << maxString
670 <<
"(child=" << childName <<
")" << std::endl;
675 while (maxBitsH != 0) {
677 if ((maxBitsH & 1) == 0) {
678 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Confused by not continous set bits for max value "
679 << maxString <<
"(child=" << childName <<
")" << std::endl;
706 std::vector<uint64_t>&
dst) {
709 if (node ==
nullptr) {
710 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
715 DOMNode* n1 =
findXMLChild(node->getFirstChild(), childName);
719 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Child of condition not found ( " << childName <<
")" << std::endl;
734 for (
unsigned int i = 0;
i <
num;
i++) {
736 LogDebug(
"L1GtTriggerMenuXmlParser")
737 <<
"Not enough values in condition child ( " << childName <<
")" << std::endl;
744 <<
"Error converting condition child ( " << childName <<
") value." << std::endl;
791 DOMDocument*
doc =
parser->getDocument();
792 DOMNode* n1 =
doc->getFirstChild();
795 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error: Found no XML child" << std::endl;
803 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error: No vme tag found." << std::endl;
807 n1 = n1->getFirstChild();
809 unsigned int chipCounter = 0;
823 n1 = n1->getNextSibling();
841 itCondOnChip->clear();
857 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Condition " << cName <<
" already exists - not inserted!"
879 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Algorithm \"" << algName
880 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
885 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Algorithm alias \"" << algAlias
886 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
893 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, "
901 <<
" algorithms in the algorithm map - not inserted!" << std::endl;
910 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Chip number " << chipNr <<
" outside allowed range [0, "
920 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Output pin " << outputPin <<
" outside allowed range [0, "
927 int iPin = (itAlgo->second)
932 int iChip = (itAlgo->second)
937 if ((outputPin == iPin) && (chipNr == iChip)) {
938 LogTrace(
"L1GtTriggerMenuXmlParser")
939 <<
" Output pin " << outputPin <<
" is the same as for algorithm " << iName
940 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" << std::endl;
965 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Technical trigger \"" << algName
966 <<
"\"already exists in the technical trigger map- not inserted!" << std::endl;
973 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Bit number " <<
bitNumber <<
" outside allowed range [0, "
980 int iBitNumber = (itAlgo->second).algoBitNumber();
984 LogTrace(
"L1GtTriggerMenuXmlParser")
985 <<
" Bit number " << iBitNumber <<
" is the same as for technical trigger " << iName
986 <<
" - technical trigger not inserted!" << std::endl;
994 <<
" technical triggers in the technical trigger map - not inserted!"
1086 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Invalid mode for single bit" << std::endl;
1092 if (tmpStr ==
"0") {
1094 }
else if (tmpStr ==
"1") {
1097 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Bad bit value (" << tmpStr <<
")" << std::endl;
1114 if (node ==
nullptr) {
1115 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
1121 DOMNode* n1 = node->getFirstChild();
1124 if (n1 !=
nullptr) {
1126 if (n1 ==
nullptr) {
1127 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"No \"greater or equal\" tag found" << std::endl;
1152 std::vector<bool>& mipDst,
1153 std::vector<bool>& isoEnDst,
1154 std::vector<bool>& isoReqDst) {
1157 if (node ==
nullptr) {
1164 if (n1 ==
nullptr) {
1171 for (
unsigned int i = 0;
i <
num;
i++) {
1172 if (n1 ==
nullptr) {
1179 if (bitnode ==
nullptr) {
1188 mipDst[
i] = (tmpint != 0);
1196 if (bitnode ==
nullptr) {
1205 isoEnDst[
i] = (tmpint != 0);
1213 if (bitnode ==
nullptr) {
1222 isoReqDst[
i] = (tmpint != 0);
1248 unsigned int chipNr,
1249 const bool corrFlag) {
1258 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Wrong particle for muon-condition (" << particle <<
")" << std::endl;
1264 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Unknown type for muon-condition (" <<
type <<
")"
1265 <<
"\nCan not determine number of trigger objects. " << std::endl;
1273 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag" << std::endl;
1277 bool gEq = (intGEq != 0);
1282 std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(nrObj);
1286 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1293 for (
int i = 0;
i < nrObj;
i++) {
1294 objParameter[
i].ptHighThreshold = tmpValues[
i];
1307 for (
int i = 0;
i < nrObj;
i++) {
1315 tmpValues[
i] = (tmpValues[
i]) / 16;
1317 objParameter[
i].ptLowThreshold = tmpValues[
i];
1330 for (
int i = 0;
i < nrObj;
i++) {
1331 objParameter[
i].qualityRange = tmpValues[
i];
1344 for (
int i = 0;
i < nrObj;
i++) {
1345 objParameter[
i].etaRange = tmpValues[
i];
1358 for (
int i = 0;
i < nrObj;
i++) {
1359 objParameter[
i].phiHigh = tmpValues[
i];
1372 for (
int i = 0;
i < nrObj;
i++) {
1373 objParameter[
i].phiLow = tmpValues[
i];
1383 LogDebug(
"L1GtTriggerMenuXmlParser") <<
" Error getting charge correlation from muon condition (" <<
name <<
")"
1397 std::vector<bool> tmpMip(nrObj);
1398 std::vector<bool> tmpEnableIso(nrObj);
1399 std::vector<bool> tmpRequestIso(nrObj);
1403 <<
" Could not get mip and iso bits from muon condition (" <<
name <<
")" << std::endl;
1407 for (
int i = 0;
i < nrObj;
i++) {
1408 objParameter[
i].enableMip = tmpMip[
i];
1409 objParameter[
i].enableIso = tmpEnableIso[
i];
1410 objParameter[
i].requestIso = tmpRequestIso[
i];
1427 <<
" Could not get deltaPhi for muon condition with wsc (" <<
name <<
")" << std::endl;
1439 unsigned int maxbits;
1460 <<
"Type for muon condition id TypeNull - it means not defined in the XML file."
1461 <<
"\nNumber of trigger objects is set to zero. " << std::endl;
1466 std::vector<L1GtObject>
objType(nrObj,
Mu);
1480 std::ostringstream myCoutStream;
1481 muonCond.
print(myCoutStream);
1482 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
1487 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1515 unsigned int chipNr,
1516 const bool corrFlag) {
1530 caloObjType =
IsoEG;
1538 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Wrong particle for calo-condition (" << particle <<
")" << std::endl;
1544 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Unknown type for calo-condition (" <<
type <<
")"
1545 <<
"\nCan not determine number of trigger objects. " << std::endl;
1553 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag" << std::endl;
1557 bool gEq = (intGEq != 0);
1562 std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(nrObj);
1566 std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1573 for (
int i = 0;
i < nrObj;
i++) {
1574 objParameter[
i].etThreshold = tmpValues[
i];
1587 for (
int i = 0;
i < nrObj;
i++) {
1588 objParameter[
i].etaRange = tmpValues[
i];
1601 for (
int i = 0;
i < nrObj;
i++) {
1602 objParameter[
i].phiRange = tmpValues[
i];
1633 unsigned int maxbits;
1654 <<
"Type for calo condition id TypeNull - it means not defined in the XML file."
1655 <<
"\nNumber of trigger objects is set to zero. " << std::endl;
1660 std::vector<L1GtObject>
objType(nrObj, caloObjType);
1674 std::ostringstream myCoutStream;
1675 caloCond.
print(myCoutStream);
1676 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
1681 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1709 unsigned int chipNr,
1710 const bool corrFlag) {
1723 energySumObjType =
ETM;
1727 energySumObjType =
ETT;
1731 energySumObjType =
HTT;
1735 energySumObjType =
HTM;
1740 <<
"Wrong particle or type for energy-sum condition (" << particle <<
", " <<
type <<
")" << std::endl;
1751 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag" << std::endl;
1755 bool gEq = (intGEq != 0);
1760 std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(nrObj);
1763 std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1770 for (
int i = 0;
i < nrObj;
i++) {
1771 objParameter[
i].etThreshold = tmpValues[
i];
1781 if (energySumObjType ==
ETM) {
1784 <<
" Could not get phi for ETM condition (" <<
name <<
")" << std::endl;
1788 objParameter[
i].phiRange0Word = tmpValues[0];
1789 objParameter[
i].phiRange1Word = tmpValues[1];
1791 }
else if (energySumObjType ==
HTM) {
1794 <<
" Could not get phi for HTM condition (" <<
name <<
")" << std::endl;
1798 objParameter[
i].phiRange0Word = tmpValues[0];
1805 <<
" Could not get energyOverflow for EnergySum condition (" <<
name <<
")" << std::endl;
1810 <<
" Could not get energyOverflow for EnergySum condition (" <<
name <<
")" << std::endl;
1816 objParameter[
i].energyOverflow =
false;
1822 }
else if (tmpInt == 1) {
1823 objParameter[
i].energyOverflow =
true;
1830 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" EnergySum energyOverflow logical flag (hex) = " << std::hex
1831 << tmpInt <<
std::dec <<
" - wrong value! " << std::endl;
1837 std::vector<L1GtObject>
objType(nrObj, energySumObjType);
1851 std::ostringstream myCoutStream;
1852 energySumCond.
print(myCoutStream);
1853 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
1858 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
1888 unsigned int chipNr) {
1898 <<
"Wrong particle for JetCounts condition (" << particle <<
")" << std::endl;
1913 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag" << std::endl;
1917 bool gEq = (intGEq != 0);
1922 std::vector<L1GtJetCountsTemplate::ObjectParameter> objParameter(nrObj);
1926 char* endPtr =
nullptr;
1927 long int typeInt = strtol(
type.c_str(), &endPtr, 10);
1930 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Unable to convert " <<
type <<
" to dec." << std::endl;
1938 <<
"]" << std::endl;
1943 objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
1946 std::vector<uint64_t> tmpValues(nrObj);
1952 for (
int i = 0;
i < nrObj;
i++) {
1953 objParameter[
i].countThreshold = tmpValues[
i];
2004 std::vector<L1GtObject>
objType(nrObj, jetCountsObjType);
2018 std::ostringstream myCoutStream;
2019 jetCountsCond.
print(myCoutStream);
2020 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2025 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2050 unsigned int chipNr) {
2060 <<
"\nError: wrong particle for Castor condition (" << particle <<
")" << std::endl;
2082 std::ostringstream myCoutStream;
2083 castorCond.
print(myCoutStream);
2084 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2089 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2114 unsigned int chipNr) {
2124 <<
"Wrong particle for HfBitCounts condition (" << particle <<
")" << std::endl;
2139 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag" << std::endl;
2143 bool gEq = (intGEq != 0);
2148 std::vector<L1GtHfBitCountsTemplate::ObjectParameter> objParameter(nrObj);
2152 char* endPtr =
nullptr;
2153 long int typeInt = strtol(
type.c_str(), &endPtr, 10);
2156 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Unable to convert " <<
type <<
" to dec." << std::endl;
2169 objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
2172 std::vector<uint64_t> tmpValues(nrObj);
2178 for (
int i = 0;
i < nrObj;
i++) {
2179 objParameter[
i].countThreshold = tmpValues[
i];
2188 std::vector<L1GtObject>
objType(nrObj, hfBitCountsObjType);
2202 std::ostringstream myCoutStream;
2203 hfBitCountsCond.
print(myCoutStream);
2204 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2209 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2234 unsigned int chipNr) {
2244 <<
"Wrong particle for HfRingEtSums condition (" << particle <<
")" << std::endl;
2259 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag" << std::endl;
2263 bool gEq = (intGEq != 0);
2268 std::vector<L1GtHfRingEtSumsTemplate::ObjectParameter> objParameter(nrObj);
2272 char* endPtr =
nullptr;
2273 long int typeInt = strtol(
type.c_str(), &endPtr, 10);
2276 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"Unable to convert " <<
type <<
" to dec." << std::endl;
2289 objParameter[0].etSumIndex = static_cast<unsigned int>(typeInt);
2292 std::vector<uint64_t> tmpValues(nrObj);
2298 for (
int i = 0;
i < nrObj;
i++) {
2299 objParameter[
i].etSumThreshold = tmpValues[
i];
2308 std::vector<L1GtObject>
objType(nrObj, hfRingEtSumsObjType);
2322 std::ostringstream myCoutStream;
2323 hfRingEtSumsCond.
print(myCoutStream);
2324 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2329 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2354 unsigned int chipNr) {
2364 <<
"\nError: wrong particle for Bptx condition (" << particle <<
")" << std::endl;
2385 LogTrace(
"L1GtTriggerMenuXmlParser") << bptxCond <<
"\n" << std::endl;
2389 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2414 unsigned int chipNr) {
2424 <<
"\nError: wrong particle for External condition (" << particle <<
")" << std::endl;
2445 LogTrace(
"L1GtTriggerMenuXmlParser") << externalCond <<
"\n" << std::endl;
2449 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
" Error: duplicate condition (" <<
name <<
")" << std::endl;
2474 unsigned int chipNr) {
2483 <<
" Error: duplicate correlation condition (" <<
name <<
")" << std::endl;
2493 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Condition category: " <<
condition <<
", particle: " << particle
2494 <<
", type: " <<
type <<
"\n"
2501 const int nrObj = 2;
2504 int intGEq[nrObj] = {-1, -1};
2505 std::vector<L1GtObject>
objType(nrObj);
2506 std::vector<L1GtConditionCategory> condCateg(nrObj);
2509 const bool corrFlag =
true;
2510 int corrIndexVal[nrObj] = {-1, -1};
2514 DOMNode* conditionsNode = node->getFirstChild();
2516 conditionsNode =
findXMLChild(conditionsNode,
"",
true, &conditionNameNodeName);
2518 for (
int iSubCond = 0; iSubCond < nrObj; ++iSubCond) {
2524 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Sub-condition category: " <<
condition <<
", particle: " << particle
2525 <<
", type: " <<
type <<
", name: " << conditionNameNodeName <<
"\n"
2530 if (!
parseMuon(conditionsNode, conditionNameNodeName, chipNr, corrFlag)) {
2532 <<
" with name " << conditionNameNodeName << std::endl;
2537 if (intGEq[iSubCond] < 0) {
2539 <<
"Error getting \"greater or equal\" flag"
2540 <<
" for sub-condition " << conditionNameNodeName <<
" for the correlation condition " <<
name << std::endl;
2550 if (!
parseCalo(conditionsNode, conditionNameNodeName, chipNr, corrFlag)) {
2552 <<
" with name " << conditionNameNodeName << std::endl;
2557 if (intGEq[iSubCond] < 0) {
2559 <<
"Error getting \"greater or equal\" flag"
2560 <<
" for sub-condition " << conditionNameNodeName <<
" for the correlation condition " <<
name << std::endl;
2577 <<
"Wrong object type " << particle <<
" for sub-condition " << conditionNameNodeName
2578 <<
" from the correlation condition " <<
name << std::endl;
2586 if (!
parseEnergySum(conditionsNode, conditionNameNodeName, chipNr, corrFlag)) {
2588 <<
" with name " << conditionNameNodeName << std::endl;
2593 if (intGEq[iSubCond] < 0) {
2595 <<
"Error getting \"greater or equal\" flag"
2596 <<
" for sub-condition " << conditionNameNodeName <<
" for the correlation condition " <<
name << std::endl;
2611 <<
"Wrong object type " << particle <<
" for sub-condition " << conditionNameNodeName
2612 <<
" from the correlation condition " <<
name << std::endl;
2621 <<
"Unknown or un-adequate sub-condition (" <<
condition <<
")"
2622 <<
" with name " << conditionNameNodeName <<
" for the correlation condition " <<
name << std::endl;
2627 conditionsNode =
findXMLChild(conditionsNode->getNextSibling(),
"",
true, &conditionNameNodeName);
2632 if (intGEq[0] != intGEq[1]) {
2634 <<
"Inconsistent GEq flags for sub-conditions (" <<
condition <<
")"
2635 <<
" with name " << conditionNameNodeName <<
" for the correlation condition " <<
name << std::endl;
2639 gEq = (intGEq[0] != 0);
2646 std::vector<uint64_t> tmpValues(nrObj);
2659 if (node1 ==
nullptr) {
2661 <<
" Could not get deltaEta for correlation condition " <<
name <<
". " << std::endl;
2682 if (node1 ==
nullptr) {
2685 <<
" Could not get deltaPhi for correlation condition " <<
name <<
". " << std::endl;
2697 unsigned int maxbits;
2709 correlationCond.setCondType(cType);
2710 correlationCond.setObjectType(
objType);
2711 correlationCond.setCondGEq(gEq);
2712 correlationCond.setCondChipNr(chipNr);
2714 correlationCond.setCond0Category(condCateg[0]);
2715 correlationCond.setCond1Category(condCateg[1]);
2717 correlationCond.setCond0Index(corrIndexVal[0]);
2718 correlationCond.setCond1Index(corrIndexVal[1]);
2720 correlationCond.setCorrelationParameter(corrParameter);
2723 std::ostringstream myCoutStream;
2724 correlationCond.print(myCoutStream);
2725 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2749 DOMNode* n1 =
doc->getFirstChild();
2753 DOMNode* headerNode = n1->getFirstChild();
2754 if (headerNode ==
nullptr) {
2760 if (headerNode ==
nullptr) {
2762 <<
"\n - No header information." << std::endl;
2765 DOMNode* idNode = headerNode->getFirstChild();
2769 if (idNode ==
nullptr) {
2771 <<
"\n - Trigger menu interface name derived from file name." << std::endl;
2776 if (xmlPos == std::string::npos) {
2777 LogTrace(
"L1GtTriggerMenuXmlParser") <<
"\n Warning: Could not find \"_L1T_Scales\" "
2778 <<
"string in file name"
2779 <<
"\n - Trigger menu interface name set to file name." << std::endl;
2792 idNode = headerNode->getFirstChild();
2795 if (idNode ==
nullptr) {
2804 idNode = headerNode->getFirstChild();
2807 if (idNode ==
nullptr) {
2816 idNode = headerNode->getFirstChild();
2819 if (idNode ==
nullptr) {
2820 LogTrace(
"L1GtTriggerMenuXmlParser")
2829 idNode = headerNode->getFirstChild();
2832 if (idNode ==
nullptr) {
2841 idNode = headerNode->getFirstChild();
2844 if (idNode ==
nullptr) {
2853 idNode = headerNode->getFirstChild();
2856 if (idNode ==
nullptr) {
2866 idNode = headerNode->getFirstChild();
2869 if (idNode ==
nullptr) {
2872 <<
"\n - Algorithm implementation tag set to empty string." << std::endl;
2880 idNode = headerNode->getFirstChild();
2883 if (idNode ==
nullptr) {
2886 <<
"\n - Scale key set to " <<
m_scaleDbKey <<
" string." << std::endl;
2893 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"\n Parsed values from XML file"
2912 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"\n Warning: Inconsistent L1 menu name:"
2914 <<
"\n from XML tag: " << menuName << std::endl;
2923 LogTrace(
"L1GtTriggerMenuXmlParser") <<
"\n L1 menu name set to value from XML tag!"
2927 LogTrace(
"L1GtTriggerMenuXmlParser") <<
"\n L1 menu name set to file name!"
2949 unsigned int chipNr) {
2957 if (
condition.empty() || particle.empty() ||
type.empty()) {
2958 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Missing attributes for condition " <<
name << std::endl;
2990 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"\n Error: unknown condition (" <<
condition <<
")" << std::endl;
3011 LogTrace(
"L1GtTriggerMenuXmlParser") <<
"\nParsing conditions" << std::endl;
3014 DOMNode* n1 =
doc->getFirstChild();
3018 DOMNode* chipNode = n1->getFirstChild();
3019 if (chipNode ==
nullptr) {
3029 if (chipNode ==
nullptr) {
3035 unsigned int chipNr = 0;
3038 DOMNode* conditionsNode = chipNode->getFirstChild();
3040 if (conditionsNode ==
nullptr) {
3042 <<
"Error: No <" <<
m_xmlTagConditions <<
"> child found in Chip " << chipName << std::endl;
3047 char* nodeName = XMLString::transcode(chipNode->getNodeName());
3055 DOMNode* conditionNameNode = conditionsNode->getFirstChild();
3057 conditionNameNode =
findXMLChild(conditionNameNode,
"",
true, &conditionNameNodeName);
3058 while (conditionNameNode !=
nullptr) {
3059 LogTrace(
"L1GtTriggerMenuXmlParser")
3060 <<
"\n Found a condition with name: " << conditionNameNodeName << std::endl;
3062 if (!
workCondition(conditionNameNode, conditionNameNodeName, chipNr)) {
3065 conditionNameNode =
findXMLChild(conditionNameNode->getNextSibling(),
"",
true, &conditionNameNodeName);
3089 unsigned int chipNr) {
3092 if (node ==
nullptr) {
3093 LogDebug(
"L1GtTriggerMenuXmlParser") <<
" Node is 0 in " << __PRETTY_FUNCTION__
3094 <<
" can not parse the algorithm " << algName << std::endl;
3101 if (algAlias.empty()) {
3103 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"\n No alias defined for algorithm. Alias set to algorithm name."
3104 <<
"\n Algorithm name: " << algName
3105 <<
"\n Algorithm alias: " << algAlias << std::endl;
3107 LogDebug(
"L1GtTriggerMenuXmlParser") <<
"\n Alias defined for algorithm."
3108 <<
"\n Algorithm name: " << algName
3109 <<
"\n Algorithm alias: " << algAlias << std::endl;
3128 pinNode = node->getFirstChild();
3133 std::istringstream opStream(pinString);
3135 if ((opStream >> outputPin).fail()) {
3136 LogDebug(
"L1GtTriggerMenuXmlParser")
3137 <<
" Unable to convert pin string " << pinString <<
" to int for algorithm : " << algName << std::endl;
3143 if (pinNode ==
nullptr) {
3144 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Warning: No pin number found for algorithm: " << algName << std::endl;
3163 alg.setAlgoChipNumber(static_cast<int>(chipNr));
3164 alg.setAlgoAlias(algAlias);
3167 std::ostringstream myCoutStream;
3168 alg.print(myCoutStream);
3169 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
3199 DOMNode* node =
doc->getFirstChild();
3201 DOMNode* chipNode = node->getFirstChild();
3202 if (chipNode ==
nullptr) {
3210 if (chipNode ==
nullptr) {
3215 unsigned int chipNr = 0;
3225 DOMNode* algNode = chipNode->getFirstChild();
3227 if (algNode ==
nullptr) {
3229 <<
" Error: No <" <<
m_xmlTagAlgorithms <<
"> child found in chip " << chipName << std::endl;
3234 DOMNode* algNameNode = algNode->getFirstChild();
3236 algNameNode =
findXMLChild(algNameNode,
"",
true, &algNameNodeName);
3238 while (algNameNode !=
nullptr) {
3247 algNameNode =
findXMLChild(algNameNode->getNextSibling(),
"",
true, &algNameNodeName);
3272 if (node ==
nullptr) {
3273 LogDebug(
"L1GtTriggerMenuXmlParser") <<
" Node is 0 in " << __PRETTY_FUNCTION__
3274 <<
" can not parse the technical trigger " << algName << std::endl;
3290 pinNode = node->getFirstChild();
3295 std::istringstream opStream(pinString);
3297 if ((opStream >> outputPin).fail()) {
3298 LogDebug(
"L1GtTriggerMenuXmlParser") <<
" Unable to convert pin string " << pinString
3299 <<
" to int for technical trigger : " << algName << std::endl;
3305 if (pinNode ==
nullptr) {
3306 LogTrace(
"L1GtTriggerMenuXmlParser") <<
" Warning: No pin number found for technical trigger: " << algName
3325 std::ostringstream myCoutStream;
3326 alg.
print(myCoutStream);
3327 LogTrace(
"L1GtTriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
3353 DOMNode* node =
doc->getFirstChild();
3355 DOMNode* algNode = node->getFirstChild();
3356 if (algNode ==
nullptr) {
3362 if (algNode ==
nullptr) {
3369 DOMNode* algNameNode = algNode->getFirstChild();
3371 algNameNode =
findXMLChild(algNameNode,
"",
true, &algNameNodeName);
3373 while (algNameNode !=
nullptr) {
3382 algNameNode =
findXMLChild(algNameNode->getNextSibling(),
"",
true, &algNameNodeName);
3399 DOMDocument*
doc =
parser->getDocument();
3400 DOMNode* n1 =
doc->getFirstChild();
3402 if (n1 ==
nullptr) {
3403 edm::LogError(
"L1GtTriggerMenuXmlParser") <<
"Error: Found no XML child" << std::endl;
3408 char* nodeName = XMLString::transcode(n1->getNodeName());
3410 if (XMLString::compareIString(nodeName,
m_xmlTagDef.c_str())) {
3412 <<
"Error: First XML child is not \" " <<
m_xmlTagDef <<
"\" " << std::endl;
3417 LogTrace(
"L1GtTriggerMenuXmlParser") <<
"\nFirst node name is: " << nodeName << std::endl;