28 #include <boost/cstdint.hpp>
40 #include "L1Trigger/L1TGlobal/src/L1TMenuEditor/L1TriggerMenu.hxx"
45 m_triggerMenuName(
"NULL"), m_triggerMenuImplementation(
"NULL"), m_scaleDbKey(
"NULL")
64 const unsigned int& numberConditionChipsValue) {
66 m_numberConditionChips = numberConditionChipsValue;
73 m_pinsOnConditionChip = pinsOnConditionChipValue;
80 const std::vector<int>& orderConditionChipValue) {
82 m_orderConditionChip = orderConditionChipValue;
88 const unsigned int& numberPhysTriggersValue) {
90 m_numberPhysTriggers = numberPhysTriggersValue;
96 const unsigned int& numberTechTriggersValue) {
98 m_numberTechTriggers = numberTechTriggersValue;
105 m_numberL1JetCounts = numberL1JetCountsValue;
112 m_conditionMap = condMap;
117 m_triggerMenuInterface = menuInterface;
121 m_triggerMenuName = menuName;
125 m_triggerMenuImplementation = menuImplementation;
130 m_scaleDbKey = scaleKey;
135 const std::vector<std::vector<MuonTemplate> >& vecMuonTempl) {
137 m_vecMuonTemplate = vecMuonTempl;
141 const std::vector<std::vector<CaloTemplate> >& vecCaloTempl) {
143 m_vecCaloTemplate = vecCaloTempl;
147 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
149 m_vecEnergySumTemplate = vecEnergySumTempl;
153 const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTempl) {
155 m_vecJetCountsTemplate = vecJetCountsTempl;
159 const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTempl) {
161 m_vecCastorTemplate = vecCastorTempl;
165 const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTempl) {
167 m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
171 const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTempl) {
173 m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
177 const std::vector<std::vector<L1GtBptxTemplate> >& vecBptxTempl) {
179 m_vecBptxTemplate = vecBptxTempl;
183 const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTempl) {
185 m_vecExternalTemplate = vecExternalTempl;
189 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
191 m_vecCorrelationTemplate = vecCorrelationTempl;
197 const std::vector<std::vector<MuonTemplate> >& corMuonTempl) {
199 m_corMuonTemplate = corMuonTempl;
203 const std::vector<std::vector<CaloTemplate> >& corCaloTempl) {
205 m_corCaloTemplate = corCaloTempl;
209 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
211 m_corEnergySumTemplate = corEnergySumTempl;
219 m_algorithmMap = algoMap;
224 m_algorithmAliasMap = algoMap;
229 m_technicalTriggerMap = ttMap;
239 XERCES_CPP_NAMESPACE_USE
243 m_conditionMap.resize(m_numberConditionChips);
245 m_vecMuonTemplate.resize(m_numberConditionChips);
246 m_vecCaloTemplate.resize(m_numberConditionChips);
247 m_vecEnergySumTemplate.resize(m_numberConditionChips);
248 m_vecJetCountsTemplate.resize(m_numberConditionChips);
249 m_vecCastorTemplate.resize(m_numberConditionChips);
250 m_vecHfBitCountsTemplate.resize(m_numberConditionChips);
251 m_vecHfRingEtSumsTemplate.resize(m_numberConditionChips);
252 m_vecBptxTemplate.resize(m_numberConditionChips);
253 m_vecExternalTemplate.resize(m_numberConditionChips);
255 m_vecCorrelationTemplate.resize(m_numberConditionChips);
256 m_corMuonTemplate.resize(m_numberConditionChips);
257 m_corCaloTemplate.resize(m_numberConditionChips);
258 m_corEnergySumTemplate.resize(m_numberConditionChips);
264 m_triggerMenuName = defXmlFile;
265 size_t xmlPos = m_triggerMenuName.find_last_of(
"/");
266 m_triggerMenuName.erase(m_triggerMenuName.begin(), m_triggerMenuName.begin()
269 xmlPos = m_triggerMenuName.find_last_of(
".");
270 m_triggerMenuName.erase(m_triggerMenuName.begin() + xmlPos, m_triggerMenuName.end());
275 std::auto_ptr<l1t::L1TriggerMenu> tm(l1t::l1TriggerMenu(defXmlFile));
277 LogTrace(
"TriggerMenuXmlParser") <<
"\nOpening XML-File: \n " << defXmlFile << std::endl;
279 l1t::ConditionList conditions = tm->conditions();
294 m_triggerMenuInterfaceDate = val;
300 m_triggerMenuInterfaceAuthor = val;
306 m_triggerMenuInterfaceDescription = val;
313 m_triggerMenuDate = val;
319 m_triggerMenuAuthor = val;
325 m_triggerMenuDescription = val;
331 m_algorithmImplementation = val;
350 XERCES_CPP_NAMESPACE_USE
354 XMLPlatformUtils::Initialize();
356 catch (
const XMLException& toCatch) {
357 char*
message = XMLString::transcode(toCatch.getMessage());
360 <<
"Error during Xerces-c initialization! :"
361 << message << std::endl;
367 XercesDOMParser*
parser =
new XercesDOMParser();
368 parser->setValidationScheme(XercesDOMParser::Val_Always);
369 parser->setDoNamespaces(
false);
371 if (m_xmlErrHandler == 0) {
372 m_xmlErrHandler = (ErrorHandler*)
new HandlerBase();
377 parser->setErrorHandler(m_xmlErrHandler);
381 parser->parse(xmlFile.c_str());
383 catch(
const XMLException &toCatch) {
384 char*
message = XMLString::transcode(toCatch.getMessage());
387 <<
"Exception while parsing XML: \n"
388 << message << std::endl;
392 delete m_xmlErrHandler;
396 catch (
const DOMException &toCatch) {
397 char *
message = XMLString::transcode(toCatch.msg);
400 <<
"DOM-Exception while parsing XML: \n"
401 << message << std::endl;
405 delete m_xmlErrHandler;
412 <<
"Unexpected Exception while parsing XML!"
416 delete m_xmlErrHandler;
426 XERCES_CPP_NAMESPACE::DOMNode* startChild,
const std::string& tagName,
bool beginOnly,
429 XERCES_CPP_NAMESPACE_USE
433 DOMNode *n1 = startChild;
438 if ( !tagName.empty() ) {
439 nodeName = XMLString::transcode(n1->getNodeName());
443 while (XMLString::compareIString(nodeName, tagName.c_str())) {
446 n1 = n1->getNextSibling();
451 nodeName = XMLString::transcode(n1->getNodeName());
456 while (XMLString::compareNIString(nodeName, tagName.c_str(), tagName.length())) {
458 n1 = n1->getNextSibling();
463 nodeName = XMLString::transcode(n1->getNodeName());
465 if (n1 != 0 && rest != 0) {
466 *rest =
std::string(nodeName).substr(tagName.length(), strlen(nodeName) - tagName.length());
471 while (n1->getNodeType() != DOMNode::ELEMENT_NODE) {
472 n1 = n1->getNextSibling();
478 if (n1 != 0 && rest != 0) {
479 nodeName = XMLString::transcode(n1->getNodeName());
502 XERCES_CPP_NAMESPACE_USE
507 DOMNamedNodeMap*
attributes = node->getAttributes();
508 if (attributes == 0) {
513 XMLCh* attrName = XMLString::transcode(name.c_str());
514 DOMNode* attribNode = attributes->getNamedItem(attrName);
517 if (attribNode == 0) {
521 char* retCstr = XMLString::transcode(attribNode->getNodeValue());
538 XERCES_CPP_NAMESPACE_USE
547 const XMLCh* retXmlCh = n1->getTextContent();
552 char* retCstr = XMLString::transcode(retXmlCh);
553 XMLString::trim(retCstr);
575 static const std::string valid_hex_start(
"0123456789ABCDEFabcdef");
578 static const std::string valid_hex_end(
"0123456789ABCDEFabcdef");
583 unsigned int hexStart = tempStr.find_first_of(valid_hex_start);
584 unsigned int hexEnd = tempStr.find_first_not_of(valid_hex_end, hexStart);
586 if (hexStart == hexEnd) {
588 LogDebug(
"TriggerMenuXmlParser") <<
"No hex value found in: " << tempStr << std::endl;
593 tempStr = tempStr.substr(hexStart, hexEnd - hexStart);
595 if (tempStr.empty() ) {
597 LogDebug(
"TriggerMenuXmlParser") <<
"Empty value in " << __PRETTY_FUNCTION__
606 if (tempStr.length() > 16) {
607 tempStrL = tempStr.substr(tempStr.length()-16, 16);
608 tempStrH = tempStr.substr(0, tempStr.length()-16);
616 char* endPtr = (
char*) tempStrL.c_str();
621 LogDebug(
"TriggerMenuXmlParser") <<
"Unable to convert " << tempStr <<
" to hex."
628 endPtr = (
char*) tempStrH.c_str();
633 LogDebug(
"TriggerMenuXmlParser") <<
"Unable to convert " << tempStr <<
" to hex."
660 LogDebug(
"TriggerMenuXmlParser") <<
"node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
668 if ( !hexString2UInt128(tempStr, tempUIntL, tempUIntH) ) {
684 if ( !hexString2UInt128(tempStr, tempUIntL, tempUIntH) ) {
711 if ( !getXMLHexTextValue128Old(node, tempUInt, dummyH) ) {
716 edm::LogError(
"TriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
731 if ( !getXMLHexTextValue128( childName, tempUInt, dummyH) ) {
736 edm::LogError(
"TriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
758 XERCES_CPP_NAMESPACE_USE
767 if ( !hexString2UInt128(maxString, maxBitsL, maxBitsH) ) {
782 while (maxBitsL != 0) {
784 if ( (maxBitsL & 1) == 0) {
787 <<
" Confused by not continous set bits for max value " << maxString
797 if ( (maxBitsH != 0) && (counter != 64)) {
800 <<
" Confused by not continous set bits for max value " << maxString
806 while (maxBitsH != 0) {
808 if ( (maxBitsH & 1) == 0) {
811 <<
" Confused by not continous set bits for max value " << maxString
839 const std::string& childName,
unsigned int num, std::vector<boost::uint64_t>& dst) {
841 XERCES_CPP_NAMESPACE_USE
846 <<
"node == 0 in " << __PRETTY_FUNCTION__
852 DOMNode* n1 = findXMLChild(node->getFirstChild(), childName);
857 LogDebug(
"TriggerMenuXmlParser") <<
"Child of condition not found ( " << childName
872 n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
873 for (
unsigned int i = 0;
i <
num;
i++) {
876 LogDebug(
"TriggerMenuXmlParser") <<
"Not enough values in condition child ( "
877 << childName <<
")" << std::endl;
882 if ( !getXMLHexTextValueOld(n1, dst[
i]) ) {
884 edm::LogError(
"TriggerMenuXmlParser") <<
"Error converting condition child ( "
885 << childName <<
") value." << std::endl;
890 n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue);
905 XERCES_CPP_NAMESPACE_USE
911 if (m_xmlErrHandler != 0) {
912 delete m_xmlErrHandler;
916 XMLPlatformUtils::Terminate();
935 XERCES_CPP_NAMESPACE_USE
937 DOMDocument*
doc = parser->getDocument();
938 DOMNode* n1 = doc->getFirstChild();
942 edm::LogError(
"TriggerMenuXmlParser") <<
"Error: Found no XML child" << std::endl;
948 n1 = findXMLChild(n1, m_xmlTagVme);
951 edm::LogError(
"TriggerMenuXmlParser") <<
"Error: No vme tag found." << std::endl;
955 n1 = n1->getFirstChild();
957 unsigned int chipCounter = 0;
959 while (chipCounter < m_numberConditionChips) {
961 n1 = findXMLChild(n1, m_xmlTagChip,
true);
972 n1 = n1->getNextSibling();
988 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip
989 != m_conditionMap.end(); itCondOnChip++) {
993 itCondOnChip->clear();
998 m_algorithmMap.clear();
1011 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
1012 LogTrace(
"TriggerMenuXmlParser") <<
" Condition " << cName
1013 <<
" already exists - not inserted!" << std::endl;
1017 (m_conditionMap[chipNr])[cName] = &cond;
1036 if (m_algorithmMap.count(algName) != 0) {
1037 LogTrace(
"TriggerMenuXmlParser") <<
" Algorithm \"" << algName
1038 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
1042 if (m_algorithmAliasMap.count(algAlias) != 0) {
1043 LogTrace(
"TriggerMenuXmlParser") <<
" Algorithm alias \"" << algAlias
1044 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
1050 if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberPhysTriggers))) {
1051 LogTrace(
"TriggerMenuXmlParser") <<
" Bit number " << bitNumber
1052 <<
" outside allowed range [0, " << m_numberPhysTriggers
1053 <<
") - algorithm not inserted!" << std::endl;
1058 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
1059 LogTrace(
"TriggerMenuXmlParser") <<
" More than maximum allowed "
1060 << m_numberPhysTriggers <<
" algorithms in the algorithm map - not inserted!"
1066 int chipNr = alg.
algoChipNumber(static_cast<int>(m_numberConditionChips),
1067 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1069 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
1070 LogTrace(
"TriggerMenuXmlParser") <<
" Chip number " << chipNr
1071 <<
" outside allowed range [0, " << m_numberConditionChips
1072 <<
") - algorithm not inserted!" << std::endl;
1077 int outputPin = alg.
algoOutputPin(static_cast<int>(m_numberConditionChips),
1078 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1080 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
1081 LogTrace(
"TriggerMenuXmlParser") <<
" Output pin " << outputPin
1082 <<
" outside allowed range [0, " << m_pinsOnConditionChip
1083 <<
"] - algorithm not inserted!" << std::endl;
1088 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
1090 int iPin = (itAlgo->second).algoOutputPin( static_cast<int>(m_numberConditionChips),
1091 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1093 int iChip = (itAlgo->second).algoChipNumber(static_cast<int>(m_numberConditionChips),
1094 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1096 if ( (outputPin == iPin) && (chipNr == iChip)) {
1097 LogTrace(
"TriggerMenuXmlParser") <<
" Output pin " << outputPin
1098 <<
" is the same as for algorithm " << iName
1099 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!"
1107 m_algorithmMap[algName] = alg;
1108 m_algorithmAliasMap[algAlias] = alg;
1127 if (m_technicalTriggerMap.count(algName) != 0) {
1128 LogTrace(
"TriggerMenuXmlParser") <<
" Technical trigger \""
1130 <<
"\"already exists in the technical trigger map- not inserted!"
1138 || (bitNumber >= static_cast<int>(m_numberTechTriggers))) {
1139 LogTrace(
"TriggerMenuXmlParser") <<
" Bit number "
1140 << bitNumber <<
" outside allowed range [0, "
1141 << m_numberTechTriggers
1142 <<
") - technical trigger not inserted!" << std::endl;
1147 for (
CItAlgo itAlgo = m_technicalTriggerMap.begin(); itAlgo
1148 != m_technicalTriggerMap.end(); itAlgo++) {
1150 int iBitNumber = (itAlgo->second).algoBitNumber();
1153 if ((iBitNumber == bitNumber)) {
1154 LogTrace(
"TriggerMenuXmlParser") <<
" Bit number "
1155 << iBitNumber <<
" is the same as for technical trigger "
1156 << iName <<
" - technical trigger not inserted!"
1164 if (m_technicalTriggerMap.size() >= m_numberTechTriggers) {
1166 <<
" More than maximum allowed " << m_numberTechTriggers
1167 <<
" technical triggers in the technical trigger map - not inserted!"
1173 m_technicalTriggerMap[algName] = alg;
1189 if (type == m_xmlConditionAttrType1s) {
1193 if (type == m_xmlConditionAttrType2s) {
1197 if (type == m_xmlConditionAttrType3s) {
1201 if (type == m_xmlConditionAttrType4s) {
1205 if (type == m_xmlConditionAttrType2wsc) {
1209 if (type == m_xmlConditionAttrType2cor) {
1227 if (type == m_xmlConditionAttrType1s) {
1231 if (type == m_xmlConditionAttrType2s) {
1235 if (type == m_xmlConditionAttrType3s) {
1239 if (type == m_xmlConditionAttrType4s) {
1243 if (type == m_xmlConditionAttrType2wsc) {
1247 if (type == m_xmlConditionAttrType2cor) {
1264 if (getXMLAttribute(node, m_xmlAttrMode) != m_xmlAttrModeBit) {
1266 edm::LogError(
"TriggerMenuXmlParser") <<
"Invalid mode for single bit" << std::endl;
1272 if (tmpStr ==
"0") {
1275 else if (tmpStr ==
"1") {
1279 edm::LogError(
"TriggerMenuXmlParser") <<
"Bad bit value (" << tmpStr <<
")"
1297 XERCES_CPP_NAMESPACE_USE
1302 <<
"node == 0 in " << __PRETTY_FUNCTION__
1309 DOMNode* n1 = node->getFirstChild();
1310 n1 = findXMLChild(n1, nodeName);
1313 n1 = findXMLChild(n1->getFirstChild(), m_xmlTagGEq);
1316 LogDebug(
"TriggerMenuXmlParser") <<
"No \"greater or equal\" tag found"
1322 return getBitFromNode(n1);
1345 unsigned int num, std::vector<bool>& mipDst, std::vector<bool>& isoEnDst,
1346 std::vector<bool>& isoReqDst) {
1348 XERCES_CPP_NAMESPACE_USE
1355 DOMNode* n1 = findXMLChild(node->getFirstChild(), m_xmlTagPtLowThreshold);
1362 n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
1364 for (
unsigned int i = 0;
i <
num;
i++) {
1372 DOMNode* bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagEnableMip);
1377 int tmpint = getBitFromNode(bitnode);
1382 mipDst[
i] = (tmpint != 0);
1390 bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagEnableIso);
1395 tmpint = getBitFromNode(bitnode);
1400 isoEnDst[
i] = (tmpint != 0);
1407 bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagRequestIso);
1412 tmpint = getBitFromNode(bitnode);
1417 isoReqDst[
i] = (tmpint != 0);
1424 n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue);
1432 std::stringstream
ss;
1437 std::stringstream
ss;
1438 ss << std::setfill(
'0');
1439 ss << std::setw(4) << date.year() <<
"-" << std::setw(2) << date.month() <<
"-" << std::setw(2) << date.day() <<
"T";
1440 ss << std::setw(2) << date.hours() <<
":" << std::setw(2) << date.minutes() <<
":" << std::setw(2) << date.seconds();
1445 std::stringstream
ss;
1466 unsigned int chipNr,
const bool corrFlag) {
1468 XERCES_CPP_NAMESPACE_USE
1476 if( particle==
"mu" ) particle =
"muon";
1478 if( type==
"double_wsc" ) type =
"2_wsc";
1479 else if( type==
"single" ) type =
"1_s";
1480 else if( type==
"double" ) type =
"2_s";
1481 else if( type==
"triple" ) type =
"3";
1482 else if( type==
"quad" ) type =
"4";
1485 <<
"\n ****************************************** "
1487 <<
"\n condition = " << condition
1488 <<
"\n particle = " << particle
1489 <<
"\n type = " << type
1490 <<
"\n name = " << name
1493 if (particle != m_xmlConditionAttrObjectMu) {
1494 edm::LogError(
"TriggerMenuXmlParser") <<
"Wrong particle for muon-condition ("
1495 << particle <<
")" << std::endl;
1500 std::string str_etComparison = l1t2string( condMu.comparison_operator() );
1502 int nrObj = getNumFromType(type);
1504 edm::LogError(
"TriggerMenuXmlParser") <<
"Unknown type for muon-condition (" << type
1505 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1510 int intGEq = ( str_etComparison==
"ge" ) ? 1 : 0;
1512 edm::LogError(
"TriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag"
1517 bool gEq = (intGEq != 0);
1522 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1526 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1527 tmpValues.reserve( nrObj );
1529 if(
int(condMu.objectRequirements().objectRequirement().size())!=nrObj ){
1530 edm::LogError(
"TriggerMenuXmlParser") <<
" condMu objects: nrObj = " << nrObj
1531 <<
"condMu.objectRequirements().objectRequirement().size() = "
1532 << condMu.objectRequirements().objectRequirement().size()
1538 std::string str_chargeCorrelation = l1t2string( condMu.requestedChargeCorr() );
1540 unsigned int chargeCorrelation = 0;
1541 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1542 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1543 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1552 for( l1t::MuonObjectRequirements::objectRequirement_const_iterator objPar = condMu.objectRequirements().objectRequirement().begin();
1553 objPar != condMu.objectRequirements().objectRequirement().end(); ++objPar ){
1556 str_condMu = l1t2string( objPar->ptThreshold() );
1557 if( !getXMLHexTextValue(str_condMu, dst) )
return false;
1561 objParameter[cnt].ptHighThreshold = objPar->ptThreshold();
1562 objParameter[cnt].ptLowThreshold = objPar->ptThreshold();
1567 str_condMu =
"7f7f";
1569 if( !getXMLHexTextValue(str_condMu, dst) )
return false;
1570 if( cnt<nrObj ) objParameter[cnt].etaRange = dst;
1573 str_condMu =
"3ffff";
1574 if( !getXMLHexTextValue(str_condMu, dst) )
return false;
1576 getXMLHexTextValue(
"8f", dst);
1577 objParameter[cnt].phiHigh = dst;
1578 objParameter[cnt].phiLow = dst;
1580 objParameter[cnt].enableMip =
false;
1581 objParameter[cnt].enableIso =
false;
1582 objParameter[cnt].requestIso =
false;
1584 std::string str_charge = l1t2string( objPar->requestedCharge() );
1586 if( str_charge==
"ign" ) charge = -1;
1587 else if( str_charge==
"pos" ) charge = 0;
1588 else if( str_charge==
"neg" ) charge = 1;
1590 objParameter[cnt].charge =
charge;
1594 for( l1t::MuonQualityLUT::quality_const_iterator iQualFlag = objPar->qualityLut().quality().begin();
1595 iQualFlag != objPar->qualityLut().quality().end(); ++iQualFlag ){
1597 bool flag = (*iQualFlag);
1599 qualityLUT |= (flag << cntQual);
1602 <<
"\n quality flag " << cntQual <<
" = " << flag
1603 <<
"\n qualityLUT = " << qualityLUT
1609 objParameter[cnt].qualityLUT = qualityLUT;
1613 int isolationLUT = 0;
1614 for( l1t::MuonIsolationLUT::isolation_const_iterator iIsoFlag = objPar->isolationLut().isolation().begin();
1615 iIsoFlag != objPar->isolationLut().isolation().end(); ++iIsoFlag ){
1617 bool flag = (*iIsoFlag);
1619 isolationLUT |= (flag << cntIso);
1622 <<
"\n isolation flag " << cntIso <<
" = " << flag
1623 <<
"\n isolationLUT = " << isolationLUT
1629 objParameter[cnt].isolationLUT = isolationLUT;
1633 unsigned int etaWindowLower=-1, etaWindowUpper=-1, etaWindowVetoLower=-1, etaWindowVetoUpper=-1;
1635 for( l1t::MuonObjectRequirement::etaWindow_const_iterator etaWindow =objPar->etaWindow().begin();
1636 etaWindow != objPar->etaWindow().end(); ++etaWindow ){
1639 <<
"\n etaWindow lower = " << etaWindow->lower()
1640 <<
"\n etaWindow upper = " << etaWindow->upper()
1642 if( cntEta==0 ){ etaWindowLower = etaWindow->lower(); etaWindowUpper = etaWindow->upper(); }
1643 else if( cntEta==1 ){ etaWindowVetoLower = etaWindow->lower(); etaWindowVetoUpper = etaWindow->upper(); }
1648 unsigned int phiWindowLower=-1, phiWindowUpper=-1, phiWindowVetoLower=-1, phiWindowVetoUpper=-1;
1649 for( l1t::MuonObjectRequirement::phiWindow_const_iterator phiWindow =objPar->phiWindow().begin();
1650 phiWindow != objPar->phiWindow().end(); ++phiWindow ){
1653 <<
"\n phiWindow begin = " << phiWindow->lower()
1654 <<
"\n phiWindow end = " << phiWindow->upper()
1657 if( cntPhi==0 ){ phiWindowLower = phiWindow->lower(); phiWindowUpper = phiWindow->upper(); }
1658 else if( cntPhi==1 ){ phiWindowVetoLower = phiWindow->lower(); phiWindowVetoUpper = phiWindow->upper(); }
1662 objParameter[cnt].etaWindowLower = etaWindowLower;
1663 objParameter[cnt].etaWindowUpper = etaWindowUpper;
1664 objParameter[cnt].etaWindowVetoLower = etaWindowVetoLower;
1665 objParameter[cnt].etaWindowVetoUpper = etaWindowVetoUpper;
1667 objParameter[cnt].phiWindowLower = phiWindowLower;
1668 objParameter[cnt].phiWindowUpper = phiWindowUpper;
1669 objParameter[cnt].phiWindowVetoLower = phiWindowVetoLower;
1670 objParameter[cnt].phiWindowVetoUpper = phiWindowVetoUpper;
1675 <<
"\n Muon PT high threshold (hex) for muon object " << cnt <<
" = "
1676 << std::hex << objParameter[cnt].ptHighThreshold <<
std::dec
1677 <<
"\n etaWindow (hex) for muon object " << cnt <<
" = "
1678 << std::hex << objParameter[cnt].etaRange <<
std::dec
1681 <<
"\n etaWindow Lower / Upper for muon object " << cnt <<
" = "
1682 << objParameter[cnt].etaWindowLower <<
" / " << objParameter[cnt].etaWindowUpper
1683 <<
"\n etaWindowVeto Lower / Upper for muon object " << cnt <<
" = "
1684 << objParameter[cnt].etaWindowVetoLower <<
" / " << objParameter[cnt].etaWindowVetoUpper
1685 <<
"\n phiWindow Lower / Upper for muon object " << cnt <<
" = "
1686 << objParameter[cnt].phiWindowLower <<
" / " << objParameter[cnt].phiWindowUpper
1687 <<
"\n phiWindowVeto Lower / Upper for muon object " << cnt <<
" = "
1688 << objParameter[cnt].phiWindowVetoLower <<
" / " << objParameter[cnt].phiWindowVetoUpper
1697 bool wscVal = (type == m_xmlConditionAttrType2wsc );
1701 xsd::cxx::tree::optional<l1t::DeltaRequirement> condRanges = condMu.deltaRequirement();
1703 <<
"\t condRanges->deltaEtaRange().lower() = " << condRanges->deltaEtaRange().lower()
1704 <<
"\n\t condRanges->deltaEtaRange().upper() = " << condRanges->deltaEtaRange().upper()
1705 <<
"\n\t condRanges->deltaPhiRange().lower() = " << condRanges->deltaPhiRange().lower()
1706 <<
"\n\t condRanges->deltaPhiRange().upper() = " << condRanges->deltaPhiRange().upper()
1720 str_condMu =
"0003";
1721 if ( !hexString2UInt128(str_condMu, tempUIntL, tempUIntH) ) {
1724 if( tempUIntH != 0 ){
1725 edm::LogError(
"TriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
1732 if ( !hexString2UInt128(str_condMu, tempUIntL, tempUIntH) ) {
1735 if( tempUIntH != 0 ){
1736 edm::LogError(
"TriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
1746 unsigned int maxbits = 0;
1748 if ( !countConditionChildMaxBits(maxString, maxbits) ) {
1754 <<
" deltaPhiMaxbits (dec) = " << maxbits
1768 <<
"Type for muon condition id l1t::TypeNull - it means not defined in the XML file."
1769 <<
"\nNumber of trigger objects is set to zero. " << std::endl;
1774 std::vector<L1GtObject> objType(nrObj,
Mu);
1778 int relativeBx = l1t2int( condMu.relativeBx() );
1785 muonCond.setCondType(cType);
1786 muonCond.setObjectType(objType);
1787 muonCond.setCondGEq(gEq);
1788 muonCond.setCondChipNr(chipNr);
1789 muonCond.setCondRelativeBx(relativeBx);
1791 muonCond.setConditionParameter(objParameter, corrParameter);
1794 std::ostringstream myCoutStream;
1795 muonCond.print(myCoutStream);
1796 LogTrace(
"TriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
1800 if ( !insertConditionIntoMap(muonCond, chipNr)) {
1802 <<
" Error: duplicate condition (" << name <<
")"
1808 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1811 (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1818 <<
"\n intGEq = " << intGEq
1819 <<
" nrObj = " << nrObj
1820 <<
"\n ****************************************** "
1839 unsigned int chipNr,
const bool corrFlag) {
1841 XERCES_CPP_NAMESPACE_USE
1846 std::string particle = l1t2string( condCalo.objectType() );
1851 <<
"\n ****************************************** "
1852 <<
"\n DARRENS TEST OUTPUT (in parseCalo) "
1853 <<
"\n condition = " << condition
1854 <<
"\n particle = " << particle
1855 <<
"\n type = " << type
1856 <<
"\n name = " << name
1863 if (particle == m_xmlConditionAttrObjectNoIsoEG) {
1866 else if (particle == m_xmlConditionAttrObjectIsoEG) {
1867 caloObjType =
IsoEG;
1869 else if (particle == m_xmlConditionAttrObjectCenJet) {
1872 else if (particle == m_xmlConditionAttrObjectTauJet) {
1875 else if (particle == m_xmlConditionAttrObjectForJet) {
1879 edm::LogError(
"TriggerMenuXmlParser") <<
"Wrong particle for calo-condition ("
1880 << particle <<
")" << std::endl;
1884 if( type==
"double_wsc" ) type =
"2_wsc";
1885 else if( type==
"single" ) type =
"1_s";
1886 else if( type==
"double" ) type =
"2_s";
1887 else if( type==
"triple" ) type =
"3";
1888 else if( type==
"quad" ) type =
"4";
1891 std::string str_etComparison = l1t2string( condCalo.comparison_operator() );
1893 int nrObj = getNumFromType(type);
1895 edm::LogError(
"TriggerMenuXmlParser") <<
"Unknown type for calo-condition (" << type
1896 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1901 int intGEq = ( str_etComparison==
"ge" ) ? 1 : 0;
1903 edm::LogError(
"TriggerMenuXmlParser") <<
"Error getting \"greater or equal\" flag"
1908 bool gEq = (intGEq != 0);
1913 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1917 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1918 tmpValues.reserve( nrObj );
1920 if(
int(condCalo.objectRequirements().objectRequirement().size())!=nrObj ){
1921 edm::LogError(
"TriggerMenuXmlParser") <<
" condCalo objects: nrObj = " << nrObj
1922 <<
"condCalo.objectRequirements().objectRequirement().size() = "
1923 << condCalo.objectRequirements().objectRequirement().size()
1933 for( l1t::CalorimeterObjectRequirements::objectRequirement_const_iterator objPar = condCalo.objectRequirements().objectRequirement().begin();
1934 objPar != condCalo.objectRequirements().objectRequirement().end(); ++objPar ){
1937 str_condCalo = l1t2string( objPar->etThreshold() );
1938 if( !getXMLHexTextValue(str_condCalo, dst) )
return false;
1941 if( cnt<nrObj ) objParameter[cnt].etThreshold = objPar->etThreshold();
1945 str_condCalo =
"7f7f";
1947 if( !getXMLHexTextValue(str_condCalo, dst) )
return false;
1948 if( cnt<nrObj ) objParameter[cnt].etaRange = dst;
1951 str_condCalo =
"3ffff";
1952 if( !getXMLHexTextValue(str_condCalo, dst) )
return false;
1953 if( cnt<nrObj ) objParameter[cnt].phiRange = dst;
1957 int isolationLUT = 0;
1958 for( l1t::CalorimeterIsolationLUT::isolation_const_iterator iIsoFlag = objPar->isolationLut().isolation().begin();
1959 iIsoFlag != objPar->isolationLut().isolation().end(); ++iIsoFlag ){
1961 bool flag = (*iIsoFlag);
1963 isolationLUT |= (flag << cntIso);
1966 <<
"\n isolation flag " << cntIso <<
" = " << flag
1967 <<
"\n isolationLUT = " << isolationLUT
1973 objParameter[cnt].isolationLUT = isolationLUT;
1977 unsigned int etaWindowLower=-1, etaWindowUpper=-1, etaWindowVetoLower=-1, etaWindowVetoUpper=-1;
1979 for( l1t::CalorimeterObjectRequirement::etaWindow_const_iterator etaWindow =objPar->etaWindow().begin();
1980 etaWindow != objPar->etaWindow().end(); ++etaWindow ){
1983 <<
"\n etaWindow lower = " << etaWindow->lower()
1984 <<
"\n etaWindow upper = " << etaWindow->upper()
1986 if( cntEta==0 ){ etaWindowLower = etaWindow->lower(); etaWindowUpper = etaWindow->upper(); }
1987 else if( cntEta==1 ){ etaWindowVetoLower = etaWindow->lower(); etaWindowVetoUpper = etaWindow->upper(); }
1992 unsigned int phiWindowLower=-1, phiWindowUpper=-1, phiWindowVetoLower=-1, phiWindowVetoUpper=-1;
1993 for( l1t::CalorimeterObjectRequirement::phiWindow_const_iterator phiWindow =objPar->phiWindow().begin();
1994 phiWindow != objPar->phiWindow().end(); ++phiWindow ){
1997 <<
"\n phiWindow begin = " << phiWindow->lower()
1998 <<
"\n phiWindow end = " << phiWindow->upper()
2001 if( cntPhi==0 ){ phiWindowLower = phiWindow->lower(); phiWindowUpper = phiWindow->upper(); }
2002 else if( cntPhi==1 ){ phiWindowVetoLower = phiWindow->lower(); phiWindowVetoUpper = phiWindow->upper(); }
2006 objParameter[cnt].etaWindowLower = etaWindowLower;
2007 objParameter[cnt].etaWindowUpper = etaWindowUpper;
2008 objParameter[cnt].etaWindowVetoLower = etaWindowVetoLower;
2009 objParameter[cnt].etaWindowVetoUpper = etaWindowVetoUpper;
2011 objParameter[cnt].phiWindowLower = phiWindowLower;
2012 objParameter[cnt].phiWindowUpper = phiWindowUpper;
2013 objParameter[cnt].phiWindowVetoLower = phiWindowVetoLower;
2014 objParameter[cnt].phiWindowVetoUpper = phiWindowVetoUpper;
2019 <<
"\n Calo ET high threshold (hex) for calo object " << cnt <<
" = "
2020 << std::hex << objParameter[cnt].etThreshold <<
std::dec
2021 <<
"\n etaWindow (hex) for calo object " << cnt <<
" = "
2022 << std::hex << objParameter[cnt].etaRange <<
std::dec
2023 <<
"\n phiRange (hex) for calo object " << cnt <<
" = "
2024 << std::hex << objParameter[cnt].phiRange <<
std::dec
2025 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = "
2026 << objParameter[cnt].etaWindowLower <<
" / " << objParameter[cnt].etaWindowUpper
2027 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = "
2028 << objParameter[cnt].etaWindowVetoLower <<
" / " << objParameter[cnt].etaWindowVetoUpper
2029 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = "
2030 << objParameter[cnt].phiWindowLower <<
" / " << objParameter[cnt].phiWindowUpper
2031 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = "
2032 << objParameter[cnt].phiWindowVetoLower <<
" / " << objParameter[cnt].phiWindowVetoUpper
2041 bool wscVal = (type == m_xmlConditionAttrType2wsc );
2045 xsd::cxx::tree::optional<l1t::DeltaRequirement> condRanges = condCalo.deltaRequirement();
2047 <<
"\t condRanges->deltaEtaRange().lower() = " << condRanges->deltaEtaRange().lower()
2048 <<
"\n\t condRanges->deltaEtaRange().upper() = " << condRanges->deltaEtaRange().upper()
2049 <<
"\n\t condRanges->deltaPhiRange().lower() = " << condRanges->deltaPhiRange().lower()
2050 <<
"\n\t condRanges->deltaPhiRange().upper() = " << condRanges->deltaPhiRange().upper()
2064 str_condCalo =
"0003";
2065 if ( !hexString2UInt128(str_condCalo, tempUIntL, tempUIntH) ) {
2068 if( tempUIntH != 0 ){
2069 edm::LogError(
"TriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
2075 str_condCalo =
"003";
2076 if ( !hexString2UInt128(str_condCalo, tempUIntL, tempUIntH) ) {
2079 if( tempUIntH != 0 ){
2080 edm::LogError(
"TriggerMenuXmlParser") <<
"Too large hex-value!" << std::endl;
2090 unsigned int maxbits = 0;
2092 if ( !countConditionChildMaxBits(maxString, maxbits) ) {
2098 <<
" deltaPhiMaxbits (dec) = " << maxbits
2108 <<
" Condition type (enum value) = " << cType
2113 <<
"Type for calo condition id l1t::TypeNull - it means not defined in the XML file."
2114 <<
"\nNumber of trigger objects is set to zero. " << std::endl;
2119 std::vector<L1GtObject> objType(nrObj, caloObjType);
2122 int relativeBx = l1t2int( condCalo.relativeBx() );
2127 caloCond.setCondType(cType);
2128 caloCond.setObjectType(objType);
2129 caloCond.setCondGEq(gEq);
2130 caloCond.setCondChipNr(chipNr);
2131 caloCond.setCondRelativeBx(relativeBx);
2133 caloCond.setConditionParameter(objParameter, corrParameter);
2137 std::ostringstream myCoutStream;
2138 caloCond.print(myCoutStream);
2139 LogTrace(
"TriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2144 if ( !insertConditionIntoMap(caloCond, chipNr)) {
2147 <<
" Error: duplicate condition (" << name <<
")"
2155 (m_corCaloTemplate[chipNr]).push_back(caloCond);
2158 (m_vecCaloTemplate[chipNr]).push_back(caloCond);
2164 <<
"\n intGEq = " << intGEq
2165 <<
" nrObj = " << nrObj
2166 <<
"\n ****************************************** "
2186 unsigned int chipNr,
const bool corrFlag) {
2188 XERCES_CPP_NAMESPACE_USE
2197 <<
"\n ****************************************** "
2198 <<
"\n DARRENS TEST OUTPUT (in parseEnergySum) "
2199 <<
"\n condition = " << condition
2200 <<
"\n type = " << type
2201 <<
"\n name = " << name
2208 if( type == m_xmlConditionAttrObjectETM ){
2209 energySumObjType =
ETM;
2212 else if( type == m_xmlConditionAttrObjectETT ){
2213 energySumObjType =
ETT;
2216 else if( type == m_xmlConditionAttrObjectHTT ){
2217 energySumObjType =
HTT;
2220 else if( type == m_xmlConditionAttrObjectHTM ){
2221 energySumObjType =
HTM;
2226 <<
"Wrong type for energy-sum condition (" << type
2227 <<
")" << std::endl;
2236 std::string str_etComparison = l1t2string( condEnergySum.comparison_operator() );
2239 int intGEq = ( str_etComparison==
"ge" ) ? 1 : 0;
2242 <<
"Error getting \"greater or equal\" flag"
2247 bool gEq = (intGEq != 0);
2253 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2258 l1t::EnergySumsObjectRequirement objPar = condEnergySum.objectRequirement();
2261 objParameter[cnt].etThreshold = objPar.etThreshold();
2264 unsigned int phiWindowLower=-1, phiWindowUpper=-1, phiWindowVetoLower=-1, phiWindowVetoUpper=-1;
2265 for( l1t::EnergySumsObjectRequirement::phiWindow_const_iterator phiWindow =objPar.phiWindow().begin();
2266 phiWindow != objPar.phiWindow().end(); ++phiWindow ){
2269 <<
"\n phiWindow begin = " << phiWindow->lower()
2270 <<
"\n phiWindow end = " << phiWindow->upper()
2273 if( cntPhi==0 ){ phiWindowLower = phiWindow->lower(); phiWindowUpper = phiWindow->upper(); }
2274 else if( cntPhi==1 ){ phiWindowVetoLower = phiWindow->lower(); phiWindowVetoUpper = phiWindow->upper(); }
2278 objParameter[cnt].phiWindowLower = phiWindowLower;
2279 objParameter[cnt].phiWindowUpper = phiWindowUpper;
2280 objParameter[cnt].phiWindowVetoLower = phiWindowVetoLower;
2281 objParameter[cnt].phiWindowVetoUpper = phiWindowVetoUpper;
2286 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2287 << std::hex << objParameter[cnt].etThreshold <<
std::dec
2288 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = "
2289 << objParameter[cnt].phiWindowLower <<
" / " << objParameter[cnt].phiWindowUpper
2290 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = "
2291 << objParameter[cnt].phiWindowVetoLower <<
" / " << objParameter[cnt].phiWindowVetoUpper
2297 int relativeBx = l1t2int( condEnergySum.relativeBx() );
2300 std::vector<L1GtObject> objType(nrObj, energySumObjType);
2316 std::ostringstream myCoutStream;
2317 energySumCond.
print(myCoutStream);
2318 LogTrace(
"TriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
2323 if ( !insertConditionIntoMap(energySumCond, chipNr)) {
2326 <<
" Error: duplicate condition (" << name <<
")"
2334 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2338 (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2454 XERCES_CPP_NAMESPACE_USE
2628 XERCES_CPP_NAMESPACE_USE
2704 XERCES_CPP_NAMESPACE_USE
2837 XERCES_CPP_NAMESPACE_USE
2969 XERCES_CPP_NAMESPACE_USE
3038 XERCES_CPP_NAMESPACE_USE
3106 unsigned int chipNr) {
3108 XERCES_CPP_NAMESPACE_USE
3114 if ( !insertConditionIntoMap(correlationCond, chipNr)) {
3117 <<
" Error: duplicate correlation condition (" << name <<
")"
3442 XERCES_CPP_NAMESPACE_USE
3620 m_triggerMenuInterface = l1t2string( meta.name() );
3621 m_triggerMenuInterfaceDate =
"2013-010-24T15:33:24";
3622 m_triggerMenuInterfaceAuthor =
"Darren Puigh";
3623 m_triggerMenuInterfaceDescription = l1t2string( meta.comment() );
3627 m_triggerMenuDescription = l1t2string( meta.comment() );
3628 m_scaleDbKey = l1t2string( meta.scale_set() );
3632 for( l1t::RevisionList::revision_const_iterator revision = meta.revisions().revision().begin();
3633 revision != meta.revisions().revision().end(); ++revision ){
3636 <<
"\t Revision " << cnt
3637 <<
"\t\t author = " << l1t2string( revision->author() )
3638 <<
"\t\t datetime = " << l1tDateTime2string( revision->datetime() )
3642 m_triggerMenuDate = l1tDateTime2string( revision->datetime() );
3643 m_triggerMenuAuthor = l1t2string( revision->author() );
3650 <<
"\n Parsed values from XML file DRULES"
3651 <<
"\nL1 MenuInterface: " << m_triggerMenuInterface
3652 <<
"\nL1 MenuInterface - Creation date: " << m_triggerMenuInterfaceDate
3653 <<
"\nL1 MenuInterface - Creation author: " << m_triggerMenuInterfaceAuthor
3654 <<
"\nL1 MenuInterface - Description: " << m_triggerMenuInterfaceDescription
3656 <<
"\nAlgorithm implementation tag: " << m_algorithmImplementation
3658 <<
"\nL1 Menu - Creation date: " << m_triggerMenuDate
3659 <<
"\nL1 Menu - Creation author: " << m_triggerMenuAuthor
3660 <<
"\nL1 Menu - Description: " << m_triggerMenuDescription
3668 std::string menuName = m_triggerMenuInterface +
"/" + m_scaleDbKey +
"/" + m_algorithmImplementation;
3670 if (menuName != m_triggerMenuName) {
3672 LogDebug(
"TriggerMenuXmlParser") <<
"\n Warning: Inconsistent L1 menu name:"
3673 <<
"\n from XML file name: " << m_triggerMenuName
3674 <<
"\n from XML tag: " << menuName << std::endl;
3676 if (m_triggerMenuInterface !=
"") {
3677 if (m_scaleDbKey ==
"NULL") {
3678 m_triggerMenuName = m_triggerMenuInterface;
3680 m_triggerMenuName = menuName;
3683 LogTrace(
"TriggerMenuXmlParser") <<
"\n L1 menu name set to value from XML tag!"
3684 <<
"\n L1 Menu name: " << m_triggerMenuName << std::endl;
3687 LogTrace(
"TriggerMenuXmlParser") <<
"\n L1 menu name set to file name!"
3688 <<
"\n L1 Menu name: " << m_triggerMenuName << std::endl;
3711 XERCES_CPP_NAMESPACE_USE
3714 std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
3715 std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
3719 <<
"\n ****************************************** "
3720 <<
"\n workCondition "
3721 <<
"\n condition = " << condition
3722 <<
"\n particle = " << particle
3723 <<
"\n type = " << type
3724 <<
"\n name = " << name
3727 if (condition.empty() || particle.empty() || type.empty() ) {
3729 edm::LogError(
"TriggerMenuXmlParser") <<
"Missing attributes for condition " << name
3797 XERCES_CPP_NAMESPACE_USE
3799 LogTrace(
"TriggerMenuXmlParser") <<
"\nParsing conditions" << std::endl;
3802 LogDebug(
"l1t|Global") <<
" ====> condCalorimeter" << std::endl;
3803 for (l1t::ConditionList::condCalorimeter_const_iterator condCalo = conditions.condCalorimeter().begin();
3804 condCalo != conditions.condCalorimeter().end(); ++condCalo ){
3807 << condCalo->name() <<
" {"
3808 <<
" comment: " << condCalo->comment()
3809 <<
" locked: " << condCalo->locked()
3813 l1t::CalorimeterCondition condition = (*condCalo);
3815 parseCalo( condition, chipNr );
3818 LogDebug(
"l1t|Global") <<
" ====> condMuon " << std::endl;
3819 for (l1t::ConditionList::condMuon_const_iterator condMu = conditions.condMuon().begin();
3820 condMu != conditions.condMuon().end(); ++condMu ){
3823 << condMu->name() <<
" {"
3824 <<
" comment: " << condMu->comment()
3825 <<
" locked: " << condMu->locked()
3829 l1t::MuonCondition condition = (*condMu);
3831 parseMuon( condition, chipNr );
3834 LogDebug(
"l1t|Global") <<
" ====> condEnergySums " << std::endl;
3835 for (l1t::ConditionList::condEnergySums_const_iterator condEnergySums = conditions.condEnergySums().begin();
3836 condEnergySums != conditions.condEnergySums().end(); ++condEnergySums ){
3839 << condEnergySums->name() <<
" {"
3840 <<
" comment: " << condEnergySums->comment()
3841 <<
" locked: " << condEnergySums->locked()
3845 l1t::EnergySumsCondition condition = (*condEnergySums);
3847 parseEnergySum( condition, chipNr );
3866 unsigned int chipNr) {
3868 XERCES_CPP_NAMESPACE_USE
3879 std::string algAlias = l1t2string( algorithm.name() );
3880 std::string algName = l1t2string( algorithm.name() );
3882 if (algAlias ==
"") {
3885 <<
"\n No alias defined for algorithm. Alias set to algorithm name."
3886 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3890 LogDebug(
"l1t|Global") <<
"\n Alias defined for algorithm."
3891 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3896 std::string logExpression = l1t2string( algorithm.logical_expression() );
3899 <<
" Logical expression: " << logExpression
3900 <<
" Chip number: " << chipNr
3904 std::string pinString = l1t2string( algorithm.index() );
3907 std::istringstream opStream(pinString);
3909 if ((opStream >> outputPin).
fail()) {
3911 <<
" Unable to convert pin string " << pinString
3912 <<
" to int for algorithm : " << algName
3920 LogDebug(
"l1t|Global") <<
" Output pin: " << outputPin
3926 int bitNumber = outputPin;
3929 LogDebug(
"l1t|Global") <<
" Bit number: " << bitNumber
3939 std::ostringstream myCoutStream;
3940 alg.
print(myCoutStream);
3941 LogTrace(
"TriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
3946 if ( !insertAlgorithmIntoMap(alg)) {
3970 XERCES_CPP_NAMESPACE_USE
3972 LogTrace(
"TriggerMenuXmlParser") <<
"\nParsing algorithms" << std::endl;
3975 LogDebug(
"l1t|Global") <<
" ====> algorithms " << std::endl;
3976 for( l1t::AlgorithmList::algorithm_const_iterator
i = algorithms.algorithm().begin();
3977 i != algorithms.algorithm().end(); ++
i ){
3981 << algorithm.name() <<
" {"
3982 <<
" index: " << algorithm.index()
3983 <<
" equation: " << algorithm.logical_expression()
3984 <<
" comment: " << algorithm.comment()
3985 <<
" locked: " << algorithm.locked()
3990 workAlgorithm( algorithm, chipNr );
4010 XERCES_CPP_NAMESPACE_USE
4014 <<
" Node is 0 in " << __PRETTY_FUNCTION__
4015 <<
" can not parse the technical trigger " << algName
4021 std::string logExpression = getXMLTextValue(node);
4028 DOMNode* pinNode = findXMLChild(node->getFirstChild(), m_xmlTagOutput);
4032 pinNode = node->getFirstChild();
4033 if ( (pinNode = findXMLChild(pinNode, m_xmlTagOutputPin) ) != 0) {
4034 pinString = getXMLAttribute(pinNode, m_xmlAttrNr);
4037 std::istringstream opStream(pinString);
4039 if ((opStream >> outputPin).
fail()) {
4041 <<
" Unable to convert pin string " << pinString
4042 <<
" to int for technical trigger : " << algName
4052 <<
" Warning: No pin number found for technical trigger: "
4053 << algName << std::endl;
4059 int bitNumber = outputPin;
4072 std::ostringstream myCoutStream;
4073 alg.
print(myCoutStream);
4074 LogTrace(
"TriggerMenuXmlParser") << myCoutStream.str() <<
"\n" << std::endl;
4079 if ( !insertTechTriggerIntoMap(alg)) {
4099 XERCES_CPP_NAMESPACE_USE
4103 DOMNode*
doc = parser->getDocument();
4104 DOMNode*
node = doc->getFirstChild();
4106 DOMNode* algNode = node->getFirstChild();
4109 <<
" Error: No child found for " << m_xmlTagDef << std::endl;
4113 algNode = findXMLChild(algNode, m_xmlTagTechTriggers);
4116 << m_xmlTagTechTriggers <<
"> child found."
4122 DOMNode* algNameNode = algNode->getFirstChild();
4124 algNameNode = findXMLChild(algNameNode,
"",
true, &algNameNodeName);
4126 while (algNameNode != 0) {
4131 if ( !workTechTrigger(algNameNode, algNameNodeName)) {
4135 algNameNode = findXMLChild(algNameNode->getNextSibling(),
"",
true,
4155 XERCES_CPP_NAMESPACE_USE
4161 l1t::Meta meta = tm->meta();
4162 l1t::ConditionList conditions = tm->conditions();
4163 l1t::AlgorithmList algorithms = tm->algorithms();
4165 if ( !parseId( meta ) ) {
4170 if ( !parseConditions( conditions ) ) {
4175 if ( !parseAlgorithms( algorithms ) ) {
unsigned int deltaPhiMaxbits
unsigned int deltaEtaRangeLower
void setAlgoAlias(const std::string &algoAliasValue)
virtual void print(std::ostream &myCout) const
print condition
void setCondType(const l1t::GtConditionType &cType)
unsigned long long deltaEtaRange
const std::string algoName() const
get / set algorithm name
unsigned long long deltaPhiRange
void setCondGEq(const bool &cGEq)
unsigned int deltaPhiRangeLower
virtual void print(std::ostream &myCout) const
print the condition
std::string const & algoAlias() const
get / set algorithm alias
void setAlgoChipNumber(const int algoChipNumberValue)
unsigned long long deltaPhiRange
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
unsigned int deltaEtaRangeUpper
unsigned int deltaPhiRangeLower
const int algoOutputPin(const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
get the output pin on the condition chip for the algorithm
int algoBitNumber() const
get / set algorithm bit number
unsigned int deltaPhiRangeUpper
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
unsigned int deltaPhiMaxbits
unsigned int deltaPhiRangeUpper
const std::string & condName() const
get / set condition name
unsigned long long uint64_t
bool xmlFile(const std::string fParam)
void setCondChipNr(const int &cChipNr)
typedef for correlation parameters
unsigned long long deltaEtaRange
char data[epos_bytes_allocation]
void setObjectType(const std::vector< L1GtObject > &objType)
const int algoChipNumber() const
get / set algorithm bit number
static std::atomic< unsigned int > counter
void setCondRelativeBx(const int &cRelativeBx)
unsigned int chargeCorrelation
unsigned int deltaEtaRangeLower
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
unsigned int deltaEtaRangeUpper