16 #include <TPluginManager.h> 46 mgr->AddHandler(
"TFile",
48 "TStorageFactoryFile",
50 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t)");
52 mgr->AddHandler(
"TSystem",
type,
"TStorageFactorySystem",
"IOPoolTFileAdaptor",
"TStorageFactorySystem()");
53 }
else if (altType == 1) {
54 mgr->AddHandler(
"TFile",
56 "TStorageFactoryFile",
58 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t, Int_t, Bool_t)");
61 "TSystem",
type,
"TStorageFactorySystem",
"IOPoolTFileAdaptor",
"TStorageFactorySystem(const char *,Bool_t)");
73 enablePrefetching_(
false),
74 cacheHint_(
"auto-detect"),
75 readHint_(
"auto-detect"),
95 minFree_ =
pset.getUntrackedParameter<
double>(
"tempMinFree",
f->tempMinFree());
132 f->setCacheHint(StorageFactory::CACHE_HINT_APPLICATION);
134 f->setCacheHint(StorageFactory::CACHE_HINT_STORAGE);
136 f->setCacheHint(StorageFactory::CACHE_HINT_LAZY_DOWNLOAD);
138 f->setCacheHint(StorageFactory::CACHE_HINT_AUTO_DETECT);
141 <<
"', recognised values are 'application-only'," 142 <<
" 'storage-only', 'lazy-download', 'auto-detect'";
145 f->setReadHint(StorageFactory::READ_HINT_UNBUFFERED);
146 else if (
readHint_ ==
"read-ahead-buffered")
147 f->setReadHint(StorageFactory::READ_HINT_READAHEAD);
149 f->setReadHint(StorageFactory::READ_HINT_AUTO);
152 <<
"', recognised values are 'direct-unbuffered'," 153 <<
" 'read-ahead-buffered', 'auto-detect'";
165 TPluginManager* mgr = gROOT->GetPluginManager();
168 mgr->LoadHandlersFromPluginDirs(
"TFile");
169 mgr->LoadHandlersFromPluginDirs(
"TSystem");
204 if (
auto cl = TClass::GetClass(
"TStorageFactoryFile")) {
207 throw cms::Exception(
"TFileAdaptor") <<
"Unable to obtain TClass for TStorageFactoryFile";
214 desc.addOptionalUntracked<
bool>(
"enable");
215 desc.addOptionalUntracked<
bool>(
"stats");
219 desc.addOptionalUntracked<
double>(
"tempMinFree");
220 desc.addOptionalUntracked<std::vector<std::string> >(
"native");
221 descriptions.
add(
"AdaptorConfig",
desc);
226 std::map<std::string, std::string>
data;
238 float const oneMeg = 1048576.0;
239 o <<
"Storage parameters: adaptor: true" 240 <<
" Stats:" << (
doStats_ ?
"true" :
"false") <<
'\n' 245 << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms" 246 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
253 float const oneMeg = 1048576.0;
254 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
255 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
256 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
257 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
258 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
260 std::ostringstream
r;
261 std::ostringstream
w;
262 r << (TFile::GetFileBytesRead() / oneMeg);
263 w << (TFile::GetFileBytesWritten() / oneMeg);
264 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes",
r.str()));
265 data.insert(std::make_pair(
"ROOT-tfile-write-totalMegabytes",
w.str()));
273 me = std::make_shared<TFileAdaptor>(param, ar);
static std::string summaryText(bool banner=false)
bool native(char const *proto) const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void termination(void) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static void fillSummary(std::map< std::string, std::string > &summary)
virtual bool enablePrefetching() const =0
virtual std::string const * sourceCacheTempDir() const =0
virtual unsigned int const * sourceTimeout() const =0
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
void stats(std::ostream &o) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual unsigned int debugLevel() const =0
std::vector< std::string > native_
static void addType(TPluginManager *mgr, char const *type, int altType=0)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual std::vector< std::string > const * sourceNativeProtocols() const =0
TFileAdaptor(edm::ParameterSet const &pset, edm::ActivityRegistry &ar)
char data[epos_bytes_allocation]
virtual double const * sourceCacheMinFree() const =0
virtual std::string const * sourceCacheHint() const =0
virtual std::string const * sourceReadHint() const =0
void statsXML(std::map< std::string, std::string > &data) const