16 #include <TPluginManager.h>
18 #include <boost/shared_ptr.hpp>
48 mgr->AddHandler(
"TFile",
50 "TStorageFactoryFile",
52 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t)");
54 mgr->AddHandler(
"TSystem",
56 "TStorageFactorySystem",
58 "TStorageFactorySystem()");
59 }
else if (altType == 1) {
60 mgr->AddHandler(
"TFile",
62 "TStorageFactoryFile",
64 "TStorageFactoryFile(char const*,Option_t*,char const*,Int_t, Int_t, Bool_t)");
66 mgr->AddHandler(
"TSystem",
68 "TStorageFactorySystem",
70 "TStorageFactorySystem(const char *,Bool_t)");
84 enablePrefetching_(
false),
85 cacheHint_(
"auto-detect"),
86 readHint_(
"auto-detect"),
137 if ((
enablePrefetching_) && ((cacheHint_ ==
"storage-only") || (cacheHint_ ==
"auto-detect")))
138 cacheHint_ =
"application-only";
141 if (cacheHint_ ==
"application-only")
143 else if (cacheHint_ ==
"storage-only")
145 else if (cacheHint_ ==
"lazy-download")
147 else if (cacheHint_ ==
"auto-detect")
151 <<
"Unrecognised 'cacheHint' value '" << cacheHint_
152 <<
"', recognised values are 'application-only',"
153 <<
" 'storage-only', 'lazy-download', 'auto-detect'";
155 if (readHint_ ==
"direct-unbuffered")
157 else if (readHint_ ==
"read-ahead-buffered")
159 else if (readHint_ ==
"auto-detect")
163 <<
"Unrecognised 'readHint' value '" << readHint_
164 <<
"', recognised values are 'direct-unbuffered',"
165 <<
" 'read-ahead-buffered', 'auto-detect'";
177 TPluginManager* mgr = gROOT->GetPluginManager();
178 mgr->LoadHandlersFromPluginDirs();
208 descriptions.
add(
"AdaptorConfig", desc);
214 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'
233 <<
"Storage statistics: "
235 <<
"; tfile/read=?/?/" << (TFile::GetFileBytesRead() / oneMeg) <<
"MB/?ms/?ms/?ms"
236 <<
"; tfile/write=?/?/" << (TFile::GetFileBytesWritten() / oneMeg) <<
"MB/?ms/?ms/?ms";
244 float const oneMeg = 1048576.0;
245 data.insert(std::make_pair(
"Parameter-untracked-bool-enabled",
"true"));
246 data.insert(std::make_pair(
"Parameter-untracked-bool-stats", (
doStats_ ?
"true" :
"false")));
247 data.insert(std::make_pair(
"Parameter-untracked-bool-prefetching", (
enablePrefetching_ ?
"true" :
"false")));
248 data.insert(std::make_pair(
"Parameter-untracked-string-cacheHint",
cacheHint_));
249 data.insert(std::make_pair(
"Parameter-untracked-string-readHint",
readHint_));
251 std::ostringstream
r;
252 std::ostringstream
w;
253 r << (TFile::GetFileBytesRead() / oneMeg);
254 w << (TFile::GetFileBytesWritten() / oneMeg);
255 data.insert(std::make_pair(
"ROOT-tfile-read-totalMegabytes", r.str()));
256 data.insert(std::make_pair(
"ROOT-tfile-write-totalMegabytes", w.str()));
275 boost::shared_ptr<TFileAdaptor>
me;
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
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::string tempPath(void) const
void setTimeout(unsigned int timeout)
void setReadHint(ReadHint value)
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 bool enablePrefetching() const =0
static StorageFactory * get(void)
virtual std::string const * sourceCacheTempDir() const =0
boost::shared_ptr< TFileAdaptor > me
virtual unsigned int const * sourceTimeout() const =0
void setDebugLevel(unsigned int level)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_SERVICE(type)
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
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]
virtual double const * sourceCacheMinFree() const =0
virtual std::string const * sourceCacheHint() const =0
static std::string summaryText(bool banner=false)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
virtual std::string const * sourceReadHint() const =0
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
TFileAdaptor AdaptorConfig
void termination(void) const
void statsXML(std::map< std::string, std::string > &data) const