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() : mRandomGaus(), mRandomFlat(RandomRing<>::RandomType::Flat)
25{
26 updateParameters();
27}
28
30{
31 mGasParam = &(ParameterGas::Instance());
32 mDetParam = &(ParameterDetector::Instance());
33 mVDrift = vdrift > 0 ? vdrift : mGasParam->DriftV;
34}
35
37{
39 float driftl = mDetParam->TPClength - std::abs(posEle.Z());
40 if (driftl < 0.01) {
41 driftl = 0.01;
42 }
43 driftl = std::sqrt(driftl);
44 const float sigT = driftl * mGasParam->DiffT;
45 const float sigL = driftl * mGasParam->DiffL;
46
49 GlobalPosition3D posEleDiffusion((mRandomGaus.getNextValue() * sigT) + posEle.X(),
50 (mRandomGaus.getNextValue() * sigT) + posEle.Y(),
51 (mRandomGaus.getNextValue() * sigL) + posEle.Z());
52
56
57 if (posEle.Z() / posEleDiffusion.Z() < 0.f) {
58 driftTime = getDriftTime(posEleDiffusion.Z(), -1.f);
59 posEleDiffusion.SetZ(posEle.Z());
60
61 } else {
62 driftTime = getDriftTime(posEleDiffusion.Z());
63 }
64
65 return posEleDiffusion;
66}
67
69{
71 float driftl = mDetParam->TPClength - std::abs(posEle.Z());
72 if (driftl < 0.01) {
73 driftl = 0.01;
74 }
75 driftl = std::sqrt(driftl);
76
78 const float threeSigmaT = 3.f * driftl * mGasParam->DiffT;
79
80 auto& mapper = Mapper::instance();
81 return mapper.isOutOfSector(posEle, sector, threeSigmaT);
82}
Simple interface to the CDB manager.
Definition of the electron transport.
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
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.
Definition SimTraits.h:167
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].