Project
Loading...
Searching...
No Matches
Digitizer.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
15
16#ifndef ALICEO2_TPC_Digitizer_H_
17#define ALICEO2_TPC_Digitizer_H_
18
20#include "TPCSimulation/Point.h"
21#include "TPCBase/Mapper.h"
22
23#include <cmath>
24
25class TTree;
26class TH3;
27
28namespace o2
29{
30namespace tpc
31{
32
33class DigitContainer;
34
35template <class T>
36class SpaceCharge;
37
38enum class SCDistortionType : int;
39
52
54{
55 public:
57
60
63
64 Digitizer(const Digitizer&) = delete;
65 Digitizer& operator=(const Digitizer&) = delete;
66
68 void init();
69
74 void process(const std::vector<o2::tpc::HitGroup>& hits, const int eventID,
75 const int sourceID = 0);
76
82 void flush(std::vector<o2::tpc::Digit>& digits,
84 std::vector<o2::tpc::CommonMode>& commonModeOutput, bool finalFlush = false);
85
88 void setSector(Sector sec)
89 {
90 mSector = sec;
91 mDigitContainer.reset();
92 }
93
96 void setStartTime(double time);
97
99 void setOutputDigitTimeOffset(double offset) { mOutputDigitTimeOffset = offset; }
100
103 void setEventTime(double time) { mEventTime = time; }
104
107 void setContinuousReadout(bool isContinuous) { mIsContinuous = isContinuous; }
108
111 bool isContinuousReadout() { return mIsContinuous; }
112
119 void setUseSCDistortions(const SCDistortionType& distortionType, const TH3* hisInitialSCDensity);
122 void setUseSCDistortions(SC* spaceCharge);
123
125 void setSCDistortionsDerivative(SC* spaceCharge);
126
130 void setUseSCDistortions(std::string_view finp);
131
132 void setVDrift(float v) { mVDrift = v; }
133 void setTDriftOffset(float t) { mTDriftOffset = t; }
134
135 void setDistortionScaleType(int distortionScaleType) { mDistortionScaleType = distortionScaleType; }
136 int getDistortionScaleType() const { return mDistortionScaleType; }
137 void setLumiScaleFactor();
138 void setMeanLumiDistortions(float meanLumi);
139 void setMeanLumiDistortionsDerivative(float meanLumi);
140
143
144 private:
145 DigitContainer mDigitContainer;
146 std::unique_ptr<SC> mSpaceCharge;
147 std::unique_ptr<SC> mSpaceChargeDer;
148 Sector mSector = -1;
149 double mEventTime = 0.f;
150 double mOutputDigitTimeOffset = 0;
151 float mVDrift = 0;
152 float mTDriftOffset = 0;
153 bool mIsContinuous;
154 bool mUseSCDistortions = false;
155 int mDistortionScaleType = 0;
156 float mLumiScaleFactor = 0;
157 bool mUseScaledDistortions = false;
158 ClassDefNV(Digitizer, 3);
159};
160} // namespace tpc
161} // namespace o2
162
163#endif // ALICEO2_TPC_Digitizer_H_
Definition of the Digit Container.
int16_t time
Definition RawEventData.h:4
Class for TPC Point.
A container to hold and manage MC truth information/labels.
void reset()
Reset the container.
void setMeanLumiDistortions(float meanLumi)
void setUseSCDistortions(const SCDistortionType &distortionType, const TH3 *hisInitialSCDensity)
void setMeanLumiDistortionsDerivative(float meanLumi)
void setDistortionScaleType(int distortionScaleType)
Definition Digitizer.h:135
void flush(std::vector< o2::tpc::Digit > &digits, o2::dataformats::MCTruthContainer< o2::MCCompLabel > &labels, std::vector< o2::tpc::CommonMode > &commonModeOutput, bool finalFlush=false)
void setSector(Sector sec)
Definition Digitizer.h:88
void setOutputDigitTimeOffset(double offset)
Set mOutputDigitTimeOffset.
Definition Digitizer.h:99
void setVDrift(float v)
Definition Digitizer.h:132
Digitizer(const Digitizer &)=delete
void setSCDistortionsDerivative(SC *spaceCharge)
Digitizer & operator=(const Digitizer &)=delete
int getDistortionScaleType() const
Definition Digitizer.h:136
void setStartTime(double time)
void recalculateDistortions()
in case of scaled distortions, the distortions can be recalculated to ensure consistent distortions a...
void setContinuousReadout(bool isContinuous)
Definition Digitizer.h:107
~Digitizer()
Destructor.
void setEventTime(double time)
Definition Digitizer.h:103
void init()
Initializer.
Definition Digitizer.cxx:42
Digitizer()
Default constructor.
void setTDriftOffset(float t)
Definition Digitizer.h:133
bool isContinuousReadout()
Definition Digitizer.h:111
const GLdouble * v
Definition glcorearb.h:832
GLintptr offset
Definition glcorearb.h:660
SCDistortionType
Enumerator for setting the space-charge distortion mode.
Definition SpaceCharge.h:57
std::vector< Digit > DigitContainer
Definition Digitizer.h:43
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Digit > digits