17 XERCES_CPP_NAMESPACE_USE
37 static const char * _str =
"\
41 <EXTENSION_TABLE_NAME>HCAL_TRIGGER_KEY</EXTENSION_TABLE_NAME>\n\
42 <NAME>HCAL trigger key</NAME>\n\
44 <RUN mode='no-run' />\n\
47 <VERSION>test_version</VERSION>\n\
48 <SUBVERSION>1</SUBVERSION>\n\
49 <CREATE_TIMESTAMP>2000-01-01 00:00:00.0</CREATE_TIMESTAMP>\n\
50 <CREATED_BY_USER>kukarzev</CREATED_BY_USER>\n\
51 <COMMENT_DESCRIPTION>test trigger key</COMMENT_DESCRIPTION>\n\
53 <NAME_LABEL>CMS-HCAL-ROOT</NAME_LABEL>\n\
56 <!-- Tags secton -->\n\
58 <DATA_SET id='-1'/>\n\
60 <INTERVAL_OF_VALIDITY_BEGIN>0</INTERVAL_OF_VALIDITY_BEGIN>\n\
61 <INTERVAL_OF_VALIDITY_END>1</INTERVAL_OF_VALIDITY_END>\n\
63 <TAG id='2' mode='auto'>\n\
64 <TAG_NAME>trigger_key_tag</TAG_NAME>\n\
65 <DETECTOR_NAME>HCAL</DETECTOR_NAME>\n\
66 <COMMENT_DESCRIPTION>trigger_key_tag</COMMENT_DESCRIPTION>\n\
72 <DATA_SET idref='-1' />\n\
78 const XMLByte * _template = (
const XMLByte *)_str;
79 _root =
new MemBufInputSource( _template, strlen( (
const char *)_template ),
"_root",
false );
81 static const char * _str2 =
"\
83 <TRIGGER_KEY_ID>TEST_trigger_key</TRIGGER_KEY_ID>\n\
84 <TRIGGER_KEY_CONFIG_TYPE>LUT_tag</TRIGGER_KEY_CONFIG_TYPE>\n\
85 <TRIGGER_KEY_CONFIG_VALUE>CRUZET_part4_physics_v3</TRIGGER_KEY_CONFIG_VALUE>\n\
88 const XMLByte * _template2 = (
const XMLByte *)_str2;
89 _data =
new MemBufInputSource( _template2, strlen( (
const char *)_template2 ),
"_data",
false );
98 data_block.
setTagValue(
"TRIGGER_KEY_CONFIG_TYPE",type);
99 data_block.
setTagValue(
"TRIGGER_KEY_CONFIG_VALUE",value);
101 DOMDocument * data_doc = data_block .
getDocument();
105 DOMNode * clone_data =
document -> importNode( data_doc -> getDocumentElement(),
true );
106 data_set_elem -> appendChild( clone_data );
116 for(std::map<std::string,std::string>::const_iterator key_pair=key.begin(); key_pair!=key.end(); key_pair++){
117 add_data(key_id, key_pair->first, key_pair->second);
125 std::map<std::string, std::string> _key;
128 std::cout << std::endl <<
"Creating the trigger key..." << std::endl;
129 std::cout << std::endl <<
"Enter the key ID (or tag if you would): " << std::endl;
130 std::getline(std::cin, _id);
132 std::cout <<
"Enter the next config type (or type exit if the trigger key is complete): " << std::endl;
133 std::getline(std::cin, _type);
134 if (_type.find(
"exit") != std::string::npos)
break;
135 std::cout <<
"Enter the config value: " << std::endl;
136 std::getline(std::cin, _value);
137 _key.insert(std::pair<std::string, std::string>(_type, _value));
142 std::cout << std::endl <<
"Creating the trigger key... done" << std::endl;
XERCES_CPP_NAMESPACE::DOMDocument * document
XERCES_CPP_NAMESPACE::MemBufInputSource * _data
XERCES_CPP_NAMESPACE::MemBufInputSource * _root
XERCES_CPP_NAMESPACE::DOMDocument * getDocument(void)
XERCES_CPP_NAMESPACE::DOMNode * setTagValue(const std::string &tagName, const std::string &tagValue, int _item=0, XERCES_CPP_NAMESPACE::DOMDocument *_document=NULL)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
int fill_key(std::string key_id, std::map< std::string, std::string > &key)
static XMLCh * _toXMLCh(std::string temp)
int add_data(std::string id, std::string type, std::string value)
virtual ~HcalTriggerKey()
void parse(XERCES_CPP_NAMESPACE::InputSource &_source)
int compose_key_dialogue(void)