CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GtTriggerMenuXmlParser Class Reference

#include <L1GtTriggerMenuXmlParser.h>

Inheritance diagram for L1GtTriggerMenuXmlParser:
L1GtXmlParserTags

Public Member Functions

const std::vector< std::vector< L1GtCaloTemplate > > & corCaloTemplate () const
 
const std::vector< std::vector< L1GtEnergySumTemplate > > & corEnergySumTemplate () const
 
const std::vector< std::vector< L1GtMuonTemplate > > & corMuonTemplate () const
 
const AlgorithmMapgtAlgorithmAliasMap () const
 get / set the algorithm map (by alias) More...
 
const std::string & gtAlgorithmImplementation () const
 
const AlgorithmMapgtAlgorithmMap () const
 get / set the algorithm map (by name) More...
 
const std::vector< ConditionMap > & gtConditionMap () const
 get / set / build the condition maps More...
 
const unsigned int gtNumberConditionChips () const
 get / set the number of condition chips in GTL More...
 
const unsigned int gtNumberL1JetCounts () const
 get / set the number of L1 jet counts received by GT More...
 
const unsigned int gtNumberPhysTriggers () const
 get / set the number of physics trigger algorithms More...
 
const unsigned int gtNumberTechTriggers () const
 get / set the number of technical triggers More...
 
std::vector< int > gtOrderConditionChip () const
 
const unsigned int gtPinsOnConditionChip () const
 get / set the number of pins on the GTL condition chips More...
 
const std::string & gtScaleDbKey () const
 menu associated scale key More...
 
const AlgorithmMapgtTechnicalTriggerMap () const
 get / set the technical trigger map More...
 
const std::string & gtTriggerMenuAuthor () const
 
const std::string & gtTriggerMenuDate () const
 
const std::string & gtTriggerMenuDescription () const
 
const std::string & gtTriggerMenuImplementation () const
 
const std::string & gtTriggerMenuInterface () const
 get / set the trigger menu names More...
 
const std::string & gtTriggerMenuInterfaceAuthor () const
 
const std::string & gtTriggerMenuInterfaceDate () const
 get / set the XML parser creation date, author, description for menu interface, menu More...
 
const std::string & gtTriggerMenuInterfaceDescription () const
 
const std::string & gtTriggerMenuName () const
 
 L1GtTriggerMenuXmlParser ()
 
void parseXmlFile (const std::string &defXmlFile, const std::string &vmeXmlFile)
 parse def.xml and vme.xml files More...
 
void setCorCaloTemplate (const std::vector< std::vector< L1GtCaloTemplate > > &)
 
void setCorEnergySumTemplate (const std::vector< std::vector< L1GtEnergySumTemplate > > &)
 
void setCorMuonTemplate (const std::vector< std::vector< L1GtMuonTemplate > > &)
 
void setGtAlgorithmAliasMap (const AlgorithmMap &)
 
void setGtAlgorithmImplementation (const std::string &)
 
void setGtAlgorithmMap (const AlgorithmMap &)
 
void setGtConditionMap (const std::vector< ConditionMap > &)
 
void setGtNumberConditionChips (const unsigned int &)
 
void setGtNumberL1JetCounts (const unsigned int &)
 
void setGtNumberPhysTriggers (const unsigned int &)
 
void setGtNumberTechTriggers (const unsigned int &)
 
void setGtOrderConditionChip (const std::vector< int > &)
 
void setGtPinsOnConditionChip (const unsigned int &)
 
void setGtScaleDbKey (const std::string &)
 
void setGtTechnicalTriggerMap (const AlgorithmMap &)
 
void setGtTriggerMenuAuthor (const std::string &)
 
void setGtTriggerMenuDate (const std::string &)
 
void setGtTriggerMenuDescription (const std::string &)
 
void setGtTriggerMenuImplementation (const std::string &)
 
void setGtTriggerMenuInterface (const std::string &)
 
void setGtTriggerMenuInterfaceAuthor (const std::string &)
 
void setGtTriggerMenuInterfaceDate (const std::string &)
 
void setGtTriggerMenuInterfaceDescription (const std::string &)
 
void setGtTriggerMenuName (const std::string &)
 
void setVecBptxTemplate (const std::vector< std::vector< L1GtBptxTemplate > > &)
 
void setVecCaloTemplate (const std::vector< std::vector< L1GtCaloTemplate > > &)
 
void setVecCastorTemplate (const std::vector< std::vector< L1GtCastorTemplate > > &)
 
void setVecCorrelationTemplate (const std::vector< std::vector< L1GtCorrelationTemplate > > &)
 
void setVecEnergySumTemplate (const std::vector< std::vector< L1GtEnergySumTemplate > > &)
 
void setVecExternalTemplate (const std::vector< std::vector< L1GtExternalTemplate > > &)
 
void setVecHfBitCountsTemplate (const std::vector< std::vector< L1GtHfBitCountsTemplate > > &)
 
void setVecHfRingEtSumsTemplate (const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > &)
 
void setVecJetCountsTemplate (const std::vector< std::vector< L1GtJetCountsTemplate > > &)
 
void setVecMuonTemplate (const std::vector< std::vector< L1GtMuonTemplate > > &)
 
const std::vector< std::vector< L1GtBptxTemplate > > & vecBptxTemplate () const
 
const std::vector< std::vector< L1GtCaloTemplate > > & vecCaloTemplate () const
 
const std::vector< std::vector< L1GtCastorTemplate > > & vecCastorTemplate () const
 
const std::vector< std::vector< L1GtCorrelationTemplate > > & vecCorrelationTemplate () const
 
const std::vector< std::vector< L1GtEnergySumTemplate > > & vecEnergySumTemplate () const
 
const std::vector< std::vector< L1GtExternalTemplate > > & vecExternalTemplate () const
 
const std::vector< std::vector< L1GtHfBitCountsTemplate > > & vecHfBitCountsTemplate () const
 
const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > & vecHfRingEtSumsTemplate () const
 
const std::vector< std::vector< L1GtJetCountsTemplate > > & vecJetCountsTemplate () const
 
const std::vector< std::vector< L1GtMuonTemplate > > & vecMuonTemplate () const
 get / set the vectors containing the conditions More...
 
 ~L1GtTriggerMenuXmlParser () override
 destructor More...
 
- Public Member Functions inherited from L1GtXmlParserTags
 L1GtXmlParserTags ()
 constructor More...
 
virtual ~L1GtXmlParserTags ()
 destructor More...
 

Private Member Functions

