File indexing completed on 2024-04-06 12:22:27
0001 #include "L1Trigger/L1TCommon/src/Setting.cc"
0002 #include "L1Trigger/L1TCommon/src/Mask.cc"
0003 #include "L1Trigger/L1TCommon/src/XmlConfigReader.cc"
0004 #include "L1Trigger/L1TCommon/src/TrigSystem.cc"
0005
0006 #include <iostream>
0007 #include <fstream>
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 using namespace std;
0021
0022 int main(int argc, char *argv[]){
0023 if( argc < 2 ) return 0;
0024
0025
0026 list<string> sequence;
0027 map<string,string> xmlPayload;
0028 for(int p=1; p<argc; p++){
0029
0030 ifstream input( argv[p] );
0031 if( !input ){ cout << "Cannot open " << argv[p] << " file" << endl; return 0; }
0032 sequence.push_back( argv[p] );
0033
0034 size_t nLinesRead=0;
0035
0036 while( !input.eof() ){
0037 string tmp;
0038 getline( input, tmp, '\n' );
0039 xmlPayload[ argv[p] ].append( tmp );
0040 nLinesRead++;
0041 }
0042
0043 cout << argv[p] << ": read " << nLinesRead << " lines" << endl;
0044 input.close();
0045 }
0046
0047
0048 XmlConfigReader xmlRdr;
0049 l1t::TrigSystem trgSys;
0050 trgSys.addProcRole("MainProcessor", "processors");
0051
0052 for(auto &name : sequence){
0053 cout<<"Parsing "<<name<<endl;
0054 xmlRdr.readDOMFromString( xmlPayload[name] );
0055 xmlRdr.readRootElement ( trgSys, "calol2" );
0056 }
0057 trgSys.setConfigured();
0058
0059
0060 map<string, l1t::Setting> conf = trgSys.getSettings("MainProcessor");
0061
0062
0063 string tmp = conf["leptonSeedThreshold"].getValueAsStr();
0064 cout << "leptonSeedThreshold=" << tmp << endl;
0065
0066 return 0;
0067 }
0068