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)");
125 if ((
enablePrefetching_) && ((cacheHint_ ==
"storage-only") || (cacheHint_ ==
"auto-detect")))
126 cacheHint_ =
"application-only";
129 if (cacheHint_ ==
"application-only")
131 else if (cacheHint_ ==
"storage-only")
133 else if (cacheHint_ ==
"lazy-download")
135 else if (cacheHint_ ==
"auto-detect")
138 throw cms::Exception(
"TFileAdaptor") <<
"Unrecognised 'cacheHint' value '" << cacheHint_
139 <<
"', recognised values are 'application-only'," 140 <<
" 'storage-only', 'lazy-download', 'auto-detect'";
142 if (readHint_ ==
"direct-unbuffered")
144 else if (readHint_ ==
"read-ahead-buffered")
146 else if (readHint_ ==
"auto-detect")
149 throw cms::Exception(
"TFileAdaptor") <<
"Unrecognised 'readHint' value '" << readHint_
150 <<
"', recognised values are 'direct-unbuffered'," 151 <<
" 'read-ahead-buffered', 'auto-detect'";
163 TPluginManager* mgr = gROOT->GetPluginManager();
166 mgr->LoadHandlersFromPluginDirs(
"TFile");
167 mgr->LoadHandlersFromPluginDirs(
"TSystem");
209 descriptions.
add(
"AdaptorConfig", desc);
214 std::map<std::string, std::string>
data;
226 float const oneMeg = 1048576.0;
227 o <<
"Storage parameters: adaptor: true" 228 <<
" Stats:" << (
doStats_ ?
"true" :
"false") <<
'\n' 233 << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms" 234 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
241 float const oneMeg = 1048576.0;
242 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
243 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
244 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
245 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
246 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
248 std::ostringstream
r;
249 std::ostringstream
w;
250 r << (TFile::GetFileBytesRead() / oneMeg);
251 w << (TFile::GetFileBytesWritten() / oneMeg);
252 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes", r.str()));
253 data.insert(std::make_pair(
"ROOT-tfile-write-totalMegabytes", w.str()));
261 me = std::make_shared<TFileAdaptor>(param, ar);
virtual std::string const * sourceReadHint() const =0
virtual std::string const * sourceCacheHint() const =0
T getUntrackedParameter(std::string const &, T const &) const
bool enableAccounting(bool enabled)
static void fillSummary(std::map< std::string, std::string > &summary)
bool native(char const *proto) const
virtual std::string const * sourceCacheTempDir() const =0
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::string tempPath(void) const
void setTimeout(unsigned int timeout)
void setReadHint(ReadHint value)
virtual unsigned int debugLevel() const =0
void stats(std::ostream &o) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double tempMinFree(void) const
virtual double const * sourceCacheMinFree() const =0
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
void setDebugLevel(unsigned int level)
virtual std::vector< std::string > const * sourceNativeProtocols() const =0
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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)
void setTempDir(const std::string &s, double minFreeSpace)
TFileAdaptor(edm::ParameterSet const &pset, edm::ActivityRegistry &ar)
void setCacheHint(CacheHint value)
char data[epos_bytes_allocation]
static std::string summaryText(bool banner=false)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
void termination(void) const
virtual unsigned int const * sourceTimeout() const =0
static StorageFactory * getToModify(void)
virtual bool enablePrefetching() const =0
void statsXML(std::map< std::string, std::string > &data) const