File indexing completed on 2024-04-06 12:05:35
0001 #include <iostream>
0002 #include <cstdlib>
0003 #include <vector>
0004
0005 #include "DetectorDescription/Parser/interface/DDLParser.h"
0006 #include "DetectorDescription/RegressionTest/src/DDCheck.h"
0007 #include "DetectorDescription/Core/interface/DDRoot.h"
0008 #include "DetectorDescription/Core/interface/DDException.h"
0009 #include "DetectorDescription/Core/interface/DDSpecifics.h"
0010 #include "DetectorDescription/Core/interface/DDFilter.h"
0011 #include "DetectorDescription/Core/interface/DDFilteredView.h"
0012 #include "DetectorDescription/Core/interface/DDValue.h"
0013 #include "DetectorDescription/Core/src/tutorial.h"
0014 #include "DetectorDescription/Core/interface/Specific.h"
0015 #include "DetectorDescription/Core/interface/DDException.h"
0016 #include "DetectorDescription/Core/interface/DDComparator.h"
0017
0018
0019
0020
0021
0022
0023 using namespace DDI;
0024 using namespace std;
0025
0026
0027 class PSCreator : public Specific {
0028 public:
0029 PSCreator(const vector<string>& s, DDsvalues_type dummy) : Specific(s, dummy) {}
0030 vector<DDPartSelection> selections() { return Specific::partSelections_; }
0031 };
0032
0033 int main(int argc, char* argv[]) {
0034 try {
0035
0036
0037
0038 cout << "initialize DDL parser" << endl;
0039 DDLParser* myP = DDLParser::Instance();
0040
0041 cout << "about to set configuration" << endl;
0042
0043
0044
0045
0046
0047
0048
0049 myP->SetConfig("configuration.xml");
0050
0051 cout << "about to start parsing" << endl;
0052 int parserResult = myP->StartParsing();
0053 if (parserResult != 0) {
0054 cout << " problem encountered during parsing. exiting ... " << endl;
0055 exit(1);
0056 }
0057 cout << " parsing completed" << endl;
0058
0059 cout << endl << endl << "Start checking!" << endl << endl;
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 DDCheck(cout);
0070
0071
0072 bool loop = true;
0073
0074 DDCompactView cpv;
0075 DDExpandedView ex(cpv);
0076 while (loop) {
0077 vector<string> selV(1);
0078 cout << "Part-Selection (//doc1:name1//doc2:name2[cpno2]/nam4 ...)" << endl;
0079 cin >> selV[0];
0080 if (selV[0] == "end")
0081 loop = false;
0082 DDsvalues_type dummy;
0083 vector<DDPartSelection> partSelV = PSCreator(selV, dummy).selections();
0084 int I = partSelV.size();
0085 int i = 0;
0086 for (; i < I; ++i) {
0087 bool go = true;
0088 while (go) {
0089 if (DDCompareEqual(ex.geoHistory(), partSelV[i])(ex.geoHistory(), partSelV[i])) {
0090
0091 cout << ex.geoHistory() << endl;
0092 cout << ex.translation() << endl;
0093
0094 }
0095 go = ex.next();
0096 }
0097 ex.reset();
0098 }
0099 }
0100 return 0;
0101
0102 } catch (DDException& e)
0103 {
0104 cerr << "DDD-PROBLEM:" << endl << e << endl;
0105 }
0106 }