|
|
Go to the documentation of this file.
25 class TFileNoSync :
public TFile {
27 TFileNoSync(
char const *
file,
char const *
opt) : TFile{
file,
opt} {}
28 Int_t SysSync(Int_t)
override {
return 0; }
31 std::cout <<
"DQMFileSaver::globalEndRun()" << std::endl;
35 TFileNoSync *
file =
new TFileNoSync(
filename.c_str(), fileupdate.c_str());
38 std::vector<MonitorElement *> mes;
54 if (firstSlashPos == std::string::npos) {
55 firstSlashPos =
dirName.length();
79 double value =
me->getFloatValue();
82 std::snprintf(
buf,
sizeof(
buf),
"%.*g", DBL_DIG + 2,
value);
96 if (
me->getEfficiencyFlag()) {
106 std::snprintf(
buf,
sizeof(
buf),
"qr=st:%d:%.*g:", qr->getStatus(), DBL_DIG + 2, qr->getQTresult());
109 result += qr->getAlgorithm() +
':' + qr->getMessage();
132 if (
end == std::string::npos)
139 TObject *
o = gDirectory->Get(
part.c_str());
140 if (
o && !dynamic_cast<TDirectory *>(
o))
143 " fails because the part '"
145 <<
"' already exists and is not"
148 gDirectory->mkdir(
part.c_str());
150 if (!gDirectory->cd(
part.c_str()))
153 " fails because could not cd into subdirectory '"
163 if (
end == std::string::npos)
171 TDirectory *dirsav = gDirectory;
172 LogDebug(
"LegacyIOHelper") <<
"Inside:" << gDirectory->GetPath() << std::endl;
173 TIter
next(
dir->GetListOfKeys());
175 while ((
key = (TKey *)
next())) {
176 if (
key->IsFolder()) {
177 LogDebug(
"LegacyIOHelper") <<
key->GetName() << std::endl;
179 TDirectory *subdir = gDirectory;
184 TClass *
cl = gROOT->GetClass(
key->GetClassName());
186 if (
cl->InheritsFrom(
"TProfile")) {
187 TProfile *
h = dynamic_cast<TProfile *>(
key->ReadObject<TProfile>()->Clone());
188 h->SetDirectory(
nullptr);
190 getMEName<TProfile>(
h, toppath, meName);
193 }
else if (
cl->InheritsFrom(
"TProfile2D")) {
194 TProfile2D *
h = dynamic_cast<TProfile2D *>(
key->ReadObject<TProfile2D>()->Clone());
195 h->SetDirectory(
nullptr);
197 getMEName<TProfile2D>(
h, toppath, meName);
200 }
else if (
cl->InheritsFrom(
"TH1F")) {
201 TH1F *
h = dynamic_cast<TH1F *>(
key->ReadObject<TH1F>()->Clone());
202 h->SetDirectory(
nullptr);
204 getMEName<TH1F>(
h, toppath, meName);
207 }
else if (
cl->InheritsFrom(
"TH1S")) {
208 TH1S *
h = dynamic_cast<TH1S *>(
key->ReadObject<TH1S>()->Clone());
209 h->SetDirectory(
nullptr);
211 getMEName<TH1S>(
h, toppath, meName);
214 }
else if (
cl->InheritsFrom(
"TH1D")) {
215 TH1D *
h = dynamic_cast<TH1D *>(
key->ReadObject<TH1D>()->Clone());
216 h->SetDirectory(
nullptr);
218 getMEName<TH1D>(
h, toppath, meName);
221 }
else if (
cl->InheritsFrom(
"TH2F")) {
222 TH2F *
h = dynamic_cast<TH2F *>(
key->ReadObject<TH2F>()->Clone());
223 h->SetDirectory(
nullptr);
225 getMEName<TH2F>(
h, toppath, meName);
228 }
else if (
cl->InheritsFrom(
"TH2S")) {
229 TH2S *
h = dynamic_cast<TH2S *>(
key->ReadObject<TH2S>()->Clone());
230 h->SetDirectory(
nullptr);
232 getMEName<TH2S>(
h, toppath, meName);
235 }
else if (
cl->InheritsFrom(
"TH2D")) {
236 TH2D *
h = dynamic_cast<TH2D *>(
key->ReadObject<TH2D>()->Clone());
237 h->SetDirectory(
nullptr);
239 getMEName<TH2D>(
h, toppath, meName);
242 }
else if (
cl->InheritsFrom(
"TH3F")) {
243 TH3F *
h = dynamic_cast<TH3F *>(
key->ReadObject<TH3F>()->Clone());
244 h->SetDirectory(
nullptr);
246 getMEName<TH3F>(
h, toppath, meName);
261 std::ostringstream toppath;
262 toppath <<
filename <<
":/DQMData/Run " <<
run <<
"/";
void save(std::string const &filename, std::string const &path="", uint32_t const run=0, bool saveall=true, std::string const &fileupdate="RECREATE")
MonitorElement * book2S(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
bool readdir(TDirectory *dir, const std::string &toppath)
Log< level::Warning, true > LogPrint
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * book1S(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
bool open(std::string const &filename, std::string const &path="", uint32_t const run=0)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
bool createDirectoryIfNeededAndCd(const std::string &path)
unsigned long long uint64_t
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())