35 {
36
37 TList*
keys = parentDir->GetListOfKeys();
39
40
41
42 TList* labelkeys = parentDir->GetListOfKeys();
45 std::set<std::string> DSID_set;
46 std::set<std::string> systematics_set;
47
49 std::string taggername =
path.at(0);
50 std::string jetcollname =
path.at(1);
51 std::string workingpointname =
path.at(2);
52
53
54
55
56 for(
const auto label : *labelkeys){
57 std::string labelname =
label->GetName();
58 if(labelname == "cutvalue" || labelname.find("fraction") != std::string::npos) continue;
60 theseLabels.push_back(labelname);
61
62
63 TDirectoryFile*
flavourDir = (TDirectoryFile*)parentDir->Get(labelname.c_str());
64 if(flavourDir){
67 for(const auto CDHistCont : *DSIDkeys){
68 std::string DSIDname = CDHistCont->GetName();
69 DSID_set.insert(DSIDname);
71 if(DSIDname == "default_SF"){
72
73 std::string
dir = taggername +
"/" + jetcollname +
"/" + workingpointname +
"/" + labelname +
"/default_SF";
74 Analysis::CalibrationDataHistogramContainer* cont;
76 if(!cont){
77 std::cout << "No default_SF CalibrationDataHistogramContainer?" << std::endl;
78 } else {
80 for(const std::string &s : uncertainties){
81 systematics_set.insert(s);
82 }
83 }
84
85 std::string flav_spec_unc_name = labelname + "_syst";
86 theseData[flav_spec_unc_name] = uncertainties;
87 }
88 }
89 } else {
90 std::cout << "No flavour directory?" << std::endl;
91 }
92 }
93
94 std::sort(theseLabels.begin(), theseLabels.end());
95 theseData["labels"] = std::move(theseLabels);
96
97 Labels theseDSIDs(DSID_set.size());
98 std::copy(DSID_set.begin(), DSID_set.end(), theseDSIDs.begin());
99 theseData["DSIDs"] = std::move(theseDSIDs);
100
101 Labels theseSystematics(systematics_set.size());
102 std::copy(systematics_set.begin(), systematics_set.end(), theseSystematics.begin());
103 theseData["systematics"] = std::move(theseSystematics);
104
105
107 } else {
108 for(const auto coll: *keys){
109 std::string collname = coll->GetName();
110 if ( collname.find("cutvalue") != std::string::npos || collname.find("fraction") != std::string::npos) continue;
111
113 TDirectoryFile* collDir = (TDirectoryFile*)parentDir->Get(collname.c_str());
114 if(collDir && collname != "VersionInfo"){
115 std::string nextmap = metamap + ";" + collname;
117 } else {
118 std::cout << "No collection directory?" << std::endl;
119 }
120 }
121 }
122}
std::set< std::string > m_DSIDs
void record_metadata_map(const Data &data, const std::string &path)
bool isWPdirectory(TList *list)
std::set< std::string > m_labels
std::map< std::string, Labels > Data
std::vector< std::string > split(const std::string &str, char token=';')
std::vector< std::string > Labels
std::vector< std::string > listUncertainties() const
retrieve the list of "uncertainties" accessible to this object.
std::string depth
tag string for intendation
std::string label(const std::string &format, int i)
path
python interpreter configuration --------------------------------------—