#include "TEnv.h"
#include "TSystem.h"
#include "TEveManager.h"
#include "TRint.h"
#include "TApplication.h"
#include "TSysEvtHandler.h"
#include "Getline.h"
#include <iostream>
#include <fstream>
#include <cstring>
#include <memory>
#include <csignal>
#include "Fireworks/Core/src/CmsShowMain.h"
#include "Fireworks/Core/interface/fwPaths.h"
#include "FWCore/MessageLogger/interface/AbstractMLscribe.h"
#include "FWCore/MessageLogger/interface/ErrorObj.h"
#include "FWCore/MessageLogger/interface/MessageLoggerQ.h"
#include "FWCore/MessageLogger/interface/MessageDrop.h"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
void | run_app (TApplication &app, int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 124 of file cmsShow.cc.
References dir2webdir::argc, MessageLogger_cfi::cerr, cppFunctionSkipper::exception, mps_fire::i, run_app(), fireworks::setPath(), and mps_setup::stdout.
126 const char* dummyArgvArray[] = {
"cmsShow"};
127 char** dummyArgv =
const_cast<char**
>(dummyArgvArray);
129 gEnv->SetValue(
"Gui.BackgroundColor",
"#9f9f9f");
133 if (gSystem->Getenv(
"CMSSW_VERSION"))
135 infoText = gSystem->Getenv(
"CMSSW_VERSION");
139 TString infoFileName(
"data/version.txt");
141 std::ifstream infoFile(infoFileName);
142 infoText.ReadLine(infoFile);
145 printf(
"Starting cmsShow, version %s.\n", infoText.Data());
152 if (strncmp(
argv[
i],
"-r", 2) == 0 ||
153 strncmp(
argv[i],
"--root", 6) == 0)
162 std::cerr<<
"WARNING:You are running cmsShow with ROOT prompt enabled."<<std::endl;
163 std::cerr<<
"If you encounter an issue you suspect to be a bug in "<<std::endl;
164 std::cerr<<
"cmsShow, please re-run without this option and try to "<<std::endl;
165 std::cerr<<
"reproduce it before submitting a bug-report. "<<std::endl;
168 TRint app(
"cmsShow", &dummyArgc, dummyArgv);
171 TApplication app(
"cmsShow", &dummyArgc, dummyArgv);
177 std::cerr <<
"CmsShow unhandled exception "<<iException.what()<<std::endl;
void run_app(TApplication &app, int argc, char **argv)
void run_app |
( |
TApplication & |
app, |
|
|
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 88 of file cmsShow.cc.
References edm::MessageDrop::instance(), edm::MessageDrop::messageLoggerScribeIsRunning, edm::MessageLoggerQ::MLqEND(), edm::MLSCRIBE_RUNNING_INDICATOR, and edm::MessageLoggerQ::setMLscribe_ptr().
Referenced by main().
98 gSystem->ResetSignal(kSigBus);
99 gSystem->ResetSignal(kSigSegmentationViolation);
100 gSystem->ResetSignal(kSigIllegalInstruction);
101 gSystem->ResetSignal(kSigSystem);
102 gSystem->ResetSignal(kSigPipe);
103 gSystem->ResetSignal(kSigFloatingException);
105 struct sigaction sac;
106 sac.sa_sigaction = signal_handler_wrapper;
107 sigemptyset(&sac.sa_mask);
108 sac.sa_flags = SA_SIGINFO;
109 sigaction(SIGILL, &sac,
nullptr);
110 sigaction(SIGSEGV, &sac,
nullptr);
111 sigaction(SIGBUS, &sac,
nullptr);
112 sigaction(SIGFPE, &sac,
nullptr);
117 TEveManager::Terminate();
static unsigned char messageLoggerScribeIsRunning
static MessageDrop * instance()
static const unsigned char MLSCRIBE_RUNNING_INDICATOR
static void setMLscribe_ptr(std::shared_ptr< edm::service::AbstractMLscribe > m)