19#include "TObjString.h"
20#include "TDirectory.h"
35 const char* jetAuthor,
const char* OP,
const char* flavour,
const char* name,
37 file->cd(
"/"); TDirectory* dir = gDirectory;
39 TDirectory* taggerDir = dir->GetDirectory(tagger);
40 if (! taggerDir) taggerDir = dir->mkdir(tagger);
42 TDirectory* authorDir = taggerDir->GetDirectory(jetAuthor);
43 if (! authorDir) authorDir = taggerDir->mkdir(jetAuthor);
45 TDirectory* OPDir = authorDir->GetDirectory(OP);
46 if (! OPDir) OPDir = authorDir->mkdir(OP);
48 TDirectory* flavourDir = OPDir->GetDirectory(flavour);
49 if (! flavourDir) flavourDir = OPDir->mkdir(flavour);
51 Int_t nbytes = flavourDir->WriteTObject (cnt, name,
"SingleKey");
55 std::string
ref = cnt->getHadronisation();
57 const char* cntname = (name) ? name : cnt->GetName();
59 std::cerr <<
"addContainer(): container does not have a MC hadronisation reference!" << std::endl;
60 else if (std::string(cntname).
find(
"_Eff") == std::string::npos)
61 std::cerr <<
"addContainer(): container is not a MC efficiency object!" << std::endl;
68 if (TPair* p = (TPair*)
map->FindObject(
ref.c_str()))
map->DeleteEntry(p->Key());
69 map->Add(
new TObjString(
ref.c_str()),
new TObjString(cntname));
const boost::regex ref(r_ef)
static const std::string hadronisationRefs("MChadronisation_ref")
This is the interface for the objects to be stored in the calibration ROOT file.
std::string find(const std::string &s)
return a remapped string
Int_t addContainer(Analysis::CalibrationDataContainer *cnt, TFile *file, const char *tagger, const char *jetAuthor, const char *OP, const char *flavour, const char *name=0, bool isReference=false)