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

$Date$ $Revision$

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

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 54 of file L1GtTriggerMenuXmlParser.h.

Constructor & Destructor Documentation

L1GtTriggerMenuXmlParser::L1GtTriggerMenuXmlParser ( )

constructor empty

Definition at line 41 of file L1GtTriggerMenuXmlParser.cc.

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

destructor

Definition at line 54 of file L1GtTriggerMenuXmlParser.cc.

References clearMaps().

54  {
55 
56  clearMaps();
57 
58 }

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

References m_xmlErrHandler, and geometryXMLtoCSV::parser.

Referenced by parseXmlFile().

901  {
902 
903  XERCES_CPP_NAMESPACE_USE
904 
905  if (parser != 0) {
906  delete parser;
907  }
908 
909  if (m_xmlErrHandler != 0) {
910  delete m_xmlErrHandler;
911  m_xmlErrHandler = 0;
912  }
913 
914  XMLPlatformUtils::Terminate();
915 
916 }
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 982 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmMap, and m_conditionMap.

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

982  {
983 
984  // loop over condition maps (one map per condition chip)
985  // then loop over conditions in the map
986  for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip
987  != m_conditionMap.end(); itCondOnChip++) {
988 
989  // the conditions in the maps are deleted in L1GtTriggerMenu, not here
990 
991  itCondOnChip->clear();
992 
993  }
994 
995  // the algorithms in the maps are deleted in L1GtTriggerMenu, not here
996  m_algorithmMap.clear();
997 
998 }
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 246 of file L1GtTriggerMenuXmlParser.h.

References m_corCaloTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 253 of file L1GtTriggerMenuXmlParser.h.

References m_corEnergySumTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 239 of file L1GtTriggerMenuXmlParser.h.

References m_corMuonTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

239  {
240  return m_corMuonTemplate;
241  }
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 714 of file L1GtTriggerMenuXmlParser.cc.

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

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

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

References fetchall_from_DQM_v2::release.

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

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

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

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

1260  {
1261 
1263 
1264  edm::LogError("L1GtTriggerMenuXmlParser") << "Invalid mode for single bit" << std::endl;
1265 
1266  return -1;
1267  }
1268 
1269  std::string tmpStr = getXMLTextValue(node);
1270  if (tmpStr == "0") {
1271  return 0;
1272  }
1273  else if (tmpStr == "1") {
1274  return 1;
1275  }
1276  else {
1277  edm::LogError("L1GtTriggerMenuXmlParser") << "Bad bit value (" << tmpStr << ")"
1278  << std::endl;
1279  return -1;
1280  }
1281 }
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 836 of file L1GtTriggerMenuXmlParser.cc.

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

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

837  {
838 
839  XERCES_CPP_NAMESPACE_USE
840 
841  if (node == 0) {
842 
843  LogDebug("L1GtTriggerMenuXmlParser")
844  << "node == 0 in " << __PRETTY_FUNCTION__
845  << std::endl;
846 
847  return false;
848  }
849 
850  DOMNode* n1 = findXMLChild(node->getFirstChild(), childName);
851 
852  // if child not found
853  if (n1 == 0) {
854 
855  LogDebug("L1GtTriggerMenuXmlParser") << "Child of condition not found ( " << childName
856  << ")" << std::endl;
857 
858  return false;
859  }
860 
861  // no values are sucessfull
862  if (num == 0) {
863  return true;
864  }
865 
866  //
867  dst.reserve(num);
868 
869  //
870  n1 = findXMLChild(n1->getFirstChild(), m_xmlTagValue);
871  for (unsigned int i = 0; i < num; i++) {
872  if (n1 == 0) {
873 
874  LogDebug("L1GtTriggerMenuXmlParser") << "Not enough values in condition child ( "
875  << childName << ")" << std::endl;
876 
877  return false;
878  }
879 
880  if ( !getXMLHexTextValue(n1, dst[i]) ) {
881 
882  edm::LogError("L1GtTriggerMenuXmlParser") << "Error converting condition child ( "
883  << childName << ") value." << std::endl;
884 
885  return false;
886  }
887 
888  n1 = findXMLChild(n1->getNextSibling(), m_xmlTagValue); // next child
889  }
890 
891  return true;
892 }
#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
long long int num
Definition: procUtils.cc:71
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 1292 of file L1GtTriggerMenuXmlParser.cc.

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

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

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

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

Referenced by parseMuon().

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

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

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

References asciidump::attributes, fetchall_from_DQM_v2::release, and run_regression::ret.

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

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

References getXMLHexTextValue128().

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

