CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AutoLibraryLoader.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: LibraryLoader
4 // Class : AutoLibraryLoader
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author:
10 // Created: Wed Nov 30 14:55:01 EST 2005
11 //
12 
13 // system include files
14 #include <iostream>
15 #include "TROOT.h"
16 #include "TInterpreter.h"
17 #include "TApplication.h"
18 
19 // user include files
25 
27 //
28 // constants, enums and typedefs
29 //
30 
31 //
32 // static data member definitions
33 //
34 
35 bool AutoLibraryLoader::enabled_(false);
36 
37 //
38 // constructors and destructor
39 //
41 {
42 }
43 
44 
45 //
46 // member functions
47 //
48 
49 void
51 {
52  if (enabled_) { return; }
53  enabled_ = true;
54 
56  static BareRootProductGetter s_getter;
58  //this function must be called after enabling the autoloader
59  // so that the TClass we need will be available
60  fwlite::setRefStreamer(&s_getter);
61 
62  //Make it easy to load our headers
63  TInterpreter* intrp= gROOT->GetInterpreter();
64  const char* env = getenv("CMSSW_FWLITE_INCLUDE_PATH");
65  if( 0 != env) {
66  //this is a comma separated list
67  const char* start = env;
68  const char* end;
69  do{
70  //find end
71  for(end=start; *end!=0 and *end != ':';++end);
72  std::string dir(start, end);
73  intrp->AddIncludePath(dir.c_str());
74  start = end+1;
75  }while(*end != 0);
76  }
77 
78  bool foundCMSIncludes = false;
79  env = getenv("CMSSW_BASE");
80  if( 0 != env) {
81  foundCMSIncludes = true;
82  std::string dir(env);
83  dir += "/src";
84  intrp->AddIncludePath(dir.c_str());
85  }
86 
87  env = getenv("CMSSW_RELEASE_BASE");
88  if( 0 != env) {
89  foundCMSIncludes = true;
90  std::string dir(env);
91  dir += "/src";
92  intrp->AddIncludePath(dir.c_str());
93  }
94  if( not foundCMSIncludes) {
95  std::cerr <<"Could not find the environment variables \n"
96  <<" CMSSW_BASE or\n"
97  <<" CMSSW_RELEASE_BASE\n"
98  <<" therefore attempting to '#include' any CMS headers will not work"<<std::endl;
99  }
100  if (0 != gApplication) {
101  gApplication->InitializeGraphics();
102  }
103 }
104 
105 void
107 {
108  // std::cout <<"LoadAllDictionaries"<<std::endl;
109  enable();
111 }
112 
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
static PluginManager & configure(const Config &)
static void loadAll()
load all known libraries holding dictionaries
PluginManager::Config config()
Definition: standard.cc:21
edm::EDProductGetter const * setRefStreamer(edm::EDProductGetter const *ep)
Definition: RefStreamer.cc:10
#define end
Definition: vmac.h:37
static void loadAll()
load all known libraries holding dictionaries
static void enable()
enable automatic library loading
dbl *** dir
Definition: mlp_gen.cc:35
static void enable()
interface for TClass generators