CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EveDisplayPlugin.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: EveDisplayPlugin
4 // Class: EveDisplayPlugin
5 //
13 //
14 // Original Author: Chris D Jones
15 // Created: Wed Sep 26 08:27:23 EDT 2007
16 //
17 //
18 #define private public // workaround for bug in 5.34.18
19 #include "TROOT.h"
20 #include "TSystem.h"
21 #include "TColor.h"
22 #include "TStyle.h"
23 #include "TEnv.h"
24 
25 // system include files
26 #include <memory>
27 #include <iostream>
28 #include <sstream>
29 
30 // user include files
34 
36 
39 
40 #include "TGeoManager.h"
41 #include "TEveManager.h"
42 #include "TEveGeoNode.h"
43 
44 //
45 // class decleration
46 //
47 
49 
50  public:
51  explicit EveDisplayPlugin();
53 
54 
55  private:
56  virtual void run(const edm::EventSetup&) override;
57 
58 };
59 
60 //
61 // constants, enums and typedefs
62 //
63 
64 //
65 // static data member definitions
66 //
67 
68 //
69 // constructors and destructor
70 //
72 {
73  //now do what ever initialization is needed
74 
75 }
76 
77 
79 {
80 
81  // do anything here that needs to be done at desctruction time
82  // (e.g. close files, deallocate resources etc.)
83 
84 }
85 
86 
87 //
88 // member functions
89 //
90 // ------------ method called to for each event ------------
91 void
93 {
94  std::cout << "In the EveDisplayPlugin::analyze method..." << std::endl;
95  using namespace edm;
96 
98  iSetup.get<DisplayGeomRecord>().get(geom);
99 
100 
101 
102 // AMT workaround for an agressive clenup in 5.43.18
103 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,34,18)
104  if (!gStyle) {
105  TColor::fgInitDone=false;
106  TColor::InitializeColors();
107  TStyle::BuildStyles();
108  gROOT->SetStyle(gEnv->GetValue("Canvas.Style", "Modern"));
109  gStyle = gROOT->GetStyle("Classic");
110  }
111 #endif
112 
113  TEveManager::Create();
114 
115  TEveGeoTopNode* trk = new TEveGeoTopNode(const_cast<TGeoManager*>(geom.product()),
116  geom->GetTopNode());
117  trk->SetVisLevel(2);
118  gEve->AddGlobalElement(trk);
119 
120 }
121 
122 
123 //define this as a plug-in
#define DEFINE_FIREWORKS_GEOM_DISPLAY(type)
virtual void run(const edm::EventSetup &) override
const T & get() const
Definition: EventSetup.h:56
tuple cout
Definition: gather_cfg.py:121