void cleanupXML (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 shutdown the xml utils and deallocate parser and error handler More...
 
void clearMaps ()
 
bool countConditionChildMaxBits (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int &dst)
 get the number of bits in the max attribute of a condition child More...
 
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild (XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
 find a named child of a xml node More...
 
int getBitFromNode (XERCES_CPP_NAMESPACE::DOMNode *node)
 get bit from a bit node More...
 
bool getConditionChildValues (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
 get values from a child of a condition More...
 
int getGEqFlag (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
 getGEqFlag - get the "greater or equal flag" from a condition More...
 
bool getMuonMipIsoBits (XERCES_CPP_NAMESPACE::DOMNode *node, unsigned int num, std::vector< bool > &mipDst, std::vector< bool > &isoEnDst, std::vector< bool > &isoReqDst)
 get MIP and Isolation bits from a muon More...
 
int getNumFromType (const std::string &type)
 get number of particles from condition type More...
 
L1GtConditionType getTypeFromType (const std::string &type)
 
std::string getXMLAttribute (const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
 get a named attribute for an xml node as string More...
 
bool getXMLHexTextValue (XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dst)
 get a hexadecimal value of a xml node containing text More...
 
bool getXMLHexTextValue128 (XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dstL, uint64_t &dstH)
 get a hexadecimal value of a xml node containing text with up to 128 bit More...
 
std::string getXMLTextValue (XERCES_CPP_NAMESPACE::DOMNode *node)
 get the text value of a xml node as string More...
 
bool hexString2UInt128 (const std::string &hexString, uint64_t &dstL, uint64_t &dstH)
 convert a hexadecimal string with up to 128 to 2 uint64_t More...
 
XERCES_CPP_NAMESPACE::XercesDOMParser * initXML (const std::string &xmlFile)
 init xml system More...
 
bool insertAlgorithmIntoMap (const L1GtAlgorithm &alg)
 insert an algorithm into algorithm map More...
 
bool insertConditionIntoMap (L1GtCondition &cond, const int chipNr)
 
bool insertTechTriggerIntoMap (const L1GtAlgorithm &alg)
 insert a technical trigger into technical trigger map More...
 
bool parseAlgorithms (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 parse all algorithms More...
 
bool parseBptx (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a Bptx condition More...
 
bool parseCalo (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
 parse a calorimeter condition More...
 
bool parseCastor (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a CASTOR condition More...
 
bool parseConditions (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 parse all conditions More...
 
bool parseCorrelation (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a correlation condition More...
 
bool parseEnergySum (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
 parse an "energy sum" condition More...
 
bool parseExternal (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse an External condition More...
 
bool parseHfBitCounts (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a HfBitCounts condition More...
 
bool parseHfRingEtSums (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a HfRingEtSums condition More...
 
bool parseId (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 parse all parse all identification attributes (trigger menu names, scale DB key, etc) More...
 
bool parseJetCounts (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a "jet counts" condition More...
 
bool parseMuon (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
 parse a muon condition More...
 
bool parseTechTriggers (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 parse all algorithms More...
 
bool parseVmeXML (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 parse the vme xml file More...
 
bool workAlgorithm (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr)
 parse an algorithm and insert it into algorithm map. More...
 
bool workCondition (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr)
 choose the parser for a particular condition More...
 
bool workTechTrigger (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
 parse an algorithm and insert it into algorithm map. More...
 
bool workXML (XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
 do all the steps for filling a trigger menu More...
 

Private Attributes

AlgorithmMap m_algorithmAliasMap
 map containing the physics algorithms (by alias) More...
 
std::string m_algorithmImplementation
 
AlgorithmMap m_algorithmMap
 map containing the physics algorithms (by name) More...
 
std::vector< ConditionMapm_conditionMap
 map containing the conditions (per condition chip) - transient More...
 
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
 
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
 
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
 
unsigned int m_numberConditionChips
 hardware limits More...
 
unsigned int m_numberL1JetCounts
 jet counts More...
 
unsigned int m_numberPhysTriggers
 number of physics trigger algorithms More...
 
unsigned int m_numberTechTriggers
 number of technical triggers More...
 
std::vector< int > m_orderConditionChip
 
unsigned int m_pinsOnConditionChip
 number of pins on the GTL condition chips More...
 
std::string m_scaleDbKey
 menu associated scale key More...
 
AlgorithmMap m_technicalTriggerMap
 map containing the technical triggers More...
 
std::string m_triggerMenuAuthor
 
std::string m_triggerMenuDate
 
std::string m_triggerMenuDescription
 
std::string m_triggerMenuImplementation
 
std::string m_triggerMenuInterface
 menu names More...
 
std::string m_triggerMenuInterfaceAuthor
 
std::string m_triggerMenuInterfaceDate
 members for XML parser only (do not appear in CondFormats) More...
 
std::string m_triggerMenuInterfaceDescription
 
std::string m_triggerMenuName
 
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
 
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
 
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
 
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
 
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
 
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
 
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
 
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
 
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
 
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
 
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
 error handler for xml-parser More...
 

Additional Inherited Members

- Static Protected Attributes inherited from L1GtXmlParserTags
static const std::string m_xmlAlgorithmAttrAlias
 
static const std::string m_xmlAttrMax
 
static const std::string m_xmlAttrMode
 
static const std::string m_xmlAttrModeBit
 
static const std::string m_xmlAttrNr
 
static const std::string m_xmlAttrPin
 
static const std::string m_xmlAttrPinA
 
static const std::string m_xmlConditionAttrCondition
 
static const std::string m_xmlConditionAttrConditionBptx
 
static const std::string m_xmlConditionAttrConditionCalo
 
static const std::string m_xmlConditionAttrConditionCastor
 
static const std::string m_xmlConditionAttrConditionCorrelation
 
static const std::string m_xmlConditionAttrConditionEnergySum
 
static const std::string m_xmlConditionAttrConditionExternal
 
static const std::string m_xmlConditionAttrConditionHfBitCounts
 
static const std::string m_xmlConditionAttrConditionHfRingEtSums
 
static const std::string m_xmlConditionAttrConditionJetCounts
 
static const std::string m_xmlConditionAttrConditionMuon
 
static const std::string m_xmlConditionAttrObject
 
static const std::string m_xmlConditionAttrObjectBptx
 
static const std::string m_xmlConditionAttrObjectCastor
 
static const std::string m_xmlConditionAttrObjectCenJet
 
static const std::string m_xmlConditionAttrObjectETM
 
static const std::string m_xmlConditionAttrObjectETT
 
static const std::string m_xmlConditionAttrObjectForJet
 
static const std::string m_xmlConditionAttrObjectGtExternal
 
static const std::string m_xmlConditionAttrObjectHfBitCounts
 
static const std::string m_xmlConditionAttrObjectHfRingEtSums
 
static const std::string m_xmlConditionAttrObjectHTM
 
static const std::string m_xmlConditionAttrObjectHTT
 
static const std::string m_xmlConditionAttrObjectIsoEG
 
static const std::string m_xmlConditionAttrObjectJetCounts
 
static const std::string m_xmlConditionAttrObjectMu
 
static const std::string m_xmlConditionAttrObjectNoIsoEG
 
static const std::string m_xmlConditionAttrObjectTauJet
 
static const std::string m_xmlConditionAttrType
 
static const std::string m_xmlConditionAttrType1s
 
static const std::string m_xmlConditionAttrType2cor
 
static const std::string m_xmlConditionAttrType2s
 
static const std::string m_xmlConditionAttrType2wsc
 
static const std::string m_xmlConditionAttrType3s
 
static const std::string m_xmlConditionAttrType4s
 
static const std::string m_xmlConditionAttrTypeBptx
 
static const std::string m_xmlConditionAttrTypeCastor
 
static const std::string m_xmlConditionAttrTypeExternal
 
static const std::string m_xmlTagAlgorithms
 
static const std::string m_xmlTagCa
 
static const std::string m_xmlTagChargeCorrelation
 
static const std::string m_xmlTagChip
 
static const std::string m_xmlTagChip1
 
static const std::string m_xmlTagChipDef
 
static const std::string m_xmlTagConditions
 
static const std::string m_xmlTagCountOverflow
 
static const std::string m_xmlTagCountThreshold
 
static const std::string m_xmlTagDef
 
static const std::string m_xmlTagDeltaEta
 
static const std::string m_xmlTagDeltaPhi
 
static const std::string m_xmlTagEnableIso
 
static const std::string m_xmlTagEnableMip
 
static const std::string m_xmlTagEnergyOverflow
 
static const std::string m_xmlTagEta
 
static const std::string m_xmlTagEtThreshold
 
static const std::string m_xmlTagGEq
 
static const std::string m_xmlTagHeader
 
static const std::string m_xmlTagMenuAlgImpl
 
static const std::string m_xmlTagMenuAuthor
 
static const std::string m_xmlTagMenuDate
 
static const std::string m_xmlTagMenuDescription
 
static const std::string m_xmlTagMenuInterface
 
static const std::string m_xmlTagMenuInterfaceAuthor
 
static const std::string m_xmlTagMenuInterfaceDate
 
static const std::string m_xmlTagMenuInterfaceDescription
 
static const std::string m_xmlTagOutput
 
static const std::string m_xmlTagOutputPin
 
static const std::string m_xmlTagPhi
 
static const std::string m_xmlTagPhiHigh
 
static const std::string m_xmlTagPhiLow
 
static const std::string m_xmlTagPtHighThreshold
 
static const std::string m_xmlTagPtLowThreshold
 
static const std::string m_xmlTagQuality
 
static const std::string m_xmlTagRequestIso
 
static const std::string m_xmlTagScaleDbKey
 
static const std::string m_xmlTagTechTriggers
 
static const std::string m_xmlTagValue
 
static const std::string m_xmlTagVme
 
static const std::string m_xmlTagVmeAddress
 

Detailed Description

Description: Xerces-C XML parser for the L1 Trigger menu.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna
M. Eder - HEPHY Vienna - ORCA version, reduced functionality

Description: Xerces-C XML parser for the L1 Trigger menu.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 51 of file L1GtTriggerMenuXmlParser.h.

Constructor & Destructor Documentation

◆ L1GtTriggerMenuXmlParser()

L1GtTriggerMenuXmlParser::L1GtTriggerMenuXmlParser ( )

constructor empty

Definition at line 39 of file L1GtTriggerMenuXmlParser.cc.

41  m_xmlErrHandler(nullptr),
42  m_triggerMenuInterface("NULL"),
43  m_triggerMenuName("NULL"),
45  m_scaleDbKey("NULL")
46 
47 {
48  // menu names, scale key initialized to NULL due to ORACLE treatment of strings
49 
50  // empty
51 }
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser
std::string m_scaleDbKey
menu associated scale key
std::string m_triggerMenuInterface
menu names
L1GtXmlParserTags()
constructor

◆ ~L1GtTriggerMenuXmlParser()

L1GtTriggerMenuXmlParser::~L1GtTriggerMenuXmlParser ( )
override

destructor

Definition at line 54 of file L1GtTriggerMenuXmlParser.cc.

References clearMaps().

Member Function Documentation

◆ cleanupXML()

void L1GtTriggerMenuXmlParser::cleanupXML ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

shutdown the xml utils and deallocate parser and error handler

cleanupXML - Delete parser and error handler. Shutdown XMLPlatformUtils.

Parameters
parserA reference to the parser to be deleted.

Definition at line 762 of file L1GtTriggerMenuXmlParser.cc.

References m_xmlErrHandler, writedatasetfile::parser, and cms::concurrency::xercesTerminate().

Referenced by parseXmlFile().

762  {
764 
765  if (parser != nullptr) {
766  delete parser;
767  }
768 
769  if (m_xmlErrHandler != nullptr) {
770  delete m_xmlErrHandler;
771  m_xmlErrHandler = nullptr;
772  }
773 
775 }
void xercesTerminate()
Definition: Xerces.cc:23
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser

◆ clearMaps()

void L1GtTriggerMenuXmlParser::clearMaps ( )
private

clearMaps - delete all conditions and algorithms in the maps and clear the maps.

Definition at line 834 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmMap, and m_conditionMap.

Referenced by workXML(), and ~L1GtTriggerMenuXmlParser().

834  {
835  // loop over condition maps (one map per condition chip)
836  // then loop over conditions in the map
837  for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
838  itCondOnChip++) {
839  // the conditions in the maps are deleted in L1GtTriggerMenu, not here
840 
841  itCondOnChip->clear();
842  }
843 
844  // the algorithms in the maps are deleted in L1GtTriggerMenu, not here
845  m_algorithmMap.clear();
846 }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient

◆ corCaloTemplate()

const std::vector<std::vector<L1GtCaloTemplate> >& L1GtTriggerMenuXmlParser::corCaloTemplate ( ) const
inline

Definition at line 186 of file L1GtTriggerMenuXmlParser.h.

References m_corCaloTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

186 { return m_corCaloTemplate; }
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate

◆ corEnergySumTemplate()

const std::vector<std::vector<L1GtEnergySumTemplate> >& L1GtTriggerMenuXmlParser::corEnergySumTemplate ( ) const
inline

Definition at line 191 of file L1GtTriggerMenuXmlParser.h.

References m_corEnergySumTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

191  {
192  return m_corEnergySumTemplate;
193  }
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate

◆ corMuonTemplate()

const std::vector<std::vector<L1GtMuonTemplate> >& L1GtTriggerMenuXmlParser::corMuonTemplate ( ) const
inline

Definition at line 181 of file L1GtTriggerMenuXmlParser.h.

References m_corMuonTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

181 { return m_corMuonTemplate; }
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate

◆ countConditionChildMaxBits()

bool L1GtTriggerMenuXmlParser::countConditionChildMaxBits ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  childName,
unsigned int &  dst 
)
private

get the number of bits in the max attribute of a condition child

countConditionChildMaxBits Count the set bits in the max attribute. Needed for the wsc-values to determine 180 degree.

Parameters
nodeThe xml node of the condition.
childNameThe name of the child
dstThe destination to write the number of bits.
Returns
true if the bits could be determined, otherwise false.

Definition at line 595 of file L1GtTriggerMenuXmlParser.cc.

References counter, math::cholesky::dst, findXMLChild(), getXMLAttribute(), hexString2UInt128(), LogDebug, L1GtXmlParserTags::m_xmlAttrMax, L1GtXmlParserTags::m_xmlTagValue, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseCalo(), parseCorrelation(), and parseMuon().

597  {
599 
600  // should never happen...
601  if (node == nullptr) {
602  LogDebug("L1GtTriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
603 
604  return false;
605  }
606 
607  DOMNode* n1 = findXMLChild(node->getFirstChild(), childName);
608 
609  if (n1 == nullptr) {
610  LogDebug("L1GtTriggerMenuXmlParser") << "Child of condition not found ( " << childName << ")" << std::endl;
611 
612  return false;
613  }
614 
615  DOMNode* n2 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
616 
617  if (n2 == nullptr) {
618  LogDebug("L1GtTriggerMenuXmlParser") << "No value tag found for child " << childName << " in "
619  << __PRETTY_FUNCTION__ << std::endl;
620 
621  return false;
622  }
623 
624  // first try direct
625  std::string maxString = getXMLAttribute(n1, m_xmlAttrMax); // string for the maxbits
626 
627  if (maxString.empty()) {
628  maxString = getXMLAttribute(n2, m_xmlAttrMax); // try next value tag
629  // if no max was found neither in value nor in the childName tag
630  if (maxString.empty()) {
631  LogDebug("L1GtTriggerMenuXmlParser") << "No Max value found for " << childName << std::endl;
632 
633  return false;
634  }
635  }
636 
637  // do the hex conversion
638 
639  uint64_t maxBitsL, maxBitsH;
640  if (!hexString2UInt128(maxString, maxBitsL, maxBitsH)) {
641  return false;
642  }
643 
644  // count the bits
645  //LogTrace("L1GtTriggerMenuXmlParser")
646  //<< std::dec
647  //<< " words: dec: high (MSB) word = " << maxBitsH << " low word = " << maxBitsL
648  //<< std::hex << "\n"
649  //<< " words: hex: high (MSB) word = " << maxBitsH << " low word = " << maxBitsL
650  //<< std::dec
651  //<< std::endl;
652 
653  unsigned int counter = 0;
654 
655  while (maxBitsL != 0) {
656  // check if bits set countinously
657  if ((maxBitsL & 1) == 0) {
658  edm::LogError("L1GtTriggerMenuXmlParser") << " Confused by not continous set bits for max value "
659  << maxString << "(child=" << childName << ")" << std::endl;
660 
661  return false;
662  }
663 
664  maxBitsL >>= 1;
665  counter++;
666  }
667 
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;
671 
672  return false;
673  }
674 
675  while (maxBitsH != 0) {
676  //check if bits set countinously
677  if ((maxBitsH & 1) == 0) {
678  edm::LogError("L1GtTriggerMenuXmlParser") << " Confused by not continous set bits for max value "
679  << maxString << "(child=" << childName << ")" << std::endl;
680 
681  return false;
682  }
683 
684  maxBitsH >>= 1;
685  counter++;
686  }
687 
688  dst = counter;
689  return true;
690 }
bool hexString2UInt128(const std::string &hexString, uint64_t &dstL, uint64_t &dstH)
convert a hexadecimal string with up to 128 to 2 uint64_t
Log< level::Error, false > LogError
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
unsigned long long uint64_t
Definition: Time.h:13
constexpr void M2 & dst
static std::atomic< unsigned int > counter
static const std::string m_xmlTagValue
static const std::string m_xmlAttrMax
#define LogDebug(id)

◆ findXMLChild()

XERCES_CPP_NAMESPACE::DOMNode * L1GtTriggerMenuXmlParser::findXMLChild ( XERCES_CPP_NAMESPACE::DOMNode *  startChild,
const std::string &  tagName,
bool  beginOnly = false,
std::string *  rest = nullptr 
)
private

find a named child of a xml node

Definition at line 320 of file L1GtTriggerMenuXmlParser.cc.

References fetchall_from_DQM_v2::release, mergeAndRegister::rest, AlCaHLTBitMon_QueryRunRegistry::string, and TauJetAlgoParameters_cfi::tagName.

Referenced by countConditionChildMaxBits(), getConditionChildValues(), getGEqFlag(), getMuonMipIsoBits(), parseAlgorithms(), parseConditions(), parseCorrelation(), parseEnergySum(), parseId(), parseMuon(), parseTechTriggers(), parseVmeXML(), workAlgorithm(), and workTechTrigger().

323  {
325 
326  char* nodeName = nullptr;
327 
328  DOMNode* n1 = startChild;
329  if (n1 == nullptr) {
330  return nullptr;
331  }
332 
333  if (!tagName.empty()) {
334  nodeName = XMLString::transcode(n1->getNodeName());
335 
336  if (!beginOnly) {
337  //match the whole tag
338  while (XMLString::compareIString(nodeName, tagName.c_str())) {
339  XMLString::release(&nodeName);
340  n1 = n1->getNextSibling();
341  if (n1 == nullptr) {
342  break;
343  }
344 
345  nodeName = XMLString::transcode(n1->getNodeName());
346  }
347  } else {
348  // match only the beginning
349  while (XMLString::compareNIString(nodeName, tagName.c_str(), tagName.length())) {
350  XMLString::release(&nodeName);
351  n1 = n1->getNextSibling();
352  if (n1 == nullptr) {
353  break;
354  }
355 
356  nodeName = XMLString::transcode(n1->getNodeName());
357  }
358  if (n1 != nullptr && rest != nullptr) {
359  *rest = std::string(nodeName).substr(tagName.length(), strlen(nodeName) - tagName.length());
360  }
361  }
362  } else { // empty string given
363  while (n1->getNodeType() != DOMNode::ELEMENT_NODE) {
364  n1 = n1->getNextSibling();
365  if (n1 == nullptr) {
366  break;
367  }
368  }
369  if (n1 != nullptr && rest != nullptr) {
370  nodeName = XMLString::transcode(n1->getNodeName());
371  *rest = std::string(nodeName);
372  }
373  }
374 
375  XMLString::release(&nodeName);
376 
377  return n1;
378 }

◆ getBitFromNode()

int L1GtTriggerMenuXmlParser::getBitFromNode ( XERCES_CPP_NAMESPACE::DOMNode *  node)
private

get bit from a bit node

getBitFromNode Get a bit from a specified bitvalue node.

Parameters
nodeThe xml node.
Returns
The value of the bit or -1 if an error occurred.

Definition at line 1084 of file L1GtTriggerMenuXmlParser.cc.

References getXMLAttribute(), getXMLTextValue(), L1GtXmlParserTags::m_xmlAttrMode, L1GtXmlParserTags::m_xmlAttrModeBit, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getGEqFlag(), getMuonMipIsoBits(), and parseEnergySum().

1084  {
1086  edm::LogError("L1GtTriggerMenuXmlParser") << "Invalid mode for single bit" << std::endl;
1087 
1088  return -1;
1089  }
1090 
1091  std::string tmpStr = getXMLTextValue(node);
1092  if (tmpStr == "0") {
1093  return 0;
1094  } else if (tmpStr == "1") {
1095  return 1;
1096  } else {
1097  edm::LogError("L1GtTriggerMenuXmlParser") << "Bad bit value (" << tmpStr << ")" << std::endl;
1098  return -1;
1099  }
1100 }
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
Log< level::Error, false > LogError
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
static const std::string m_xmlAttrMode
static const std::string m_xmlAttrModeBit

◆ getConditionChildValues()

bool L1GtTriggerMenuXmlParser::getConditionChildValues ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  childName,
unsigned int  num,
std::vector< uint64_t > &  dst 
)
private

get values from a child of a condition

getConditionChildValues - Get values from a child of a condition.

Parameters
nodeThe xml node of the condition.
childNameThe name of the child the values should be extracted from.
numThe number of values needed.
dstA pointer to a vector of uint64_t where the results are written.
Returns
true if succeeded. false if an error occurred or not enough values found.

Definition at line 703 of file L1GtTriggerMenuXmlParser.cc.

References math::cholesky::dst, findXMLChild(), getXMLHexTextValue(), mps_fire::i, LogDebug, L1GtXmlParserTags::m_xmlTagValue, and EgammaValidation_cff::num.

Referenced by parseCalo(), parseEnergySum(), parseHfBitCounts(), parseHfRingEtSums(), parseJetCounts(), and parseMuon().

706  {
708 
709  if (node == nullptr) {
710  LogDebug("L1GtTriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
711 
712  return false;
713  }
714 
715  DOMNode* n1 = findXMLChild(node->getFirstChild(), childName);
716 
717  // if child not found
718  if (n1 == nullptr) {
719  LogDebug("L1GtTriggerMenuXmlParser") << "Child of condition not found ( " << childName << ")" << std::endl;
720 
721  return false;
722  }
723 
724  // no values are sucessfull
725  if (num == 0) {
726  return true;
727  }
728 
729  //
730  dst.reserve(num);
731 
732  //
733  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
734  for (unsigned int i = 0; i < num; i++) {
735  if (n1 == nullptr) {
736  LogDebug("L1GtTriggerMenuXmlParser")
737  << "Not enough values in condition child ( " << childName << ")" << std::endl;
738 
739  return false;
740  }
741 
742  if (!getXMLHexTextValue(n1, dst[i])) {
743  edm::LogError("L1GtTriggerMenuXmlParser")
744  << "Error converting condition child ( " << childName << ") value." << std::endl;
745 
746  return false;
747  }
748 
749  n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue); // next child
750  }
751 
752  return true;
753 }
Log< level::Error, false > LogError
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
bool getXMLHexTextValue(XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dst)
get a hexadecimal value of a xml node containing text
constexpr void M2 & dst
static const std::string m_xmlTagValue
#define LogDebug(id)

◆ getGEqFlag()

int L1GtTriggerMenuXmlParser::getGEqFlag ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  nodeName 
)
private

getGEqFlag - get the "greater or equal flag" from a condition

getGEqFlag - get the "greater or equal flag" from a condition

Parameters
nodeThe xml node of the condition. The name of the node from which the flag is a subchild.
Returns
The value of the flag or -1 if no flag was found.

Definition at line 1111 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), getBitFromNode(), LogDebug, and L1GtXmlParserTags::m_xmlTagGEq.

Referenced by parseCalo(), parseCorrelation(), parseEnergySum(), parseHfBitCounts(), parseHfRingEtSums(), parseJetCounts(), and parseMuon().

1111  {
1113 
1114  if (node == nullptr) {
1115  LogDebug("L1GtTriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
1116 
1117  return -1;
1118  }
1119 
1120  // usually the GEq flag is a child of the first child (the first element node)
1121  DOMNode* n1 = node->getFirstChild();
1122  n1 = findXMLChild(n1, nodeName);
1123 
1124  if (n1 != nullptr) {
1125  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagGEq);
1126  if (n1 == nullptr) {
1127  LogDebug("L1GtTriggerMenuXmlParser") << "No \"greater or equal\" tag found" << std::endl;
1128 
1129  return -1;
1130  }
1131 
1132  return getBitFromNode(n1);
1133  } else {
1134  return -1;
1135  }
1136 }
int getBitFromNode(XERCES_CPP_NAMESPACE::DOMNode *node)
get bit from a bit node
static const std::string m_xmlTagGEq
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
#define LogDebug(id)

◆ getMuonMipIsoBits()

bool L1GtTriggerMenuXmlParser::getMuonMipIsoBits ( XERCES_CPP_NAMESPACE::DOMNode *  node,
unsigned int  num,
std::vector< bool > &  mipDst,
std::vector< bool > &  isoEnDst,
std::vector< bool > &  isoReqDst 
)
private

get MIP and Isolation bits from a muon

getMuonMipIsoBits - get MIP and Isolation bits from a muon.

Parameters
nodeThe node of the condition.
numThe number of bits required.
mipDstA pointer to the vector of the MIP bits.
isoEnDstA pointer to the vector of the "enable isolation" bits.
isoReqDstA pointer to the vector of the "request isolation" bits.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 1150 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), getBitFromNode(), mps_fire::i, L1GtXmlParserTags::m_xmlTagEnableIso, L1GtXmlParserTags::m_xmlTagEnableMip, L1GtXmlParserTags::m_xmlTagPtLowThreshold, L1GtXmlParserTags::m_xmlTagRequestIso, L1GtXmlParserTags::m_xmlTagValue, and EgammaValidation_cff::num.

Referenced by parseMuon().

1154  {
1156 
1157  if (node == nullptr) {
1158  return false;
1159  }
1160 
1161  // find ptLowThreshold child
1162  DOMNode* n1 = findXMLChild(node->getFirstChild(), m_xmlTagPtLowThreshold);
1163 
1164  if (n1 == nullptr) {
1165  return false;
1166  }
1167 
1168  // get first value tag
1169  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
1170 
1171  for (unsigned int i = 0; i < num; i++) {
1172  if (n1 == nullptr) {
1173  return false;
1174  }
1175 
1176  // MIP bit
1177 
1178  DOMNode* bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagEnableMip);
1179  if (bitnode == nullptr) {
1180  return true;
1181  }
1182 
1183  int tmpint = getBitFromNode(bitnode);
1184  if (tmpint < 0) {
1185  return false;
1186  }
1187 
1188  mipDst[i] = (tmpint != 0);
1189 
1190  //LogTrace("L1GtTriggerMenuXmlParser")
1191  //<< " MIP bit value for muon " << i << " = " << mipDst[i]
1192  //<< std::endl;
1193 
1194  // enable iso bit
1195  bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagEnableIso);
1196  if (bitnode == nullptr) {
1197  return true;
1198  }
1199 
1200  tmpint = getBitFromNode(bitnode);
1201  if (tmpint < 0) {
1202  return false;
1203  }
1204 
1205  isoEnDst[i] = (tmpint != 0);
1206 
1207  //LogTrace("L1GtTriggerMenuXmlParser")
1208  //<< " Enabled iso bit value for muon " << i << " = " << isoEnDst[i]
1209  //<< std::endl;
1210 
1211  // request iso bit
1212  bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagRequestIso);
1213  if (bitnode == nullptr) {
1214  return true;
1215  }
1216 
1217  tmpint = getBitFromNode(bitnode);
1218  if (tmpint < 0) {
1219  return false;
1220  }
1221 
1222  isoReqDst[i] = (tmpint != 0);
1223 
1224  //LogTrace("L1GtTriggerMenuXmlParser")
1225  //<< " Request iso bit value for muon " << i << " = " << isoReqDst[i]
1226  //<< std::endl;
1227 
1228  //
1229  n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue); // next value
1230  }
1231 
1232  return true;
1233 }
int getBitFromNode(XERCES_CPP_NAMESPACE::DOMNode *node)
get bit from a bit node
static const std::string m_xmlTagEnableIso
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
static const std::string m_xmlTagPtLowThreshold
static const std::string m_xmlTagEnableMip
static const std::string m_xmlTagValue
static const std::string m_xmlTagRequestIso

◆ getNumFromType()

int L1GtTriggerMenuXmlParser::getNumFromType ( const std::string &  type)
private

get number of particles from condition type

getNumFromType - get the number of particles from a specified type name (for calorimeter objects and muons)

Parameters
typeThe name of the type
Returns
The number of particles in this condition. -1 if type not found.

Definition at line 1048 of file L1GtTriggerMenuXmlParser.cc.

References L1GtXmlParserTags::m_xmlConditionAttrType1s, L1GtXmlParserTags::m_xmlConditionAttrType2cor, L1GtXmlParserTags::m_xmlConditionAttrType2s, L1GtXmlParserTags::m_xmlConditionAttrType2wsc, L1GtXmlParserTags::m_xmlConditionAttrType3s, and L1GtXmlParserTags::m_xmlConditionAttrType4s.

Referenced by parseCalo(), and parseMuon().

1048  {
1049  if (type == m_xmlConditionAttrType1s) {
1050  return 1;
1051  }
1052 
1053  if (type == m_xmlConditionAttrType2s) {
1054  return 2;
1055  }
1056 
1057  if (type == m_xmlConditionAttrType3s) {
1058  return 3;
1059  }
1060 
1061  if (type == m_xmlConditionAttrType4s) {
1062  return 4;
1063  }
1064 
1066  return 2;
1067  }
1068 
1070  return 2;
1071  }
1072 
1073  return -1;
1074 }
static const std::string m_xmlConditionAttrType1s
static const std::string m_xmlConditionAttrType4s
static const std::string m_xmlConditionAttrType3s
static const std::string m_xmlConditionAttrType2cor
static const std::string m_xmlConditionAttrType2s
static const std::string m_xmlConditionAttrType2wsc

◆ getTypeFromType()

L1GtConditionType L1GtTriggerMenuXmlParser::getTypeFromType ( const std::string &  type)
private

get the type of the condition, as defined in enum, from the condition type as defined in the XML file

Definition at line 1011 of file L1GtTriggerMenuXmlParser.cc.

References L1GtXmlParserTags::m_xmlConditionAttrType1s, L1GtXmlParserTags::m_xmlConditionAttrType2cor, L1GtXmlParserTags::m_xmlConditionAttrType2s, L1GtXmlParserTags::m_xmlConditionAttrType2wsc, L1GtXmlParserTags::m_xmlConditionAttrType3s, L1GtXmlParserTags::m_xmlConditionAttrType4s, Type1s, Type2cor, Type2s, Type2wsc, Type3s, Type4s, and TypeNull.

Referenced by parseCalo(), and parseMuon().

1011  {
1012  if (type == m_xmlConditionAttrType1s) {
1013  return Type1s;
1014  }
1015 
1016  if (type == m_xmlConditionAttrType2s) {
1017  return Type2s;
1018  }
1019 
1020  if (type == m_xmlConditionAttrType3s) {
1021  return Type3s;
1022  }
1023 
1024  if (type == m_xmlConditionAttrType4s) {
1025  return Type4s;
1026  }
1027 
1029  return Type2wsc;
1030  }
1031 
1033  return Type2cor;
1034  }
1035 
1036  return TypeNull;
1037 }
static const std::string m_xmlConditionAttrType1s
static const std::string m_xmlConditionAttrType4s
static const std::string m_xmlConditionAttrType3s
static const std::string m_xmlConditionAttrType2cor
static const std::string m_xmlConditionAttrType2s
static const std::string m_xmlConditionAttrType2wsc

◆ getXMLAttribute()

std::string L1GtTriggerMenuXmlParser::getXMLAttribute ( const XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name 
)
private

get a named attribute for an xml node as string

getXMLAttribute - get a named attribute from a node

Parameters
nodeThe node to get the attribute from
nameThe name of the attribut to get
Returns
The value of the attribute or empty string if an error occurred.

Definition at line 389 of file L1GtTriggerMenuXmlParser.cc.

References Skims_PA_cff::name, fetchall_from_DQM_v2::release, runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by countConditionChildMaxBits(), getBitFromNode(), parseBptx(), parseCalo(), parseCastor(), parseCorrelation(), parseEnergySum(), parseExternal(), parseHfBitCounts(), parseHfRingEtSums(), parseJetCounts(), parseMuon(), workAlgorithm(), workCondition(), and workTechTrigger().

390  {
392 
394 
395  // get attributes list
396  DOMNamedNodeMap* attributes = node->getAttributes();
397  if (attributes == nullptr) {
398  return ret;
399  }
400 
401  // get attribute node
402  XMLCh* attrName = XMLString::transcode(name.c_str());
403  DOMNode* attribNode = attributes->getNamedItem(attrName);
404 
405  XMLString::release(&attrName);
406  if (attribNode == nullptr) {
407  return ret;
408  }
409 
410  char* retCstr = XMLString::transcode(attribNode->getNodeValue());
411  ret = retCstr;
412  XMLString::release(&retCstr);
413 
414  return ret;
415 }
ret
prodAgent to be discontinued

◆ getXMLHexTextValue()

bool L1GtTriggerMenuXmlParser::getXMLHexTextValue ( XERCES_CPP_NAMESPACE::DOMNode *  node,
uint64_t &  dst 
)
private

get a hexadecimal value of a xml node containing text

getXMLHexTextValue Get the integer representation of a xml text child representing a hex value

Parameters
nodeThe xml node to get the value from.
dstThe destination the value is written to.
Returns
true if succeeded, false if an error occurred

Definition at line 566 of file L1GtTriggerMenuXmlParser.cc.

References math::cholesky::dst, and getXMLHexTextValue128().

Referenced by getConditionChildValues(), parseEnergySum(), and parseMuon().

566  {
567  uint64_t dummyH; // dummy for eventual higher 64bit
568  uint64_t tempUInt; // temporary unsigned integer
569 
570  if (!getXMLHexTextValue128(node, tempUInt, dummyH)) {
571  return false;
572  }
573 
574  if (dummyH != 0) {
575  edm::LogError("L1GtTriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
576  return false;
577  }
578 
579  dst = tempUInt;
580 
581  return true;
582 }
Log< level::Error, false > LogError
unsigned long long uint64_t
Definition: Time.h:13
constexpr void M2 & dst
bool getXMLHexTextValue128(XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dstL, uint64_t &dstH)
get a hexadecimal value of a xml node containing text with up to 128 bit

◆ getXMLHexTextValue128()

bool L1GtTriggerMenuXmlParser::getXMLHexTextValue128 ( XERCES_CPP_NAMESPACE::DOMNode *  node,
uint64_t &  dstL,
uint64_t &  dstH 
)
private

get a hexadecimal value of a xml node containing text with up to 128 bit

getXMLHexTextValue128 Get the integer representation of a xml-node containing a hexadecimal value. The value may contain up to 128 bits.

node - The reference to the node to get the value from. dstL - The destination for the lower 64bit dstH - The destination for the higher 64bit

Definition at line 533 of file L1GtTriggerMenuXmlParser.cc.

References getXMLTextValue(), hexString2UInt128(), LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getXMLHexTextValue(), parseEnergySum(), and parseMuon().

535  {
536  if (node == nullptr) {
537  LogDebug("L1GtTriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
538 
539  return false;
540  }
541 
542  uint64_t tempUIntH, tempUIntL;
543 
544  std::string tempStr = getXMLTextValue(node);
545  if (!hexString2UInt128(tempStr, tempUIntL, tempUIntH)) {
546  return false;
547  }
548 
549  dstL = tempUIntL;
550  dstH = tempUIntH;
551 
552  return true;
553 }
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
bool hexString2UInt128(const std::string &hexString, uint64_t &dstL, uint64_t &dstH)
convert a hexadecimal string with up to 128 to 2 uint64_t
unsigned long long uint64_t
Definition: Time.h:13
#define LogDebug(id)

◆ getXMLTextValue()

std::string L1GtTriggerMenuXmlParser::getXMLTextValue ( XERCES_CPP_NAMESPACE::DOMNode *  node)
private

get the text value of a xml node as string

getXMLTextValue - get the textvalue from a specified node

Parameters
nodeThe reference to the node.
Returns
The textvalue of the node or an empty std::string if no textvalue is available.

Definition at line 425 of file L1GtTriggerMenuXmlParser.cc.

References fetchall_from_DQM_v2::release, runTheMatrix::ret, AlCaHLTBitMon_QueryRunRegistry::string, and trim().

Referenced by getBitFromNode(), getXMLHexTextValue128(), parseCorrelation(), parseId(), workAlgorithm(), and workTechTrigger().

425  {
427 
429 
430  DOMNode* n1 = node;
431  if (n1 == nullptr) {
432  return ret;
433  }
434 
435  const XMLCh* retXmlCh = n1->getTextContent();
436  if (retXmlCh == nullptr) {
437  return ret;
438  }
439 
440  char* retCstr = XMLString::transcode(retXmlCh);
441  XMLString::trim(retCstr); // trim spaces
442 
443  ret = retCstr;
444  XMLString::release(&retCstr);
445 
446  return ret;
447 }
ret
prodAgent to be discontinued
static void trim(std::string &s)

◆ gtAlgorithmAliasMap()

const AlgorithmMap& L1GtTriggerMenuXmlParser::gtAlgorithmAliasMap ( ) const
inline

get / set the algorithm map (by alias)

Definition at line 203 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmAliasMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

203 { return m_algorithmAliasMap; }
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)

◆ gtAlgorithmImplementation()

const std::string& L1GtTriggerMenuXmlParser::gtAlgorithmImplementation ( ) const
inline

Definition at line 244 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmImplementation.

◆ gtAlgorithmMap()

const AlgorithmMap& L1GtTriggerMenuXmlParser::gtAlgorithmMap ( ) const
inline

get / set the algorithm map (by name)

Definition at line 198 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

198 { return m_algorithmMap; }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)

◆ gtConditionMap()

const std::vector<ConditionMap>& L1GtTriggerMenuXmlParser::gtConditionMap ( ) const
inline

get / set / build the condition maps

Definition at line 94 of file L1GtTriggerMenuXmlParser.h.

References m_conditionMap.

94 { return m_conditionMap; }
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient

◆ gtNumberConditionChips()

const unsigned int L1GtTriggerMenuXmlParser::gtNumberConditionChips ( ) const
inline

get / set the number of condition chips in GTL

Definition at line 62 of file L1GtTriggerMenuXmlParser.h.

References m_numberConditionChips.

62 { return m_numberConditionChips; }
unsigned int m_numberConditionChips
hardware limits

◆ gtNumberL1JetCounts()

const unsigned int L1GtTriggerMenuXmlParser::gtNumberL1JetCounts ( ) const
inline

get / set the number of L1 jet counts received by GT

Definition at line 88 of file L1GtTriggerMenuXmlParser.h.

References m_numberL1JetCounts.

88 { return m_numberL1JetCounts; }
unsigned int m_numberL1JetCounts
jet counts

◆ gtNumberPhysTriggers()

const unsigned int L1GtTriggerMenuXmlParser::gtNumberPhysTriggers ( ) const
inline

get / set the number of physics trigger algorithms

Definition at line 78 of file L1GtTriggerMenuXmlParser.h.

References m_numberPhysTriggers.

78 { return m_numberPhysTriggers; }
unsigned int m_numberPhysTriggers
number of physics trigger algorithms

◆ gtNumberTechTriggers()

const unsigned int L1GtTriggerMenuXmlParser::gtNumberTechTriggers ( ) const
inline

get / set the number of technical triggers

Definition at line 83 of file L1GtTriggerMenuXmlParser.h.

References m_numberTechTriggers.

83 { return m_numberTechTriggers; }
unsigned int m_numberTechTriggers
number of technical triggers

◆ gtOrderConditionChip()

std::vector<int> L1GtTriggerMenuXmlParser::gtOrderConditionChip ( ) const
inline

get / set the correspondence "condition chip - GTL algorithm word" in the hardware

Definition at line 73 of file L1GtTriggerMenuXmlParser.h.

References m_orderConditionChip.

73 { return m_orderConditionChip; }
std::vector< int > m_orderConditionChip

◆ gtPinsOnConditionChip()

const unsigned int L1GtTriggerMenuXmlParser::gtPinsOnConditionChip ( ) const
inline

get / set the number of pins on the GTL condition chips

Definition at line 67 of file L1GtTriggerMenuXmlParser.h.

References m_pinsOnConditionChip.

67 { return m_pinsOnConditionChip; }
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips

◆ gtScaleDbKey()

const std::string& L1GtTriggerMenuXmlParser::gtScaleDbKey ( ) const
inline

menu associated scale key

Definition at line 114 of file L1GtTriggerMenuXmlParser.h.

References m_scaleDbKey.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

114 { return m_scaleDbKey; }
std::string m_scaleDbKey
menu associated scale key

◆ gtTechnicalTriggerMap()

const AlgorithmMap& L1GtTriggerMenuXmlParser::gtTechnicalTriggerMap ( ) const
inline

get / set the technical trigger map

Definition at line 208 of file L1GtTriggerMenuXmlParser.h.

References m_technicalTriggerMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

208 { return m_technicalTriggerMap; }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers

◆ gtTriggerMenuAuthor()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuAuthor ( ) const
inline

Definition at line 236 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuAuthor.

◆ gtTriggerMenuDate()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuDate ( ) const
inline

Definition at line 232 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuDate.

232 { return m_triggerMenuDate; }

◆ gtTriggerMenuDescription()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuDescription ( ) const
inline

Definition at line 240 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuDescription.

◆ gtTriggerMenuImplementation()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuImplementation ( ) const
inline

◆ gtTriggerMenuInterface()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterface ( ) const
inline

get / set the trigger menu names

Definition at line 99 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterface.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

99 { return m_triggerMenuInterface; }
std::string m_triggerMenuInterface
menu names

◆ gtTriggerMenuInterfaceAuthor()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterfaceAuthor ( ) const
inline

Definition at line 222 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceAuthor.

◆ gtTriggerMenuInterfaceDate()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterfaceDate ( ) const
inline

get / set the XML parser creation date, author, description for menu interface, menu

Definition at line 218 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDate.

218 { return m_triggerMenuInterfaceDate; }
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)

◆ gtTriggerMenuInterfaceDescription()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterfaceDescription ( ) const
inline

◆ gtTriggerMenuName()

const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuName ( ) const
inline

◆ hexString2UInt128()

bool L1GtTriggerMenuXmlParser::hexString2UInt128 ( const std::string &  hexString,
uint64_t &  dstL,
uint64_t &  dstH 
)
private

convert a hexadecimal string with up to 128 to 2 uint64_t

hexString2UInt128 converts an up to 128 bit hexadecimal string to two uint64_t

Parameters
hexThe string to be converted.
dstLThe target for the lower 64 bit.
dstHThe target for the upper 64 bit.
Returns
true if conversion succeeded, false if an error occurred.

Definition at line 459 of file L1GtTriggerMenuXmlParser.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by countConditionChildMaxBits(), and getXMLHexTextValue128().

459  {
460  // string to determine start of hex value, do not ignore leading zeros
461  static const std::string valid_hex_start("0123456789ABCDEFabcdef");
462 
463  // string to determine end of hex value
464  static const std::string valid_hex_end("0123456789ABCDEFabcdef");
465 
466  std::string tempStr = hexString;
467 
468  // start / end position of the hex value in the string
469  unsigned int hexStart = tempStr.find_first_of(valid_hex_start);
470  unsigned int hexEnd = tempStr.find_first_not_of(valid_hex_end, hexStart);
471 
472  if (hexStart == hexEnd) {
473  LogDebug("L1GtTriggerMenuXmlParser") << "No hex value found in: " << tempStr << std::endl;
474 
475  return false;
476  }
477 
478  tempStr = tempStr.substr(hexStart, hexEnd - hexStart);
479 
480  if (tempStr.empty()) {
481  LogDebug("L1GtTriggerMenuXmlParser") << "Empty value in " << __PRETTY_FUNCTION__ << std::endl;
482 
483  return false;
484  }
485 
486  // split the string
487  std::string tempStrH, tempStrL;
488 
489  if (tempStr.length() > 16) { // more than 64 bit
490  tempStrL = tempStr.substr(tempStr.length() - 16, 16);
491  tempStrH = tempStr.substr(0, tempStr.length() - 16);
492  } else {
493  tempStrL = tempStr;
494  tempStrH = "0";
495  }
496 
497  // convert lower 64bit
498  char* endPtr = (char*)tempStrL.c_str();
499  uint64_t tempUIntL = strtoull(tempStrL.c_str(), &endPtr, 16);
500 
501  if (*endPtr != 0) {
502  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << tempStr << " to hex." << std::endl;
503 
504  return false;
505  }
506 
507  // convert higher64 bit
508  endPtr = (char*)tempStrH.c_str();
509  uint64_t tempUIntH = strtoull(tempStrH.c_str(), &endPtr, 16);
510 
511  if (*endPtr != 0) {
512  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << tempStr << " to hex." << std::endl;
513 
514  return false;
515  }
516 
517  dstL = tempUIntL;
518  dstH = tempUIntH;
519 
520  return true;
521 }
unsigned long long uint64_t
Definition: Time.h:13
#define LogDebug(id)

◆ initXML()

XERCES_CPP_NAMESPACE::XercesDOMParser * L1GtTriggerMenuXmlParser::initXML ( const std::string &  xmlFile)
private

init xml system

initXML - Initialize XML-utilities and try to create a parser for the specified file.

Parameters
xmlFileFilename of the XML-File
Returns
A reference to a XercesDOMParser object if succeeded. 0 if an error occurred.

Definition at line 258 of file L1GtTriggerMenuXmlParser.cc.

References m_xmlErrHandler, writedatasetfile::parser, fetchall_from_DQM_v2::release, and cms::concurrency::xercesInitialize().

Referenced by parseXmlFile().

258  {
260 
261  // try to initialize
262  try {
264  } catch (const XMLException& toCatch) {
265  char* message = XMLString::transcode(toCatch.getMessage());
266 
267  edm::LogError("L1GtTriggerMenuXmlParser") << "Error during Xerces-c initialization! :" << message << std::endl;
268 
269  XMLString::release(&message);
270  return nullptr;
271  }
272 
273  XercesDOMParser* parser = new XercesDOMParser();
274  parser->setValidationScheme(XercesDOMParser::Val_Always);
275  parser->setDoNamespaces(false); // we got no dtd
276 
277  if (m_xmlErrHandler == nullptr) { // redundant check
278  m_xmlErrHandler = (ErrorHandler*)new HandlerBase();
279  } else {
280  // TODO ASSERTION
281  }
282  parser->setErrorHandler(m_xmlErrHandler);
283 
284  // try to parse the file
285  try {
286  parser->parse(xmlFile.c_str());
287  } catch (const XMLException& toCatch) {
288  char* message = XMLString::transcode(toCatch.getMessage());
289 
290  edm::LogError("L1GtTriggerMenuXmlParser") << "Exception while parsing XML: \n" << message << std::endl;
291 
292  XMLString::release(&message);
293  delete parser;
294  delete m_xmlErrHandler;
295  m_xmlErrHandler = nullptr;
296  return nullptr;
297  } catch (const DOMException& toCatch) {
298  char* message = XMLString::transcode(toCatch.msg);
299 
300  edm::LogError("L1GtTriggerMenuXmlParser") << "DOM-Exception while parsing XML: \n" << message << std::endl;
301 
302  XMLString::release(&message);
303  delete parser;
304  delete m_xmlErrHandler;
305  m_xmlErrHandler = nullptr;
306  return nullptr;
307  } catch (...) {
308  edm::LogError("L1GtTriggerMenuXmlParser") << "Unexpected Exception while parsing XML!" << std::endl;
309 
310  delete parser;
311  delete m_xmlErrHandler;
312  m_xmlErrHandler = nullptr;
313  return nullptr;
314  }
315 
316  return parser;
317 }
void xercesInitialize()
Definition: Xerces.cc:18
Log< level::Error, false > LogError
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser

◆ insertAlgorithmIntoMap()

bool L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap ( const L1GtAlgorithm alg)
private

insert an algorithm into algorithm map

Definition at line 871 of file L1GtTriggerMenuXmlParser.cc.

References L1GtAlgorithm::algoAlias(), L1GtAlgorithm::algoBitNumber(), L1GtAlgorithm::algoChipNumber(), L1GtAlgorithm::algoName(), L1GtAlgorithm::algoOutputPin(), L1TBPTX_cfi::bitNumber, LogTrace, m_algorithmAliasMap, m_algorithmMap, m_numberConditionChips, m_numberPhysTriggers, m_orderConditionChip, m_pinsOnConditionChip, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by workAlgorithm().

871  {
872  std::string algName = alg.algoName();
873  const std::string& algAlias = alg.algoAlias();
874  //LogTrace("L1GtTriggerMenuXmlParser")
875  //<< " Trying to insert algorithm \"" << algName << "\" in the algorithm map." ;
876 
877  // no algorithm name has to appear twice!
878  if (m_algorithmMap.count(algName) != 0) {
879  LogTrace("L1GtTriggerMenuXmlParser") << " Algorithm \"" << algName
880  << "\"already exists in the algorithm map- not inserted!" << std::endl;
881  return false;
882  }
883 
884  if (m_algorithmAliasMap.count(algAlias) != 0) {
885  LogTrace("L1GtTriggerMenuXmlParser") << " Algorithm alias \"" << algAlias
886  << "\"already exists in the algorithm alias map- not inserted!" << std::endl;
887  return false;
888  }
889 
890  // bit number less than zero or greater than maximum number of algorithms
891  int bitNumber = alg.algoBitNumber();
892  if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberPhysTriggers))) {
893  LogTrace("L1GtTriggerMenuXmlParser") << " Bit number " << bitNumber << " outside allowed range [0, "
894  << m_numberPhysTriggers << ") - algorithm not inserted!" << std::endl;
895  return false;
896  }
897 
898  // maximum number of algorithms
899  if (m_algorithmMap.size() >= m_numberPhysTriggers) {
900  LogTrace("L1GtTriggerMenuXmlParser") << " More than maximum allowed " << m_numberPhysTriggers
901  << " algorithms in the algorithm map - not inserted!" << std::endl;
902  return false;
903  }
904 
905  // chip number outside allowed values
906  int chipNr = alg.algoChipNumber(
907  static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
908 
909  if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
910  LogTrace("L1GtTriggerMenuXmlParser") << " Chip number " << chipNr << " outside allowed range [0, "
911  << m_numberConditionChips << ") - algorithm not inserted!" << std::endl;
912  return false;
913  }
914 
915  // output pin outside allowed values
916  int outputPin = alg.algoOutputPin(
917  static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
918 
919  if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
920  LogTrace("L1GtTriggerMenuXmlParser") << " Output pin " << outputPin << " outside allowed range [0, "
921  << m_pinsOnConditionChip << "] - algorithm not inserted!" << std::endl;
922  return false;
923  }
924 
925  // no two algorithms on the same chip can have the same output pin
926  for (CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
927  int iPin = (itAlgo->second)
928  .algoOutputPin(static_cast<int>(m_numberConditionChips),
929  static_cast<int>(m_pinsOnConditionChip),
931  std::string iName = itAlgo->first;
932  int iChip = (itAlgo->second)
933  .algoChipNumber(static_cast<int>(m_numberConditionChips),
934  static_cast<int>(m_pinsOnConditionChip),
936 
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;
941  return false;
942  }
943  }
944 
945  // insert algorithm
946  m_algorithmMap[algName] = alg;
947  m_algorithmAliasMap[algAlias] = alg;
948 
949  //LogTrace("L1GtTriggerMenuXmlParser")
950  //<< " OK - algorithm inserted!"
951  //<< std::endl;
952 
953  return true;
954 }
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
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
const int algoChipNumber() const
get / set algorithm bit number
Definition: L1GtAlgorithm.h:77
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
#define LogTrace(id)
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
const std::string algoName() const
get / set algorithm name
Definition: L1GtAlgorithm.h:52
unsigned int m_numberConditionChips
hardware limits
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
std::string const & algoAlias() const
get / set algorithm alias
Definition: L1GtAlgorithm.h:57
int algoBitNumber() const
get / set algorithm bit number
Definition: L1GtAlgorithm.h:72
std::vector< int > m_orderConditionChip

◆ insertConditionIntoMap()

bool L1GtTriggerMenuXmlParser::insertConditionIntoMap ( L1GtCondition cond,
const int  chipNr 
)
private

insertConditionIntoMap - safe insert of condition into condition map. if the condition name already exists, do not insert it and return false

Definition at line 850 of file L1GtTriggerMenuXmlParser.cc.

References submitPVResolutionJobs::count, LogTrace, m_conditionMap, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseBptx(), parseCalo(), parseCastor(), parseCorrelation(), parseEnergySum(), parseExternal(), parseHfBitCounts(), parseHfRingEtSums(), parseJetCounts(), and parseMuon().

850  {
851  std::string cName = cond.condName();
852  //LogTrace("L1GtTriggerMenuXmlParser")
853  //<< " Trying to insert condition \"" << cName << "\" in the condition map." ;
854 
855  // no condition name has to appear twice!
856  if ((m_conditionMap[chipNr]).count(cName) != 0) {
857  LogTrace("L1GtTriggerMenuXmlParser") << " Condition " << cName << " already exists - not inserted!"
858  << std::endl;
859  return false;
860  }
861 
862  (m_conditionMap[chipNr])[cName] = &cond;
863  //LogTrace("L1GtTriggerMenuXmlParser")
864  //<< " OK - condition inserted!"
865  //<< std::endl;
866 
867  return true;
868 }
#define LogTrace(id)
Definition: plugin.cc:23
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient

◆ insertTechTriggerIntoMap()

bool L1GtTriggerMenuXmlParser::insertTechTriggerIntoMap ( const L1GtAlgorithm alg)
private

insert a technical trigger into technical trigger map

Definition at line 957 of file L1GtTriggerMenuXmlParser.cc.

References L1GtAlgorithm::algoBitNumber(), L1GtAlgorithm::algoName(), L1TBPTX_cfi::bitNumber, LogTrace, m_numberTechTriggers, m_technicalTriggerMap, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by workTechTrigger().

957  {
958  std::string algName = alg.algoName();
959  //LogTrace("L1GtTriggerMenuXmlParser")
960  //<< " Trying to insert technical trigger \"" << algName
961  //<< "\" in the technical trigger map." ;
962 
963  // no technical trigger name has to appear twice!
964  if (m_technicalTriggerMap.count(algName) != 0) {
965  LogTrace("L1GtTriggerMenuXmlParser") << " Technical trigger \"" << algName
966  << "\"already exists in the technical trigger map- not inserted!" << std::endl;
967  return false;
968  }
969 
970  // bit number less than zero or greater than maximum number of technical triggers
971  int bitNumber = alg.algoBitNumber();
972  if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberTechTriggers))) {
973  LogTrace("L1GtTriggerMenuXmlParser") << " Bit number " << bitNumber << " outside allowed range [0, "
974  << m_numberTechTriggers << ") - technical trigger not inserted!" << std::endl;
975  return false;
976  }
977 
978  // no two technical triggers can have the same bit number
979  for (CItAlgo itAlgo = m_technicalTriggerMap.begin(); itAlgo != m_technicalTriggerMap.end(); itAlgo++) {
980  int iBitNumber = (itAlgo->second).algoBitNumber();
981  std::string iName = itAlgo->first;
982 
983  if (iBitNumber == bitNumber) {
984  LogTrace("L1GtTriggerMenuXmlParser")
985  << " Bit number " << iBitNumber << " is the same as for technical trigger " << iName
986  << " - technical trigger not inserted!" << std::endl;
987  return false;
988  }
989  }
990 
991  // maximum number of technical triggers
993  LogTrace("L1GtTriggerMenuXmlParser") << " More than maximum allowed " << m_numberTechTriggers
994  << " technical triggers in the technical trigger map - not inserted!"
995  << std::endl;
996  return false;
997  }
998 
999  // insert technical trigger
1000  m_technicalTriggerMap[algName] = alg;
1001 
1002  //LogTrace("L1GtTriggerMenuXmlParser")
1003  //<< " OK - technical trigger inserted!"
1004  //<< std::endl;
1005 
1006  return true;
1007 }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
#define LogTrace(id)
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
unsigned int m_numberTechTriggers
number of technical triggers
const std::string algoName() const
get / set algorithm name
Definition: L1GtAlgorithm.h:52
int algoBitNumber() const
get / set algorithm bit number
Definition: L1GtAlgorithm.h:72