684  {
685 
686  boost::uint64_t dummyH; // dummy for eventual higher 64bit
687  boost::uint64_t tempUInt; // temporary unsigned integer
688 
689  if ( !getXMLHexTextValue128(node, tempUInt, dummyH) ) {
690  return false;
691  }
692 
693  if (dummyH != 0) {
694  edm::LogError("L1GtTriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
695  return false;
696  }
697 
698  dst = tempUInt;
699 
700  return true;
701 }
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 649 of file L1GtTriggerMenuXmlParser.cc.

References getXMLTextValue(), hexString2UInt128(), and LogDebug.

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

650  {
651 
652  if (node == 0) {
653 
654  LogDebug("L1GtTriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
655 
656  return false;
657  }
658 
659  boost::uint64_t tempUIntH, tempUIntL;
660 
661  std::string tempStr = getXMLTextValue(node);
662  if ( !hexString2UInt128(tempStr, tempUIntL, tempUIntH) ) {
663  return false;
664  }
665 
666  dstL = tempUIntL;
667  dstH = tempUIntH;
668 
669  return true;
670 }
#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 530 of file L1GtTriggerMenuXmlParser.cc.

References python.Node::node, fetchall_from_DQM_v2::release, and run_regression::ret.

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

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

get / set the algorithm map (by alias)

Definition at line 269 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmAliasMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 330 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmImplementation.

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

get / set the algorithm map (by name)

Definition at line 262 of file L1GtTriggerMenuXmlParser.h.

References m_algorithmMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

262  {
263  return m_algorithmMap;
264  }
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 114 of file L1GtTriggerMenuXmlParser.h.

References m_conditionMap.

114  {
115  return m_conditionMap;
116  }
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 69 of file L1GtTriggerMenuXmlParser.h.

References m_numberConditionChips.

69  {
71  }
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 105 of file L1GtTriggerMenuXmlParser.h.

References m_numberL1JetCounts.

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

get / set the number of physics trigger algorithms

Definition at line 91 of file L1GtTriggerMenuXmlParser.h.

References m_numberPhysTriggers.

91  {
92  return m_numberPhysTriggers;
93  }
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 98 of file L1GtTriggerMenuXmlParser.h.

References m_numberTechTriggers.

98  {
99  return m_numberTechTriggers;
100  }
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 84 of file L1GtTriggerMenuXmlParser.h.

References m_orderConditionChip.

84  {
85  return m_orderConditionChip;
86  }
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 76 of file L1GtTriggerMenuXmlParser.h.

References m_pinsOnConditionChip.

76  {
77  return m_pinsOnConditionChip;
78  }
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 142 of file L1GtTriggerMenuXmlParser.h.

References m_scaleDbKey.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

get / set the technical trigger map

Definition at line 276 of file L1GtTriggerMenuXmlParser.h.

References m_technicalTriggerMap.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 317 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuAuthor.

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

Definition at line 311 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuDate.

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

Definition at line 323 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuDescription.

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

get / set the trigger menu names

Definition at line 121 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterface.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 297 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceAuthor.

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

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

Definition at line 291 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDate.

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

Definition at line 303 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDescription.

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

Definition at line 128 of file L1GtTriggerMenuXmlParser.h.

References m_triggerMenuName.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

128  {
129  return m_triggerMenuName;
130  }
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 565 of file L1GtTriggerMenuXmlParser.cc.

References LogDebug.

Referenced by countConditionChildMaxBits(), and getXMLHexTextValue128().

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

References m_xmlErrHandler, python.rootplot.argparse::message, geometryXMLtoCSV::parser, and fetchall_from_DQM_v2::release.

Referenced by parseXmlFile().

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

insert an algorithm into algorithm map

Definition at line 1026 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, and m_pinsOnConditionChip.

Referenced by workAlgorithm().

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

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

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

1002  {
1003 
1004  std::string cName = cond.condName();
1005  //LogTrace("L1GtTriggerMenuXmlParser")
1006  //<< " Trying to insert condition \"" << cName << "\" in the condition map." ;
1007 
1008  // no condition name has to appear twice!
1009  if ((m_conditionMap[chipNr]).count(cName) != 0) {
1010  LogTrace("L1GtTriggerMenuXmlParser") << " Condition " << cName
1011  << " already exists - not inserted!" << std::endl;
1012  return false;
1013  }
1014 
1015  (m_conditionMap[chipNr])[cName] = &cond;
1016  //LogTrace("L1GtTriggerMenuXmlParser")
1017  //<< " OK - condition inserted!"
1018  //<< std::endl;
1019 
1020 
1021  return true;
1022 
1023 }
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:55
#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 1117 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workTechTrigger().

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

parse all algorithms

Definition at line 3636 of file L1GtTriggerMenuXmlParser.cc.

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

Referenced by workXML().

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

Referenced by workCondition().

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

Referenced by parseCorrelation(), and workCondition().

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

Referenced by workCondition().

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

References asciidump::doc, findXMLChild(), LogTrace, m_numberConditionChips, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagConditions, L1GtXmlParserTags::m_xmlTagDef, fetchall_from_DQM_v2::release, and workCondition().

Referenced by workXML().

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

Referenced by workCondition().

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

References 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(), TypeETM, TypeETT, TypeHTM, and TypeHTT.

Referenced by parseCorrelation(), and workCondition().

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

Referenced by workCondition().

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

Referenced by workCondition().

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

Referenced by workCondition().

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

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

Referenced by workXML().

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

Referenced by workCondition().

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

Referenced by parseCorrelation(), and workCondition().

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

References asciidump::doc, findXMLChild(), L1GtXmlParserTags::m_xmlTagDef, L1GtXmlParserTags::m_xmlTagTechTriggers, python.Node::node, and workTechTrigger().

Referenced by workXML().

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

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

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

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

References m_corCaloTemplate.

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

Definition at line 206 of file L1GtTriggerMenuXmlParser.cc.

References m_corEnergySumTemplate.

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

Definition at line 194 of file L1GtTriggerMenuXmlParser.cc.

References m_corMuonTemplate.

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

Definition at line 221 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmAliasMap.

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

Definition at line 323 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmImplementation.

323  {
324 
326 
327 }
void L1GtTriggerMenuXmlParser::setGtAlgorithmMap ( const AlgorithmMap algoMap)

Definition at line 216 of file L1GtTriggerMenuXmlParser.cc.

References m_algorithmMap.

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

Definition at line 109 of file L1GtTriggerMenuXmlParser.cc.

References m_conditionMap.

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

Definition at line 61 of file L1GtTriggerMenuXmlParser.cc.

References m_numberConditionChips.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 101 of file L1GtTriggerMenuXmlParser.cc.

References m_numberL1JetCounts.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 85 of file L1GtTriggerMenuXmlParser.cc.

References m_numberPhysTriggers.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 93 of file L1GtTriggerMenuXmlParser.cc.

References m_numberTechTriggers.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 77 of file L1GtTriggerMenuXmlParser.cc.

References m_orderConditionChip.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 69 of file L1GtTriggerMenuXmlParser.cc.

References m_pinsOnConditionChip.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 127 of file L1GtTriggerMenuXmlParser.cc.

References m_scaleDbKey.

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

Definition at line 226 of file L1GtTriggerMenuXmlParser.cc.

References m_technicalTriggerMap.

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

Definition at line 311 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuAuthor.

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

Definition at line 305 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuDate.

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

Definition at line 317 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuDescription.

317  {
318 
320 
321 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuImplementation ( const std::string &  menuImplementation)

Definition at line 122 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuImplementation.

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

Definition at line 114 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterface.

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

Definition at line 292 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceAuthor.

292  {
293 
295 
296 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuInterfaceDate ( const std::string &  val)

Definition at line 286 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceDate.

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

Definition at line 298 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuInterfaceDescription.

298  {
299 
301 
302 }
void L1GtTriggerMenuXmlParser::setGtTriggerMenuName ( const std::string &  menuName)

Definition at line 118 of file L1GtTriggerMenuXmlParser.cc.

References m_triggerMenuName.

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

Definition at line 174 of file L1GtTriggerMenuXmlParser.cc.

References m_vecBptxTemplate.

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

Definition at line 138 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCaloTemplate.

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

Definition at line 156 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCastorTemplate.

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

Definition at line 186 of file L1GtTriggerMenuXmlParser.cc.

References m_vecCorrelationTemplate.

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

Definition at line 144 of file L1GtTriggerMenuXmlParser.cc.

References m_vecEnergySumTemplate.

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

Definition at line 180 of file L1GtTriggerMenuXmlParser.cc.

References m_vecExternalTemplate.

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

Definition at line 162 of file L1GtTriggerMenuXmlParser.cc.

References m_vecHfBitCountsTemplate.

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

Definition at line 168 of file L1GtTriggerMenuXmlParser.cc.

References m_vecHfRingEtSumsTemplate.

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

Definition at line 150 of file L1GtTriggerMenuXmlParser.cc.

References m_vecJetCountsTemplate.

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

Definition at line 132 of file L1GtTriggerMenuXmlParser.cc.

References m_vecMuonTemplate.

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

Definition at line 210 of file L1GtTriggerMenuXmlParser.h.

References m_vecBptxTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 155 of file L1GtTriggerMenuXmlParser.h.

References m_vecCaloTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 180 of file L1GtTriggerMenuXmlParser.h.

References m_vecCastorTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 229 of file L1GtTriggerMenuXmlParser.h.

References m_vecCorrelationTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 162 of file L1GtTriggerMenuXmlParser.h.

References m_vecEnergySumTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 220 of file L1GtTriggerMenuXmlParser.h.

References m_vecExternalTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 190 of file L1GtTriggerMenuXmlParser.h.

References m_vecHfBitCountsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 200 of file L1GtTriggerMenuXmlParser.h.

References m_vecHfRingEtSumsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 171 of file L1GtTriggerMenuXmlParser.h.

References m_vecJetCountsTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

171  {
172 
173  return m_vecJetCountsTemplate;
174  }
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 149 of file L1GtTriggerMenuXmlParser.h.

References m_vecMuonTemplate.

Referenced by L1GtTriggerMenuXmlProducer::produceGtTriggerMenu().

149  {
150  return m_vecMuonTemplate;
151  }
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 3518 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, and L1GtXmlParserTags::m_xmlTagOutputPin.

Referenced by parseAlgorithms().

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

Referenced by parseConditions().

3353  {
3354 
3355  XERCES_CPP_NAMESPACE_USE
3356 
3357  // get condition, particle name and type name
3358  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
3359  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
3361 
3362  if (condition.empty() || particle.empty() || type.empty() ) {
3363 
3364  edm::LogError("L1GtTriggerMenuXmlParser") << "Missing attributes for condition " << name
3365  << std::endl;
3366 
3367  return false;
3368  }
3369 
3370  //LogTrace("L1GtTriggerMenuXmlParser")
3371  //<< " condition: " << condition << ", particle: " << particle
3372  //<< ", type: " << type << std::endl;
3373 
3374  // call the appropiate function for this condition
3375 
3376  if (condition == m_xmlConditionAttrConditionMuon) {
3377  return parseMuon(node, name, chipNr);
3378  }
3379  else if (condition == m_xmlConditionAttrConditionCalo) {
3380  return parseCalo(node, name, chipNr);
3381  }
3382  else if (condition == m_xmlConditionAttrConditionEnergySum) {
3383  return parseEnergySum(node, name, chipNr);
3384  }
3385  else if (condition == m_xmlConditionAttrConditionJetCounts) {
3386  return parseJetCounts(node, name, chipNr);
3387  }
3388  else if (condition == m_xmlConditionAttrConditionCastor) {
3389  return parseCastor(node, name, chipNr);
3390  }
3391  else if (condition == m_xmlConditionAttrConditionHfBitCounts) {
3392  return parseHfBitCounts(node, name, chipNr);
3393  }
3394  else if (condition == m_xmlConditionAttrConditionHfRingEtSums) {
3395  return parseHfRingEtSums(node, name, chipNr);
3396  }
3397  else if (condition == m_xmlConditionAttrConditionBptx) {
3398  return parseBptx(node, name, chipNr);
3399  }
3400  else if (condition == m_xmlConditionAttrConditionExternal) {
3401  return parseExternal(node, name, chipNr);
3402  }
3403  else if (condition == m_xmlConditionAttrConditionCorrelation) {
3404  return parseCorrelation(node, name, chipNr);
3405  }
3406  else {
3407  edm::LogError("L1GtTriggerMenuXmlParser")
3408  << "\n Error: unknown condition (" << condition << ")"
3409  << std::endl;
3410 
3411  return false;
3412  }
3413 
3414  return true;
3415 
3416 }
type
Definition: HCALResponse.h:22
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 3717 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(), and L1GtAlgorithm::setAlgoAlias().

Referenced by parseTechTriggers().

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

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

Referenced by parseXmlFile().

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

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

unsigned int L1GtTriggerMenuXmlParser::m_numberPhysTriggers
private

number of physics trigger algorithms

Definition at line 514 of file L1GtTriggerMenuXmlParser.h.

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

unsigned int L1GtTriggerMenuXmlParser::m_numberTechTriggers
private

number of technical triggers

Definition at line 517 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 511 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 507 of file L1GtTriggerMenuXmlParser.h.

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

std::string L1GtTriggerMenuXmlParser::m_scaleDbKey
private

menu associated scale key

Definition at line 550 of file L1GtTriggerMenuXmlParser.h.

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

AlgorithmMap L1GtTriggerMenuXmlParser::m_technicalTriggerMap
private

map containing the technical triggers

Definition at line 576 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 530 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 545 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 526 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 554 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 499 of file L1GtTriggerMenuXmlParser.h.

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