Project
Loading...
Searching...
No Matches
Segmentation.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
17#ifndef O2_MCH_MAPPING_SEGMENTATION_H
18#define O2_MCH_MAPPING_SEGMENTATION_H
19
21
22namespace o2
23{
24namespace mch
25{
26namespace mapping
27{
28
59
61{
62 public:
64 Segmentation(int deid);
65
68 int detElemId() const;
69 int nofPads() const;
70 int nofDualSampas() const;
72
81
87 bool findPadPairByPosition(double x, double y, int& bpad, int& nbpad) const;
88
90 int findPadByFEE(int dualSampaId, int dualSampaChannel) const;
92
97 double padPositionX(int dePadIndex) const;
98 double padPositionY(int dePadIndex) const;
99 double padSizeX(int dePadIndex) const;
100 double padSizeY(int dePadIndex) const;
101 int padDualSampaId(int dePadIndex) const;
102 int padDualSampaChannel(int dePadIndex) const;
103 bool isValid(int dePadIndex) const;
104 bool isBendingPad(int dePadIndex) const { return dePadIndex < mPadIndexOffset; }
105 std::string padAsString(int dePadIndex) const;
107
109 void forEachDualSampa(std::function<void(int dualSampaId)> func) const;
110
116 template <typename CALLABLE>
117 void forEachPad(CALLABLE&& func) const;
118
119 template <typename CALLABLE>
120 void forEachPadInDualSampa(int dualSampaId, CALLABLE&& func) const;
121
122 template <typename CALLABLE>
123 void forEachNeighbouringPad(int dePadIndex, CALLABLE&& func) const;
124
125 template <typename CALLABLE>
126 void forEachPadInArea(double xmin, double ymin, double xmax, double ymax, CALLABLE&& func) const;
128
133 const CathodeSegmentation& bending() const;
134 const CathodeSegmentation& nonBending() const;
136
137 bool operator==(const Segmentation& rhs) const;
138 bool operator!=(const Segmentation& rhs) const;
139 friend void swap(Segmentation& a, Segmentation& b);
143
144 private:
145 int padC2DE(int catPadIndex, bool isBending) const;
146 void catSegPad(int dePadIndex, const CathodeSegmentation*& catseg, int& padcuid) const;
147
148 private:
149 int mDetElemId;
150 CathodeSegmentation mBending;
151 CathodeSegmentation mNonBending;
152 int mPadIndexOffset = 0;
153};
154
171const Segmentation& segmentation(int detElemId) __attribute__((weak));
172
173} // namespace mapping
174} // namespace mch
175} // namespace o2
176
177#include "Segmentation.inl"
178
179#endif
o2::mch::mapping::CathodeSegmentation seg
A CathodeSegmentation lets you find pads on a given plane (cathode) of a detection element and then i...
A Segmentation lets you find pads of a detection element and then inspect those pads.
std::string padAsString(int dePadIndex) const
double padPositionX(int dePadIndex) const
double padSizeY(int dePadIndex) const
int padDualSampaId(int dePadIndex) const
Segmentation(const Segmentation &seg)
const CathodeSegmentation & nonBending() const
const CathodeSegmentation & bending() const
bool operator!=(const Segmentation &rhs) const
void forEachDualSampa(std::function< void(int dualSampaId)> func) const
Loop over dual sampas of this detection element.
Segmentation & operator=(Segmentation seg)
void forEachPadInDualSampa(int dualSampaId, CALLABLE &&func) const
bool findPadPairByPosition(double x, double y, int &bpad, int &nbpad) const
int findPadByFEE(int dualSampaId, int dualSampaChannel) const
bool isBendingPad(int dePadIndex) const
void forEachNeighbouringPad(int dePadIndex, CALLABLE &&func) const
bool operator==(const Segmentation &rhs) const
void forEachPad(CALLABLE &&func) const
double padPositionY(int dePadIndex) const
int padDualSampaChannel(int dePadIndex) const
void forEachPadInArea(double xmin, double ymin, double xmax, double ymax, CALLABLE &&func) const
friend void swap(Segmentation &a, Segmentation &b)
double padSizeX(int dePadIndex) const
bool isValid(int dePadIndex) const
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum func
Definition glcorearb.h:778
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
O2MCHMAPPINGIMPL3_EXPORT const Segmentation & segmentation(int detElemId)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...