◆ parseAlgorithms()

bool L1GtTriggerMenuXmlParser::parseAlgorithms ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all algorithms

Definition at line 3193 of file L1GtTriggerMenuXmlParser.cc.

References boostedTaus_cff::doc, findXMLChild(), m_numberConditionChips, L1GtXmlParserTags::m_xmlTagAlgorithms, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagDef, writedatasetfile::parser, AlCaHLTBitMon_QueryRunRegistry::string, and workAlgorithm().

Referenced by workXML().

3193  {
3195 
3196  //LogTrace("L1GtTriggerMenuXmlParser") << "\nParsing algorithms" << std::endl;
3197 
3198  DOMNode* doc = parser->getDocument();
3199  DOMNode* node = doc->getFirstChild();
3200 
3201  DOMNode* chipNode = node->getFirstChild();
3202  if (chipNode == nullptr) {
3203  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: No child found for " << m_xmlTagDef << std::endl;
3204  return false;
3205  }
3206 
3207  // find first chip
3208  std::string chipName;
3209  chipNode = findXMLChild(chipNode, m_xmlTagChip, true, &chipName);
3210  if (chipNode == nullptr) {
3211  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: Could not find <" << m_xmlTagChip << std::endl;
3212  return false;
3213  }
3214 
3215  unsigned int chipNr = 0;
3216  do {
3217  //LogTrace("L1GtTriggerMenuXmlParser") << std::endl;
3218 
3219  std::string nodeName = m_xmlTagChip + chipName;
3220  //LogTrace("L1GtTriggerMenuXmlParser")
3221  //<< " Chip: " << nodeName << " Name: " << chipName
3222  //<< std::endl;
3223 
3224  // find algorithms
3225  DOMNode* algNode = chipNode->getFirstChild();
3226  algNode = findXMLChild(algNode, m_xmlTagAlgorithms);
3227  if (algNode == nullptr) {
3228  edm::LogError("L1GtTriggerMenuXmlParser")
3229  << " Error: No <" << m_xmlTagAlgorithms << "> child found in chip " << chipName << std::endl;
3230  return false;
3231  }
3232 
3233  // walk through algorithms
3234  DOMNode* algNameNode = algNode->getFirstChild();
3235  std::string algNameNodeName;
3236  algNameNode = findXMLChild(algNameNode, "", true, &algNameNodeName);
3237 
3238  while (algNameNode != nullptr) {
3239  //LogTrace("L1GtTriggerMenuXmlParser")
3240  //<< " Found an algorithm with name: " << algNameNodeName
3241  //<< std::endl;
3242 
3243  if (!workAlgorithm(algNameNode, algNameNodeName, chipNr)) {
3244  return false;
3245  }
3246 
3247  algNameNode = findXMLChild(algNameNode->getNextSibling(), "", true, &algNameNodeName);
3248  }
3249 
3250  // next chip
3251  chipNode = findXMLChild(chipNode->getNextSibling(), m_xmlTagChip, true, &chipName);
3252  chipNr++;
3253 
3254  } while (chipNode != nullptr && chipNr < m_numberConditionChips);
3255 
3256  return true;
3257 }
bool workAlgorithm(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr)
parse an algorithm and insert it into algorithm map.
Log< level::Error, false > LogError
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
unsigned int m_numberConditionChips
hardware limits
static const std::string m_xmlTagChip
static const std::string m_xmlTagAlgorithms
static const std::string m_xmlTagDef

◆ parseBptx()

bool L1GtTriggerMenuXmlParser::parseBptx ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse a Bptx condition

parseBptx Parse a BPTX condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 2352 of file L1GtTriggerMenuXmlParser.cc.

References getXMLAttribute(), insertConditionIntoMap(), LogTrace, m_vecBptxTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectBptx, L1GtXmlParserTags::m_xmlConditionAttrType, Skims_PA_cff::name, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCondition::setCondType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeBptx.

Referenced by workCondition().

2354  {
2356 
2357  // get condition, particle name and type name
2361 
2362  if (particle != m_xmlConditionAttrObjectBptx) {
2363  edm::LogError("L1GtTriggerMenuXmlParser")
2364  << "\nError: wrong particle for Bptx condition (" << particle << ")" << std::endl;
2365  return false;
2366  }
2367 
2368  // object type and condition type
2369  // object type - irrelevant for BPTX conditions
2370  L1GtConditionType cType = TypeBptx;
2371 
2372  // no objects for BPTX conditions
2373 
2374  // set the boolean value for the ge_eq mode - irrelevant for BPTX conditions
2375  bool gEq = false;
2376 
2377  // now create a new BPTX condition
2378 
2379  L1GtBptxTemplate bptxCond(name);
2380 
2381  bptxCond.setCondType(cType);
2382  bptxCond.setCondGEq(gEq);
2383  bptxCond.setCondChipNr(chipNr);
2384 
2385  LogTrace("L1GtTriggerMenuXmlParser") << bptxCond << "\n" << std::endl;
2386 
2387  // insert condition into the map
2388  if (!insertConditionIntoMap(bptxCond, chipNr)) {
2389  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2390 
2391  return false;
2392  } else {
2393  (m_vecBptxTemplate[chipNr]).push_back(bptxCond);
2394  }
2395 
2396  //
2397  return true;
2398 }
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
#define LogTrace(id)
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
static const std::string m_xmlConditionAttrObjectBptx
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})

◆ parseCalo()

bool L1GtTriggerMenuXmlParser::parseCalo ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0,
const bool  corrFlag = false 
)
private

parse a calorimeter condition

parseCalo Parse a calo condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 1513 of file L1GtTriggerMenuXmlParser.cc.

References CenJet, countConditionChildMaxBits(), L1GtCaloTemplate::CorrelationParameter::deltaEtaRange, L1GtCaloTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtCaloTemplate::CorrelationParameter::deltaPhiRange, ForJet, getConditionChildValues(), getGEqFlag(), getNumFromType(), getTypeFromType(), getXMLAttribute(), mps_fire::i, insertConditionIntoMap(), edm::isDebugEnabled(), IsoEG, LogTrace, m_corCaloTemplate, m_vecCaloTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectCenJet, L1GtXmlParserTags::m_xmlConditionAttrObjectForJet, L1GtXmlParserTags::m_xmlConditionAttrObjectIsoEG, L1GtXmlParserTags::m_xmlConditionAttrObjectNoIsoEG, L1GtXmlParserTags::m_xmlConditionAttrObjectTauJet, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlConditionAttrType2wsc, L1GtXmlParserTags::m_xmlTagDeltaEta, L1GtXmlParserTags::m_xmlTagDeltaPhi, L1GtXmlParserTags::m_xmlTagEta, L1GtXmlParserTags::m_xmlTagEtThreshold, L1GtXmlParserTags::m_xmlTagPhi, Skims_PA_cff::name, NoIsoEG, electrons_cff::objType, L1GtCaloTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCaloTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, TauJet, and TypeNull.

