Project
Loading...
Searching...
No Matches
Clusterizer.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
16
17#ifndef ALICEO2_ECAL_CLUSTERIZER_H
18#define ALICEO2_ECAL_CLUSTERIZER_H
19
20#include <gsl/span>
21#include <vector>
24
26using o2::ecal::Digit;
27class TF1;
28
29namespace o2
30{
31namespace ecal
32{
34{
35 public:
36 Clusterizer(bool applyCorrectionZ = 1, bool applyCorrectionE = 1);
37 ~Clusterizer() = default;
38 void initialize() {};
39 void addDigitToCluster(Cluster& cluster, int row, int col, const gsl::span<const Digit>& digits);
40 void findClusters(const gsl::span<const Digit>& digits, std::vector<Cluster>& foundClusters, std::vector<Cluster>& unfoldedClusters);
41 void makeClusters(const gsl::span<const Digit>& digits, std::vector<Cluster>& clusters);
42 void makeUnfoldings(std::vector<Cluster>& foundClusters, std::vector<Cluster>& unfoldedClusters);
43 void unfoldOneCluster(Cluster* iniClu, int nMax, int* digitId, float* maxAtEnergy, std::vector<Cluster>& unfoldedClusters);
44 void evalClusters(std::vector<Cluster>& clusters);
45 int getNumberOfLocalMax(Cluster& clu, int* maxAt, float* maxAtEnergy);
46 double showerShape(double dx, double dz, bool isCrystal);
47 void setLogWeight(double logWeight) { mLogWeight = logWeight; }
48 void setClusteringThreshold(double threshold) { mClusteringThreshold = threshold; }
49 void setCrystalDigitThreshold(double threshold) { mCrystalDigitThreshold = threshold; }
50 void setSamplingDigitThreshold(double threshold) { mSamplingDigitThreshold = threshold; }
51 void setCrystalEnergyCorrectionPars(std::vector<double> pars) { mCrystalEnergyCorrectionPars = pars; }
52 void setSamplingEnergyCorrectionPars(std::vector<double> pars) { mSamplingEnergyCorrectionPars = pars; }
53 void setCrystalZCorrectionPars(std::vector<double> pars) { mCrystalZCorrectionPars = pars; }
54 void setSamplingZCorrectionPars(std::vector<double> pars) { mSamplingZCorrectionPars = pars; }
55
56 private:
57 std::vector<std::vector<int>> mDigitIndices; // 2D map of digit indices used for recursive cluster finding
58 bool mUnfoldClusters = true; // to perform cluster unfolding
59 double mCrystalDigitThreshold = 0.040; // minimal energy of crystal digit
60 double mSamplingDigitThreshold = 0.100; // minimal energy of sampling digit
61 double mClusteringThreshold = 0.050; // minimal energy of digit to start clustering (GeV)
62 double mClusteringTimeGate = 1e9; // maximal time difference between digits to be accepted to clusters (in ns)
63 int mNLMMax = 30; // maximal number of local maxima in unfolding
64 double mLogWeight = 4.; // cutoff used in log. weight calculation
65 double mUnfogingEAccuracy = 1.e-4; // accuracy of energy calculation in unfoding prosedure (GeV)
66 double mUnfogingXZAccuracy = 1.e-2; // accuracy of position calculation in unfolding procedure (cm)
67 int mNMaxIterations = 100; // maximal number of iterations in unfolding procedure
68 double mLocalMaximumCut = 0.015; // minimal height of local maximum over neighbours
69 bool mApplyCorrectionZ = 1; // apply z-correction
70 bool mApplyCorrectionE = 1; // apply energy-correction
71 TF1* fCrystalShowerShape;
72 TF1* fSamplingShowerShape;
73 TF1* fCrystalRMS;
74 std::vector<double> mCrystalEnergyCorrectionPars; // crystal energy-correction parameters
75 std::vector<double> mSamplingEnergyCorrectionPars; // sampling energy-correction parameters
76 std::vector<double> mCrystalZCorrectionPars; // crystal z-correction parameters
77 std::vector<double> mSamplingZCorrectionPars; // sampling z-correction parameters
78};
79
80} // namespace ecal
81} // namespace o2
82
83#endif // ALICEO2_ECAL_CLUSTERIZER_H
Definition of ECal cluster class.
Definition of ECal digit class.
uint32_t col
Definition RawData.h:4
void setLogWeight(double logWeight)
Definition Clusterizer.h:47
void makeUnfoldings(std::vector< Cluster > &foundClusters, std::vector< Cluster > &unfoldedClusters)
void setCrystalZCorrectionPars(std::vector< double > pars)
Definition Clusterizer.h:53
void setSamplingDigitThreshold(double threshold)
Definition Clusterizer.h:50
void setClusteringThreshold(double threshold)
Definition Clusterizer.h:48
void setSamplingEnergyCorrectionPars(std::vector< double > pars)
Definition Clusterizer.h:52
void setCrystalEnergyCorrectionPars(std::vector< double > pars)
Definition Clusterizer.h:51
void unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, float *maxAtEnergy, std::vector< Cluster > &unfoldedClusters)
void setSamplingZCorrectionPars(std::vector< double > pars)
Definition Clusterizer.h:54
void findClusters(const gsl::span< const Digit > &digits, std::vector< Cluster > &foundClusters, std::vector< Cluster > &unfoldedClusters)
void makeClusters(const gsl::span< const Digit > &digits, std::vector< Cluster > &clusters)
void setCrystalDigitThreshold(double threshold)
Definition Clusterizer.h:49
double showerShape(double dx, double dz, bool isCrystal)
void addDigitToCluster(Cluster &cluster, int row, int col, const gsl::span< const Digit > &digits)
void evalClusters(std::vector< Cluster > &clusters)
int getNumberOfLocalMax(Cluster &clu, int *maxAt, float *maxAtEnergy)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Cluster clu
std::vector< Cluster > clusters
std::vector< Digit > digits
std::vector< int > row