CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | Friends
FWLiteEnabler Class Reference

#include <FWLiteEnabler.h>

Public Member Functions

 FWLiteEnabler (const FWLiteEnabler &)=delete
 
FWLiteEnabler const & operator= (FWLiteEnabler const &)=delete
 

Static Public Member Functions

static void enable ()
 enable automatic library loading More...
 

Private Member Functions

 FWLiteEnabler ()
 

Static Private Attributes

static bool enabled_
 

Friends

class DummyClassToStopCompilerWarning
 

Detailed Description

helper class to enable fwlite. Using a free function enable() directly does not work in macros.

Definition at line 11 of file FWLiteEnabler.h.

Constructor & Destructor Documentation

◆ FWLiteEnabler() [1/2]

FWLiteEnabler::FWLiteEnabler ( const FWLiteEnabler )
delete

◆ FWLiteEnabler() [2/2]

FWLiteEnabler::FWLiteEnabler ( )
private

Definition at line 40 of file FWLiteEnabler.cc.

40 {}

Member Function Documentation

◆ enable()

void FWLiteEnabler::enable ( )
static

enable automatic library loading

Definition at line 46 of file FWLiteEnabler.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, edmplugin::standard::config(), edmplugin::PluginManager::configure(), DeadROC_duringRun::dir, enabled_, mps_fire::end, web.browse_db::env, fwlite::setRefStreamer(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CmsShowMain::CmsShowMain(), AutoLibraryLoader::enable(), fwlite::EventContainer::EventContainer(), AutoLibraryLoader::loadAll(), and main().

46  {
47  if (enabled_) {
48  return;
49  }
50  enabled_ = true;
51 
53  static BareRootProductGetter s_getter;
54  //this function must be called
55  // so that the TClass we need will be available
56  fwlite::setRefStreamer(&s_getter);
57 
58  //Make it easy to load our headers
59  TInterpreter* intrp = gROOT->GetInterpreter();
60  char const* env = std::getenv("CMSSW_FWLITE_INCLUDE_PATH");
61  if (nullptr != env) {
62  //this is a comma separated list
63  char const* start = env;
64  char const* end;
65  do {
66  //find end
67  for (end = start; *end != 0 and *end != ':'; ++end)
68  ;
70  intrp->AddIncludePath(dir.c_str());
71  start = end + 1;
72  } while (*end != 0);
73  }
74 
75  bool foundCMSIncludes = false;
76  env = std::getenv("CMSSW_BASE");
77  if (nullptr != env) {
78  foundCMSIncludes = true;
80  dir += "/src";
81  intrp->AddIncludePath(dir.c_str());
82  }
83 
84  env = std::getenv("CMSSW_RELEASE_BASE");
85  if (nullptr != env) {
86  foundCMSIncludes = true;
88  dir += "/src";
89  intrp->AddIncludePath(dir.c_str());
90  }
91  if (not foundCMSIncludes) {
92  std::cerr << "Could not find the environment variables \n"
93  << " CMSSW_BASE or\n"
94  << " CMSSW_RELEASE_BASE\n"
95  << " therefore attempting to '#include' any CMS headers will not work" << std::endl;
96  }
97  if (nullptr != gApplication) {
98  gApplication->InitializeGraphics();
99  }
100 }
Definition: start.py:1
static PluginManager & configure(const Config &)
edm::EDProductGetter const * setRefStreamer(edm::EDProductGetter const *ep)
Definition: RefStreamer.cc:11
PluginManager::Config config()
Definition: standard.cc:21
static bool enabled_
Definition: FWLiteEnabler.h:21

◆ operator=()

FWLiteEnabler const& FWLiteEnabler::operator= ( FWLiteEnabler const &  )
delete

Friends And Related Function Documentation

◆ DummyClassToStopCompilerWarning

friend class DummyClassToStopCompilerWarning
friend

Definition at line 12 of file FWLiteEnabler.h.

Member Data Documentation

◆ enabled_

bool FWLiteEnabler::enabled_
staticprivate

Definition at line 21 of file FWLiteEnabler.h.

Referenced by enable().