CMS 3D CMS Logo

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 
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 public:
51  ~EveDisplayPlugin() override;
52 
53 private:
54  void run(const edm::EventSetup&) override;
56 };
57 
58 //
59 // constants, enums and typedefs
60 //
61 
62 //
63 // static data member definitions
64 //
65 
66 //
67 // constructors and destructor
68 //
69 EveDisplayPlugin::EveDisplayPlugin(edm::ConsumesCollector iCollector) : m_geomToken(iCollector.esConsumes()) {
70  //now do what ever initialization is needed
71 }
72 
74  // do anything here that needs to be done at desctruction time
75  // (e.g. close files, deallocate resources etc.)
76 }
77 
78 //
79 // member functions
80 //
81 // ------------ method called to for each event ------------
83  std::cout << "In the EveDisplayPlugin::analyze method..." << std::endl;
84  using namespace edm;
85 
86  TGeoManager const& geom = iSetup.getData(m_geomToken);
87 
88  TEveManager::Create();
89 
90  TEveGeoTopNode* trk = new TEveGeoTopNode(const_cast<TGeoManager*>(&geom), geom.GetTopNode());
91  trk->SetVisLevel(2);
92  gEve->AddGlobalElement(trk);
93 }
94 
95 //define this as a plug-in
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
~EveDisplayPlugin() override
const edm::ESGetToken< TGeoManager, DisplayGeomRecord > m_geomToken
#define DEFINE_FIREWORKS_GEOM_DISPLAY(type)
void run(const edm::EventSetup &) override
HLT enums.
EveDisplayPlugin(edm::ConsumesCollector)