ATLAS Offline Software
Loading...
Searching...
No Matches
RegSelSubDetector.h
Go to the documentation of this file.
1// emacs: this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7/**************************************************************************
8 **
9 ** File: RegSelSubDetector.h
10 **
11 ** Description: Basic name class for named objects, just to
12 ** keep everything tidy with standard calls
13 **
14 **
15 ** Author: M.Sutton
16 **
17 ** Created: Wed Apr 4 15:50:48 BST 2007
18 ** Modified:
19 **
20 **
21 **
22 **************************************************************************/
23
24
25#ifndef __REGSELSUBDETECTOR_H
26#define __REGSELSUBDETECTOR_H
27
28
29#include "RegSelLUT/RegSelRoI.h"
32
34#include "RegSelLUT/ZRObject.h"
35
36#include <vector>
37#include <map>
38
39
40
41
42
43
44class RegSelSubDetector : public ZRObject, public RegSelName {
45
46public:
47
48 RegSelSubDetector() : ZRObject(0,0,0,0), m_ID(0), m_Nlayers(0), m_mapped(false) { }
49
50 RegSelSubDetector(int ID, int Nlayers, const std::string& s) :
51 ZRObject(0,0,0,0), RegSelName(s), m_ID(ID), m_Nlayers(Nlayers), m_mapped(false)
52 { } // m_layer.resize(m_Nlayers); }
53
54 RegSelSubDetector(int ID, const std::string& s) :
55 ZRObject(0,0,0,0), RegSelName(s), m_ID(ID), m_Nlayers(0), m_mapped(false)
56 { }
57
59 ZRObject(0,0,0,0), RegSelName(""), m_ID(ID), m_Nlayers(0), m_mapped(false)
60 { }
61
62
63
64 RegSelSubDetector(double rmin, double rmax,
65 double zmin, double zmax) :
66 ZRObject(rmin, rmax, zmin, zmax), m_ID(0), m_Nlayers(0), m_mapped(false)
67 { } // m_layer.resize(m_Nlayers); }
68
69
70 RegSelSubDetector(double rmin, double rmax,
71 double zmin, double zmax,
72 const std::string& s) :
73 ZRObject(rmin, rmax, zmin, zmax), RegSelName(s), m_ID(0), m_Nlayers(0), m_mapped(false)
74 { }
75
76
77 void reset();
78
79 void addModules(std::vector<RegSelModule>& modules);
80
82
83 void getModules(const RegSelRoI& roi, std::vector<const RegSelModule*>& modules) const;
84 void getModules(const RegSelRoI& roi, unsigned layer, std::vector<const RegSelModule*>& modules) const;
85 void getModules(unsigned layer, std::vector<const RegSelModule*>& modules) const;
86
87
88 int ID() const { return m_ID; }
89 int Nlayers() const { return m_Nlayers; }
90
91
92 void drawlayers(std::vector<const ZRObject*>& c) const {
93 for ( unsigned i=0 ; i<m_Nlayers ; i++ ) c.push_back(&m_layer[i]);
94 }
95
96 const std::vector<RegSelLayer>& getLayers() const { return m_layer; }
97
98 void disableLayer(unsigned layer);
99 void enableLayer(unsigned layer);
100
101protected:
102
103 int m_ID;
104
105 unsigned m_Nlayers;
106 std::vector<RegSelLayer> m_layer;
107
108 std::map<unsigned, unsigned> m_layermap;
110};
111
112
113
114
115
116#endif /* __REGSELSUBDETECTOR_H */
117
118
119
120
121
122
123
124
125
126
RegSelName(const std::string &s="")
Definition RegSelName.h:37
void enableLayer(unsigned layer)
void drawlayers(std::vector< const ZRObject * > &c) const
RegSelSubDetector(double rmin, double rmax, double zmin, double zmax, const std::string &s)
void disableLayer(unsigned layer)
std::map< unsigned, unsigned > m_layermap
const std::vector< RegSelLayer > & getLayers() const
void getModules(const RegSelRoI &roi, std::vector< const RegSelModule * > &modules) const
std::vector< RegSelLayer > m_layer
RegSelSubDetector(int ID, const std::string &s)
RegSelSubDetector(int ID, int Nlayers, const std::string &s)
RegSelSubDetector(double rmin, double rmax, double zmin, double zmax)
void addModules(std::vector< RegSelModule > &modules)
ZRObject()
Definition ZRObject.h:45