FWCore
FWLite
src
FWLiteEnabler.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: LibraryLoader
4
// Class : FWLiteEnabler
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
//
10
11
// system include files
12
#include <iostream>
13
#include "TROOT.h"
14
#include "TInterpreter.h"
15
#include "TApplication.h"
16
17
// user include files
18
#include "
FWCore/FWLite/interface/FWLiteEnabler.h
"
19
#include "
FWCore/FWLite/src/BareRootProductGetter.h
"
20
#include "
FWCore/PluginManager/interface/PluginManager.h
"
21
#include "
FWCore/PluginManager/interface/standard.h
"
22
23
#include "
FWCore/FWLite/interface/setRefStreamer.h
"
24
25
//
26
// constants, enums and typedefs
27
//
28
29
//
30
// static data member definitions
31
//
32
33
bool
FWLiteEnabler::enabled_
(
false
);
34
35
//
36
// constructors and destructor
37
//
38
// Note: this ctor will never be invoked.
39
// All data and functions are static
40
FWLiteEnabler::FWLiteEnabler
() {}
41
42
//
43
// member functions
44
//
45
46
void
FWLiteEnabler::enable
() {
47
if
(
enabled_
) {
48
return
;
49
}
50
enabled_
=
true
;
51
52
edmplugin::PluginManager::configure
(
edmplugin::standard::config
());
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
;
69
std::string
dir
(
start
,
end
);
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
;
79
std::string
dir
(
env
);
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
;
87
std::string
dir
(
env
);
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
}
start
Definition:
start.py:1
edmplugin::PluginManager::configure
static PluginManager & configure(const Config &)
Definition:
PluginManager.cc:315
fwlite::setRefStreamer
edm::EDProductGetter const * setRefStreamer(edm::EDProductGetter const *ep)
Definition:
RefStreamer.cc:11
BareRootProductGetter.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
DeadROC_duringRun.dir
dir
Definition:
DeadROC_duringRun.py:23
edmplugin::standard::config
PluginManager::Config config()
Definition:
standard.cc:21
BareRootProductGetter
Definition:
BareRootProductGetter.h:43
FWLiteEnabler::enable
static void enable()
enable automatic library loading
Definition:
FWLiteEnabler.cc:46
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition:
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
web.browse_db.env
env
Definition:
browse_db.py:18
FWLiteEnabler::FWLiteEnabler
FWLiteEnabler()
Definition:
FWLiteEnabler.cc:40
FWLiteEnabler.h
mps_fire.end
end
Definition:
mps_fire.py:242
setRefStreamer.h
PluginManager.h
FWLiteEnabler::enabled_
static bool enabled_
Definition:
FWLiteEnabler.h:21
standard.h
Generated for CMSSW Reference Manual by
1.8.14