ATLAS Offline Software
MuonDQAHistMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 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 #include "LWHists/TH1F_LW.h"
26 #include "LWHists/TH2F_LW.h"
27 
28 
30 
32  public:
33  void clear() {
34  m_H1s.clear();
35  m_H2s.clear();
36  }
37  void addHist( TH1* p ) {
38  m_H1s.push_back(p);
39  }
40  void addHist( TH2* p ) {
41  m_H2s.push_back(p);
42  }
43  TH1* getH1( const std::string& hist_name ) const {
44  std::vector<TH1*>::const_iterator it = m_H1s.begin(),
45  itEnd = m_H1s.end();
46  for ( ; it != itEnd; ++it ) {
47  if ( (*it)->GetName() == hist_name ) {
48  return *it;
49  }
50  }
51  return 0;
52  }
53  TH2* getH2( const std::string& hist_name ) const {
54  std::vector<TH2*>::const_iterator it = m_H2s.begin(),
55  itEnd = m_H2s.end();
56  for ( ; it != itEnd; ++it ) {
57  if ( (*it)->GetName() == hist_name ) {
58  return *it;
59  }
60  }
61  return 0;
62  }
63 
64  private:
65  std::vector<TH1*> m_H1s;
66  std::vector<TH2*> m_H2s;
67 };
68 
70  public:
71  void clear() {
72  m_H1s.clear();
73  m_H2s.clear();
74  }
75  void addHist( TH1F_LW* p ) {
76  m_H1s.push_back(p);
77  }
78  void addHist( TH2F_LW* p ) {
79  m_H2s.push_back(p);
80  }
81 
82  TH1F_LW* getH1( const std::string& hist_name ) const {
83  std::vector<TH1F_LW*>::const_iterator it = m_H1s.begin(),
84  itEnd = m_H1s.end();
85  for ( ; it != itEnd; ++it ) {
86  if ( (*it)->GetName() == hist_name ) {
87  return *it;
88  }
89  }
90  return 0;
91  }
92  TH2F_LW* getH2( const std::string& hist_name ) const {
93  std::vector<TH2F_LW*>::const_iterator it = m_H2s.begin(),
94  itEnd = m_H2s.end();
95  for ( ; it != itEnd; ++it ) {
96  if ( (*it)->GetName() == hist_name ) {
97  return *it;
98  }
99  }
100  return 0;
101  }
102 
103  private:
104  std::vector<TH1F_LW*> m_H1s;
105  std::vector<TH2F_LW*> m_H2s;
106 };
107 
109  public:
110  void clear() {
111  m_data.clear();
112  }
113 
114  void addList( const std::string& station_name, const MuonDQAHistList& lst ) {
115  m_data[station_name] = lst;
116  }
117 
120  it = m_data.find( station_name );
121  if ( it != m_data.end() ) {
122  return it->second;
123  } else {
125  return m_data[station_name];
126  }
127  }
128 
129  void addList( const int& station_idInt, const MuonDQAHistList& lst ) {
130  m_data_int[station_idInt] = lst;
131  }
132 
133  MuonDQAHistList& getList( int station_idInt) {
135  it = m_data_int.find( station_idInt );
136  if ( it != m_data_int.end() ) {
137  return it->second;
138  } else {
139  m_data_int[station_idInt] = MuonDQAHistList();
140  return m_data_int[station_idInt];
141  }
142  }
143 
144  private:
145  std::map< std::string, MuonDQAHistList > m_data;
146  std::map< int, MuonDQAHistList > m_data_int;
147 };
148 
150  public:
151  void clear() {
152  m_data.clear();
153  }
154 
155  void addList( const std::string& station_name, const MuonDQAHistList_LW& lst ) {
156  m_data[station_name] = lst;
157  }
158 
161  it = m_data.find( station_name );
162  if ( it != m_data.end() ) {
163  return it->second;
164  } else {
166  return m_data[station_name];
167  }
168  }
169 
170  void addList( const int& station_idInt, const MuonDQAHistList_LW& lst ) {
171  m_data_int[station_idInt] = lst;
172  }
173 
174  MuonDQAHistList_LW& getList( int station_idInt) {
176  it = m_data_int.find( station_idInt );
177  if ( it != m_data_int.end() ) {
178  return it->second;
179  } else {
180  m_data_int[station_idInt] = MuonDQAHistList_LW();
181  return m_data_int[station_idInt];
182  }
183  }
184 
185  private:
186  std::map< std::string, MuonDQAHistList_LW > m_data;
187  std::map< int, MuonDQAHistList_LW > m_data_int;
188 };
189 
190 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonDQAHistMap::m_data
std::map< std::string, MuonDQAHistList > m_data
Definition: MuonDQAHistMap.h:145
TH1F_LW.h
TH2F_LW.h
MuonDQAHistMap_LW::m_data_int
std::map< int, MuonDQAHistList_LW > m_data_int
Definition: MuonDQAHistMap.h:187
MuonDQAHistList_LW::m_H1s
std::vector< TH1F_LW * > m_H1s
Definition: MuonDQAHistMap.h:104
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
MuonDQAHistList::getH2
TH2 * getH2(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:53
MuonDQAHistMap
Definition: MuonDQAHistMap.h:108
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MuonDQAHistList_LW
Definition: MuonDQAHistMap.h:69
MuonDQAHistList_LW::clear
void clear()
Definition: MuonDQAHistMap.h:71
MuonDQAHistList::addHist
void addHist(TH1 *p)
Definition: MuonDQAHistMap.h:37
TH1F_LW
Definition: TH1F_LW.h:23
MuonDQAHistMap_LW::addList
void addList(const std::string &station_name, const MuonDQAHistList_LW &lst)
Definition: MuonDQAHistMap.h:155
createCablingJSON.station_name
int station_name
Simple script to generate a BIS78 cabling map as used for the Monte Carlo processing.
Definition: createCablingJSON.py:8
MuonDQAHistMap::m_data_int
std::map< int, MuonDQAHistList > m_data_int
Definition: MuonDQAHistMap.h:146
MuonDQAHistMap_LW::clear
void clear()
Definition: MuonDQAHistMap.h:151
TH2
Definition: rootspy.cxx:373
MuonDQAHistList_LW::getH1
TH1F_LW * getH1(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:82
MuonDQAHistList::clear
void clear()
Definition: MuonDQAHistMap.h:33
MuonDQAHistMap::getList
MuonDQAHistList & getList(std::string station_name)
Definition: MuonDQAHistMap.h:118
MuonDQAHistMap_LW::getList
MuonDQAHistList_LW & getList(std::string station_name)
Definition: MuonDQAHistMap.h:159
MuonDQAHistMap_LW::m_data
std::map< std::string, MuonDQAHistList_LW > m_data
Definition: MuonDQAHistMap.h:186
MuonDQAHistList
Definition: MuonDQAHistMap.h:31
MuonDQAHistMap::addList
void addList(const int &station_idInt, const MuonDQAHistList &lst)
Definition: MuonDQAHistMap.h:129
MuonDQAHistList_LW::addHist
void addHist(TH1F_LW *p)
Definition: MuonDQAHistMap.h:75
MuonDQAHistList_LW::m_H2s
std::vector< TH2F_LW * > m_H2s
Definition: MuonDQAHistMap.h:105
MuonDQAHistMap::getList
MuonDQAHistList & getList(int station_idInt)
Definition: MuonDQAHistMap.h:133
MuonDQAHistList_LW::getH2
TH2F_LW * getH2(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:92
TH1
Definition: rootspy.cxx:268
MuonDQAHistList::getH1
TH1 * getH1(const std::string &hist_name) const
Definition: MuonDQAHistMap.h:43
MuonDQAHistList_LW::addHist
void addHist(TH2F_LW *p)
Definition: MuonDQAHistMap.h:78
MuonDQAHistMap::clear
void clear()
Definition: MuonDQAHistMap.h:110
MuonDQAHistList::addHist
void addHist(TH2 *p)
Definition: MuonDQAHistMap.h:40
TH2F_LW
Definition: TH2F_LW.h:23
MuonDQAHistMap_LW
Definition: MuonDQAHistMap.h:149
MuonDQAHistMap::addList
void addList(const std::string &station_name, const MuonDQAHistList &lst)
Definition: MuonDQAHistMap.h:114
MuonDQAHistMap_LW::getList
MuonDQAHistList_LW & getList(int station_idInt)
Definition: MuonDQAHistMap.h:174
MuonDQAHistList::m_H2s
std::vector< TH2 * > m_H2s
Definition: MuonDQAHistMap.h:66
MuonDQAHistMap_LW::addList
void addList(const int &station_idInt, const MuonDQAHistList_LW &lst)
Definition: MuonDQAHistMap.h:170
MuonDQAHistList::m_H1s
std::vector< TH1 * > m_H1s
Definition: MuonDQAHistMap.h:65