Transfers the input ROOT file to the EventDisplay class to manage and draw.
24 {
25
26 bool verbose = false;
27 std::string file;
28 for (int iArg = 1; iArg < argc; iArg++) {
29 if (strcmp(argv[iArg], "--help") == 0 or strcmp(argv[iArg], "-h") == 0) {
31 return 0;
32 } else if (strcmp(argv[iArg], "--verbose") == 0 or
33 strcmp(argv[iArg], "-v") == 0) {
34 verbose = true;
35 } else if (file.empty()) {
36 file = argv[iArg];
37 } else {
39 return 1;
40 }
41 }
42
43 if (verbose) {
44 std::cout << "[ ldmx-eve ] : Starting up ROOT app, manager, and browser."
45 << std::endl;
46 }
47
48 int* dummyArgC;
49 char** dummyArgV;
50 TRint* app = new TRint("app", dummyArgC, dummyArgV, 0, 0, true);
51 app->SetPrompt("");
52
53 TEveManager* manager = TEveManager::Create(kTRUE, "FV");
54
55 TEveBrowser* browser = manager->GetBrowser();
56 browser->StartEmbedding(TRootBrowser::kLeft);
57
58 if (verbose) {
59 std::cout << "[ ldmx-eve ] : Constructing Event Display window and drawing "
60 "geometry."
61 << std::endl;
62 }
63
65
66 if (verbose) {
67 std::cout << "[ ldmx-eve ] : Opening file " << file << std::endl;
68 }
69
70 if (!display.SetFile(file)) {
71 std::cerr << "[ ldmx-eve ] : Unable to open file! Exiting..." << std::endl;
72
73 app->Terminate(1);
74 manager->Terminate();
75 browser->ReallyDelete();
76
77 return 1;
78 }
79
80 browser->SetTabTitle("Event Control", 0);
81 browser->StopEmbedding();
82
83 if (verbose) {
84 std::cout << "[ ldmx-eve ] : Event display window has been opened. Enter "
85 "'.q' to quit the root prompt."
86 << std::endl;
87 }
88
89
90
91
92 app->Run(kFALSE);
93
94 return 0;
95}
void printHelp()
Print Help Message for ldmx-eve.