Project
Loading...
Searching...
No Matches
mathieson.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
12// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
13// See https://alice-o2.web.cern.ch/copyright for details of the copyright
14// holders. All rights not expressly granted are reserved.
15//
16// This software is distributed under the terms of the GNU General Public
17// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
18//
19// In applying this license CERN does not waive the privileges and immunities
20// granted to it by virtue of its status as an Intergovernmental Organization
21// or submit itself to any jurisdiction.
22
23#ifndef O2_MCH_MATHIESON_H
24#define O2_MCH_MATHIESON_H
25
26#include <cmath>
27#include <cstddef>
28
30
31namespace o2
32{
33namespace mch
34{
35typedef struct SplineCoef {
36 double* a;
37 double* b;
38 double* c;
39 double* d;
40 SplineCoef(int N);
43
44typedef struct {
45 // Compressed values along X and Y
46 int nYc;
47 int nXc;
48 // Mapping : original array -> compressed array
49 int* mapXInf;
50 int* mapXSup;
51 int* mapYInf;
52 int* mapYSup;
53 double* xCompressed;
54 double* yCompressed;
56
57void initMathieson(int useSpline_, int useCache_);
58void mathiesonPrimitive(const double* xy, int N,
59 int axe, int chamberId, double mPrimitive[]);
61void computeSplineCoef(const double* xy, double xyStep, const double* f, int N,
62 double leftDerivative, double rightDerivative, SplineCoef* splineCoef);
63void splineMathiesonPrimitive(const double* x, int N, int axe, int chamberId, double* mPrimitive);
64
65void compute1DMathieson(const double* xy, int N,
66 int axe, int chamberId, double mathieson[]);
67void compute1DPadIntegrals(const double* xyInf, const double* xySup, int N,
68 double xy0, int axe, int chamberId, double* integrals);
69void compute1DPadIntegrals(const double* xInf, const double* xSup, int N,
70 int axe, int chamberId, double Integrals[]);
71
72void compute2DPadIntegrals(const double* xInf, const double* xSup,
73 const double* yInf, const double* ySup, int N,
74 int chamberId, double Integrals[]);
75
76CompressedPads_t* compressPads(const double* xInf, const double* xSup,
77 const double* yInf, const double* ySup, int N);
78void computeCompressed2DPadIntegrals(CompressedPads_t* compressedPads, double xShift, double yShift, int N,
79 int chamberId, double Integrals[]);
80void deleteCompressedPads(CompressedPads_t* compressedPads);
81
82void compute2DMathiesonMixturePadIntegrals(const double* xyInfSup0,
83 const double* theta, int N, int K,
84 int chamberId, double Integrals[]);
85
86void computeCij(const Pads& pads, const Pads& theta, double Cij[]);
87void computeFastCij(const Pads& pads, const Pads& theta, double Cij[]);
88void checkCij(const Pads& pads, const Pads& pixels, const double* checkCij, int mode);
89
90bool checkIntegrals(const double* xInf, const double* xSup, const double* yInf, const double* ySup,
91 const double* integralsToCheck, int chId, int N);
92
93// Utilities to handle mixture of parameter theta
94double* getVarX(double* theta, int K);
95double* getVarY(double* theta, int K);
96double* getMuX(double* theta, int K);
97double* getMuY(double* theta, int K);
98double* getW(double* theta, int K);
99double* getMuAndW(double* theta, int K);
100//
101const double* getConstVarX(const double* theta, int K);
102const double* getConstVarY(const double* theta, int K);
103const double* getConstMuX(const double* theta, int K);
104const double* getConstMuY(const double* theta, int K);
105const double* getConstW(const double* theta, int K);
106const double* getConstMuAndW(const double* theta, int K);
107// xyDxy
108double* getX(double* xyDxy, int N);
109double* getY(double* xyDxy, int N);
110double* getDX(double* xyDxy, int N);
111double* getDY(double* xyDxy, int N);
112//
113const double* getConstX(const double* xyDxy, int N);
114const double* getConstY(const double* xyDxy, int N);
115const double* getConstDX(const double* xyDxy, int N);
116const double* getConstDY(const double* xyDxy, int N);
117
118// xySupInf
119double* getXInf(double* xyInfSup, int N);
120double* getYInf(double* xyInfSup, int N);
121double* getXSup(double* xyInfSup, int N);
122double* getYSup(double* xyInfSup, int N);
123const double* getConstXInf(const double* xyInfSup, int N);
124const double* getConstYInf(const double* xyInfSup, int N);
125const double* getConstXSup(const double* xyInfSup, int N);
126const double* getConstYSup(const double* xyInfSup, int N);
127
128// copy
129void copyTheta(const double* theta0, int K0, double* theta, int K1, int K);
130void copyXYdXY(const double* xyDxy0, int N0, double* xyDxy, int N1, int N);
131
132// Transformations
133void xyDxyToxyInfSup(const double* xyDxy, int nxyDxy, double* xyInfSup);
134// Mask operations
135void maskedCopyXYdXY(const double* xyDxy, int nxyDxy, const Mask_t* mask,
136 int nMask, double* xyDxyMasked, int nxyDxyMasked);
137
138void maskedCopyToXYInfSup(const double* xyDxy, int ndxyDxy, const Mask_t* mask,
139 int nMask, double* xyDxyMasked, int ndxyDxyMasked);
140
141void maskedCopyTheta(const double* theta, int K, const Mask_t* mask, int nMask,
142 double* maskedTheta, int maskedK);
143
144void printTheta(const char* str, double meanCharge, const double* theta, int K);
145
146void printXYdXY(const char* str, const double* xyDxy, int NMax, int N,
147 const double* val1, const double* val2);
148
149} // namespace mch
150} // namespace o2
151
152// For InspectModel (if required)
153extern "C" {
155void o2_mch_compute2DPadIntegrals(const double* xInf, const double* xSup,
156 const double* yInf, const double* ySup, int N,
157 int chamberId, double Integrals[]);
158void o2_mch_compute2DMathiesonMixturePadIntegrals(const double* xyInfSup0,
159 const double* theta, int N,
160 int K, int chamberId,
161 double Integrals[]);
162void o2_mch_computeCij(const double* xyInfSup0, const double* theta, int N,
163 int K, int chamberId, double Cij[]);
164}
165
166#endif // O2_MCH_MATHIESON_H_
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum mode
Definition glcorearb.h:266
GLdouble f
Definition glcorearb.h:310
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
Definition glcorearb.h:275
GLint GLuint mask
Definition glcorearb.h:291
void o2_mch_compute2DMathiesonMixturePadIntegrals(const double *xyInfSup0, const double *theta, int N, int K, int chamberId, double Integrals[])
void o2_mch_initMathieson()
void o2_mch_computeCij(const double *xyInfSup0, const double *theta, int N, int K, int chamberId, double Cij[])
void o2_mch_compute2DPadIntegrals(const double *xInf, const double *xSup, const double *yInf, const double *ySup, int N, int chamberId, double Integrals[])
void initMathieson(int useSpline_, int useCache_)
Definition mathieson.cxx:73
const double * getConstXInf(const double *xyInfSup, int N)
void maskedCopyToXYInfSup(const double *xyDxy, int ndxyDxy, const Mask_t *mask, int nMask, double *xyDxyMasked, int ndxyDxyMasked)
void maskedCopyTheta(const double *theta, int K, const Mask_t *mask, int nMask, double *maskedTheta, int maskedK)
double * getMuY(double *theta, int K)
struct o2::mch::SplineCoef SplineCoef_t
const double * getConstMuAndW(const double *theta, int K)
void printTheta(const char *str, double meanCharge, const double *theta, int K)
void compute2DPadIntegrals(const double *xInf, const double *xSup, const double *yInf, const double *ySup, int N, int chamberId, double Integrals[])
void printXYdXY(const char *str, const double *xyDxy, int NMax, int N, const double *val1, const double *val2)
double * getDX(double *xyDxy, int N)
bool checkIntegrals(const double *xInf, const double *xSup, const double *yInf, const double *ySup, const double *integralsToCheck, int chId, int N)
CompressedPads_t * compressPads(const double *xInf, const double *xSup, const double *yInf, const double *ySup, int N)
void computeFastCij(const Pads &pads, const Pads &pixel, double Cij[])
const double * getConstDX(const double *xyDxy, int N)
void splineMathiesonPrimitive(const double *x, int N, int axe, int chamberId, double *mPrimitive)
double * getX(double *xyDxy, int N)
double * getY(double *xyDxy, int N)
void compute1DPadIntegrals(const double *xyInf, const double *xySup, int N, double xy0, int axe, int chamberId, double *integrals)
double * getYSup(double *xyInfSup, int N)
void maskedCopyXYdXY(const double *xyDxy, int nxyDxy, const Mask_t *mask, int nMask, double *xyDxyMasked, int nxyDxyMasked)
double * getYInf(double *xyInfSup, int N)
const double * getConstVarY(const double *theta, int K)
void computeCij(const Pads &pads, const Pads &pixel, double Cij[])
void copyTheta(const double *theta0, int K0, double *theta, int K1, int K)
double * getMuAndW(double *theta, int K)
void initSplineMathiesonPrimitive()
Definition mathieson.cxx:94
SplineCoef * splineCoef[2][2]
Definition mathieson.cxx:49
const double * getConstW(const double *theta, int K)
double * getVarX(double *theta, int K)
void compute2DMathiesonMixturePadIntegrals(const double *xyInfSup0, const double *theta, int N, int K, int chamberId, double Integrals[])
void computeCompressed2DPadIntegrals(CompressedPads_t *compressedPads, double xShift, double yShift, int N, int chamberId, double Integrals[])
void checkCij(const Pads &pads, const Pads &pixels, const double *checkCij, int mode)
void xyDxyToxyInfSup(const double *xyDxy, int nxyDxy, double *xyInfSup)
const double * getConstDY(const double *xyDxy, int N)
double * getMuX(double *theta, int K)
void copyXYdXY(const double *xyDxy0, int N0, double *xyDxy, int N1, int N)
double * getXSup(double *xyInfSup, int N)
double * getW(double *theta, int K)
const double * getConstYInf(const double *xyInfSup, int N)
const double * getConstY(const double *xyDxy, int N)
const double * getConstX(const double *xyDxy, int N)
const double * getConstMuX(const double *theta, int K)
void deleteCompressedPads(CompressedPads_t *compressedPads)
double * getVarY(double *theta, int K)
double * getDY(double *xyDxy, int N)
const double * getConstXSup(const double *xyInfSup, int N)
const double * getConstMuY(const double *theta, int K)
void compute1DMathieson(const double *xy, int N, int axe, int chamberId, double mathieson[])
const double * getConstVarX(const double *theta, int K)
void mathiesonPrimitive(const double *xy, int N, int axe, int chamberId, double mPrimitive[])
void computeSplineCoef(const double *xy, double xyStep, const double *f, int N, double leftDerivative, double rightDerivative, SplineCoef *splineCoef)
double * getXInf(double *xyInfSup, int N)
const double * getConstYSup(const double *xyInfSup, int N)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
const std::string str