test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual ~L1GtTriggerMenuXmlParser ()
 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=0)
 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< boost::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, boost::uint64_t &dst)
 get a hexadecimal value of a xml node containing text More...
 
bool getXMLHexTextValue128 (XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dstL, boost::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, boost::uint64_t &dstL, boost::uint64_t &dstH)
 convert a hexadecimal string with up to 128 to 2 boost::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 52 of file L1GtTriggerMenuXmlParser.h.

Constructor & Destructor Documentation

L1GtTriggerMenuXmlParser::L1GtTriggerMenuXmlParser ( )

constructor empty

Definition at line 40 of file L1GtTriggerMenuXmlParser.cc.

40  :
43 
44 {
45 
46  // menu names, scale key initialized to NULL due to ORACLE treatment of strings
47 
48  // empty
49 
50 }
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 ( )
virtual

destructor

Definition at line 53 of file L1GtTriggerMenuXmlParser.cc.

References clearMaps().

53  {
54 
55  clearMaps();
56 
57 }

Member Function Documentation

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 900 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by parseXmlFile().

900  {
901 
902  XERCES_CPP_NAMESPACE_USE
903 
904  if (parser != 0) {
905  delete parser;
906  }
907 
908  if (m_xmlErrHandler != 0) {
909  delete m_xmlErrHandler;
910  m_xmlErrHandler = 0;
911  }
912 
914 
915 }
void xercesTerminate()
Definition: Xerces.cc:22
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser
void L1GtTriggerMenuXmlParser::clearMaps ( )
private

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

Definition at line 981 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmMap, and m_conditionMap.

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

981  {
982 
983  // loop over condition maps (one map per condition chip)
984  // then loop over conditions in the map
985  for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip
986  != m_conditionMap.end(); itCondOnChip++) {
987 
988  // the conditions in the maps are deleted in L1GtTriggerMenu, not here
989 
990  itCondOnChip->clear();
991 
992  }
993 
994  // the algorithms in the maps are deleted in L1GtTriggerMenu, not here
995  m_algorithmMap.clear();
996 
997 }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
const std::vector<std::vector<L1GtCaloTemplate> >& L1GtTriggerMenuXmlParser::corCaloTemplate ( ) const
inline

Definition at line 244 of file L1GtTriggerMenuXmlParser.h.

References m_corCaloTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

244  {
245  return m_corCaloTemplate;
246  }
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
const std::vector<std::vector<L1GtEnergySumTemplate> >& L1GtTriggerMenuXmlParser::corEnergySumTemplate ( ) const
inline

Definition at line 251 of file L1GtTriggerMenuXmlParser.h.

References m_corEnergySumTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

251  {
252 
253  return m_corEnergySumTemplate;
254  }
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
const std::vector<std::vector<L1GtMuonTemplate> >& L1GtTriggerMenuXmlParser::corMuonTemplate ( ) const
inline

Definition at line 237 of file L1GtTriggerMenuXmlParser.h.

References m_corMuonTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

237  {
238  return m_corMuonTemplate;
239  }
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
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 713 of file L1GtTriggerMenuXmlParser.cc.

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

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

714  {
715 
716  XERCES_CPP_NAMESPACE_USE
717 
718  // should never happen...
719  if (node == 0) {
720 
721  LogDebug("L1GtTriggerMenuXmlParser")
722  << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
723 
724  return false;
725  }
726 
727  DOMNode* n1 = findXMLChild(node->getFirstChild(), childName);
728 
729  if (n1 == 0) {
730 
731  LogDebug("L1GtTriggerMenuXmlParser") << "Child of condition not found ( " << childName
732  << ")" << std::endl;
733 
734  return false;
735  }
736 
737  DOMNode* n2 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
738 
739  if (n2 == 0) {
740 
741  LogDebug("L1GtTriggerMenuXmlParser") << "No value tag found for child " << childName
742  << " in " << __PRETTY_FUNCTION__ << std::endl;
743 
744  return false;
745  }
746 
747  // first try direct
748  std::string maxString = getXMLAttribute(n1, m_xmlAttrMax); // string for the maxbits
749 
750  if (maxString.empty() ) {
751  maxString = getXMLAttribute(n2, m_xmlAttrMax); // try next value tag
752  // if no max was found neither in value nor in the childName tag
753  if (maxString.empty() ) {
754 
755  LogDebug("L1GtTriggerMenuXmlParser") << "No Max value found for " << childName
756  << std::endl;
757 
758  return false;
759  }
760  }
761 
762  // do the hex conversion
763 
764  boost::uint64_t maxBitsL, maxBitsH;
765  if ( !hexString2UInt128(maxString, maxBitsL, maxBitsH) ) {
766  return false;
767  }
768 
769  // count the bits
770  //LogTrace("L1GtTriggerMenuXmlParser")
771  //<< std::dec
772  //<< " words: dec: high (MSB) word = " << maxBitsH << " low word = " << maxBitsL
773  //<< std::hex << "\n"
774  //<< " words: hex: high (MSB) word = " << maxBitsH << " low word = " << maxBitsL
775  //<< std::dec
776  //<< std::endl;
777 
778  unsigned int counter = 0;
779 
780  while (maxBitsL != 0) {
781  // check if bits set countinously
782  if ( (maxBitsL & 1) == 0) {
783 
784  edm::LogError("L1GtTriggerMenuXmlParser")
785  << " Confused by not continous set bits for max value " << maxString
786  << "(child=" << childName << ")" << std::endl;
787 
788  return false;
789  }
790 
791  maxBitsL >>= 1;
792  counter++;
793  }
794 
795  if ( (maxBitsH != 0) && (counter != 64)) {
796 
797  edm::LogError("L1GtTriggerMenuXmlParser")
798  << " Confused by not continous set bits for max value " << maxString << "(child="
799  << childName << ")" << std::endl;
800 
801  return false;
802  }
803 
804  while (maxBitsH != 0) {
805  //check if bits set countinously
806  if ( (maxBitsH & 1) == 0) {
807 
808  edm::LogError("L1GtTriggerMenuXmlParser")
809  << " Confused by not continous set bits for max value " << maxString
810  << "(child=" << childName << ")" << std::endl;
811 
812  return false;
813  }
814 
815  maxBitsH >>= 1;
816  counter++;
817  }
818 
819  dst = counter;
820  return true;
821 
822 }
#define LogDebug(id)
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
std::string getXMLAttribute(const XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name)
get a named attribute for an xml node as string
unsigned long long uint64_t
Definition: Time.h:15
static std::atomic< unsigned int > counter
bool hexString2UInt128(const std::string &hexString, boost::uint64_t &dstL, boost::uint64_t &dstH)
convert a hexadecimal string with up to 128 to 2 boost::uint64_t
static const std::string m_xmlTagValue
static const std::string m_xmlAttrMax
XERCES_CPP_NAMESPACE::DOMNode * L1GtTriggerMenuXmlParser::findXMLChild ( XERCES_CPP_NAMESPACE::DOMNode *  startChild,
const std::string &  tagName,
bool  beginOnly = false,
std::string *  rest = 0 
)
private

find a named child of a xml node

Definition at line 418 of file L1GtTriggerMenuXmlParser.cc.

References fetchall_from_DQM_v2::release, AlCaHLTBitMon_QueryRunRegistry::string, and XERCES_CPP_NAMESPACE_USE::transcode().

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

420  {
421 
422  XERCES_CPP_NAMESPACE_USE
423 
424  char* nodeName = 0;
425 
426  DOMNode *n1 = startChild;
427  if (n1 == 0) {
428  return 0;
429  }
430 
431  if ( !tagName.empty() ) {
432  nodeName = XMLString::transcode(n1->getNodeName());
433 
434  if (!beginOnly) {
435  //match the whole tag
436  while (XMLString::compareIString(nodeName, tagName.c_str())) {
437 
438  XMLString::release(&nodeName);
439  n1 = n1->getNextSibling();
440  if (n1 == 0) {
441  break;
442  }
443 
444  nodeName = XMLString::transcode(n1->getNodeName());
445  }
446  }
447  else {
448  // match only the beginning
449  while (XMLString::compareNIString(nodeName, tagName.c_str(), tagName.length())) {
450  XMLString::release(&nodeName);
451  n1 = n1->getNextSibling();
452  if (n1 == 0) {
453  break;
454  }
455 
456  nodeName = XMLString::transcode(n1->getNodeName());
457  }
458  if (n1 != 0 && rest != 0) {
459  *rest = std::string(nodeName).substr(tagName.length(), strlen(nodeName) - tagName.length());
460  }
461  }
462  }
463  else { // empty string given
464  while (n1->getNodeType() != DOMNode::ELEMENT_NODE) {
465  n1 = n1->getNextSibling();
466  if (n1 == 0) {
467  break;
468  }
469 
470  }
471  if (n1 != 0 && rest != 0) {
472  nodeName = XMLString::transcode(n1->getNodeName());
473  *rest = std::string(nodeName);
474  }
475  }
476 
477  XMLString::release(&nodeName);
478 
479  return n1;
480 
481 }
XMLCh * transcode(const T &fInput)
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 1259 of file L1GtTriggerMenuXmlParser.cc.

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

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

1259  {
1260 
1262 
1263  edm::LogError("L1GtTriggerMenuXmlParser") << "Invalid mode for single bit" << std::endl;
1264 
1265  return -1;
1266  }
1267 
1268  std::string tmpStr = getXMLTextValue(node);
1269  if (tmpStr == "0") {
1270  return 0;
1271  }
1272  else if (tmpStr == "1") {
1273  return 1;
1274  }
1275  else {
1276  edm::LogError("L1GtTriggerMenuXmlParser") << "Bad bit value (" << tmpStr << ")"
1277  << std::endl;
1278  return -1;
1279  }
1280 }
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
tuple node
Definition: Node.py:50
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
bool L1GtTriggerMenuXmlParser::getConditionChildValues ( XERCES_CPP_NAMESPACE::DOMNode *  node,
const std::string &  childName,
unsigned int  num,
std::vector< boost::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 boost::uint64_t where the results are written.
Returns
true if succeeded. false if an error occurred or not enough values found.

Definition at line 835 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), getXMLHexTextValue(), i, LogDebug, L1GtXmlParserTags::m_xmlTagValue, and pileupDistInMC::num.

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

836  {
837 
838  XERCES_CPP_NAMESPACE_USE
839 
840  if (node == 0) {
841 
842  LogDebug("L1GtTriggerMenuXmlParser")
843  << "node == 0 in " << __PRETTY_FUNCTION__
844  << std::endl;
845 
846  return false;
847  }
848 
849  DOMNode* n1 = findXMLChild(node->getFirstChild(), childName);
850 
851  // if child not found
852  if (n1 == 0) {
853 
854  LogDebug("L1GtTriggerMenuXmlParser") << "Child of condition not found ( " << childName
855  << ")" << std::endl;
856 
857  return false;
858  }
859 
860  // no values are sucessfull
861  if (num == 0) {
862  return true;
863  }
864 
865  //
866  dst.reserve(num);
867 
868  //
869  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
870  for (unsigned int i = 0; i < num; i++) {
871  if (n1 == 0) {
872 
873  LogDebug("L1GtTriggerMenuXmlParser") << "Not enough values in condition child ( "
874  << childName << ")" << std::endl;
875 
876  return false;
877  }
878 
879  if ( !getXMLHexTextValue(n1, dst[i]) ) {
880 
881  edm::LogError("L1GtTriggerMenuXmlParser") << "Error converting condition child ( "
882  << childName << ") value." << std::endl;
883 
884  return false;
885  }
886 
887  n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue); // next child
888  }
889 
890  return true;
891 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
bool getXMLHexTextValue(XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dst)
get a hexadecimal value of a xml node containing text
static const std::string m_xmlTagValue
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 1291 of file L1GtTriggerMenuXmlParser.cc.

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

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

1292  {
1293 
1294  XERCES_CPP_NAMESPACE_USE
1295 
1296  if (node == 0) {
1297 
1298  LogDebug("L1GtTriggerMenuXmlParser")
1299  << "node == 0 in " << __PRETTY_FUNCTION__
1300  << std::endl;
1301 
1302  return -1;
1303  }
1304 
1305  // usually the GEq flag is a child of the first child (the first element node)
1306  DOMNode* n1 = node->getFirstChild();
1307  n1 = findXMLChild(n1, nodeName);
1308 
1309  if (n1 != 0) {
1310  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagGEq);
1311  if (n1 == 0) {
1312 
1313  LogDebug("L1GtTriggerMenuXmlParser") << "No \"greater or equal\" tag found"
1314  << std::endl;
1315 
1316  return -1;
1317  }
1318 
1319  return getBitFromNode(n1);
1320  }
1321  else {
1322 
1323  return -1;
1324 
1325  }
1326 
1327 }
#define LogDebug(id)
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=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
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 1341 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by parseMuon().

1343  {
1344 
1345  XERCES_CPP_NAMESPACE_USE
1346 
1347  if (node == 0) {
1348  return false;
1349  }
1350 
1351  // find ptLowThreshold child
1352  DOMNode* n1 = findXMLChild(node->getFirstChild(), m_xmlTagPtLowThreshold);
1353 
1354  if (n1 == 0) {
1355  return false;
1356  }
1357 
1358  // get first value tag
1359  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
1360 
1361  for (unsigned int i = 0; i < num; i++) {
1362 
1363  if (n1 == 0) {
1364  return false;
1365  }
1366 
1367  // MIP bit
1368 
1369  DOMNode* bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagEnableMip);
1370  if (bitnode == 0) {
1371  return true;
1372  }
1373 
1374  int tmpint = getBitFromNode(bitnode);
1375  if (tmpint < 0) {
1376  return false;
1377  }
1378 
1379  mipDst[i] = (tmpint != 0);
1380 
1381  //LogTrace("L1GtTriggerMenuXmlParser")
1382  //<< " MIP bit value for muon " << i << " = " << mipDst[i]
1383  //<< std::endl;
1384 
1385 
1386  // enable iso bit
1387  bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagEnableIso);
1388  if (bitnode == 0) {
1389  return true;
1390  }
1391 
1392  tmpint = getBitFromNode(bitnode);
1393  if (tmpint < 0) {
1394  return false;
1395  }
1396 
1397  isoEnDst[i] = (tmpint != 0);
1398 
1399  //LogTrace("L1GtTriggerMenuXmlParser")
1400  //<< " Enabled iso bit value for muon " << i << " = " << isoEnDst[i]
1401  //<< std::endl;
1402 
1403  // request iso bit
1404  bitnode = findXMLChild(n1->getFirstChild(), m_xmlTagRequestIso);
1405  if (bitnode == 0) {
1406  return true;
1407  }
1408 
1409  tmpint = getBitFromNode(bitnode);
1410  if (tmpint < 0) {
1411  return false;
1412  }
1413 
1414  isoReqDst[i] = (tmpint != 0);
1415 
1416  //LogTrace("L1GtTriggerMenuXmlParser")
1417  //<< " Request iso bit value for muon " << i << " = " << isoReqDst[i]
1418  //<< std::endl;
1419 
1420  //
1421  n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue); // next value
1422  }
1423 
1424  return true;
1425 }
int getBitFromNode(XERCES_CPP_NAMESPACE::DOMNode *node)
get bit from a bit node
int i
Definition: DBlmapReader.cc:9
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=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
static const std::string m_xmlTagPtLowThreshold
static const std::string m_xmlTagEnableMip
static const std::string m_xmlTagValue
static const std::string m_xmlTagRequestIso
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 1222 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().

1222  {
1223 
1224  if (type == m_xmlConditionAttrType1s) {
1225  return 1;
1226  }
1227 
1228  if (type == m_xmlConditionAttrType2s) {
1229  return 2;
1230  }
1231 
1232  if (type == m_xmlConditionAttrType3s) {
1233  return 3;
1234  }
1235 
1236  if (type == m_xmlConditionAttrType4s) {
1237  return 4;
1238  }
1239 
1241  return 2;
1242  }
1243 
1245  return 2;
1246  }
1247 
1248  return -1;
1249 }
type
Definition: HCALResponse.h:21
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
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 1184 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().

1184  {
1185 
1186  if (type == m_xmlConditionAttrType1s) {
1187  return Type1s;
1188  }
1189 
1190  if (type == m_xmlConditionAttrType2s) {
1191  return Type2s;
1192  }
1193 
1194  if (type == m_xmlConditionAttrType3s) {
1195  return Type3s;
1196  }
1197 
1198  if (type == m_xmlConditionAttrType4s) {
1199  return Type4s;
1200  }
1201 
1203  return Type2wsc;
1204  }
1205 
1207  return Type2cor;
1208  }
1209 
1210  return TypeNull;
1211 }
type
Definition: HCALResponse.h:21
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
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 492 of file L1GtTriggerMenuXmlParser.cc.

References fetchall_from_DQM_v2::release, run_regression::ret, AlCaHLTBitMon_QueryRunRegistry::string, and XERCES_CPP_NAMESPACE_USE::transcode().

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

