"...git@code.ihep.ac.cn:yudian2002/cepcsw-ote-development.git" did not exist on "f876c6bd8f6f9a8a40e3bcc81f46dad6b226e1d0"
Newer
Older
// $Id:$
//====================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------
//
// Generic ROOT based geometry display program
//
// Author : M.Frank
//
//====================================================================
// Framework include files
#include "DD4hep/LCDD.h"
#include "TRint.h"
// C/C++ include files
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cerrno>
#include <string>
using namespace std;
using namespace DD4hep::Geometry;
//______________________________________________________________________________
namespace {
void usage() {
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
" -compact <file> Specify the compact geometry file \n"
" At least one compact geo file is required!\n"
" -load_only Dry-run to only load geometry without \n"
" starting the dispay. \n"
<< endl;
exit(EINVAL);
}
}
//______________________________________________________________________________
int main(int argc,char** argv) {
bool dry_run = false;
vector<char*> geo_files;
for(int i=1; i<argc;++i) {
if ( argv[i][0]=='-' ) {
if ( strncmp(argv[i],"-compact",2)==0 )
geo_files.push_back(argv[++i]);
else if ( strncmp(argv[i],"-load_only",2)==0 )
dry_run = true;
else
usage();
}
else { // This is the default
geo_files.push_back(argv[i]);
}
}
if ( geo_files.empty() )
usage();
try {
pair<int, char**> args(0,0);
LCDD& lcdd = LCDD::getInstance();
// Load all compact files
lcdd.apply("DD4hepCompactLoader",int(geo_files.size()),&geo_files[0]);
// Create an interactive ROOT application
if ( !dry_run ) {
TRint app("DD4hepGeometryDisplay", &args.first, args.second);
lcdd.apply("DD4hepGeometryDisplay",args.first,args.second);
app.Run();
}
else {
cout << "The geometry was loaded. Application now exiting." << endl;
}
return 0;
}
catch(const exception& e) {
cout << "Exception:" << e.what() << endl;
}
catch(...) {
cout << "UNKNOWN Exception" << endl;
}
return EINVAL;
}