CMS 3D CMS Logo

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