Referenced by parseCorrelation(), and workCondition().

1516  {
1518 
1519  // get condition, particle name and type name
1523 
1524  // determine object type type
1525  L1GtObject caloObjType;
1526 
1527  if (particle == m_xmlConditionAttrObjectNoIsoEG) {
1528  caloObjType = NoIsoEG;
1529  } else if (particle == m_xmlConditionAttrObjectIsoEG) {
1530  caloObjType = IsoEG;
1531  } else if (particle == m_xmlConditionAttrObjectCenJet) {
1532  caloObjType = CenJet;
1533  } else if (particle == m_xmlConditionAttrObjectTauJet) {
1534  caloObjType = TauJet;
1535  } else if (particle == m_xmlConditionAttrObjectForJet) {
1536  caloObjType = ForJet;
1537  } else {
1538  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for calo-condition (" << particle << ")" << std::endl;
1539  return false;
1540  }
1541 
1542  int nrObj = getNumFromType(type);
1543  if (nrObj < 0) {
1544  edm::LogError("L1GtTriggerMenuXmlParser") << "Unknown type for calo-condition (" << type << ")"
1545  << "\nCan not determine number of trigger objects. " << std::endl;
1546  return false;
1547  }
1548 
1549  // get greater equal flag
1550 
1551  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
1552  if (intGEq < 0) {
1553  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag" << std::endl;
1554  return false;
1555  }
1556  // set the boolean value for the ge_eq mode
1557  bool gEq = (intGEq != 0);
1558 
1559  // get values
1560 
1561  // temporary storage of the parameters
1562  std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(nrObj);
1564 
1565  // need at least one value for deltaPhiRange
1566  std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1567 
1568  // get etThreshold values and fill into structure
1569  if (!getConditionChildValues(node, m_xmlTagEtThreshold, nrObj, tmpValues)) {
1570  return false;
1571  }
1572 
1573  for (int i = 0; i < nrObj; i++) {
1574  objParameter[i].etThreshold = tmpValues[i];
1575 
1576  //LogTrace("L1GtTriggerMenuXmlParser")
1577  //<< " Calo ET high threshold (hex) for calo object " << i << " = "
1578  //<< std::hex << objParameter[i].etThreshold << std::dec
1579  //<< std::endl;
1580  }
1581 
1582  // get etaRange and fill into structure
1583  if (!getConditionChildValues(node, m_xmlTagEta, nrObj, tmpValues)) {
1584  return false;
1585  }
1586 
1587  for (int i = 0; i < nrObj; i++) {
1588  objParameter[i].etaRange = tmpValues[i];
1589 
1590  //LogTrace("L1GtTriggerMenuXmlParser")
1591  //<< " etaRange (hex) for calo object " << i << " = "
1592  //<< std::hex << objParameter[i].etaRange << std::dec
1593  //<< std::endl;
1594  }
1595 
1596  // get phiRange values and fill into structure
1597  if (!getConditionChildValues(node, m_xmlTagPhi, nrObj, tmpValues)) {
1598  return false;
1599  }
1600 
1601  for (int i = 0; i < nrObj; i++) {
1602  objParameter[i].phiRange = tmpValues[i];
1603 
1604  //LogTrace("L1GtTriggerMenuXmlParser")
1605  //<< " phiRange (hex) for calo object " << i << " = "
1606  //<< std::hex << objParameter[i].phiRange << std::dec
1607  //<< std::endl;
1608  }
1609 
1610  // indicates if a correlation is used
1611  bool wscVal = (type == m_xmlConditionAttrType2wsc);
1612 
1613  if (wscVal) {
1614  // get deltaEtaRange
1615  if (!getConditionChildValues(node, m_xmlTagDeltaEta, 1, tmpValues)) {
1616  return false;
1617  }
1618 
1619  corrParameter.deltaEtaRange = tmpValues[0];
1620 
1621  // get deltaPhiRange
1622  if (!getConditionChildValues(node, m_xmlTagDeltaPhi, 1, tmpValues)) {
1623  return false;
1624  }
1625 
1626  corrParameter.deltaPhiRange = tmpValues[0];
1627 
1628  // get maximum number of bits for delta phi
1629  //LogTrace("L1GtTriggerMenuXmlParser")
1630  //<< " Counting deltaPhiMaxbits"
1631  //<< std::endl;
1632 
1633  unsigned int maxbits;
1634 
1635  if (!countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits)) {
1636  return false;
1637  }
1638 
1639  corrParameter.deltaPhiMaxbits = maxbits;
1640  //LogTrace("L1GtTriggerMenuXmlParser")
1641  //<< " deltaPhiMaxbits (dec) = " << maxbits
1642  //<< std::endl;
1643  }
1644 
1645  // get the type of the condition, as defined in enum, from the condition type
1646  // as defined in the XML file
1648  //LogTrace("L1GtTriggerMenuXmlParser")
1649  //<< " Condition type (enum value) = " << cType
1650  //<< std::endl;
1651 
1652  if (cType == TypeNull) {
1653  edm::LogError("L1GtTriggerMenuXmlParser")
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;
1656  return false;
1657  }
1658 
1659  // object types - all same caloObjType
1660  std::vector<L1GtObject> objType(nrObj, caloObjType);
1661 
1662  // now create a new calo condition
1663 
1664  L1GtCaloTemplate caloCond(name);
1665 
1666  caloCond.setCondType(cType);
1667  caloCond.setObjectType(objType);
1668  caloCond.setCondGEq(gEq);
1669  caloCond.setCondChipNr(chipNr);
1670 
1671  caloCond.setConditionParameter(objParameter, corrParameter);
1672 
1673  if (edm::isDebugEnabled()) {
1674  std::ostringstream myCoutStream;
1675  caloCond.print(myCoutStream);
1676  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
1677  }
1678 
1679  // insert condition into the map
1680  if (!insertConditionIntoMap(caloCond, chipNr)) {
1681  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
1682 
1683  return false;
1684  } else {
1685  if (corrFlag) {
1686  (m_corCaloTemplate[chipNr]).push_back(caloCond);
1687  } else {
1688  (m_vecCaloTemplate[chipNr]).push_back(caloCond);
1689  }
1690  }
1691 
1692  //
1693  return true;
1694 }
static const std::string m_xmlTagEta
static const std::string m_xmlConditionAttrObjectIsoEG
bool isDebugEnabled()
static const std::string m_xmlTagDeltaPhi
static const std::string m_xmlConditionAttrObjectCenJet
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
static const std::string m_xmlConditionAttrObjectForJet
#define LogTrace(id)
static const std::string m_xmlConditionAttrObjectNoIsoEG
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
static const std::string m_xmlTagPhi
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
static const std::string m_xmlConditionAttrObjectTauJet
typedef for correlation parameters
static const std::string m_xmlTagDeltaEta
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
get values from a child of a condition
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
int getNumFromType(const std::string &type)
get number of particles from condition type
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
static const std::string m_xmlConditionAttrType2wsc
bool countConditionChildMaxBits(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int &dst)
get the number of bits in the max attribute of a condition child
L1GtConditionType getTypeFromType(const std::string &type)

◆ parseCastor()

bool L1GtTriggerMenuXmlParser::parseCastor ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse a CASTOR condition

parseCastor Parse a CASTOR condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 2048 of file L1GtTriggerMenuXmlParser.cc.

References getXMLAttribute(), insertConditionIntoMap(), edm::isDebugEnabled(), LogTrace, m_vecCastorTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectCastor, L1GtXmlParserTags::m_xmlConditionAttrType, Skims_PA_cff::name, L1GtCastorTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCondition::setCondType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeCastor.

Referenced by workCondition().

2050  {
2052 
2053  // get condition, particle name and type name
2057 
2058  if (particle != m_xmlConditionAttrObjectCastor) {
2059  edm::LogError("L1GtTriggerMenuXmlParser")
2060  << "\nError: wrong particle for Castor condition (" << particle << ")" << std::endl;
2061  return false;
2062  }
2063 
2064  // object type and condition type
2065  // object type - irrelevant for CASTOR conditions
2066  L1GtConditionType cType = TypeCastor;
2067 
2068  // no objects for CASTOR conditions
2069 
2070  // set the boolean value for the ge_eq mode - irrelevant for CASTOR conditions
2071  bool gEq = false;
2072 
2073  // now create a new CASTOR condition
2074 
2075  L1GtCastorTemplate castorCond(name);
2076 
2077  castorCond.setCondType(cType);
2078  castorCond.setCondGEq(gEq);
2079  castorCond.setCondChipNr(chipNr);
2080 
2081  if (edm::isDebugEnabled()) {
2082  std::ostringstream myCoutStream;
2083  castorCond.print(myCoutStream);
2084  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2085  }
2086 
2087  // insert condition into the map
2088  if (!insertConditionIntoMap(castorCond, chipNr)) {
2089  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2090 
2091  return false;
2092  } else {
2093  (m_vecCastorTemplate[chipNr]).push_back(castorCond);
2094  }
2095 
2096  //
2097  return true;
2098 }
bool isDebugEnabled()
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
static const std::string m_xmlConditionAttrObjectCastor
#define LogTrace(id)
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})

◆ parseConditions()

bool L1GtTriggerMenuXmlParser::parseConditions ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all conditions

parseConditions - look for conditions and call the workCondition function for each node

Parameters
parserThe parser to parse the XML file with.
Returns
"true" if succeeded. "false" if an error occurred.

Definition at line 3008 of file L1GtTriggerMenuXmlParser.cc.

References boostedTaus_cff::doc, findXMLChild(), LogTrace, m_numberConditionChips, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagConditions, L1GtXmlParserTags::m_xmlTagDef, writedatasetfile::parser, fetchall_from_DQM_v2::release, AlCaHLTBitMon_QueryRunRegistry::string, and workCondition().

Referenced by workXML().

3008  {
3010 
3011  LogTrace("L1GtTriggerMenuXmlParser") << "\nParsing conditions" << std::endl;
3012 
3013  DOMNode* doc = parser->getDocument();
3014  DOMNode* n1 = doc->getFirstChild();
3015 
3016  // we assume that the first child is m_xmlTagDef because it was checked in workXML
3017 
3018  DOMNode* chipNode = n1->getFirstChild();
3019  if (chipNode == nullptr) {
3020  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No child of <" << m_xmlTagDef << "> tag found." << std::endl;
3021 
3022  return false;
3023  }
3024 
3025  // find chip
3026 
3027  std::string chipName; // name of the actual chip
3028  chipNode = findXMLChild(chipNode, m_xmlTagChip, true, &chipName);
3029  if (chipNode == nullptr) {
3030  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: Could not find <" << m_xmlTagChip << "> tag" << std::endl;
3031 
3032  return false;
3033  }
3034 
3035  unsigned int chipNr = 0;
3036  do {
3037  // find conditions
3038  DOMNode* conditionsNode = chipNode->getFirstChild();
3039  conditionsNode = findXMLChild(conditionsNode, m_xmlTagConditions);
3040  if (conditionsNode == nullptr) {
3041  edm::LogError("L1GtTriggerMenuXmlParser")
3042  << "Error: No <" << m_xmlTagConditions << "> child found in Chip " << chipName << std::endl;
3043 
3044  return false;
3045  }
3046 
3047  char* nodeName = XMLString::transcode(chipNode->getNodeName());
3048  //LogTrace("L1GtTriggerMenuXmlParser")
3049  //<< "\n Found Chip: " << nodeName << " Name: " << chipName
3050  //<< std::endl;
3051 
3052  XMLString::release(&nodeName);
3053 
3054  // walk through conditions
3055  DOMNode* conditionNameNode = conditionsNode->getFirstChild();
3056  std::string conditionNameNodeName;
3057  conditionNameNode = findXMLChild(conditionNameNode, "", true, &conditionNameNodeName);
3058  while (conditionNameNode != nullptr) {
3059  LogTrace("L1GtTriggerMenuXmlParser")
3060  << "\n Found a condition with name: " << conditionNameNodeName << std::endl;
3061 
3062  if (!workCondition(conditionNameNode, conditionNameNodeName, chipNr)) {
3063  return false;
3064  }
3065  conditionNameNode = findXMLChild(conditionNameNode->getNextSibling(), "", true, &conditionNameNodeName);
3066  }
3067  // next chip
3068  chipNode = findXMLChild(chipNode->getNextSibling(), m_xmlTagChip, true, &chipName);
3069  chipNr++;
3070 
3071  } while (chipNode != nullptr && chipNr < m_numberConditionChips);
3072 
3073  return true;
3074 }
Log< level::Error, false > LogError
#define LogTrace(id)
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
unsigned int m_numberConditionChips
hardware limits
bool workCondition(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr)
choose the parser for a particular condition
static const std::string m_xmlTagConditions
static const std::string m_xmlTagChip
static const std::string m_xmlTagDef

◆ parseCorrelation()

bool L1GtTriggerMenuXmlParser::parseCorrelation ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse a correlation condition

parseCorrelation Parse a correlation condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 2472 of file L1GtTriggerMenuXmlParser.cc.

References CenJet, CondCalo, CondEnergySum, CondMuon, countConditionChildMaxBits(), L1GtCorrelationTemplate::CorrelationParameter::deltaEtaRange, L1GtCorrelationTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtCorrelationTemplate::CorrelationParameter::deltaPhiRange, ETM, ETT, findXMLChild(), ForJet, getGEqFlag(), getXMLAttribute(), getXMLTextValue(), HTM, HTT, insertConditionIntoMap(), edm::isDebugEnabled(), IsoEG, LogTrace, m_corCaloTemplate, m_corEnergySumTemplate, m_corMuonTemplate, m_vecCorrelationTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrConditionCalo, L1GtXmlParserTags::m_xmlConditionAttrConditionEnergySum, L1GtXmlParserTags::m_xmlConditionAttrConditionMuon, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectCenJet, L1GtXmlParserTags::m_xmlConditionAttrObjectETM, L1GtXmlParserTags::m_xmlConditionAttrObjectETT, L1GtXmlParserTags::m_xmlConditionAttrObjectForJet, L1GtXmlParserTags::m_xmlConditionAttrObjectHTM, L1GtXmlParserTags::m_xmlConditionAttrObjectHTT, L1GtXmlParserTags::m_xmlConditionAttrObjectIsoEG, L1GtXmlParserTags::m_xmlConditionAttrObjectNoIsoEG, L1GtXmlParserTags::m_xmlConditionAttrObjectTauJet, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlTagDeltaEta, L1GtXmlParserTags::m_xmlTagDeltaPhi, L1GtXmlParserTags::m_xmlTagEtThreshold, L1GtXmlParserTags::m_xmlTagPtHighThreshold, Mu, Skims_PA_cff::name, NoIsoEG, electrons_cff::objType, parseCalo(), parseEnergySum(), parseMuon(), push_back(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, TauJet, and Type2cor.

Referenced by workCondition().

2474  {
2476 
2477  // create a new correlation condition
2478  L1GtCorrelationTemplate correlationCond(name);
2479 
2480  // check that the condition does not exist already in the map
2481  if (!insertConditionIntoMap(correlationCond, chipNr)) {
2482  edm::LogError("L1GtTriggerMenuXmlParser")
2483  << " Error: duplicate correlation condition (" << name << ")" << std::endl;
2484 
2485  return false;
2486  }
2487 
2488  // get condition, particle name and type name
2492 
2493  LogTrace("L1GtTriggerMenuXmlParser") << " Condition category: " << condition << ", particle: " << particle
2494  << ", type: " << type << "\n"
2495  << std::endl;
2496 
2497  // condition type
2498  L1GtConditionType cType = Type2cor;
2499 
2500  // two objects (for sure)
2501  const int nrObj = 2;
2502 
2503  // object types and greater equal flag - filled in the loop
2504  int intGEq[nrObj] = {-1, -1};
2505  std::vector<L1GtObject> objType(nrObj);
2506  std::vector<L1GtConditionCategory> condCateg(nrObj);
2507 
2508  // correlation flag and index in the cor*vector
2509  const bool corrFlag = true;
2510  int corrIndexVal[nrObj] = {-1, -1};
2511 
2512  // get the subconditions
2513 
2514  DOMNode* conditionsNode = node->getFirstChild();
2515  std::string conditionNameNodeName;
2516  conditionsNode = findXMLChild(conditionsNode, "", true, &conditionNameNodeName);
2517 
2518  for (int iSubCond = 0; iSubCond < nrObj; ++iSubCond) {
2519  // get for sub-condition: category, object name and type name and condition name
2520  condition = getXMLAttribute(conditionsNode, m_xmlConditionAttrCondition);
2521  particle = getXMLAttribute(conditionsNode, m_xmlConditionAttrObject);
2522  type = getXMLAttribute(conditionsNode, m_xmlConditionAttrType);
2523 
2524  LogTrace("L1GtTriggerMenuXmlParser") << " Sub-condition category: " << condition << ", particle: " << particle
2525  << ", type: " << type << ", name: " << conditionNameNodeName << "\n"
2526  << std::endl;
2527 
2528  // call the appropriate function for this condition
2529  if (condition == m_xmlConditionAttrConditionMuon) {
2530  if (!parseMuon(conditionsNode, conditionNameNodeName, chipNr, corrFlag)) {
2531  edm::LogError("L1GtTriggerMenuXmlParser") << "Error parsing sub-condition " << condition << ")"
2532  << " with name " << conditionNameNodeName << std::endl;
2533  }
2534 
2535  // get greater equal flag
2536  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagPtHighThreshold);
2537  if (intGEq[iSubCond] < 0) {
2538  edm::LogError("L1GtTriggerMenuXmlParser")
2539  << "Error getting \"greater or equal\" flag"
2540  << " for sub-condition " << conditionNameNodeName << " for the correlation condition " << name << std::endl;
2541  return false;
2542  }
2543 
2544  // set object type and sub-condition category
2545  objType[iSubCond] = Mu;
2546  condCateg[iSubCond] = CondMuon;
2547  corrIndexVal[iSubCond] = (m_corMuonTemplate[chipNr]).size() - 1;
2548 
2549  } else if (condition == m_xmlConditionAttrConditionCalo) {
2550  if (!parseCalo(conditionsNode, conditionNameNodeName, chipNr, corrFlag)) {
2551  edm::LogError("L1GtTriggerMenuXmlParser") << "Error parsing sub-condition " << condition << ")"
2552  << " with name " << conditionNameNodeName << std::endl;
2553  }
2554 
2555  // get greater equal flag
2556  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagEtThreshold);
2557  if (intGEq[iSubCond] < 0) {
2558  edm::LogError("L1GtTriggerMenuXmlParser")
2559  << "Error getting \"greater or equal\" flag"
2560  << " for sub-condition " << conditionNameNodeName << " for the correlation condition " << name << std::endl;
2561  return false;
2562  }
2563 
2564  // set object type and sub-condition category
2565  if (particle == m_xmlConditionAttrObjectNoIsoEG) {
2566  objType[iSubCond] = NoIsoEG;
2567  } else if (particle == m_xmlConditionAttrObjectIsoEG) {
2568  objType[iSubCond] = IsoEG;
2569  } else if (particle == m_xmlConditionAttrObjectCenJet) {
2570  objType[iSubCond] = CenJet;
2571  } else if (particle == m_xmlConditionAttrObjectTauJet) {
2572  objType[iSubCond] = TauJet;
2573  } else if (particle == m_xmlConditionAttrObjectForJet) {
2574  objType[iSubCond] = ForJet;
2575  } else {
2576  edm::LogError("L1GtTriggerMenuXmlParser")
2577  << "Wrong object type " << particle << " for sub-condition " << conditionNameNodeName
2578  << " from the correlation condition " << name << std::endl;
2579  return false;
2580  }
2581 
2582  condCateg[iSubCond] = CondCalo;
2583  corrIndexVal[iSubCond] = (m_corCaloTemplate[chipNr]).size() - 1;
2584 
2585  } else if (condition == m_xmlConditionAttrConditionEnergySum) {
2586  if (!parseEnergySum(conditionsNode, conditionNameNodeName, chipNr, corrFlag)) {
2587  edm::LogError("L1GtTriggerMenuXmlParser") << "Error parsing sub-condition " << condition << ")"
2588  << " with name " << conditionNameNodeName << std::endl;
2589  }
2590 
2591  // get greater equal flag
2592  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagEtThreshold);
2593  if (intGEq[iSubCond] < 0) {
2594  edm::LogError("L1GtTriggerMenuXmlParser")
2595  << "Error getting \"greater or equal\" flag"
2596  << " for sub-condition " << conditionNameNodeName << " for the correlation condition " << name << std::endl;
2597  return false;
2598  }
2599 
2600  // set object type and sub-condition category
2601  if (particle == m_xmlConditionAttrObjectETM) {
2602  objType[iSubCond] = ETM;
2603  } else if (particle == m_xmlConditionAttrObjectETT) {
2604  objType[iSubCond] = ETT;
2605  } else if (particle == m_xmlConditionAttrObjectHTT) {
2606  objType[iSubCond] = HTT;
2607  } else if (particle == m_xmlConditionAttrObjectHTM) {
2608  objType[iSubCond] = HTM;
2609  } else {
2610  edm::LogError("L1GtTriggerMenuXmlParser")
2611  << "Wrong object type " << particle << " for sub-condition " << conditionNameNodeName
2612  << " from the correlation condition " << name << std::endl;
2613  return false;
2614  }
2615 
2616  condCateg[iSubCond] = CondEnergySum;
2617  corrIndexVal[iSubCond] = (m_corEnergySumTemplate[chipNr]).size() - 1;
2618 
2619  } else {
2620  edm::LogError("L1GtTriggerMenuXmlParser")
2621  << "Unknown or un-adequate sub-condition (" << condition << ")"
2622  << " with name " << conditionNameNodeName << " for the correlation condition " << name << std::endl;
2623 
2624  return false;
2625  }
2626 
2627  conditionsNode = findXMLChild(conditionsNode->getNextSibling(), "", true, &conditionNameNodeName);
2628  }
2629 
2630  // get greater equal flag for the correlation condition
2631  bool gEq = true;
2632  if (intGEq[0] != intGEq[1]) {
2633  edm::LogError("L1GtTriggerMenuXmlParser")
2634  << "Inconsistent GEq flags for sub-conditions (" << condition << ")"
2635  << " with name " << conditionNameNodeName << " for the correlation condition " << name << std::endl;
2636  return false;
2637 
2638  } else {
2639  gEq = (intGEq[0] != 0);
2640  }
2641 
2642  // correlation parameters
2643 
2644  // temporary storage of the parameters
2646  std::vector<uint64_t> tmpValues(nrObj);
2647 
2648  // get deltaEtaRange
2649  // if ( !getConditionChildValues(node, m_xmlTagDeltaEta, 1, tmpValues) ) {
2650  // return false;
2651  // }
2652  //
2653  // corrParameter.deltaEtaRange = tmpValues[0];
2654 
2655  XERCES_CPP_NAMESPACE::DOMNode* node1 = findXMLChild(node->getFirstChild(), m_xmlTagDeltaEta);
2656 
2657  std::string valString;
2658 
2659  if (node1 == nullptr) {
2660  edm::LogError("L1GtTriggerMenuXmlParser")
2661  << " Could not get deltaEta for correlation condition " << name << ". " << std::endl;
2662  return false;
2663  } else {
2664  valString = getXMLTextValue(node1);
2665  }
2666 
2667  corrParameter.deltaEtaRange = valString;
2668 
2669  // // deltaPhi is larger than 64bit
2670  // if ( !getXMLHexTextValue128(findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi),
2671  // tmpValues[0], tmpValues[1])) {
2672  // edm::LogError("L1GtTriggerMenuXmlParser")
2673  // << " Could not get deltaPhi for correlation condition " << name << ". "
2674  // << std::endl;
2675  // return false;
2676  // }
2677  //
2678  // corrParameter.deltaPhiRange = tmpValues[0];
2679 
2680  node1 = findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi);
2681 
2682  if (node1 == nullptr) {
2683  return false;
2684  edm::LogError("L1GtTriggerMenuXmlParser")
2685  << " Could not get deltaPhi for correlation condition " << name << ". " << std::endl;
2686  } else {
2687  valString = getXMLTextValue(node1);
2688  }
2689 
2690  corrParameter.deltaPhiRange = valString;
2691 
2692  // get maximum number of bits for delta phi
2693  //LogTrace("L1GtTriggerMenuXmlParser")
2694  //<< " Counting deltaPhiMaxbits"
2695  //<< std::endl;
2696 
2697  unsigned int maxbits;
2698 
2699  if (!countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits)) {
2700  return false;
2701  }
2702 
2703  corrParameter.deltaPhiMaxbits = maxbits;
2704  //LogTrace("L1GtTriggerMenuXmlParser")
2705  //<< " deltaPhiMaxbits (dec) = " << maxbits
2706  //<< std::endl;
2707 
2708  // fill the correlation condition
2709  correlationCond.setCondType(cType);
2710  correlationCond.setObjectType(objType);
2711  correlationCond.setCondGEq(gEq);
2712  correlationCond.setCondChipNr(chipNr);
2713 
2714  correlationCond.setCond0Category(condCateg[0]);
2715  correlationCond.setCond1Category(condCateg[1]);
2716 
2717  correlationCond.setCond0Index(corrIndexVal[0]);
2718  correlationCond.setCond1Index(corrIndexVal[1]);
2719 
2720  correlationCond.setCorrelationParameter(corrParameter);
2721 
2722  if (edm::isDebugEnabled()) {
2723  std::ostringstream myCoutStream;
2724  correlationCond.print(myCoutStream);
2725  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2726  }
2727 
2728  // insert condition into the map
2729  // condition is not duplicate, check was done at the beginning
2730 
2731  (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
2732 
2733  //
2734  return true;
2735 }
size
Write out results.
static const std::string m_xmlConditionAttrObjectIsoEG
bool isDebugEnabled()
static const std::string m_xmlConditionAttrConditionEnergySum
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
Definition: L1GtObject.h:38
static const std::string m_xmlTagDeltaPhi
static const std::string m_xmlConditionAttrObjectCenJet
Definition: L1GtObject.h:35
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
static const std::string m_xmlConditionAttrConditionCalo
static const std::string m_xmlConditionAttrConditionMuon
Log< level::Error, false > LogError
static const std::string m_xmlConditionAttrObjectForJet
#define LogTrace(id)
bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon condition
Definition: L1GtObject.h:37
static const std::string m_xmlConditionAttrObjectHTM
static const std::string m_xmlConditionAttrObjectNoIsoEG
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
static const std::string m_xmlConditionAttrObjectTauJet
static const std::string m_xmlTagDeltaEta
bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse an "energy sum" condition
static const std::string m_xmlTagPtHighThreshold
static const std::string m_xmlConditionAttrObjectHTT
Definition: L1GtObject.h:29
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
static const std::string m_xmlConditionAttrObjectETM
Definition: L1GtObject.h:36
bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse a calorimeter condition
static const std::string m_xmlConditionAttrObjectETT
bool countConditionChildMaxBits(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int &dst)
get the number of bits in the max attribute of a condition child

