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
24 
26 //
27 // constants, enums and typedefs
28 //
29 
30 //
31 // static data member definitions
32 //
33 
34 bool AutoLibraryLoader::enabled_(false);
35 
36 //
37 // constructors and destructor
38 //
40 {
41 }
42 
43 
44 //
45 // member functions
46 //
47 
48 void
50 {
51  if (enabled_) { return; }
52  enabled_ = true;
53 
55  static BareRootProductGetter s_getter;
56  //this function must be called
57  // so that the TClass we need will be available
58  fwlite::setRefStreamer(&s_getter);
59 
60  //Make it easy to load our headers
61  TInterpreter* intrp= gROOT->GetInterpreter();
62  const char* env = getenv("CMSSW_FWLITE_INCLUDE_PATH");
63  if( 0 != env) {
64  //this is a comma separated list
65  const char* start = env;
66  const char* end;
67  do{
68  //find end
69  for(end=start; *end!=0 and *end != ':';++end);
70  std::string dir(start, end);
71  intrp->AddIncludePath(dir.c_str());
72  start = end+1;
73  }while(*end != 0);
74  }
75 
76  bool foundCMSIncludes = false;
77  env = getenv("CMSSW_BASE");
78  if( 0 != env) {
79  foundCMSIncludes = true;
80  std::string dir(env);
81  dir += "/src";
82  intrp->AddIncludePath(dir.c_str());
83  }
84 
85  env = getenv("CMSSW_RELEASE_BASE");
86  if( 0 != env) {
87  foundCMSIncludes = true;
88  std::string dir(env);
89  dir += "/src";
90  intrp->AddIncludePath(dir.c_str());
91  }
92  if( not foundCMSIncludes) {
93  std::cerr <<"Could not find the environment variables \n"
94  <<" CMSSW_BASE or\n"
95  <<" CMSSW_RELEASE_BASE\n"
96  <<" therefore attempting to '#include' any CMS headers will not work"<<std::endl;
97  }
98  if (0 != gApplication) {
99  gApplication->InitializeGraphics();
100  }
101 }
102 
103 void
105 {
106  // std::cout <<"LoadAllDictionaries"<<std::endl;
107  enable();
108 }
109 
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 enable()
enable automatic library loading
dbl *** dir
Definition: mlp_gen.cc:35