Project
Loading...
Searching...
No Matches
TPCMShapeCorrection.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
14
15#ifndef ALICEO2_TPC_TPCMSHAPECORRECTION
16#define ALICEO2_TPC_TPCMSHAPECORRECTION
17
18#include "DataFormatsTPC/Defs.h"
19#include <vector>
20
21class TTree;
22
23namespace o2::tpc
24{
25
29 void addValue(float potential, float z)
30 {
31 mPotential.emplace_back(potential);
32 mZPosition.emplace_back(z);
33 }
34 std::vector<float> mPotential;
35 std::vector<float> mZPosition;
37};
38
40struct TPCMShape {
42 double getStartTimeMS() const { return mTimeMS.front(); }
43
45 double getEndTimeMS() const { return mTimeMS.back(); }
46
49 {
50 mTimeMS.emplace_back(time);
51 mBoundaryPotentialIFC.emplace_back(pot);
52 }
53
54 std::vector<double> mTimeMS;
55 std::vector<BoundaryPotentialIFC> mBoundaryPotentialIFC;
56 int mZ{129};
57 int mR{129};
58 int mPhi{5};
59 int mBField{5};
61};
62
63/*
64Class for storing the scalers (obtained from DCAs) which are used to correct for the M-shape distortions
65*/
66
68{
69 public:
72
74 void setRun(int run) { mRun = run; }
75
79 void dumpToFile(const char* file, const char* name);
80
84 void dumpToFileSlices(const char* file, const char* name, int nSlices);
85
89 void loadFromFile(const char* inpf, const char* name);
90
92 void setFromTree(TTree& tpcMShapeTree);
93
95 float setMaxDeltaTimeMS(float deltaTMS) { return mMaxDeltaTimeMS = deltaTMS; }
96
98 void setMShapes(const TPCMShape& mshapes) { mMShapes = mshapes; }
99
101 int getRun() const { return mRun; }
102
105 BoundaryPotentialIFC getBoundaryPotential(const double timestamp) const;
106
108 float getMaxDeltaTimeMS() const { return mMaxDeltaTimeMS; }
109
111 const auto& getMShapes() const { return mMShapes; }
112
113 private:
114 int mRun{};
115 float mMaxDeltaTimeMS = 50;
116 TPCMShape mMShapes;
117
118 ClassDefNV(TPCMShapeCorrection, 1);
119};
120
121} // namespace o2::tpc
122#endif
int16_t time
Definition RawEventData.h:4
TPCMShapeCorrection()=default
default constructor
void loadFromFile(const char *inpf, const char *name)
float setMaxDeltaTimeMS(float deltaTMS)
set maximum delta time when searching for nearest boundary potential
void dumpToFileSlices(const char *file, const char *name, int nSlices)
void setMShapes(const TPCMShape &mshapes)
adding M-shapes
void dumpToFile(const char *file, const char *name)
BoundaryPotentialIFC getBoundaryPotential(const double timestamp) const
void setFromTree(TTree &tpcMShapeTree)
set this object from input tree
GLuint const GLchar * name
Definition glcorearb.h:781
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
Global TPC definitions and constants.
Definition SimTraits.h:167
arbitrary boundary potential at the IFC
ClassDefNV(BoundaryPotentialIFC, 1)
std::vector< float > mPotential
boundary potential
void addValue(float potential, float z)
add boundary potential at given z coordinate
std::vector< float > mZPosition
z-position of the delta potential
struct containing all M-Shape boundary potentials
double getEndTimeMS() const
get time of first stored boundary potential
void addBoundaryPotentialIFC(const BoundaryPotentialIFC &pot, double time)
adding boundary potential for given timestamp
ClassDefNV(TPCMShape, 1)
double getStartTimeMS() const
get time of last stored boundary potential
std::vector< BoundaryPotentialIFC > mBoundaryPotentialIFC
definition of boundary potential
int mR
number of vertices for boundary potential in radial direction
std::vector< double > mTimeMS
time of the boundary potential
int mPhi
number of vertices for boundary potential in phi direction
int mZ
number of vertices for boundary potential in z direction