Project
Loading...
Searching...
No Matches
ElectronTransport.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_ElectronTransport_H_
17#define ALICEO2_TPC_ElectronTransport_H_
18
21
22#include "TPCBase/Mapper.h"
24
25namespace o2
26{
27namespace tpc
28{
29
34
36{
37 public:
39 {
40 static ElectronTransport electronTransport;
41 return electronTransport;
42 }
43
46 explicit ElectronTransport(TRandom* rng = nullptr);
47
49 ~ElectronTransport() = default;
50
52 void setRandomRingPositions(TRandom& rng);
53
55 void updateParameters(float vdrift = 0);
56
61 GlobalPosition3D getElectronDrift(GlobalPosition3D posEle, float& driftTime);
62
68
72 bool isElectronAttachment(float driftTime);
73
79 float getDriftTime(float zPos, float signChange = 1.f) const;
80
81 private:
84 math_utils::RandomRing<> mRandomGaus;
86 math_utils::RandomRing<> mRandomFlat;
87 const ParameterDetector* mDetParam;
88 const ParameterGas* mGasParam;
89 float mVDrift = 0;
90};
91
92inline bool ElectronTransport::isElectronAttachment(float driftTime)
93{
94 if (mRandomFlat.getNextValue() < mGasParam->AttCoeff * mGasParam->OxygenCont * driftTime) {
95 return true;
96 } else {
97 return false;
98 }
99}
100
101inline float ElectronTransport::getDriftTime(float zPos, float signChange) const
102{
103 float time = (mDetParam->TPClength - signChange * std::abs(zPos)) / mVDrift;
104 return time;
105}
106} // namespace tpc
107} // namespace o2
108
109#endif // ALICEO2_TPC_ElectronTransport_H_
int16_t time
Definition RawEventData.h:4
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
Definition of the parameter class for the detector.
Definition of the parameter class for the detector gas.
void setRandomRingPositions(TRandom &rng)
Move the random rings to new positions drawn from rng.
bool isElectronAttachment(float driftTime)
void updateParameters(float vdrift=0)
Update the OCDB parameters cached in the class. To be called once per event.
bool isCompletelyOutOfSectorCoarseElectronDrift(GlobalPosition3D posEle, const Sector &sector) const
~ElectronTransport()=default
Destructor.
float getDriftTime(float zPos, float signChange=1.f) const
GlobalPosition3D getElectronDrift(GlobalPosition3D posEle, float &driftTime)
static ElectronTransport & instance()
math_utils::Point3D< float > GlobalPosition3D
Definition Defs.h:110
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
float TPClength
Length of the TPC [cm].
float OxygenCont
Oxygen content [1E6 ppm].
float AttCoeff
Attachement coefficient [1/m].