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
l1t::TriggerMenuXmlParser Class Reference

#include <TriggerMenuXmlParser.h>

Inheritance diagram for l1t::TriggerMenuXmlParser:
L1GtXmlParserTags

Public Member Functions

const std::vector< std::vector
< CaloTemplate > > & 
corCaloTemplate () const
 
const std::vector< std::vector
< L1GtEnergySumTemplate > > & 
corEnergySumTemplate () const
 
const std::vector< std::vector
< MuonTemplate > > & 
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
 
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< CaloTemplate > > &)
 
void setCorEnergySumTemplate (const std::vector< std::vector< L1GtEnergySumTemplate > > &)
 
void setCorMuonTemplate (const std::vector< std::vector< MuonTemplate > > &)
 
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< CaloTemplate > > &)
 
void setVecCastorTemplate (const std::vector< std::vector< L1GtCastorTemplate > > &)
 
void setVecCorrelationTemplate (const std::vector< std::vector< CorrelationTemplate > > &)
 
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< MuonTemplate > > &)
 
 TriggerMenuXmlParser ()
 
const std::vector< std::vector
< L1GtBptxTemplate > > & 
vecBptxTemplate () const
 
const std::vector< std::vector
< CaloTemplate > > & 
vecCaloTemplate () const
 
const std::vector< std::vector
< L1GtCastorTemplate > > & 
vecCastorTemplate () const
 
const std::vector< std::vector
< CorrelationTemplate > > & 
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
< MuonTemplate > > & 
vecMuonTemplate () const
 get / set the vectors containing the conditions More...
 
