15 #include <TPluginManager.h> 45 mgr->AddHandler(
"TFile",
47 "TStorageFactoryFile",
49 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t)");
51 mgr->AddHandler(
"TSystem",
type,
"TStorageFactorySystem",
"IOPoolTFileAdaptor",
"TStorageFactorySystem()");
52 }
else if (altType == 1) {
53 mgr->AddHandler(
"TFile",
55 "TStorageFactoryFile",
57 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t, Int_t, Bool_t)");
60 "TSystem",
type,
"TStorageFactorySystem",
"IOPoolTFileAdaptor",
"TStorageFactorySystem(const char *,Bool_t)");
72 enablePrefetching_(
false),
73 cacheHint_(
"auto-detect"),
74 readHint_(
"auto-detect"),
94 minFree_ =
pset.getUntrackedParameter<
double>(
"tempMinFree",
f->tempMinFree());
131 f->setCacheHint(StorageFactory::CACHE_HINT_APPLICATION);
133 f->setCacheHint(StorageFactory::CACHE_HINT_STORAGE);
135 f->setCacheHint(StorageFactory::CACHE_HINT_LAZY_DOWNLOAD);
137 f->setCacheHint(StorageFactory::CACHE_HINT_AUTO_DETECT);
140 <<
"', recognised values are 'application-only'," 141 <<
" 'storage-only', 'lazy-download', 'auto-detect'";
144 f->setReadHint(StorageFactory::READ_HINT_UNBUFFERED);
145 else if (
readHint_ ==
"read-ahead-buffered")
146 f->setReadHint(StorageFactory::READ_HINT_READAHEAD);
148 f->setReadHint(StorageFactory::READ_HINT_AUTO);
151 <<
"', recognised values are 'direct-unbuffered'," 152 <<
" 'read-ahead-buffered', 'auto-detect'";
164 TPluginManager* mgr = gROOT->GetPluginManager();
167 mgr->LoadHandlersFromPluginDirs(
"TFile");
168 mgr->LoadHandlersFromPluginDirs(
"TSystem");
203 desc.addOptionalUntracked<
bool>(
"enable");
204 desc.addOptionalUntracked<
bool>(
"stats");
208 desc.addOptionalUntracked<
double>(
"tempMinFree");
209 desc.addOptionalUntracked<std::vector<std::string> >(
"native");
210 descriptions.
add(
"AdaptorConfig",
desc);
215 std::map<std::string, std::string>
data;
227 float const oneMeg = 1048576.0;
228 o <<
"Storage parameters: adaptor: true" 229 <<
" Stats:" << (
doStats_ ?
"true" :
"false") <<
'\n' 234 << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms" 235 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
242 float const oneMeg = 1048576.0;
243 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
244 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
245 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
246 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
247 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
249 std::ostringstream
r;
250 std::ostringstream
w;
251 r << (TFile::GetFileBytesRead() / oneMeg);
252 w << (TFile::GetFileBytesWritten() / oneMeg);
253 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes",
r.str()));
254 data.insert(std::make_pair(
"ROOT-tfile-write-totalMegabytes",
w.str()));
262 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