ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDQAHistMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
18#include "TH1.h"
19#include "TH2.h"
20
21#include <vector>
22#include <map>
23
25
27 public:
28 void clear() {
29 m_H1s.clear();
30 m_H2s.clear();
31 }
32 void addHist( TH1* p ) {
33 m_H1s.push_back(p);
34 }
35 void addHist( TH2* p ) {
36 m_H2s.push_back(p);
37 }
38 TH1* getH1( const std::string& hist_name ) const {
39 std::vector<TH1*>::const_iterator it = m_H1s.begin(),
40 itEnd = m_H1s.end();
41 for ( ; it != itEnd; ++it ) {
42 if ( (*it)->GetName() == hist_name ) {
43 return *it;
44 }
45 }
46 return 0;
47 }
48 TH2* getH2( const std::string& hist_name ) const {
49 std::vector<TH2*>::const_iterator it = m_H2s.begin(),
50 itEnd = m_H2s.end();
51 for ( ; it != itEnd; ++it ) {
52 if ( (*it)->GetName() == hist_name ) {
53 return *it;
54 }
55 }
56 return 0;
57 }
58
59 private:
60 std::vector<TH1*> m_H1s;
61 std::vector<TH2*> m_H2s;
62};
63
64
66 public:
67 void clear() {
68 m_data.clear();
69 }
70
71 void addList( const std::string& station_name, const MuonDQAHistList& lst ) {
72 m_data[station_name] = lst;
73 }
74
75 MuonDQAHistList& getList( std::string station_name ) {
76 std::map<std::string,MuonDQAHistList>::iterator it;
77 it = m_data.find( station_name );
78 if ( it != m_data.end() ) {
79 return it->second;
80 } else {
81 m_data[station_name] = MuonDQAHistList();
82 return m_data[station_name];
83 }
84 }
85
86 void addList( const int& station_idInt, const MuonDQAHistList& lst ) {
87 m_data_int[station_idInt] = lst;
88 }
89
90 MuonDQAHistList& getList( int station_idInt) {
91 std::map<int, MuonDQAHistList>::iterator it;
92 it = m_data_int.find( station_idInt );
93 if ( it != m_data_int.end() ) {
94 return it->second;
95 } else {
96 m_data_int[station_idInt] = MuonDQAHistList();
97 return m_data_int[station_idInt];
98 }
99 }
100
101 private:
102 std::map< std::string, MuonDQAHistList > m_data;
103 std::map< int, MuonDQAHistList > m_data_int;
104};
105
106#endif
std::vector< TH2 * > m_H2s
void addHist(TH1 *p)
TH2 * getH2(const std::string &hist_name) const
TH1 * getH1(const std::string &hist_name) const
std::vector< TH1 * > m_H1s
void addHist(TH2 *p)
std::map< std::string, MuonDQAHistList > m_data
MuonDQAHistList & getList(std::string station_name)
std::map< int, MuonDQAHistList > m_data_int
void addList(const int &station_idInt, const MuonDQAHistList &lst)
void addList(const std::string &station_name, const MuonDQAHistList &lst)
MuonDQAHistList & getList(int station_idInt)