15#ifndef ALICEO2_ITS3_TOPOLOGYDICTIONARY_H
16#define ALICEO2_ITS3_TOPOLOGYDICTIONARY_H
24class BuildTopologyDictionary;
52 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
53 return mVectorOfIDs[
n].mXCOG;
58 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
59 return mVectorOfIDs[
n].mErrX;
64 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
65 return mVectorOfIDs[
n].mZCOG;
70 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
71 return mVectorOfIDs[
n].mErrZ;
76 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
77 return mVectorOfIDs[
n].mErr2X;
82 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
83 return mVectorOfIDs[
n].mErr2Z;
88 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
89 return mVectorOfIDs[
n].mHash;
94 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
95 return mVectorOfIDs[
n].mNpixels;
100 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
101 return mVectorOfIDs[
n].mFrequency;
106 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
107 return mVectorOfIDs[
n].mIsGroup;
112 assert(
n >= 0 ||
n < (
int)mVectorOfIDs.size());
113 return mVectorOfIDs[
n].mPattern;
119 int getSize()
const {
return (
int)mVectorOfIDs.size(); }
123 template <
typename T =
float>
127 template <
typename T =
float>
136 static constexpr int STopoSize{8 * 255 + 1};
137 std::unordered_map<unsigned long, int> mCommonMap{};
138 std::unordered_map<int, int> mGroupMap{};
139 int mSmallTopologiesLUT[STopoSize]{};
140 std::vector<itsmft::GroupStruct> mVectorOfIDs{};
static constexpr int ColClassSpan
Column span of the classes of rare topologies.
math_utils::Point3D< T > getClusterCoordinates(const itsmft::CompClusterExt &cl) const
Returns the local position of a compact cluster.
float getErr2X(int n) const
Returns the error^2 on the x position of the COG for the n_th element.
int getSize() const
Returns the number of elements in the dicionary;.
static constexpr int MaxNumberOfRowClasses
Maximum number of row classes for the groups of rare topologies.
static constexpr int NumberOfRareGroups
unsigned long getHash(int n) const
Returns the hash of the n_th element.
static constexpr int MaxNumberOfColClasses
Maximum number of col classes for the groups of rare topologies.
static constexpr int RowClassSpan
Row span of the classes of rare topologies.
float getErrZ(int n) const
Returns the error on the z position of the COG for the n_th element.
static TopologyDictionary * loadFrom(const std::string &fileName="", const std::string &objName="ccdb_object")
int readBinaryFile(const std::string &fileName)
Reads the dictionary from a binary file.
bool isGroup(int n) const
Returns true if the element corresponds to a group of rare topologies.
float getZCOG(int n) const
Returns the z position of the COG for the n_th element.
TH1F * getTopologyDistribution(const std::string_view hname="h_topo_dist") const
Fills a hostogram with the distribution of the IDs.
float getXCOG(int n) const
Returns the x position of the COG for the n_th element.
float getErrX(int n) const
Returns the error on the x position of the COG for the n_th element.
void writeBinaryFile(const std::string &outputFile)
Prints the dictionary in a binary file.
double getFrequency(int n) const
Returns the frequency of the n_th element;.
friend std::ostream & operator<<(std::ostream &os, const its3::TopologyDictionary &dictionary)
Prints the dictionary.
int readFromFile(const std::string &fileName)
int getNpixels(int n) const
Returns the number of fired pixels of the n_th element.
const itsmft::ClusterPattern & getPattern(int n) const
Returns the pattern of the topology.
float getErr2Z(int n) const
Returns the error^2 on the z position of the COG for the n_th element.
static constexpr uint8_t MaxRowSpan
static constexpr uint8_t MaxColSpan