15#ifndef O2_MCH_MAPPING_IMPL3_CATHODESEGMENTATION_H
16#define O2_MCH_MAPPING_IMPL3_CATHODESEGMENTATION_H
23#include <boost/geometry/index/rtree.hpp>
39 using Point = boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian>;
40 using Box = boost::geometry::model::box<Point>;
41 using Value = std::pair<Box, unsigned>;
44 std::vector<PadGroupType> padGroupTypes, std::vector<std::pair<float, float>> padSizes);
50 std::vector<int>
getCatPadIndexs(
double xmin,
double ymin,
double xmax,
double ymax)
const;
59 int findPadByFEE(
int dualSampaId,
int dualSampaChannel)
const;
74 double padSizeX(
int catPadIndex)
const;
76 double padSizeY(
int catPadIndex)
const;
82 bool isValid(
int catPadIndex)
const;
85 int dualSampaIndex(
int dualSampaId)
const;
89 std::ostream& showPad(std::ostream& out,
int index)
const;
91 const PadGroup& padGroup(
int catPadIndex)
const;
95 double squaredDistance(
int catPadIndex,
double x,
double y)
const;
100 std::vector<PadGroup> mPadGroups;
101 std::set<int> mDualSampaIds;
102 std::vector<PadGroupType> mPadGroupTypes;
103 std::vector<std::pair<float, float>> mPadSizes;
104 boost::geometry::index::rtree<Value, boost::geometry::index::quadratic<8>> mRtree;
105 std::vector<int> mCatPadIndex2PadGroupIndex;
106 std::vector<int> mCatPadIndex2PadGroupTypeFastIndex;
107 std::vector<int> mPadGroupIndex2CatPadIndexIndex;
o2::mch::mapping::CathodeSegmentation seg
A CathodeSegmentation lets you find pads on a given plane (cathode) of a detection element and then i...
bool hasPadByPosition(double x, double y) const
int findPadByFEE(int dualSampaId, int dualSampaChannel) const
std::vector< int > getCatPadIndexs(int dualSampaIds) const
Return the list of catPadIndexs for the pads of the given dual sampa.
std::set< int > dualSampaIds() const
double padSizeY(int catPadIndex) const
bool isValid(int catPadIndex) const
std::vector< int > getNeighbouringCatPadIndexs(int catPadIndex) const
Return the list of catPadIndexs of the pads which are neighbours to catPadIndex.
double padPositionY(int catPadIndex) const
bool hasPadByFEE(int dualSampaId, int dualSampaChannel) const
double padPositionX(int catPadIndex) const
boost::geometry::model::box< Point > Box
std::pair< Box, unsigned > Value
int findPadByPosition(double x, double y) const
int padDualSampaId(int catPadIndex) const
boost::geometry::model::point< double, 2, boost::geometry::cs::cartesian > Point
double padSizeX(int catPadIndex) const
static constexpr int InvalidCatPadIndex
int padDualSampaChannel(int catPadIndex) const
friend std::ostream & operator<<(std::ostream &os, const CathodeSegmentation &seg)
CathodeSegmentation * createCathodeSegmentation(int detElemId, bool isBendingPlane)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...