493  {
494 
495  XERCES_CPP_NAMESPACE_USE
496 
498 
499  // get attributes list
500  DOMNamedNodeMap* attributes = node->getAttributes();
501  if (attributes == 0) {
502  return ret;
503  }
504 
505  // get attribute node
506  XMLCh* attrName = XMLString::transcode(name.c_str());
507  DOMNode* attribNode = attributes->getNamedItem(attrName);
508 
509  XMLString::release(&attrName);
510  if (attribNode == 0) {
511  return ret;
512  }
513 
514  char* retCstr = XMLString::transcode(attribNode->getNodeValue());
515  ret = retCstr;
516  XMLString::release(&retCstr);
517 
518  return ret;
519 }
tuple node
Definition: Node.py:50
XMLCh * transcode(const T &fInput)
bool L1GtTriggerMenuXmlParser::getXMLHexTextValue ( XERCES_CPP_NAMESPACE::DOMNode *  node,
boost::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 682 of file L1GtTriggerMenuXmlParser.cc.

References getXMLHexTextValue128().

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

683  {
684 
685  boost::uint64_t dummyH; // dummy for eventual higher 64bit
686  boost::uint64_t tempUInt; // temporary unsigned integer
687 
688  if ( !getXMLHexTextValue128(node, tempUInt, dummyH) ) {
689  return false;
690  }
691 
692  if (dummyH != 0) {
693  edm::LogError("L1GtTriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
694  return false;
695  }
696 
697  dst = tempUInt;
698 
699  return true;
700 }
tuple node
Definition: Node.py:50
unsigned long long uint64_t
Definition: Time.h:15
bool getXMLHexTextValue128(XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dstL, boost::uint64_t &dstH)
get a hexadecimal value of a xml node containing text with up to 128 bit
bool L1GtTriggerMenuXmlParser::getXMLHexTextValue128 ( XERCES_CPP_NAMESPACE::DOMNode *  node,
boost::uint64_t &  dstL,
boost::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 648 of file L1GtTriggerMenuXmlParser.cc.

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

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

649  {
650 
651  if (node == 0) {
652 
653  LogDebug("L1GtTriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
654 
655  return false;
656  }
657 
658  boost::uint64_t tempUIntH, tempUIntL;
659 
660  std::string tempStr = getXMLTextValue(node);
661  if ( !hexString2UInt128(tempStr, tempUIntL, tempUIntH) ) {
662  return false;
663  }
664 
665  dstL = tempUIntL;
666  dstH = tempUIntH;
667 
668  return true;
669 }
#define LogDebug(id)
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
tuple node
Definition: Node.py:50
unsigned long long uint64_t
Definition: Time.h:15
bool hexString2UInt128(const std::string &hexString, boost::uint64_t &dstL, boost::uint64_t &dstH)
convert a hexadecimal string with up to 128 to 2 boost::uint64_t
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 529 of file L1GtTriggerMenuXmlParser.cc.

References python.Node::node, fetchall_from_DQM_v2::release, run_regression::ret, AlCaHLTBitMon_QueryRunRegistry::string, and XERCES_CPP_NAMESPACE_USE::transcode().

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

529  {
530 
531  XERCES_CPP_NAMESPACE_USE
532 
534 
535  DOMNode* n1 = node;
536  if (n1 == 0) {
537  return ret;
538  }
539 
540  const XMLCh* retXmlCh = n1->getTextContent();
541  if (retXmlCh == 0) {
542  return ret;
543  }
544 
545  char* retCstr = XMLString::transcode(retXmlCh);
546  XMLString::trim(retCstr); // trim spaces
547 
548  ret = retCstr;
549  XMLString::release(&retCstr);
550 
551  return ret;
552 }
tuple node
Definition: Node.py:50
XMLCh * transcode(const T &fInput)
const AlgorithmMap& L1GtTriggerMenuXmlParser::gtAlgorithmAliasMap ( ) const
inline

get / set the algorithm map (by alias)

Definition at line 267 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmAliasMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

267  {
268  return m_algorithmAliasMap;
269  }
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
const std::string& L1GtTriggerMenuXmlParser::gtAlgorithmImplementation ( ) const
inline

Definition at line 328 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmImplementation.

328  {
330  }
const AlgorithmMap& L1GtTriggerMenuXmlParser::gtAlgorithmMap ( ) const
inline

get / set the algorithm map (by name)

Definition at line 260 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

260  {
261  return m_algorithmMap;
262  }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
const std::vector<ConditionMap>& L1GtTriggerMenuXmlParser::gtConditionMap ( ) const
inline

get / set / build the condition maps

Definition at line 112 of file L1GtTriggerMenuXmlParser.h.

References m_conditionMap.

112  {
113  return m_conditionMap;
114  }
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
const unsigned int L1GtTriggerMenuXmlParser::gtNumberConditionChips ( ) const
inline

get / set the number of condition chips in GTL

Definition at line 67 of file L1GtTriggerMenuXmlParser.h.

References m_numberConditionChips.

67  {
69  }
unsigned int m_numberConditionChips
hardware limits
const unsigned int L1GtTriggerMenuXmlParser::gtNumberL1JetCounts ( ) const
inline

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

Definition at line 103 of file L1GtTriggerMenuXmlParser.h.

References m_numberL1JetCounts.

103  {
104  return m_numberL1JetCounts;
105  }
unsigned int m_numberL1JetCounts
jet counts
const unsigned int L1GtTriggerMenuXmlParser::gtNumberPhysTriggers ( ) const
inline

get / set the number of physics trigger algorithms

Definition at line 89 of file L1GtTriggerMenuXmlParser.h.

References m_numberPhysTriggers.

89  {
90  return m_numberPhysTriggers;
91  }
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
const unsigned int L1GtTriggerMenuXmlParser::gtNumberTechTriggers ( ) const
inline

get / set the number of technical triggers

Definition at line 96 of file L1GtTriggerMenuXmlParser.h.

References m_numberTechTriggers.

96  {
97  return m_numberTechTriggers;
98  }
unsigned int m_numberTechTriggers
number of technical triggers
std::vector<int> L1GtTriggerMenuXmlParser::gtOrderConditionChip ( ) const
inline

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

Definition at line 82 of file L1GtTriggerMenuXmlParser.h.

References m_orderConditionChip.

82  {
83  return m_orderConditionChip;
84  }
std::vector< int > m_orderConditionChip
const unsigned int L1GtTriggerMenuXmlParser::gtPinsOnConditionChip ( ) const
inline

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

Definition at line 74 of file L1GtTriggerMenuXmlParser.h.

References m_pinsOnConditionChip.

74  {
75  return m_pinsOnConditionChip;
76  }
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
const std::string& L1GtTriggerMenuXmlParser::gtScaleDbKey ( ) const
inline

menu associated scale key

Definition at line 140 of file L1GtTriggerMenuXmlParser.h.

References m_scaleDbKey.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

140  {
141  return m_scaleDbKey;
142  }
std::string m_scaleDbKey
menu associated scale key
const AlgorithmMap& L1GtTriggerMenuXmlParser::gtTechnicalTriggerMap ( ) const
inline

get / set the technical trigger map

Definition at line 274 of file L1GtTriggerMenuXmlParser.h.

References m_technicalTriggerMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

274  {
275  return m_technicalTriggerMap;
276  }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuAuthor ( ) const
inline

Definition at line 315 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuAuthor.

315  {
316  return m_triggerMenuAuthor;
317  }
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuDate ( ) const
inline

Definition at line 309 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuDate.

309  {
310  return m_triggerMenuDate;
311  }
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuDescription ( ) const
inline

Definition at line 321 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuDescription.

321  {
323  }
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuImplementation ( ) const
inline
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterface ( ) const
inline

get / set the trigger menu names

Definition at line 119 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterface.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

119  {
120  return m_triggerMenuInterface;
121  }
std::string m_triggerMenuInterface
menu names
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterfaceAuthor ( ) const
inline

Definition at line 295 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceAuthor.

295  {
297  }
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterfaceDate ( ) const
inline

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

Definition at line 289 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDate.

289  {
291  }
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuInterfaceDescription ( ) const
inline

Definition at line 301 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDescription.

301  {
303  }
const std::string& L1GtTriggerMenuXmlParser::gtTriggerMenuName ( ) const
inline

Definition at line 126 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuName.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

126  {
127  return m_triggerMenuName;
128  }
bool L1GtTriggerMenuXmlParser::hexString2UInt128 ( const std::string &  hexString,
boost::uint64_t &  dstL,
boost::uint64_t &  dstH 
)
private

convert a hexadecimal string with up to 128 to 2 boost::uint64_t

hexString2UInt128 converts an up to 128 bit hexadecimal string to two boost::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 564 of file L1GtTriggerMenuXmlParser.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by countConditionChildMaxBits(), and getXMLHexTextValue128().

565  {
566 
567  // string to determine start of hex value, do not ignore leading zeros
568  static const std::string valid_hex_start("0123456789ABCDEFabcdef");
569 
570  // string to determine end of hex value
571  static const std::string valid_hex_end("0123456789ABCDEFabcdef");
572 
573  std::string tempStr = hexString;
574 
575  // start / end position of the hex value in the string
576  unsigned int hexStart = tempStr.find_first_of(valid_hex_start);
577  unsigned int hexEnd = tempStr.find_first_not_of(valid_hex_end, hexStart);
578 
579  if (hexStart == hexEnd) {
580 
581  LogDebug("L1GtTriggerMenuXmlParser") << "No hex value found in: " << tempStr << std::endl;
582 
583  return false;
584  }
585 
586  tempStr = tempStr.substr(hexStart, hexEnd - hexStart);
587 
588  if (tempStr.empty() ) {
589 
590  LogDebug("L1GtTriggerMenuXmlParser") << "Empty value in " << __PRETTY_FUNCTION__
591  << std::endl;
592 
593  return false;
594  }
595 
596  // split the string
597  std::string tempStrH, tempStrL;
598 
599  if (tempStr.length() > 16) { // more than 64 bit
600  tempStrL = tempStr.substr(tempStr.length()-16, 16);
601  tempStrH = tempStr.substr(0, tempStr.length()-16);
602  }
603  else {
604  tempStrL = tempStr;
605  tempStrH = "0";
606  }
607 
608  // convert lower 64bit
609  char* endPtr = (char*) tempStrL.c_str();
610  boost::uint64_t tempUIntL = strtoull(tempStrL.c_str(), &endPtr, 16);
611 
612  if (*endPtr != 0) {
613 
614  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << tempStr << " to hex."
615  << std::endl;
616 
617  return false;
618  }
619 
620  // convert higher64 bit
621  endPtr = (char*) tempStrH.c_str();
622  boost::uint64_t tempUIntH = strtoull(tempStrH.c_str(), &endPtr, 16);
623 
624  if (*endPtr != 0) {
625 
626  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << tempStr << " to hex."
627  << std::endl;
628 
629  return false;
630  }
631 
632  dstL = tempUIntL;
633  dstH = tempUIntH;
634 
635  return true;
636 }
#define LogDebug(id)
unsigned long long uint64_t
Definition: Time.h:15
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 341 of file L1GtTriggerMenuXmlParser.cc.

References m_xmlErrHandler, python.rootplot.argparse::message, geometryXMLtoCSV::parser, fetchall_from_DQM_v2::release, XERCES_CPP_NAMESPACE_USE::transcode(), and cms::concurrency::xercesInitialize().

Referenced by parseXmlFile().

341  {
342 
343  XERCES_CPP_NAMESPACE_USE
344 
345  // try to initialize
346  try {
348  }
349  catch (const XMLException& toCatch) {
350  char* message = XMLString::transcode(toCatch.getMessage());
351 
352  edm::LogError("L1GtTriggerMenuXmlParser")
353  << "Error during Xerces-c initialization! :"
354  << message << std::endl;
355 
356  XMLString::release(&message);
357  return 0;
358  }
359 
360  XercesDOMParser* parser = new XercesDOMParser();
361  parser->setValidationScheme(XercesDOMParser::Val_Always);
362  parser->setDoNamespaces(false); // we got no dtd
363 
364  if (m_xmlErrHandler == 0) { // redundant check
365  m_xmlErrHandler = (ErrorHandler*) new HandlerBase();
366  }
367  else {
368  // TODO ASSERTION
369  }
370  parser->setErrorHandler(m_xmlErrHandler);
371 
372  // try to parse the file
373  try {
374  parser->parse(xmlFile.c_str());
375  }
376  catch(const XMLException &toCatch) {
377  char* message = XMLString::transcode(toCatch.getMessage());
378 
379  edm::LogError("L1GtTriggerMenuXmlParser")
380  << "Exception while parsing XML: \n"
381  << message << std::endl;
382 
383  XMLString::release(&message);
384  delete parser;
385  delete m_xmlErrHandler;
386  m_xmlErrHandler = 0;
387  return 0;
388  }
389  catch (const DOMException &toCatch) {
390  char *message = XMLString::transcode(toCatch.msg);
391 
392  edm::LogError("L1GtTriggerMenuXmlParser")
393  << "DOM-Exception while parsing XML: \n"
394  << message << std::endl;
395 
396  XMLString::release(&message);
397  delete parser;
398  delete m_xmlErrHandler;
399  m_xmlErrHandler = 0;
400  return 0;
401  }
402  catch (...) {
403 
404  edm::LogError("L1GtTriggerMenuXmlParser")
405  << "Unexpected Exception while parsing XML!"
406  << std::endl;
407 
408  delete parser;
409  delete m_xmlErrHandler;
410  m_xmlErrHandler = 0;
411  return 0;
412  }
413 
414  return parser;
415 }
void xercesInitialize()
Definition: Xerces.cc:17
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser
XMLCh * transcode(const T &fInput)
bool xmlFile(const std::string fParam)
bool L1GtTriggerMenuXmlParser::insertAlgorithmIntoMap ( const L1GtAlgorithm alg)
private

insert an algorithm into algorithm map

Definition at line 1025 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workAlgorithm().

1025  {
1026 
1027  std::string algName = alg.algoName();
1028  std::string algAlias = alg.algoAlias();
1029  //LogTrace("L1GtTriggerMenuXmlParser")
1030  //<< " Trying to insert algorithm \"" << algName << "\" in the algorithm map." ;
1031 
1032  // no algorithm name has to appear twice!
1033  if (m_algorithmMap.count(algName) != 0) {
1034  LogTrace("L1GtTriggerMenuXmlParser") << " Algorithm \"" << algName
1035  << "\"already exists in the algorithm map- not inserted!" << std::endl;
1036  return false;
1037  }
1038 
1039  if (m_algorithmAliasMap.count(algAlias) != 0) {
1040  LogTrace("L1GtTriggerMenuXmlParser") << " Algorithm alias \"" << algAlias
1041  << "\"already exists in the algorithm alias map- not inserted!" << std::endl;
1042  return false;
1043  }
1044 
1045  // bit number less than zero or greater than maximum number of algorithms
1046  int bitNumber = alg.algoBitNumber();
1047  if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberPhysTriggers))) {
1048  LogTrace("L1GtTriggerMenuXmlParser") << " Bit number " << bitNumber
1049  << " outside allowed range [0, " << m_numberPhysTriggers
1050  << ") - algorithm not inserted!" << std::endl;
1051  return false;
1052  }
1053 
1054  // maximum number of algorithms
1055  if (m_algorithmMap.size() >= m_numberPhysTriggers) {
1056  LogTrace("L1GtTriggerMenuXmlParser") << " More than maximum allowed "
1057  << m_numberPhysTriggers << " algorithms in the algorithm map - not inserted!"
1058  << std::endl;
1059  return false;
1060  }
1061 
1062  // chip number outside allowed values
1063  int chipNr = alg.algoChipNumber(static_cast<int>(m_numberConditionChips),
1064  static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1065 
1066  if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
1067  LogTrace("L1GtTriggerMenuXmlParser") << " Chip number " << chipNr
1068  << " outside allowed range [0, " << m_numberConditionChips
1069  << ") - algorithm not inserted!" << std::endl;
1070  return false;
1071  }
1072 
1073  // output pin outside allowed values
1074  int outputPin = alg.algoOutputPin(static_cast<int>(m_numberConditionChips),
1075  static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1076 
1077  if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
1078  LogTrace("L1GtTriggerMenuXmlParser") << " Output pin " << outputPin
1079  << " outside allowed range [0, " << m_pinsOnConditionChip
1080  << "] - algorithm not inserted!" << std::endl;
1081  return false;
1082  }
1083 
1084  // no two algorithms on the same chip can have the same output pin
1085  for (CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
1086 
1087  int iPin = (itAlgo->second).algoOutputPin( static_cast<int>(m_numberConditionChips),
1088  static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1089  std::string iName = itAlgo->first;
1090  int iChip = (itAlgo->second).algoChipNumber(static_cast<int>(m_numberConditionChips),
1091  static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
1092 
1093  if ( (outputPin == iPin) && (chipNr == iChip)) {
1094  LogTrace("L1GtTriggerMenuXmlParser") << " Output pin " << outputPin
1095  << " is the same as for algorithm " << iName
1096  << "\n from the same chip number " << chipNr << " - algorithm not inserted!"
1097  << std::endl;
1098  return false;
1099  }
1100 
1101  }
1102 
1103  // insert algorithm
1104  m_algorithmMap[algName] = alg;
1105  m_algorithmAliasMap[algAlias] = alg;
1106 
1107  //LogTrace("L1GtTriggerMenuXmlParser")
1108  //<< " OK - algorithm inserted!"
1109  //<< std::endl;
1110 
1111  return true;
1112 
1113 }
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
const std::string algoName() const
get / set algorithm name
Definition: L1GtAlgorithm.h:56
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
std::string const & algoAlias() const
get / set algorithm alias
Definition: L1GtAlgorithm.h:67
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
const int algoOutputPin(const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
get the output pin on the condition chip for the algorithm
int algoBitNumber() const
get / set algorithm bit number
Definition: L1GtAlgorithm.h:94
unsigned int m_numberConditionChips
hardware limits
#define LogTrace(id)
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
const int algoChipNumber() const
get / set algorithm bit number
std::vector< int > m_orderConditionChip
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 1001 of file L1GtTriggerMenuXmlParser.cc.

References L1GtCondition::condName(), prof2calltree::count, LogTrace, m_conditionMap, and AlCaHLTBitMon_QueryRunRegistry::string.

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

1001  {
1002 
1003  std::string cName = cond.condName();
1004  //LogTrace("L1GtTriggerMenuXmlParser")
1005  //<< " Trying to insert condition \"" << cName << "\" in the condition map." ;
1006 
1007  // no condition name has to appear twice!
1008  if ((m_conditionMap[chipNr]).count(cName) != 0) {
1009  LogTrace("L1GtTriggerMenuXmlParser") << " Condition " << cName
1010  << " already exists - not inserted!" << std::endl;
1011  return false;
1012  }
1013 
1014  (m_conditionMap[chipNr])[cName] = &cond;
1015  //LogTrace("L1GtTriggerMenuXmlParser")
1016  //<< " OK - condition inserted!"
1017  //<< std::endl;
1018 
1019 
1020  return true;
1021 
1022 }
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:57
#define LogTrace(id)
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
bool L1GtTriggerMenuXmlParser::insertTechTriggerIntoMap ( const L1GtAlgorithm alg)
private

insert a technical trigger into technical trigger map

Definition at line 1116 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workTechTrigger().

1116  {
1117 
1118  std::string algName = alg.algoName();
1119  //LogTrace("L1GtTriggerMenuXmlParser")
1120  //<< " Trying to insert technical trigger \"" << algName
1121  //<< "\" in the technical trigger map." ;
1122 
1123  // no technical trigger name has to appear twice!
1124  if (m_technicalTriggerMap.count(algName) != 0) {
1125  LogTrace("L1GtTriggerMenuXmlParser") << " Technical trigger \""
1126  << algName
1127  << "\"already exists in the technical trigger map- not inserted!"
1128  << std::endl;
1129  return false;
1130  }
1131 
1132  // bit number less than zero or greater than maximum number of technical triggers
1133  int bitNumber = alg.algoBitNumber();
1134  if ((bitNumber < 0)
1135  || (bitNumber >= static_cast<int>(m_numberTechTriggers))) {
1136  LogTrace("L1GtTriggerMenuXmlParser") << " Bit number "
1137  << bitNumber << " outside allowed range [0, "
1139  << ") - technical trigger not inserted!" << std::endl;
1140  return false;
1141  }
1142 
1143  // no two technical triggers can have the same bit number
1144  for (CItAlgo itAlgo = m_technicalTriggerMap.begin(); itAlgo
1145  != m_technicalTriggerMap.end(); itAlgo++) {
1146 
1147  int iBitNumber = (itAlgo->second).algoBitNumber();
1148  std::string iName = itAlgo->first;
1149 
1150  if ((iBitNumber == bitNumber)) {
1151  LogTrace("L1GtTriggerMenuXmlParser") << " Bit number "
1152  << iBitNumber << " is the same as for technical trigger "
1153  << iName << " - technical trigger not inserted!"
1154  << std::endl;
1155  return false;
1156  }
1157 
1158  }
1159 
1160  // maximum number of technical triggers
1162  LogTrace("L1GtTriggerMenuXmlParser")
1163  << " More than maximum allowed " << m_numberTechTriggers
1164  << " technical triggers in the technical trigger map - not inserted!"
1165  << std::endl;
1166  return false;
1167  }
1168 
1169  // insert technical trigger
1170  m_technicalTriggerMap[algName] = alg;
1171 
1172  //LogTrace("L1GtTriggerMenuXmlParser")
1173  //<< " OK - technical trigger inserted!"
1174  //<< std::endl;
1175 
1176  return true;
1177 
1178 }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
const std::string algoName() const
get / set algorithm name
Definition: L1GtAlgorithm.h:56
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
unsigned int m_numberTechTriggers
number of technical triggers
int algoBitNumber() const
get / set algorithm bit number
Definition: L1GtAlgorithm.h:94
#define LogTrace(id)
bool L1GtTriggerMenuXmlParser::parseAlgorithms ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all algorithms

Definition at line 3635 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), m_numberConditionChips, L1GtXmlParserTags::m_xmlTagAlgorithms, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagDef, python.Node::node, AlCaHLTBitMon_QueryRunRegistry::string, and workAlgorithm().

Referenced by workXML().

3635  {
3636 
3637  XERCES_CPP_NAMESPACE_USE
3638 
3639  //LogTrace("L1GtTriggerMenuXmlParser") << "\nParsing algorithms" << std::endl;
3640 
3641  DOMNode* doc = parser->getDocument();
3642  DOMNode* node = doc->getFirstChild();
3643 
3644  DOMNode* chipNode = node->getFirstChild();
3645  if (chipNode == 0) {
3646  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: No child found for " << m_xmlTagDef
3647  << std::endl;
3648  return false;
3649  }
3650 
3651  // find first chip
3652  std::string chipName;
3653  chipNode = findXMLChild(chipNode, m_xmlTagChip, true, &chipName);
3654  if (chipNode == 0) {
3655  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: Could not find <" << m_xmlTagChip
3656  << std::endl;
3657  return false;
3658  }
3659 
3660  unsigned int chipNr = 0;
3661  do {
3662 
3663  //LogTrace("L1GtTriggerMenuXmlParser") << std::endl;
3664 
3665  std::string nodeName = m_xmlTagChip + chipName;
3666  //LogTrace("L1GtTriggerMenuXmlParser")
3667  //<< " Chip: " << nodeName << " Name: " << chipName
3668  //<< std::endl;
3669 
3670  // find algorithms
3671  DOMNode* algNode = chipNode->getFirstChild();
3672  algNode = findXMLChild(algNode, m_xmlTagAlgorithms);
3673  if (algNode == 0) {
3674  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: No <" << m_xmlTagAlgorithms
3675  << "> child found in chip " << chipName << std::endl;
3676  return false;
3677  }
3678 
3679  // walk through algorithms
3680  DOMNode* algNameNode = algNode->getFirstChild();
3681  std::string algNameNodeName;
3682  algNameNode = findXMLChild(algNameNode, "", true, &algNameNodeName);
3683 
3684  while (algNameNode != 0) {
3685  //LogTrace("L1GtTriggerMenuXmlParser")
3686  //<< " Found an algorithm with name: " << algNameNodeName
3687  //<< std::endl;
3688 
3689  if ( !workAlgorithm(algNameNode, algNameNodeName, chipNr)) {
3690  return false;
3691  }
3692 
3693  algNameNode = findXMLChild(algNameNode->getNextSibling(), "", true, &algNameNodeName);
3694 
3695  }
3696 
3697  // next chip
3698  chipNode = findXMLChild(chipNode->getNextSibling(), m_xmlTagChip, true, &chipName);
3699  chipNr++;
3700 
3701  } while (chipNode != 0 && chipNr < m_numberConditionChips);
3702 
3703  return true;
3704 }
bool workAlgorithm(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr)
parse an algorithm and insert it into algorithm map.
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
unsigned int m_numberConditionChips
hardware limits
static const std::string m_xmlTagChip
static const std::string m_xmlTagAlgorithms
static const std::string m_xmlTagDef
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 2651 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workCondition().

2652  {
2653 
2654  XERCES_CPP_NAMESPACE_USE
2655 
2656  // get condition, particle name and type name
2660 
2661  if (particle != m_xmlConditionAttrObjectBptx) {
2662  edm::LogError("L1GtTriggerMenuXmlParser")
2663  << "\nError: wrong particle for Bptx condition ("
2664  << particle << ")" << std::endl;
2665  return false;
2666  }
2667 
2668  // object type and condition type
2669  // object type - irrelevant for BPTX conditions
2670  L1GtConditionType cType = TypeBptx;
2671 
2672  // no objects for BPTX conditions
2673 
2674  // set the boolean value for the ge_eq mode - irrelevant for BPTX conditions
2675  bool gEq = false;
2676 
2677  // now create a new BPTX condition
2678 
2679  L1GtBptxTemplate bptxCond(name);
2680 
2681  bptxCond.setCondType(cType);
2682  bptxCond.setCondGEq(gEq);
2683  bptxCond.setCondChipNr(chipNr);
2684 
2685  LogTrace("L1GtTriggerMenuXmlParser") << bptxCond << "\n" << std::endl;
2686 
2687  // insert condition into the map
2688  if ( !insertConditionIntoMap(bptxCond, chipNr)) {
2689 
2690  edm::LogError("L1GtTriggerMenuXmlParser")
2691  << " Error: duplicate condition (" << name
2692  << ")" << std::endl;
2693 
2694  return false;
2695  } else {
2696 
2697  (m_vecBptxTemplate[chipNr]).push_back(bptxCond);
2698 
2699  }
2700 
2701 
2702  //
2703  return true;
2704 }
type
Definition: HCALResponse.h:21
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
tuple node
Definition: Node.py:50
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
#define LogTrace(id)
static const std::string m_xmlConditionAttrObjectBptx
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 1719 of file L1GtTriggerMenuXmlParser.cc.

References CenJet, countConditionChildMaxBits(), L1GtCaloTemplate::CorrelationParameter::deltaEtaRange, L1GtCaloTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtCaloTemplate::CorrelationParameter::deltaPhiRange, ForJet, getConditionChildValues(), getGEqFlag(), getNumFromType(), getTypeFromType(), getXMLAttribute(), 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, NoIsoEG, L1GtCaloTemplate::print(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCaloTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, TauJet, and TypeNull.

Referenced by parseCorrelation(), and workCondition().

1720  {
1721 
1722  XERCES_CPP_NAMESPACE_USE
1723 
1724  // get condition, particle name and type name
1728 
1729  // determine object type type
1730  L1GtObject caloObjType;
1731 
1732  if (particle == m_xmlConditionAttrObjectNoIsoEG) {
1733  caloObjType = NoIsoEG;
1734  }
1735  else if (particle == m_xmlConditionAttrObjectIsoEG) {
1736  caloObjType = IsoEG;
1737  }
1738  else if (particle == m_xmlConditionAttrObjectCenJet) {
1739  caloObjType = CenJet;
1740  }
1741  else if (particle == m_xmlConditionAttrObjectTauJet) {
1742  caloObjType = TauJet;
1743  }
1744  else if (particle == m_xmlConditionAttrObjectForJet) {
1745  caloObjType = ForJet;
1746  }
1747  else {
1748  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for calo-condition ("
1749  << particle << ")" << std::endl;
1750  return false;
1751  }
1752 
1753  int nrObj = getNumFromType(type);
1754  if (nrObj < 0) {
1755  edm::LogError("L1GtTriggerMenuXmlParser") << "Unknown type for calo-condition (" << type
1756  << ")" << "\nCan not determine number of trigger objects. " << std::endl;
1757  return false;
1758  }
1759 
1760  // get greater equal flag
1761 
1762  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
1763  if (intGEq < 0) {
1764  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
1765  << std::endl;
1766  return false;
1767  }
1768  // set the boolean value for the ge_eq mode
1769  bool gEq = (intGEq != 0);
1770 
1771  // get values
1772 
1773  // temporary storage of the parameters
1774  std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(nrObj);
1776 
1777  // need at least one value for deltaPhiRange
1778  std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1779 
1780  // get etThreshold values and fill into structure
1781  if ( !getConditionChildValues(node, m_xmlTagEtThreshold, nrObj, tmpValues) ) {
1782  return false;
1783  }
1784 
1785  for (int i = 0; i < nrObj; i++) {
1786  objParameter[i].etThreshold = tmpValues[i];
1787 
1788  //LogTrace("L1GtTriggerMenuXmlParser")
1789  //<< " Calo ET high threshold (hex) for calo object " << i << " = "
1790  //<< std::hex << objParameter[i].etThreshold << std::dec
1791  //<< std::endl;
1792  }
1793 
1794  // get etaRange and fill into structure
1795  if ( !getConditionChildValues(node, m_xmlTagEta, nrObj, tmpValues) ) {
1796  return false;
1797  }
1798 
1799 
1800  for (int i = 0; i < nrObj; i++) {
1801 
1802  objParameter[i].etaRange = tmpValues[i];
1803 
1804  //LogTrace("L1GtTriggerMenuXmlParser")
1805  //<< " etaRange (hex) for calo object " << i << " = "
1806  //<< std::hex << objParameter[i].etaRange << std::dec
1807  //<< std::endl;
1808  }
1809 
1810  // get phiRange values and fill into structure
1811  if ( !getConditionChildValues(node, m_xmlTagPhi, nrObj, tmpValues) ) {
1812  return false;
1813  }
1814 
1815  for (int i = 0; i < nrObj; i++) {
1816  objParameter[i].phiRange = tmpValues[i];
1817 
1818  //LogTrace("L1GtTriggerMenuXmlParser")
1819  //<< " phiRange (hex) for calo object " << i << " = "
1820  //<< std::hex << objParameter[i].phiRange << std::dec
1821  //<< std::endl;
1822  }
1823 
1824  // indicates if a correlation is used
1825  bool wscVal = (type == m_xmlConditionAttrType2wsc );
1826 
1827  if (wscVal) {
1828  // get deltaEtaRange
1829  if ( !getConditionChildValues(node, m_xmlTagDeltaEta, 1, tmpValues) ) {
1830  return false;
1831  }
1832 
1833  corrParameter.deltaEtaRange = tmpValues[0];
1834 
1835  // get deltaPhiRange
1836  if ( !getConditionChildValues(node, m_xmlTagDeltaPhi, 1, tmpValues) ) {
1837  return false;
1838  }
1839 
1840  corrParameter.deltaPhiRange = tmpValues[0];
1841 
1842  // get maximum number of bits for delta phi
1843  //LogTrace("L1GtTriggerMenuXmlParser")
1844  //<< " Counting deltaPhiMaxbits"
1845  //<< std::endl;
1846 
1847  unsigned int maxbits;
1848 
1849  if ( !countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits) ) {
1850  return false;
1851  }
1852 
1853  corrParameter.deltaPhiMaxbits = maxbits;
1854  //LogTrace("L1GtTriggerMenuXmlParser")
1855  //<< " deltaPhiMaxbits (dec) = " << maxbits
1856  //<< std::endl;
1857  }
1858 
1859  // get the type of the condition, as defined in enum, from the condition type
1860  // as defined in the XML file
1861  L1GtConditionType cType = getTypeFromType(type);
1862  //LogTrace("L1GtTriggerMenuXmlParser")
1863  //<< " Condition type (enum value) = " << cType
1864  //<< std::endl;
1865 
1866  if (cType == TypeNull) {
1867  edm::LogError("L1GtTriggerMenuXmlParser")
1868  << "Type for calo condition id TypeNull - it means not defined in the XML file."
1869  << "\nNumber of trigger objects is set to zero. " << std::endl;
1870  return false;
1871  }
1872 
1873  // object types - all same caloObjType
1874  std::vector<L1GtObject> objType(nrObj, caloObjType);
1875 
1876  // now create a new calo condition
1877 
1878  L1GtCaloTemplate caloCond(name);
1879 
1880  caloCond.setCondType(cType);
1881  caloCond.setObjectType(objType);
1882  caloCond.setCondGEq(gEq);
1883  caloCond.setCondChipNr(chipNr);
1884 
1885  caloCond.setConditionParameter(objParameter, corrParameter);
1886 
1887  if (edm::isDebugEnabled() ) {
1888 
1889  std::ostringstream myCoutStream;
1890  caloCond.print(myCoutStream);
1891  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
1892 
1893  }
1894 
1895  // insert condition into the map
1896  if ( !insertConditionIntoMap(caloCond, chipNr)) {
1897 
1898  edm::LogError("L1GtTriggerMenuXmlParser")
1899  << " Error: duplicate condition (" << name << ")"
1900  << std::endl;
1901 
1902  return false;
1903  }
1904  else {
1905 
1906  if (corrFlag) {
1907  (m_corCaloTemplate[chipNr]).push_back(caloCond);
1908  }
1909  else {
1910  (m_vecCaloTemplate[chipNr]).push_back(caloCond);
1911  }
1912 
1913  }
1914 
1915 
1916  //
1917  return true;
1918 }
static const std::string m_xmlTagEta
type
Definition: HCALResponse.h:21
static const std::string m_xmlConditionAttrObjectIsoEG
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< boost::uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlTagDeltaPhi
static const std::string m_xmlConditionAttrObjectCenJet
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
static const std::string m_xmlConditionAttrObjectForJet
tuple node
Definition: Node.py:50
static const std::string m_xmlConditionAttrObjectNoIsoEG
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the &quot;greater or equal flag&quot; 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
#define LogTrace(id)
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
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)
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 2313 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workCondition().

2314  {
2315 
2316  XERCES_CPP_NAMESPACE_USE
2317 
2318  // get condition, particle name and type name
2322 
2323  if (particle != m_xmlConditionAttrObjectCastor) {
2324  edm::LogError("L1GtTriggerMenuXmlParser")
2325  << "\nError: wrong particle for Castor condition ("
2326  << particle << ")" << std::endl;
2327  return false;
2328  }
2329 
2330  // object type and condition type
2331  // object type - irrelevant for CASTOR conditions
2332  L1GtConditionType cType = TypeCastor;
2333 
2334  // no objects for CASTOR conditions
2335 
2336  // set the boolean value for the ge_eq mode - irrelevant for CASTOR conditions
2337  bool gEq = false;
2338 
2339  // now create a new CASTOR condition
2340 
2341  L1GtCastorTemplate castorCond(name);
2342 
2343  castorCond.setCondType(cType);
2344  castorCond.setCondGEq(gEq);
2345  castorCond.setCondChipNr(chipNr);
2346 
2347 
2348  if (edm::isDebugEnabled() ) {
2349 
2350  std::ostringstream myCoutStream;
2351  castorCond.print(myCoutStream);
2352  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2353 
2354  }
2355 
2356  // insert condition into the map
2357  if ( !insertConditionIntoMap(castorCond, chipNr)) {
2358 
2359  edm::LogError("L1GtTriggerMenuXmlParser")
2360  << " Error: duplicate condition (" << name
2361  << ")" << std::endl;
2362 
2363  return false;
2364  } else {
2365 
2366  (m_vecCastorTemplate[chipNr]).push_back(castorCond);
2367 
2368  }
2369 
2370 
2371  //
2372  return true;
2373 }
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
static const std::string m_xmlConditionAttrObjectCastor
tuple node
Definition: Node.py:50
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
#define LogTrace(id)
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 3427 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), LogTrace, m_numberConditionChips, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagConditions, L1GtXmlParserTags::m_xmlTagDef, fetchall_from_DQM_v2::release, AlCaHLTBitMon_QueryRunRegistry::string, XERCES_CPP_NAMESPACE_USE::transcode(), and workCondition().

Referenced by workXML().

3427  {
3428 
3429  XERCES_CPP_NAMESPACE_USE
3430 
3431  LogTrace("L1GtTriggerMenuXmlParser") << "\nParsing conditions" << std::endl;
3432 
3433  DOMNode* doc = parser->getDocument();
3434  DOMNode* n1 = doc->getFirstChild();
3435 
3436  // we assume that the first child is m_xmlTagDef because it was checked in workXML
3437 
3438  DOMNode* chipNode = n1->getFirstChild();
3439  if (chipNode == 0) {
3440 
3441  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No child of <" << m_xmlTagDef
3442  << "> tag found." << std::endl;
3443 
3444  return false;
3445  }
3446 
3447  // find chip
3448 
3449  std::string chipName; // name of the actual chip
3450  chipNode = findXMLChild(chipNode, m_xmlTagChip, true, &chipName);
3451  if (chipNode == 0) {
3452 
3453  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: Could not find <" << m_xmlTagChip
3454  << "> tag" << std::endl;
3455 
3456  return false;
3457  }
3458 
3459  unsigned int chipNr = 0;
3460  do {
3461 
3462  // find conditions
3463  DOMNode* conditionsNode = chipNode->getFirstChild();
3464  conditionsNode = findXMLChild(conditionsNode, m_xmlTagConditions);
3465  if (conditionsNode == 0) {
3466 
3467  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No <" << m_xmlTagConditions
3468  << "> child found in Chip " << chipName << std::endl;
3469 
3470  return false;
3471  }
3472 
3473  char* nodeName = XMLString::transcode(chipNode->getNodeName());
3474  //LogTrace("L1GtTriggerMenuXmlParser")
3475  //<< "\n Found Chip: " << nodeName << " Name: " << chipName
3476  //<< std::endl;
3477 
3478  XMLString::release(&nodeName);
3479 
3480  // walk through conditions
3481  DOMNode* conditionNameNode = conditionsNode->getFirstChild();
3482  std::string conditionNameNodeName;
3483  conditionNameNode = findXMLChild(conditionNameNode, "", true, &conditionNameNodeName);
3484  while (conditionNameNode != 0) {
3485 
3486  LogTrace("L1GtTriggerMenuXmlParser")
3487  << "\n Found a condition with name: " << conditionNameNodeName
3488  << std::endl;
3489 
3490  if ( !workCondition(conditionNameNode, conditionNameNodeName, chipNr) ) {
3491  return false;
3492  }
3493  conditionNameNode = findXMLChild(conditionNameNode->getNextSibling(), "", true,
3494  &conditionNameNodeName);
3495 
3496  }
3497  // next chip
3498  chipNode = findXMLChild(chipNode->getNextSibling(), m_xmlTagChip, true, &chipName);
3499  chipNr++;
3500 
3501  } while (chipNode != 0 && chipNr < m_numberConditionChips);
3502 
3503  return true;
3504 }
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
XMLCh * transcode(const T &fInput)
unsigned int m_numberConditionChips
hardware limits
#define LogTrace(id)
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
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 2787 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, NoIsoEG, parseCalo(), parseEnergySum(), parseMuon(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, TauJet, and Type2cor.

Referenced by workCondition().

2789  {
2790 
2791  XERCES_CPP_NAMESPACE_USE
2792 
2793  // create a new correlation condition
2794  L1GtCorrelationTemplate correlationCond(name);
2795 
2796  // check that the condition does not exist already in the map
2797  if ( !insertConditionIntoMap(correlationCond, chipNr)) {
2798 
2799  edm::LogError("L1GtTriggerMenuXmlParser")
2800  << " Error: duplicate correlation condition (" << name << ")"
2801  << std::endl;
2802 
2803  return false;
2804  }
2805 
2806  // get condition, particle name and type name
2810 
2811  LogTrace("L1GtTriggerMenuXmlParser") << " Condition category: "
2812  << condition << ", particle: " << particle << ", type: " << type
2813  << "\n" << std::endl;
2814 
2815  // condition type
2816  L1GtConditionType cType = Type2cor;
2817 
2818  // two objects (for sure)
2819  const int nrObj = 2;
2820 
2821  // object types and greater equal flag - filled in the loop
2822  int intGEq[nrObj] = { -1, -1 };
2823  std::vector<L1GtObject> objType(nrObj);
2824  std::vector<L1GtConditionCategory> condCateg(nrObj);
2825 
2826  // correlation flag and index in the cor*vector
2827  const bool corrFlag = true;
2828  int corrIndexVal[nrObj] = { -1, -1 };
2829 
2830  // get the subconditions
2831 
2832  DOMNode* conditionsNode = node->getFirstChild();
2833  std::string conditionNameNodeName;
2834  conditionsNode = findXMLChild(conditionsNode, "", true,
2835  &conditionNameNodeName);
2836 
2837 
2838  for (int iSubCond = 0; iSubCond < nrObj; ++iSubCond) {
2839 
2840  // get for sub-condition: category, object name and type name and condition name
2841  condition = getXMLAttribute(conditionsNode, m_xmlConditionAttrCondition);
2842  particle = getXMLAttribute(conditionsNode, m_xmlConditionAttrObject);
2843  type = getXMLAttribute(conditionsNode, m_xmlConditionAttrType);
2844 
2845  LogTrace("L1GtTriggerMenuXmlParser") << " Sub-condition category: "
2846  << condition << ", particle: " << particle << ", type: "
2847  << type << ", name: " << conditionNameNodeName << "\n"
2848  << std::endl;
2849 
2850  // call the appropriate function for this condition
2851  if (condition == m_xmlConditionAttrConditionMuon) {
2852  if (!parseMuon(conditionsNode, conditionNameNodeName, chipNr,
2853  corrFlag)) {
2854  edm::LogError("L1GtTriggerMenuXmlParser")
2855  << "Error parsing sub-condition " << condition << ")"
2856  << " with name " << conditionNameNodeName << std::endl;
2857 
2858  }
2859 
2860  // get greater equal flag
2861  intGEq[iSubCond] = getGEqFlag(conditionsNode,
2863  if (intGEq[iSubCond] < 0) {
2864  edm::LogError("L1GtTriggerMenuXmlParser")
2865  << "Error getting \"greater or equal\" flag"
2866  << " for sub-condition " << conditionNameNodeName
2867  << " for the correlation condition " << name
2868  << std::endl;
2869  return false;
2870  }
2871 
2872  // set object type and sub-condition category
2873  objType[iSubCond] = Mu;
2874  condCateg[iSubCond] = CondMuon;
2875  corrIndexVal[iSubCond] = (m_corMuonTemplate[chipNr]).size() - 1;
2876 
2877  }
2878  else if (condition == m_xmlConditionAttrConditionCalo) {
2879  if (!parseCalo(conditionsNode, conditionNameNodeName, chipNr,
2880  corrFlag)) {
2881  edm::LogError("L1GtTriggerMenuXmlParser")
2882  << "Error parsing sub-condition " << condition << ")"
2883  << " with name " << conditionNameNodeName << std::endl;
2884 
2885  }
2886 
2887  // get greater equal flag
2888  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagEtThreshold);
2889  if (intGEq[iSubCond] < 0) {
2890  edm::LogError("L1GtTriggerMenuXmlParser")
2891  << "Error getting \"greater or equal\" flag"
2892  << " for sub-condition " << conditionNameNodeName
2893  << " for the correlation condition " << name
2894  << std::endl;
2895  return false;
2896  }
2897 
2898  // set object type and sub-condition category
2899  if (particle == m_xmlConditionAttrObjectNoIsoEG) {
2900  objType[iSubCond] = NoIsoEG;
2901  }
2902  else if (particle == m_xmlConditionAttrObjectIsoEG) {
2903  objType[iSubCond] = IsoEG;
2904  }
2905  else if (particle == m_xmlConditionAttrObjectCenJet) {
2906  objType[iSubCond] = CenJet;
2907  }
2908  else if (particle == m_xmlConditionAttrObjectTauJet) {
2909  objType[iSubCond] = TauJet;
2910  }
2911  else if (particle == m_xmlConditionAttrObjectForJet) {
2912  objType[iSubCond] = ForJet;
2913  }
2914  else {
2915  edm::LogError("L1GtTriggerMenuXmlParser")
2916  << "Wrong object type " << particle
2917  << " for sub-condition " << conditionNameNodeName
2918  << " from the correlation condition " << name
2919  << std::endl;
2920  return false;
2921  }
2922 
2923  condCateg[iSubCond] = CondCalo;
2924  corrIndexVal[iSubCond] = (m_corCaloTemplate[chipNr]).size() - 1;
2925 
2926  }
2927  else if (condition == m_xmlConditionAttrConditionEnergySum) {
2928  if (!parseEnergySum(conditionsNode, conditionNameNodeName, chipNr,
2929  corrFlag)) {
2930  edm::LogError("L1GtTriggerMenuXmlParser")
2931  << "Error parsing sub-condition " << condition << ")"
2932  << " with name " << conditionNameNodeName << std::endl;
2933 
2934  }
2935 
2936  // get greater equal flag
2937  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagEtThreshold);
2938  if (intGEq[iSubCond] < 0) {
2939  edm::LogError("L1GtTriggerMenuXmlParser")
2940  << "Error getting \"greater or equal\" flag"
2941  << " for sub-condition " << conditionNameNodeName
2942  << " for the correlation condition " << name
2943  << std::endl;
2944  return false;
2945  }
2946 
2947  // set object type and sub-condition category
2948  if (particle == m_xmlConditionAttrObjectETM) {
2949  objType[iSubCond] = ETM;
2950  }
2951  else if (particle == m_xmlConditionAttrObjectETT) {
2952  objType[iSubCond] = ETT;
2953  }
2954  else if (particle == m_xmlConditionAttrObjectHTT) {
2955  objType[iSubCond] = HTT;
2956  }
2957  else if (particle == m_xmlConditionAttrObjectHTM) {
2958  objType[iSubCond] = HTM;
2959  }
2960  else {
2961  edm::LogError("L1GtTriggerMenuXmlParser")
2962  << "Wrong object type " << particle
2963  << " for sub-condition " << conditionNameNodeName
2964  << " from the correlation condition " << name
2965  << std::endl;
2966  return false;
2967  }
2968 
2969  condCateg[iSubCond] = CondEnergySum;
2970  corrIndexVal[iSubCond] = (m_corEnergySumTemplate[chipNr]).size() - 1;
2971 
2972  }
2973  else {
2974  edm::LogError("L1GtTriggerMenuXmlParser")
2975  << "Unknown or un-adequate sub-condition (" << condition
2976  << ")" << " with name " << conditionNameNodeName
2977  << " for the correlation condition " << name << std::endl;
2978 
2979  return false;
2980  }
2981 
2982  conditionsNode = findXMLChild(conditionsNode->getNextSibling(), "",
2983  true, &conditionNameNodeName);
2984 
2985  }
2986 
2987  // get greater equal flag for the correlation condition
2988  bool gEq = true;
2989  if (intGEq[0] != intGEq[1]) {
2990  edm::LogError("L1GtTriggerMenuXmlParser")
2991  << "Inconsistent GEq flags for sub-conditions (" << condition
2992  << ")" << " with name " << conditionNameNodeName
2993  << " for the correlation condition " << name << std::endl;
2994  return false;
2995 
2996  }
2997  else {
2998  gEq = (intGEq[0] != 0);
2999 
3000  }
3001 
3002  // correlation parameters
3003 
3004  // temporary storage of the parameters
3006  std::vector<boost::uint64_t> tmpValues(nrObj);
3007 
3008  // get deltaEtaRange
3009 // if ( !getConditionChildValues(node, m_xmlTagDeltaEta, 1, tmpValues) ) {
3010 // return false;
3011 // }
3012 //
3013 // corrParameter.deltaEtaRange = tmpValues[0];
3014 
3015  XERCES_CPP_NAMESPACE::DOMNode* node1 = findXMLChild(node->getFirstChild(),
3017 
3018  std::string valString;
3019 
3020  if (node1 == 0) {
3021  edm::LogError("L1GtTriggerMenuXmlParser")
3022  << " Could not get deltaEta for correlation condition "
3023  << name << ". " << std::endl;
3024  return false;
3025  }
3026  else {
3027  valString = getXMLTextValue(node1);
3028  }
3029 
3030  corrParameter.deltaEtaRange = valString;
3031 
3032 // // deltaPhi is larger than 64bit
3033 // if ( !getXMLHexTextValue128(findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi),
3034 // tmpValues[0], tmpValues[1])) {
3035 // edm::LogError("L1GtTriggerMenuXmlParser")
3036 // << " Could not get deltaPhi for correlation condition " << name << ". "
3037 // << std::endl;
3038 // return false;
3039 // }
3040 //
3041 // corrParameter.deltaPhiRange = tmpValues[0];
3042 
3043  node1 = findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi);
3044 
3045  if (node1 == 0) {
3046  return false;
3047  edm::LogError("L1GtTriggerMenuXmlParser")
3048  << " Could not get deltaPhi for correlation condition "
3049  << name << ". " << std::endl;
3050  }
3051  else {
3052  valString = getXMLTextValue(node1);
3053  }
3054 
3055  corrParameter.deltaPhiRange = valString;
3056 
3057  // get maximum number of bits for delta phi
3058  //LogTrace("L1GtTriggerMenuXmlParser")
3059  //<< " Counting deltaPhiMaxbits"
3060  //<< std::endl;
3061 
3062  unsigned int maxbits;
3063 
3064  if ( !countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits) ) {
3065  return false;
3066  }
3067 
3068  corrParameter.deltaPhiMaxbits = maxbits;
3069  //LogTrace("L1GtTriggerMenuXmlParser")
3070  //<< " deltaPhiMaxbits (dec) = " << maxbits
3071  //<< std::endl;
3072 
3073 
3074  // fill the correlation condition
3075  correlationCond.setCondType(cType);
3076  correlationCond.setObjectType(objType);
3077  correlationCond.setCondGEq(gEq);
3078  correlationCond.setCondChipNr(chipNr);
3079 
3080  correlationCond.setCond0Category(condCateg[0]);
3081  correlationCond.setCond1Category(condCateg[1]);
3082 
3083  correlationCond.setCond0Index(corrIndexVal[0]);
3084  correlationCond.setCond1Index(corrIndexVal[1]);
3085 
3086  correlationCond.setCorrelationParameter(corrParameter);
3087 
3088  if (edm::isDebugEnabled() ) {
3089 
3090  std::ostringstream myCoutStream;
3091  correlationCond.print(myCoutStream);
3092  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n"
3093  << std::endl;
3094 
3095  }
3096 
3097  // insert condition into the map
3098  // condition is not duplicate, check was done at the beginning
3099 
3100  (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
3101 
3102  //
3103  return true;
3104 }
type
Definition: HCALResponse.h:21
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:39
static const std::string m_xmlTagDeltaPhi
static const std::string m_xmlConditionAttrObjectCenJet
Definition: L1GtObject.h:36
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
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
L1GtConditionType
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
static const std::string m_xmlConditionAttrObjectForJet
tuple node
Definition: Node.py:50
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:38
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 &quot;greater or equal flag&quot; 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
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 &quot;energy sum&quot; condition
static const std::string m_xmlTagPtHighThreshold
#define LogTrace(id)
static const std::string m_xmlConditionAttrObjectHTT
Definition: L1GtObject.h:30
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
static const std::string m_xmlConditionAttrObjectETM
Definition: L1GtObject.h:37
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
tuple size
Write out results.
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 1931 of file L1GtTriggerMenuXmlParser.cc.

References TauDecayModes::dec, ETM, ETT, findXMLChild(), getBitFromNode(), getConditionChildValues(), getGEqFlag(), getXMLAttribute(), getXMLHexTextValue(), getXMLHexTextValue128(), HTM, HTT, 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, L1GtEnergySumTemplate::print(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtEnergySumTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, TypeETM, TypeETT, TypeHTM, and TypeHTT.

Referenced by parseCorrelation(), and workCondition().

1933  {
1934 
1935  XERCES_CPP_NAMESPACE_USE
1936 
1937  // get condition, particle name and type name
1941 
1942  // determine object type type
1943  L1GtObject energySumObjType;
1944  L1GtConditionType cType;
1945 
1946  if ((particle == m_xmlConditionAttrObjectETM) && (type == m_xmlConditionAttrObjectETM)) {
1947 
1948  energySumObjType = ETM;
1949  cType = TypeETM;
1950 
1951  }
1952  else if ((particle == m_xmlConditionAttrObjectETT) && (type == m_xmlConditionAttrObjectETT)) {
1953 
1954  energySumObjType = ETT;
1955  cType = TypeETT;
1956 
1957  }
1958  else if ((particle == m_xmlConditionAttrObjectHTT) && (type == m_xmlConditionAttrObjectHTT)) {
1959 
1960  energySumObjType = HTT;
1961  cType = TypeHTT;
1962 
1963  }
1964  else if ((particle == m_xmlConditionAttrObjectHTM) && (type == m_xmlConditionAttrObjectHTM)) {
1965 
1966  energySumObjType = HTM;
1967  cType = TypeHTM;
1968 
1969  }
1970  else {
1971  edm::LogError("L1GtTriggerMenuXmlParser")
1972  << "Wrong particle or type for energy-sum condition (" << particle << ", " << type
1973  << ")" << std::endl;
1974  return false;
1975  }
1976 
1977  // global object
1978  int nrObj = 1;
1979 
1980  // get greater equal flag
1981 
1982  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
1983  if (intGEq < 0) {
1984  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
1985  << std::endl;
1986  return false;
1987  }
1988  // set the boolean value for the ge_eq mode
1989  bool gEq = (intGEq != 0);
1990 
1991  // get values
1992 
1993  // temporary storage of the parameters
1994  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(nrObj);
1995 
1996  // need at least two values for phi
1997  std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1998 
1999  // get etThreshold values and fill into structure
2000  if ( !getConditionChildValues(node, m_xmlTagEtThreshold, nrObj, tmpValues) ) {
2001  return false;
2002  }
2003 
2004  for (int i = 0; i < nrObj; i++) {
2005  objParameter[i].etThreshold = tmpValues[i];
2006 
2007  //LogTrace("L1GtTriggerMenuXmlParser")
2008  //<< " EnergySum ET high threshold (hex) for energySum object " << i << " = "
2009  //<< std::hex << objParameter[i].etThreshold << std::dec
2010  //<< std::endl;
2011 
2012  // for ETM and HTM read phi value
2013  // phi is larger than 64 bits for ETM - it needs two 64bits words
2014  // phi is less than 64 bits for HTM - it needs one 64bits word
2015  if (energySumObjType == ETM) {
2016 
2017  if (!getXMLHexTextValue128(
2018  findXMLChild(node->getFirstChild(), m_xmlTagPhi), tmpValues[0], tmpValues[1])) {
2019  edm::LogError("L1GtTriggerMenuXmlParser")
2020  << " Could not get phi for ETM condition (" << name << ")" << std::endl;
2021  return false;
2022  }
2023 
2024  objParameter[i].phiRange0Word = tmpValues[0];
2025  objParameter[i].phiRange1Word = tmpValues[1];
2026 
2027  } else if (energySumObjType == HTM) {
2028 
2029  if (!getXMLHexTextValue(findXMLChild(node->getFirstChild(), m_xmlTagPhi), tmpValues[0])) {
2030  edm::LogError("L1GtTriggerMenuXmlParser")
2031  << " Could not get phi for HTM condition (" << name << ")" << std::endl;
2032  return false;
2033  }
2034 
2035  objParameter[i].phiRange0Word = tmpValues[0];
2036 
2037  }
2038 
2039  // get energyOverflow logical flag and fill into structure
2040  DOMNode* n1;
2041  if ( (n1 = findXMLChild(node->getFirstChild(), m_xmlTagEtThreshold)) == 0) {
2042  edm::LogError("L1GtTriggerMenuXmlParser")
2043  << " Could not get energyOverflow for EnergySum condition (" << name << ")"
2044  << std::endl;
2045  return false;
2046  }
2047  if ( (n1 = findXMLChild(n1->getFirstChild(), m_xmlTagEnergyOverflow)) == 0) {
2048  edm::LogError("L1GtTriggerMenuXmlParser")
2049  << " Could not get energyOverflow for EnergySum condition (" << name << ")"
2050  << std::endl;
2051  return false;
2052  }
2053 
2054  int tmpInt = getBitFromNode(n1);
2055  if (tmpInt == 0) {
2056  objParameter[i].energyOverflow = false;
2057 
2058  //LogTrace("L1GtTriggerMenuXmlParser")
2059  //<< " EnergySum energyOverflow logical flag (hex) = "
2060  //<< std::hex << objParameter[i].energyOverflow << std::dec
2061  //<< std::endl;
2062  }
2063  else if (tmpInt == 1) {
2064  objParameter[i].energyOverflow = true;
2065 
2066  //LogTrace("L1GtTriggerMenuXmlParser")
2067  //<< " EnergySum energyOverflow logical flag (hex) = "
2068  //<< std::hex << objParameter[i].energyOverflow << std::dec
2069  //<< std::endl;
2070  }
2071  else {
2072  LogTrace("L1GtTriggerMenuXmlParser")
2073  << " EnergySum energyOverflow logical flag (hex) = " << std::hex << tmpInt
2074  << std::dec << " - wrong value! " << std::endl;
2075  return false;
2076  }
2077 
2078  }
2079 
2080  // object types - all same energySumObjType
2081  std::vector<L1GtObject> objType(nrObj, energySumObjType);
2082 
2083  // now create a new energySum condition
2084 
2085  L1GtEnergySumTemplate energySumCond(name);
2086 
2087  energySumCond.setCondType(cType);
2088  energySumCond.setObjectType(objType);
2089  energySumCond.setCondGEq(gEq);
2090  energySumCond.setCondChipNr(chipNr);
2091 
2092  energySumCond.setConditionParameter(objParameter);
2093 
2094  if (edm::isDebugEnabled() ) {
2095 
2096  std::ostringstream myCoutStream;
2097  energySumCond.print(myCoutStream);
2098  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2099 
2100  }
2101 
2102  // insert condition into the map
2103  if ( !insertConditionIntoMap(energySumCond, chipNr)) {
2104 
2105  edm::LogError("L1GtTriggerMenuXmlParser")
2106  << " Error: duplicate condition (" << name << ")"
2107  << std::endl;
2108 
2109  return false;
2110  }
2111  else {
2112 
2113  if (corrFlag) {
2114  (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2115 
2116  }
2117  else {
2118  (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2119  }
2120 
2121  }
2122 
2123 
2124  //
2125  return true;
2126 }
int getBitFromNode(XERCES_CPP_NAMESPACE::DOMNode *node)
get bit from a bit node
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< boost::uint64_t > &dst)
get values from a child of a condition
Definition: L1GtObject.h:39
Definition: L1GtObject.h:36
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
Definition: L1GtObject.h:38
static const std::string m_xmlConditionAttrObjectHTM
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the &quot;greater or equal flag&quot; from a condition
bool getXMLHexTextValue(XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dst)
get a hexadecimal value of a xml node containing text
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
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
static const std::string m_xmlTagEnergyOverflow
#define LogTrace(id)
static const std::string m_xmlConditionAttrObjectHTT
static const std::string m_xmlConditionAttrObjectETM
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
Definition: L1GtObject.h:37
static const std::string m_xmlConditionAttrObjectETT
bool getXMLHexTextValue128(XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dstL, boost::uint64_t &dstH)
get a hexadecimal value of a xml node containing text with up to 128 bit
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 2719 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workCondition().

2720  {
2721 
2722  XERCES_CPP_NAMESPACE_USE
2723 
2724  // get condition, particle name and type name
2728 
2729  if (particle != m_xmlConditionAttrObjectGtExternal) {
2730  edm::LogError("L1GtTriggerMenuXmlParser")
2731  << "\nError: wrong particle for External condition ("
2732  << particle << ")" << std::endl;
2733  return false;
2734  }
2735 
2736  // object type and condition type
2737  // object type - irrelevant for External conditions
2739 
2740  // no objects for External conditions
2741 
2742  // set the boolean value for the ge_eq mode - irrelevant for External conditions
2743  bool gEq = false;
2744 
2745  // now create a new External condition
2746 
2747  L1GtExternalTemplate externalCond(name);
2748 
2749  externalCond.setCondType(cType);
2750  externalCond.setCondGEq(gEq);
2751  externalCond.setCondChipNr(chipNr);
2752 
2753  LogTrace("L1GtTriggerMenuXmlParser") << externalCond << "\n" << std::endl;
2754 
2755  // insert condition into the map
2756  if ( !insertConditionIntoMap(externalCond, chipNr)) {
2757 
2758  edm::LogError("L1GtTriggerMenuXmlParser")
2759  << " Error: duplicate condition (" << name
2760  << ")" << std::endl;
2761 
2762  return false;
2763  } else {
2764 
2765  (m_vecExternalTemplate[chipNr]).push_back(externalCond);
2766 
2767  }
2768 
2769 
2770  //
2771  return true;
2772 }
type
Definition: HCALResponse.h:21
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
tuple node
Definition: Node.py:50
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
#define LogTrace(id)
static const std::string m_xmlConditionAttrObjectGtExternal
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 2388 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workCondition().

2389  {
2390 
2391  XERCES_CPP_NAMESPACE_USE
2392 
2393  // get condition, particle name and type name
2397 
2398  if (particle != m_xmlConditionAttrObjectHfBitCounts) {
2399  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for HfBitCounts condition ("
2400  << particle << ")" << std::endl;
2401  return false;
2402  }
2403 
2404  // object type and condition type
2405  L1GtObject hfBitCountsObjType = HfBitCounts;
2407 
2408  // global object
2409  int nrObj = 1;
2410 
2411  // get greater equal flag
2412 
2413  int intGEq = getGEqFlag(node, m_xmlTagCountThreshold);
2414  if (intGEq < 0) {
2415  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2416  << std::endl;
2417  return false;
2418  }
2419  // set the boolean value for the ge_eq mode
2420  bool gEq = (intGEq != 0);
2421 
2422  // get values
2423 
2424  // temporary storage of the parameters
2425  std::vector<L1GtHfBitCountsTemplate::ObjectParameter> objParameter(nrObj);
2426 
2427  // get countIndex value and fill into structure
2428  // they are expressed in base 10
2429  char* endPtr = nullptr;
2430  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2431 
2432  if (*endPtr != 0) {
2433 
2434  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << type << " to dec."
2435  << std::endl;
2436 
2437  return false;
2438  }
2439 
2440  // test if count index is out of range FIXME introduce m_numberL1HfBitCounts?
2441  //if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1HfBitCounts))) {
2442  // LogDebug("L1GtTriggerMenuXmlParser") << "Count index " << typeInt
2443  // << " outside range [0, " << m_numberL1HfBitCounts << "]" << std::endl;
2444  //
2445  // return false;
2446  //}
2447 
2448  objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
2449 
2450  // get count threshold values and fill into structure
2451  std::vector<boost::uint64_t> tmpValues(nrObj);
2452 
2453  if ( !getConditionChildValues(node, m_xmlTagCountThreshold, nrObj, tmpValues) ) {
2454  return false;
2455  }
2456 
2457  for (int i = 0; i < nrObj; i++) {
2458  objParameter[i].countThreshold = tmpValues[i];
2459 
2460  //LogTrace("L1GtTriggerMenuXmlParser")
2461  //<< " HfBitCounts count threshold (hex) for HfBitCounts object " << i << " = "
2462  //<< std::hex << objParameter[i].countThreshold << std::dec
2463  //<< std::endl;
2464 
2465  }
2466 
2467  // object types - all same objType
2468  std::vector<L1GtObject> objType(nrObj, hfBitCountsObjType);
2469 
2470  // now create a new HfBitCounts condition
2471 
2472  L1GtHfBitCountsTemplate hfBitCountsCond(name);
2473 
2474  hfBitCountsCond.setCondType(cType);
2475  hfBitCountsCond.setObjectType(objType);
2476  hfBitCountsCond.setCondGEq(gEq);
2477  hfBitCountsCond.setCondChipNr(chipNr);
2478 
2479  hfBitCountsCond.setConditionParameter(objParameter);
2480 
2481  if (edm::isDebugEnabled() ) {
2482 
2483  std::ostringstream myCoutStream;
2484  hfBitCountsCond.print(myCoutStream);
2485  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2486 
2487  }
2488 
2489  // insert condition into the map
2490  if ( !insertConditionIntoMap(hfBitCountsCond, chipNr)) {
2491 
2492  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name
2493  << ")" << std::endl;
2494 
2495  return false;
2496  } else {
2497 
2498  (m_vecHfBitCountsTemplate[chipNr]).push_back(hfBitCountsCond);
2499 
2500  }
2501 
2502 
2503  //
2504  return true;
2505 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< boost::uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
tuple node
Definition: Node.py:50
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the &quot;greater or equal flag&quot; 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
#define LogTrace(id)
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 2520 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workCondition().

2521  {
2522 
2523  XERCES_CPP_NAMESPACE_USE
2524 
2525  // get condition, particle name and type name
2529 
2530  if (particle != m_xmlConditionAttrObjectHfRingEtSums) {
2531  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for HfRingEtSums condition ("
2532  << particle << ")" << std::endl;
2533  return false;
2534  }
2535 
2536  // object type and condition type
2537  L1GtObject hfRingEtSumsObjType = HfRingEtSums;
2539 
2540  // global object
2541  int nrObj = 1;
2542 
2543  // get greater equal flag
2544 
2545  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
2546  if (intGEq < 0) {
2547  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2548  << std::endl;
2549  return false;
2550  }
2551  // set the boolean value for the ge_eq mode
2552  bool gEq = (intGEq != 0);
2553 
2554  // get values
2555 
2556  // temporary storage of the parameters
2557  std::vector<L1GtHfRingEtSumsTemplate::ObjectParameter> objParameter(nrObj);
2558 
2559  // get etSumIndex value and fill into structure
2560  // they are expressed in base 10
2561  char* endPtr = nullptr;
2562  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2563 
2564  if (*endPtr != 0) {
2565 
2566  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << type << " to dec."
2567  << std::endl;
2568 
2569  return false;
2570  }
2571 
2572  // test if ET sum index is out of range FIXME introduce m_numberL1HfRingEtSums?
2573  //if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1HfRingEtSums))) {
2574  // LogDebug("L1GtTriggerMenuXmlParser") << "Count index " << typeInt
2575  // << " outside range [0, " << m_numberL1HfRingEtSums << "]" << std::endl;
2576  //
2577  // return false;
2578  //}
2579 
2580  objParameter[0].etSumIndex = static_cast<unsigned int>(typeInt);
2581 
2582  // get ET sum threshold values and fill into structure
2583  std::vector<boost::uint64_t> tmpValues(nrObj);
2584 
2585  if ( !getConditionChildValues(node, m_xmlTagEtThreshold, nrObj, tmpValues) ) {
2586  return false;
2587  }
2588 
2589  for (int i = 0; i < nrObj; i++) {
2590  objParameter[i].etSumThreshold = tmpValues[i];
2591 
2592  //LogTrace("L1GtTriggerMenuXmlParser")
2593  //<< " HfRingEtSums count threshold (hex) for HfRingEtSums object " << i << " = "
2594  //<< std::hex << objParameter[i].etSumThreshold << std::dec
2595  //<< std::endl;
2596 
2597  }
2598 
2599  // object types - all same objType
2600  std::vector<L1GtObject> objType(nrObj, hfRingEtSumsObjType);
2601 
2602  // now create a new HfRingEtSums condition
2603 
2604  L1GtHfRingEtSumsTemplate hfRingEtSumsCond(name);
2605 
2606  hfRingEtSumsCond.setCondType(cType);
2607  hfRingEtSumsCond.setObjectType(objType);
2608  hfRingEtSumsCond.setCondGEq(gEq);
2609  hfRingEtSumsCond.setCondChipNr(chipNr);
2610 
2611  hfRingEtSumsCond.setConditionParameter(objParameter);
2612 
2613  if (edm::isDebugEnabled() ) {
2614 
2615  std::ostringstream myCoutStream;
2616  hfRingEtSumsCond.print(myCoutStream);
2617  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2618 
2619  }
2620 
2621  // insert condition into the map
2622  if ( !insertConditionIntoMap(hfRingEtSumsCond, chipNr)) {
2623 
2624  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name
2625  << ")" << std::endl;
2626 
2627  return false;
2628  } else {
2629 
2630  (m_vecHfRingEtSumsTemplate[chipNr]).push_back(hfRingEtSumsCond);
2631 
2632  }
2633 
2634 
2635  //
2636  return true;
2637 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< boost::uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlConditionAttrObjectHfRingEtSums
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlTagEtThreshold
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
tuple node
Definition: Node.py:50
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the &quot;greater or equal flag&quot; 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
#define LogTrace(id)
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
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 3114 of file L1GtTriggerMenuXmlParser.cc.

References 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, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by workXML().

3114  {
3115 
3116  XERCES_CPP_NAMESPACE_USE
3117 
3118  DOMNode* doc = parser->getDocument();
3119  DOMNode* n1 = doc->getFirstChild();
3120 
3121  // we assume that the first child is m_xmlTagDef because it was checked in workXML
3122 
3123  DOMNode* headerNode = n1->getFirstChild();
3124  if (headerNode == 0) {
3125  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No child of <" << m_xmlTagDef
3126  << "> tag found." << std::endl;
3127  return false;
3128  }
3129 
3130  headerNode = findXMLChild(headerNode, m_xmlTagHeader);
3131  if (headerNode == 0) {
3132 
3133  LogDebug("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagHeader
3134  << "> tag" << "\n - No header information." << std::endl;
3135 
3136  } else {
3137 
3138  DOMNode* idNode = headerNode->getFirstChild();
3139 
3140  // find menu interface name
3141  idNode = findXMLChild(idNode, m_xmlTagMenuInterface);
3142  if (idNode == 0) {
3143 
3144  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3145  << m_xmlTagMenuInterface << "> tag"
3146  << "\n - Trigger menu interface name derived from file name." << std::endl;
3147 
3148  // set the name of the trigger menu interface: from beginning of file names
3149  // until beginning of "_L1T_Scales"
3150  size_t xmlPos = m_triggerMenuName.find("_L1T_Scales", 0);
3151  if (xmlPos == std::string::npos) {
3152  LogTrace("L1GtTriggerMenuXmlParser")
3153  << "\n Warning: Could not find \"_L1T_Scales\" " << "string in file name"
3154  << "\n - Trigger menu interface name set to file name." << std::endl;
3156 
3157  } else {
3159  m_triggerMenuInterface.erase(
3160  m_triggerMenuInterface.begin(), m_triggerMenuInterface.begin() + xmlPos);
3161  }
3162 
3163  } else {
3165  }
3166 
3167  // find menu interface creation date
3168  idNode = headerNode->getFirstChild();
3169  idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceDate);
3170 
3171  if (idNode == 0) {
3172 
3173  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3174  << m_xmlTagMenuInterfaceDate << "> tag" << "\n - No creation date."
3175  << m_triggerMenuInterfaceDate << std::endl;
3176 
3177  } else {
3178 
3180  }
3181 
3182  // find menu interface creation author
3183  idNode = headerNode->getFirstChild();
3184  idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceAuthor);
3185 
3186  if (idNode == 0) {
3187 
3188  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3189  << m_xmlTagMenuInterfaceAuthor << "> tag" << "\n - No creation author."
3190  << m_triggerMenuInterfaceAuthor << std::endl;
3191 
3192  } else {
3193 
3195  }
3196 
3197  // find menu interface description
3198  idNode = headerNode->getFirstChild();
3200 
3201  if (idNode == 0) {
3202 
3203  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3204  << m_xmlTagMenuInterfaceDescription << "> tag" << "\n - No description."
3205  << m_triggerMenuInterfaceDescription << std::endl;
3206 
3207  } else {
3208 
3210  }
3211 
3212  // find menu creation date
3213  idNode = headerNode->getFirstChild();
3214  idNode = findXMLChild(idNode, m_xmlTagMenuDate);
3215 
3216  if (idNode == 0) {
3217 
3218  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3219  << m_xmlTagMenuDate << "> tag" << "\n - No creation date."
3220  << m_triggerMenuDate << std::endl;
3221 
3222  } else {
3223 
3225  }
3226 
3227  // find menu creation author
3228  idNode = headerNode->getFirstChild();
3229  idNode = findXMLChild(idNode, m_xmlTagMenuAuthor);
3230 
3231  if (idNode == 0) {
3232 
3233  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3234  << m_xmlTagMenuAuthor << "> tag" << "\n - No creation author."
3235  << m_triggerMenuAuthor << std::endl;
3236 
3237  } else {
3238 
3240  }
3241 
3242  // find menu description
3243  idNode = headerNode->getFirstChild();
3244  idNode = findXMLChild(idNode, m_xmlTagMenuDescription);
3245 
3246  if (idNode == 0) {
3247 
3248  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3249  << m_xmlTagMenuDescription << "> tag" << "\n - No description."
3250  << m_triggerMenuDescription << std::endl;
3251 
3252  } else {
3253 
3255  }
3256 
3257  // find algorithm implementation tag
3258 
3259  idNode = headerNode->getFirstChild();
3260 
3261  idNode = findXMLChild(idNode, m_xmlTagMenuAlgImpl);
3262  if (idNode == 0) {
3263 
3265  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3266  << m_xmlTagMenuAlgImpl << "> tag"
3267  << "\n - Algorithm implementation tag set to empty string." << std::endl;
3268 
3269  } else {
3270 
3272  }
3273 
3274  // find DB key for L1 scales
3275 
3276  idNode = headerNode->getFirstChild();
3277 
3278  idNode = findXMLChild(idNode, m_xmlTagScaleDbKey);
3279  if (idNode == 0) {
3280 
3281  m_scaleDbKey = "NULL";
3282  LogTrace("L1GtTriggerMenuXmlParser") << "\n Warning: Could not find <"
3283  << m_xmlTagScaleDbKey << "> tag" << "\n - Scale key set to " << m_scaleDbKey
3284  << " string." << std::endl;
3285 
3286  } else {
3287  m_scaleDbKey = getXMLTextValue(idNode);
3288  }
3289 
3290  }
3291 
3292  LogDebug("L1GtTriggerMenuXmlParser")
3293  << "\n Parsed values from XML file"
3294  << "\nL1 MenuInterface: " << m_triggerMenuInterface
3295  << "\nL1 MenuInterface - Creation date: " << m_triggerMenuInterfaceDate
3296  << "\nL1 MenuInterface - Creation author: " << m_triggerMenuInterfaceAuthor
3297  << "\nL1 MenuInterface - Description: " << m_triggerMenuInterfaceDescription
3298  << "\n"
3299  << "\nAlgorithm implementation tag: " << m_algorithmImplementation
3300  << "\n"
3301  << "\nL1 Menu - Creation date: " << m_triggerMenuDate
3302  << "\nL1 Menu - Creation author: " << m_triggerMenuAuthor
3303  << "\nL1 Menu - Description: " << m_triggerMenuDescription
3304  << std::endl;
3305 
3306 
3307  // set the trigger menu name
3308  // format:
3309  // L1MenuInterface/ScaleDbKey/AlgorithmImplementationTag
3310 
3312 
3313  if (menuName != m_triggerMenuName) {
3314 
3315  LogDebug("L1GtTriggerMenuXmlParser") << "\n Warning: Inconsistent L1 menu name:"
3316  << "\n from XML file name: " << m_triggerMenuName
3317  << "\n from XML tag: " << menuName << std::endl;
3318 
3319  if (m_triggerMenuInterface != "") {
3320  if (m_scaleDbKey == "NULL") {
3322  } else {
3323  m_triggerMenuName = menuName;
3324  }
3325 
3326  LogTrace("L1GtTriggerMenuXmlParser") << "\n L1 menu name set to value from XML tag!"
3327  << "\n L1 Menu name: " << m_triggerMenuName << std::endl;
3328 
3329  } else {
3330  LogTrace("L1GtTriggerMenuXmlParser") << "\n L1 menu name set to file name!"
3331  << "\n L1 Menu name: " << m_triggerMenuName << std::endl;
3332 
3333  }
3334  }
3335 
3336  //
3337  return true;
3338 }
#define LogDebug(id)
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
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
static const std::string m_xmlTagMenuInterfaceAuthor
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
std::string m_scaleDbKey
menu associated scale key
static const std::string m_xmlTagMenuDate
std::string m_triggerMenuInterface
menu names
#define LogTrace(id)
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
static const std::string m_xmlTagMenuInterfaceDescription
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 2140 of file L1GtTriggerMenuXmlParser.cc.

References getConditionChildValues(), getGEqFlag(), getXMLAttribute(), 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, L1GtJetCountsTemplate::print(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtJetCountsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeJetCounts.

Referenced by workCondition().

2141  {
2142 
2143  XERCES_CPP_NAMESPACE_USE
2144 
2145  // get condition, particle name and type name
2149 
2150  if (particle != m_xmlConditionAttrObjectJetCounts) {
2151  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for JetCounts condition ("
2152  << particle << ")" << std::endl;
2153  return false;
2154  }
2155 
2156  // object type and condition type
2157  L1GtObject jetCountsObjType = JetCounts;
2159 
2160  // global object
2161  int nrObj = 1;
2162 
2163  // get greater equal flag
2164 
2165  int intGEq = getGEqFlag(node, m_xmlTagCountThreshold);
2166  if (intGEq < 0) {
2167  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2168  << std::endl;
2169  return false;
2170  }
2171  // set the boolean value for the ge_eq mode
2172  bool gEq = (intGEq != 0);
2173 
2174  // get values
2175 
2176  // temporary storage of the parameters
2177  std::vector<L1GtJetCountsTemplate::ObjectParameter> objParameter(nrObj);
2178 
2179  // get countIndex value and fill into structure
2180  // they are expressed in base 10 (values: 0 - m_numberL1JetCounts)
2181  char* endPtr = nullptr;
2182  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2183 
2184  if (*endPtr != 0) {
2185 
2186  LogDebug("L1GtTriggerMenuXmlParser") << "Unable to convert " << type << " to dec."
2187  << std::endl;
2188 
2189  return false;
2190  }
2191 
2192  // test if count index is out of range
2193  if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1JetCounts))) {
2194  LogDebug("L1GtTriggerMenuXmlParser") << "Count index " << typeInt
2195  << " outside range [0, " << m_numberL1JetCounts << "]" << std::endl;
2196 
2197  return false;
2198  }
2199 
2200  objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
2201 
2202  // get count threshold values and fill into structure
2203  std::vector<boost::uint64_t> tmpValues(nrObj);
2204 
2205  if ( !getConditionChildValues(node, m_xmlTagCountThreshold, nrObj, tmpValues) ) {
2206  return false;
2207  }
2208 
2209  for (int i = 0; i < nrObj; i++) {
2210  objParameter[i].countThreshold = tmpValues[i];
2211 
2212  //LogTrace("L1GtTriggerMenuXmlParser")
2213  //<< " JetCounts count threshold (hex) for JetCounts object " << i << " = "
2214  //<< std::hex << objParameter[i].countThreshold << std::dec
2215  //<< std::endl;
2216 
2217  // TODO FIXME un-comment when tag available in XML file
2218 
2219  // // get countOverflow logical flag and fill into structure
2220  // DOMNode* n1;
2221  // if ( (n1 = findXMLChild(node->getFirstChild(), m_xmlTagCountThreshold)) == 0) {
2222  // edm::LogError("L1GtTriggerMenuXmlParser")
2223  // << " Could not get countOverflow for JetCounts condition ("
2224  // << name << ")"
2225  // << std::endl;
2226  // return false;
2227  // }
2228  // if ( (n1 = findXMLChild(n1->getFirstChild(), m_xmlTagCountThreshold)) == 0) {
2229  // edm::LogError("L1GtTriggerMenuXmlParser")
2230  // << " Could not get countOverflow for JetCounts condition ("
2231  // << name << ")"
2232  // << std::endl;
2233  // return false;
2234  // }
2235  //
2236  // int tmpInt = getBitFromNode(n1);
2237  // if (tmpInt == 0) {
2238  // objParameter[i].countOverflow = false;
2239  //
2240  // LogTrace("L1GtTriggerMenuXmlParser")
2241  // << " JetCounts countOverflow logical flag (hex) = "
2242  // << std::hex << objParameter[i].countOverflow << std::dec
2243  // << std::endl;
2244  // } else if (tmpInt == 1) {
2245  // objParameter[i].countOverflow = true;
2246  //
2247  // LogTrace("L1GtTriggerMenuXmlParser")
2248  // << " JetCounts countOverflow logical flag (hex) = "
2249  // << std::hex << objParameter[i].countOverflow << std::dec
2250  // << std::endl;
2251  // } else {
2252  // LogTrace("L1GtTriggerMenuXmlParser")
2253  // << " JetCounts countOverflow logical flag (hex) = "
2254  // << std::hex << tmpInt << std::dec << " - wrong value! "
2255  // << std::endl;
2256  // return false;
2257  // }
2258 
2259  }
2260 
2261  // object types - all same objType
2262  std::vector<L1GtObject> objType(nrObj, jetCountsObjType);
2263 
2264  // now create a new JetCounts condition
2265 
2266  L1GtJetCountsTemplate jetCountsCond(name);
2267 
2268  jetCountsCond.setCondType(cType);
2269  jetCountsCond.setObjectType(objType);
2270  jetCountsCond.setCondGEq(gEq);
2271  jetCountsCond.setCondChipNr(chipNr);
2272 
2273  jetCountsCond.setConditionParameter(objParameter);
2274 
2275  if (edm::isDebugEnabled() ) {
2276 
2277  std::ostringstream myCoutStream;
2278  jetCountsCond.print(myCoutStream);
2279  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2280 
2281  }
2282 
2283  // insert condition into the map
2284  if ( !insertConditionIntoMap(jetCountsCond, chipNr)) {
2285 
2286  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: duplicate condition (" << name
2287  << ")" << std::endl;
2288 
2289  return false;
2290  } else {
2291 
2292  (m_vecJetCountsTemplate[chipNr]).push_back(jetCountsCond);
2293 
2294  }
2295 
2296 
2297  //
2298  return true;
2299 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< boost::uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
tuple node
Definition: Node.py:50
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the &quot;greater or equal flag&quot; 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
#define LogTrace(id)
static const std::string m_xmlConditionAttrObjectJetCounts
unsigned int m_numberL1JetCounts
jet counts
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 1438 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(), 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, L1GtMuonTemplate::print(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtMuonTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), AlCaHLTBitMon_QueryRunRegistry::string, and TypeNull.

Referenced by parseCorrelation(), and workCondition().

1439  {
1440 
1441  XERCES_CPP_NAMESPACE_USE
1442 
1443  // get condition, particle name (must be muon) and type name
1447 
1448  if (particle != m_xmlConditionAttrObjectMu) {
1449  edm::LogError("L1GtTriggerMenuXmlParser") << "Wrong particle for muon-condition ("
1450  << particle << ")" << std::endl;
1451  return false;
1452  }
1453 
1454  int nrObj = getNumFromType(type);
1455  if (nrObj < 0) {
1456  edm::LogError("L1GtTriggerMenuXmlParser") << "Unknown type for muon-condition (" << type
1457  << ")" << "\nCan not determine number of trigger objects. " << std::endl;
1458  return false;
1459  }
1460 
1461  // get greater equal flag
1462 
1463  int intGEq = getGEqFlag(node, m_xmlTagPtHighThreshold);
1464  if (intGEq < 0) {
1465  edm::LogError("L1GtTriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
1466  << std::endl;
1467  return false;
1468  }
1469  // set the boolean value for the ge_eq mode
1470  bool gEq = (intGEq != 0);
1471 
1472  // get values
1473 
1474  // temporary storage of the parameters
1475  std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(nrObj);
1477 
1478  // need at least two values for deltaPhi
1479  std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1480 
1481  // get ptHighThreshold values and fill into structure
1482  if ( !getConditionChildValues(node, m_xmlTagPtHighThreshold, nrObj, tmpValues) ) {
1483  return false;
1484  }
1485 
1486  for (int i = 0; i < nrObj; i++) {
1487  objParameter[i].ptHighThreshold = tmpValues[i];
1488 
1489  //LogTrace("L1GtTriggerMenuXmlParser")
1490  //<< " Muon pT high threshold (hex) for muon " << i << " = "
1491  //<< std::hex << objParameter[i].ptHighThreshold << std::dec
1492  //<< std::endl;
1493  }
1494 
1495  // get ptLowThreshold values and fill into structure
1496  if ( !getConditionChildValues(node, m_xmlTagPtLowThreshold, nrObj, tmpValues) ) {
1497  return false;
1498  }
1499 
1500  for (int i = 0; i < nrObj; i++) {
1501  //LogTrace("L1GtTriggerMenuXmlParser")
1502  //<< " Muon pT low threshold word (hex) for muon " << i << " = "
1503  //<< std::hex << tmpValues[i] << std::dec
1504  //<< std::endl;
1505 
1506  // TODO FIXME stupid format in def.xml...
1507  // one takes mip bit also, therefore one divide by 16
1508  tmpValues[i] = (tmpValues[i])/16;
1509 
1510  objParameter[i].ptLowThreshold = tmpValues[i];
1511 
1512  //LogTrace("L1GtTriggerMenuXmlParser")
1513  //<< " Muon pT low threshold (hex) for muon " << i << " = "
1514  //<< std::hex << objParameter[i].ptLowThreshold << std::dec
1515  //<< std::endl;
1516  }
1517 
1518  // get qualityRange and fill into structure
1519  if ( !getConditionChildValues(node, m_xmlTagQuality, nrObj, tmpValues) ) {
1520  return false;
1521  }
1522 
1523  for (int i = 0; i < nrObj; i++) {
1524  objParameter[i].qualityRange = tmpValues[i];
1525 
1526  //LogTrace("L1GtTriggerMenuXmlParser")
1527  //<< " qualityRange mask (hex) for muon " << i << " = "
1528  //<< std::hex << objParameter[i].qualityRange << std::dec
1529  //<< std::endl;
1530  }
1531 
1532  // get etaRange and fill into structure
1533  if ( !getConditionChildValues(node, m_xmlTagEta, nrObj, tmpValues) ) {
1534  return false;
1535  }
1536 
1537  for (int i = 0; i < nrObj; i++) {
1538 
1539  objParameter[i].etaRange = tmpValues[i];
1540 
1541  //LogTrace("L1GtTriggerMenuXmlParser")
1542  //<< " etaRange (hex) for muon " << i << " = "
1543  //<< std::hex << objParameter[i].etaRange << std::dec
1544  //<< std::endl;
1545  }
1546 
1547  // get phiHigh values and fill into structure
1548  if ( !getConditionChildValues(node, m_xmlTagPhiHigh, nrObj, tmpValues) ) {
1549  return false;
1550  }
1551 
1552  for (int i = 0; i < nrObj; i++) {
1553  objParameter[i].phiHigh = tmpValues[i];
1554 
1555  //LogTrace("L1GtTriggerMenuXmlParser")
1556  //<< " phiHigh (hex) for muon " << i << " = "
1557  //<< std::hex << objParameter[i].phiHigh << std::dec
1558  //<< std::endl;
1559  }
1560 
1561  // get phiLow values and fill into structure
1562  if ( !getConditionChildValues(node, m_xmlTagPhiLow, nrObj, tmpValues) ) {
1563  return false;
1564  }
1565 
1566  for (int i = 0; i < nrObj; i++) {
1567  objParameter[i].phiLow = tmpValues[i];
1568 
1569  //LogTrace("L1GtTriggerMenuXmlParser")
1570  //<< " phiLow (hex) for muon " << i << " = "
1571  //<< std::hex << objParameter[i].phiLow << std::dec
1572  //<< std::endl;
1573  }
1574 
1575  // get charge correlation and fill into structure
1577  tmpValues[0]) ) {
1578 
1579  LogDebug("L1GtTriggerMenuXmlParser")
1580  << " Error getting charge correlation from muon condition (" << name << ")"
1581  << std::endl;
1582  return false;
1583  }
1584 
1585  corrParameter.chargeCorrelation = tmpValues[0];
1586 
1587  //LogTrace("L1GtTriggerMenuXmlParser")
1588  //<< " charge correlation" << " = "
1589  //<< std::hex << corrParameter.chargeCorrelation << std::dec
1590  //<< std::endl;
1591 
1592  // get mip and iso bits and fill into structure
1593 
1594  std::vector<bool> tmpMip(nrObj);
1595  std::vector<bool> tmpEnableIso(nrObj);
1596  std::vector<bool> tmpRequestIso(nrObj);
1597 
1598  if ( !getMuonMipIsoBits(node, nrObj, tmpMip, tmpEnableIso, tmpRequestIso) ) {
1599  edm::LogError("L1GtTriggerMenuXmlParser")
1600  << " Could not get mip and iso bits from muon condition (" << name << ")"
1601  << std::endl;
1602  return false;
1603  }
1604 
1605  for (int i = 0; i < nrObj; i++) {
1606  objParameter[i].enableMip = tmpMip[i];
1607  objParameter[i].enableIso = tmpEnableIso[i];
1608  objParameter[i].requestIso = tmpRequestIso[i];
1609  }
1610 
1611  // indicates if a correlation is used
1612  bool wscVal = (type == m_xmlConditionAttrType2wsc );
1613 
1614  if (wscVal) {
1615  // get deltaEtaRange
1616  if ( !getConditionChildValues(node, m_xmlTagDeltaEta, 1, tmpValues) ) {
1617  return false;
1618  }
1619 
1620  corrParameter.deltaEtaRange = tmpValues[0];
1621 
1622  // deltaPhi is larger than 64bit
1623  if ( !getXMLHexTextValue128(findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi),
1624  tmpValues[0], tmpValues[1])) {
1625  edm::LogError("L1GtTriggerMenuXmlParser")
1626  << " Could not get deltaPhi for muon condition with wsc (" << name << ")"
1627  << std::endl;
1628  return false;
1629  }
1630 
1631  corrParameter.deltaPhiRange0Word = tmpValues[0];
1632  corrParameter.deltaPhiRange1Word = tmpValues[1];
1633 
1634  // get maximum number of bits for delta phi
1635  //LogTrace("L1GtTriggerMenuXmlParser")
1636  //<< " Counting deltaPhiMaxbits"
1637  //<< std::endl;
1638 
1639  unsigned int maxbits;
1640 
1641  if ( !countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits) ) {
1642  return false;
1643  }
1644 
1645  corrParameter.deltaPhiMaxbits = maxbits;
1646  //LogTrace("L1GtTriggerMenuXmlParser")
1647  //<< " deltaPhiMaxbits (dec) = " << maxbits
1648  //<< std::endl;
1649  }
1650 
1651  // get the type of the condition, as defined in enum, from the condition type
1652  // as defined in the XML file
1653  L1GtConditionType cType = getTypeFromType(type);
1654  //LogTrace("L1GtTriggerMenuXmlParser")
1655  //<< " Condition type (enum value) = " << cType
1656  //<< std::endl;
1657 
1658  if (cType == TypeNull) {
1659  edm::LogError("L1GtTriggerMenuXmlParser")
1660  << "Type for muon condition id TypeNull - it means not defined in the XML file."
1661  << "\nNumber of trigger objects is set to zero. " << std::endl;
1662  return false;
1663  }
1664 
1665  // object types - all muons
1666  std::vector<L1GtObject> objType(nrObj, Mu);
1667 
1668  // now create a new CondMuonition
1669 
1670  L1GtMuonTemplate muonCond(name);
1671 
1672  muonCond.setCondType(cType);
1673  muonCond.setObjectType(objType);
1674  muonCond.setCondGEq(gEq);
1675  muonCond.setCondChipNr(chipNr);
1676 
1677  muonCond.setConditionParameter(objParameter, corrParameter);
1678 
1679  if (edm::isDebugEnabled() ) {
1680  std::ostringstream myCoutStream;
1681  muonCond.print(myCoutStream);
1682  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
1683  }
1684 
1685  // insert condition into the map and into muon template vector
1686  if ( !insertConditionIntoMap(muonCond, chipNr)) {
1687 
1688  edm::LogError("L1GtTriggerMenuXmlParser")
1689  << " Error: duplicate condition (" << name << ")"
1690  << std::endl;
1691  return false;
1692  }
1693  else {
1694  if (corrFlag) {
1695  (m_corMuonTemplate[chipNr]).push_back(muonCond);
1696 
1697  }
1698  else {
1699  (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1700  }
1701 
1702  }
1703 
1704  //
1705  return true;
1706 }
#define LogDebug(id)
static const std::string m_xmlTagEta
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
int i
Definition: DBlmapReader.cc:9
static const std::string m_xmlTagPhiLow
bool getConditionChildValues(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &childName, unsigned int num, std::vector< boost::uint64_t > &dst)
get values from a child of a condition
static const std::string m_xmlTagDeltaPhi
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
L1GtConditionType
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
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
tuple node
Definition: Node.py:50
int getGEqFlag(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &nodeName)
getGEqFlag - get the &quot;greater or equal flag&quot; from a condition
static const std::string m_xmlTagChargeCorrelation
bool getXMLHexTextValue(XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dst)
get a hexadecimal value of a xml node containing text
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
static const std::string m_xmlTagDeltaEta
static const std::string m_xmlTagPtHighThreshold
#define LogTrace(id)
static const std::string m_xmlTagPtLowThreshold
Definition: L1GtObject.h:30
static const std::string m_xmlConditionAttrObjectMu
int getNumFromType(const std::string &type)
get number of particles from condition type
static const std::string m_xmlTagQuality
bool getXMLHexTextValue128(XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dstL, boost::uint64_t &dstH)
get a hexadecimal value of a xml node containing text with up to 128 bit
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
bool L1GtTriggerMenuXmlParser::parseTechTriggers ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all algorithms

Definition at line 3806 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), L1GtXmlParserTags::m_xmlTagDef, L1GtXmlParserTags::m_xmlTagTechTriggers, python.Node::node, AlCaHLTBitMon_QueryRunRegistry::string, and workTechTrigger().

Referenced by workXML().

3806  {
3807 
3808  XERCES_CPP_NAMESPACE_USE
3809 
3810  //LogTrace("L1GtTriggerMenuXmlParser") << "\nParsing technical triggers" << std::endl;
3811 
3812  DOMNode* doc = parser->getDocument();
3813  DOMNode* node = doc->getFirstChild();
3814 
3815  DOMNode* algNode = node->getFirstChild();
3816  if (algNode == 0) {
3817  edm::LogError("L1GtTriggerMenuXmlParser")
3818  << " Error: No child found for " << m_xmlTagDef << std::endl;
3819  return false;
3820  }
3821 
3822  algNode = findXMLChild(algNode, m_xmlTagTechTriggers);
3823  if (algNode == 0) {
3824  edm::LogError("L1GtTriggerMenuXmlParser") << " Error: No <"
3825  << m_xmlTagTechTriggers << "> child found."
3826  << std::endl;
3827  return false;
3828  }
3829 
3830  // walk through technical triggers
3831  DOMNode* algNameNode = algNode->getFirstChild();
3832  std::string algNameNodeName;
3833  algNameNode = findXMLChild(algNameNode, "", true, &algNameNodeName);
3834 
3835  while (algNameNode != 0) {
3836  //LogTrace("L1GtTriggerMenuXmlParser")
3837  //<< " Found an technical trigger with name: " << algNameNodeName
3838  //<< std::endl;
3839 
3840  if ( !workTechTrigger(algNameNode, algNameNodeName)) {
3841  return false;
3842  }
3843 
3844  algNameNode = findXMLChild(algNameNode->getNextSibling(), "", true,
3845  &algNameNodeName);
3846 
3847  }
3848 
3849  return true;
3850 }
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
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
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 930 of file L1GtTriggerMenuXmlParser.cc.

References findXMLChild(), m_numberConditionChips, L1GtXmlParserTags::m_xmlTagChip, and L1GtXmlParserTags::m_xmlTagVme.

930  {
931 
932  XERCES_CPP_NAMESPACE_USE
933 
934  DOMDocument* doc = parser->getDocument();
935  DOMNode* n1 = doc->getFirstChild();
936 
937  if (n1 == 0) {
938 
939  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: Found no XML child" << std::endl;
940 
941  return false;
942  }
943 
944  // find "vme"-tag
945  n1 = findXMLChild(n1, m_xmlTagVme);
946  if (n1 == 0) {
947 
948  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: No vme tag found." << std::endl;
949  return false;
950  }
951 
952  n1 = n1->getFirstChild();
953 
954  unsigned int chipCounter = 0; // count chips
955 
956  while (chipCounter < m_numberConditionChips) {
957 
958  n1 = findXMLChild(n1, m_xmlTagChip, true);
959  if (n1 == 0) {
960  // just break if no more chips found
961  break;
962  }
963 
964  // node for a particle
965  //DOMNode* particleNode = n1->getFirstChild(); // FIXME un-comment
966 
967  // FIXME parse vme.xml, modify the menu
968 
969  n1 = n1->getNextSibling();
970  chipCounter++;
971  } // end while chipCounter
972 
973  return true;
974 
975 }
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=0)
find a named child of a xml node
unsigned int m_numberConditionChips
hardware limits
static const std::string m_xmlTagChip
void L1GtTriggerMenuXmlParser::parseXmlFile ( const std::string &  defXmlFile,
const std::string &  vmeXmlFile 
)

parse def.xml and vme.xml files

Definition at line 233 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, geometryXMLtoCSV::parser, and workXML().

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

234  {
235 
236  XERCES_CPP_NAMESPACE_USE
237 
238  // resize the vector of condition maps
239  // the number of condition chips should be correctly set before calling parseXmlFile
241 
251 
256 
257  // set the name of the trigger menu name:
258  // defXmlFile, stripped of absolute path and .xml
259  // will be overwritten by the value read from the xml file, with a warning if
260  // they are not the same
261  m_triggerMenuName = defXmlFile;
262  size_t xmlPos = m_triggerMenuName.find_last_of("/");
264  + xmlPos + 1);
265 
266  xmlPos = m_triggerMenuName.find_last_of(".");
267  m_triggerMenuName.erase(m_triggerMenuName.begin() + xmlPos, m_triggerMenuName.end());
268 
269  // error handler for xml-parser
270  m_xmlErrHandler = 0;
271 
272  XercesDOMParser* parser;
273 
274  LogTrace("L1GtTriggerMenuXmlParser") << "\nOpening XML-File: \n " << defXmlFile << std::endl;
275 
276  if ((parser = initXML(defXmlFile)) != 0) {
277  workXML(parser);
278  }
279  cleanupXML(parser);
280 
281 }
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
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
#define LogTrace(id)
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
void L1GtTriggerMenuXmlParser::setCorCaloTemplate ( const std::vector< std::vector< L1GtCaloTemplate > > &  corCaloTempl)

Definition at line 199 of file L1GtTriggerMenuXmlParser.cc.

References m_corCaloTemplate.

200  {
201 
202  m_corCaloTemplate = corCaloTempl;
203 }
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
void L1GtTriggerMenuXmlParser::setCorEnergySumTemplate ( const std::vector< std::vector< L1GtEnergySumTemplate > > &  corEnergySumTempl)

Definition at line 205 of file L1GtTriggerMenuXmlParser.cc.

References m_corEnergySumTemplate.

206  {
207 
208  m_corEnergySumTemplate = corEnergySumTempl;
209 }
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
void L1GtTriggerMenuXmlParser::setCorMuonTemplate ( const std::vector< std::vector< L1GtMuonTemplate > > &  corMuonTempl)

Definition at line 193 of file L1GtTriggerMenuXmlParser.cc.

References m_corMuonTemplate.

194  {
195 
196  m_corMuonTemplate = corMuonTempl;
197 }
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
void L1GtTriggerMenuXmlParser::setGtAlgorithmAliasMap ( const AlgorithmMap algoMap)

Definition at line 220 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmAliasMap.

220  {
221  m_algorithmAliasMap = algoMap;
222 }
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
void L1GtTriggerMenuXmlParser::setGtAlgorithmImplementation ( const std::string &  val)

Definition at line 322 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmImplementation.

322  {
323 
325 
326 }
void L1GtTriggerMenuXmlParser::setGtAlgorithmMap ( const AlgorithmMap algoMap)

Definition at line 215 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmMap.

215  {
216  m_algorithmMap = algoMap;
217 }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
void L1GtTriggerMenuXmlParser::setGtConditionMap ( const std::vector< ConditionMap > &  condMap)

Definition at line 108 of file L1GtTriggerMenuXmlParser.cc.

References m_conditionMap.

108  {
109  m_conditionMap = condMap;
110 }
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
void L1GtTriggerMenuXmlParser::setGtNumberConditionChips ( const unsigned int &  numberConditionChipsValue)

Definition at line 60 of file L1GtTriggerMenuXmlParser.cc.

References m_numberConditionChips.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

61  {
62 
63  m_numberConditionChips = numberConditionChipsValue;
64 
65 }
unsigned int m_numberConditionChips
hardware limits
void L1GtTriggerMenuXmlParser::setGtNumberL1JetCounts ( const unsigned int &  numberL1JetCountsValue)

Definition at line 100 of file L1GtTriggerMenuXmlParser.cc.

References m_numberL1JetCounts.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

100  {
101 
102  m_numberL1JetCounts = numberL1JetCountsValue;
103 
104 }
unsigned int m_numberL1JetCounts
jet counts
void L1GtTriggerMenuXmlParser::setGtNumberPhysTriggers ( const unsigned int &  numberPhysTriggersValue)

Definition at line 84 of file L1GtTriggerMenuXmlParser.cc.

References m_numberPhysTriggers.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

85  {
86 
87  m_numberPhysTriggers = numberPhysTriggersValue;
88 
89 }
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
void L1GtTriggerMenuXmlParser::setGtNumberTechTriggers ( const unsigned int &  numberTechTriggersValue)

Definition at line 92 of file L1GtTriggerMenuXmlParser.cc.

References m_numberTechTriggers.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

93  {
94 
95  m_numberTechTriggers = numberTechTriggersValue;
96 
97 }
unsigned int m_numberTechTriggers
number of technical triggers
void L1GtTriggerMenuXmlParser::setGtOrderConditionChip ( const std::vector< int > &  orderConditionChipValue)

Definition at line 76 of file L1GtTriggerMenuXmlParser.cc.

References m_orderConditionChip.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

77  {
78 
79  m_orderConditionChip = orderConditionChipValue;
80 
81 }
std::vector< int > m_orderConditionChip
void L1GtTriggerMenuXmlParser::setGtPinsOnConditionChip ( const unsigned int &  pinsOnConditionChipValue)

Definition at line 68 of file L1GtTriggerMenuXmlParser.cc.

References m_pinsOnConditionChip.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

68  {
69 
70  m_pinsOnConditionChip = pinsOnConditionChipValue;
71 
72 }
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
void L1GtTriggerMenuXmlParser::setGtScaleDbKey ( const std::string &  scaleKey)

Definition at line 126 of file L1GtTriggerMenuXmlParser.cc.

References m_scaleDbKey.

126  {
127  m_scaleDbKey = scaleKey;
128 }
std::string m_scaleDbKey
menu associated scale key
void L1GtTriggerMenuXmlParser::setGtTechnicalTriggerMap ( const AlgorithmMap ttMap)

Definition at line 225 of file L1GtTriggerMenuXmlParser.cc.

References m_technicalTriggerMap.

225  {
226  m_technicalTriggerMap = ttMap;
227 }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
void L1GtTriggerMenuXmlParser::setGtTriggerMenuAuthor ( const std::string &  val)

Definition at line 310 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuAuthor.

310  {
311 
312  m_triggerMenuAuthor = val;
313 
314 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuDate ( const std::string &  val)

Definition at line 304 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuDate.

304  {
305 
306  m_triggerMenuDate = val;
307 
308 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuDescription ( const std::string &  val)

Definition at line 316 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuDescription.

316  {
317 
319 
320 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuImplementation ( const std::string &  menuImplementation)

Definition at line 121 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuImplementation.

121  {
122  m_triggerMenuImplementation = menuImplementation;
123 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterface ( const std::string &  menuInterface)

Definition at line 113 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterface.

113  {
114  m_triggerMenuInterface = menuInterface;
115 }
std::string m_triggerMenuInterface
menu names
void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceAuthor ( const std::string &  val)

Definition at line 291 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceAuthor.

291  {
292 
294 
295 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceDate ( const std::string &  val)

Definition at line 285 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceDate.

285  {
286 
288 
289 }
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceDescription ( const std::string &  val)

Definition at line 297 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceDescription.

297  {
298 
300 
301 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuName ( const std::string &  menuName)

Definition at line 117 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuName.

117  {
118  m_triggerMenuName = menuName;
119 }
void L1GtTriggerMenuXmlParser::setVecBptxTemplate ( const std::vector< std::vector< L1GtBptxTemplate > > &  vecBptxTempl)

Definition at line 173 of file L1GtTriggerMenuXmlParser.cc.

References m_vecBptxTemplate.

174  {
175 
176  m_vecBptxTemplate = vecBptxTempl;
177 }
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
void L1GtTriggerMenuXmlParser::setVecCaloTemplate ( const std::vector< std::vector< L1GtCaloTemplate > > &  vecCaloTempl)

Definition at line 137 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCaloTemplate.

138  {
139 
140  m_vecCaloTemplate = vecCaloTempl;
141 }
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
void L1GtTriggerMenuXmlParser::setVecCastorTemplate ( const std::vector< std::vector< L1GtCastorTemplate > > &  vecCastorTempl)

Definition at line 155 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCastorTemplate.

156  {
157 
158  m_vecCastorTemplate = vecCastorTempl;
159 }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
void L1GtTriggerMenuXmlParser::setVecCorrelationTemplate ( const std::vector< std::vector< L1GtCorrelationTemplate > > &  vecCorrelationTempl)

Definition at line 185 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCorrelationTemplate.

186  {
187 
188  m_vecCorrelationTemplate = vecCorrelationTempl;
189 }
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
void L1GtTriggerMenuXmlParser::setVecEnergySumTemplate ( const std::vector< std::vector< L1GtEnergySumTemplate > > &  vecEnergySumTempl)

Definition at line 143 of file L1GtTriggerMenuXmlParser.cc.

References m_vecEnergySumTemplate.

144  {
145 
146  m_vecEnergySumTemplate = vecEnergySumTempl;
147 }
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
void L1GtTriggerMenuXmlParser::setVecExternalTemplate ( const std::vector< std::vector< L1GtExternalTemplate > > &  vecExternalTempl)

Definition at line 179 of file L1GtTriggerMenuXmlParser.cc.

References m_vecExternalTemplate.

180  {
181 
182  m_vecExternalTemplate = vecExternalTempl;
183 }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
void L1GtTriggerMenuXmlParser::setVecHfBitCountsTemplate ( const std::vector< std::vector< L1GtHfBitCountsTemplate > > &  vecHfBitCountsTempl)

Definition at line 161 of file L1GtTriggerMenuXmlParser.cc.

References m_vecHfBitCountsTemplate.

162  {
163 
164  m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
165 }
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
void L1GtTriggerMenuXmlParser::setVecHfRingEtSumsTemplate ( const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > &  vecHfRingEtSumsTempl)

Definition at line 167 of file L1GtTriggerMenuXmlParser.cc.

References m_vecHfRingEtSumsTemplate.

168  {
169 
170  m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
171 }
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
void L1GtTriggerMenuXmlParser::setVecJetCountsTemplate ( const std::vector< std::vector< L1GtJetCountsTemplate > > &  vecJetCountsTempl)

Definition at line 149 of file L1GtTriggerMenuXmlParser.cc.

References m_vecJetCountsTemplate.

150  {
151 
152  m_vecJetCountsTemplate = vecJetCountsTempl;
153 }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
void L1GtTriggerMenuXmlParser::setVecMuonTemplate ( const std::vector< std::vector< L1GtMuonTemplate > > &  vecMuonTempl)

Definition at line 131 of file L1GtTriggerMenuXmlParser.cc.

References m_vecMuonTemplate.

132  {
133 
134  m_vecMuonTemplate = vecMuonTempl;
135 }
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
const std::vector<std::vector<L1GtBptxTemplate> >& L1GtTriggerMenuXmlParser::vecBptxTemplate ( ) const
inline

Definition at line 208 of file L1GtTriggerMenuXmlParser.h.

References m_vecBptxTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

208  {
209 
210  return m_vecBptxTemplate;
211  }
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
const std::vector<std::vector<L1GtCaloTemplate> >& L1GtTriggerMenuXmlParser::vecCaloTemplate ( ) const
inline

Definition at line 153 of file L1GtTriggerMenuXmlParser.h.

References m_vecCaloTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

153  {
154  return m_vecCaloTemplate;
155  }
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
const std::vector<std::vector<L1GtCastorTemplate> >& L1GtTriggerMenuXmlParser::vecCastorTemplate ( ) const
inline

Definition at line 178 of file L1GtTriggerMenuXmlParser.h.

References m_vecCastorTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

178  {
179 
180  return m_vecCastorTemplate;
181  }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
const std::vector<std::vector<L1GtCorrelationTemplate> >& L1GtTriggerMenuXmlParser::vecCorrelationTemplate ( ) const
inline

Definition at line 227 of file L1GtTriggerMenuXmlParser.h.

References m_vecCorrelationTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

227  {
228 
230  }
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
const std::vector<std::vector<L1GtEnergySumTemplate> >& L1GtTriggerMenuXmlParser::vecEnergySumTemplate ( ) const
inline

Definition at line 160 of file L1GtTriggerMenuXmlParser.h.

References m_vecEnergySumTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

160  {
161 
162  return m_vecEnergySumTemplate;
163  }
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
const std::vector<std::vector<L1GtExternalTemplate> >& L1GtTriggerMenuXmlParser::vecExternalTemplate ( ) const
inline

Definition at line 218 of file L1GtTriggerMenuXmlParser.h.

References m_vecExternalTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

218  {
219 
220  return m_vecExternalTemplate;
221  }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
const std::vector<std::vector<L1GtHfBitCountsTemplate> >& L1GtTriggerMenuXmlParser::vecHfBitCountsTemplate ( ) const
inline

Definition at line 188 of file L1GtTriggerMenuXmlParser.h.

References m_vecHfBitCountsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

188  {
189 
191  }
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& L1GtTriggerMenuXmlParser::vecHfRingEtSumsTemplate ( ) const
inline

Definition at line 198 of file L1GtTriggerMenuXmlParser.h.

References m_vecHfRingEtSumsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

198  {
199 
201  }
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
const std::vector<std::vector<L1GtJetCountsTemplate> >& L1GtTriggerMenuXmlParser::vecJetCountsTemplate ( ) const
inline

Definition at line 169 of file L1GtTriggerMenuXmlParser.h.

References m_vecJetCountsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

169  {
170 
171  return m_vecJetCountsTemplate;
172  }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
const std::vector<std::vector<L1GtMuonTemplate> >& L1GtTriggerMenuXmlParser::vecMuonTemplate ( ) const
inline

get / set the vectors containing the conditions

Definition at line 147 of file L1GtTriggerMenuXmlParser.h.

References m_vecMuonTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

147  {
148  return m_vecMuonTemplate;
149  }
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
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 3517 of file L1GtTriggerMenuXmlParser.cc.

References cmsPerfPublish::fail(), 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().

3518  {
3519 
3520  XERCES_CPP_NAMESPACE_USE
3521 
3522  if (node == 0) {
3523  LogDebug("L1GtTriggerMenuXmlParser")
3524  << " Node is 0 in " << __PRETTY_FUNCTION__
3525  << " can not parse the algorithm " << algName
3526  << std::endl;
3527  return false;
3528  }
3529 
3530  // get alias
3532 
3533  if (algAlias == "") {
3534  algAlias = algName;
3535  LogDebug("L1GtTriggerMenuXmlParser")
3536  << "\n No alias defined for algorithm. Alias set to algorithm name."
3537  << "\n Algorithm name: " << algName << "\n Algorithm alias: " << algAlias
3538  << std::endl;
3539  } else {
3540  LogDebug("L1GtTriggerMenuXmlParser") << "\n Alias defined for algorithm."
3541  << "\n Algorithm name: " << algName << "\n Algorithm alias: " << algAlias
3542  << std::endl;
3543  }
3544 
3545  // get the logical expression from the node
3546  std::string logExpression = getXMLTextValue(node);
3547 
3548  //LogTrace("L1GtTriggerMenuXmlParser")
3549  //<< " Logical expression: " << logExpression
3550  //<< std::endl;
3551 
3552  //LogTrace("L1GtTriggerMenuXmlParser")
3553  //<< " Chip number: " << chipNr
3554  //<< std::endl;
3555 
3556  // determine output pin
3557  DOMNode* pinNode = findXMLChild(node->getFirstChild(), m_xmlTagOutput);
3558  std::string pinString;
3559  int outputPin = 0;
3560 
3561  pinNode = node->getFirstChild();
3562  if ( (pinNode = findXMLChild(pinNode, m_xmlTagOutputPin) ) != 0) {
3563  pinString = getXMLAttribute(pinNode, m_xmlAttrNr);
3564 
3565  // convert pinString to integer
3566  std::istringstream opStream(pinString);
3567 
3568  if ((opStream >> outputPin).fail()) {
3569  LogDebug("L1GtTriggerMenuXmlParser")
3570  << " Unable to convert pin string " << pinString
3571  << " to int for algorithm : " << algName
3572  << std::endl;
3573 
3574  return false;
3575  }
3576 
3577  }
3578 
3579  if (pinNode == 0) {
3580  LogTrace("L1GtTriggerMenuXmlParser") << " Warning: No pin number found for algorithm: "
3581  << algName << std::endl;
3582 
3583  return false;
3584  }
3585 
3586  //LogTrace("L1GtTriggerMenuXmlParser")
3587  //<< " Output pin: " << outputPin
3588  //<< std::endl;
3589 
3590 
3591  // compute the bit number from chip number, output pin and order of the chips
3592  // pin numbering start with 1, bit numbers with 0
3593  int bitNumber = outputPin + (m_orderConditionChip[chipNr] -1)*m_pinsOnConditionChip -1;
3594 
3595  //LogTrace("L1GtTriggerMenuXmlParser")
3596  //<< " Bit number: " << bitNumber
3597  //<< std::endl;
3598 
3599  // create a new algorithm and insert it into algorithm map
3600  L1GtAlgorithm alg(algName, logExpression, bitNumber);
3601  alg.setAlgoChipNumber(static_cast<int>(chipNr));
3602  alg.setAlgoAlias(algAlias);
3603 
3604  if (edm::isDebugEnabled() ) {
3605 
3606  std::ostringstream myCoutStream;
3607  alg.print(myCoutStream);
3608  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
3609 
3610  }
3611 
3612  // insert algorithm into the map
3613  if ( !insertAlgorithmIntoMap(alg)) {
3614 
3615  return false;
3616  }
3617 
3618  return true;
3619 
3620 }
#define LogDebug(id)
bool isDebugEnabled()
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
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
static const std::string m_xmlTagOutput
static const std::string m_xmlAttrNr
#define LogTrace(id)
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
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 3351 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, parseBptx(), parseCalo(), parseCastor(), parseCorrelation(), parseEnergySum(), parseExternal(), parseHfBitCounts(), parseHfRingEtSums(), parseJetCounts(), parseMuon(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseConditions().

3352  {
3353 
3354  XERCES_CPP_NAMESPACE_USE
3355 
3356  // get condition, particle name and type name
3360 
3361  if (condition.empty() || particle.empty() || type.empty() ) {
3362 
3363  edm::LogError("L1GtTriggerMenuXmlParser") << "Missing attributes for condition " << name
3364  << std::endl;
3365 
3366  return false;
3367  }
3368 
3369  //LogTrace("L1GtTriggerMenuXmlParser")
3370  //<< " condition: " << condition << ", particle: " << particle
3371  //<< ", type: " << type << std::endl;
3372 
3373  // call the appropiate function for this condition
3374 
3375  if (condition == m_xmlConditionAttrConditionMuon) {
3376  return parseMuon(node, name, chipNr);
3377  }
3378  else if (condition == m_xmlConditionAttrConditionCalo) {
3379  return parseCalo(node, name, chipNr);
3380  }
3381  else if (condition == m_xmlConditionAttrConditionEnergySum) {
3382  return parseEnergySum(node, name, chipNr);
3383  }
3384  else if (condition == m_xmlConditionAttrConditionJetCounts) {
3385  return parseJetCounts(node, name, chipNr);
3386  }
3387  else if (condition == m_xmlConditionAttrConditionCastor) {
3388  return parseCastor(node, name, chipNr);
3389  }
3390  else if (condition == m_xmlConditionAttrConditionHfBitCounts) {
3391  return parseHfBitCounts(node, name, chipNr);
3392  }
3393  else if (condition == m_xmlConditionAttrConditionHfRingEtSums) {
3394  return parseHfRingEtSums(node, name, chipNr);
3395  }
3396  else if (condition == m_xmlConditionAttrConditionBptx) {
3397  return parseBptx(node, name, chipNr);
3398  }
3399  else if (condition == m_xmlConditionAttrConditionExternal) {
3400  return parseExternal(node, name, chipNr);
3401  }
3402  else if (condition == m_xmlConditionAttrConditionCorrelation) {
3403  return parseCorrelation(node, name, chipNr);
3404  }
3405  else {
3406  edm::LogError("L1GtTriggerMenuXmlParser")
3407  << "\n Error: unknown condition (" << condition << ")"
3408  << std::endl;
3409 
3410  return false;
3411  }
3412 
3413  return true;
3414 
3415 }
type
Definition: HCALResponse.h:21
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
tuple node
Definition: Node.py:50
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 &quot;jet counts&quot; condition
bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0, const bool corrFlag=false)
parse an &quot;energy sum&quot; 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
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 3716 of file L1GtTriggerMenuXmlParser.cc.

References cmsPerfPublish::fail(), 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().

3717  {
3718 
3719  XERCES_CPP_NAMESPACE_USE
3720 
3721  if (node == 0) {
3722  LogDebug("L1GtTriggerMenuXmlParser")
3723  << " Node is 0 in " << __PRETTY_FUNCTION__
3724  << " can not parse the technical trigger " << algName
3725  << std::endl;
3726  return false;
3727  }
3728 
3729  // get the logical expression from the node
3730  std::string logExpression = getXMLTextValue(node);
3731 
3732  //LogTrace("L1GtTriggerMenuXmlParser")
3733  //<< " Logical expression: " << logExpression
3734  //<< std::endl;
3735 
3736  // determine bit number (use output pin tag)
3737  DOMNode* pinNode = findXMLChild(node->getFirstChild(), m_xmlTagOutput);
3738  std::string pinString;
3739  int outputPin = 0;
3740 
3741  pinNode = node->getFirstChild();
3742  if ( (pinNode = findXMLChild(pinNode, m_xmlTagOutputPin) ) != 0) {
3743  pinString = getXMLAttribute(pinNode, m_xmlAttrNr);
3744 
3745  // convert pinString to integer
3746  std::istringstream opStream(pinString);
3747 
3748  if ((opStream >> outputPin).fail()) {
3749  LogDebug("L1GtTriggerMenuXmlParser")
3750  << " Unable to convert pin string " << pinString
3751  << " to int for technical trigger : " << algName
3752  << std::endl;
3753 
3754  return false;
3755  }
3756 
3757  }
3758 
3759  if (pinNode == 0) {
3760  LogTrace("L1GtTriggerMenuXmlParser")
3761  << " Warning: No pin number found for technical trigger: "
3762  << algName << std::endl;
3763 
3764  return false;
3765  }
3766 
3767  // set the bit number
3768  int bitNumber = outputPin;
3769 
3770  //LogTrace("L1GtTriggerMenuXmlParser")
3771  //<< " Bit number: " << bitNumber
3772  //<< std::endl;
3773 
3774  // create a new technical trigger and insert it into technical trigger map
3775  // alias set automatically to name
3776  L1GtAlgorithm alg(algName, logExpression, bitNumber);
3777  alg.setAlgoAlias(algName);
3778 
3779  if (edm::isDebugEnabled() ) {
3780 
3781  std::ostringstream myCoutStream;
3782  alg.print(myCoutStream);
3783  LogTrace("L1GtTriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
3784 
3785  }
3786 
3787  // insert technical trigger into the map
3788  if ( !insertTechTriggerIntoMap(alg)) {
3789 
3790  return false;
3791  }
3792 
3793  return true;
3794 
3795 }
#define LogDebug(id)
bool isDebugEnabled()
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
XERCES_CPP_NAMESPACE::DOMNode * findXMLChild(XERCES_CPP_NAMESPACE::DOMNode *startChild, const std::string &tagName, bool beginOnly=false, std::string *rest=0)
find a named child of a xml node
tuple node
Definition: Node.py:50
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
static const std::string m_xmlTagOutput
static const std::string m_xmlAttrNr
#define LogTrace(id)
bool insertTechTriggerIntoMap(const L1GtAlgorithm &alg)
insert a technical trigger into technical trigger map
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 3861 of file L1GtTriggerMenuXmlParser.cc.

References clearMaps(), LogTrace, L1GtXmlParserTags::m_xmlTagDef, parseAlgorithms(), parseConditions(), parseId(), parseTechTriggers(), fetchall_from_DQM_v2::release, and XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by parseXmlFile().

3861  {
3862 
3863  XERCES_CPP_NAMESPACE_USE
3864 
3865  DOMDocument* doc = parser->getDocument();
3866  DOMNode* n1 = doc->getFirstChild();
3867 
3868  if (n1 == 0) {
3869 
3870  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: Found no XML child" << std::endl;
3871 
3872  return false;
3873  }
3874 
3875  char* nodeName = XMLString::transcode(n1->getNodeName());
3876 
3877  if (XMLString::compareIString(nodeName, m_xmlTagDef.c_str())) {
3878 
3879  edm::LogError("L1GtTriggerMenuXmlParser") << "Error: First XML child is not \" "
3880  << m_xmlTagDef << "\" " << std::endl;
3881 
3882  return false;
3883  }
3884 
3885  LogTrace("L1GtTriggerMenuXmlParser")
3886  << "\nFirst node name is: " << nodeName
3887  << std::endl;
3888  XMLString::release(&nodeName);
3889 
3890  // clear possible old maps
3891  clearMaps();
3892 
3893  if ( !parseId(parser) ) {
3894  clearMaps();
3895  return false;
3896  }
3897 
3898 
3899  if ( !parseConditions(parser) ) {
3900  clearMaps();
3901  return false;
3902  }
3903 
3904  if ( !parseAlgorithms(parser) ) {
3905  clearMaps();
3906  return false;
3907  }
3908 
3909  if ( !parseTechTriggers(parser) ) {
3910  clearMaps();
3911  return false;
3912  }
3913 
3914  return true;
3915 
3916 }
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
XMLCh * transcode(const T &fInput)
#define LogTrace(id)
bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser *parser)
parse all algorithms
static const std::string m_xmlTagDef

Member Data Documentation

AlgorithmMap L1GtTriggerMenuXmlParser::m_algorithmAliasMap
private

map containing the physics algorithms (by alias)

Definition at line 571 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_algorithmImplementation
private
AlgorithmMap L1GtTriggerMenuXmlParser::m_algorithmMap
private

map containing the physics algorithms (by name)

Definition at line 568 of file L1GtTriggerMenuXmlParser.h.

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

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

map containing the conditions (per condition chip) - transient

Definition at line 538 of file L1GtTriggerMenuXmlParser.h.

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

std::vector<std::vector<L1GtCaloTemplate> > L1GtTriggerMenuXmlParser::m_corCaloTemplate
private
std::vector<std::vector<L1GtEnergySumTemplate> > L1GtTriggerMenuXmlParser::m_corEnergySumTemplate
private
std::vector<std::vector<L1GtMuonTemplate> > L1GtTriggerMenuXmlParser::m_corMuonTemplate
private
unsigned int L1GtTriggerMenuXmlParser::m_numberConditionChips
private
unsigned int L1GtTriggerMenuXmlParser::m_numberL1JetCounts
private

jet counts

Definition at line 518 of file L1GtTriggerMenuXmlParser.h.

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

unsigned int L1GtTriggerMenuXmlParser::m_numberPhysTriggers
private

number of physics trigger algorithms

Definition at line 512 of file L1GtTriggerMenuXmlParser.h.

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

unsigned int L1GtTriggerMenuXmlParser::m_numberTechTriggers
private

number of technical triggers

Definition at line 515 of file L1GtTriggerMenuXmlParser.h.

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

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 509 of file L1GtTriggerMenuXmlParser.h.

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

unsigned int L1GtTriggerMenuXmlParser::m_pinsOnConditionChip
private

number of pins on the GTL condition chips

Definition at line 505 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_scaleDbKey
private

menu associated scale key

Definition at line 548 of file L1GtTriggerMenuXmlParser.h.

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

AlgorithmMap L1GtTriggerMenuXmlParser::m_technicalTriggerMap
private

map containing the technical triggers

Definition at line 574 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_triggerMenuAuthor
private
std::string L1GtTriggerMenuXmlParser::m_triggerMenuDate
private

Definition at line 528 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_triggerMenuDescription
private
std::string L1GtTriggerMenuXmlParser::m_triggerMenuImplementation
private
std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterface
private

menu names

Definition at line 543 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterfaceAuthor
private
std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterfaceDate
private

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

Definition at line 524 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_triggerMenuInterfaceDescription
private
std::string L1GtTriggerMenuXmlParser::m_triggerMenuName
private
std::vector<std::vector<L1GtBptxTemplate> > L1GtTriggerMenuXmlParser::m_vecBptxTemplate
private
std::vector<std::vector<L1GtCaloTemplate> > L1GtTriggerMenuXmlParser::m_vecCaloTemplate
private
std::vector<std::vector<L1GtCastorTemplate> > L1GtTriggerMenuXmlParser::m_vecCastorTemplate
private
std::vector<std::vector<L1GtCorrelationTemplate> > L1GtTriggerMenuXmlParser::m_vecCorrelationTemplate
private
std::vector<std::vector<L1GtEnergySumTemplate> > L1GtTriggerMenuXmlParser::m_vecEnergySumTemplate
private
std::vector<std::vector<L1GtExternalTemplate> > L1GtTriggerMenuXmlParser::m_vecExternalTemplate
private
std::vector<std::vector<L1GtHfBitCountsTemplate> > L1GtTriggerMenuXmlParser::m_vecHfBitCountsTemplate
private
std::vector<std::vector<L1GtHfRingEtSumsTemplate> > L1GtTriggerMenuXmlParser::m_vecHfRingEtSumsTemplate
private
std::vector<std::vector<L1GtJetCountsTemplate> > L1GtTriggerMenuXmlParser::m_vecJetCountsTemplate
private
std::vector<std::vector<L1GtMuonTemplate> > L1GtTriggerMenuXmlParser::m_vecMuonTemplate
private

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

Definition at line 552 of file L1GtTriggerMenuXmlParser.h.

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

XERCES_CPP_NAMESPACE::ErrorHandler* L1GtTriggerMenuXmlParser::m_xmlErrHandler
private

error handler for xml-parser

Definition at line 497 of file L1GtTriggerMenuXmlParser.h.

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