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;
34class ElectronTransport;
35class GEMAmplification;
36
37template <class T>
38class SpaceCharge;
39
40enum class SCDistortionType : int;
41
54
56{
57 public:
59
62
65
66 Digitizer(const Digitizer&) = delete;
67 Digitizer& operator=(const Digitizer&) = delete;
68
70 void init();
71
76 void process(const std::vector<o2::tpc::HitGroup>& hits, const int eventID,
77 const int sourceID = 0);
78
84 void flush(std::vector<o2::tpc::Digit>& digits,
86 std::vector<o2::tpc::CommonMode>& commonModeOutput, bool finalFlush = false);
87
90 void setSector(Sector sec)
91 {
92 mSector = sec;
93 mDigitContainer.reset();
94 }
95
98 void setStartTime(double time);
99
101 void setOutputDigitTimeOffset(double offset) { mOutputDigitTimeOffset = offset; }
102
105 void setEventTime(double time) { mEventTime = time; }
106
109 void setContinuousReadout(bool isContinuous) { mIsContinuous = isContinuous; }
110
113 bool isContinuousReadout() { return mIsContinuous; }
114
121 void setUseSCDistortions(const SCDistortionType& distortionType, const TH3* hisInitialSCDensity);
124 void setUseSCDistortions(SC* spaceCharge);
125
127 void setSCDistortionsDerivative(SC* spaceCharge);
128
132 void setUseSCDistortions(std::string_view finp);
133
134 void setVDrift(float v) { mVDrift = v; }
135 void setTDriftOffset(float t) { mTDriftOffset = t; }
136
137 void setDistortionScaleType(int distortionScaleType) { mDistortionScaleType = distortionScaleType; }
138 int getDistortionScaleType() const { return mDistortionScaleType; }
139 void setLumiScaleFactor();
140 void setMeanLumiDistortions(float meanLumi);
141 void setMeanLumiDistortionsDerivative(float meanLumi);
142
145
148
153 void setUseSectorSeeding(ULong64_t seed);
154
156 void setSeedingTimeframe(ULong64_t timeframe) { mSeedingTimeframe = timeframe; }
157
160
162 void setFlushDebugStreamer(bool flush) { mFlushDebugStreamer = flush; }
163
164 private:
166 void initSectorSeeding();
167
168 ElectronTransport& electronTransport();
169 GEMAmplification& gemAmplification();
170 SAMPAProcessing& sampaProcessing();
171
172 std::unique_ptr<ElectronTransport> mElectronTransport;
173 std::unique_ptr<GEMAmplification> mGEMAmplification;
174 std::unique_ptr<SAMPAProcessing> mSAMPAProcessing;
175 ULong64_t mSeed = 0;
176 ULong64_t mSeedingTimeframe = 0;
177 bool mUseSectorSeeding = false;
178 bool mFlushDebugStreamer = true;
179
180 DigitContainer mDigitContainer;
181 std::vector<float> mSignalArray;
182 std::unique_ptr<SC> mSpaceChargeOwned;
183 SC* mSpaceCharge = nullptr;
184 SC* mSpaceChargeDer = nullptr;
185 Sector mSector = -1;
186 double mEventTime = 0.f;
187 double mOutputDigitTimeOffset = 0;
188 float mVDrift = 0;
189 float mTDriftOffset = 0;
190 bool mIsContinuous;
191 bool mUseSCDistortions = false;
192 int mDistortionScaleType = 0;
193 float mLumiScaleFactor = 0;
194 bool mUseScaledDistortions = false;
195 ClassDefNV(Digitizer, 4);
196};
197} // namespace tpc
198} // namespace o2
199
200#endif // ALICEO2_TPC_Digitizer_H_
Definition of the Digit Container.
int16_t time
Definition RawEventData.h:4
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
Timeframe settings Average distance in cm of events merged into timeframe
std::vector< o2::MCCompLabel > labels
Class for TPC Point.
A container to hold and manage MC truth information/labels.
void reset()
Reset the container.
void setSeedingTimeframe(ULong64_t timeframe)
Set the timeframe identifier that enters the sector seeding.
Definition Digitizer.h:156
void setMeanLumiDistortions(float meanLumi)
void setUseSCDistortions(const SCDistortionType &distortionType, const TH3 *hisInitialSCDensity)
void setMeanLumiDistortionsDerivative(float meanLumi)
void setDistortionScaleType(int distortionScaleType)
Definition Digitizer.h:137
void flush(std::vector< o2::tpc::Digit > &digits, o2::dataformats::MCTruthContainer< o2::MCCompLabel > &labels, std::vector< o2::tpc::CommonMode > &commonModeOutput, bool finalFlush=false)
void setUseSectorSeeding(ULong64_t seed)
Definition Digitizer.cxx:85
void setSector(Sector sec)
Definition Digitizer.h:90
void setSCDistortionsFrom(const Digitizer &other)
Use the distortion maps and scaling of another digitizer, which keeps ownership of the maps.
void setOutputDigitTimeOffset(double offset)
Set mOutputDigitTimeOffset.
Definition Digitizer.h:101
void setVDrift(float v)
Definition Digitizer.h:134
Digitizer(const Digitizer &)=delete
void setSCDistortionsDerivative(SC *spaceCharge)
Digitizer & operator=(const Digitizer &)=delete
int getDistortionScaleType() const
Definition Digitizer.h:138
void setStartTime(double time)
void recalculateDistortions()
in case of scaled distortions, the distortions can be recalculated to ensure consistent distortions a...
void setFlushDebugStreamer(bool flush)
Whether flush() also flushes the process-wide debug streamer.
Definition Digitizer.h:162
void setContinuousReadout(bool isContinuous)
Definition Digitizer.h:109
~Digitizer()
Destructor.
void setEventTime(double time)
Definition Digitizer.h:105
void setSectorSeedingFrom(Digitizer &other)
Use copies of the sector-seeding random rings of another digitizer, which fills them if needed.
void init()
Initializer.
Digitizer()
Default constructor.
void setTDriftOffset(float t)
Definition Digitizer.h:135
bool isContinuousReadout()
Definition Digitizer.h:113
const GLdouble * v
Definition glcorearb.h:832
GLintptr offset
Definition glcorearb.h:660
uint8_t int statusCode int
SCDistortionType
Enumerator for setting the space-charge distortion mode.
Definition SpaceCharge.h:57
std::vector< Digit > DigitContainer
Definition Digitizer.h:46
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other
std::vector< Digit > digits