Project
Loading...
Searching...
No Matches
BuildTopologyDictionary.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
14
15#ifndef ALICEO2_ITS3_BUILDTOPOLOGYDICTIONARY_H
16#define ALICEO2_ITS3_BUILDTOPOLOGYDICTIONARY_H
17
21
22namespace o2::its3
23{
24
26{
27 using TopoInfo = std::unordered_map<long unsigned, itsmft::TopologyInfo>;
28 using TopoStat = std::map<long unsigned, itsmft::TopoStat>;
29 using TopoFreq = std::vector<std::pair<unsigned long, unsigned long>>;
30
31 public:
32 static constexpr float IgnoreVal = 999.;
33 void accountTopology(const itsmft::ClusterTopology& cluster, bool IB, float dX = IgnoreVal, float dZ = IgnoreVal);
34 void setNCommon(unsigned int nCommon, bool IB); // set number of common topologies
35 void setThreshold(double thr, bool IB);
36 void setThresholdCumulative(double cumulative, bool IB); // Considering the integral
38 void printDictionary(const std::string& fname);
39 void printDictionaryBinary(const std::string& fname);
40 void saveDictionaryRoot(const std::string& fname);
41
42 [[nodiscard]] unsigned int getTotClusters(bool IB) const { return (IB) ? mTotClustersIB : mTotClustersOB; }
43 [[nodiscard]] unsigned int getNotInGroups(bool IB) const { return (IB) ? mNCommonTopologiesIB : mNCommonTopologiesOB; }
44 [[nodiscard]] const TopologyDictionary& getDictionary() const { return mDictionary; }
45
46 friend std::ostream& operator<<(std::ostream& os, const BuildTopologyDictionary& BD);
47
48 private:
49 void accountTopologyImpl(const itsmft::ClusterTopology& cluster, TopoInfo& tinfo, TopoStat& tstat, unsigned int& ntot, float sigmaX, float sigmaZ, float dX, float dZ);
50 void setNCommonImpl(unsigned int ncom, TopoFreq& tfreq, TopoStat& tstat, unsigned int& ncommon, unsigned int ntot);
51 void setThresholdImpl(double thr, TopoFreq& tfreq, TopoInfo& tinfo, TopoStat& tstat, unsigned int& ncommon, double& freqthres, unsigned int ntot);
52 void setThresholdCumulativeImpl(double cumulative, TopoFreq& tfreq, unsigned int& ncommon, double& freqthres, unsigned int ntot);
53 void groupRareTopologiesImpl(TopoFreq& tfreq, TopoInfo& tinfo, TopoStat& tstat, unsigned int& ncommon, double& freqthres, TopologyDictionaryData& data, unsigned int ntot);
54
55 TopologyDictionary mDictionary;
56 unsigned int mTotClustersIB{0};
57 unsigned int mTotClustersOB{0};
58 unsigned int mNCommonTopologiesIB{0};
59 unsigned int mNCommonTopologiesOB{0};
60 double mFrequencyThresholdIB{0.};
61 double mFrequencyThresholdOB{0.};
62 TopoInfo mMapInfoIB;
63 TopoInfo mMapInfoOB;
64 TopoStat mTopologyMapIB;
65 TopoStat mTopologyMapOB;
66 TopoFreq mTopologyFrequencyIB;
67 TopoFreq mTopologyFrequencyOB;
68
69 ClassDefNV(BuildTopologyDictionary, 3);
70};
71} // namespace o2::its3
72
73#endif
Definition of the ClusterTopology class.
Definition of the BuildTopologyDictionary class for ITS3.
Definition of the BuildTopologyDictionary class.
friend std::ostream & operator<<(std::ostream &os, const BuildTopologyDictionary &BD)
void saveDictionaryRoot(const std::string &fname)
void setNCommon(unsigned int nCommon, bool IB)
void setThresholdCumulative(double cumulative, bool IB)
const TopologyDictionary & getDictionary() const
void accountTopology(const itsmft::ClusterTopology &cluster, bool IB, float dX=IgnoreVal, float dZ=IgnoreVal)
void printDictionary(const std::string &fname)
unsigned int getTotClusters(bool IB) const
void printDictionaryBinary(const std::string &fname)
unsigned int getNotInGroups(bool IB) const
GLboolean * data
Definition glcorearb.h:298