◆ parseEnergySum()

bool L1GtTriggerMenuXmlParser::parseEnergySum ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0,
const bool  corrFlag = false 
)
private

parse an "energy sum" condition

parseEnergySum Parse an "energy sum" condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 1707 of file L1GtTriggerMenuXmlParser.cc.

References TauDecayModes::dec, ETM, ETT, findXMLChild(), getBitFromNode(), getConditionChildValues(), getGEqFlag(), getXMLAttribute(), getXMLHexTextValue(), getXMLHexTextValue128(), HTM, HTT, mps_fire::i, insertConditionIntoMap(), edm::isDebugEnabled(), LogTrace, m_corEnergySumTemplate, m_vecEnergySumTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectETM, L1GtXmlParserTags::m_xmlConditionAttrObjectETT, L1GtXmlParserTags::m_xmlConditionAttrObjectHTM, L1GtXmlParserTags::m_xmlConditionAttrObjectHTT, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlTagEnergyOverflow, L1GtXmlParserTags::m_xmlTagEtThreshold, L1GtXmlParserTags::m_xmlTagPhi, Skims_PA_cff::name, electrons_cff::objType, L1GtEnergySumTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtEnergySumTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, TypeETM, TypeETT, TypeHTM, and TypeHTT.

Referenced by parseCorrelation(), and workCondition().

1710  {
1712 
1713  // get condition, particle name and type name
1717 
1718  // determine object type type
1719  L1GtObject energySumObjType;
1720  L1GtConditionType cType;
1721 
1722  if ((particle == m_xmlConditionAttrObjectETM) && (type == m_xmlConditionAttrObjectETM)) {
1723  energySumObjType = ETM;
1724  cType = TypeETM;
1725 
1726  } else if ((particle == m_xmlConditionAttrObjectETT) && (type == m_xmlConditionAttrObjectETT)) {
1727  energySumObjType = ETT;
1728  cType = TypeETT;
1729 
1730  } else if ((particle == m_xmlConditionAttrObjectHTT) && (type == m_xmlConditionAttrObjectHTT)) {
1731  energySumObjType = HTT;
1732  cType = TypeHTT;
1733 
1734  } else if ((particle == m_xmlConditionAttrObjectHTM) && (type == m_xmlConditionAttrObjectHTM)) {
1735  energySumObjType = HTM;
1736  cType = TypeHTM;
1737 
1738  } else {
1739  edm::LogError("L1GtTriggerMenuXmlParser")
1740  << "Wrong particle or type for energy-sum condition (" << particle << ", " << type << ")" << std::endl;
1741  return false;
1742  }
1743 
1744  // global object
1745  int nrObj = 1;
1746 
1747  // get greater equal flag
1748 
1749  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
1750  if (intGEq < 0) {
1751  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag" << std::endl;
1752  return false;
1753  }
1754  // set the boolean value for the ge_eq mode
1755  bool gEq = (intGEq != 0);
1756 
1757  // get values
1758 
1759  // temporary storage of the parameters
1760  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(nrObj);
1761 
1762  // need at least two values for phi
1763  std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1764 
1765  // get etThreshold values and fill into structure
1766  if (!getConditionChildValues(node, m_xmlTagEtThreshold, nrObj, tmpValues)) {
1767  return false;
1768  }
1769 
1770  for (int i = 0; i < nrObj; i++) {
1771  objParameter[i].etThreshold = tmpValues[i];
1772 
1773  //LogTrace("L1GtTriggerMenuXmlParser")
1774  //<< " EnergySum ET high threshold (hex) for energySum object " << i << " = "
1775  //<< std::hex << objParameter[i].etThreshold << std::dec
1776  //<< std::endl;
1777 
1778  // for ETM and HTM read phi value
1779  // phi is larger than 64 bits for ETM - it needs two 64bits words
1780  // phi is less than 64 bits for HTM - it needs one 64bits word
1781  if (energySumObjType == ETM) {
1782  if (!getXMLHexTextValue128(findXMLChild(node->getFirstChild(), m_xmlTagPhi), tmpValues[0], tmpValues[1])) {
1783  edm::LogError("L1GtTriggerMenuXmlParser")
1784  << " Could not get phi for ETM condition (" << name << ")" << std::endl;
1785  return false;
1786  }
1787 
1788  objParameter[i].phiRange0Word = tmpValues[0];
1789  objParameter[i].phiRange1Word = tmpValues[1];
1790 
1791  } else if (energySumObjType == HTM) {
1792  if (!getXMLHexTextValue(findXMLChild(node->getFirstChild(), m_xmlTagPhi), tmpValues[0])) {
1793  edm::LogError("L1GtTriggerMenuXmlParser")
1794  << " Could not get phi for HTM condition (" << name << ")" << std::endl;
1795  return false;
1796  }
1797 
1798  objParameter[i].phiRange0Word = tmpValues[0];
1799  }
1800 
1801  // get energyOverflow logical flag and fill into structure
1802  DOMNode* n1;
1803  if ((n1 = findXMLChild(node->getFirstChild(), m_xmlTagEtThreshold)) == nullptr) {
1804  edm::LogError("L1GtTriggerMenuXmlParser")
1805  << " Could not get energyOverflow for EnergySum condition (" << name << ")" << std::endl;
1806  return false;
1807  }
1808  if ((n1 = findXMLChild(n1->getFirstChild(), m_xmlTagEnergyOverflow)) == nullptr) {
1809  edm::LogError("L1GtTriggerMenuXmlParser")
1810  << " Could not get energyOverflow for EnergySum condition (" << name << ")" << std::endl;
1811  return false;
1812  }
1813 
1814  int tmpInt = getBitFromNode(n1);
1815  if (tmpInt == 0) {
1816  objParameter[i].energyOverflow = false;
1817 
1818  //LogTrace("L1GtTriggerMenuXmlParser")
1819  //<< " EnergySum energyOverflow logical flag (hex) = "
1820  //<< std::hex << objParameter[i].energyOverflow << std::dec
1821  //<< std::endl;
1822  } else if (tmpInt == 1) {
1823  objParameter[i].energyOverflow = true;
1824 
1825  //LogTrace("L1GtTriggerMenuXmlParser")
1826  //<< " EnergySum energyOverflow logical flag (hex) = "
1827  //<< std::hex << objParameter[i].energyOverflow << std::dec
1828  //<< std::endl;
1829  } else {
1830  LogTrace("L1GtTriggerMenuXmlParser") << " EnergySum energyOverflow logical flag (hex) = " << std::hex
1831  << tmpInt << std::dec << " - wrong value! " << std::endl;
1832  return false;
1833  }
1834  }
1835 
1836  // object types - all same energySumObjType
1837  std::vector<L1GtObject> objType(nrObj, energySumObjType);
1838 
1839  // now create a new energySum condition
1840 
1841  L1GtEnergySumTemplate energySumCond(name);
1842 
1843  energySumCond.setCondType(cType);
1844  energySumCond.setObjectType(objType);
1845  energySumCond.setCondGEq(gEq);
1846  energySumCond.setCondChipNr(chipNr);
1847 
1848  energySumCond.setConditionParameter(objParameter);
1849 
1850  if (edm::isDebugEnabled()) {
1851  std::ostringstream myCoutStream;
1852  energySumCond.print(myCoutStream);
1853  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
1854  }
1855 
1856  // insert condition into the map
1857  if (!insertConditionIntoMap(energySumCond, chipNr)) {
1858  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
1859 
1860  return false;
1861  } else {
1862  if (corrFlag) {
1863  (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
1864 
1865  } else {
1866  (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
1867  }
1868  }
1869 
1870  //
1871  return true;
1872 }
int getBitFromNode(XERCES_CPP_NAMESPACE::DOMNode *node)
get bit from a bit node
bool isDebugEnabled()
Definition: L1GtObject.h:38
Definition: L1GtObject.h:35
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
#define LogTrace(id)
Definition: L1GtObject.h:37
static const std::string m_xmlConditionAttrObjectHTM
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
static const std::string m_xmlTagPhi
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
static const std::string m_xmlTagEnergyOverflow
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlConditionAttrObjectHTT
bool getXMLHexTextValue(XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dst)
get a hexadecimal value of a xml node containing text
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
static const std::string m_xmlConditionAttrObjectETM
bool getXMLHexTextValue128(XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dstL, uint64_t &dstH)
get a hexadecimal value of a xml node containing text with up to 128 bit
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
Definition: L1GtObject.h:36
static const std::string m_xmlConditionAttrObjectETT

◆ parseExternal()

bool L1GtTriggerMenuXmlParser::parseExternal ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse an External condition

parseExternal Parse an External condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 2412 of file L1GtTriggerMenuXmlParser.cc.

References getXMLAttribute(), insertConditionIntoMap(), LogTrace, m_vecExternalTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectGtExternal, L1GtXmlParserTags::m_xmlConditionAttrType, Skims_PA_cff::name, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCondition::setCondType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeExternal.

Referenced by workCondition().

2414  {
2416 
2417  // get condition, particle name and type name
2421 
2422  if (particle != m_xmlConditionAttrObjectGtExternal) {
2423  edm::LogError("L1GtTriggerMenuXmlParser")
2424  << "\nError: wrong particle for External condition (" << particle << ")" << std::endl;
2425  return false;
2426  }
2427 
2428  // object type and condition type
2429  // object type - irrelevant for External conditions
2431 
2432  // no objects for External conditions
2433 
2434  // set the boolean value for the ge_eq mode - irrelevant for External conditions
2435  bool gEq = false;
2436 
2437  // now create a new External condition
2438 
2439  L1GtExternalTemplate externalCond(name);
2440 
2441  externalCond.setCondType(cType);
2442  externalCond.setCondGEq(gEq);
2443  externalCond.setCondChipNr(chipNr);
2444 
2445  LogTrace("L1GtTriggerMenuXmlParser") << externalCond << "\n" << std::endl;
2446 
2447  // insert condition into the map
2448  if (!insertConditionIntoMap(externalCond, chipNr)) {
2449  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2450 
2451  return false;
2452  } else {
2453  (m_vecExternalTemplate[chipNr]).push_back(externalCond);
2454  }
2455 
2456  //
2457  return true;
2458 }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
#define LogTrace(id)
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
static const std::string m_xmlConditionAttrObjectGtExternal

◆ parseHfBitCounts()

bool L1GtTriggerMenuXmlParser::parseHfBitCounts ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse a HfBitCounts condition

parseHfBitCounts Parse a "HF bit counts" condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 2112 of file L1GtTriggerMenuXmlParser.cc.

References getConditionChildValues(), getGEqFlag(), getXMLAttribute(), HfBitCounts, mps_fire::i, insertConditionIntoMap(), edm::isDebugEnabled(), LogDebug, LogTrace, m_vecHfBitCountsTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectHfBitCounts, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlTagCountThreshold, Skims_PA_cff::name, electrons_cff::objType, L1GtHfBitCountsTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtHfBitCountsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeHfBitCounts.

Referenced by workCondition().

2114  {
2116 
2117  // get condition, particle name and type name
2121 
2122  if (particle != m_xmlConditionAttrObjectHfBitCounts) {
2123  edm::LogError("L1GtTriggerMenuXmlParser")
2124  << "Wrong particle for HfBitCounts condition (" << particle << ")" << std::endl;
2125  return false;
2126  }
2127 
2128  // object type and condition type
2129  L1GtObject hfBitCountsObjType = HfBitCounts;
2131 
2132  // global object
2133  int nrObj = 1;
2134 
2135  // get greater equal flag
2136 
2137  int intGEq = getGEqFlag(node, m_xmlTagCountThreshold);
2138  if (intGEq < 0) {
2139  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag" << std::endl;
2140  return false;
2141  }
2142  // set the boolean value for the ge_eq mode
2143  bool gEq = (intGEq != 0);
2144 
2145  // get values
2146 
2147  // temporary storage of the parameters
2148  std::vector<L1GtHfBitCountsTemplate::ObjectParameter> objParameter(nrObj);
2149 
2150  // get countIndex value and fill into structure
2151  // they are expressed in base 10
2152  char* endPtr = nullptr;
2153  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2154 
2155  if (*endPtr != 0) {
2156  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << type << " to dec." << std::endl;
2157 
2158  return false;
2159  }
2160 
2161  // test if count index is out of range FIXME introduce m_numberL1HfBitCounts?
2162  //if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1HfBitCounts))) {
2163  // LogDebug("L1GtTriggerMenuXmlParser") << "Count index " << typeInt
2164  // << " outside range [0, " << m_numberL1HfBitCounts << "]" << std::endl;
2165  //
2166  // return false;
2167  //}
2168 
2169  objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
2170 
2171  // get count threshold values and fill into structure
2172  std::vector<uint64_t> tmpValues(nrObj);
2173 
2174  if (!getConditionChildValues(node, m_xmlTagCountThreshold, nrObj, tmpValues)) {
2175  return false;
2176  }
2177 
2178  for (int i = 0; i < nrObj; i++) {
2179  objParameter[i].countThreshold = tmpValues[i];
2180 
2181  //LogTrace("L1GtTriggerMenuXmlParser")
2182  //<< " HfBitCounts count threshold (hex) for HfBitCounts object " << i << " = "
2183  //<< std::hex << objParameter[i].countThreshold << std::dec
2184  //<< std::endl;
2185  }
2186 
2187  // object types - all same objType
2188  std::vector<L1GtObject> objType(nrObj, hfBitCountsObjType);
2189 
2190  // now create a new HfBitCounts condition
2191 
2192  L1GtHfBitCountsTemplate hfBitCountsCond(name);
2193 
2194  hfBitCountsCond.setCondType(cType);
2195  hfBitCountsCond.setObjectType(objType);
2196  hfBitCountsCond.setCondGEq(gEq);
2197  hfBitCountsCond.setCondChipNr(chipNr);
2198 
2199  hfBitCountsCond.setConditionParameter(objParameter);
2200 
2201  if (edm::isDebugEnabled()) {
2202  std::ostringstream myCoutStream;
2203  hfBitCountsCond.print(myCoutStream);
2204  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2205  }
2206 
2207  // insert condition into the map
2208  if (!insertConditionIntoMap(hfBitCountsCond, chipNr)) {
2209  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2210 
2211  return false;
2212  } else {
2213  (m_vecHfBitCountsTemplate[chipNr]).push_back(hfBitCountsCond);
2214  }
2215 
2216  //
2217  return true;
2218 }
bool isDebugEnabled()
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
#define LogTrace(id)
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
static const std::string m_xmlTagCountThreshold
static const std::string m_xmlConditionAttrObjectHfBitCounts
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
get values from a child of a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
#define LogDebug(id)

◆ parseHfRingEtSums()

bool L1GtTriggerMenuXmlParser::parseHfRingEtSums ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse a HfRingEtSums condition

parseHfRingEtSums Parse a "HF Ring ET sums" condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 2232 of file L1GtTriggerMenuXmlParser.cc.

References getConditionChildValues(), getGEqFlag(), getXMLAttribute(), HfRingEtSums, mps_fire::i, insertConditionIntoMap(), edm::isDebugEnabled(), LogDebug, LogTrace, m_vecHfRingEtSumsTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectHfRingEtSums, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlTagEtThreshold, Skims_PA_cff::name, electrons_cff::objType, L1GtHfRingEtSumsTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtHfRingEtSumsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeHfRingEtSums.

Referenced by workCondition().

2234  {
2236 
2237  // get condition, particle name and type name
2241 
2242  if (particle != m_xmlConditionAttrObjectHfRingEtSums) {
2243  edm::LogError("L1GtTriggerMenuXmlParser")
2244  << "Wrong particle for HfRingEtSums condition (" << particle << ")" << std::endl;
2245  return false;
2246  }
2247 
2248  // object type and condition type
2249  L1GtObject hfRingEtSumsObjType = HfRingEtSums;
2251 
2252  // global object
2253  int nrObj = 1;
2254 
2255  // get greater equal flag
2256 
2257  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
2258  if (intGEq < 0) {
2259  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag" << std::endl;
2260  return false;
2261  }
2262  // set the boolean value for the ge_eq mode
2263  bool gEq = (intGEq != 0);
2264 
2265  // get values
2266 
2267  // temporary storage of the parameters
2268  std::vector<L1GtHfRingEtSumsTemplate::ObjectParameter> objParameter(nrObj);
2269 
2270  // get etSumIndex value and fill into structure
2271  // they are expressed in base 10
2272  char* endPtr = nullptr;
2273  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2274 
2275  if (*endPtr != 0) {
2276  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << type << " to dec." << std::endl;
2277 
2278  return false;
2279  }
2280 
2281  // test if ET sum index is out of range FIXME introduce m_numberL1HfRingEtSums?
2282  //if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1HfRingEtSums))) {
2283  // LogDebug("L1GtTriggerMenuXmlParser") << "Count index " << typeInt
2284  // << " outside range [0, " << m_numberL1HfRingEtSums << "]" << std::endl;
2285  //
2286  // return false;
2287  //}
2288 
2289  objParameter[0].etSumIndex = static_cast<unsigned int>(typeInt);
2290 
2291  // get ET sum threshold values and fill into structure
2292  std::vector<uint64_t> tmpValues(nrObj);
2293 
2294  if (!getConditionChildValues(node, m_xmlTagEtThreshold, nrObj, tmpValues)) {
2295  return false;
2296  }
2297 
2298  for (int i = 0; i < nrObj; i++) {
2299  objParameter[i].etSumThreshold = tmpValues[i];
2300 
2301  //LogTrace("L1GtTriggerMenuXmlParser")
2302  //<< " HfRingEtSums count threshold (hex) for HfRingEtSums object " << i << " = "
2303  //<< std::hex << objParameter[i].etSumThreshold << std::dec
2304  //<< std::endl;
2305  }
2306 
2307  // object types - all same objType
2308  std::vector<L1GtObject> objType(nrObj, hfRingEtSumsObjType);
2309 
2310  // now create a new HfRingEtSums condition
2311 
2312  L1GtHfRingEtSumsTemplate hfRingEtSumsCond(name);
2313 
2314  hfRingEtSumsCond.setCondType(cType);
2315  hfRingEtSumsCond.setObjectType(objType);
2316  hfRingEtSumsCond.setCondGEq(gEq);
2317  hfRingEtSumsCond.setCondChipNr(chipNr);
2318 
2319  hfRingEtSumsCond.setConditionParameter(objParameter);
2320 
2321  if (edm::isDebugEnabled()) {
2322  std::ostringstream myCoutStream;
2323  hfRingEtSumsCond.print(myCoutStream);
2324  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2325  }
2326 
2327  // insert condition into the map
2328  if (!insertConditionIntoMap(hfRingEtSumsCond, chipNr)) {
2329  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2330 
2331  return false;
2332  } else {
2333  (m_vecHfRingEtSumsTemplate[chipNr]).push_back(hfRingEtSumsCond);
2334  }
2335 
2336  //
2337  return true;
2338 }
bool isDebugEnabled()
static const std::string m_xmlConditionAttrObjectHfRingEtSums
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
#define LogTrace(id)
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
get values from a child of a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
#define LogDebug(id)

◆ parseId()

bool L1GtTriggerMenuXmlParser::parseId ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all parse all identification attributes (trigger menu names, scale DB key, etc)

parseId - parse all identification attributes (trigger menu names, scale DB key, etc)

Parameters
parserThe parser to parse the XML file with.
Returns
"true" if succeeded. "false" if an error occurred.

Definition at line 2745 of file L1GtTriggerMenuXmlParser.cc.

References boostedTaus_cff::doc, findXMLChild(), getXMLTextValue(), LogDebug, LogTrace, m_algorithmImplementation, m_scaleDbKey, m_triggerMenuAuthor, m_triggerMenuDate, m_triggerMenuDescription, m_triggerMenuInterface, m_triggerMenuInterfaceAuthor, m_triggerMenuInterfaceDate, m_triggerMenuInterfaceDescription, m_triggerMenuName, L1GtXmlParserTags::m_xmlTagDef, L1GtXmlParserTags::m_xmlTagHeader, L1GtXmlParserTags::m_xmlTagMenuAlgImpl, L1GtXmlParserTags::m_xmlTagMenuAuthor, L1GtXmlParserTags::m_xmlTagMenuDate, L1GtXmlParserTags::m_xmlTagMenuDescription, L1GtXmlParserTags::m_xmlTagMenuInterface, L1GtXmlParserTags::m_xmlTagMenuInterfaceAuthor, L1GtXmlParserTags::m_xmlTagMenuInterfaceDate, L1GtXmlParserTags::m_xmlTagMenuInterfaceDescription, L1GtXmlParserTags::m_xmlTagScaleDbKey, writedatasetfile::parser, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by workXML().

2745  {
2747 
2748  DOMNode* doc = parser->getDocument();
2749  DOMNode* n1 = doc->getFirstChild();
2750 
2751  // we assume that the first child is m_xmlTagDef because it was checked in workXML
2752 
2753  DOMNode* headerNode = n1->getFirstChild();
2754  if (headerNode == nullptr) {
2755  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No child of <" << m_xmlTagDef << "> tag found." << std::endl;
2756  return false;
2757  }
2758 
2759  headerNode = findXMLChild(headerNode, m_xmlTagHeader);
2760  if (headerNode == nullptr) {
2761  LogDebug("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagHeader << "> tag"
2762  << "\n - No header information." << std::endl;
2763 
2764  } else {
2765  DOMNode* idNode = headerNode->getFirstChild();
2766 
2767  // find menu interface name
2768  idNode = findXMLChild(idNode, m_xmlTagMenuInterface);
2769  if (idNode == nullptr) {
2770  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuInterface << "> tag"
2771  << "\n - Trigger menu interface name derived from file name." << std::endl;
2772 
2773  // set the name of the trigger menu interface: from beginning of file names
2774  // until beginning of "_L1T_Scales"
2775  size_t xmlPos = m_triggerMenuName.find("_L1T_Scales", 0);
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;
2781 
2782  } else {
2784  m_triggerMenuInterface.erase(m_triggerMenuInterface.begin(), m_triggerMenuInterface.begin() + xmlPos);
2785  }
2786 
2787  } else {
2789  }
2790 
2791  // find menu interface creation date
2792  idNode = headerNode->getFirstChild();
2793  idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceDate);
2794 
2795  if (idNode == nullptr) {
2796  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuInterfaceDate << "> tag"
2797  << "\n - No creation date." << m_triggerMenuInterfaceDate << std::endl;
2798 
2799  } else {
2801  }
2802 
2803  // find menu interface creation author
2804  idNode = headerNode->getFirstChild();
2805  idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceAuthor);
2806 
2807  if (idNode == nullptr) {
2808  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuInterfaceAuthor << "> tag"
2809  << "\n - No creation author." << m_triggerMenuInterfaceAuthor << std::endl;
2810 
2811  } else {
2813  }
2814 
2815  // find menu interface description
2816  idNode = headerNode->getFirstChild();
2818 
2819  if (idNode == nullptr) {
2820  LogTrace("L1GtTriggerMenuXmlParser")
2821  << "\n Warning: Could not find <" << m_xmlTagMenuInterfaceDescription << "> tag"
2822  << "\n - No description." << m_triggerMenuInterfaceDescription << std::endl;
2823 
2824  } else {
2826  }
2827 
2828  // find menu creation date
2829  idNode = headerNode->getFirstChild();
2830  idNode = findXMLChild(idNode, m_xmlTagMenuDate);
2831 
2832  if (idNode == nullptr) {
2833  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuDate << "> tag"
2834  << "\n - No creation date." << m_triggerMenuDate << std::endl;
2835 
2836  } else {
2838  }
2839 
2840  // find menu creation author
2841  idNode = headerNode->getFirstChild();
2842  idNode = findXMLChild(idNode, m_xmlTagMenuAuthor);
2843 
2844  if (idNode == nullptr) {
2845  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuAuthor << "> tag"
2846  << "\n - No creation author." << m_triggerMenuAuthor << std::endl;
2847 
2848  } else {
2850  }
2851 
2852  // find menu description
2853  idNode = headerNode->getFirstChild();
2854  idNode = findXMLChild(idNode, m_xmlTagMenuDescription);
2855 
2856  if (idNode == nullptr) {
2857  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuDescription << "> tag"
2858  << "\n - No description." << m_triggerMenuDescription << std::endl;
2859 
2860  } else {
2862  }
2863 
2864  // find algorithm implementation tag
2865 
2866  idNode = headerNode->getFirstChild();
2867 
2868  idNode = findXMLChild(idNode, m_xmlTagMenuAlgImpl);
2869  if (idNode == nullptr) {
2871  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagMenuAlgImpl << "> tag"
2872  << "\n - Algorithm implementation tag set to empty string." << std::endl;
2873 
2874  } else {
2876  }
2877 
2878  // find DB key for L1 scales
2879 
2880  idNode = headerNode->getFirstChild();
2881 
2882  idNode = findXMLChild(idNode, m_xmlTagScaleDbKey);
2883  if (idNode == nullptr) {
2884  m_scaleDbKey = "NULL";
2885  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagScaleDbKey << "> tag"
2886  << "\n - Scale key set to " << m_scaleDbKey << " string." << std::endl;
2887 
2888  } else {
2889  m_scaleDbKey = getXMLTextValue(idNode);
2890  }
2891  }
2892 
2893  LogDebug("L1GtTriggerMenuXmlParser") << "\n Parsed values from XML file"
2894  << "\nL1 MenuInterface: " << m_triggerMenuInterface
2895  << "\nL1 MenuInterface - Creation date: " << m_triggerMenuInterfaceDate
2896  << "\nL1 MenuInterface - Creation author: " << m_triggerMenuInterfaceAuthor
2897  << "\nL1 MenuInterface - Description: " << m_triggerMenuInterfaceDescription
2898  << "\n"
2899  << "\nAlgorithm implementation tag: " << m_algorithmImplementation << "\n"
2900  << "\nL1 Menu - Creation date: " << m_triggerMenuDate
2901  << "\nL1 Menu - Creation author: " << m_triggerMenuAuthor
2902  << "\nL1 Menu - Description: " << m_triggerMenuDescription
2903  << std::endl;
2904 
2905  // set the trigger menu name
2906  // format:
2907  // L1MenuInterface/ScaleDbKey/AlgorithmImplementationTag
2908 
2910 
2911  if (menuName != m_triggerMenuName) {
2912  LogDebug("L1GtTriggerMenuXmlParser") << "\n Warning: Inconsistent L1 menu name:"
2913  << "\n from XML file name: " << m_triggerMenuName
2914  << "\n from XML tag: " << menuName << std::endl;
2915 
2916  if (!m_triggerMenuInterface.empty()) {
2917  if (m_scaleDbKey == "NULL") {
2919  } else {
2920  m_triggerMenuName = menuName;
2921  }
2922 
2923  LogTrace("L1GtTriggerMenuXmlParser") << "\n L1 menu name set to value from XML tag!"
2924  << "\n L1 Menu name: " << m_triggerMenuName << std::endl;
2925 
2926  } else {
2927  LogTrace("L1GtTriggerMenuXmlParser") << "\n L1 menu name set to file name!"
2928  << "\n L1 Menu name: " << m_triggerMenuName << std::endl;
2929  }
2930  }
2931 
2932  //
2933  return true;
2934 }
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
static const std::string m_xmlTagHeader
static const std::string m_xmlTagMenuInterface
static const std::string m_xmlTagScaleDbKey
Log< level::Error, false > LogError
static const std::string m_xmlTagMenuInterfaceAuthor
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
#define LogTrace(id)
std::string m_scaleDbKey
menu associated scale key
static const std::string m_xmlTagMenuDate
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
std::string m_triggerMenuInterface
menu names
static const std::string m_xmlTagMenuAuthor
static const std::string m_xmlTagMenuAlgImpl
static const std::string m_xmlTagMenuDescription
static const std::string m_xmlTagMenuInterfaceDate
static const std::string m_xmlTagDef
#define LogDebug(id)
static const std::string m_xmlTagMenuInterfaceDescription

