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"),
83 using namespace edm::storage;
102 if (pSLC.isAvailable()) {
103 if (
std::string const*
p = pSLC->sourceCacheTempDir()) {
106 if (
double const*
p = pSLC->sourceCacheMinFree()) {
115 if (
unsigned int const*
p = pSLC->sourceTimeout()) {
118 if (std::vector<std::string>
const*
p = pSLC->sourceNativeProtocols()) {
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");
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);
T getUntrackedParameter(std::string const &, T const &) const
static std::string summaryText(bool banner=false)
bool native(char const *proto) const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void stats(std::ostream &o) 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)
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
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)
TFileAdaptor(edm::ParameterSet const &pset, edm::ActivityRegistry &ar)
char data[epos_bytes_allocation]
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
void termination(void) const
void statsXML(std::map< std::string, std::string > &data) const