Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicromegasHotChannelMapData.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MicromegasHotChannelMapData.h
1 #ifndef MICROMEGAS_MICROMEGASHOTCHANNELMAPDATA_H
2 #define MICROMEGAS_MICROMEGASHOTCHANNELMAPDATA_H
3 
9 #include <trackbase/TrkrDefs.h>
10 
11 #include <array>
12 #include <map>
13 #include <set>
14 #include <string>
15 
18 {
19  public:
20 
22  MicromegasHotChannelMapData() = default;
23 
25 
26 
28  void read( const std::string& /*filename*/ );
29 
31  void add_hot_channel( int /*layer*/, int /*tile*/, int /*strip*/ );
32 
34 
36 
37 
39  void write( const std::string& /*filename*/ ) const;
40 
42  bool is_hot_channel( int /*layer*/, int /*tile*/, int /*strip*/ ) const;
43 
45 
46  private:
47 
50  {
51  public:
52 
54  channel_id_t( int layer, int tile, int strip ):
55  m_layer(layer),
56  m_tile(tile),
57  m_strip(strip)
58  {}
59 
60  int m_layer = 0;
61  int m_tile = 0;
62  int m_strip = 0;
63 
65  bool operator < (const channel_id_t& other ) const
66  {
67  if( m_layer != other.m_layer ) return m_layer < other.m_layer;
68  else if( m_tile != other.m_tile ) return m_tile < other.m_tile;
69  else return m_strip < other.m_strip;
70  }
71 
73  friend std::ostream& operator << ( std::ostream& out, const channel_id_t& channel_id )
74  {
75  out << "{ " << channel_id.m_layer << ", " << channel_id.m_tile << ", " << channel_id.m_strip << " }";
76  return out;
77  }
78 
79  };
80 
81  using channel_id_set_t = std::set<channel_id_t>;
83 
84  friend std::ostream& operator << (std::ostream&, const MicromegasHotChannelMapData& );
85 
86 };
87 
88 #endif