CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DisplayGeom Class Reference

#include <Reve/DisplayGeom/src/DisplayGeom.cc>

Inheritance diagram for DisplayGeom:
edm::EDAnalyzer

List of all members.

Public Member Functions

 DisplayGeom (const edm::ParameterSet &)
 ~DisplayGeom ()

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void endJob ()

Private Attributes

TApplication * app_
int level_
DisplayPluginplugin_
bool verbose_

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 43 of file DisplayGeom.cc.


Constructor & Destructor Documentation

DisplayGeom::DisplayGeom ( const edm::ParameterSet iConfig) [explicit]

Definition at line 72 of file DisplayGeom.cc.

References app_, gather_cfg::cout, reco::get(), and plugin_.

                                                      :
   level_(iConfig.getUntrackedParameter<int>("level",4)),
   verbose_(iConfig.getUntrackedParameter<bool>("verbose",false)),
   app_(0),
   plugin_(0)
{
   //now do what ever initialization is needed

  std::cout <<" is batch "<<gROOT->IsBatch()<<std::endl;
  std::cout <<" display "<<gSystem->Getenv("DISPLAY")<<std::endl;

  const char* dummyArgvArray[] = {"cmsRun"};
  char** dummyArgv = const_cast<char**>(dummyArgvArray);
  int dummyArgc = 1;
  app_ = new TApplication("App", &dummyArgc, dummyArgv);
  assert(TApplication::GetApplications()->GetSize());
  
  gROOT->SetBatch(kFALSE);
  //TApplication* app = dynamic_cast<TApplication*>(TApplication::GetApplications()->First());
  //assert(app!=0);
  std::cout<<"calling NeedGraphicsLibs()"<<std::endl;
  TApplication::NeedGraphicsLibs();

  DisplayPluginFactory* factory = DisplayPluginFactory::get();
  plugin_ = factory->create("EveDisplayPlugin");
}
DisplayGeom::~DisplayGeom ( )

Definition at line 100 of file DisplayGeom.cc.

References plugin_.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)
  
   delete plugin_;
}

Member Function Documentation

void DisplayGeom::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 116 of file DisplayGeom.cc.

References app_, gather_cfg::cout, plugin_, and fireworks::geometry::DisplayPlugin::run().

{
  std::cout << "In the DisplayGeom::analyze method..." << std::endl;
   using namespace edm;

   //need to reset the Error handler to avoid error messages becoming exceptions
   ErrorHandlerFunc_t old = SetErrorHandler(DefaultErrorHandler);

   plugin_->run(iSetup);
   app_->Run(kTRUE);

   SetErrorHandler(old);

   // Exit from fireworks
   // gApplication
   //app->Terminate(0);

}
void DisplayGeom::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file DisplayGeom.cc.

{
}
void DisplayGeom::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 144 of file DisplayGeom.cc.

                    {
}

Member Data Documentation

TApplication* DisplayGeom::app_ [private]

Definition at line 57 of file DisplayGeom.cc.

Referenced by analyze(), and DisplayGeom().

int DisplayGeom::level_ [private]

Definition at line 55 of file DisplayGeom.cc.

Definition at line 58 of file DisplayGeom.cc.

Referenced by analyze(), DisplayGeom(), and ~DisplayGeom().

bool DisplayGeom::verbose_ [private]

Definition at line 56 of file DisplayGeom.cc.