15#ifndef O2_MCH_MAPPING_Impl4_CATHODESEGMENTATION_H
16#define O2_MCH_MAPPING_Impl4_CATHODESEGMENTATION_H
23#include <boost/geometry/index/rtree.hpp>
41 boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian>;
42 using Box = boost::geometry::model::box<Point>;
43 using Value = std::pair<Box, unsigned>;
46 std::vector<PadGroup> padGroups,
47 std::vector<PadGroupType> padGroupTypes,
48 std::vector<std::pair<float, float>> padSizes);
66 int findPadByFEE(
int dualSampaId,
int dualSampaChannel)
const;
78 friend std::ostream&
operator<<(std::ostream& os,
85 double padSizeX(
int catPadIndex)
const;
87 double padSizeY(
int catPadIndex)
const;
93 bool isValid(
int catPadIndex)
const;
96 int dualSampaIndex(
int dualSampaId)
const;
100 std::ostream& showPad(std::ostream& out,
int index)
const;
102 const PadGroup& padGroup(
int catPadIndex)
const;
104 const PadGroupType& padGroupType(
int catPadIndex)
const;
106 double squaredDistance(
int catPadIndex,
double x,
double y)
const;
108 std::vector<int> catPadIndices(
int dualSampaId)
const;
112 bool mIsBendingPlane;
113 std::vector<PadGroup> mPadGroups;
114 std::set<int> mDualSampaIds;
115 std::vector<PadGroupType> mPadGroupTypes;
116 std::vector<std::pair<float, float>> mPadSizes;
117 boost::geometry::index::rtree<Value, boost::geometry::index::quadratic<8>>
119 std::vector<int> mCatPadIndex2PadGroupIndex;
120 std::vector<int> mCatPadIndex2PadGroupTypeFastIndex;
121 std::vector<int> mPadGroupIndex2CatPadIndexIndex;
122 std::map<int, std::vector<int>> mDualSampaId2CatPadIndices;
o2::mch::mapping::CathodeSegmentation seg
A CathodeSegmentation lets you find pads on a given plane (cathode) of a detection element and then i...
int findPadByFEE(int dualSampaId, int dualSampaChannel) const
int padDualSampaId(int catPadIndex) const
int findPadByPosition(double x, double y) const
std::vector< int > getNeighbouringCatPadIndices(int catPadIndex) const
double padPositionY(int catPadIndex) const
double padSizeX(int catPadIndex) const
static constexpr int InvalidCatPadIndex
boost::geometry::model::point< double, 2, boost::geometry::cs::cartesian > Point
bool hasPadByFEE(int dualSampaId, int dualSampaChannel) const
bool isValid(int catPadIndex) const
std::vector< int > getCatPadIndices(int dualSampaId) const
Return the list of catPadIndices for the pads of the given dual sampa.
std::pair< Box, unsigned > Value
boost::geometry::model::box< Point > Box
bool hasPadByPosition(double x, double y) const
double padPositionX(int catPadIndex) const
std::set< int > dualSampaIds() const
double padSizeY(int catPadIndex) const
friend std::ostream & operator<<(std::ostream &os, const CathodeSegmentation &seg)
int padDualSampaChannel(int catPadIndex) const
constexpr std::array< std::string_view, BasicOp::Conditional+1 > mapping
a map between BasicOp and tokens in string expressions
CathodeSegmentation * createCathodeSegmentation(int detElemId, bool isBendingPlane)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...