◆ parseJetCounts()

bool L1GtTriggerMenuXmlParser::parseJetCounts ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0 
)
private

parse a "jet counts" condition

parseJetCounts Parse a "jet counts" condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 1886 of file L1GtTriggerMenuXmlParser.cc.

References getConditionChildValues(), getGEqFlag(), getXMLAttribute(), mps_fire::i, insertConditionIntoMap(), edm::isDebugEnabled(), JetCounts, LogDebug, LogTrace, m_numberL1JetCounts, m_vecJetCountsTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectJetCounts, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlTagCountThreshold, Skims_PA_cff::name, electrons_cff::objType, L1GtJetCountsTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtJetCountsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeJetCounts.

Referenced by workCondition().

1888  {
1890 
1891  // get condition, particle name and type name
1895 
1896  if (particle != m_xmlConditionAttrObjectJetCounts) {
1897  edm::LogError("L1GtTriggerMenuXmlParser")
1898  << "Wrong particle for JetCounts condition (" << particle << ")" << std::endl;
1899  return false;
1900  }
1901 
1902  // object type and condition type
1903  L1GtObject jetCountsObjType = JetCounts;
1905 
1906  // global object
1907  int nrObj = 1;
1908 
1909  // get greater equal flag
1910 
1911  int intGEq = getGEqFlag(node, m_xmlTagCountThreshold);
1912  if (intGEq < 0) {
1913  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag" << std::endl;
1914  return false;
1915  }
1916  // set the boolean value for the ge_eq mode
1917  bool gEq = (intGEq != 0);
1918 
1919  // get values
1920 
1921  // temporary storage of the parameters
1922  std::vector<L1GtJetCountsTemplate::ObjectParameter> objParameter(nrObj);
1923 
1924  // get countIndex value and fill into structure
1925  // they are expressed in base 10 (values: 0 - m_numberL1JetCounts)
1926  char* endPtr = nullptr;
1927  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
1928 
1929  if (*endPtr != 0) {
1930  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << type << " to dec." << std::endl;
1931 
1932  return false;
1933  }
1934 
1935  // test if count index is out of range
1936  if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1JetCounts))) {
1937  LogDebug("L1GtTriggerMenuXmlParser") << "Count index " << typeInt << " outside range [0, " << m_numberL1JetCounts
1938  << "]" << std::endl;
1939 
1940  return false;
1941  }
1942 
1943  objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
1944 
1945  // get count threshold values and fill into structure
1946  std::vector<uint64_t> tmpValues(nrObj);
1947 
1948  if (!getConditionChildValues(node, m_xmlTagCountThreshold, nrObj, tmpValues)) {
1949  return false;
1950  }
1951 
1952  for (int i = 0; i < nrObj; i++) {
1953  objParameter[i].countThreshold = tmpValues[i];
1954 
1955  //LogTrace("L1GtTriggerMenuXmlParser")
1956  //<< " JetCounts count threshold (hex) for JetCounts object " << i << " = "
1957  //<< std::hex << objParameter[i].countThreshold << std::dec
1958  //<< std::endl;
1959 
1960  // TODO FIXME un-comment when tag available in XML file
1961 
1962  // // get countOverflow logical flag and fill into structure
1963  // DOMNode* n1;
1964  // if ( (n1 = findXMLChild(node->getFirstChild(), m_xmlTagCountThreshold)) == 0) {
1965  // edm::LogError("L1GtTriggerMenuXmlParser")
1966  // << " Could not get countOverflow for JetCounts condition ("
1967  // << name << ")"
1968  // << std::endl;
1969  // return false;
1970  // }
1971  // if ( (n1 = findXMLChild(n1->getFirstChild(), m_xmlTagCountThreshold)) == 0) {
1972  // edm::LogError("L1GtTriggerMenuXmlParser")
1973  // << " Could not get countOverflow for JetCounts condition ("
1974  // << name << ")"
1975  // << std::endl;
1976  // return false;
1977  // }
1978  //
1979  // int tmpInt = getBitFromNode(n1);
1980  // if (tmpInt == 0) {
1981  // objParameter[i].countOverflow = false;
1982  //
1983  // LogTrace("L1GtTriggerMenuXmlParser")
1984  // << " JetCounts countOverflow logical flag (hex) = "
1985  // << std::hex << objParameter[i].countOverflow << std::dec
1986  // << std::endl;
1987  // } else if (tmpInt == 1) {
1988  // objParameter[i].countOverflow = true;
1989  //
1990  // LogTrace("L1GtTriggerMenuXmlParser")
1991  // << " JetCounts countOverflow logical flag (hex) = "
1992  // << std::hex << objParameter[i].countOverflow << std::dec
1993  // << std::endl;
1994  // } else {
1995  // LogTrace("L1GtTriggerMenuXmlParser")
1996  // << " JetCounts countOverflow logical flag (hex) = "
1997  // << std::hex << tmpInt << std::dec << " - wrong value! "
1998  // << std::endl;
1999  // return false;
2000  // }
2001  }
2002 
2003  // object types - all same objType
2004  std::vector<L1GtObject> objType(nrObj, jetCountsObjType);
2005 
2006  // now create a new JetCounts condition
2007 
2008  L1GtJetCountsTemplate jetCountsCond(name);
2009 
2010  jetCountsCond.setCondType(cType);
2011  jetCountsCond.setObjectType(objType);
2012  jetCountsCond.setCondGEq(gEq);
2013  jetCountsCond.setCondChipNr(chipNr);
2014 
2015  jetCountsCond.setConditionParameter(objParameter);
2016 
2017  if (edm::isDebugEnabled()) {
2018  std::ostringstream myCoutStream;
2019  jetCountsCond.print(myCoutStream);
2020  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2021  }
2022 
2023  // insert condition into the map
2024  if (!insertConditionIntoMap(jetCountsCond, chipNr)) {
2025  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2026 
2027  return false;
2028  } else {
2029  (m_vecJetCountsTemplate[chipNr]).push_back(jetCountsCond);
2030  }
2031 
2032  //
2033  return true;
2034 }
bool isDebugEnabled()
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
#define LogTrace(id)
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
static const std::string m_xmlTagCountThreshold
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
get values from a child of a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
#define LogDebug(id)
static const std::string m_xmlConditionAttrObjectJetCounts
unsigned int m_numberL1JetCounts
jet counts

◆ parseMuon()

bool L1GtTriggerMenuXmlParser::parseMuon ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr = 0,
const bool  corrFlag = false 
)
private

parse a muon condition

parseMuon Parse a muon condition and insert an entry to the conditions map

Parameters
nodeThe corresponding node.
nameThe name of the condition.
chipNrThe number of the chip this condition is located.
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 1246 of file L1GtTriggerMenuXmlParser.cc.

References L1GtMuonTemplate::CorrelationParameter::chargeCorrelation, countConditionChildMaxBits(), L1GtMuonTemplate::CorrelationParameter::deltaEtaRange, L1GtMuonTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtMuonTemplate::CorrelationParameter::deltaPhiRange0Word, L1GtMuonTemplate::CorrelationParameter::deltaPhiRange1Word, findXMLChild(), getConditionChildValues(), getGEqFlag(), getMuonMipIsoBits(), getNumFromType(), getTypeFromType(), getXMLAttribute(), getXMLHexTextValue(), getXMLHexTextValue128(), mps_fire::i, insertConditionIntoMap(), edm::isDebugEnabled(), LogDebug, LogTrace, m_corMuonTemplate, m_vecMuonTemplate, L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrObjectMu, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlConditionAttrType2wsc, L1GtXmlParserTags::m_xmlTagChargeCorrelation, L1GtXmlParserTags::m_xmlTagDeltaEta, L1GtXmlParserTags::m_xmlTagDeltaPhi, L1GtXmlParserTags::m_xmlTagEta, L1GtXmlParserTags::m_xmlTagPhiHigh, L1GtXmlParserTags::m_xmlTagPhiLow, L1GtXmlParserTags::m_xmlTagPtHighThreshold, L1GtXmlParserTags::m_xmlTagPtLowThreshold, L1GtXmlParserTags::m_xmlTagQuality, Mu, Skims_PA_cff::name, electrons_cff::objType, L1GtMuonTemplate::print(), push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtMuonTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeNull.

Referenced by parseCorrelation(), and workCondition().

1249  {
1251 
1252  // get condition, particle name (must be muon) and type name
1256 
1257  if (particle != m_xmlConditionAttrObjectMu) {
1258  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for muon-condition (" << particle << ")" << std::endl;
1259  return false;
1260  }
1261 
1262  int nrObj = getNumFromType(type);
1263  if (nrObj < 0) {
1264  edm::LogError("L1GtTriggerMenuXmlParser") << "Unknown type for muon-condition (" << type << ")"
1265  << "\nCan not determine number of trigger objects. " << std::endl;
1266  return false;
1267  }
1268 
1269  // get greater equal flag
1270 
1271  int intGEq = getGEqFlag(node, m_xmlTagPtHighThreshold);
1272  if (intGEq < 0) {
1273  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag" << std::endl;
1274  return false;
1275  }
1276  // set the boolean value for the ge_eq mode
1277  bool gEq = (intGEq != 0);
1278 
1279  // get values
1280 
1281  // temporary storage of the parameters
1282  std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(nrObj);
1284 
1285  // need at least two values for deltaPhi
1286  std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1287 
1288  // get ptHighThreshold values and fill into structure
1289  if (!getConditionChildValues(node, m_xmlTagPtHighThreshold, nrObj, tmpValues)) {
1290  return false;
1291  }
1292 
1293  for (int i = 0; i < nrObj; i++) {
1294  objParameter[i].ptHighThreshold = tmpValues[i];
1295 
1296  //LogTrace("L1GtTriggerMenuXmlParser")
1297  //<< " Muon pT high threshold (hex) for muon " << i << " = "
1298  //<< std::hex << objParameter[i].ptHighThreshold << std::dec
1299  //<< std::endl;
1300  }
1301 
1302  // get ptLowThreshold values and fill into structure
1303  if (!getConditionChildValues(node, m_xmlTagPtLowThreshold, nrObj, tmpValues)) {
1304  return false;
1305  }
1306 
1307  for (int i = 0; i < nrObj; i++) {
1308  //LogTrace("L1GtTriggerMenuXmlParser")
1309  //<< " Muon pT low threshold word (hex) for muon " << i << " = "
1310  //<< std::hex << tmpValues[i] << std::dec
1311  //<< std::endl;
1312 
1313  // TODO FIXME stupid format in def.xml...
1314  // one takes mip bit also, therefore one divide by 16
1315  tmpValues[i] = (tmpValues[i]) / 16;
1316 
1317  objParameter[i].ptLowThreshold = tmpValues[i];
1318 
1319  //LogTrace("L1GtTriggerMenuXmlParser")
1320  //<< " Muon pT low threshold (hex) for muon " << i << " = "
1321  //<< std::hex << objParameter[i].ptLowThreshold << std::dec
1322  //<< std::endl;
1323  }
1324 
1325  // get qualityRange and fill into structure
1326  if (!getConditionChildValues(node, m_xmlTagQuality, nrObj, tmpValues)) {
1327  return false;
1328  }
1329 
1330  for (int i = 0; i < nrObj; i++) {
1331  objParameter[i].qualityRange = tmpValues[i];
1332 
1333  //LogTrace("L1GtTriggerMenuXmlParser")
1334  //<< " qualityRange mask (hex) for muon " << i << " = "
1335  //<< std::hex << objParameter[i].qualityRange << std::dec
1336  //<< std::endl;
1337  }
1338 
1339  // get etaRange and fill into structure
1340  if (!getConditionChildValues(node, m_xmlTagEta, nrObj, tmpValues)) {
1341  return false;
1342  }
1343 
1344  for (int i = 0; i < nrObj; i++) {
1345  objParameter[i].etaRange = tmpValues[i];
1346 
1347  //LogTrace("L1GtTriggerMenuXmlParser")
1348  //<< " etaRange (hex) for muon " << i << " = "
1349  //<< std::hex << objParameter[i].etaRange << std::dec
1350  //<< std::endl;
1351  }
1352 
1353  // get phiHigh values and fill into structure
1354  if (!getConditionChildValues(node, m_xmlTagPhiHigh, nrObj, tmpValues)) {
1355  return false;
1356  }
1357 
1358  for (int i = 0; i < nrObj; i++) {
1359  objParameter[i].phiHigh = tmpValues[i];
1360 
1361  //LogTrace("L1GtTriggerMenuXmlParser")
1362  //<< " phiHigh (hex) for muon " << i << " = "
1363  //<< std::hex << objParameter[i].phiHigh << std::dec
1364  //<< std::endl;
1365  }
1366 
1367  // get phiLow values and fill into structure
1368  if (!getConditionChildValues(node, m_xmlTagPhiLow, nrObj, tmpValues)) {
1369  return false;
1370  }
1371 
1372  for (int i = 0; i < nrObj; i++) {
1373  objParameter[i].phiLow = tmpValues[i];
1374 
1375  //LogTrace("L1GtTriggerMenuXmlParser")
1376  //<< " phiLow (hex) for muon " << i << " = "
1377  //<< std::hex << objParameter[i].phiLow << std::dec
1378  //<< std::endl;
1379  }
1380 
1381  // get charge correlation and fill into structure
1382  if (!getXMLHexTextValue(findXMLChild(node->getFirstChild(), m_xmlTagChargeCorrelation), tmpValues[0])) {
1383  LogDebug("L1GtTriggerMenuXmlParser") << " Error getting charge correlation from muon condition (" << name << ")"
1384  << std::endl;
1385  return false;
1386  }
1387 
1388  corrParameter.chargeCorrelation = tmpValues[0];
1389 
1390  //LogTrace("L1GtTriggerMenuXmlParser")
1391  //<< " charge correlation" << " = "
1392  //<< std::hex << corrParameter.chargeCorrelation << std::dec
1393  //<< std::endl;
1394 
1395  // get mip and iso bits and fill into structure
1396 
1397  std::vector<bool> tmpMip(nrObj);
1398  std::vector<bool> tmpEnableIso(nrObj);
1399  std::vector<bool> tmpRequestIso(nrObj);
1400 
1401  if (!getMuonMipIsoBits(node, nrObj, tmpMip, tmpEnableIso, tmpRequestIso)) {
1402  edm::LogError("L1GtTriggerMenuXmlParser")
1403  << " Could not get mip and iso bits from muon condition (" << name << ")" << std::endl;
1404  return false;
1405  }
1406 
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];
1411  }
1412 
1413  // indicates if a correlation is used
1414  bool wscVal = (type == m_xmlConditionAttrType2wsc);
1415 
1416  if (wscVal) {
1417  // get deltaEtaRange
1418  if (!getConditionChildValues(node, m_xmlTagDeltaEta, 1, tmpValues)) {
1419  return false;
1420  }
1421 
1422  corrParameter.deltaEtaRange = tmpValues[0];
1423 
1424  // deltaPhi is larger than 64bit
1425  if (!getXMLHexTextValue128(findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi), tmpValues[0], tmpValues[1])) {
1426  edm::LogError("L1GtTriggerMenuXmlParser")
1427  << " Could not get deltaPhi for muon condition with wsc (" << name << ")" << std::endl;
1428  return false;
1429  }
1430 
1431  corrParameter.deltaPhiRange0Word = tmpValues[0];
1432  corrParameter.deltaPhiRange1Word = tmpValues[1];
1433 
1434  // get maximum number of bits for delta phi
1435  //LogTrace("L1GtTriggerMenuXmlParser")
1436  //<< " Counting deltaPhiMaxbits"
1437  //<< std::endl;
1438 
1439  unsigned int maxbits;
1440 
1441  if (!countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits)) {
1442  return false;
1443  }
1444 
1445  corrParameter.deltaPhiMaxbits = maxbits;
1446  //LogTrace("L1GtTriggerMenuXmlParser")
1447  //<< " deltaPhiMaxbits (dec) = " << maxbits
1448  //<< std::endl;
1449  }
1450 
1451  // get the type of the condition, as defined in enum, from the condition type
1452  // as defined in the XML file
1454  //LogTrace("L1GtTriggerMenuXmlParser")
1455  //<< " Condition type (enum value) = " << cType
1456  //<< std::endl;
1457 
1458  if (cType == TypeNull) {
1459  edm::LogError("L1GtTriggerMenuXmlParser")
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;
1462  return false;
1463  }
1464 
1465  // object types - all muons
1466  std::vector<L1GtObject> objType(nrObj, Mu);
1467 
1468  // now create a new CondMuonition
1469 
1470  L1GtMuonTemplate muonCond(name);
1471 
1472  muonCond.setCondType(cType);
1473  muonCond.setObjectType(objType);
1474  muonCond.setCondGEq(gEq);
1475  muonCond.setCondChipNr(chipNr);
1476 
1477  muonCond.setConditionParameter(objParameter, corrParameter);
1478 
1479  if (edm::isDebugEnabled()) {
1480  std::ostringstream myCoutStream;
1481  muonCond.print(myCoutStream);
1482  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
1483  }
1484 
1485  // insert condition into the map and into muon template vector
1486  if (!insertConditionIntoMap(muonCond, chipNr)) {
1487  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name << ")" << std::endl;
1488  return false;
1489  } else {
1490  if (corrFlag) {
1491  (m_corMuonTemplate[chipNr]).push_back(muonCond);
1492 
1493  } else {
1494  (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1495  }
1496  }
1497 
1498  //
1499  return true;
1500 }
static const std::string m_xmlTagEta
bool isDebugEnabled()
static const std::string m_xmlTagPhiLow
static const std::string m_xmlTagDeltaPhi
L1GtConditionType
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
Log< level::Error, false > LogError
bool getMuonMipIsoBits(XERCES_CPP_NAMESPACE::DOMNode *node, unsigned int num, std::vector< bool > &mipDst, std::vector< bool > &isoEnDst, std::vector< bool > &isoReqDst)
get MIP and Isolation bits from a muon
#define LogTrace(id)
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the "greater or equal flag" from a condition
static const std::string m_xmlTagChargeCorrelation
bool insertConditionIntoMap(L1GtCondition &cond, const int chipNr)
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
static const std::string m_xmlTagPhiHigh
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
static const std::string m_xmlTagDeltaEta
static const std::string m_xmlTagPtHighThreshold
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlTagPtLowThreshold
Definition: L1GtObject.h:29
static const std::string m_xmlConditionAttrObjectMu
int getNumFromType(const std::string &type)
get number of particles from condition type
bool getXMLHexTextValue(XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dst)
get a hexadecimal value of a xml node containing text
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
bool getXMLHexTextValue128(XERCES_CPP_NAMESPACE::DOMNode *node, uint64_t &dstL, uint64_t &dstH)
get a hexadecimal value of a xml node containing text with up to 128 bit
static const std::string m_xmlTagQuality
static const std::string m_xmlConditionAttrType2wsc
bool countConditionChildMaxBits(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int &dst)
get the number of bits in the max attribute of a condition child
L1GtConditionType getTypeFromType(const std::string &type)
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
#define LogDebug(id)

