Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RoiDescriptor.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RoiDescriptor.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
11 // TODO: update to C++17 style
12 #include <atomic>
13 #include <iostream>
14 #include <map>
15 #include <ostream>
16 #include <vector>
17 
18 #include <stdint.h>
19 
20 namespace Acts {
21 
23  public:
24  // iterator
25  using roi_iterator = std::vector<const RoiDescriptor*>::const_iterator;
27  static constexpr bool FULLSCAN = true;
28  static constexpr bool ROI = false;
29 
42  RoiDescriptor(double eta, double etaMinus, double etaPlus, double phi,
43  double phiMinus, double phiPlus, double zed = 0,
44  double zedMinus = -s_zedWidthDefault,
45  double zedPlus = s_zedWidthDefault);
46  // zedminus - s_zedWidthDefault = 225 //from ROIDescriptor
47 
48  /*
49  * need an explicit class copy constructor
50  */
51  RoiDescriptor(const RoiDescriptor& roi);
53 
54  // Destructor
56 
57  // Methods to retrieve data members
58 
59  double phi() const { return m_phi; }
60  double eta() const { return m_eta; }
61  double zed() const { return m_zed; }
62 
66 
67  double zedPlus() const {
68  return m_zedPlus;
69  }
70  double zedMinus() const {
71  return m_zedMinus;
72  }
73 
74  double etaPlus() const { return m_etaPlus; }
75  double etaMinus() const { return m_etaMinus; }
76 
77  double phiPlus() const { return m_phiPlus; }
78  double phiMinus() const { return m_phiMinus; }
79 
81  int version() const { return m_version; }
82  void version(int v) { m_version = v; }
83 
85  // virtual operator std::string() const ;
86 
88  bool isFullscan() const { return m_fullscan; }
89 
91 
93  bool composite() const { return m_composite; }
94  void setComposite(bool b = true) { m_composite = b; }
95 
97  bool manageConstituents() const { return m_manageConstituents; }
99 
101  unsigned size() const { return m_roiDescriptors.size(); }
102 
104  const RoiDescriptor* at(int i) const { return m_roiDescriptors.at(i); }
105 
107  void clear() { m_roiDescriptors.clear(); } // setComposite(false); }
108 
110  void reserve(size_t s) { m_roiDescriptors.reserve(s); }
111 
113  void push_back(const RoiDescriptor* roi) {
114  m_roiDescriptors.push_back(roi);
115  setComposite(true);
116  }
117 
119  roi_iterator begin() const { return m_roiDescriptors.begin(); }
120  roi_iterator end() const { return m_roiDescriptors.end(); }
121 
123  double dzdrMinus() const {
124  return m_dzdrMinus;
125  }
126  double dzdrPlus() const {
127  return m_dzdrPlus;
128  }
129 
130  double drdzMinus() const {
131  return m_drdzMinus;
132  }
133  double drdzPlus() const {
134  return m_drdzPlus;
135  }
136 
139  double zedMin(double r) const;
140  double zedMax(double r) const;
141 
142  double zedOuterPlus() const {
143  return m_zedOuterPlus;
144  }
145  double zedOuterMinus() const {
146  return m_zedOuterMinus;
147  }
148 
149  double rhoMin(double z) const;
150  double rhoMax(double z) const;
151 
152  static double zedWidthDefault() { return s_zedWidthDefault; }
153 
155  static void zedWidthDefault(double d);
156 
157  // fromn trig
158  unsigned int roiId() const { return m_roiId; }
159  unsigned int l1Id() const { return m_l1Id; }
160  unsigned int roiWord() const { return m_roiWord; }
161 
162  private:
164  static std::atomic<double> s_zedWidthDefault;
166  static std::atomic<bool> s_firstInstanceCreated;
167 
168  float m_phi{};
169  float m_eta{};
170  float m_zed{};
171 
172  float m_phiMinus{};
173  float m_phiPlus{};
174  float m_etaMinus{};
175  float m_etaPlus{};
176  float m_zedMinus{};
177 
178  float
180 
181  float m_dzdrMinus{};
182  float m_dzdrPlus{};
183 
184  float m_drdzMinus{};
185  float m_drdzPlus{};
186 
187  float
189  float
191 
192  bool m_fullscan{};
193  bool m_composite{};
195 
196 
197  int m_version{};
198 
199  std::vector<const RoiDescriptor*> m_roiDescriptors;
200 
201  // from trig
202  unsigned int m_l1Id{0};
203  unsigned int m_roiId{0};
204  unsigned int m_roiWord{0};
205 
206 
207  // std::string str( const RoiDescriptor& d ); //<!
208  // printing helper std::ostream& operator<<( std::ostream& m, const
209  // RoiDescriptor& d ); //<! printing helper (wraps above)
210 };
211 
212 } // namespace Acts