CMS 3D CMS Logo

FWFFHelper.cc
Go to the documentation of this file.
4 
5 #include "TROOT.h"
6 #include "TSystem.h"
7 #include "TColor.h"
8 #include "TStyle.h"
9 #include "TEnv.h"
10 #include "TRint.h"
11 #include "TEveManager.h"
12 #include "TEveEventManager.h"
13 #include "TEveTrackPropagator.h"
14 #include "TGLWidget.h"
15 #include "TEveBrowser.h"
16 
17 #include <cassert>
18 #include <iostream>
19 
20 class FWFFTRint : public TRint {
21 public:
22  FWFFTRint(const char *appClassName, Int_t *argc, char **argv, bool rootPrompt)
23  : TRint(appClassName, argc, argv, nullptr, 0, !rootPrompt), m_rootPrompt(rootPrompt) {
24  if (rootPrompt)
25  return;
26 
27  SetPrompt("");
28  GetInputHandler()->Remove();
29  }
30 
31  Bool_t HandleTermInput() override {
32  if (m_rootPrompt)
33  return TRint::HandleTermInput();
34  return true;
35  }
36 
37 private:
39 };
40 
41 FWFFHelper::FWFFHelper(const edm::ParameterSet &ps, const edm::ActivityRegistry &) : m_Rint(nullptr) {
42  printf("CMSSW is starting... You should always have a 2 minutes walk every 45 minutes anyways.\n");
43  const char *dummyArgvArray[] = {"cmsRun"};
44  char **dummyArgv = const_cast<char **>(dummyArgvArray);
45  int dummyArgc = 1;
46 
47  m_Rint = new FWFFTRint("App", &dummyArgc, dummyArgv, ps.getUntrackedParameter<bool>("rootPrompt"));
48  assert(TApplication::GetApplications()->GetSize());
49 
50  gROOT->SetBatch(kFALSE);
51  TApplication::NeedGraphicsLibs();
52 
53  try {
54  TGLWidget *w = TGLWidget::Create(gClient->GetDefaultRoot(), kTRUE, kTRUE, nullptr, 10, 10);
55  delete w;
56  } catch (std::exception &iException) {
57  std::cerr << "Insufficient GL support. " << iException.what() << std::endl;
58  throw;
59  }
60 
61  TEveManager::Create(kFALSE, "FI");
62 }
FWFFHelper::m_Rint
TRint * m_Rint
Definition: FWFFHelper.h:17
cmsBatch.argv
argv
Definition: cmsBatch.py:279
FWFFTRint
Definition: FWFFHelper.cc:20
dir2webdir.argc
argc
Definition: dir2webdir.py:39
FWFFTRint::FWFFTRint
FWFFTRint(const char *appClassName, Int_t *argc, char **argv, bool rootPrompt)
Definition: FWFFHelper.cc:22
cms::cuda::assert
assert(be >=bs)
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ActivityRegistry.h
w
const double w
Definition: UKUtility.cc:23
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
FWFFHelper.h
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::ParameterSet
Definition: ParameterSet.h:47
FWFFHelper::FWFFHelper
FWFFHelper(const edm::ParameterSet &, const edm::ActivityRegistry &)
Definition: FWFFHelper.cc:41
FWFFTRint::m_rootPrompt
bool m_rootPrompt
Definition: FWFFHelper.cc:38
FWFFTRint::HandleTermInput
Bool_t HandleTermInput() override
Definition: FWFFHelper.cc:31
ParameterSet.h
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8