24{
26 for (
int i = 0;
i<=
argc;
i++){
28 }
29
31
32
33 QCommandLineOption databaseDirectoryOption(QStringList() << "d" << "database-directory", "Use geometry database <file>.", "default");
34 parser.addOption(databaseDirectoryOption);
35
36
37 QCommandLineOption AODDirectoryOption(QStringList() << "x" << "xaod-directory", "Use xAOD file <file>.", "default");
38 parser.addOption(AODDirectoryOption);
39
40
41 QCommandLineOption helpOption(QStringList() << "h" << "help", "Show help.");
42 parser.addOption(helpOption);
43
44
46
47 bool helpIsSet =
parser.isSet(helpOption);
48 bool dbIsSet =
parser.isSet(databaseDirectoryOption);
49 bool AODIsSet =
parser.isSet(AODDirectoryOption);
50 QString dbDir =
parser.value(databaseDirectoryOption);
51 QString aodDir =
parser.value(AODDirectoryOption);
52
53
54 if(helpIsSet){
55 qInfo() << "Usage";
56 qInfo() << " ";
57 qInfo() << " vp1light [options]";
58 qInfo() << " ";
59 qInfo() << "Add path to geometry database or AOD file as options. Alternatively they can be set inside VP1Light.";
60 qInfo() << " ";
61 qInfo() << "Options:";
62 qInfo() << " -h, --help = Show help.";
63 qInfo() << " -d, --database-directory <path-to-DB> = Specify geometry database file.";
64 qInfo() << " -x, --xaod-directory <path-to-xAOD> = Specify xAOD file.";
65 return 0;
66 }
67
68
69 QSettings settings("ATLAS", "VP1Light");
70 if(dbIsSet){
71 settings.setValue("db/path", dbDir);
72 settings.setValue("db/dbByEnv", "1");
73 }
74 else{
75 settings.setValue("db/dbByEnv", "");
76 }
77 if(AODIsSet){
78 settings.setValue("aod/path", aodDir);
79 settings.setValue("aod/aodByEnv", "1");
80 }
81 else{
82 settings.setValue("aod/aodByEnv", "");
83 }
84
85
86 if(settings.value("ExpertSettings/notFirstStart").toString().isEmpty()){
87 settings.setValue("ExpertSettings/notFirstStart","1");
88 settings.setValue("ExpertSettings/enableExpertSettings","");
89 }
90
91
93
94 vp1light.initialize();
95 while ( vp1light.execute());
96}