◆ parseTechTriggers()

bool L1GtTriggerMenuXmlParser::parseTechTriggers ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all algorithms

Definition at line 3347 of file L1GtTriggerMenuXmlParser.cc.

References boostedTaus_cff::doc, findXMLChild(), L1GtXmlParserTags::m_xmlTagDef, L1GtXmlParserTags::m_xmlTagTechTriggers, writedatasetfile::parser, AlCaHLTBitMon_QueryRunRegistry::string, and workTechTrigger().

Referenced by workXML().

3347  {
3349 
3350  //LogTrace("L1GtTriggerMenuXmlParser") << "\nParsing technical triggers" << std::endl;
3351 
3352  DOMNode* doc = parser->getDocument();
3353  DOMNode* node = doc->getFirstChild();
3354 
3355  DOMNode* algNode = node->getFirstChild();
3356  if (algNode == nullptr) {
3357  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: No child found for " << m_xmlTagDef << std::endl;
3358  return false;
3359  }
3360 
3361  algNode = findXMLChild(algNode, m_xmlTagTechTriggers);
3362  if (algNode == nullptr) {
3363  edm::LogError("L1GtTriggerMenuXmlParser")
3364  << " Error: No <" << m_xmlTagTechTriggers << "> child found." << std::endl;
3365  return false;
3366  }
3367 
3368  // walk through technical triggers
3369  DOMNode* algNameNode = algNode->getFirstChild();
3370  std::string algNameNodeName;
3371  algNameNode = findXMLChild(algNameNode, "", true, &algNameNodeName);
3372 
3373  while (algNameNode != nullptr) {
3374  //LogTrace("L1GtTriggerMenuXmlParser")
3375  //<< " Found an technical trigger with name: " << algNameNodeName
3376  //<< std::endl;
3377 
3378  if (!workTechTrigger(algNameNode, algNameNodeName)) {
3379  return false;
3380  }
3381 
3382  algNameNode = findXMLChild(algNameNode->getNextSibling(), "", true, &algNameNodeName);
3383  }
3384 
3385  return true;
3386 }
Log< level::Error, false > LogError
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
static const std::string m_xmlTagTechTriggers
bool workTechTrigger(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
parse an algorithm and insert it into algorithm map.
static const std::string m_xmlTagDef

◆ parseVmeXML()

bool L1GtTriggerMenuXmlParser::parseVmeXML ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse the vme xml file

parseVmeXML parse a xml file

Parameters
parserThe parser to use for parsing the file.
Returns
true if succeeded, false if an error occurred.

Definition at line 788 of file L1GtTriggerMenuXmlParser.cc.

References boostedTaus_cff::doc, findXMLChild(), m_numberConditionChips, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagVme, and writedatasetfile::parser.

788  {
790 
791  DOMDocument* doc = parser->getDocument();
792  DOMNode* n1 = doc->getFirstChild();
793 
794  if (n1 == nullptr) {
795  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: Found no XML child" << std::endl;
796 
797  return false;
798  }
799 
800  // find "vme"-tag
801  n1 = findXMLChild(n1, m_xmlTagVme);
802  if (n1 == nullptr) {
803  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No vme tag found." << std::endl;
804  return false;
805  }
806 
807  n1 = n1->getFirstChild();
808 
809  unsigned int chipCounter = 0; // count chips
810 
811  while (chipCounter < m_numberConditionChips) {
812  n1 = findXMLChild(n1, m_xmlTagChip, true);
813  if (n1 == nullptr) {
814  // just break if no more chips found
815  break;
816  }
817 
818  // node for a particle
819  //DOMNode* particleNode = n1->getFirstChild(); // FIXME un-comment
820 
821  // FIXME parse vme.xml, modify the menu
822 
823  n1 = n1->getNextSibling();
824  chipCounter++;
825  } // end while chipCounter
826 
827  return true;
828 }
Log< level::Error, false > LogError
static const std::string m_xmlTagVme
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
unsigned int m_numberConditionChips
hardware limits
static const std::string m_xmlTagChip

◆ parseXmlFile()

void L1GtTriggerMenuXmlParser::parseXmlFile ( const std::string &  defXmlFile,
const std::string &  vmeXmlFile 
)

parse def.xml and vme.xml files

Definition at line 179 of file L1GtTriggerMenuXmlParser.cc.

References cleanupXML(), initXML(), LogTrace, m_conditionMap, m_corCaloTemplate, m_corEnergySumTemplate, m_corMuonTemplate, m_numberConditionChips, m_triggerMenuName, m_vecBptxTemplate, m_vecCaloTemplate, m_vecCastorTemplate, m_vecCorrelationTemplate, m_vecEnergySumTemplate, m_vecExternalTemplate, m_vecHfBitCountsTemplate, m_vecHfRingEtSumsTemplate, m_vecJetCountsTemplate, m_vecMuonTemplate, m_xmlErrHandler, writedatasetfile::parser, and workXML().

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

179  {
181 
182  // resize the vector of condition maps
183  // the number of condition chips should be correctly set before calling parseXmlFile
185 
195 
200 
201  // set the name of the trigger menu name:
202  // defXmlFile, stripped of absolute path and .xml
203  // will be overwritten by the value read from the xml file, with a warning if
204  // they are not the same
205  m_triggerMenuName = defXmlFile;
206  size_t xmlPos = m_triggerMenuName.find_last_of('/');
207  m_triggerMenuName.erase(m_triggerMenuName.begin(), m_triggerMenuName.begin() + xmlPos + 1);
208 
209  xmlPos = m_triggerMenuName.find_last_of('.');
210  m_triggerMenuName.erase(m_triggerMenuName.begin() + xmlPos, m_triggerMenuName.end());
211 
212  // error handler for xml-parser
213  m_xmlErrHandler = nullptr;
214 
215  XercesDOMParser* parser;
216 
217  LogTrace("L1GtTriggerMenuXmlParser") << "\nOpening XML-File: \n " << defXmlFile << std::endl;
218 
219  if ((parser = initXML(defXmlFile)) != nullptr) {
220  workXML(parser);
221  }
223 }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
XERCES_CPP_NAMESPACE::XercesDOMParser * initXML(const std::string &xmlFile)
init xml system
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser
#define LogTrace(id)
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
void cleanupXML(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
shutdown the xml utils and deallocate parser and error handler
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
unsigned int m_numberConditionChips
hardware limits
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
bool workXML(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
do all the steps for filling a trigger menu
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate

◆ setCorCaloTemplate()

void L1GtTriggerMenuXmlParser::setCorCaloTemplate ( const std::vector< std::vector< L1GtCaloTemplate > > &  corCaloTempl)

Definition at line 158 of file L1GtTriggerMenuXmlParser.cc.

References m_corCaloTemplate.

158  {
159  m_corCaloTemplate = corCaloTempl;
160 }
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate

◆ setCorEnergySumTemplate()

void L1GtTriggerMenuXmlParser::setCorEnergySumTemplate ( const std::vector< std::vector< L1GtEnergySumTemplate > > &  corEnergySumTempl)

Definition at line 162 of file L1GtTriggerMenuXmlParser.cc.

References m_corEnergySumTemplate.

163  {
164  m_corEnergySumTemplate = corEnergySumTempl;
165 }
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate

◆ setCorMuonTemplate()

void L1GtTriggerMenuXmlParser::setCorMuonTemplate ( const std::vector< std::vector< L1GtMuonTemplate > > &  corMuonTempl)

Definition at line 154 of file L1GtTriggerMenuXmlParser.cc.

References m_corMuonTemplate.

154  {
155  m_corMuonTemplate = corMuonTempl;
156 }
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate

◆ setGtAlgorithmAliasMap()

void L1GtTriggerMenuXmlParser::setGtAlgorithmAliasMap ( const AlgorithmMap algoMap)

Definition at line 171 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmAliasMap.

171 { m_algorithmAliasMap = algoMap; }
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)

◆ setGtAlgorithmImplementation()

void L1GtTriggerMenuXmlParser::setGtAlgorithmImplementation ( const std::string &  val)

◆ setGtAlgorithmMap()

void L1GtTriggerMenuXmlParser::setGtAlgorithmMap ( const AlgorithmMap algoMap)

Definition at line 168 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmMap.

168 { m_algorithmMap = algoMap; }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)

◆ setGtConditionMap()

void L1GtTriggerMenuXmlParser::setGtConditionMap ( const std::vector< ConditionMap > &  condMap)

Definition at line 88 of file L1GtTriggerMenuXmlParser.cc.

References m_conditionMap.

88 { m_conditionMap = condMap; }
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient

◆ setGtNumberConditionChips()

void L1GtTriggerMenuXmlParser::setGtNumberConditionChips ( const unsigned int &  numberConditionChipsValue)

Definition at line 57 of file L1GtTriggerMenuXmlParser.cc.

References m_numberConditionChips.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

57  {
58  m_numberConditionChips = numberConditionChipsValue;
59 }
unsigned int m_numberConditionChips
hardware limits

◆ setGtNumberL1JetCounts()

void L1GtTriggerMenuXmlParser::setGtNumberL1JetCounts ( const unsigned int &  numberL1JetCountsValue)

Definition at line 83 of file L1GtTriggerMenuXmlParser.cc.

References m_numberL1JetCounts.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

83  {
84  m_numberL1JetCounts = numberL1JetCountsValue;
85 }
unsigned int m_numberL1JetCounts
jet counts

◆ setGtNumberPhysTriggers()

void L1GtTriggerMenuXmlParser::setGtNumberPhysTriggers ( const unsigned int &  numberPhysTriggersValue)

Definition at line 73 of file L1GtTriggerMenuXmlParser.cc.

References m_numberPhysTriggers.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

73  {
74  m_numberPhysTriggers = numberPhysTriggersValue;
75 }
unsigned int m_numberPhysTriggers
number of physics trigger algorithms

◆ setGtNumberTechTriggers()

void L1GtTriggerMenuXmlParser::setGtNumberTechTriggers ( const unsigned int &  numberTechTriggersValue)

Definition at line 78 of file L1GtTriggerMenuXmlParser.cc.

References m_numberTechTriggers.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

78  {
79  m_numberTechTriggers = numberTechTriggersValue;
80 }
unsigned int m_numberTechTriggers
number of technical triggers

◆ setGtOrderConditionChip()

void L1GtTriggerMenuXmlParser::setGtOrderConditionChip ( const std::vector< int > &  orderConditionChipValue)

Definition at line 68 of file L1GtTriggerMenuXmlParser.cc.

References m_orderConditionChip.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

68  {
69  m_orderConditionChip = orderConditionChipValue;
70 }
std::vector< int > m_orderConditionChip

◆ setGtPinsOnConditionChip()

void L1GtTriggerMenuXmlParser::setGtPinsOnConditionChip ( const unsigned int &  pinsOnConditionChipValue)

Definition at line 62 of file L1GtTriggerMenuXmlParser.cc.

References m_pinsOnConditionChip.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

62  {
63  m_pinsOnConditionChip = pinsOnConditionChipValue;
64 }
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips

◆ setGtScaleDbKey()

void L1GtTriggerMenuXmlParser::setGtScaleDbKey ( const std::string &  scaleKey)

Definition at line 102 of file L1GtTriggerMenuXmlParser.cc.

References m_scaleDbKey.

102 { m_scaleDbKey = scaleKey; }
std::string m_scaleDbKey
menu associated scale key

◆ setGtTechnicalTriggerMap()

void L1GtTriggerMenuXmlParser::setGtTechnicalTriggerMap ( const AlgorithmMap ttMap)

Definition at line 174 of file L1GtTriggerMenuXmlParser.cc.

References m_technicalTriggerMap.

174 { m_technicalTriggerMap = ttMap; }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers

◆ setGtTriggerMenuAuthor()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuAuthor ( const std::string &  val)

◆ setGtTriggerMenuDate()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuDate ( const std::string &  val)

◆ setGtTriggerMenuDescription()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuDescription ( const std::string &  val)

◆ setGtTriggerMenuImplementation()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuImplementation ( const std::string &  menuImplementation)

Definition at line 97 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuImplementation.

97  {
98  m_triggerMenuImplementation = menuImplementation;
99 }

◆ setGtTriggerMenuInterface()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterface ( const std::string &  menuInterface)

Definition at line 91 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterface.

91  {
92  m_triggerMenuInterface = menuInterface;
93 }
std::string m_triggerMenuInterface
menu names

◆ setGtTriggerMenuInterfaceAuthor()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceAuthor ( const std::string &  val)

◆ setGtTriggerMenuInterfaceDate()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceDate ( const std::string &  val)

Definition at line 227 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceDate, and heppy_batch::val.

227  {
229 }
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)

◆ setGtTriggerMenuInterfaceDescription()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceDescription ( const std::string &  val)

◆ setGtTriggerMenuName()

void L1GtTriggerMenuXmlParser::setGtTriggerMenuName ( const std::string &  menuName)

Definition at line 95 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuName.

95 { m_triggerMenuName = menuName; }

◆ setVecBptxTemplate()

void L1GtTriggerMenuXmlParser::setVecBptxTemplate ( const std::vector< std::vector< L1GtBptxTemplate > > &  vecBptxTempl)

Definition at line 138 of file L1GtTriggerMenuXmlParser.cc.

References m_vecBptxTemplate.

138  {
139  m_vecBptxTemplate = vecBptxTempl;
140 }
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate

◆ setVecCaloTemplate()

void L1GtTriggerMenuXmlParser::setVecCaloTemplate ( const std::vector< std::vector< L1GtCaloTemplate > > &  vecCaloTempl)

Definition at line 109 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCaloTemplate.

109  {
110  m_vecCaloTemplate = vecCaloTempl;
111 }
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate

◆ setVecCastorTemplate()

void L1GtTriggerMenuXmlParser::setVecCastorTemplate ( const std::vector< std::vector< L1GtCastorTemplate > > &  vecCastorTempl)

Definition at line 123 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCastorTemplate.

124  {
125  m_vecCastorTemplate = vecCastorTempl;
126 }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate

◆ setVecCorrelationTemplate()

void L1GtTriggerMenuXmlParser::setVecCorrelationTemplate ( const std::vector< std::vector< L1GtCorrelationTemplate > > &  vecCorrelationTempl)

Definition at line 147 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCorrelationTemplate.

148  {
149  m_vecCorrelationTemplate = vecCorrelationTempl;
150 }
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate

◆ setVecEnergySumTemplate()

void L1GtTriggerMenuXmlParser::setVecEnergySumTemplate ( const std::vector< std::vector< L1GtEnergySumTemplate > > &  vecEnergySumTempl)

Definition at line 113 of file L1GtTriggerMenuXmlParser.cc.

References m_vecEnergySumTemplate.

114  {
115  m_vecEnergySumTemplate = vecEnergySumTempl;
116 }
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate

◆ setVecExternalTemplate()

void L1GtTriggerMenuXmlParser::setVecExternalTemplate ( const std::vector< std::vector< L1GtExternalTemplate > > &  vecExternalTempl)

Definition at line 142 of file L1GtTriggerMenuXmlParser.cc.

References m_vecExternalTemplate.

143  {
144  m_vecExternalTemplate = vecExternalTempl;
145 }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate

◆ setVecHfBitCountsTemplate()

void L1GtTriggerMenuXmlParser::setVecHfBitCountsTemplate ( const std::vector< std::vector< L1GtHfBitCountsTemplate > > &  vecHfBitCountsTempl)

Definition at line 128 of file L1GtTriggerMenuXmlParser.cc.

References m_vecHfBitCountsTemplate.

129  {
130  m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
131 }
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate

◆ setVecHfRingEtSumsTemplate()

void L1GtTriggerMenuXmlParser::setVecHfRingEtSumsTemplate ( const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > &  vecHfRingEtSumsTempl)

Definition at line 133 of file L1GtTriggerMenuXmlParser.cc.

References m_vecHfRingEtSumsTemplate.

134  {
135  m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
136 }
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate

◆ setVecJetCountsTemplate()

void L1GtTriggerMenuXmlParser::setVecJetCountsTemplate ( const std::vector< std::vector< L1GtJetCountsTemplate > > &  vecJetCountsTempl)

Definition at line 118 of file L1GtTriggerMenuXmlParser.cc.

References m_vecJetCountsTemplate.

119  {
120  m_vecJetCountsTemplate = vecJetCountsTempl;
121 }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate

◆ setVecMuonTemplate()

void L1GtTriggerMenuXmlParser::setVecMuonTemplate ( const std::vector< std::vector< L1GtMuonTemplate > > &  vecMuonTempl)

Definition at line 105 of file L1GtTriggerMenuXmlParser.cc.

References m_vecMuonTemplate.

105  {
106  m_vecMuonTemplate = vecMuonTempl;
107 }
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate

◆ vecBptxTemplate()

const std::vector<std::vector<L1GtBptxTemplate> >& L1GtTriggerMenuXmlParser::vecBptxTemplate ( ) const
inline

Definition at line 161 of file L1GtTriggerMenuXmlParser.h.

References m_vecBptxTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

161 { return m_vecBptxTemplate; }
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate

◆ vecCaloTemplate()

const std::vector<std::vector<L1GtCaloTemplate> >& L1GtTriggerMenuXmlParser::vecCaloTemplate ( ) const
inline

Definition at line 123 of file L1GtTriggerMenuXmlParser.h.

References m_vecCaloTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

123 { return m_vecCaloTemplate; }
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate

◆ vecCastorTemplate()

const std::vector<std::vector<L1GtCastorTemplate> >& L1GtTriggerMenuXmlParser::vecCastorTemplate ( ) const
inline

Definition at line 142 of file L1GtTriggerMenuXmlParser.h.

References m_vecCastorTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

142 { return m_vecCastorTemplate; }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate

◆ vecCorrelationTemplate()

const std::vector<std::vector<L1GtCorrelationTemplate> >& L1GtTriggerMenuXmlParser::vecCorrelationTemplate ( ) const
inline

Definition at line 173 of file L1GtTriggerMenuXmlParser.h.

References m_vecCorrelationTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

173  {
175  }
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate

◆ vecEnergySumTemplate()

const std::vector<std::vector<L1GtEnergySumTemplate> >& L1GtTriggerMenuXmlParser::vecEnergySumTemplate ( ) const
inline

Definition at line 128 of file L1GtTriggerMenuXmlParser.h.

References m_vecEnergySumTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

128  {
129  return m_vecEnergySumTemplate;
130  }
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate

◆ vecExternalTemplate()

const std::vector<std::vector<L1GtExternalTemplate> >& L1GtTriggerMenuXmlParser::vecExternalTemplate ( ) const
inline

Definition at line 166 of file L1GtTriggerMenuXmlParser.h.

References m_vecExternalTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

166  {
167  return m_vecExternalTemplate;
168  }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate

◆ vecHfBitCountsTemplate()

const std::vector<std::vector<L1GtHfBitCountsTemplate> >& L1GtTriggerMenuXmlParser::vecHfBitCountsTemplate ( ) const
inline

Definition at line 147 of file L1GtTriggerMenuXmlParser.h.

References m_vecHfBitCountsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

147  {
149  }
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate

◆ vecHfRingEtSumsTemplate()

const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& L1GtTriggerMenuXmlParser::vecHfRingEtSumsTemplate ( ) const
inline

Definition at line 154 of file L1GtTriggerMenuXmlParser.h.

References m_vecHfRingEtSumsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

154  {
156  }
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate

◆ vecJetCountsTemplate()

const std::vector<std::vector<L1GtJetCountsTemplate> >& L1GtTriggerMenuXmlParser::vecJetCountsTemplate ( ) const
inline

Definition at line 135 of file L1GtTriggerMenuXmlParser.h.

