35 const std::string key =
h->GetName();
39 TRG_MSG_WARNING(
"StandaloneL1TopoHistSvc::registerHist: a histogram " << key <<
" exists already. Will keep the first one and delete the newly requested.");
48 const std::string key =
h->GetName();
52 TRG_MSG_WARNING(
"StandaloneL1TopoHistSvc::registerHist: a histogram " << key <<
" exists already. Will keep the first one and delete the newly requested.");
59 auto colPos = histName.find_first_of(
'/');
60 std::string realhistName = histName.substr(colPos+1);
91 std::string filename =
"L1Topo.root";
92 std::string basepath =
"";
94 std::string opt =
"RECREATE";
96 auto colPos =
m_baseDir.find_last_of(
':');
97 if( colPos != std::string::npos ) {
105 TFile * f = TFile::Open(filename.c_str(),opt.c_str());
108 std::string fullName(
h.second->GetName());
109 std::string path(basepath);
111 auto slashPos = fullName.find_last_of(
'/');
112 if(slashPos != std::string::npos) {
115 path += fullName.substr(0,slashPos);
117 h.second->SetName( fullName.substr(slashPos+1).c_str() );
120 const char* dir = path.c_str();
121 if( ! f->GetDirectory(dir)) {
129 std::string fullName(
h.second->GetName());
130 std::string path(basepath);
132 auto slashPos = fullName.find_last_of(
'/');
133 if(slashPos != std::string::npos) {
136 path += fullName.substr(0,slashPos);
138 h.second->SetName( fullName.substr(slashPos+1).c_str() );
141 const char* dir = path.c_str();
142 if( ! f->GetDirectory(dir)) {
190 return m_impl->findHist(histName);
194 m_impl->fillHist1D(histName,
x);
203 m_impl->setBaseDir(baseDir);
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
#define TRG_MSG_WARNING(x)
Header file for AthHistogramAlgorithm.
void registerHist(TH1 *h)
TH1 * findHist(const std::string &histName)
void fillHist1D(const std::string &histName, double x)
~StandaloneL1TopoHistSvcImpl()
StandaloneL1TopoHistSvcImpl()
std::map< std::string, TH2 * > m_hists2D
std::map< std::string, TH1 * > m_hists1D
void registerHist(TH2 *h)
void setBaseDir(const std::string &baseDir)
void fillHist2D(const std::string &histName, double x, double y)
std::unique_ptr< StandaloneL1TopoHistSvcImpl > m_impl
virtual TH1 * findHist(const std::string &histName) override
virtual void setBaseDir(const std::string &baseDir) override
virtual ~StandaloneL1TopoHistSvc()
virtual void save() override
virtual void fillHist1D(const std::string &histName, double x) override
virtual void registerHist(TH1 *h) override
StandaloneL1TopoHistSvc()
virtual void fillHist2D(const std::string &histName, double x, double y) override
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
TrigConfMessaging(const std::string &name)
Constructor with parameters.