ATLAS Offline Software
MuonDQAHistMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Package : MuonDQAUtils - MuonDQAHistMap
7 // Author: N. Benekos(MPI) - M. Woudstra(University of Massachusetts), J. Griffiths(University of Washington)
8 // August. 2007
9 //
10 // DESCRIPTION:
11 // Subject: Offline Muon Data Quality --> returns maps of HistLists
13 
14 #ifndef MuonDQAHistMap_H
15 #define MuonDQAHistMap_H
16 
17 #include <sstream>
18 #include <string.h>
19 #include <vector>
20 #include <map>
21 
22 #include "TH1.h"
23 #include "TH2.h"
24 #include "TProfile.h"
25 
26 
28 
30  public:
31  void clear() {
32  m_H1s.clear();
33  m_H2s.clear();
34  }
35  void addHist( TH1* p ) {
36  m_H1s.push_back(p);
37  }
38  void addHist( TH2* p ) {
39  m_H2s.push_back(p);
40  }
41  TH1* getH1( const std::string& hist_name ) const {
42  std::vector<TH1*>::const_iterator it = m_H1s.begin(),
43  itEnd = m_H1s.end();
44  for ( ; it != itEnd; ++it ) {
45  if ( (*it)->GetName() == hist_name ) {
46  return *it;
47  }
48  }
49  return 0;
50  }
51  TH2* getH2( const std::string& hist_name ) const {
52  std::vector<TH2*>::const_iterator it = m_H2s.begin(),
53  itEnd = m_H2s.end();
54  for ( ; it != itEnd; ++it ) {
55  if ( (*it)->GetName() == hist_name ) {
56  return *it;
57  }
58  }
59  return 0;
60  }
61 
62  private:
63  std::vector<TH1*> m_H1s;
64  std::vector<TH2*> m_H2s;
65 };
66 
67 
69  public:
70  void clear() {
71  m_data.clear();
72  }
73 
74  void addList( const std::string& station_name, const MuonDQAHistList& lst ) {
75  m_data[station_name] = lst;
76  }
77 
80  it = m_data.find( station_name );
81  if ( it != m_data.end() ) {
82  return it->second;
83  } else {
85  return m_data[station_name];
86  }
87  }
88 
89  void addList( const int& station_idInt, const MuonDQAHistList& lst ) {
90  m_data_int[station_idInt] = lst;
91  }
92 
93  MuonDQAHistList& getList( int station_idInt) {
95  it = m_data_int.find( station_idInt );
96  if ( it != m_data_int.end() ) {
97  return it->second;
98  } else {
99  m_data_int[station_idInt] = MuonDQAHistList();
100  return m_data_int[station_idInt];
101  }
102  }
103 
104  private:
105  std::map< std::string, MuonDQAHistList > m_data;
106  std::map< int, MuonDQAHistList > m_data_int;
107 };
108 
109 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonDQAHistMap::m_data
std::map< std::string, MuonDQAHistList > m_data
Definition: MuonDQAHistMap.h:105
MuonDQAHistList::getH2
TH2 * getH2(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:51
MuonDQAHistMap
Definition: MuonDQAHistMap.h:68
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonDQAHistList::addHist
void addHist(TH1 *p)
Definition: MuonDQAHistMap.h:35
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonDQAHistMap::m_data_int
std::map< int, MuonDQAHistList > m_data_int
Definition: MuonDQAHistMap.h:106
MuonDQAHistList::clear
void clear()
Definition: MuonDQAHistMap.h:31
MuonDQAHistMap::getList
MuonDQAHistList & getList(std::string station_name)
Definition: MuonDQAHistMap.h:78
MuonDQAHistList
Definition: MuonDQAHistMap.h:29
MuonDQAHistMap::addList
void addList(const int &station_idInt, const MuonDQAHistList &lst)
Definition: MuonDQAHistMap.h:89
MuonDQAHistMap::getList
MuonDQAHistList & getList(int station_idInt)
Definition: MuonDQAHistMap.h:93
MuonDQAHistList::getH1
TH1 * getH1(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:41
MuonDQAHistMap::clear
void clear()
Definition: MuonDQAHistMap.h:70
MuonDQAHistList::addHist
void addHist(TH2 *p)
Definition: MuonDQAHistMap.h:38
createCablingJSON.station_name
string station_name
Simple script to generate a BIS78 cabling map as used for the Monte Carlo processing.
Definition: createCablingJSON.py:8
MuonDQAHistMap::addList
void addList(const std::string &station_name, const MuonDQAHistList &lst)
Definition: MuonDQAHistMap.h:74
MuonDQAHistList::m_H2s
std::vector< TH2 * > m_H2s
Definition: MuonDQAHistMap.h:64
MuonDQAHistList::m_H1s
std::vector< TH1 * > m_H1s
Definition: MuonDQAHistMap.h:63