CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
T getUntrackedParameter(std::string const &, T const &) const
const double w
Definition: UKUtility.cc:23
bool m_rootPrompt
Definition: FWFFHelper.cc:38
assert(be >=bs)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
Bool_t HandleTermInput() override
Definition: FWFFHelper.cc:31
TRint * m_Rint
Definition: FWFFHelper.h:17
tuple argc
Definition: dir2webdir.py:39
FWFFTRint(const char *appClassName, Int_t *argc, char **argv, bool rootPrompt)
Definition: FWFFHelper.cc:22
FWFFHelper(const edm::ParameterSet &, const edm::ActivityRegistry &)
Definition: FWFFHelper.cc:41