Project
Loading...
Searching...
No Matches
Cluster.h
Go to the documentation of this file.
1// Copyright 2020-2022 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
12#ifndef DETECTORS_HMPID_BASE_INCLUDE_HMPIDDATAFORMAT_CLUSTER_H_
13#define DETECTORS_HMPID_BASE_INCLUDE_HMPIDDATAFORMAT_CLUSTER_H_
14
18#include "HMPIDBase/Param.h"
19
20namespace o2
21{
22namespace hmpid
23{
27{
28 public:
41
42 public:
43 Cluster() : mCh(-1), mSi(-1), mSt(kEmp), mBox(-1), mNlocMax(-1), mMaxQpad(-1), mMaxQ(-1), mQRaw(0), mQ(0), mErrQ(-1), mXX(0), mErrX(-1), mYY(0), mErrY(-1), mChi2(-1) {}
44
45 // Methods
46 // void draw(Option_t *opt=""); //overloaded TObject::Print() to draw cluster in current canvas
47 void print(Option_t* opt = "") const; // overloaded TObject::Print() to print cluster info
48 static void fitFunc(int& iNpars, double* deriv, double& chi2, double* par, int iflag); // fit function to be used by MINUIT
50 {
51 mDigs = nullptr;
52 }
53 void coG(); // calculates center of gravity
54 void corrSin(); // sinoidal correction
55 void digAdd(const o2::hmpid::Digit* pDig); // add new digit to the cluster
56 const o2::hmpid::Digit* dig(int i) const { return mDigs ? (*mDigs)[i] : nullptr; } // pointer to i-th digi
57 const std::vector<const o2::hmpid::Digit*>* getDigits() const { return mDigs; }
58 void setDigits(std::vector<const o2::hmpid::Digit*>* v = nullptr) { mDigs = v; }
59 inline bool isInPc(); // check if is in the current PC
60 void reset(); // cleans the cluster
61 // void setClusterParams(float xL, float yL, int iCh); //Set AliCluster3D part
62 int solve(std::vector<o2::hmpid::Cluster>* pCluLst, float* pSigmaCut, bool isUnfold); // solve cluster: MINUIT fit or CoG
63 // Getters
64 int box() { return mBox; } // Dimension of the cluster
65 int ch() { return mCh; } // chamber number
66 int size() { return mSi; } // returns number of pads in formed cluster
67 int status() { return mSt; } // Status of cluster
68 float qRaw() { return mQRaw; } // raw cluster charge in QDC channels
69 float q() { return mQ; } // given cluster charge in QDC channels
70 float qe() { return mErrQ; } // Error in cluster charge in QDC channels
71 float x() { return mXX; } // cluster x position in LRS
72 float xe() { return mErrX; } // cluster charge in QDC channels
73 float y() { return mYY; } // cluster y position in LRS
74 float ye() { return mErrY; } // cluster charge in QDC channels
75 float chi2() { return mChi2; } // chi2 of the fit
76 // Setters
77 void doCorrSin(bool doCorrSin) { fgDoCorrSin = doCorrSin; } // Set sinoidal correction
78 void setX(float x) { mXX = x; }
79 void setY(float y) { mYY = y; }
80 void setQ(float q)
81 {
82 mQ = q;
83 if (mQ > 4095) {
84 mQ = 4095;
85 }
86 }
87 void setQRaw(float qRaw)
88 {
89 mQRaw = qRaw;
90 if (mQRaw > 4095) {
91 mQRaw = 4095;
92 }
93 }
94 void setSize(int size) { mSi = size; }
95 void setCh(int chamber) { mCh = chamber; }
96 void setChi2(float chi2) { mChi2 = chi2; }
97 void setStatus(int status) { mSt = status; }
98 void findClusterSize(int i, float* pSigmaCut); // Find the clusterSize of deconvoluted clusters
99
100 // public:
101 protected:
102 int mCh; // chamber number
103 int mSi; // size of the formed cluster from which this cluster deduced
104 int mSt; // flag to mark the quality of the cluster
105 int mBox; // box contaning this cluster
106 int mNlocMax; // number of local maxima in formed cluster
107 int mMaxQpad; // abs pad number of a pad with the highest charge
108 double mMaxQ; // that max charge value
109 double mQRaw; // QDC value of the raw cluster
110 double mQ; // QDC value of the actual cluster
111 double mErrQ; // error on Q
112 double mXX; // local x postion, [cm]
113 double mErrX; // error on x postion, [cm]
114 double mYY; // local y postion, [cm]
115 double mErrY; // error on y postion, [cm]
116 double mChi2; // some estimator of the fit quality
117 std::vector<const o2::hmpid::Digit*>* mDigs = nullptr;
118
119 public:
120 static bool fgDoCorrSin; // flag to switch on/off correction for Sinusoidal to cluster reco
121
123};
124
125} // namespace hmpid
126
127namespace framework
128{
129template <typename T>
130struct is_messageable;
131template <>
132struct is_messageable<o2::hmpid::Cluster> : std::true_type {
133};
134} // namespace framework
135
136} // namespace o2
137
138#endif /* DETECTORS_HMPID_BASE_INCLUDE_HMPIDDATAFORMAT_CLUSTER_H_ */
void print() const
int32_t i
Class to refer to the 1st entry and N elements of some group in the continuous container.
HMPID cluster implementation.
Definition Cluster.h:27
ClassDefNV(Cluster, 3)
std::vector< const o2::hmpid::Digit * > * mDigs
Definition Cluster.h:117
void cleanPointers()
Definition Cluster.h:49
void setSize(int size)
Definition Cluster.h:94
void setChi2(float chi2)
Definition Cluster.h:96
void setQRaw(float qRaw)
Definition Cluster.h:87
void setStatus(int status)
Definition Cluster.h:97
const o2::hmpid::Digit * dig(int i) const
Definition Cluster.h:56
void setQ(float q)
Definition Cluster.h:80
void doCorrSin(bool doCorrSin)
Definition Cluster.h:77
static void fitFunc(int &iNpars, double *deriv, double &chi2, double *par, int iflag)
Definition Cluster.cxx:121
void setCh(int chamber)
Definition Cluster.h:95
void findClusterSize(int i, float *pSigmaCut)
Definition Cluster.cxx:427
void setX(float x)
Definition Cluster.h:78
void setDigits(std::vector< const o2::hmpid::Digit * > *v=nullptr)
Definition Cluster.h:58
const std::vector< const o2::hmpid::Digit * > * getDigits() const
Definition Cluster.h:57
void setY(float y)
Definition Cluster.h:79
static bool fgDoCorrSin
list of digits forming this cluster
Definition Cluster.h:120
void digAdd(const o2::hmpid::Digit *pDig)
Definition Cluster.cxx:465
int solve(std::vector< o2::hmpid::Cluster > *pCluLst, float *pSigmaCut, bool isUnfold)
Definition Cluster.cxx:257
HMPID Digit declaration.
Definition Digit.h:36
GLint GLenum GLint x
Definition glcorearb.h:403
GLsizeiptr size
Definition glcorearb.h:659
const GLdouble * v
Definition glcorearb.h:832
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...