virtual ~TriggerMenuXmlParser ()
 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 (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 getConditionChildValuesOld (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...
 
l1t::GtConditionType 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 (const std::string &childName, boost::uint64_t &dst)
 
bool getXMLHexTextValue128 (const std::string &childName, boost::uint64_t &dstL, boost::uint64_t &dstH)
 
bool getXMLHexTextValue128Old (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...
 
bool getXMLHexTextValueOld (XERCES_CPP_NAMESPACE::DOMNode *node, boost::uint64_t &dst)
 get a hexadecimal value of a xml node containing text 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 (GtCondition &cond, const int chipNr)
 
bool insertTechTriggerIntoMap (const L1GtAlgorithm &alg)
 insert a technical trigger into technical trigger map More...
 
int l1t2int (l1t::RelativeBx)
 
template<typename T >
std::string l1t2string (T)
 
std::string l1tDateTime2string (l1t::DateTime)
 
bool parseAlgorithms (l1t::AlgorithmList algorithms)
 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 (l1t::CalorimeterCondition condCalo, 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 (l1t::ConditionList conditions)
 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 (std::auto_ptr< l1t::L1TriggerMenu > tm)
 parse all parse all identification attributes (trigger menu names, scale DB key, etc) More...
 
bool parseId (l1t::Meta meta)
 
bool parseJetCounts (XERCES_CPP_NAMESPACE::DOMNode *node, const std::string &name, unsigned int chipNr=0)
 parse a "jet counts" condition More...
 
bool parseMuon (l1t::MuonCondition condMu, 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 (l1t::Algorithm algorithm, 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 (std::auto_ptr< l1t::L1TriggerMenu > tm)
 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
< CaloTemplate > > 
m_corCaloTemplate
 
std::vector< std::vector
< L1GtEnergySumTemplate > > 
m_corEnergySumTemplate
 
std::vector< std::vector
< MuonTemplate > > 
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
< CaloTemplate > > 
m_vecCaloTemplate
 
std::vector< std::vector
< L1GtCastorTemplate > > 
m_vecCastorTemplate
 
std::vector< std::vector
< CorrelationTemplate > > 
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
< MuonTemplate > > 
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

Definition at line 59 of file TriggerMenuXmlParser.h.

Constructor & Destructor Documentation

TriggerMenuXmlParser::TriggerMenuXmlParser ( )

constructor empty

Definition at line 43 of file TriggerMenuXmlParser.cc.

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

destructor

Definition at line 56 of file TriggerMenuXmlParser.cc.

56  {
57 
58  clearMaps();
59 
60 }

Member Function Documentation

void TriggerMenuXmlParser::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 903 of file TriggerMenuXmlParser.cc.

References geometryXMLtoCSV::parser.

903  {
904 
905  XERCES_CPP_NAMESPACE_USE
906 
907  if (parser != 0) {
908  delete parser;
909  }
910 
911  if (m_xmlErrHandler != 0) {
912  delete m_xmlErrHandler;
913  m_xmlErrHandler = 0;
914  }
915 
916  XMLPlatformUtils::Terminate();
917 
918 }
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser
void TriggerMenuXmlParser::clearMaps ( )
private

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

Definition at line 984 of file TriggerMenuXmlParser.cc.

984  {
985 
986  // loop over condition maps (one map per condition chip)
987  // then loop over conditions in the map
988  for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip
989  != m_conditionMap.end(); itCondOnChip++) {
990 
991  // the conditions in the maps are deleted in L1uGtTriggerMenu, not here
992 
993  itCondOnChip->clear();
994 
995  }
996 
997  // the algorithms in the maps are deleted in L1uGtTriggerMenu, not here
998  m_algorithmMap.clear();
999 
1000 }
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<CaloTemplate> >& l1t::TriggerMenuXmlParser::corCaloTemplate ( ) const
inline

Definition at line 251 of file TriggerMenuXmlParser.h.

References m_corCaloTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

251  {
252  return m_corCaloTemplate;
253  }
std::vector< std::vector< CaloTemplate > > m_corCaloTemplate
const std::vector<std::vector<L1GtEnergySumTemplate> >& l1t::TriggerMenuXmlParser::corEnergySumTemplate ( ) const
inline

Definition at line 258 of file TriggerMenuXmlParser.h.

References m_corEnergySumTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

258  {
259 
260  return m_corEnergySumTemplate;
261  }
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
const std::vector<std::vector<MuonTemplate> >& l1t::TriggerMenuXmlParser::corMuonTemplate ( ) const
inline

Definition at line 244 of file TriggerMenuXmlParser.h.

References m_corMuonTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

244  {
245  return m_corMuonTemplate;
246  }
std::vector< std::vector< MuonTemplate > > m_corMuonTemplate
bool TriggerMenuXmlParser::countConditionChildMaxBits ( 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 755 of file TriggerMenuXmlParser.cc.

References counter, and AlCaHLTBitMon_QueryRunRegistry::string.

756  {
757 
758  XERCES_CPP_NAMESPACE_USE
759 
760  // should never happen...
761  // first try direct
762  std::string maxString = childName; // string for the maxbits
763 
764  // do the hex conversion
765 
766  boost::uint64_t maxBitsL, maxBitsH;
767  if ( !hexString2UInt128(maxString, maxBitsL, maxBitsH) ) {
768  return false;
769  }
770 
771  // count the bits
772  //LogTrace("TriggerMenuXmlParser")
773  //<< std::dec
774  //<< " words: dec: high (MSB) word = " << maxBitsH << " low word = " << maxBitsL
775  //<< std::hex << "\n"
776  //<< " words: hex: high (MSB) word = " << maxBitsH << " low word = " << maxBitsL
777  //<< std::dec
778  //<< std::endl;
779 
780  unsigned int counter = 0;
781 
782  while (maxBitsL != 0) {
783  // check if bits set countinously
784  if ( (maxBitsL & 1) == 0) {
785 
786  edm::LogError("TriggerMenuXmlParser")
787  << " Confused by not continous set bits for max value " << maxString
788  << std::endl;
789 
790  return false;
791  }
792 
793  maxBitsL >>= 1;
794  counter++;
795  }
796 
797  if ( (maxBitsH != 0) && (counter != 64)) {
798 
799  edm::LogError("TriggerMenuXmlParser")
800  << " Confused by not continous set bits for max value " << maxString
801  << std::endl;
802 
803  return false;
804  }
805 
806  while (maxBitsH != 0) {
807  //check if bits set countinously
808  if ( (maxBitsH & 1) == 0) {
809 
810  edm::LogError("TriggerMenuXmlParser")
811  << " Confused by not continous set bits for max value " << maxString
812  << std::endl;
813 
814  return false;
815  }
816 
817  maxBitsH >>= 1;
818  counter++;
819  }
820 
821  dst = counter;
822  return true;
823 
824 }
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
unsigned long long uint64_t
Definition: Time.h:15
static std::atomic< unsigned int > counter
XERCES_CPP_NAMESPACE::DOMNode * TriggerMenuXmlParser::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 425 of file TriggerMenuXmlParser.cc.

References fetchall_from_DQM_v2::release, and AlCaHLTBitMon_QueryRunRegistry::string.

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

References AlCaHLTBitMon_QueryRunRegistry::string.

1262  {
1263 
1265 
1266  edm::LogError("TriggerMenuXmlParser") << "Invalid mode for single bit" << std::endl;
1267 
1268  return -1;
1269  }
1270 
1271  std::string tmpStr = getXMLTextValue(node);
1272  if (tmpStr == "0") {
1273  return 0;
1274  }
1275  else if (tmpStr == "1") {
1276  return 1;
1277  }
1278  else {
1279  edm::LogError("TriggerMenuXmlParser") << "Bad bit value (" << tmpStr << ")"
1280  << std::endl;
1281  return -1;
1282  }
1283 }
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
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
bool TriggerMenuXmlParser::getConditionChildValuesOld ( 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 838 of file TriggerMenuXmlParser.cc.

References i, LogDebug, and pileupDistInMC::num.

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

References LogDebug.

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

References i, and pileupDistInMC::num.

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

1225  {
1226 
1227  if (type == m_xmlConditionAttrType1s) {
1228  return 1;
1229  }
1230 
1231  if (type == m_xmlConditionAttrType2s) {
1232  return 2;
1233  }
1234 
1235  if (type == m_xmlConditionAttrType3s) {
1236  return 3;
1237  }
1238 
1239  if (type == m_xmlConditionAttrType4s) {
1240  return 4;
1241  }
1242 
1244  return 2;
1245  }
1246 
1248  return 2;
1249  }
1250 
1251  return -1;
1252 }
type
Definition: HCALResponse.h:21
static const std::string m_xmlConditionAttrType1s
static const std::string m_xmlConditionAttrType4s
static const std::string m_xmlConditionAttrType3s
static const std::string m_xmlConditionAttrType2cor
static const std::string m_xmlConditionAttrType2s
static const std::string m_xmlConditionAttrType2wsc
l1t::GtConditionType TriggerMenuXmlParser::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 1187 of file TriggerMenuXmlParser.cc.

References l1t::Type1s, l1t::Type2cor, l1t::Type2s, l1t::Type2wsc, l1t::Type3s, l1t::Type4s, and l1t::TypeNull.

1187  {
1188 
1189  if (type == m_xmlConditionAttrType1s) {
1190  return l1t::Type1s;
1191  }
1192 
1193  if (type == m_xmlConditionAttrType2s) {
1194  return l1t::Type2s;
1195  }
1196 
1197  if (type == m_xmlConditionAttrType3s) {
1198  return l1t::Type3s;
1199  }
1200 
1201  if (type == m_xmlConditionAttrType4s) {
1202  return l1t::Type4s;
1203  }
1204 
1206  return l1t::Type2wsc;
1207  }
1208 
1210  return l1t::Type2cor;
1211  }
1212 
1213  return l1t::TypeNull;
1214 }
type
Definition: HCALResponse.h:21
static const std::string m_xmlConditionAttrType1s
static const std::string m_xmlConditionAttrType4s
static const std::string m_xmlConditionAttrType3s
static const std::string m_xmlConditionAttrType2cor
static const std::string m_xmlConditionAttrType2s
static const std::string m_xmlConditionAttrType2wsc
std::string TriggerMenuXmlParser::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 499 of file TriggerMenuXmlParser.cc.

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

500  {
501 
502  XERCES_CPP_NAMESPACE_USE
503 
505 
506  // get attributes list
507  DOMNamedNodeMap* attributes = node->getAttributes();
508  if (attributes == 0) {
509  return ret;
510  }
511 
512  // get attribute node
513  XMLCh* attrName = XMLString::transcode(name.c_str());
514  DOMNode* attribNode = attributes->getNamedItem(attrName);
515 
516  XMLString::release(&attrName);
517  if (attribNode == 0) {
518  return ret;
519  }
520 
521  char* retCstr = XMLString::transcode(attribNode->getNodeValue());
522  ret = retCstr;
523  XMLString::release(&retCstr);
524 
525  return ret;
526 }
tuple node
Definition: Node.py:50
list attributes
Definition: asciidump.py:415
bool TriggerMenuXmlParser::getXMLHexTextValue ( const std::string &  childName,
boost::uint64_t &  dst 
)
private

Definition at line 725 of file TriggerMenuXmlParser.cc.

726  {
727 
728  boost::uint64_t dummyH; // dummy for eventual higher 64bit
729  boost::uint64_t tempUInt; // temporary unsigned integer
730 
731  if ( !getXMLHexTextValue128( childName, tempUInt, dummyH) ) {
732  return false;
733  }
734 
735  if (dummyH != 0) {
736  edm::LogError("TriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
737  return false;
738  }
739 
740  dst = tempUInt;
741 
742  return true;
743 }
bool getXMLHexTextValue128(const std::string &childName, boost::uint64_t &dstL, boost::uint64_t &dstH)
unsigned long long uint64_t
Definition: Time.h:15
bool TriggerMenuXmlParser::getXMLHexTextValue128 ( const std::string &  childName,
boost::uint64_t &  dstL,
boost::uint64_t &  dstH 
)
private

Definition at line 678 of file TriggerMenuXmlParser.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

679  {
680 
681  boost::uint64_t tempUIntH, tempUIntL;
682 
683  std::string tempStr = childName;
684  if ( !hexString2UInt128(tempStr, tempUIntL, tempUIntH) ) {
685  return false;
686  }
687 
688  dstL = tempUIntL;
689  dstH = tempUIntH;
690 
691  return true;
692 }
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
unsigned long long uint64_t
Definition: Time.h:15
bool TriggerMenuXmlParser::getXMLHexTextValue128Old ( 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 655 of file TriggerMenuXmlParser.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

656  {
657 
658  if (node == 0) {
659 
660  LogDebug("TriggerMenuXmlParser") << "node == 0 in " << __PRETTY_FUNCTION__ << std::endl;
661 
662  return false;
663  }
664 
665  boost::uint64_t tempUIntH, tempUIntL;
666 
667  std::string tempStr = getXMLTextValue(node);
668  if ( !hexString2UInt128(tempStr, tempUIntL, tempUIntH) ) {
669  return false;
670  }
671 
672  dstL = tempUIntL;
673  dstH = tempUIntH;
674 
675  return true;
676 }
#define LogDebug(id)
tuple node
Definition: Node.py:50
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
unsigned long long uint64_t
Definition: Time.h:15
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
bool TriggerMenuXmlParser::getXMLHexTextValueOld ( 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 705 of file TriggerMenuXmlParser.cc.

706  {
707 
708  boost::uint64_t dummyH; // dummy for eventual higher 64bit
709  boost::uint64_t tempUInt; // temporary unsigned integer
710 
711  if ( !getXMLHexTextValue128Old(node, tempUInt, dummyH) ) {
712  return false;
713  }
714 
715  if (dummyH != 0) {
716  edm::LogError("TriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
717  return false;
718  }
719 
720  dst = tempUInt;
721 
722  return true;
723 }
tuple node
Definition: Node.py:50
bool getXMLHexTextValue128Old(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
unsigned long long uint64_t
Definition: Time.h:15
std::string TriggerMenuXmlParser::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 536 of file TriggerMenuXmlParser.cc.

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

536  {
537 
538  XERCES_CPP_NAMESPACE_USE
539 
541 
542  DOMNode* n1 = node;
543  if (n1 == 0) {
544  return ret;
545  }
546 
547  const XMLCh* retXmlCh = n1->getTextContent();
548  if (retXmlCh == 0) {
549  return ret;
550  }
551 
552  char* retCstr = XMLString::transcode(retXmlCh);
553  XMLString::trim(retCstr); // trim spaces
554 
555  ret = retCstr;
556  XMLString::release(&retCstr);
557 
558  return ret;
559 }
tuple node
Definition: Node.py:50
const AlgorithmMap& l1t::TriggerMenuXmlParser::gtAlgorithmAliasMap ( ) const
inline

get / set the algorithm map (by alias)

Definition at line 274 of file TriggerMenuXmlParser.h.

References m_algorithmAliasMap.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

274  {
275  return m_algorithmAliasMap;
276  }
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
const std::string& l1t::TriggerMenuXmlParser::gtAlgorithmImplementation ( ) const
inline

Definition at line 335 of file TriggerMenuXmlParser.h.

References m_algorithmImplementation.

335  {
337  }
const AlgorithmMap& l1t::TriggerMenuXmlParser::gtAlgorithmMap ( ) const
inline

get / set the algorithm map (by name)

Definition at line 267 of file TriggerMenuXmlParser.h.

References m_algorithmMap.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

267  {
268  return m_algorithmMap;
269  }
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
const std::vector<ConditionMap>& l1t::TriggerMenuXmlParser::gtConditionMap ( ) const
inline

get / set / build the condition maps

Definition at line 119 of file TriggerMenuXmlParser.h.

References m_conditionMap.

119  {
120  return m_conditionMap;
121  }
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
const unsigned int l1t::TriggerMenuXmlParser::gtNumberConditionChips ( ) const
inline

get / set the number of condition chips in GTL

Definition at line 74 of file TriggerMenuXmlParser.h.

References m_numberConditionChips.

74  {
76  }
unsigned int m_numberConditionChips
hardware limits
const unsigned int l1t::TriggerMenuXmlParser::gtNumberL1JetCounts ( ) const
inline

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

Definition at line 110 of file TriggerMenuXmlParser.h.

References m_numberL1JetCounts.

110  {
111  return m_numberL1JetCounts;
112  }
unsigned int m_numberL1JetCounts
jet counts
const unsigned int l1t::TriggerMenuXmlParser::gtNumberPhysTriggers ( ) const
inline

get / set the number of physics trigger algorithms

Definition at line 96 of file TriggerMenuXmlParser.h.

References m_numberPhysTriggers.

96  {
97  return m_numberPhysTriggers;
98  }
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
const unsigned int l1t::TriggerMenuXmlParser::gtNumberTechTriggers ( ) const
inline

get / set the number of technical triggers

Definition at line 103 of file TriggerMenuXmlParser.h.

References m_numberTechTriggers.

103  {
104  return m_numberTechTriggers;
105  }
unsigned int m_numberTechTriggers
number of technical triggers
std::vector<int> l1t::TriggerMenuXmlParser::gtOrderConditionChip ( ) const
inline

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

Definition at line 89 of file TriggerMenuXmlParser.h.

References m_orderConditionChip.

89  {
90  return m_orderConditionChip;
91  }
std::vector< int > m_orderConditionChip
const unsigned int l1t::TriggerMenuXmlParser::gtPinsOnConditionChip ( ) const
inline

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

Definition at line 81 of file TriggerMenuXmlParser.h.

References m_pinsOnConditionChip.

81  {
82  return m_pinsOnConditionChip;
83  }
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
const std::string& l1t::TriggerMenuXmlParser::gtScaleDbKey ( ) const
inline

menu associated scale key

Definition at line 147 of file TriggerMenuXmlParser.h.

References m_scaleDbKey.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

147  {
148  return m_scaleDbKey;
149  }
std::string m_scaleDbKey
menu associated scale key
const AlgorithmMap& l1t::TriggerMenuXmlParser::gtTechnicalTriggerMap ( ) const
inline

get / set the technical trigger map

Definition at line 281 of file TriggerMenuXmlParser.h.

References m_technicalTriggerMap.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

281  {
282  return m_technicalTriggerMap;
283  }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuAuthor ( ) const
inline

Definition at line 322 of file TriggerMenuXmlParser.h.

References m_triggerMenuAuthor.

322  {
323  return m_triggerMenuAuthor;
324  }
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuDate ( ) const
inline

Definition at line 316 of file TriggerMenuXmlParser.h.

References m_triggerMenuDate.

316  {
317  return m_triggerMenuDate;
318  }
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuDescription ( ) const
inline

Definition at line 328 of file TriggerMenuXmlParser.h.

References m_triggerMenuDescription.

328  {
330  }
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuImplementation ( ) const
inline

Definition at line 140 of file TriggerMenuXmlParser.h.

References m_triggerMenuImplementation.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

140  {
142  }
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuInterface ( ) const
inline

get / set the trigger menu names

Definition at line 126 of file TriggerMenuXmlParser.h.

References m_triggerMenuInterface.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

126  {
127  return m_triggerMenuInterface;
128  }
std::string m_triggerMenuInterface
menu names
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuInterfaceAuthor ( ) const
inline

Definition at line 302 of file TriggerMenuXmlParser.h.

References m_triggerMenuInterfaceAuthor.

302  {
304  }
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuInterfaceDate ( ) const
inline

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

Definition at line 296 of file TriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDate.

296  {
298  }
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuInterfaceDescription ( ) const
inline

Definition at line 308 of file TriggerMenuXmlParser.h.

References m_triggerMenuInterfaceDescription.

308  {
310  }
const std::string& l1t::TriggerMenuXmlParser::gtTriggerMenuName ( ) const
inline

Definition at line 133 of file TriggerMenuXmlParser.h.

References m_triggerMenuName.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

133  {
134  return m_triggerMenuName;
135  }
bool TriggerMenuXmlParser::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 571 of file TriggerMenuXmlParser.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

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

insert an algorithm into algorithm map

Definition at line 1028 of file TriggerMenuXmlParser.cc.

References L1GtAlgorithm::algoAlias(), L1GtAlgorithm::algoBitNumber(), L1GtAlgorithm::algoChipNumber(), L1GtAlgorithm::algoName(), L1GtAlgorithm::algoOutputPin(), LogTrace, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

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

insert a technical trigger into technical trigger map

Definition at line 1119 of file TriggerMenuXmlParser.cc.

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

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

Definition at line 1444 of file TriggerMenuXmlParser.cc.

References data, contentValuesCheck::ss, and relativeConstraints::value.

1444  {
1445  std::stringstream ss;
1446  ss << data;
1447  int value;
1448  ss >> value;
1449  return value;
1450 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename T >
std::string TriggerMenuXmlParser::l1t2string ( T  data)
private

Definition at line 1431 of file TriggerMenuXmlParser.cc.

References data, and contentValuesCheck::ss.

1431  {
1432  std::stringstream ss;
1433  ss << data;
1434  return ss.str();
1435 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::string TriggerMenuXmlParser::l1tDateTime2string ( l1t::DateTime  date)
private

Definition at line 1436 of file TriggerMenuXmlParser.cc.

References contentValuesCheck::ss.

1436  {
1437  std::stringstream ss;
1438  ss << std::setfill('0');
1439  ss << std::setw(4) << date.year() << "-" << std::setw(2) << date.month() << "-" << std::setw(2) << date.day() << "T";
1440  ss << std::setw(2) << date.hours() << ":" << std::setw(2) << date.minutes() << ":" << std::setw(2) << date.seconds();
1441  //ss << data;
1442  return ss.str();
1443 }
bool TriggerMenuXmlParser::parseAlgorithms ( l1t::AlgorithmList  algorithms)
private

parse all algorithms

Definition at line 3877 of file TriggerMenuXmlParser.cc.

References HLT_25ns14e33_v1_cff::algorithm, i, LogDebug, and LogTrace.

3877  {
3878 
3879  XERCES_CPP_NAMESPACE_USE
3880 
3881  LogTrace("TriggerMenuXmlParser") << "\nParsing algorithms" << std::endl;
3882 
3883  int chipNr = 1;
3884  LogDebug("l1t|Global") << " ====> algorithms " << std::endl;
3885  for( l1t::AlgorithmList::algorithm_const_iterator i = algorithms.algorithm().begin();
3886  i != algorithms.algorithm().end(); ++i ){
3887 
3888  l1t::Algorithm algorithm = (*i);
3889  LogDebug("l1t|Global")
3890  << algorithm.name() << " {"
3891  << " index: " << algorithm.index()
3892  << " equation: " << algorithm.logical_expression()
3893  << " comment: " << algorithm.comment()
3894  << " locked: " << algorithm.locked()
3895  << "}"
3896  << std::endl;
3897 
3898 
3899  workAlgorithm( algorithm, chipNr );
3900  }
3901 
3902 
3903  return true;
3904 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
bool workAlgorithm(l1t::Algorithm algorithm, unsigned int chipNr)
parse an algorithm and insert it into algorithm map.
#define LogTrace(id)
bool TriggerMenuXmlParser::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 2891 of file TriggerMenuXmlParser.cc.

2892  {
2893 
2894  XERCES_CPP_NAMESPACE_USE
2895 
2896  /*
2897  // get condition, particle name and type name
2898  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2899  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2900  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2901 
2902  if (particle != m_xmlConditionAttrObjectBptx) {
2903  edm::LogError("TriggerMenuXmlParser")
2904  << "\nError: wrong particle for Bptx condition ("
2905  << particle << ")" << std::endl;
2906  return false;
2907  }
2908 
2909  // object type and condition type
2910  // object type - irrelevant for BPTX conditions
2911  GtConditionType cType = TypeBptx;
2912 
2913  // no objects for BPTX conditions
2914 
2915  // set the boolean value for the ge_eq mode - irrelevant for BPTX conditions
2916  bool gEq = false;
2917 
2918  // now create a new BPTX condition
2919 
2920  L1GtBptxTemplate bptxCond(name);
2921 
2922  bptxCond.setCondType(cType);
2923  bptxCond.setCondGEq(gEq);
2924  bptxCond.setCondChipNr(chipNr);
2925 
2926  LogTrace("TriggerMenuXmlParser") << bptxCond << "\n" << std::endl;
2927 
2928  // insert condition into the map
2929  if ( !insertConditionIntoMap(bptxCond, chipNr)) {
2930 
2931  edm::LogError("TriggerMenuXmlParser")
2932  << " Error: duplicate condition (" << name
2933  << ")" << std::endl;
2934 
2935  return false;
2936  } else {
2937 
2938  (m_vecBptxTemplate[chipNr]).push_back(bptxCond);
2939 
2940  }
2941  */
2942 
2943  //
2944  return true;
2945 }
bool TriggerMenuXmlParser::parseCalo ( l1t::CalorimeterCondition  condCalo,
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.

DMP: Use dec instead of hex

Temporary

Definition at line 1838 of file TriggerMenuXmlParser.cc.

References CenJet, TauDecayModes::dec, CaloTemplate::CorrelationParameter::deltaEtaRange, CaloTemplate::CorrelationParameter::deltaEtaRangeLower, CaloTemplate::CorrelationParameter::deltaEtaRangeUpper, CaloTemplate::CorrelationParameter::deltaPhiMaxbits, CaloTemplate::CorrelationParameter::deltaPhiRange, CaloTemplate::CorrelationParameter::deltaPhiRangeLower, CaloTemplate::CorrelationParameter::deltaPhiRangeUpper, ForJet, edm::isDebugEnabled(), IsoEG, LogDebug, LogTrace, mergeVDriftHistosByStation::name, NoIsoEG, AlCaHLTBitMon_QueryRunRegistry::string, TauJet, and l1t::TypeNull.

1839  {
1840 
1841  XERCES_CPP_NAMESPACE_USE
1842 
1843  // get condition, particle name and type name
1844 
1845  std::string condition = "calo";
1846  std::string particle = l1t2string( condCalo.objectType() );
1847  std::string type = l1t2string( condCalo.type() );
1848  std::string name = l1t2string( condCalo.name() );
1849 
1850  LogDebug("l1t|Global")
1851  << "\n ****************************************** "
1852  << "\n DARRENS TEST OUTPUT (in parseCalo) "
1853  << "\n condition = " << condition
1854  << "\n particle = " << particle
1855  << "\n type = " << type
1856  << "\n name = " << name
1857  << std::endl;
1858 
1859 
1860  // determine object type type
1861  L1GtObject caloObjType;
1862 
1863  if (particle == m_xmlConditionAttrObjectNoIsoEG) {
1864  caloObjType = NoIsoEG;
1865  }
1866  else if (particle == m_xmlConditionAttrObjectIsoEG) {
1867  caloObjType = IsoEG;
1868  }
1869  else if (particle == m_xmlConditionAttrObjectCenJet) {
1870  caloObjType = CenJet;
1871  }
1872  else if (particle == m_xmlConditionAttrObjectTauJet) {
1873  caloObjType = TauJet;
1874  }
1875  else if (particle == m_xmlConditionAttrObjectForJet) {
1876  caloObjType = ForJet;
1877  }
1878  else {
1879  edm::LogError("TriggerMenuXmlParser") << "Wrong particle for calo-condition ("
1880  << particle << ")" << std::endl;
1881  return false;
1882  }
1883 
1884  if( type=="double_wsc" ) type = "2_wsc";
1885  else if( type=="single" ) type = "1_s";
1886  else if( type=="double" ) type = "2_s";
1887  else if( type=="triple" ) type = "3";
1888  else if( type=="quad" ) type = "4";
1889 
1890 
1891  std::string str_etComparison = l1t2string( condCalo.comparison_operator() );
1892 
1893  int nrObj = getNumFromType(type);
1894  if (nrObj < 0) {
1895  edm::LogError("TriggerMenuXmlParser") << "Unknown type for calo-condition (" << type
1896  << ")" << "\nCan not determine number of trigger objects. " << std::endl;
1897  return false;
1898  }
1899 
1900  // get greater equal flag
1901  int intGEq = ( str_etComparison=="ge" ) ? 1 : 0;
1902  if (intGEq < 0) {
1903  edm::LogError("TriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
1904  << std::endl;
1905  return false;
1906  }
1907  // set the boolean value for the ge_eq mode
1908  bool gEq = (intGEq != 0);
1909 
1910  // get values
1911 
1912  // temporary storage of the parameters
1913  std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1914  CaloTemplate::CorrelationParameter corrParameter;
1915 
1916  // need at least one value for deltaPhiRange
1917  std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1918  tmpValues.reserve( nrObj );
1919 
1920  if( int(condCalo.objectRequirements().objectRequirement().size())!=nrObj ){
1921  edm::LogError("TriggerMenuXmlParser") << " condCalo objects: nrObj = " << nrObj
1922  << "condCalo.objectRequirements().objectRequirement().size() = "
1923  << condCalo.objectRequirements().objectRequirement().size()
1924  << std::endl;
1925  return false;
1926  }
1927 
1928 
1929  std::string str_condCalo = "";
1930  boost::uint64_t tempUIntH, tempUIntL;
1931  boost::uint64_t dst;
1932  int cnt = 0;
1933  for( l1t::CalorimeterObjectRequirements::objectRequirement_const_iterator objPar = condCalo.objectRequirements().objectRequirement().begin();
1934  objPar != condCalo.objectRequirements().objectRequirement().end(); ++objPar ){
1935 
1936  // ET Threshold
1937  str_condCalo = l1t2string( objPar->etThreshold() );
1938  if( !getXMLHexTextValue(str_condCalo, dst) ) return false;
1939  //if( cnt<nrObj ) objParameter[cnt].etThreshold = dst;
1941  if( cnt<nrObj ) objParameter[cnt].etThreshold = objPar->etThreshold();
1942 
1943  // Eta Range
1944  //str_condCalo = "ffff";
1945  str_condCalo = "7f7f";
1946  //str_condCalo = "0f0f";
1947  if( !getXMLHexTextValue(str_condCalo, dst) ) return false;
1948  if( cnt<nrObj ) objParameter[cnt].etaRange = dst;
1949 
1950  // Phi Range
1951  str_condCalo = "3ffff";
1952  if( !getXMLHexTextValue(str_condCalo, dst) ) return false;
1953  if( cnt<nrObj ) objParameter[cnt].phiRange = dst;
1954 
1955 
1956 
1957  int cntEta=0;
1958  unsigned int etaWindowLower=-1, etaWindowUpper=-1, etaWindowVetoLower=-1, etaWindowVetoUpper=-1;
1959  // Temporary before translation
1960  for( l1t::CalorimeterObjectRequirement::etaWindow_const_iterator etaWindow =objPar->etaWindow().begin();
1961  etaWindow != objPar->etaWindow().end(); ++etaWindow ){
1962 
1963  LogDebug("l1t|Global")
1964  << "\n etaWindow lower = " << etaWindow->lower()
1965  << "\n etaWindow upper = " << etaWindow->upper()
1966  << std::endl;
1967  if( cntEta==0 ){ etaWindowLower = etaWindow->lower(); etaWindowUpper = etaWindow->upper(); }
1968  else if( cntEta==1 ){ etaWindowVetoLower = etaWindow->lower(); etaWindowVetoUpper = etaWindow->upper(); }
1969  cntEta++;
1970  }
1971 
1972  int cntPhi=0;
1973  unsigned int phiWindowLower=-1, phiWindowUpper=-1, phiWindowVetoLower=-1, phiWindowVetoUpper=-1;
1974  for( l1t::CalorimeterObjectRequirement::phiWindow_const_iterator phiWindow =objPar->phiWindow().begin();
1975  phiWindow != objPar->phiWindow().end(); ++phiWindow ){
1976 
1977  LogDebug("l1t|Global")
1978  << "\n phiWindow begin = " << phiWindow->lower()
1979  << "\n phiWindow end = " << phiWindow->upper()
1980  << std::endl;
1981 
1982  if( cntPhi==0 ){ phiWindowLower = phiWindow->lower(); phiWindowUpper = phiWindow->upper(); }
1983  else if( cntPhi==1 ){ phiWindowVetoLower = phiWindow->lower(); phiWindowVetoUpper = phiWindow->upper(); }
1984  cntPhi++;
1985  }
1986 
1987  objParameter[cnt].etaWindowLower = etaWindowLower;
1988  objParameter[cnt].etaWindowUpper = etaWindowUpper;
1989  objParameter[cnt].etaWindowVetoLower = etaWindowVetoLower;
1990  objParameter[cnt].etaWindowVetoUpper = etaWindowVetoUpper;
1991 
1992  objParameter[cnt].phiWindowLower = phiWindowLower;
1993  objParameter[cnt].phiWindowUpper = phiWindowUpper;
1994  objParameter[cnt].phiWindowVetoLower = phiWindowVetoLower;
1995  objParameter[cnt].phiWindowVetoUpper = phiWindowVetoUpper;
1996 
1997 
1998  // Output for debugging
1999  LogDebug("l1t|Global")
2000  << "\n Calo ET high threshold (hex) for calo object " << cnt << " = "
2001  << std::hex << objParameter[cnt].etThreshold << std::dec
2002  << "\n etaWindow (hex) for calo object " << cnt << " = "
2003  << std::hex << objParameter[cnt].etaRange << std::dec
2004  << "\n phiRange (hex) for calo object " << cnt << " = "
2005  << std::hex << objParameter[cnt].phiRange << std::dec
2006  << "\n etaWindow Lower / Upper for calo object " << cnt << " = "
2007  << objParameter[cnt].etaWindowLower << " / " << objParameter[cnt].etaWindowUpper
2008  << "\n etaWindowVeto Lower / Upper for calo object " << cnt << " = "
2009  << objParameter[cnt].etaWindowVetoLower << " / " << objParameter[cnt].etaWindowVetoUpper
2010  << "\n phiWindow Lower / Upper for calo object " << cnt << " = "
2011  << objParameter[cnt].phiWindowLower << " / " << objParameter[cnt].phiWindowUpper
2012  << "\n phiWindowVeto Lower / Upper for calo object " << cnt << " = "
2013  << objParameter[cnt].phiWindowVetoLower << " / " << objParameter[cnt].phiWindowVetoUpper
2014  << std::endl;
2015 
2016  cnt++;
2017  }
2018 
2019 
2020 
2021  // indicates if a correlation is used
2022  bool wscVal = (type == m_xmlConditionAttrType2wsc );
2023 
2024  if( wscVal ){
2025 
2026  xsd::cxx::tree::optional<l1t::DeltaRequirement> condRanges = condCalo.deltaRequirement();
2027  LogDebug("l1t|Global")
2028  << "\t condRanges->deltaEtaRange().lower() = " << condRanges->deltaEtaRange().lower()
2029  << "\n\t condRanges->deltaEtaRange().upper() = " << condRanges->deltaEtaRange().upper()
2030  << "\n\t condRanges->deltaPhiRange().lower() = " << condRanges->deltaPhiRange().lower()
2031  << "\n\t condRanges->deltaPhiRange().upper() = " << condRanges->deltaPhiRange().upper()
2032  << std::endl;
2033 
2034  corrParameter.deltaEtaRangeLower = condRanges->deltaEtaRange().lower();
2035  corrParameter.deltaEtaRangeUpper = condRanges->deltaEtaRange().upper();
2036 
2037  corrParameter.deltaPhiRangeLower = condRanges->deltaPhiRange().lower();
2038  corrParameter.deltaPhiRangeUpper = condRanges->deltaPhiRange().upper();
2039 
2040  //
2042  //
2043 
2044  // Eta Range
2045  str_condCalo = "0003";
2046  if ( !hexString2UInt128(str_condCalo, tempUIntL, tempUIntH) ) {
2047  return false;
2048  }
2049  if( tempUIntH != 0 ){
2050  edm::LogError("TriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
2051  return false;
2052  }
2053  corrParameter.deltaEtaRange = tempUIntL;
2054 
2055  // Phi Range
2056  str_condCalo = "003";
2057  if ( !hexString2UInt128(str_condCalo, tempUIntL, tempUIntH) ) {
2058  return false;
2059  }
2060  if( tempUIntH != 0 ){
2061  edm::LogError("TriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
2062  return false;
2063  }
2064  corrParameter.deltaPhiRange = tempUIntL;
2065 
2066 
2067 
2068  // Max Phi Range
2069  std::string maxString = "3FF";
2070 
2071  unsigned int maxbits = 0;
2072 
2073  if ( !countConditionChildMaxBits(maxString, maxbits) ) {
2074  return false;
2075  }
2076 
2077  corrParameter.deltaPhiMaxbits = maxbits;
2078  LogTrace("TriggerMenuXmlParser")
2079  << " deltaPhiMaxbits (dec) = " << maxbits
2080  << std::endl;
2081  }
2082 
2083 
2084 
2085  // get the type of the condition, as defined in enum, from the condition type
2086  // as defined in the XML file
2087  GtConditionType cType = getTypeFromType(type);
2088  LogTrace("TriggerMenuXmlParser")
2089  << " Condition type (enum value) = " << cType
2090  << std::endl;
2091 
2092  if (cType == l1t::TypeNull) {
2093  edm::LogError("TriggerMenuXmlParser")
2094  << "Type for calo condition id l1t::TypeNull - it means not defined in the XML file."
2095  << "\nNumber of trigger objects is set to zero. " << std::endl;
2096  return false;
2097  }
2098 
2099  // object types - all same caloObjType
2100  std::vector<L1GtObject> objType(nrObj, caloObjType);
2101 
2102 
2103  int relativeBx = l1t2int( condCalo.relativeBx() );
2104 
2105  // now create a new calo condition
2106  CaloTemplate caloCond(name);
2107 
2108  caloCond.setCondType(cType);
2109  caloCond.setObjectType(objType);
2110  caloCond.setCondGEq(gEq);
2111  caloCond.setCondChipNr(chipNr);
2112  caloCond.setCondRelativeBx(relativeBx);
2113 
2114  caloCond.setConditionParameter(objParameter, corrParameter);
2115 
2116  if (edm::isDebugEnabled() ) {
2117 
2118  std::ostringstream myCoutStream;
2119  caloCond.print(myCoutStream);
2120  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2121 
2122  }
2123 
2124  // insert condition into the map
2125  if ( !insertConditionIntoMap(caloCond, chipNr)) {
2126 
2127  edm::LogError("TriggerMenuXmlParser")
2128  << " Error: duplicate condition (" << name << ")"
2129  << std::endl;
2130 
2131  return false;
2132  }
2133  else {
2134 
2135  if (corrFlag) {
2136  (m_corCaloTemplate[chipNr]).push_back(caloCond);
2137  }
2138  else {
2139  (m_vecCaloTemplate[chipNr]).push_back(caloCond);
2140  }
2141 
2142  }
2143 
2144  LogDebug("l1t|Global")
2145  << "\n intGEq = " << intGEq
2146  << " nrObj = " << nrObj
2147  << "\n ****************************************** "
2148  << std::endl;
2149 
2150 
2151  //
2152  return true;
2153 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
static const std::string m_xmlConditionAttrObjectIsoEG
bool isDebugEnabled()
bool insertConditionIntoMap(GtCondition &cond, const int chipNr)
GtConditionType
Definition: GtDefinitions.h:99
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
static const std::string m_xmlConditionAttrObjectCenJet
unsigned long long deltaEtaRange
Definition: CaloTemplate.h:79
unsigned long long deltaPhiRange
Definition: CaloTemplate.h:81
std::vector< std::vector< CaloTemplate > > m_corCaloTemplate
static const std::string m_xmlConditionAttrObjectForJet
static const std::string m_xmlConditionAttrObjectNoIsoEG
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
bool getXMLHexTextValue(const std::string &childName, boost::uint64_t &dst)
static const std::string m_xmlConditionAttrObjectTauJet
#define LogTrace(id)
l1t::GtConditionType getTypeFromType(const std::string &type)
unsigned long long uint64_t
Definition: Time.h:15
bool countConditionChildMaxBits(const std::string &childName, unsigned int &dst)
get the number of bits in the max attribute of a condition child
typedef for correlation parameters
Definition: CaloTemplate.h:77
static const std::string m_xmlConditionAttrType2wsc
int getNumFromType(const std::string &type)
get number of particles from condition type
bool TriggerMenuXmlParser::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 2550 of file TriggerMenuXmlParser.cc.

2551  {
2552 
2553  XERCES_CPP_NAMESPACE_USE
2554 
2555  /*
2556  // get condition, particle name and type name
2557  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2558  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2559  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2560 
2561  if (particle != m_xmlConditionAttrObjectCastor) {
2562  edm::LogError("TriggerMenuXmlParser")
2563  << "\nError: wrong particle for Castor condition ("
2564  << particle << ")" << std::endl;
2565  return false;
2566  }
2567 
2568  // object type and condition type
2569  // object type - irrelevant for CASTOR conditions
2570  GtConditionType cType = TypeCastor;
2571 
2572  // no objects for CASTOR conditions
2573 
2574  // set the boolean value for the ge_eq mode - irrelevant for CASTOR conditions
2575  bool gEq = false;
2576 
2577  // now create a new CASTOR condition
2578 
2579  L1GtCastorTemplate castorCond(name);
2580 
2581  castorCond.setCondType(cType);
2582  castorCond.setCondGEq(gEq);
2583  castorCond.setCondChipNr(chipNr);
2584 
2585 
2586  if (edm::isDebugEnabled() ) {
2587 
2588  std::ostringstream myCoutStream;
2589  castorCond.print(myCoutStream);
2590  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2591 
2592  }
2593 
2594  // insert condition into the map
2595  if ( !insertConditionIntoMap(castorCond, chipNr)) {
2596 
2597  edm::LogError("TriggerMenuXmlParser")
2598  << " Error: duplicate condition (" << name
2599  << ")" << std::endl;
2600 
2601  return false;
2602  } else {
2603 
2604  (m_vecCastorTemplate[chipNr]).push_back(castorCond);
2605 
2606  }
2607  */
2608 
2609  //
2610  return true;
2611 }
bool TriggerMenuXmlParser::parseConditions ( l1t::ConditionList  conditions)
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 3720 of file TriggerMenuXmlParser.cc.

References LogDebug, and LogTrace.

3720  {
3721 
3722  XERCES_CPP_NAMESPACE_USE
3723 
3724  LogTrace("TriggerMenuXmlParser") << "\nParsing conditions" << std::endl;
3725 
3726  int chipNr = 1;
3727  LogDebug("l1t|Global") << " ====> condCalorimeter" << std::endl;
3728  for (l1t::ConditionList::condCalorimeter_const_iterator condCalo = conditions.condCalorimeter().begin();
3729  condCalo != conditions.condCalorimeter().end(); ++condCalo ){
3730 
3731  LogDebug("l1t|Global")
3732  << condCalo->name() << " {"
3733  << " comment: " << condCalo->comment()
3734  << " locked: " << condCalo->locked()
3735  << "}"
3736  << std::endl;
3737 
3738  l1t::CalorimeterCondition condition = (*condCalo);
3739 
3740  parseCalo( condition, chipNr );
3741  }
3742 
3743  LogDebug("l1t|Global") << " ====> condMuon " << std::endl;
3744  for (l1t::ConditionList::condMuon_const_iterator condMu = conditions.condMuon().begin();
3745  condMu != conditions.condMuon().end(); ++condMu ){
3746 
3747  LogDebug("l1t|Global")
3748  << condMu->name() << " {"
3749  << " comment: " << condMu->comment()
3750  << " locked: " << condMu->locked()
3751  << "}"
3752  << std::endl;
3753 
3754  l1t::MuonCondition condition = (*condMu);
3755 
3756  parseMuon( condition, chipNr );
3757  }
3758 
3759 
3760  return true;
3761 }
#define LogDebug(id)
bool parseCalo(l1t::CalorimeterCondition condCalo, unsigned int chipNr=0, const bool corrFlag=false)
parse a calorimeter condition
bool parseMuon(l1t::MuonCondition condMu, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon condition
#define LogTrace(id)
bool TriggerMenuXmlParser::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 3029 of file TriggerMenuXmlParser.cc.

3031  {
3032 
3033  XERCES_CPP_NAMESPACE_USE
3034 
3035  // create a new correlation condition
3036  CorrelationTemplate correlationCond(name);
3037 
3038  // check that the condition does not exist already in the map
3039  if ( !insertConditionIntoMap(correlationCond, chipNr)) {
3040 
3041  edm::LogError("TriggerMenuXmlParser")
3042  << " Error: duplicate correlation condition (" << name << ")"
3043  << std::endl;
3044 
3045  return false;
3046  }
3047 
3048  /*
3049  // get condition, particle name and type name
3050  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
3051  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
3052  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
3053 
3054  std::cout << " ****************************************** " << std::endl;
3055  std::cout << " DARRENS TEST OUTPUT (in parseCorrelation) " << std::endl;
3056  std::cout << " condition = " << condition << std::endl;
3057  std::cout << " particle = " << particle << std::endl;
3058  std::cout << " type = " << type << std::endl;
3059  std::cout << " name = " << name << std::endl;
3060 
3061  LogTrace("TriggerMenuXmlParser") << " Condition category: "
3062  << condition << ", particle: " << particle << ", type: " << type
3063  << "\n" << std::endl;
3064 
3065  // condition type
3066  GtConditionType cType = l1t::Type2cor;
3067 
3068  // two objects (for sure)
3069  const int nrObj = 2;
3070 
3071  // object types and greater equal flag - filled in the loop
3072  int intGEq[nrObj] = { -1, -1 };
3073  std::vector<L1GtObject> objType(nrObj);
3074  std::vector<GtConditionCategory> condCateg(nrObj);
3075 
3076  // correlation flag and index in the cor*vector
3077  const bool corrFlag = true;
3078  int corrIndexVal[nrObj] = { -1, -1 };
3079 
3080  // get the subconditions
3081 
3082  DOMNode* conditionsNode = node->getFirstChild();
3083  std::string conditionNameNodeName;
3084  conditionsNode = findXMLChild(conditionsNode, "", true,
3085  &conditionNameNodeName);
3086 
3087 
3088  for (int iSubCond = 0; iSubCond < nrObj; ++iSubCond) {
3089 
3090  // get for sub-condition: category, object name and type name and condition name
3091  condition = getXMLAttribute(conditionsNode, m_xmlConditionAttrCondition);
3092  particle = getXMLAttribute(conditionsNode, m_xmlConditionAttrObject);
3093  type = getXMLAttribute(conditionsNode, m_xmlConditionAttrType);
3094 
3095  LogTrace("TriggerMenuXmlParser") << " Sub-condition category: "
3096  << condition << ", particle: " << particle << ", type: "
3097  << type << ", name: " << conditionNameNodeName << "\n"
3098  << std::endl;
3099 
3100  // call the appropriate function for this condition
3101  if (condition == m_xmlConditionAttrConditionMuon) {
3102  if (!parseMuon(conditionsNode, conditionNameNodeName, chipNr,
3103  corrFlag)) {
3104  edm::LogError("TriggerMenuXmlParser")
3105  << "Error parsing sub-condition " << condition << ")"
3106  << " with name " << conditionNameNodeName << std::endl;
3107 
3108  }
3109 
3110  // get greater equal flag
3111  intGEq[iSubCond] = getGEqFlag(conditionsNode,
3112  m_xmlTagPtHighThreshold);
3113  if (intGEq[iSubCond] < 0) {
3114  edm::LogError("TriggerMenuXmlParser")
3115  << "Error getting \"greater or equal\" flag"
3116  << " for sub-condition " << conditionNameNodeName
3117  << " for the correlation condition " << name
3118  << std::endl;
3119  return false;
3120  }
3121 
3122  // set object type and sub-condition category
3123  objType[iSubCond] = Mu;
3124  condCateg[iSubCond] = CondMuon;
3125  corrIndexVal[iSubCond] = (m_corMuonTemplate[chipNr]).size() - 1;
3126 
3127  }
3128  else if (condition == m_xmlConditionAttrConditionCalo) {
3129  if (!parseCalo(conditionsNode, conditionNameNodeName, chipNr,
3130  corrFlag)) {
3131  edm::LogError("TriggerMenuXmlParser")
3132  << "Error parsing sub-condition " << condition << ")"
3133  << " with name " << conditionNameNodeName << std::endl;
3134 
3135  }
3136 
3137  // get greater equal flag
3138  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagEtThreshold);
3139  if (intGEq[iSubCond] < 0) {
3140  edm::LogError("TriggerMenuXmlParser")
3141  << "Error getting \"greater or equal\" flag"
3142  << " for sub-condition " << conditionNameNodeName
3143  << " for the correlation condition " << name
3144  << std::endl;
3145  return false;
3146  }
3147 
3148  // set object type and sub-condition category
3149  if (particle == m_xmlConditionAttrObjectNoIsoEG) {
3150  objType[iSubCond] = NoIsoEG;
3151  }
3152  else if (particle == m_xmlConditionAttrObjectIsoEG) {
3153  objType[iSubCond] = IsoEG;
3154  }
3155  else if (particle == m_xmlConditionAttrObjectCenJet) {
3156  objType[iSubCond] = CenJet;
3157  }
3158  else if (particle == m_xmlConditionAttrObjectTauJet) {
3159  objType[iSubCond] = TauJet;
3160  }
3161  else if (particle == m_xmlConditionAttrObjectForJet) {
3162  objType[iSubCond] = ForJet;
3163  }
3164  else {
3165  edm::LogError("TriggerMenuXmlParser")
3166  << "Wrong object type " << particle
3167  << " for sub-condition " << conditionNameNodeName
3168  << " from the correlation condition " << name
3169  << std::endl;
3170  return false;
3171  }
3172 
3173  condCateg[iSubCond] = CondCalo;
3174  corrIndexVal[iSubCond] = (m_corCaloTemplate[chipNr]).size() - 1;
3175 
3176  }
3177  else if (condition == m_xmlConditionAttrConditionEnergySum) {
3178  if (!parseEnergySum(conditionsNode, conditionNameNodeName, chipNr,
3179  corrFlag)) {
3180  edm::LogError("TriggerMenuXmlParser")
3181  << "Error parsing sub-condition " << condition << ")"
3182  << " with name " << conditionNameNodeName << std::endl;
3183 
3184  }
3185 
3186  // get greater equal flag
3187  intGEq[iSubCond] = getGEqFlag(conditionsNode, m_xmlTagEtThreshold);
3188  if (intGEq[iSubCond] < 0) {
3189  edm::LogError("TriggerMenuXmlParser")
3190  << "Error getting \"greater or equal\" flag"
3191  << " for sub-condition " << conditionNameNodeName
3192  << " for the correlation condition " << name
3193  << std::endl;
3194  return false;
3195  }
3196 
3197  // set object type and sub-condition category
3198  if (particle == m_xmlConditionAttrObjectETM) {
3199  objType[iSubCond] = ETM;
3200  }
3201  else if (particle == m_xmlConditionAttrObjectETT) {
3202  objType[iSubCond] = ETT;
3203  }
3204  else if (particle == m_xmlConditionAttrObjectHTT) {
3205  objType[iSubCond] = HTT;
3206  }
3207  else if (particle == m_xmlConditionAttrObjectHTM) {
3208  objType[iSubCond] = HTM;
3209  }
3210  else {
3211  edm::LogError("TriggerMenuXmlParser")
3212  << "Wrong object type " << particle
3213  << " for sub-condition " << conditionNameNodeName
3214  << " from the correlation condition " << name
3215  << std::endl;
3216  return false;
3217  }
3218 
3219  condCateg[iSubCond] = CondEnergySum;
3220  corrIndexVal[iSubCond] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3221 
3222  }
3223  else {
3224  edm::LogError("TriggerMenuXmlParser")
3225  << "Unknown or un-adequate sub-condition (" << condition
3226  << ")" << " with name " << conditionNameNodeName
3227  << " for the correlation condition " << name << std::endl;
3228 
3229  return false;
3230  }
3231 
3232  conditionsNode = findXMLChild(conditionsNode->getNextSibling(), "",
3233  true, &conditionNameNodeName);
3234 
3235  }
3236 
3237  // get greater equal flag for the correlation condition
3238  bool gEq = true;
3239  if (intGEq[0] != intGEq[1]) {
3240  edm::LogError("TriggerMenuXmlParser")
3241  << "Inconsistent GEq flags for sub-conditions (" << condition
3242  << ")" << " with name " << conditionNameNodeName
3243  << " for the correlation condition " << name << std::endl;
3244  return false;
3245 
3246  }
3247  else {
3248  gEq = (intGEq[0] != 0);
3249 
3250  }
3251 
3252  // correlation parameters
3253 
3254  // temporary storage of the parameters
3255  CorrelationTemplate::CorrelationParameter corrParameter;
3256  std::vector<boost::uint64_t> tmpValues(nrObj);
3257 
3258  // get deltaEtaRange
3259 // if ( !getConditionChildValuesOld(node, m_xmlTagDeltaEta, 1, tmpValues) ) {
3260 // return false;
3261 // }
3262 //
3263 // corrParameter.deltaEtaRange = tmpValues[0];
3264 
3265  XERCES_CPP_NAMESPACE::DOMNode* node1 = findXMLChild(node->getFirstChild(),
3266  m_xmlTagDeltaEta);
3267 
3268  std::string valString;
3269 
3270  if (node1 == 0) {
3271  edm::LogError("TriggerMenuXmlParser")
3272  << " Could not get deltaEta for correlation condition "
3273  << name << ". " << std::endl;
3274  return false;
3275  }
3276  else {
3277  valString = getXMLTextValue(node1);
3278  }
3279 
3280  corrParameter.deltaEtaRange = valString;
3281 
3282 // // deltaPhi is larger than 64bit
3283 // if ( !getXMLHexTextValue128Old(findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi),
3284 // tmpValues[0], tmpValues[1])) {
3285 // edm::LogError("TriggerMenuXmlParser")
3286 // << " Could not get deltaPhi for correlation condition " << name << ". "
3287 // << std::endl;
3288 // return false;
3289 // }
3290 //
3291 // corrParameter.deltaPhiRange = tmpValues[0];
3292 
3293  node1 = findXMLChild(node->getFirstChild(), m_xmlTagDeltaPhi);
3294 
3295  if (node1 == 0) {
3296  return false;
3297  edm::LogError("TriggerMenuXmlParser")
3298  << " Could not get deltaPhi for correlation condition "
3299  << name << ". " << std::endl;
3300  }
3301  else {
3302  valString = getXMLTextValue(node1);
3303  }
3304 
3305  corrParameter.deltaPhiRange = valString;
3306 
3307  // get maximum number of bits for delta phi
3308  //LogTrace("TriggerMenuXmlParser")
3309  //<< " Counting deltaPhiMaxbits"
3310  //<< std::endl;
3311 
3312  unsigned int maxbits;
3313 
3314  if ( !countConditionChildMaxBits(node, m_xmlTagDeltaPhi, maxbits) ) {
3315  return false;
3316  }
3317 
3318  corrParameter.deltaPhiMaxbits = maxbits;
3319  //LogTrace("TriggerMenuXmlParser")
3320  //<< " deltaPhiMaxbits (dec) = " << maxbits
3321  //<< std::endl;
3322 
3323 
3324  // fill the correlation condition
3325  correlationCond.setCondType(cType);
3326  correlationCond.setObjectType(objType);
3327  correlationCond.setCondGEq(gEq);
3328  correlationCond.setCondChipNr(chipNr);
3329 
3330  correlationCond.setCond0Category(condCateg[0]);
3331  correlationCond.setCond1Category(condCateg[1]);
3332 
3333  correlationCond.setCond0Index(corrIndexVal[0]);
3334  correlationCond.setCond1Index(corrIndexVal[1]);
3335 
3336  correlationCond.setCorrelationParameter(corrParameter);
3337 
3338  if (edm::isDebugEnabled() ) {
3339 
3340  std::ostringstream myCoutStream;
3341  correlationCond.print(myCoutStream);
3342  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n"
3343  << std::endl;
3344 
3345  }
3346 
3347  // insert condition into the map
3348  // condition is not duplicate, check was done at the beginning
3349 
3350  (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
3351 
3352  */
3353  //
3354  return true;
3355 }
bool insertConditionIntoMap(GtCondition &cond, const int chipNr)
bool TriggerMenuXmlParser::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 2166 of file TriggerMenuXmlParser.cc.

2168  {
2169 
2170  XERCES_CPP_NAMESPACE_USE
2171 
2172  /*
2173  // get condition, particle name and type name
2174  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2175  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2176  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2177 
2178  // determine object type type
2179  L1GtObject energySumObjType;
2180  GtConditionType cType;
2181 
2182  if ((particle == m_xmlConditionAttrObjectETM) && (type == m_xmlConditionAttrObjectETM)) {
2183 
2184  energySumObjType = ETM;
2185  cType = TypeETM;
2186 
2187  }
2188  else if ((particle == m_xmlConditionAttrObjectETT) && (type == m_xmlConditionAttrObjectETT)) {
2189 
2190  energySumObjType = ETT;
2191  cType = TypeETT;
2192 
2193  }
2194  else if ((particle == m_xmlConditionAttrObjectHTT) && (type == m_xmlConditionAttrObjectHTT)) {
2195 
2196  energySumObjType = HTT;
2197  cType = TypeHTT;
2198 
2199  }
2200  else if ((particle == m_xmlConditionAttrObjectHTM) && (type == m_xmlConditionAttrObjectHTM)) {
2201 
2202  energySumObjType = HTM;
2203  cType = TypeHTM;
2204 
2205  }
2206  else {
2207  edm::LogError("TriggerMenuXmlParser")
2208  << "Wrong particle or type for energy-sum condition (" << particle << ", " << type
2209  << ")" << std::endl;
2210  return false;
2211  }
2212 
2213  // global object
2214  int nrObj = 1;
2215 
2216  // get greater equal flag
2217 
2218  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
2219  if (intGEq < 0) {
2220  edm::LogError("TriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2221  << std::endl;
2222  return false;
2223  }
2224  // set the boolean value for the ge_eq mode
2225  bool gEq = (intGEq != 0);
2226 
2227  // get values
2228 
2229  // temporary storage of the parameters
2230  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(nrObj);
2231 
2232  // need at least two values for phi
2233  std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
2234 
2235  // get etThreshold values and fill into structure
2236  if ( !getConditionChildValuesOld(node, m_xmlTagEtThreshold, nrObj, tmpValues) ) {
2237  return false;
2238  }
2239 
2240  for (int i = 0; i < nrObj; i++) {
2241  objParameter[i].etThreshold = tmpValues[i];
2242 
2243  //LogTrace("TriggerMenuXmlParser")
2244  //<< " EnergySum ET high threshold (hex) for energySum object " << i << " = "
2245  //<< std::hex << objParameter[i].etThreshold << std::dec
2246  //<< std::endl;
2247 
2248  // for ETM and HTM read phi value
2249  // phi is larger than 64 bits for ETM - it needs two 64bits words
2250  // phi is less than 64 bits for HTM - it needs one 64bits word
2251  if (energySumObjType == ETM) {
2252 
2253  if (!getXMLHexTextValue128Old(
2254  findXMLChild(node->getFirstChild(), m_xmlTagPhi), tmpValues[0], tmpValues[1])) {
2255  edm::LogError("TriggerMenuXmlParser")
2256  << " Could not get phi for ETM condition (" << name << ")" << std::endl;
2257  return false;
2258  }
2259 
2260  objParameter[i].phiRange0Word = tmpValues[0];
2261  objParameter[i].phiRange1Word = tmpValues[1];
2262 
2263  } else if (energySumObjType == HTM) {
2264 
2265  if (!getXMLHexTextValueOld(findXMLChild(node->getFirstChild(), m_xmlTagPhi), tmpValues[0])) {
2266  edm::LogError("TriggerMenuXmlParser")
2267  << " Could not get phi for HTM condition (" << name << ")" << std::endl;
2268  return false;
2269  }
2270 
2271  objParameter[i].phiRange0Word = tmpValues[0];
2272 
2273  }
2274 
2275  // get energyOverflow logical flag and fill into structure
2276  DOMNode* n1;
2277  if ( (n1 = findXMLChild(node->getFirstChild(), m_xmlTagEtThreshold)) == 0) {
2278  edm::LogError("TriggerMenuXmlParser")
2279  << " Could not get energyOverflow for EnergySum condition (" << name << ")"
2280  << std::endl;
2281  return false;
2282  }
2283  if ( (n1 = findXMLChild(n1->getFirstChild(), m_xmlTagEnergyOverflow)) == 0) {
2284  edm::LogError("TriggerMenuXmlParser")
2285  << " Could not get energyOverflow for EnergySum condition (" << name << ")"
2286  << std::endl;
2287  return false;
2288  }
2289 
2290  int tmpInt = getBitFromNode(n1);
2291  if (tmpInt == 0) {
2292  objParameter[i].energyOverflow = false;
2293 
2294  //LogTrace("TriggerMenuXmlParser")
2295  //<< " EnergySum energyOverflow logical flag (hex) = "
2296  //<< std::hex << objParameter[i].energyOverflow << std::dec
2297  //<< std::endl;
2298  }
2299  else if (tmpInt == 1) {
2300  objParameter[i].energyOverflow = true;
2301 
2302  //LogTrace("TriggerMenuXmlParser")
2303  //<< " EnergySum energyOverflow logical flag (hex) = "
2304  //<< std::hex << objParameter[i].energyOverflow << std::dec
2305  //<< std::endl;
2306  }
2307  else {
2308  LogTrace("TriggerMenuXmlParser")
2309  << " EnergySum energyOverflow logical flag (hex) = " << std::hex << tmpInt
2310  << std::dec << " - wrong value! " << std::endl;
2311  return false;
2312  }
2313 
2314  }
2315 
2316  // object types - all same energySumObjType
2317  std::vector<L1GtObject> objType(nrObj, energySumObjType);
2318 
2319  // now create a new energySum condition
2320 
2321  L1GtEnergySumTemplate energySumCond(name);
2322 
2323  energySumCond.setCondType(cType);
2324  energySumCond.setObjectType(objType);
2325  energySumCond.setCondGEq(gEq);
2326  energySumCond.setCondChipNr(chipNr);
2327 
2328  energySumCond.setConditionParameter(objParameter);
2329 
2330  if (edm::isDebugEnabled() ) {
2331 
2332  std::ostringstream myCoutStream;
2333  energySumCond.print(myCoutStream);
2334  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2335 
2336  }
2337 
2338  // insert condition into the map
2339  if ( !insertConditionIntoMap(energySumCond, chipNr)) {
2340 
2341  edm::LogError("TriggerMenuXmlParser")
2342  << " Error: duplicate condition (" << name << ")"
2343  << std::endl;
2344 
2345  return false;
2346  }
2347  else {
2348 
2349  if (corrFlag) {
2350  (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2351 
2352  }
2353  else {
2354  (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2355  }
2356 
2357  }
2358  */
2359 
2360  //
2361  return true;
2362 }
bool TriggerMenuXmlParser::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 2960 of file TriggerMenuXmlParser.cc.

2961  {
2962 
2963  XERCES_CPP_NAMESPACE_USE
2964 
2965  /*
2966  // get condition, particle name and type name
2967  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2968  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2969  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2970 
2971  if (particle != m_xmlConditionAttrObjectGtExternal) {
2972  edm::LogError("TriggerMenuXmlParser")
2973  << "\nError: wrong particle for External condition ("
2974  << particle << ")" << std::endl;
2975  return false;
2976  }
2977 
2978  // object type and condition type
2979  // object type - irrelevant for External conditions
2980  GtConditionType cType = TypeExternal;
2981 
2982  // no objects for External conditions
2983 
2984  // set the boolean value for the ge_eq mode - irrelevant for External conditions
2985  bool gEq = false;
2986 
2987  // now create a new External condition
2988 
2989  L1GtExternalTemplate externalCond(name);
2990 
2991  externalCond.setCondType(cType);
2992  externalCond.setCondGEq(gEq);
2993  externalCond.setCondChipNr(chipNr);
2994 
2995  LogTrace("TriggerMenuXmlParser") << externalCond << "\n" << std::endl;
2996 
2997  // insert condition into the map
2998  if ( !insertConditionIntoMap(externalCond, chipNr)) {
2999 
3000  edm::LogError("TriggerMenuXmlParser")
3001  << " Error: duplicate condition (" << name
3002  << ")" << std::endl;
3003 
3004  return false;
3005  } else {
3006 
3007  (m_vecExternalTemplate[chipNr]).push_back(externalCond);
3008 
3009  }
3010  */
3011 
3012  //
3013  return true;
3014 }
bool TriggerMenuXmlParser::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 2626 of file TriggerMenuXmlParser.cc.

2627  {
2628 
2629  XERCES_CPP_NAMESPACE_USE
2630 
2631  /*
2632  // get condition, particle name and type name
2633  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2634  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2635  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2636 
2637  if (particle != m_xmlConditionAttrObjectHfBitCounts) {
2638  edm::LogError("TriggerMenuXmlParser") << "Wrong particle for HfBitCounts condition ("
2639  << particle << ")" << std::endl;
2640  return false;
2641  }
2642 
2643  // object type and condition type
2644  L1GtObject hfBitCountsObjType = HfBitCounts;
2645  GtConditionType cType = TypeHfBitCounts;
2646 
2647  // global object
2648  int nrObj = 1;
2649 
2650  // get greater equal flag
2651 
2652  int intGEq = getGEqFlag(node, m_xmlTagCountThreshold);
2653  if (intGEq < 0) {
2654  edm::LogError("TriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2655  << std::endl;
2656  return false;
2657  }
2658  // set the boolean value for the ge_eq mode
2659  bool gEq = (intGEq != 0);
2660 
2661  // get values
2662 
2663  // temporary storage of the parameters
2664  std::vector<L1GtHfBitCountsTemplate::ObjectParameter> objParameter(nrObj);
2665 
2666  // get countIndex value and fill into structure
2667  // they are expressed in base 10
2668  char* endPtr = const_cast<char*>(type.c_str());
2669  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2670 
2671  if (*endPtr != 0) {
2672 
2673  LogDebug("TriggerMenuXmlParser") << "Unable to convert " << type << " to dec."
2674  << std::endl;
2675 
2676  return false;
2677  }
2678 
2679  // test if count index is out of range FIXME introduce m_numberL1HfBitCounts?
2680  //if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1HfBitCounts))) {
2681  // LogDebug("TriggerMenuXmlParser") << "Count index " << typeInt
2682  // << " outside range [0, " << m_numberL1HfBitCounts << "]" << std::endl;
2683  //
2684  // return false;
2685  //}
2686 
2687  objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
2688 
2689  // get count threshold values and fill into structure
2690  std::vector<boost::uint64_t> tmpValues(nrObj);
2691 
2692  if ( !getConditionChildValuesOld(node, m_xmlTagCountThreshold, nrObj, tmpValues) ) {
2693  return false;
2694  }
2695 
2696  for (int i = 0; i < nrObj; i++) {
2697  objParameter[i].countThreshold = tmpValues[i];
2698 
2699  //LogTrace("TriggerMenuXmlParser")
2700  //<< " HfBitCounts count threshold (hex) for HfBitCounts object " << i << " = "
2701  //<< std::hex << objParameter[i].countThreshold << std::dec
2702  //<< std::endl;
2703 
2704  }
2705 
2706  // object types - all same objType
2707  std::vector<L1GtObject> objType(nrObj, hfBitCountsObjType);
2708 
2709  // now create a new HfBitCounts condition
2710 
2711  L1GtHfBitCountsTemplate hfBitCountsCond(name);
2712 
2713  hfBitCountsCond.setCondType(cType);
2714  hfBitCountsCond.setObjectType(objType);
2715  hfBitCountsCond.setCondGEq(gEq);
2716  hfBitCountsCond.setCondChipNr(chipNr);
2717 
2718  hfBitCountsCond.setConditionParameter(objParameter);
2719 
2720  if (edm::isDebugEnabled() ) {
2721 
2722  std::ostringstream myCoutStream;
2723  hfBitCountsCond.print(myCoutStream);
2724  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2725 
2726  }
2727 
2728  // insert condition into the map
2729  if ( !insertConditionIntoMap(hfBitCountsCond, chipNr)) {
2730 
2731  edm::LogError("TriggerMenuXmlParser") << " Error: duplicate condition (" << name
2732  << ")" << std::endl;
2733 
2734  return false;
2735  } else {
2736 
2737  (m_vecHfBitCountsTemplate[chipNr]).push_back(hfBitCountsCond);
2738 
2739  }
2740 
2741  */
2742  //
2743  return true;
2744 }
bool TriggerMenuXmlParser::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 2759 of file TriggerMenuXmlParser.cc.

2760  {
2761 
2762  XERCES_CPP_NAMESPACE_USE
2763 
2764  /*
2765  // get condition, particle name and type name
2766  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2767  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2768  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2769 
2770  if (particle != m_xmlConditionAttrObjectHfRingEtSums) {
2771  edm::LogError("TriggerMenuXmlParser") << "Wrong particle for HfRingEtSums condition ("
2772  << particle << ")" << std::endl;
2773  return false;
2774  }
2775 
2776  // object type and condition type
2777  L1GtObject hfRingEtSumsObjType = HfRingEtSums;
2778  GtConditionType cType = TypeHfRingEtSums;
2779 
2780  // global object
2781  int nrObj = 1;
2782 
2783  // get greater equal flag
2784 
2785  int intGEq = getGEqFlag(node, m_xmlTagEtThreshold);
2786  if (intGEq < 0) {
2787  edm::LogError("TriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2788  << std::endl;
2789  return false;
2790  }
2791  // set the boolean value for the ge_eq mode
2792  bool gEq = (intGEq != 0);
2793 
2794  // get values
2795 
2796  // temporary storage of the parameters
2797  std::vector<L1GtHfRingEtSumsTemplate::ObjectParameter> objParameter(nrObj);
2798 
2799  // get etSumIndex value and fill into structure
2800  // they are expressed in base 10
2801  char* endPtr = const_cast<char*>(type.c_str());
2802  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2803 
2804  if (*endPtr != 0) {
2805 
2806  LogDebug("TriggerMenuXmlParser") << "Unable to convert " << type << " to dec."
2807  << std::endl;
2808 
2809  return false;
2810  }
2811 
2812  // test if ET sum index is out of range FIXME introduce m_numberL1HfRingEtSums?
2813  //if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1HfRingEtSums))) {
2814  // LogDebug("TriggerMenuXmlParser") << "Count index " << typeInt
2815  // << " outside range [0, " << m_numberL1HfRingEtSums << "]" << std::endl;
2816  //
2817  // return false;
2818  //}
2819 
2820  objParameter[0].etSumIndex = static_cast<unsigned int>(typeInt);
2821 
2822  // get ET sum threshold values and fill into structure
2823  std::vector<boost::uint64_t> tmpValues(nrObj);
2824 
2825  if ( !getConditionChildValuesOld(node, m_xmlTagEtThreshold, nrObj, tmpValues) ) {
2826  return false;
2827  }
2828 
2829  for (int i = 0; i < nrObj; i++) {
2830  objParameter[i].etSumThreshold = tmpValues[i];
2831 
2832  //LogTrace("TriggerMenuXmlParser")
2833  //<< " HfRingEtSums count threshold (hex) for HfRingEtSums object " << i << " = "
2834  //<< std::hex << objParameter[i].etSumThreshold << std::dec
2835  //<< std::endl;
2836 
2837  }
2838 
2839  // object types - all same objType
2840  std::vector<L1GtObject> objType(nrObj, hfRingEtSumsObjType);
2841 
2842  // now create a new HfRingEtSums condition
2843 
2844  L1GtHfRingEtSumsTemplate hfRingEtSumsCond(name);
2845 
2846  hfRingEtSumsCond.setCondType(cType);
2847  hfRingEtSumsCond.setObjectType(objType);
2848  hfRingEtSumsCond.setCondGEq(gEq);
2849  hfRingEtSumsCond.setCondChipNr(chipNr);
2850 
2851  hfRingEtSumsCond.setConditionParameter(objParameter);
2852 
2853  if (edm::isDebugEnabled() ) {
2854 
2855  std::ostringstream myCoutStream;
2856  hfRingEtSumsCond.print(myCoutStream);
2857  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2858 
2859  }
2860 
2861  // insert condition into the map
2862  if ( !insertConditionIntoMap(hfRingEtSumsCond, chipNr)) {
2863 
2864  edm::LogError("TriggerMenuXmlParser") << " Error: duplicate condition (" << name
2865  << ")" << std::endl;
2866 
2867  return false;
2868  } else {
2869 
2870  (m_vecHfRingEtSumsTemplate[chipNr]).push_back(hfRingEtSumsCond);
2871 
2872  }
2873  */
2874 
2875  //
2876  return true;
2877 }
bool l1t::TriggerMenuXmlParser::parseId ( std::auto_ptr< l1t::L1TriggerMenu >  tm)
private

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

bool TriggerMenuXmlParser::parseId ( l1t::Meta  meta)
private

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 3365 of file TriggerMenuXmlParser.cc.

References LogDebug, LogTrace, and AlCaHLTBitMon_QueryRunRegistry::string.

3365  {
3366 
3367  XERCES_CPP_NAMESPACE_USE
3368 
3369 // DOMNode* doc = parser->getDocument();
3370 // DOMNode* n1 = doc->getFirstChild();
3371 
3372 // // we assume that the first child is m_xmlTagDef because it was checked in workXML
3373 
3374 // DOMNode* headerNode = n1->getFirstChild();
3375 // if (headerNode == 0) {
3376 // edm::LogError("TriggerMenuXmlParser") << "Error: No child of <" << m_xmlTagDef
3377 // << "> tag found." << std::endl;
3378 // return false;
3379 // }
3380 
3381 // headerNode = findXMLChild(headerNode, m_xmlTagHeader);
3382 // if (headerNode == 0) {
3383 
3384 // LogDebug("TriggerMenuXmlParser") << "\n Warning: Could not find <" << m_xmlTagHeader
3385 // << "> tag" << "\n - No header information." << std::endl;
3386 
3387 // } else {
3388 
3389 // DOMNode* idNode = headerNode->getFirstChild();
3390 
3391 // // find menu interface name
3392 // idNode = findXMLChild(idNode, m_xmlTagMenuInterface);
3393 // if (idNode == 0) {
3394 
3395 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3396 // << m_xmlTagMenuInterface << "> tag"
3397 // << "\n - Trigger menu interface name derived from file name." << std::endl;
3398 
3399 // // set the name of the trigger menu interface: from beginning of file names
3400 // // until beginning of "_L1T_Scales"
3401 // size_t xmlPos = m_triggerMenuName.find("_L1T_Scales", 0);
3402 // if (xmlPos == std::string::npos) {
3403 // LogTrace("TriggerMenuXmlParser")
3404 // << "\n Warning: Could not find \"_L1T_Scales\" " << "string in file name"
3405 // << "\n - Trigger menu interface name set to file name." << std::endl;
3406 // m_triggerMenuInterface = m_triggerMenuName;
3407 
3408 // } else {
3409 // m_triggerMenuInterface = m_triggerMenuName;
3410 // m_triggerMenuInterface.erase(
3411 // m_triggerMenuInterface.begin(), m_triggerMenuInterface.begin() + xmlPos);
3412 // }
3413 
3414 // } else {
3415 // m_triggerMenuInterface = getXMLTextValue(idNode);
3416 // }
3417 
3418 // // find menu interface creation date
3419 // idNode = headerNode->getFirstChild();
3420 // idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceDate);
3421 
3422 // if (idNode == 0) {
3423 
3424 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3425 // << m_xmlTagMenuInterfaceDate << "> tag" << "\n - No creation date."
3426 // << m_triggerMenuInterfaceDate << std::endl;
3427 
3428 // } else {
3429 
3430 // m_triggerMenuInterfaceDate = getXMLTextValue(idNode);
3431 // }
3432 
3433 // // find menu interface creation author
3434 // idNode = headerNode->getFirstChild();
3435 // idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceAuthor);
3436 
3437 // if (idNode == 0) {
3438 
3439 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3440 // << m_xmlTagMenuInterfaceAuthor << "> tag" << "\n - No creation author."
3441 // << m_triggerMenuInterfaceAuthor << std::endl;
3442 
3443 // } else {
3444 
3445 // m_triggerMenuInterfaceAuthor = getXMLTextValue(idNode);
3446 // }
3447 
3448 // // find menu interface description
3449 // idNode = headerNode->getFirstChild();
3450 // idNode = findXMLChild(idNode, m_xmlTagMenuInterfaceDescription);
3451 
3452 // if (idNode == 0) {
3453 
3454 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3455 // << m_xmlTagMenuInterfaceDescription << "> tag" << "\n - No description."
3456 // << m_triggerMenuInterfaceDescription << std::endl;
3457 
3458 // } else {
3459 
3460 // m_triggerMenuInterfaceDescription = getXMLTextValue(idNode);
3461 // }
3462 
3463 // // find menu creation date
3464 // idNode = headerNode->getFirstChild();
3465 // idNode = findXMLChild(idNode, m_xmlTagMenuDate);
3466 
3467 // if (idNode == 0) {
3468 
3469 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3470 // << m_xmlTagMenuDate << "> tag" << "\n - No creation date."
3471 // << m_triggerMenuDate << std::endl;
3472 
3473 // } else {
3474 
3475 // m_triggerMenuDate = getXMLTextValue(idNode);
3476 // }
3477 
3478 // // find menu creation author
3479 // idNode = headerNode->getFirstChild();
3480 // idNode = findXMLChild(idNode, m_xmlTagMenuAuthor);
3481 
3482 // if (idNode == 0) {
3483 
3484 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3485 // << m_xmlTagMenuAuthor << "> tag" << "\n - No creation author."
3486 // << m_triggerMenuAuthor << std::endl;
3487 
3488 // } else {
3489 
3490 // m_triggerMenuAuthor = getXMLTextValue(idNode);
3491 // }
3492 
3493 // // find menu description
3494 // idNode = headerNode->getFirstChild();
3495 // idNode = findXMLChild(idNode, m_xmlTagMenuDescription);
3496 
3497 // if (idNode == 0) {
3498 
3499 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3500 // << m_xmlTagMenuDescription << "> tag" << "\n - No description."
3501 // << m_triggerMenuDescription << std::endl;
3502 
3503 // } else {
3504 
3505 // m_triggerMenuDescription = getXMLTextValue(idNode);
3506 // }
3507 
3508 // // find algorithm implementation tag
3509 
3510 // idNode = headerNode->getFirstChild();
3511 
3512 // idNode = findXMLChild(idNode, m_xmlTagMenuAlgImpl);
3513 // if (idNode == 0) {
3514 
3515 // m_algorithmImplementation = "";
3516 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3517 // << m_xmlTagMenuAlgImpl << "> tag"
3518 // << "\n - Algorithm implementation tag set to empty string." << std::endl;
3519 
3520 // } else {
3521 
3522 // m_algorithmImplementation = getXMLTextValue(idNode);
3523 // }
3524 
3525 // // find DB key for L1 scales
3526 
3527 // idNode = headerNode->getFirstChild();
3528 
3529 // idNode = findXMLChild(idNode, m_xmlTagScaleDbKey);
3530 // if (idNode == 0) {
3531 
3532 // m_scaleDbKey = "NULL";
3533 // LogTrace("TriggerMenuXmlParser") << "\n Warning: Could not find <"
3534 // << m_xmlTagScaleDbKey << "> tag" << "\n - Scale key set to " << m_scaleDbKey
3535 // << " string." << std::endl;
3536 
3537 // } else {
3538 // m_scaleDbKey = getXMLTextValue(idNode);
3539 // }
3540 
3541 // }
3542 
3543 
3544 
3545  m_triggerMenuInterface = l1t2string( meta.name() );
3546  m_triggerMenuInterfaceDate = "2013-010-24T15:33:24";
3547  m_triggerMenuInterfaceAuthor = "Darren Puigh";
3548  m_triggerMenuInterfaceDescription = l1t2string( meta.comment() );
3549 // m_algorithmImplementation = l1t2string( meta.firmwareVersion() );
3550 // m_triggerMenuDate = l1t2string( meta.changesDate() );
3551 // m_triggerMenuAuthor = l1t2string( meta.changesAuthor() );
3552  m_triggerMenuDescription = l1t2string( meta.comment() );
3553  m_scaleDbKey = l1t2string( meta.scale_set() );
3554 
3555 
3556  int cnt = 0;
3557  for( l1t::RevisionList::revision_const_iterator revision = meta.revisions().revision().begin();
3558  revision != meta.revisions().revision().end(); ++revision ){
3559 
3560  LogDebug("l1t|Global")
3561  << "\t Revision " << cnt
3562  << "\t\t author = " << l1t2string( revision->author() )
3563  << "\t\t datetime = " << l1tDateTime2string( revision->datetime() )
3564  << std::endl;
3565 
3566  if( cnt==0 ){
3567  m_triggerMenuDate = l1tDateTime2string( revision->datetime() );
3568  m_triggerMenuAuthor = l1t2string( revision->author() );
3569  }
3570  cnt++;
3571  }
3572 
3573  //LogDebug("TriggerMenuXmlParser")
3574  LogDebug("l1t|Global")
3575  << "\n Parsed values from XML file DRULES"
3576  << "\nL1 MenuInterface: " << m_triggerMenuInterface
3577  << "\nL1 MenuInterface - Creation date: " << m_triggerMenuInterfaceDate
3578  << "\nL1 MenuInterface - Creation author: " << m_triggerMenuInterfaceAuthor
3579  << "\nL1 MenuInterface - Description: " << m_triggerMenuInterfaceDescription
3580  << "\n"
3581  << "\nAlgorithm implementation tag: " << m_algorithmImplementation
3582  << "\n"
3583  << "\nL1 Menu - Creation date: " << m_triggerMenuDate
3584  << "\nL1 Menu - Creation author: " << m_triggerMenuAuthor
3585  << "\nL1 Menu - Description: " << m_triggerMenuDescription
3586  << std::endl;
3587 
3588 
3589  // set the trigger menu name
3590  // format:
3591  // L1MenuInterface/ScaleDbKey/AlgorithmImplementationTag
3592 
3593  std::string menuName = m_triggerMenuInterface + "/" + m_scaleDbKey + "/" + m_algorithmImplementation;
3594 
3595  if (menuName != m_triggerMenuName) {
3596 
3597  LogDebug("TriggerMenuXmlParser") << "\n Warning: Inconsistent L1 menu name:"
3598  << "\n from XML file name: " << m_triggerMenuName
3599  << "\n from XML tag: " << menuName << std::endl;
3600 
3601  if (m_triggerMenuInterface != "") {
3602  if (m_scaleDbKey == "NULL") {
3604  } else {
3605  m_triggerMenuName = menuName;
3606  }
3607 
3608  LogTrace("TriggerMenuXmlParser") << "\n L1 menu name set to value from XML tag!"
3609  << "\n L1 Menu name: " << m_triggerMenuName << std::endl;
3610 
3611  } else {
3612  LogTrace("TriggerMenuXmlParser") << "\n L1 menu name set to file name!"
3613  << "\n L1 Menu name: " << m_triggerMenuName << std::endl;
3614 
3615  }
3616  }
3617 
3618  //
3619  return true;
3620 }
#define LogDebug(id)
std::string l1tDateTime2string(l1t::DateTime)
std::string m_scaleDbKey
menu associated scale key
#define LogTrace(id)
std::string m_triggerMenuInterface
menu names
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
bool TriggerMenuXmlParser::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 2376 of file TriggerMenuXmlParser.cc.

2377  {
2378 
2379  XERCES_CPP_NAMESPACE_USE
2380 
2381  /*
2382  // get condition, particle name and type name
2383  std::string condition = getXMLAttribute(node, m_xmlConditionAttrCondition);
2384  std::string particle = getXMLAttribute(node, m_xmlConditionAttrObject);
2385  std::string type = getXMLAttribute(node, m_xmlConditionAttrType);
2386 
2387  if (particle != m_xmlConditionAttrObjectJetCounts) {
2388  edm::LogError("TriggerMenuXmlParser") << "Wrong particle for JetCounts condition ("
2389  << particle << ")" << std::endl;
2390  return false;
2391  }
2392 
2393  // object type and condition type
2394  L1GtObject jetCountsObjType = JetCounts;
2395  GtConditionType cType = TypeJetCounts;
2396 
2397  // global object
2398  int nrObj = 1;
2399 
2400  // get greater equal flag
2401 
2402  int intGEq = getGEqFlag(node, m_xmlTagCountThreshold);
2403  if (intGEq < 0) {
2404  edm::LogError("TriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
2405  << std::endl;
2406  return false;
2407  }
2408  // set the boolean value for the ge_eq mode
2409  bool gEq = (intGEq != 0);
2410 
2411  // get values
2412 
2413  // temporary storage of the parameters
2414  std::vector<L1GtJetCountsTemplate::ObjectParameter> objParameter(nrObj);
2415 
2416  // get countIndex value and fill into structure
2417  // they are expressed in base 10 (values: 0 - m_numberL1JetCounts)
2418  char* endPtr = const_cast<char*>(type.c_str());
2419  long int typeInt = strtol(type.c_str(), &endPtr, 10); // base = 10
2420 
2421  if (*endPtr != 0) {
2422 
2423  LogDebug("TriggerMenuXmlParser") << "Unable to convert " << type << " to dec."
2424  << std::endl;
2425 
2426  return false;
2427  }
2428 
2429  // test if count index is out of range
2430  if ((typeInt < 0) || (typeInt > static_cast<int>(m_numberL1JetCounts))) {
2431  LogDebug("TriggerMenuXmlParser") << "Count index " << typeInt
2432  << " outside range [0, " << m_numberL1JetCounts << "]" << std::endl;
2433 
2434  return false;
2435  }
2436 
2437  objParameter[0].countIndex = static_cast<unsigned int>(typeInt);
2438 
2439  // get count threshold values and fill into structure
2440  std::vector<boost::uint64_t> tmpValues(nrObj);
2441 
2442  if ( !getConditionChildValuesOld(node, m_xmlTagCountThreshold, nrObj, tmpValues) ) {
2443  return false;
2444  }
2445 
2446  for (int i = 0; i < nrObj; i++) {
2447  objParameter[i].countThreshold = tmpValues[i];
2448 
2449  //LogTrace("TriggerMenuXmlParser")
2450  //<< " JetCounts count threshold (hex) for JetCounts object " << i << " = "
2451  //<< std::hex << objParameter[i].countThreshold << std::dec
2452  //<< std::endl;
2453 
2454  // TODO FIXME un-comment when tag available in XML file
2455 
2456  // // get countOverflow logical flag and fill into structure
2457  // DOMNode* n1;
2458  // if ( (n1 = findXMLChild(node->getFirstChild(), m_xmlTagCountThreshold)) == 0) {
2459  // edm::LogError("TriggerMenuXmlParser")
2460  // << " Could not get countOverflow for JetCounts condition ("
2461  // << name << ")"
2462  // << std::endl;
2463  // return false;
2464  // }
2465  // if ( (n1 = findXMLChild(n1->getFirstChild(), m_xmlTagCountThreshold)) == 0) {
2466  // edm::LogError("TriggerMenuXmlParser")
2467  // << " Could not get countOverflow for JetCounts condition ("
2468  // << name << ")"
2469  // << std::endl;
2470  // return false;
2471  // }
2472  //
2473  // int tmpInt = getBitFromNode(n1);
2474  // if (tmpInt == 0) {
2475  // objParameter[i].countOverflow = false;
2476  //
2477  // LogTrace("TriggerMenuXmlParser")
2478  // << " JetCounts countOverflow logical flag (hex) = "
2479  // << std::hex << objParameter[i].countOverflow << std::dec
2480  // << std::endl;
2481  // } else if (tmpInt == 1) {
2482  // objParameter[i].countOverflow = true;
2483  //
2484  // LogTrace("TriggerMenuXmlParser")
2485  // << " JetCounts countOverflow logical flag (hex) = "
2486  // << std::hex << objParameter[i].countOverflow << std::dec
2487  // << std::endl;
2488  // } else {
2489  // LogTrace("TriggerMenuXmlParser")
2490  // << " JetCounts countOverflow logical flag (hex) = "
2491  // << std::hex << tmpInt << std::dec << " - wrong value! "
2492  // << std::endl;
2493  // return false;
2494  // }
2495 
2496  }
2497 
2498  // object types - all same objType
2499  std::vector<L1GtObject> objType(nrObj, jetCountsObjType);
2500 
2501  // now create a new JetCounts condition
2502 
2503  L1GtJetCountsTemplate jetCountsCond(name);
2504 
2505  jetCountsCond.setCondType(cType);
2506  jetCountsCond.setObjectType(objType);
2507  jetCountsCond.setCondGEq(gEq);
2508  jetCountsCond.setCondChipNr(chipNr);
2509 
2510  jetCountsCond.setConditionParameter(objParameter);
2511 
2512  if (edm::isDebugEnabled() ) {
2513 
2514  std::ostringstream myCoutStream;
2515  jetCountsCond.print(myCoutStream);
2516  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
2517 
2518  }
2519 
2520  // insert condition into the map
2521  if ( !insertConditionIntoMap(jetCountsCond, chipNr)) {
2522 
2523  edm::LogError("TriggerMenuXmlParser") << " Error: duplicate condition (" << name
2524  << ")" << std::endl;
2525 
2526  return false;
2527  } else {
2528 
2529  (m_vecJetCountsTemplate[chipNr]).push_back(jetCountsCond);
2530 
2531  }
2532 
2533  */
2534  //
2535  return true;
2536 }
bool TriggerMenuXmlParser::parseMuon ( l1t::MuonCondition  condMu,
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.

DMP: Use dec instead of hex

Temporary

Definition at line 1465 of file TriggerMenuXmlParser.cc.

References MuonTemplate::CorrelationParameter::chargeCorrelation, TauDecayModes::dec, MuonTemplate::CorrelationParameter::deltaEtaRange, MuonTemplate::CorrelationParameter::deltaEtaRangeLower, MuonTemplate::CorrelationParameter::deltaEtaRangeUpper, MuonTemplate::CorrelationParameter::deltaPhiMaxbits, MuonTemplate::CorrelationParameter::deltaPhiRange, MuonTemplate::CorrelationParameter::deltaPhiRangeLower, MuonTemplate::CorrelationParameter::deltaPhiRangeUpper, archive::flag, edm::isDebugEnabled(), LogDebug, LogTrace, Mu, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, and l1t::TypeNull.

1466  {
1467 
1468  XERCES_CPP_NAMESPACE_USE
1469 
1470  // get condition, particle name (must be muon) and type name
1471  std::string condition = "muon";
1472  std::string particle = "muon";//l1t2string( condMu.objectType() );
1473  std::string type = l1t2string( condMu.type() );
1474  std::string name = l1t2string( condMu.name() );
1475 
1476  if( particle=="mu" ) particle = "muon";
1477 
1478  if( type=="double_wsc" ) type = "2_wsc";
1479  else if( type=="single" ) type = "1_s";
1480  else if( type=="double" ) type = "2_s";
1481  else if( type=="triple" ) type = "3";
1482  else if( type=="quad" ) type = "4";
1483 
1484  LogDebug("l1t|Global")
1485  << "\n ****************************************** "
1486  << "\n parseMuon "
1487  << "\n condition = " << condition
1488  << "\n particle = " << particle
1489  << "\n type = " << type
1490  << "\n name = " << name
1491  << std::endl;
1492 
1493  if (particle != m_xmlConditionAttrObjectMu) {
1494  edm::LogError("TriggerMenuXmlParser") << "Wrong particle for muon-condition ("
1495  << particle << ")" << std::endl;
1496  return false;
1497  }
1498 
1499  // get greater equal flag
1500  std::string str_etComparison = l1t2string( condMu.comparison_operator() );
1501 
1502  int nrObj = getNumFromType(type);
1503  if (nrObj < 0) {
1504  edm::LogError("TriggerMenuXmlParser") << "Unknown type for calo-condition (" << type
1505  << ")" << "\nCan not determine number of trigger objects. " << std::endl;
1506  return false;
1507  }
1508 
1509  // get greater equal flag
1510  int intGEq = ( str_etComparison=="ge" ) ? 1 : 0;
1511  if (intGEq < 0) {
1512  edm::LogError("TriggerMenuXmlParser") << "Error getting \"greater or equal\" flag"
1513  << std::endl;
1514  return false;
1515  }
1516  // set the boolean value for the ge_eq mode
1517  bool gEq = (intGEq != 0);
1518 
1519 // // get values
1520 
1521  // temporary storage of the parameters
1522  std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1523  MuonTemplate::CorrelationParameter corrParameter;
1524 
1525  // need at least two values for deltaPhi
1526  std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1527  tmpValues.reserve( nrObj );
1528 
1529  if( int(condMu.objectRequirements().objectRequirement().size())!=nrObj ){
1530  edm::LogError("TriggerMenuXmlParser") << " condMu objects: nrObj = " << nrObj
1531  << "condMu.objectRequirements().objectRequirement().size() = "
1532  << condMu.objectRequirements().objectRequirement().size()
1533  << std::endl;
1534  return false;
1535  }
1536 
1537 
1538  std::string str_chargeCorrelation = l1t2string( condMu.requestedChargeCorr() );
1539 
1540  unsigned int chargeCorrelation = 0;
1541  if( str_chargeCorrelation=="ig" ) chargeCorrelation = 1;
1542  else if( str_chargeCorrelation=="ls" ) chargeCorrelation = 2;
1543  else if( str_chargeCorrelation=="os" ) chargeCorrelation = 4;
1544 
1545  //getXMLHexTextValue("1", dst);
1546  corrParameter.chargeCorrelation = chargeCorrelation;//tmpValues[0];
1547 
1548  std::string str_condMu = "";
1549  boost::uint64_t tempUIntH, tempUIntL;
1550  boost::uint64_t dst;
1551  int cnt = 0;
1552  for( l1t::MuonObjectRequirementList::objectRequirement_const_iterator objPar = condMu.objectRequirements().objectRequirement().begin();
1553  objPar != condMu.objectRequirements().objectRequirement().end(); ++objPar ){
1554 
1555  // ET Threshold
1556  str_condMu = l1t2string( objPar->ptThreshold() );
1557  if( !getXMLHexTextValue(str_condMu, dst) ) return false;
1558  //if( cnt<nrObj ) objParameter[cnt].etThreshold = dst;
1560  if( cnt<nrObj ){
1561  objParameter[cnt].ptHighThreshold = objPar->ptThreshold();
1562  objParameter[cnt].ptLowThreshold = objPar->ptThreshold();
1563  }
1564 
1565  // Eta Range
1566  //str_condMu = "ffff";
1567  str_condMu = "7f7f";
1568  //str_condMu = "0f0f";
1569  if( !getXMLHexTextValue(str_condMu, dst) ) return false;
1570  if( cnt<nrObj ) objParameter[cnt].etaRange = dst;
1571 
1572  // Phi Range
1573  str_condMu = "3ffff";
1574  if( !getXMLHexTextValue(str_condMu, dst) ) return false;
1575  //if( cnt<nrObj ) objParameter[cnt].phiRange = dst;
1576  getXMLHexTextValue("8f", dst);
1577  objParameter[cnt].phiHigh = dst;//tmpValues[i];
1578  objParameter[cnt].phiLow = dst;//tmpValues[i];
1579 
1580  objParameter[cnt].enableMip = false;//tmpMip[i];
1581  objParameter[cnt].enableIso = false;//tmpEnableIso[i];
1582  objParameter[cnt].requestIso = false;//tmpRequestIso[i];
1583 
1584  std::string str_charge = l1t2string( objPar->requestedCharge() );
1585  int charge = 0;
1586  if( str_charge=="ign" ) charge = -1;
1587  else if( str_charge=="pos" ) charge = 0;
1588  else if( str_charge=="neg" ) charge = 1;
1589 
1590  objParameter[cnt].charge = charge;
1591 
1592  int cntQual=0;
1593  int qualityLUT = 0;
1594  for( l1t::MuonQualityLUT::quality_const_iterator iQualFlag = objPar->qualityLut().quality().begin();
1595  iQualFlag != objPar->qualityLut().quality().end(); ++iQualFlag ){
1596 
1597  bool flag = (*iQualFlag);
1598 
1599  qualityLUT |= (flag << cntQual);
1600 
1601  LogDebug("l1t|Global")
1602  << "\n quality flag " << cntQual << " = " << flag
1603  << "\n qualityLUT = " << qualityLUT
1604  << std::endl;
1605 
1606  cntQual++;
1607  }
1608 
1609  objParameter[cnt].qualityLUT = qualityLUT;
1610 
1611 
1612  int cntIso=0;
1613  int isolationLUT = 0;
1614  for( l1t::MuonIsolationLUT::isolation_const_iterator iIsoFlag = objPar->isolationLut().isolation().begin();
1615  iIsoFlag != objPar->isolationLut().isolation().end(); ++iIsoFlag ){
1616 
1617  bool flag = (*iIsoFlag);
1618 
1619  isolationLUT |= (flag << cntIso);
1620 
1621  LogDebug("l1t|Global")
1622  << "\n isolation flag " << cntIso << " = " << flag
1623  << "\n isolationLUT = " << isolationLUT
1624  << std::endl;
1625 
1626  cntIso++;
1627  }
1628 
1629  objParameter[cnt].isolationLUT = isolationLUT;
1630 
1631 
1632  int cntEta=0;
1633  unsigned int etaWindowLower=-1, etaWindowUpper=-1, etaWindowVetoLower=-1, etaWindowVetoUpper=-1;
1634  // Temporary before translation
1635  for( l1t::MuonObjectRequirement::etaWindow_const_iterator etaWindow =objPar->etaWindow().begin();
1636  etaWindow != objPar->etaWindow().end(); ++etaWindow ){
1637 
1638  LogDebug("l1t|Global")
1639  << "\n etaWindow lower = " << etaWindow->lower()
1640  << "\n etaWindow upper = " << etaWindow->upper()
1641  << std::endl;
1642  if( cntEta==0 ){ etaWindowLower = etaWindow->lower(); etaWindowUpper = etaWindow->upper(); }
1643  else if( cntEta==1 ){ etaWindowVetoLower = etaWindow->lower(); etaWindowVetoUpper = etaWindow->upper(); }
1644  cntEta++;
1645  }
1646 
1647  int cntPhi=0;
1648  unsigned int phiWindowLower=-1, phiWindowUpper=-1, phiWindowVetoLower=-1, phiWindowVetoUpper=-1;
1649  for( l1t::MuonObjectRequirement::phiWindow_const_iterator phiWindow =objPar->phiWindow().begin();
1650  phiWindow != objPar->phiWindow().end(); ++phiWindow ){
1651 
1652  LogDebug("l1t|Global")
1653  << "\n phiWindow begin = " << phiWindow->lower()
1654  << "\n phiWindow end = " << phiWindow->upper()
1655  << std::endl;
1656 
1657  if( cntPhi==0 ){ phiWindowLower = phiWindow->lower(); phiWindowUpper = phiWindow->upper(); }
1658  else if( cntPhi==1 ){ phiWindowVetoLower = phiWindow->lower(); phiWindowVetoUpper = phiWindow->upper(); }
1659  cntPhi++;
1660  }
1661 
1662  objParameter[cnt].etaWindowLower = etaWindowLower;
1663  objParameter[cnt].etaWindowUpper = etaWindowUpper;
1664  objParameter[cnt].etaWindowVetoLower = etaWindowVetoLower;
1665  objParameter[cnt].etaWindowVetoUpper = etaWindowVetoUpper;
1666 
1667  objParameter[cnt].phiWindowLower = phiWindowLower;
1668  objParameter[cnt].phiWindowUpper = phiWindowUpper;
1669  objParameter[cnt].phiWindowVetoLower = phiWindowVetoLower;
1670  objParameter[cnt].phiWindowVetoUpper = phiWindowVetoUpper;
1671 
1672 
1673  // Output for debugging
1674  LogDebug("l1t|Global")
1675  << "\n Muon PT high threshold (hex) for muon object " << cnt << " = "
1676  << std::hex << objParameter[cnt].ptHighThreshold << std::dec
1677  << "\n etaWindow (hex) for muon object " << cnt << " = "
1678  << std::hex << objParameter[cnt].etaRange << std::dec
1679  // << "\n phiRange (hex) for muon object " << cnt << " = "
1680  // << std::hex << objParameter[cnt].phiRange << std::dec
1681  << "\n etaWindow Lower / Upper for muon object " << cnt << " = "
1682  << objParameter[cnt].etaWindowLower << " / " << objParameter[cnt].etaWindowUpper
1683  << "\n etaWindowVeto Lower / Upper for muon object " << cnt << " = "
1684  << objParameter[cnt].etaWindowVetoLower << " / " << objParameter[cnt].etaWindowVetoUpper
1685  << "\n phiWindow Lower / Upper for muon object " << cnt << " = "
1686  << objParameter[cnt].phiWindowLower << " / " << objParameter[cnt].phiWindowUpper
1687  << "\n phiWindowVeto Lower / Upper for muon object " << cnt << " = "
1688  << objParameter[cnt].phiWindowVetoLower << " / " << objParameter[cnt].phiWindowVetoUpper
1689  << std::endl;
1690 
1691  cnt++;
1692  }
1693 
1694 
1695 
1696  // indicates if a correlation is used
1697  bool wscVal = (type == m_xmlConditionAttrType2wsc );
1698 
1699  if( wscVal ){
1700 
1701  xsd::cxx::tree::optional<l1t::DeltaRequirement> condRanges = condMu.deltaRequirement();
1702  LogDebug("l1t|Global")
1703  << "\t condRanges->deltaEtaRange().lower() = " << condRanges->deltaEtaRange().lower()
1704  << "\n\t condRanges->deltaEtaRange().upper() = " << condRanges->deltaEtaRange().upper()
1705  << "\n\t condRanges->deltaPhiRange().lower() = " << condRanges->deltaPhiRange().lower()
1706  << "\n\t condRanges->deltaPhiRange().upper() = " << condRanges->deltaPhiRange().upper()
1707  << std::endl;
1708 
1709  corrParameter.deltaEtaRangeLower = condRanges->deltaEtaRange().lower();
1710  corrParameter.deltaEtaRangeUpper = condRanges->deltaEtaRange().upper();
1711 
1712  corrParameter.deltaPhiRangeLower = condRanges->deltaPhiRange().lower();
1713  corrParameter.deltaPhiRangeUpper = condRanges->deltaPhiRange().upper();
1714 
1715  //
1717  //
1718 
1719  // Eta Range
1720  str_condMu = "0003";
1721  if ( !hexString2UInt128(str_condMu, tempUIntL, tempUIntH) ) {
1722  return false;
1723  }
1724  if( tempUIntH != 0 ){
1725  edm::LogError("TriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
1726  return false;
1727  }
1728  corrParameter.deltaEtaRange = tempUIntL;
1729 
1730  // Phi Range
1731  str_condMu = "003";
1732  if ( !hexString2UInt128(str_condMu, tempUIntL, tempUIntH) ) {
1733  return false;
1734  }
1735  if( tempUIntH != 0 ){
1736  edm::LogError("TriggerMenuXmlParser") << "Too large hex-value!" << std::endl;
1737  return false;
1738  }
1739  corrParameter.deltaPhiRange = tempUIntL;
1740 
1741 
1742 
1743  // Max Phi Range
1744  std::string maxString = "3FF";
1745 
1746  unsigned int maxbits = 0;
1747 
1748  if ( !countConditionChildMaxBits(maxString, maxbits) ) {
1749  return false;
1750  }
1751 
1752  corrParameter.deltaPhiMaxbits = maxbits;
1753  LogTrace("TriggerMenuXmlParser")
1754  << " deltaPhiMaxbits (dec) = " << maxbits
1755  << std::endl;
1756  }
1757 
1758 
1759  // get the type of the condition, as defined in enum, from the condition type
1760  // as defined in the XML file
1761  GtConditionType cType = getTypeFromType(type);
1762  //LogTrace("TriggerMenuXmlParser")
1763  //<< " Condition type (enum value) = " << cType
1764  //<< std::endl;
1765 
1766  if (cType == l1t::TypeNull) {
1767  edm::LogError("TriggerMenuXmlParser")
1768  << "Type for muon condition id l1t::TypeNull - it means not defined in the XML file."
1769  << "\nNumber of trigger objects is set to zero. " << std::endl;
1770  return false;
1771  }
1772 
1773  // object types - all muons
1774  std::vector<L1GtObject> objType(nrObj, Mu);
1775 
1777 
1778  int relativeBx = l1t2int( condMu.relativeBx() );
1779 
1781  // now create a new CondMuonition
1782 
1783  MuonTemplate muonCond(name);
1784 
1785  muonCond.setCondType(cType);
1786  muonCond.setObjectType(objType);
1787  muonCond.setCondGEq(gEq);
1788  muonCond.setCondChipNr(chipNr);
1789  muonCond.setCondRelativeBx(relativeBx);
1790 
1791  muonCond.setConditionParameter(objParameter, corrParameter);
1792 
1793  if (edm::isDebugEnabled()) {
1794  std::ostringstream myCoutStream;
1795  muonCond.print(myCoutStream);
1796  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
1797  }
1798 
1799  // insert condition into the map and into muon template vector
1800  if ( !insertConditionIntoMap(muonCond, chipNr)) {
1801  edm::LogError("TriggerMenuXmlParser")
1802  << " Error: duplicate condition (" << name << ")"
1803  << std::endl;
1804  return false;
1805  }
1806  else {
1807  if (corrFlag) {
1808  (m_corMuonTemplate[chipNr]).push_back(muonCond);
1809  }
1810  else {
1811  (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1812  }
1813 
1814  }
1815 
1816 
1817  LogDebug("l1t|Global")
1818  << "\n intGEq = " << intGEq
1819  << " nrObj = " << nrObj
1820  << "\n ****************************************** "
1821  << std::endl;
1822 
1823  //
1824  return true;
1825 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
bool isDebugEnabled()
bool insertConditionIntoMap(GtCondition &cond, const int chipNr)
GtConditionType
Definition: GtDefinitions.h:99
unsigned long long deltaPhiRange
Definition: MuonTemplate.h:98
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
bool getXMLHexTextValue(const std::string &childName, boost::uint64_t &dst)
#define LogTrace(id)
std::vector< std::vector< MuonTemplate > > m_vecMuonTemplate
l1t::GtConditionType getTypeFromType(const std::string &type)
Definition: L1GtObject.h:30
unsigned long long uint64_t
Definition: Time.h:15
bool countConditionChildMaxBits(const std::string &childName, unsigned int &dst)
get the number of bits in the max attribute of a condition child
static const std::string m_xmlConditionAttrObjectMu
std::vector< std::vector< MuonTemplate > > m_corMuonTemplate
unsigned long long deltaEtaRange
Definition: MuonTemplate.h:96
static const std::string m_xmlConditionAttrType2wsc
int getNumFromType(const std::string &type)
get number of particles from condition type
bool TriggerMenuXmlParser::parseTechTriggers ( XERCES_CPP_NAMESPACE::XercesDOMParser *  parser)
private

parse all algorithms

Definition at line 4006 of file TriggerMenuXmlParser.cc.

References asciidump::doc, python.Node::node, and AlCaHLTBitMon_QueryRunRegistry::string.

4006  {
4007 
4008  XERCES_CPP_NAMESPACE_USE
4009 
4010  //LogTrace("TriggerMenuXmlParser") << "\nParsing technical triggers" << std::endl;
4011 
4012  DOMNode* doc = parser->getDocument();
4013  DOMNode* node = doc->getFirstChild();
4014 
4015  DOMNode* algNode = node->getFirstChild();
4016  if (algNode == 0) {
4017  edm::LogError("TriggerMenuXmlParser")
4018  << " Error: No child found for " << m_xmlTagDef << std::endl;
4019  return false;
4020  }
4021 
4022  algNode = findXMLChild(algNode, m_xmlTagTechTriggers);
4023  if (algNode == 0) {
4024  edm::LogError("TriggerMenuXmlParser") << " Error: No <"
4025  << m_xmlTagTechTriggers << "> child found."
4026  << std::endl;
4027  return false;
4028  }
4029 
4030  // walk through technical triggers
4031  DOMNode* algNameNode = algNode->getFirstChild();
4032  std::string algNameNodeName;
4033  algNameNode = findXMLChild(algNameNode, "", true, &algNameNodeName);
4034 
4035  while (algNameNode != 0) {
4036  //LogTrace("TriggerMenuXmlParser")
4037  //<< " Found an technical trigger with name: " << algNameNodeName
4038  //<< std::endl;
4039 
4040  if ( !workTechTrigger(algNameNode, algNameNodeName)) {
4041  return false;
4042  }
4043 
4044  algNameNode = findXMLChild(algNameNode->getNextSibling(), "", true,
4045  &algNameNodeName);
4046 
4047  }
4048 
4049  return true;
4050 }
tuple node
Definition: Node.py:50
tuple doc
Definition: asciidump.py:381
static const std::string m_xmlTagTechTriggers
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 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 TriggerMenuXmlParser::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 933 of file TriggerMenuXmlParser.cc.

References asciidump::doc.

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

parse def.xml and vme.xml files

Definition at line 236 of file TriggerMenuXmlParser.cc.

References LogTrace.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

237  {
238 
239  XERCES_CPP_NAMESPACE_USE
240 
241  // resize the vector of condition maps
242  // the number of condition chips should be correctly set before calling parseXmlFile
244 
254 
259 
260  // set the name of the trigger menu name:
261  // defXmlFile, stripped of absolute path and .xml
262  // will be overwritten by the value read from the xml file, with a warning if
263  // they are not the same
264  m_triggerMenuName = defXmlFile;
265  size_t xmlPos = m_triggerMenuName.find_last_of("/");
267  + xmlPos + 1);
268 
269  xmlPos = m_triggerMenuName.find_last_of(".");
270  m_triggerMenuName.erase(m_triggerMenuName.begin() + xmlPos, m_triggerMenuName.end());
271 
272  // error handler for xml-parser
273  m_xmlErrHandler = 0;
274 
275  std::auto_ptr<l1t::L1TriggerMenu> tm(l1t::l1TriggerMenu(defXmlFile));
276 
277  LogTrace("TriggerMenuXmlParser") << "\nOpening XML-File: \n " << defXmlFile << std::endl;
278 
279  l1t::ConditionList conditions = tm->conditions();
280 
281  workXML( tm );
282 
283 // if ((parser = initXML(defXmlFile)) != 0) {
284 // workXML(parser);
285 // }
286 // cleanupXML(parser);
287 
288 }
bool workXML(std::auto_ptr< l1t::L1TriggerMenu > tm)
do all the steps for filling a trigger menu
unsigned int m_numberConditionChips
hardware limits
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
std::vector< std::vector< CorrelationTemplate > > m_vecCorrelationTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
std::vector< std::vector< CaloTemplate > > m_corCaloTemplate
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
XERCES_CPP_NAMESPACE::ErrorHandler * m_xmlErrHandler
error handler for xml-parser
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
#define LogTrace(id)
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
std::vector< std::vector< MuonTemplate > > m_vecMuonTemplate
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
std::vector< std::vector< MuonTemplate > > m_corMuonTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
void TriggerMenuXmlParser::setCorCaloTemplate ( const std::vector< std::vector< CaloTemplate > > &  corCaloTempl)

Definition at line 202 of file TriggerMenuXmlParser.cc.

203  {
204 
205  m_corCaloTemplate = corCaloTempl;
206 }
std::vector< std::vector< CaloTemplate > > m_corCaloTemplate
void TriggerMenuXmlParser::setCorEnergySumTemplate ( const std::vector< std::vector< L1GtEnergySumTemplate > > &  corEnergySumTempl)

Definition at line 208 of file TriggerMenuXmlParser.cc.

209  {
210 
211  m_corEnergySumTemplate = corEnergySumTempl;
212 }
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
void TriggerMenuXmlParser::setCorMuonTemplate ( const std::vector< std::vector< MuonTemplate > > &  corMuonTempl)

Definition at line 196 of file TriggerMenuXmlParser.cc.

197  {
198 
199  m_corMuonTemplate = corMuonTempl;
200 }
std::vector< std::vector< MuonTemplate > > m_corMuonTemplate
void TriggerMenuXmlParser::setGtAlgorithmAliasMap ( const AlgorithmMap algoMap)

Definition at line 223 of file TriggerMenuXmlParser.cc.

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

Definition at line 329 of file TriggerMenuXmlParser.cc.

329  {
330 
332 
333 }
void TriggerMenuXmlParser::setGtAlgorithmMap ( const AlgorithmMap algoMap)

Definition at line 218 of file TriggerMenuXmlParser.cc.

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

Definition at line 111 of file TriggerMenuXmlParser.cc.

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

Definition at line 63 of file TriggerMenuXmlParser.cc.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

64  {
65 
66  m_numberConditionChips = numberConditionChipsValue;
67 
68 }
unsigned int m_numberConditionChips
hardware limits
void TriggerMenuXmlParser::setGtNumberL1JetCounts ( const unsigned int &  numberL1JetCountsValue)

Definition at line 103 of file TriggerMenuXmlParser.cc.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

103  {
104 
105  m_numberL1JetCounts = numberL1JetCountsValue;
106 
107 }
unsigned int m_numberL1JetCounts
jet counts
void TriggerMenuXmlParser::setGtNumberPhysTriggers ( const unsigned int &  numberPhysTriggersValue)

Definition at line 87 of file TriggerMenuXmlParser.cc.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 95 of file TriggerMenuXmlParser.cc.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 79 of file TriggerMenuXmlParser.cc.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

80  {
81 
82  m_orderConditionChip = orderConditionChipValue;
83 
84 }
std::vector< int > m_orderConditionChip
void TriggerMenuXmlParser::setGtPinsOnConditionChip ( const unsigned int &  pinsOnConditionChipValue)

Definition at line 71 of file TriggerMenuXmlParser.cc.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

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

Definition at line 129 of file TriggerMenuXmlParser.cc.

129  {
130  m_scaleDbKey = scaleKey;
131 }
std::string m_scaleDbKey
menu associated scale key
void TriggerMenuXmlParser::setGtTechnicalTriggerMap ( const AlgorithmMap ttMap)

Definition at line 228 of file TriggerMenuXmlParser.cc.

228  {
229  m_technicalTriggerMap = ttMap;
230 }
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
void TriggerMenuXmlParser::setGtTriggerMenuAuthor ( const std::string &  val)

Definition at line 317 of file TriggerMenuXmlParser.cc.

317  {
318 
319  m_triggerMenuAuthor = val;
320 
321 }
void TriggerMenuXmlParser::setGtTriggerMenuDate ( const std::string &  val)

Definition at line 311 of file TriggerMenuXmlParser.cc.

311  {
312 
313  m_triggerMenuDate = val;
314 
315 }
void TriggerMenuXmlParser::setGtTriggerMenuDescription ( const std::string &  val)

Definition at line 323 of file TriggerMenuXmlParser.cc.

323  {
324 
326 
327 }
void TriggerMenuXmlParser::setGtTriggerMenuImplementation ( const std::string &  menuImplementation)

Definition at line 124 of file TriggerMenuXmlParser.cc.

124  {
125  m_triggerMenuImplementation = menuImplementation;
126 }
void TriggerMenuXmlParser::setGtTriggerMenuInterface ( const std::string &  menuInterface)

Definition at line 116 of file TriggerMenuXmlParser.cc.

116  {
117  m_triggerMenuInterface = menuInterface;
118 }
std::string m_triggerMenuInterface
menu names
void TriggerMenuXmlParser::setGtTriggerMenuInterfaceAuthor ( const std::string &  val)

Definition at line 298 of file TriggerMenuXmlParser.cc.

298  {
299 
301 
302 }
void TriggerMenuXmlParser::setGtTriggerMenuInterfaceDate ( const std::string &  val)

Definition at line 292 of file TriggerMenuXmlParser.cc.

292  {
293 
295 
296 }
std::string m_triggerMenuInterfaceDate
members for XML parser only (do not appear in CondFormats)
void TriggerMenuXmlParser::setGtTriggerMenuInterfaceDescription ( const std::string &  val)

Definition at line 304 of file TriggerMenuXmlParser.cc.

304  {
305 
307 
308 }
void TriggerMenuXmlParser::setGtTriggerMenuName ( const std::string &  menuName)

Definition at line 120 of file TriggerMenuXmlParser.cc.

120  {
121  m_triggerMenuName = menuName;
122 }
void TriggerMenuXmlParser::setVecBptxTemplate ( const std::vector< std::vector< L1GtBptxTemplate > > &  vecBptxTempl)

Definition at line 176 of file TriggerMenuXmlParser.cc.

177  {
178 
179  m_vecBptxTemplate = vecBptxTempl;
180 }
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
void TriggerMenuXmlParser::setVecCaloTemplate ( const std::vector< std::vector< CaloTemplate > > &  vecCaloTempl)

Definition at line 140 of file TriggerMenuXmlParser.cc.

141  {
142 
143  m_vecCaloTemplate = vecCaloTempl;
144 }
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
void TriggerMenuXmlParser::setVecCastorTemplate ( const std::vector< std::vector< L1GtCastorTemplate > > &  vecCastorTempl)

Definition at line 158 of file TriggerMenuXmlParser.cc.

159  {
160 
161  m_vecCastorTemplate = vecCastorTempl;
162 }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
void TriggerMenuXmlParser::setVecCorrelationTemplate ( const std::vector< std::vector< CorrelationTemplate > > &  vecCorrelationTempl)

Definition at line 188 of file TriggerMenuXmlParser.cc.

189  {
190 
191  m_vecCorrelationTemplate = vecCorrelationTempl;
192 }
std::vector< std::vector< CorrelationTemplate > > m_vecCorrelationTemplate
void TriggerMenuXmlParser::setVecEnergySumTemplate ( const std::vector< std::vector< L1GtEnergySumTemplate > > &  vecEnergySumTempl)

Definition at line 146 of file TriggerMenuXmlParser.cc.

147  {
148 
149  m_vecEnergySumTemplate = vecEnergySumTempl;
150 }
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
void TriggerMenuXmlParser::setVecExternalTemplate ( const std::vector< std::vector< L1GtExternalTemplate > > &  vecExternalTempl)

Definition at line 182 of file TriggerMenuXmlParser.cc.

183  {
184 
185  m_vecExternalTemplate = vecExternalTempl;
186 }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
void TriggerMenuXmlParser::setVecHfBitCountsTemplate ( const std::vector< std::vector< L1GtHfBitCountsTemplate > > &  vecHfBitCountsTempl)

Definition at line 164 of file TriggerMenuXmlParser.cc.

165  {
166 
167  m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
168 }
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
void TriggerMenuXmlParser::setVecHfRingEtSumsTemplate ( const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > &  vecHfRingEtSumsTempl)

Definition at line 170 of file TriggerMenuXmlParser.cc.

171  {
172 
173  m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
174 }
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
void TriggerMenuXmlParser::setVecJetCountsTemplate ( const std::vector< std::vector< L1GtJetCountsTemplate > > &  vecJetCountsTempl)

Definition at line 152 of file TriggerMenuXmlParser.cc.

153  {
154 
155  m_vecJetCountsTemplate = vecJetCountsTempl;
156 }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
void TriggerMenuXmlParser::setVecMuonTemplate ( const std::vector< std::vector< MuonTemplate > > &  vecMuonTempl)

Definition at line 134 of file TriggerMenuXmlParser.cc.

135  {
136 
137  m_vecMuonTemplate = vecMuonTempl;
138 }
std::vector< std::vector< MuonTemplate > > m_vecMuonTemplate
const std::vector<std::vector<L1GtBptxTemplate> >& l1t::TriggerMenuXmlParser::vecBptxTemplate ( ) const
inline

Definition at line 215 of file TriggerMenuXmlParser.h.

References m_vecBptxTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

215  {
216 
217  return m_vecBptxTemplate;
218  }
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
const std::vector<std::vector<CaloTemplate> >& l1t::TriggerMenuXmlParser::vecCaloTemplate ( ) const
inline

Definition at line 160 of file TriggerMenuXmlParser.h.

References m_vecCaloTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

160  {
161  return m_vecCaloTemplate;
162  }
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
const std::vector<std::vector<L1GtCastorTemplate> >& l1t::TriggerMenuXmlParser::vecCastorTemplate ( ) const
inline

Definition at line 185 of file TriggerMenuXmlParser.h.

References m_vecCastorTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

185  {
186 
187  return m_vecCastorTemplate;
188  }
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
const std::vector<std::vector<CorrelationTemplate> >& l1t::TriggerMenuXmlParser::vecCorrelationTemplate ( ) const
inline

Definition at line 234 of file TriggerMenuXmlParser.h.

References m_vecCorrelationTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

234  {
235 
237  }
std::vector< std::vector< CorrelationTemplate > > m_vecCorrelationTemplate
const std::vector<std::vector<L1GtEnergySumTemplate> >& l1t::TriggerMenuXmlParser::vecEnergySumTemplate ( ) const
inline

Definition at line 167 of file TriggerMenuXmlParser.h.

References m_vecEnergySumTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

167  {
168 
169  return m_vecEnergySumTemplate;
170  }
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
const std::vector<std::vector<L1GtExternalTemplate> >& l1t::TriggerMenuXmlParser::vecExternalTemplate ( ) const
inline

Definition at line 225 of file TriggerMenuXmlParser.h.

References m_vecExternalTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

225  {
226 
227  return m_vecExternalTemplate;
228  }
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
const std::vector<std::vector<L1GtHfBitCountsTemplate> >& l1t::TriggerMenuXmlParser::vecHfBitCountsTemplate ( ) const
inline

Definition at line 195 of file TriggerMenuXmlParser.h.

References m_vecHfBitCountsTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

195  {
196 
198  }
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& l1t::TriggerMenuXmlParser::vecHfRingEtSumsTemplate ( ) const
inline

Definition at line 205 of file TriggerMenuXmlParser.h.

References m_vecHfRingEtSumsTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

205  {
206 
208  }
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
const std::vector<std::vector<L1GtJetCountsTemplate> >& l1t::TriggerMenuXmlParser::vecJetCountsTemplate ( ) const
inline

Definition at line 176 of file TriggerMenuXmlParser.h.

References m_vecJetCountsTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

176  {
177 
178  return m_vecJetCountsTemplate;
179  }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
const std::vector<std::vector<MuonTemplate> >& l1t::TriggerMenuXmlParser::vecMuonTemplate ( ) const
inline

get / set the vectors containing the conditions

Definition at line 154 of file TriggerMenuXmlParser.h.

References m_vecMuonTemplate.

Referenced by l1t::TriggerMenuXmlProducer::produceGtTriggerMenu().

154  {
155  return m_vecMuonTemplate;
156  }
std::vector< std::vector< MuonTemplate > > m_vecMuonTemplate
bool TriggerMenuXmlParser::workAlgorithm ( l1t::Algorithm  algorithm,
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 3774 of file TriggerMenuXmlParser.cc.

References cmsPerfPublish::fail(), edm::isDebugEnabled(), LogDebug, LogTrace, L1GtAlgorithm::print(), L1GtAlgorithm::setAlgoAlias(), L1GtAlgorithm::setAlgoChipNumber(), and AlCaHLTBitMon_QueryRunRegistry::string.

3775  {
3776 
3777  XERCES_CPP_NAMESPACE_USE
3778 
3779 // if (node == 0) {
3780 // LogDebug("TriggerMenuXmlParser")
3781 // << " Node is 0 in " << __PRETTY_FUNCTION__
3782 // << " can not parse the algorithm " << algName
3783 // << std::endl;
3784 // return false;
3785 // }
3786 
3787  // get alias
3788  std::string algAlias = l1t2string( algorithm.name() );
3789  std::string algName = l1t2string( algorithm.name() );
3790 
3791  if (algAlias == "") {
3792  algAlias = algName;
3793  LogDebug("TriggerMenuXmlParser")
3794  << "\n No alias defined for algorithm. Alias set to algorithm name."
3795  << "\n Algorithm name: " << algName << "\n Algorithm alias: " << algAlias
3796  << std::endl;
3797  } else {
3798  //LogDebug("TriggerMenuXmlParser")
3799  LogDebug("l1t|Global") << "\n Alias defined for algorithm."
3800  << "\n Algorithm name: " << algName << "\n Algorithm alias: " << algAlias
3801  << std::endl;
3802  }
3803 
3804  // get the logical expression
3805  std::string logExpression = l1t2string( algorithm.logical_expression() );
3806 
3807  LogDebug("l1t|Global")
3808  << " Logical expression: " << logExpression
3809  << " Chip number: " << chipNr
3810  << std::endl;
3811 
3812  // determine output pin
3813  std::string pinString = l1t2string( algorithm.index() );
3814  int outputPin = 0;
3815 
3816  std::istringstream opStream(pinString);
3817 
3818  if ((opStream >> outputPin).fail()) {
3819  LogDebug("TriggerMenuXmlParser")
3820  << " Unable to convert pin string " << pinString
3821  << " to int for algorithm : " << algName
3822  << std::endl;
3823 
3824  return false;
3825  }
3826 
3827 
3828  //LogTrace("TriggerMenuXmlParser")
3829  LogDebug("l1t|Global") << " Output pin: " << outputPin
3830  << std::endl;
3831 
3832 
3833  // compute the bit number from chip number, output pin and order of the chips
3834  // pin numbering start with 1, bit numbers with 0
3835  int bitNumber = outputPin;// + (m_orderConditionChip[chipNr] -1)*m_pinsOnConditionChip -1;
3836 
3837  //LogTrace("TriggerMenuXmlParser")
3838  LogDebug("l1t|Global") << " Bit number: " << bitNumber
3839  << std::endl;
3840 
3841  // create a new algorithm and insert it into algorithm map
3842  L1GtAlgorithm alg(algName, logExpression, bitNumber);
3843  alg.setAlgoChipNumber(static_cast<int>(chipNr));
3844  alg.setAlgoAlias(algAlias);
3845 
3846  if (edm::isDebugEnabled() ) {
3847 
3848  std::ostringstream myCoutStream;
3849  alg.print(myCoutStream);
3850  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
3851 
3852  }
3853 
3854  // insert algorithm into the map
3855  if ( !insertAlgorithmIntoMap(alg)) {
3856 
3857  return false;
3858  }
3859 
3860  return true;
3861 
3862 }
#define LogDebug(id)
bool isDebugEnabled()
bool insertAlgorithmIntoMap(const L1GtAlgorithm &alg)
insert an algorithm into algorithm map
#define LogTrace(id)
bool TriggerMenuXmlParser::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 3633 of file TriggerMenuXmlParser.cc.

References LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

3634  {
3635 
3636  XERCES_CPP_NAMESPACE_USE
3637 
3638  // get condition, particle name and type name
3642 
3643  LogDebug("l1t|Global")
3644  << "\n ****************************************** "
3645  << "\n workCondition "
3646  << "\n condition = " << condition
3647  << "\n particle = " << particle
3648  << "\n type = " << type
3649  << "\n name = " << name
3650  << std::endl;
3651 
3652  if (condition.empty() || particle.empty() || type.empty() ) {
3653 
3654  edm::LogError("TriggerMenuXmlParser") << "Missing attributes for condition " << name
3655  << std::endl;
3656 
3657  return false;
3658  }
3659 
3660  //LogTrace("TriggerMenuXmlParser")
3661  //<< " condition: " << condition << ", particle: " << particle
3662  //<< ", type: " << type << std::endl;
3663 
3664  // call the appropiate function for this condition
3665 
3666  /*
3667  if (condition == m_xmlConditionAttrConditionMuon) {
3668  return parseMuon(node, name, chipNr);
3669  }
3670  else if (condition == m_xmlConditionAttrConditionCalo) {
3671  return parseCalo(node, name, chipNr);
3672  }
3673  else if (condition == m_xmlConditionAttrConditionEnergySum) {
3674  return parseEnergySum(node, name, chipNr);
3675  }
3676  else if (condition == m_xmlConditionAttrConditionJetCounts) {
3677  return parseJetCounts(node, name, chipNr);
3678  }
3679  else if (condition == m_xmlConditionAttrConditionCastor) {
3680  return parseCastor(node, name, chipNr);
3681  }
3682  else if (condition == m_xmlConditionAttrConditionHfBitCounts) {
3683  return parseHfBitCounts(node, name, chipNr);
3684  }
3685  else if (condition == m_xmlConditionAttrConditionHfRingEtSums) {
3686  return parseHfRingEtSums(node, name, chipNr);
3687  }
3688  else if (condition == m_xmlConditionAttrConditionBptx) {
3689  return parseBptx(node, name, chipNr);
3690  }
3691  else if (condition == m_xmlConditionAttrConditionExternal) {
3692  return parseExternal(node, name, chipNr);
3693  }
3694  else if (condition == m_xmlConditionAttrConditionCorrelation) {
3695  return parseCorrelation(node, name, chipNr);
3696  }
3697  else {
3698  edm::LogError("TriggerMenuXmlParser")
3699  << "\n Error: unknown condition (" << condition << ")"
3700  << std::endl;
3701 
3702  return false;
3703  }
3704 
3705  */
3706  return true;
3707 
3708 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrCondition
static const std::string m_xmlConditionAttrType
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
bool TriggerMenuXmlParser::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 3916 of file TriggerMenuXmlParser.cc.

References cmsPerfPublish::fail(), edm::isDebugEnabled(), LogDebug, LogTrace, L1GtAlgorithm::print(), L1GtAlgorithm::setAlgoAlias(), and AlCaHLTBitMon_QueryRunRegistry::string.

3917  {
3918 
3919  XERCES_CPP_NAMESPACE_USE
3920 
3921  if (node == 0) {
3922  LogDebug("TriggerMenuXmlParser")
3923  << " Node is 0 in " << __PRETTY_FUNCTION__
3924  << " can not parse the technical trigger " << algName
3925  << std::endl;
3926  return false;
3927  }
3928 
3929  // get the logical expression from the node
3930  std::string logExpression = getXMLTextValue(node);
3931 
3932  //LogTrace("TriggerMenuXmlParser")
3933  //<< " Logical expression: " << logExpression
3934  //<< std::endl;
3935 
3936  // determine bit number (use output pin tag)
3937  DOMNode* pinNode = findXMLChild(node->getFirstChild(), m_xmlTagOutput);
3938  std::string pinString;
3939  int outputPin = 0;
3940 
3941  pinNode = node->getFirstChild();
3942  if ( (pinNode = findXMLChild(pinNode, m_xmlTagOutputPin) ) != 0) {
3943  pinString = getXMLAttribute(pinNode, m_xmlAttrNr);
3944 
3945  // convert pinString to integer
3946  std::istringstream opStream(pinString);
3947 
3948  if ((opStream >> outputPin).fail()) {
3949  LogDebug("TriggerMenuXmlParser")
3950  << " Unable to convert pin string " << pinString
3951  << " to int for technical trigger : " << algName
3952  << std::endl;
3953 
3954  return false;
3955  }
3956 
3957  }
3958 
3959  if (pinNode == 0) {
3960  LogTrace("TriggerMenuXmlParser")
3961  << " Warning: No pin number found for technical trigger: "
3962  << algName << std::endl;
3963 
3964  return false;
3965  }
3966 
3967  // set the bit number
3968  int bitNumber = outputPin;
3969 
3970  //LogTrace("TriggerMenuXmlParser")
3971  //<< " Bit number: " << bitNumber
3972  //<< std::endl;
3973 
3974  // create a new technical trigger and insert it into technical trigger map
3975  // alias set automatically to name
3976  L1GtAlgorithm alg(algName, logExpression, bitNumber);
3977  alg.setAlgoAlias(algName);
3978 
3979  if (edm::isDebugEnabled() ) {
3980 
3981  std::ostringstream myCoutStream;
3982  alg.print(myCoutStream);
3983  LogTrace("TriggerMenuXmlParser") << myCoutStream.str() << "\n" << std::endl;
3984 
3985  }
3986 
3987  // insert technical trigger into the map
3988  if ( !insertTechTriggerIntoMap(alg)) {
3989 
3990  return false;
3991  }
3992 
3993  return true;
3994 
3995 }
#define LogDebug(id)
bool isDebugEnabled()
bool insertTechTriggerIntoMap(const L1GtAlgorithm &alg)
insert a technical trigger into technical trigger map
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)
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
std::string getXMLTextValue(XERCES_CPP_NAMESPACE::DOMNode *node)
get the text value of a xml node as string
bool TriggerMenuXmlParser::workXML ( std::auto_ptr< l1t::L1TriggerMenu >  tm)
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 4062 of file TriggerMenuXmlParser.cc.

4062  {
4063 
4064  XERCES_CPP_NAMESPACE_USE
4065 
4066 
4067  // clear possible old maps
4068  clearMaps();
4069 
4070  l1t::Meta meta = tm->meta();
4071  l1t::ConditionList conditions = tm->conditions();
4072  l1t::AlgorithmList algorithms = tm->algorithms();
4073 
4074  if ( !parseId( meta ) ) {
4075  clearMaps();
4076  return false;
4077  }
4078 
4079  if ( !parseConditions( conditions ) ) {
4080  clearMaps();
4081  return false;
4082  }
4083 
4084  if ( !parseAlgorithms( algorithms ) ) {
4085  clearMaps();
4086  return false;
4087  }
4088 
4089 // if ( !parseTechTriggers(parser) ) {
4090 // clearMaps();
4091 // return false;
4092 // }
4093 
4094  return true;
4095 
4096 }
bool parseConditions(l1t::ConditionList conditions)
parse all conditions
bool parseId(std::auto_ptr< l1t::L1TriggerMenu > tm)
parse all parse all identification attributes (trigger menu names, scale DB key, etc) ...
bool parseAlgorithms(l1t::AlgorithmList algorithms)
parse all algorithms

Member Data Documentation

AlgorithmMap l1t::TriggerMenuXmlParser::m_algorithmAliasMap
private

map containing the physics algorithms (by alias)

Definition at line 599 of file TriggerMenuXmlParser.h.

Referenced by gtAlgorithmAliasMap().

std::string l1t::TriggerMenuXmlParser::m_algorithmImplementation
private

Definition at line 560 of file TriggerMenuXmlParser.h.

Referenced by gtAlgorithmImplementation().

AlgorithmMap l1t::TriggerMenuXmlParser::m_algorithmMap
private

map containing the physics algorithms (by name)

Definition at line 596 of file TriggerMenuXmlParser.h.

Referenced by gtAlgorithmMap().

std::vector<ConditionMap> l1t::TriggerMenuXmlParser::m_conditionMap
private

map containing the conditions (per condition chip) - transient

Definition at line 566 of file TriggerMenuXmlParser.h.

Referenced by gtConditionMap().

std::vector<std::vector<CaloTemplate> > l1t::TriggerMenuXmlParser::m_corCaloTemplate
private

Definition at line 592 of file TriggerMenuXmlParser.h.

Referenced by corCaloTemplate().

std::vector<std::vector<L1GtEnergySumTemplate> > l1t::TriggerMenuXmlParser::m_corEnergySumTemplate
private

Definition at line 593 of file TriggerMenuXmlParser.h.

Referenced by corEnergySumTemplate().

std::vector<std::vector<MuonTemplate> > l1t::TriggerMenuXmlParser::m_corMuonTemplate
private

Definition at line 591 of file TriggerMenuXmlParser.h.

Referenced by corMuonTemplate().

unsigned int l1t::TriggerMenuXmlParser::m_numberConditionChips
private

hardware limits

number of condition chips

Definition at line 530 of file TriggerMenuXmlParser.h.

Referenced by gtNumberConditionChips().

unsigned int l1t::TriggerMenuXmlParser::m_numberL1JetCounts
private

jet counts

Definition at line 546 of file TriggerMenuXmlParser.h.

Referenced by gtNumberL1JetCounts().

unsigned int l1t::TriggerMenuXmlParser::m_numberPhysTriggers
private

number of physics trigger algorithms

Definition at line 540 of file TriggerMenuXmlParser.h.

Referenced by gtNumberPhysTriggers().

unsigned int l1t::TriggerMenuXmlParser::m_numberTechTriggers
private

number of technical triggers

Definition at line 543 of file TriggerMenuXmlParser.h.

Referenced by gtNumberTechTriggers().

std::vector<int> l1t::TriggerMenuXmlParser::m_orderConditionChip
private

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

Definition at line 537 of file TriggerMenuXmlParser.h.

Referenced by gtOrderConditionChip().

unsigned int l1t::TriggerMenuXmlParser::m_pinsOnConditionChip
private

number of pins on the GTL condition chips

Definition at line 533 of file TriggerMenuXmlParser.h.

Referenced by gtPinsOnConditionChip().

std::string l1t::TriggerMenuXmlParser::m_scaleDbKey
private

menu associated scale key

Definition at line 576 of file TriggerMenuXmlParser.h.

Referenced by gtScaleDbKey().

AlgorithmMap l1t::TriggerMenuXmlParser::m_technicalTriggerMap
private

map containing the technical triggers

Definition at line 602 of file TriggerMenuXmlParser.h.

Referenced by gtTechnicalTriggerMap().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuAuthor
private

Definition at line 557 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuAuthor().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuDate
private

Definition at line 556 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuDate().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuDescription
private

Definition at line 558 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuDescription().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuImplementation
private

Definition at line 573 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuImplementation().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuInterface
private

menu names

Definition at line 571 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuInterface().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuInterfaceAuthor
private

Definition at line 553 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuInterfaceAuthor().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuInterfaceDate
private

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

Definition at line 552 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuInterfaceDate().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuInterfaceDescription
private

Definition at line 554 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuInterfaceDescription().

std::string l1t::TriggerMenuXmlParser::m_triggerMenuName
private

Definition at line 572 of file TriggerMenuXmlParser.h.

Referenced by gtTriggerMenuName().

std::vector<std::vector<L1GtBptxTemplate> > l1t::TriggerMenuXmlParser::m_vecBptxTemplate
private

Definition at line 587 of file TriggerMenuXmlParser.h.

Referenced by vecBptxTemplate().

std::vector<std::vector<CaloTemplate> > l1t::TriggerMenuXmlParser::m_vecCaloTemplate
private

Definition at line 581 of file TriggerMenuXmlParser.h.

Referenced by vecCaloTemplate().

std::vector<std::vector<L1GtCastorTemplate> > l1t::TriggerMenuXmlParser::m_vecCastorTemplate
private

Definition at line 584 of file TriggerMenuXmlParser.h.

Referenced by vecCastorTemplate().

std::vector<std::vector<CorrelationTemplate> > l1t::TriggerMenuXmlParser::m_vecCorrelationTemplate
private

Definition at line 590 of file TriggerMenuXmlParser.h.

Referenced by vecCorrelationTemplate().

std::vector<std::vector<L1GtEnergySumTemplate> > l1t::TriggerMenuXmlParser::m_vecEnergySumTemplate
private

Definition at line 582 of file TriggerMenuXmlParser.h.

Referenced by vecEnergySumTemplate().

std::vector<std::vector<L1GtExternalTemplate> > l1t::TriggerMenuXmlParser::m_vecExternalTemplate
private

Definition at line 588 of file TriggerMenuXmlParser.h.

Referenced by vecExternalTemplate().

std::vector<std::vector<L1GtHfBitCountsTemplate> > l1t::TriggerMenuXmlParser::m_vecHfBitCountsTemplate
private

Definition at line 585 of file TriggerMenuXmlParser.h.

Referenced by vecHfBitCountsTemplate().

std::vector<std::vector<L1GtHfRingEtSumsTemplate> > l1t::TriggerMenuXmlParser::m_vecHfRingEtSumsTemplate
private

Definition at line 586 of file TriggerMenuXmlParser.h.

Referenced by vecHfRingEtSumsTemplate().

std::vector<std::vector<L1GtJetCountsTemplate> > l1t::TriggerMenuXmlParser::m_vecJetCountsTemplate
private

Definition at line 583 of file TriggerMenuXmlParser.h.

Referenced by vecJetCountsTemplate().

std::vector<std::vector<MuonTemplate> > l1t::TriggerMenuXmlParser::m_vecMuonTemplate
private

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

Definition at line 580 of file TriggerMenuXmlParser.h.

Referenced by vecMuonTemplate().

XERCES_CPP_NAMESPACE::ErrorHandler* l1t::TriggerMenuXmlParser::m_xmlErrHandler
private

error handler for xml-parser

Definition at line 525 of file TriggerMenuXmlParser.h.