ATLAS Offline Software
JetTagCalibCondData.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TObject.h"
6 #include <string>
7 #include <utility>
8 #include <algorithm>
9 
10 namespace Analysis {
11 
12 template <class T> T* JetTagCalibCondData::retrieveTObject(const std::string& folder, const std::string& channel, const std::string& hname) const {
13  T* h = 0;
14  std::string channelAlias = this->getChannelAlias(channel);
15 
16  ATH_MSG_DEBUG("#BTAG# retrieving " << hname
17  << " (channel " << channel << " -> " << channelAlias << ") "
18  << " in folder " << folder);
19  for(unsigned int i=0;i<m_taggers.size();i++) {
20  if(folder==m_taggers[i]) {
21  std::string fname = this->fullHistoName(channelAlias,hname);
22  ATH_MSG_DEBUG("#BTAG# folder " << folder << " found in pos " << i
23  << " , retrieving " << fname);
24  auto mI = m_histos[i].find(fname);
25  if(mI!=m_histos[i].end()) {
26  ATH_MSG_DEBUG("#BTAG# histo found: " << hname);
27  h = mI->second.get();
28  if(h) {
29  ATH_MSG_DEBUG("#BTAG# histo pointer is valid.");
30  } else {
31  ATH_MSG_DEBUG("#BTAG# histo pointer is NOT valid.");
32  }
33  break;
34  } else {
35  ATH_MSG_DEBUG("#BTAG# histo not found in folder: " << hname);
36  }
37  }
38  }
39  return h;
40 }
41 
42 }