|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #ifndef ANALYSISCDIREADER_H
10 #define ANALYSISCDIREADER_H
17 #include <unordered_map>
21 #include "TDirectoryFile.h"
24 #include "TObjString.h"
41 typedef std::vector<std::string>
Labels;
42 typedef std::map<std::string, Labels>
Data;
43 typedef std::map<std::string, Data>
WPoint;
44 typedef std::map<std::string, WPoint>
JetColl;
45 typedef std::map<std::string, JetColl>
Meta;
54 std::cout <<
"number of taggers: " <<
m_taggers.size() << std::endl;
56 std::cout <<
el <<
", ";
57 } std::cout << std::endl;
61 std::cout <<
"number of jet collections: " <<
m_jetcollections.size() << std::endl;
63 std::cout <<
el <<
", ";
64 } std::cout << std::endl;
68 std::cout <<
"number of working points: " <<
m_workingpoints.size() << std::endl;
70 std::cout <<
el <<
", ";
71 } std::cout << std::endl;
75 std::cout <<
"number of labels: " <<
m_labels.size() << std::endl;
77 std::cout <<
el <<
", ";
78 } std::cout << std::endl;
83 std::cout <<
"number of DSIDs: " << DSIDs.size() << std::endl;
84 for(
const std::string&
el : DSIDs){
85 std::cout <<
el <<
", ";
86 } std::cout << std::endl;
90 Labels getDSIDs(
const std::string& tagger =
"",
const std::string& jetcollection =
"",
const std::string& workingpoint =
"");
91 Labels getLabels(
const std::string& tagger =
"",
const std::string& jetcollection =
"",
const std::string& workingpoint =
"");
111 void crawlCDI(TDirectoryFile* parentDir,
int depth = 0,
const std::string& metamap =
"");
128 std::cout <<
" record_metadata :: depth is " <<
depth << std::endl;
134 int size = metamap_path.size();
136 m_metadata[metamap_path.at(0)][metamap_path.at(1)][metamap_path.at(2)] =
data;
138 std::cout <<
" record_metadata_map :: the directory structure doesn't match what we expect!" << std::endl;
146 const char* labelname =
label->GetName();
147 if(strcmp(labelname,
"B") == 0 || strcmp(labelname,
"C") == 0
148 || strcmp(labelname,
"Light") == 0 || strcmp(labelname,
"T") == 0
149 || strcmp(labelname,
"Z_BB") == 0 || strcmp(labelname,
"QCD_BB") == 0
150 || strcmp(labelname,
"Top_BX") == 0)
return true;
156 std::string
trim(
const std::string&
str,
const std::string& whitespace =
" \t") {
157 const auto strBegin =
str.find_first_not_of(whitespace);
158 if (strBegin == std::string::npos){
161 const auto strEnd =
str.find_last_not_of(whitespace);
162 const auto strRange = strEnd - strBegin + 1;
163 return str.substr(strBegin, strRange);
167 std::vector<std::string>
split(
const std::string&
str,
char token =
';') {
168 std::vector<std::string>
result;
169 if (
str.size() > 0) {
170 std::string::size_type
end;
177 }
while (
end != std::string::npos);
char data[hepevt_bytes_allocation_ATLAS]
std::set< std::string > m_taggers
Labels getLabels(const std::string &tagger="", const std::string &jetcollection="", const std::string &workingpoint="")
@ depth
pointing depth of the shower as calculated in egammaqgcld
path
python interpreter configuration --------------------------------------—
std::set< std::string > m_jetcollections
bool checkConfig(const std::string &tagger, const std::string &jetcoll, const std::string &wp, bool verbose=false)
Labels getWorkingPoints(const std::string &tagger, const std::string &jetcollection)
void printWorkingPoints()
bool isWPdirectory(TList *list)
std::vector< std::string > Labels
Labels getDSIDs(const std::string &tagger="", const std::string &jetcollection="", const std::string &workingpoint="")
std::set< std::string > m_DSIDs
std::map< std::string, JetColl > Meta
std::vector< std::string > split(const std::string &str, char token=';')
void crawlCDI(TDirectoryFile *parentDir, int depth=0, const std::string &metamap="")
std::unique_ptr< TFile > m_CDIFile
std::map< std::string, Data > WPoint
std::set< std::string > m_workingpoints
The namespace of all packages in PhysicsAnalysis/JetTagging.
Labels getJetCollections(const std::string &tagger)
void printJetCollections()
std::string trim(const std::string &str, const std::string &whitespace=" \t")
void printMetadata(int tagger=-1, int jetcoll=-1, int wpoint=-1, int label=-1)
bool m_initialized
flag whether the initialization has been carried out
void record_metadata(const std::string &datum, int depth=0)
std::map< std::string, Labels > Data
std::map< std::string, WPoint > JetColl
void record_metadata_map(const Data &data, const std::string &path)
std::set< std::string > m_labels
CDIReader(const std::string &cdipath, bool verbose=false)
normal constructor.