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
22
23#ifndef ALICEO2_ITSMFT_BUILDTOPOLOGYDICTIONARY_H
24#define ALICEO2_ITSMFT_BUILDTOPOLOGYDICTIONARY_H
25#include <algorithm>
26#include <map>
30
31namespace o2
32{
33namespace itsmft
34{
36 int mSizeX = 0;
37 int mSizeZ = 0;
38 float mCOGx = 0.f;
39 float mCOGz = 0.f;
40 float mXmean = 0.f;
41 float mXsigma2 = 0.f;
42 float mZmean = 0.f;
43 float mZsigma2 = 0.f;
44 int mNpixels = 0;
47};
48
49// transient structure to accumulate topology statistics
50struct TopoStat {
52 unsigned long countsTotal = 0; // counts for this topology
53 unsigned long countsWithBias = 0; // counts with assigned dX,dY provided
54 TopoStat() = default;
55};
56
58{
59 public:
61 static constexpr float IgnoreVal = 999.;
62 void accountTopology(const ClusterTopology& cluster, float dX = IgnoreVal, float dZ = IgnoreVal);
63 void setNCommon(unsigned int nCommon); // set number of common topologies
64 void setThreshold(double thr);
65 void setThresholdCumulative(double cumulative); // Considering the integral
67 friend std::ostream& operator<<(std::ostream& os, const BuildTopologyDictionary& BD);
68 void printDictionary(const std::string& fname);
69 void printDictionaryBinary(const std::string& fname);
70 void saveDictionaryRoot(const std::string& fname);
71
72 int getTotClusters() const { return mTotClusters; }
73 int getNotInGroups() const { return mNCommonTopologies; }
74 TopologyDictionary getDictionary() const { return mDictionary; }
75
76 private:
77 TopologyDictionary mDictionary;
78 std::map<unsigned long, TopoStat> mTopologyMap;
79 std::vector<std::pair<unsigned long, unsigned long>> mTopologyFrequency;
80 int mTotClusters;
81 int mNCommonTopologies;
82 double mFrequencyThreshold;
83
84 std::unordered_map<long unsigned, TopologyInfo> mMapInfo;
85
86 ClassDefNV(BuildTopologyDictionary, 4);
87};
88} // namespace itsmft
89} // namespace o2
90#endif
Definition of the ClusterTopology class.
Definition of the ClusterTopology class.
Definition of the SegmentationAlpide class.
friend std::ostream & operator<<(std::ostream &os, const BuildTopologyDictionary &BD)
void accountTopology(const ClusterTopology &cluster, float dX=IgnoreVal, float dZ=IgnoreVal)
void printDictionaryBinary(const std::string &fname)
void printDictionary(const std::string &fname)
void saveDictionaryRoot(const std::string &fname)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...