Project
Loading...
Searching...
No Matches
ElectronTransport.cxx
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
18
19#include <cmath>
20
21using namespace o2::tpc;
22using namespace o2::math_utils;
23
24ElectronTransport::ElectronTransport(TRandom* rng) : mRandomGaus(RandomRing<>::RandomType::Gaus, rng), mRandomFlat(RandomRing<>::RandomType::Flat, rng)
25{
27}
28
30{
31 mRandomGaus.setRandomPosition(rng);
32 mRandomFlat.setRandomPosition(rng);
33}
34
36{
37 mGasParam = &(ParameterGas::Instance());
38 mDetParam = &(ParameterDetector::Instance());
39 mVDrift = vdrift > 0 ? vdrift : mGasParam->DriftV;
40}
41
43{
45 float driftl = mDetParam->TPClength - std::abs(posEle.Z());
46 if (driftl < 0.01) {
47 driftl = 0.01;
48 }
49 driftl = std::sqrt(driftl);
50 const float sigT = driftl * mGasParam->DiffT;
51 const float sigL = driftl * mGasParam->DiffL;
52
55 GlobalPosition3D posEleDiffusion((mRandomGaus.getNextValue() * sigT) + posEle.X(),
56 (mRandomGaus.getNextValue() * sigT) + posEle.Y(),
57 (mRandomGaus.getNextValue() * sigL) + posEle.Z());
58
62
63 if (posEle.Z() / posEleDiffusion.Z() < 0.f) {
64 driftTime = getDriftTime(posEleDiffusion.Z(), -1.f);
65 posEleDiffusion.SetZ(posEle.Z());
66
67 } else {
68 driftTime = getDriftTime(posEleDiffusion.Z());
69 }
70
71 return posEleDiffusion;
72}
73
75{
77 float driftl = mDetParam->TPClength - std::abs(posEle.Z());
78 if (driftl < 0.01) {
79 driftl = 0.01;
80 }
81 driftl = std::sqrt(driftl);
82
84 const float threeSigmaT = 3.f * driftl * mGasParam->DiffT;
85
86 auto& mapper = Mapper::instance();
87 return mapper.isOutOfSector(posEle, sector, threeSigmaT);
88}
Simple interface to the CDB manager.
Definition of the electron transport.
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
void setRandomRingPositions(TRandom &rng)
Move the random rings to new positions drawn from rng.
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(TRandom *rng=nullptr)
float getDriftTime(float zPos, float signChange=1.f) const
GlobalPosition3D getElectronDrift(GlobalPosition3D posEle, float &driftTime)
static Mapper & instance(const std::string mappingDir="")
Definition Mapper.h:44
Global TPC definitions and constants.
math_utils::Point3D< float > GlobalPosition3D
Definition Defs.h:110
float TPClength
Length of the TPC [cm].
float DiffL
Longitudinal diffusion [sqrt(cm)].
float DiffT
Transverse diffusion [sqrt(cm)].
float DriftV
Drift velocity [cm/us].