Project
Loading...
Searching...
No Matches
Recon.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 ALICEO2_HMPID_RECON_H
13#define ALICEO2_HMPID_RECON_H
14
15#include <TNamed.h> //base class
16
17#include <Math/GenVector/Rotation3D.h>
18#include "Math/GenVector/RotationX.h"
19#include "Math/GenVector/RotationY.h"
20#include "Math/GenVector/RotationZ.h"
21
22#include <Math/Vector3D.h>
23#include "Math/Vector3D.h"
24
25#include <TVector2.h>
26#include <TVector3.h>
27
28#include <vector>
29
30#include "HMPIDBase/Param.h"
34
35class Param;
36
37// using Polar3DVector = ROOT::Math::Polar3DVector;
40
41namespace o2
42{
43namespace hmpid
44{
45class Recon : public TNamed
46{
47 public:
48 // ef : moved Recon(): ctor from .cxx file
49 // Recon() = default;
50
51 Recon() : TNamed("RichRec", "RichPat"), // ef : moved from cxx
52 fPhotCnt(-1),
53 fPhotFlag(0x0),
54 fPhotClusIndex(0x0),
55 fPhotCkov(0x0),
56 fPhotPhi(0x0),
57 fPhotWei(0x0),
58 fCkovSigma2(0),
59 fIsWEIGHT(kFALSE),
60 fDTheta(0.001),
61 fWindowWidth(0.045),
62 fRingArea(0),
63 fRingAcc(0),
64 fTrkDir(0, 0, 1), // Just for test
65 fTrkPos(30, 40), // Just for test
66 fMipPos(0, 0),
67 fPc(0, 0),
68 fParam(o2::hmpid::Param::instance())
69 // fParam(Param::instance())
70 {
71 //..
72 // init of data members
73 //..
74
75 fParam->setRefIdx(fParam->meanIdxRad()); // initialization of ref index to a default one // ef:ok
76 }
77
78 //~Recon() = default;
79 virtual ~Recon() { ; } // dtor
80
81 // ef : methods in these classeS?
82 void initVars(int n); // init space for variables
83
84 // ef : commented out: no need to delete variables when smart-pointer
85 // void deleteVars() const; // delete variables
86
87 // void CkovAngle (AliESDtrack *pTrk,TClonesArray *pCluLst,int index,double nmean,float xRa,float yRa );
88 void ckovAngle(o2::dataformats::MatchInfoHMP* match, const std::vector<o2::hmpid::Cluster> clusters, int index, double nmean, float xRa, float yRa); // reconstructed Theta Cerenkov
89
90 bool findPhotCkov(double cluX, double cluY, double& thetaCer, double& phiCer); // find ckov angle for single photon candidate
91 bool findPhotCkov2(double cluX, double cluY, double& thetaCer, double& phiCer);
92 double findRingCkov(int iNclus); // best ckov for ring formed by found photon candidates
93 void findRingGeom(double ckovAng, int level = 1); // estimated area of ring in cm^2 and portion accepted by geometry
94
95 // template <typename T = double>
96 const TVector2 intWithEdge(TVector2 p1, TVector2 p2); // find intercection between plane and lines of 2 thetaC
97
98 int flagPhot(double ckov, const std::vector<o2::hmpid::Cluster> clusters, float* photChargeVec); // is photon ckov near most probable track ckov
99 // int flagPhot(double ckov, const std::vector<o2::hmpid::Cluster> clusters); // is photon ckov near most probable track ckov
100
101 double houghResponse(); // most probable track ckov angle
102 // template <typename T = double>
103 void propagate(const TVector3 dir, TVector3& pos, double z) const; // propagate photon alogn the line
104 // void refract(math_utils::Vector3D<float>& dir, double n1, double n2) const; // refract photon on the boundary
105
106 // template <typename T = double>
107 void refract(TVector3& dir, double n1, double n2) const; //
108
109 TVector2 tracePhot(double ckovTh, double ckovPh) const; // trace photon created by track to PC
110
111 // ef : commented out addObjectToFriends
112 // void addObjectToFriends(TClonesArray *pCluLst, int photonIndex, AliESDtrack *pTrk ); // Add AliHMPIDCluster object to ESD friends
113 // template <typename T = double>
114 TVector2 traceForward(TVector3 dirCkov) const; // tracing forward a photon from (x,y) to PC
115 void lors2Trs(TVector3 dirCkov, double& thetaCer, double& phiCer) const; // LORS to TRS
116 void trs2Lors(TVector3 dirCkov, double& thetaCer, double& phiCer) const; // TRS to LORS
117
118 TVector2 getMip() const
119 {
120 return fMipPos;
121 } // mip coordinates
122
123 double getRingArea() const
124 {
125 return fRingArea;
126 } // area of the current ring in cm^2
127
128 double getRingAcc() const
129 {
130 return fRingAcc;
131 } // portion of the ring ([0,1]) accepted by geometry.To scale n. of photons
132 double findRingExt(double ckov, int ch, double xPc, double yPc, double thRa, double phRa); // find ring acceptance by external parameters
133
134 void setTrack(double xRad, double yRad, double theta, double phi)
135 {
136 fTrkDir.SetMagThetaPhi(1., theta, phi);
137 fTrkPos.Set(xRad, yRad);
138 } // set track parameter at RAD
139
140 void setImpPC(double xPc, double yPc)
141 {
142 fPc.Set(xPc, yPc);
143 } // set track impact to PC
144
145 void setMip(double xmip, double ymip)
146 {
147 fMipPos.Set(xmip, ymip);
148 } // set track impact to PC
149
155 //
156 protected:
157 int fPhotCnt; // counter of photons candidate
158
159 // ef : changed to smart-pointer arrays
160 std::unique_ptr<int[]> fPhotFlag; // flags of photon candidates
161 std::unique_ptr<int[]> fPhotClusIndex; // cluster index of photon candidates
162 std::unique_ptr<double[]> fPhotCkov; // Ckov angles of photon candidates, [rad]
163 std::unique_ptr<double[]> fPhotPhi; // phis of photons candidates, [rad]
164 std::unique_ptr<double[]> fPhotWei; // weigths of photon candidates
165
166 // int *fPhotClusIndex; // cluster index of photon candidates
167
168 double fCkovSigma2; // sigma2 of the reconstructed ring
169
170 bool fIsWEIGHT; // flag to consider weight procedure
171 float fDTheta; // Step for sliding window
172 float fWindowWidth; // Hough width of sliding window
173
174 double fRingArea; // area of a given ring
175 double fRingAcc; // fraction of the ring accepted by geometry
176
177 TVector3 fTrkDir; // track direction in LORS at RAD
178
179 TVector2 fTrkPos; // track positon in LORS at RAD // XY mag
180 TVector2 fMipPos; // mip positon for a given trackf // XY
181 TVector2 fPc; // track position at PC // XY
182
184
185 private:
186 Recon(const Recon& r); // dummy copy constructor
187 Recon& operator=(const Recon& r); // dummy assignment operator
188 //
189 ClassDef(Recon, 3)
190};
191
192} // namespace hmpid
193} // namespace o2
194#endif
Base track model for the Barrel, params only, w/o covariance.
constexpr int p2()
constexpr int p1()
constexpr to accelerate the coordinates changing
Class to store the output of the matching to HMPID.
uint16_t pos
Definition RawData.h:3
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
void setRefIdx(double refRadIdx)
Definition Param.h:231
double meanIdxRad() const
Definition Param.h:159
static Param * instance()
Definition Param.cxx:438
double getRingAcc() const
Definition Recon.h:128
double fCkovSigma2
Definition Recon.h:168
void ckovAngle(o2::dataformats::MatchInfoHMP *match, const std::vector< o2::hmpid::Cluster > clusters, int index, double nmean, float xRa, float yRa)
Definition Recon.cxx:49
o2::hmpid::Param * fParam
Definition Recon.h:183
std::unique_ptr< int[]> fPhotClusIndex
Definition Recon.h:161
TVector3 fTrkDir
Definition Recon.h:177
double fRingArea
Definition Recon.h:174
void setTrack(double xRad, double yRad, double theta, double phi)
Definition Recon.h:134
std::unique_ptr< double[]> fPhotPhi
Definition Recon.h:163
bool findPhotCkov2(double cluX, double cluY, double &thetaCer, double &phiCer)
Definition Recon.cxx:190
TVector2 traceForward(TVector3 dirCkov) const
Definition Recon.cxx:228
bool findPhotCkov(double cluX, double cluY, double &thetaCer, double &phiCer)
Definition Recon.cxx:145
double getRingArea() const
Definition Recon.h:123
void setMip(double xmip, double ymip)
Definition Recon.h:145
double findRingCkov(int iNclus)
Definition Recon.cxx:399
double findRingExt(double ckov, int ch, double xPc, double yPc, double thRa, double phRa)
Definition Recon.cxx:593
void initVars(int n)
Definition Recon.cxx:29
std::unique_ptr< double[]> fPhotWei
Definition Recon.h:164
float fDTheta
Definition Recon.h:171
double fRingAcc
Definition Recon.h:175
void lors2Trs(TVector3 dirCkov, double &thetaCer, double &phiCer) const
Definition Recon.cxx:252
std::unique_ptr< int[]> fPhotFlag
Definition Recon.h:160
std::unique_ptr< double[]> fPhotCkov
Definition Recon.h:162
void refract(TVector3 &dir, double n1, double n2) const
Definition Recon.cxx:510
void propagate(const TVector3 dir, TVector3 &pos, double z) const
Definition Recon.cxx:495
TVector2 getMip() const
Definition Recon.h:118
TVector2 fTrkPos
Definition Recon.h:179
TVector2 tracePhot(double ckovTh, double ckovPh) const
Definition Recon.cxx:480
TVector2 fMipPos
Definition Recon.h:180
void trs2Lors(TVector3 dirCkov, double &thetaCer, double &phiCer) const
Definition Recon.cxx:276
virtual ~Recon()
Definition Recon.h:79
TVector2 fPc
Definition Recon.h:181
const TVector2 intWithEdge(TVector2 p1, TVector2 p2)
Definition Recon.cxx:354
float fWindowWidth
Definition Recon.h:172
double houghResponse()
Definition Recon.cxx:527
int flagPhot(double ckov, const std::vector< o2::hmpid::Cluster > clusters, float *photChargeVec)
Definition Recon.cxx:442
void findRingGeom(double ckovAng, int level=1)
Definition Recon.cxx:301
void setImpPC(double xPc, double yPc)
Definition Recon.h:140
bool match(const std::vector< std::string > &queries, const char *pattern)
Definition dcs-ccdb.cxx:229
GLdouble n
Definition glcorearb.h:1982
GLuint index
Definition glcorearb.h:781
GLboolean r
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Cluster > clusters