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
45 ~ElectronTransport() = default;
46
48 void updateParameters(float vdrift = 0);
49
54 GlobalPosition3D getElectronDrift(GlobalPosition3D posEle, float& driftTime);
55
61
65 bool isElectronAttachment(float driftTime);
66
72 float getDriftTime(float zPos, float signChange = 1.f) const;
73
74 private:
76
79 math_utils::RandomRing<> mRandomGaus;
81 math_utils::RandomRing<> mRandomFlat;
82 const ParameterDetector* mDetParam;
83 const ParameterGas* mGasParam;
84 float mVDrift = 0;
85};
86
87inline bool ElectronTransport::isElectronAttachment(float driftTime)
88{
89 if (mRandomFlat.getNextValue() < mGasParam->AttCoeff * mGasParam->OxygenCont * driftTime) {
90 return true;
91 } else {
92 return false;
93 }
94}
95
96inline float ElectronTransport::getDriftTime(float zPos, float signChange) const
97{
98 float time = (mDetParam->TPClength - signChange * std::abs(zPos)) / mVDrift;
99 return time;
100}
101} // namespace tpc
102} // namespace o2
103
104#endif // ALICEO2_TPC_ElectronTransport_H_
int16_t time
Definition RawEventData.h:4
Definition of the parameter class for the detector.
Definition of the parameter class for the detector gas.
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()
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].