References m_vecJetCountsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

135  {
136  return m_vecJetCountsTemplate;
137  }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate

◆ vecMuonTemplate()

const std::vector<std::vector<L1GtMuonTemplate> >& L1GtTriggerMenuXmlParser::vecMuonTemplate ( ) const
inline

get / set the vectors containing the conditions

Definition at line 119 of file L1GtTriggerMenuXmlParser.h.

References m_vecMuonTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

119 { return m_vecMuonTemplate; }
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate

◆ workAlgorithm()

bool L1GtTriggerMenuXmlParser::workAlgorithm ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  algName,
unsigned int  chipNr 
)
private

parse an algorithm and insert it into algorithm map.

workAlgorithm - parse the algorithm and insert it into algorithm map.

Parameters
nodeThe corresponding node to the algorithm.
nameThe name of the algorithm.
chipNrThe number of the chip the conditions for that algorithm are located on.
Returns
"true" on success, "false" if an error occurred.

Definition at line 3087 of file L1GtTriggerMenuXmlParser.cc.

References L1TBPTX_cfi::bitNumber, findXMLChild(), getXMLAttribute(), getXMLTextValue(), insertAlgorithmIntoMap(), edm::isDebugEnabled(), LogDebug, LogTrace, m_orderConditionChip, m_pinsOnConditionChip, L1GtXmlParserTags::m_xmlAlgorithmAttrAlias, L1GtXmlParserTags::m_xmlAttrNr, L1GtXmlParserTags::m_xmlTagOutput, L1GtXmlParserTags::m_xmlTagOutputPin, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseAlgorithms().

3089  {
3091 
3092  if (node == nullptr) {
3093  LogDebug("L1GtTriggerMenuXmlParser") << " Node is 0 in " << __PRETTY_FUNCTION__
3094  << " can not parse the algorithm " << algName << std::endl;
3095  return false;
3096  }
3097 
3098  // get alias
3100 
3101  if (algAlias.empty()) {
3102  algAlias = algName;
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;
3106  } else {
3107  LogDebug("L1GtTriggerMenuXmlParser") << "\n Alias defined for algorithm."
3108  << "\n Algorithm name: " << algName
3109  << "\n Algorithm alias: " << algAlias << std::endl;
3110  }
3111 
3112  // get the logical expression from the node
3113  std::string logExpression = getXMLTextValue(node);
3114 
3115  //LogTrace("L1GtTriggerMenuXmlParser")
3116  //<< " Logical expression: " << logExpression
3117  //<< std::endl;
3118 
3119  //LogTrace("L1GtTriggerMenuXmlParser")
3120  //<< " Chip number: " << chipNr
3121  //<< std::endl;
3122 
3123  // determine output pin
3124  DOMNode* pinNode = findXMLChild(node->getFirstChild(), m_xmlTagOutput);
3125  std::string pinString;
3126  int outputPin = 0;
3127 
3128  pinNode = node->getFirstChild();
3129  if ((pinNode = findXMLChild(pinNode, m_xmlTagOutputPin)) != nullptr) {
3130  pinString = getXMLAttribute(pinNode, m_xmlAttrNr);
3131 
3132  // convert pinString to integer
3133  std::istringstream opStream(pinString);
3134 
3135  if ((opStream >> outputPin).fail()) {
3136  LogDebug("L1GtTriggerMenuXmlParser")
3137  << " Unable to convert pin string " << pinString << " to int for algorithm : " << algName << std::endl;
3138 
3139  return false;
3140  }
3141  }
3142 
3143  if (pinNode == nullptr) {
3144  LogTrace("L1GtTriggerMenuXmlParser") << " Warning: No pin number found for algorithm: " << algName << std::endl;
3145 
3146  return false;
3147  }
3148 
3149  //LogTrace("L1GtTriggerMenuXmlParser")
3150  //<< " Output pin: " << outputPin
3151  //<< std::endl;
3152 
3153  // compute the bit number from chip number, output pin and order of the chips
3154  // pin numbering start with 1, bit numbers with 0
3155  int bitNumber = outputPin + (m_orderConditionChip[chipNr] - 1) * m_pinsOnConditionChip - 1;
3156 
3157  //LogTrace("L1GtTriggerMenuXmlParser")
3158  //<< " Bit number: " << bitNumber
3159  //<< std::endl;
3160 
3161  // create a new algorithm and insert it into algorithm map
3162  L1GtAlgorithm alg(algName, logExpression, bitNumber);
3163  alg.setAlgoChipNumber(static_cast<int>(chipNr));
3164  alg.setAlgoAlias(algAlias);
3165 
3166  if (edm::isDebugEnabled()) {
3167  std::ostringstream myCoutStream;
3168  alg.print(myCoutStream);
3169  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
3170  }
3171 
3172  // insert algorithm into the map
3173  if (!insertAlgorithmIntoMap(alg)) {
3174  return false;
3175  }
3176 
3177  return true;
3178 }
bool isDebugEnabled()
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
#define LogTrace(id)
static const std::string m_xmlTagOutputPin
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
static const std::string m_xmlTagOutput
static const std::string m_xmlAttrNr
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
bool insertAlgorithmIntoMap(const L1GtAlgorithm &alg)
insert an algorithm into algorithm map
std::vector< int > m_orderConditionChip
static const std::string m_xmlAlgorithmAttrAlias
#define LogDebug(id)

◆ workCondition()

bool L1GtTriggerMenuXmlParser::workCondition ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  name,
unsigned int  chipNr 
)
private

choose the parser for a particular condition

workCondition - call the appropriate function to parse this condition.

Parameters
nodeThe corresponding node to the condition.
nameThe name of the condition.
chipNrThe number of the chip the condition is located on.
Returns
"true" on success, "false" if an error occurred.

Definition at line 2947 of file L1GtTriggerMenuXmlParser.cc.

References getXMLAttribute(), L1GtXmlParserTags::m_xmlConditionAttrCondition, L1GtXmlParserTags::m_xmlConditionAttrConditionBptx, L1GtXmlParserTags::m_xmlConditionAttrConditionCalo, L1GtXmlParserTags::m_xmlConditionAttrConditionCastor, L1GtXmlParserTags::m_xmlConditionAttrConditionCorrelation, L1GtXmlParserTags::m_xmlConditionAttrConditionEnergySum, L1GtXmlParserTags::m_xmlConditionAttrConditionExternal, L1GtXmlParserTags::m_xmlConditionAttrConditionHfBitCounts, L1GtXmlParserTags::m_xmlConditionAttrConditionHfRingEtSums, L1GtXmlParserTags::m_xmlConditionAttrConditionJetCounts, L1GtXmlParserTags::m_xmlConditionAttrConditionMuon, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrType, Skims_PA_cff::name, parseBptx(), parseCalo(), parseCastor(), parseCorrelation(), parseEnergySum(), parseExternal(), parseHfBitCounts(), parseHfRingEtSums(), parseJetCounts(), parseMuon(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseConditions().

2949  {
2951 
2952  // get condition, particle name and type name
2956 
2957  if (condition.empty() || particle.empty() || type.empty()) {
2958  edm::LogError("L1GtTriggerMenuXmlParser") << "Missing attributes for condition " << name << std::endl;
2959 
2960  return false;
2961  }
2962 
2963  //LogTrace("L1GtTriggerMenuXmlParser")
2964  //<< " condition: " << condition << ", particle: " << particle
2965  //<< ", type: " << type << std::endl;
2966 
2967  // call the appropiate function for this condition
2968 
2969  if (condition == m_xmlConditionAttrConditionMuon) {
2970  return parseMuon(node, name, chipNr);
2971  } else if (condition == m_xmlConditionAttrConditionCalo) {
2972  return parseCalo(node, name, chipNr);
2973  } else if (condition == m_xmlConditionAttrConditionEnergySum) {
2974  return parseEnergySum(node, name, chipNr);
2975  } else if (condition == m_xmlConditionAttrConditionJetCounts) {
2976  return parseJetCounts(node, name, chipNr);
2977  } else if (condition == m_xmlConditionAttrConditionCastor) {
2978  return parseCastor(node, name, chipNr);
2979  } else if (condition == m_xmlConditionAttrConditionHfBitCounts) {
2980  return parseHfBitCounts(node, name, chipNr);
2981  } else if (condition == m_xmlConditionAttrConditionHfRingEtSums) {
2982  return parseHfRingEtSums(node, name, chipNr);
2983  } else if (condition == m_xmlConditionAttrConditionBptx) {
2984  return parseBptx(node, name, chipNr);
2985  } else if (condition == m_xmlConditionAttrConditionExternal) {
2986  return parseExternal(node, name, chipNr);
2987  } else if (condition == m_xmlConditionAttrConditionCorrelation) {
2988  return parseCorrelation(node, name, chipNr);
2989  } else {
2990  edm::LogError("L1GtTriggerMenuXmlParser") << "\n Error: unknown condition (" << condition << ")" << std::endl;
2991 
2992  return false;
2993  }
2994 
2995  return true;
2996 }
static const std::string m_xmlConditionAttrConditionEnergySum
static const std::string m_xmlConditionAttrConditionHfRingEtSums
static const std::string m_xmlConditionAttrConditionCorrelation
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
static const std::string m_xmlConditionAttrConditionCalo
static const std::string m_xmlConditionAttrConditionBptx
bool parseExternal(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse an External condition
static const std::string m_xmlConditionAttrConditionMuon
Log< level::Error, false > LogError
bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon condition
bool parseCorrelation(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse a correlation condition
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
bool parseHfBitCounts(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse a HfBitCounts condition
bool parseHfRingEtSums(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse a HfRingEtSums condition
bool parseJetCounts(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse a "jet counts" condition
bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse an "energy sum" condition
bool parseCastor(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse a CASTOR condition
static const std::string m_xmlConditionAttrConditionCastor
static const std::string m_xmlConditionAttrConditionJetCounts
static const std::string m_xmlConditionAttrConditionExternal
bool parseBptx(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
parse a Bptx condition
static const std::string m_xmlConditionAttrConditionHfBitCounts
bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse a calorimeter condition

◆ workTechTrigger()

bool L1GtTriggerMenuXmlParser::workTechTrigger ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  algName 
)
private

parse an algorithm and insert it into algorithm map.

workTechTrigger - parse the technical trigger and insert it into technical trigger map.

Parameters
nodeThe corresponding node to the technical trigger.
nameThe name of the technical trigger.
Returns
"true" on success, "false" if an error occurred.

Definition at line 3269 of file L1GtTriggerMenuXmlParser.cc.

References L1TBPTX_cfi::bitNumber, findXMLChild(), getXMLAttribute(), getXMLTextValue(), insertTechTriggerIntoMap(), edm::isDebugEnabled(), LogDebug, LogTrace, L1GtXmlParserTags::m_xmlAttrNr, L1GtXmlParserTags::m_xmlTagOutput, L1GtXmlParserTags::m_xmlTagOutputPin, L1GtAlgorithm::print(), L1GtAlgorithm::setAlgoAlias(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseTechTriggers().

3269  {
3271 
3272  if (node == nullptr) {
3273  LogDebug("L1GtTriggerMenuXmlParser") << " Node is 0 in " << __PRETTY_FUNCTION__
3274  << " can not parse the technical trigger " << algName << std::endl;
3275  return false;
3276  }
3277 
3278  // get the logical expression from the node
3279  std::string logExpression = getXMLTextValue(node);
3280 
3281  //LogTrace("L1GtTriggerMenuXmlParser")
3282  //<< " Logical expression: " << logExpression
3283  //<< std::endl;
3284 
3285  // determine bit number (use output pin tag)
3286  DOMNode* pinNode = findXMLChild(node->getFirstChild(), m_xmlTagOutput);
3287  std::string pinString;
3288  int outputPin = 0;
3289 
3290  pinNode = node->getFirstChild();
3291  if ((pinNode = findXMLChild(pinNode, m_xmlTagOutputPin)) != nullptr) {
3292  pinString = getXMLAttribute(pinNode, m_xmlAttrNr);
3293 
3294  // convert pinString to integer
3295  std::istringstream opStream(pinString);
3296 
3297  if ((opStream >> outputPin).fail()) {
3298  LogDebug("L1GtTriggerMenuXmlParser") << " Unable to convert pin string " << pinString
3299  << " to int for technical trigger : " << algName << std::endl;
3300 
3301  return false;
3302  }
3303  }
3304 
3305  if (pinNode == nullptr) {
3306  LogTrace("L1GtTriggerMenuXmlParser") << " Warning: No pin number found for technical trigger: " << algName
3307  << std::endl;
3308 
3309  return false;
3310  }
3311 
3312  // set the bit number
3313  int bitNumber = outputPin;
3314 
3315  //LogTrace("L1GtTriggerMenuXmlParser")
3316  //<< " Bit number: " << bitNumber
3317  //<< std::endl;
3318 
3319  // create a new technical trigger and insert it into technical trigger map
3320  // alias set automatically to name
3321  L1GtAlgorithm alg(algName, logExpression, bitNumber);
3322  alg.setAlgoAlias(algName);
3323 
3324  if (edm::isDebugEnabled()) {
3325  std::ostringstream myCoutStream;
3326  alg.print(myCoutStream);
3327  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
3328  }
3329 
3330  // insert technical trigger into the map
3331  if (!insertTechTriggerIntoMap(alg)) {
3332  return false;
3333  }
3334 
3335  return true;
3336 }
bool isDebugEnabled()
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
#define LogTrace(id)
static const std::string m_xmlTagOutputPin
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=nullptr)
find a named child of a xml node
static const std::string m_xmlTagOutput
static const std::string m_xmlAttrNr
bool insertTechTriggerIntoMap(const L1GtAlgorithm &alg)
insert a technical trigger into technical trigger map
#define LogDebug(id)

◆ workXML()

bool L1GtTriggerMenuXmlParser::workXML ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

do all the steps for filling a trigger menu

workXML parse the XML-File

Parameters
parserThe parser to use for parsing the XML-File
Returns
"true" if succeeded, "false" if an error occurred.

Definition at line 3396 of file L1GtTriggerMenuXmlParser.cc.

References clearMaps(), boostedTaus_cff::doc, LogTrace, L1GtXmlParserTags::m_xmlTagDef, parseAlgorithms(), parseConditions(), parseId(), writedatasetfile::parser, parseTechTriggers(), and fetchall_from_DQM_v2::release.

Referenced by parseXmlFile().

3396  {
3398 
3399  DOMDocument* doc = parser->getDocument();
3400  DOMNode* n1 = doc->getFirstChild();
3401 
3402  if (n1 == nullptr) {
3403  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: Found no XML child" << std::endl;
3404 
3405  return false;
3406  }
3407 
3408  char* nodeName = XMLString::transcode(n1->getNodeName());
3409 
3410  if (XMLString::compareIString(nodeName, m_xmlTagDef.c_str())) {
3411  edm::LogError("L1GtTriggerMenuXmlParser")
3412  << "Error: First XML child is not \" " << m_xmlTagDef << "\" " << std::endl;
3413 
3414  return false;
3415  }
3416 
3417  LogTrace("L1GtTriggerMenuXmlParser") << "\nFirst node name is: " << nodeName << std::endl;
3418  XMLString::release(&nodeName);
3419 
3420  // clear possible old maps
3421  clearMaps();
3422 
3423  if (!parseId(parser)) {
3424  clearMaps();
3425  return false;
3426  }
3427 
3428  if (!parseConditions(parser)) {
3429  clearMaps();
3430  return false;
3431  }
3432 
3433  if (!parseAlgorithms(parser)) {
3434  clearMaps();
3435  return false;
3436  }
3437 
3438  if (!parseTechTriggers(parser)) {
3439  clearMaps();
3440  return false;
3441  }
3442 
3443  return true;
3444 }
bool parseTechTriggers(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
parse all algorithms
bool parseId(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
parse all parse all identification attributes (trigger menu names, scale DB key, etc) ...
bool parseConditions(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
parse all conditions
Log< level::Error, false > LogError
#define LogTrace(id)
bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
parse all algorithms
static const std::string m_xmlTagDef

Member Data Documentation

◆ m_algorithmAliasMap

AlgorithmMap L1GtTriggerMenuXmlParser::m_algorithmAliasMap
private

map containing the physics algorithms (by alias)

Definition at line 465 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtAlgorithmAliasMap(), insertAlgorithmIntoMap(), and setGtAlgorithmAliasMap().

◆ m_algorithmImplementation

std::string L1GtTriggerMenuXmlParser::m_algorithmImplementation
private

◆ m_algorithmMap

AlgorithmMap L1GtTriggerMenuXmlParser::m_algorithmMap
private

map containing the physics algorithms (by name)

Definition at line 462 of file L1GtTriggerMenuXmlParser.h.

Referenced by clearMaps(), gtAlgorithmMap(), insertAlgorithmIntoMap(), and setGtAlgorithmMap().

◆ m_conditionMap

std::vector<ConditionMap> L1GtTriggerMenuXmlParser::m_conditionMap
private

map containing the conditions (per condition chip) - transient

Definition at line 433 of file L1GtTriggerMenuXmlParser.h.

Referenced by clearMaps(), gtConditionMap(), insertConditionIntoMap(), parseXmlFile(), and setGtConditionMap().

◆ m_corCaloTemplate

std::vector<std::vector<L1GtCaloTemplate> > L1GtTriggerMenuXmlParser::m_corCaloTemplate
private

◆ m_corEnergySumTemplate

std::vector<std::vector<L1GtEnergySumTemplate> > L1GtTriggerMenuXmlParser::m_corEnergySumTemplate
private

◆ m_corMuonTemplate

std::vector<std::vector<L1GtMuonTemplate> > L1GtTriggerMenuXmlParser::m_corMuonTemplate
private

◆ m_numberConditionChips

unsigned int L1GtTriggerMenuXmlParser::m_numberConditionChips
private

◆ m_numberL1JetCounts

unsigned int L1GtTriggerMenuXmlParser::m_numberL1JetCounts
private

jet counts

Definition at line 416 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtNumberL1JetCounts(), parseJetCounts(), and setGtNumberL1JetCounts().

◆ m_numberPhysTriggers

unsigned int L1GtTriggerMenuXmlParser::m_numberPhysTriggers
private

number of physics trigger algorithms

Definition at line 410 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtNumberPhysTriggers(), insertAlgorithmIntoMap(), and setGtNumberPhysTriggers().

◆ m_numberTechTriggers

unsigned int L1GtTriggerMenuXmlParser::m_numberTechTriggers
private

number of technical triggers

Definition at line 413 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtNumberTechTriggers(), insertTechTriggerIntoMap(), and setGtNumberTechTriggers().

◆ m_orderConditionChip

std::vector<int> L1GtTriggerMenuXmlParser::m_orderConditionChip
private

correspondence "condition chip - GTL algorithm word" in the hardware chip 2: 0 - 95; chip 1: 96 - 128 (191)

Definition at line 407 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtOrderConditionChip(), insertAlgorithmIntoMap(), setGtOrderConditionChip(), and workAlgorithm().

◆ m_pinsOnConditionChip

unsigned int L1GtTriggerMenuXmlParser::m_pinsOnConditionChip
private

number of pins on the GTL condition chips

Definition at line 403 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtPinsOnConditionChip(), insertAlgorithmIntoMap(), setGtPinsOnConditionChip(), and workAlgorithm().

◆ m_scaleDbKey

std::string L1GtTriggerMenuXmlParser::m_scaleDbKey
private

menu associated scale key

Definition at line 442 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtScaleDbKey(), parseId(), and setGtScaleDbKey().

◆ m_technicalTriggerMap

AlgorithmMap L1GtTriggerMenuXmlParser::m_technicalTriggerMap
private

map containing the technical triggers

Definition at line 468 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtTechnicalTriggerMap(), insertTechTriggerIntoMap(), and setGtTechnicalTriggerMap().

◆ m_triggerMenuAuthor

std::string L1GtTriggerMenuXmlParser::m_triggerMenuAuthor
private

◆ m_triggerMenuDate

std::string L1GtTriggerMenuXmlParser::m_triggerMenuDate
private

Definition at line 425 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtTriggerMenuDate(), parseId(), and setGtTriggerMenuDate().

◆ m_triggerMenuDescription

std::string L1GtTriggerMenuXmlParser::m_triggerMenuDescription
private

◆ m_triggerMenuImplementation

std::string L1GtTriggerMenuXmlParser::m_triggerMenuImplementation
private

◆ m_triggerMenuInterface

std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterface
private

menu names

Definition at line 437 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtTriggerMenuInterface(), parseId(), and setGtTriggerMenuInterface().

◆ m_triggerMenuInterfaceAuthor

std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterfaceAuthor
private

◆ m_triggerMenuInterfaceDate

std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterfaceDate
private

members for XML parser only (do not appear in CondFormats)

Definition at line 421 of file L1GtTriggerMenuXmlParser.h.

Referenced by gtTriggerMenuInterfaceDate(), parseId(), and setGtTriggerMenuInterfaceDate().

◆ m_triggerMenuInterfaceDescription

std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterfaceDescription
private

◆ m_triggerMenuName

std::string L1GtTriggerMenuXmlParser::m_triggerMenuName
private

◆ m_vecBptxTemplate

std::vector<std::vector<L1GtBptxTemplate> > L1GtTriggerMenuXmlParser::m_vecBptxTemplate
private

◆ m_vecCaloTemplate

std::vector<std::vector<L1GtCaloTemplate> > L1GtTriggerMenuXmlParser::m_vecCaloTemplate
private

◆ m_vecCastorTemplate

std::vector<std::vector<L1GtCastorTemplate> > L1GtTriggerMenuXmlParser::m_vecCastorTemplate
private

◆ m_vecCorrelationTemplate

std::vector<std::vector<L1GtCorrelationTemplate> > L1GtTriggerMenuXmlParser::m_vecCorrelationTemplate
private

◆ m_vecEnergySumTemplate

std::vector<std::vector<L1GtEnergySumTemplate> > L1GtTriggerMenuXmlParser::m_vecEnergySumTemplate
private

◆ m_vecExternalTemplate

std::vector<std::vector<L1GtExternalTemplate> > L1GtTriggerMenuXmlParser::m_vecExternalTemplate
private

◆ m_vecHfBitCountsTemplate

std::vector<std::vector<L1GtHfBitCountsTemplate> > L1GtTriggerMenuXmlParser::m_vecHfBitCountsTemplate
private

◆ m_vecHfRingEtSumsTemplate

std::vector<std::vector<L1GtHfRingEtSumsTemplate> > L1GtTriggerMenuXmlParser::m_vecHfRingEtSumsTemplate
private

◆ m_vecJetCountsTemplate

std::vector<std::vector<L1GtJetCountsTemplate> > L1GtTriggerMenuXmlParser::m_vecJetCountsTemplate
private

◆ m_vecMuonTemplate

std::vector<std::vector<L1GtMuonTemplate> > L1GtTriggerMenuXmlParser::m_vecMuonTemplate
private

vectors containing the conditions explicit, due to persistency...

Definition at line 446 of file L1GtTriggerMenuXmlParser.h.

Referenced by parseMuon(), parseXmlFile(), setVecMuonTemplate(), and vecMuonTemplate().

◆ m_xmlErrHandler

XERCES_CPP_NAMESPACE::ErrorHandler* L1GtTriggerMenuXmlParser::m_xmlErrHandler
private

error handler for xml-parser

Definition at line 395 of file L1GtTriggerMenuXmlParser.h.

Referenced by cleanupXML(), initXML(), and parseXmlFile().