19 #include "TObjString.h"
20 #include "TDirectory.h"
25 static const std::string hadronisationRefs(
"MChadronisation_ref");
35 const char* jetAuthor,
const char* OP,
const char* flavour,
const char*
name,
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);
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;
65 flavourDir->GetObject(hadronisationRefs.c_str(), map);
66 if (!map) map =
new TMap;
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));
71 flavourDir->WriteTObject (map, hadronisationRefs.c_str(),
"WriteDelete SingleKey");