Project
Loading...
Searching...
No Matches
Detector.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
12#ifndef ALICEO2_TRD_DETECTOR_H_
13#define ALICEO2_TRD_DETECTOR_H_
14
15#include <memory>
16#include <vector>
20
21#include "DataFormatsTRD/Hit.h"
23
24class FairVolume;
25
26namespace o2
27{
28namespace trd
29{
30
31class Geometry;
32class TRsim;
33
34class Detector : public o2::base::DetImpl<Detector>
35{
36 public:
37 Detector(Bool_t active = true);
38 ~Detector() override;
39 void InitializeO2Detector() override;
40 bool isMTSafe() const override { return true; }
41 bool ProcessHits(FairVolume* v = nullptr) override;
42 void Register() override;
43 std::vector<Hit>* getHits(int iColl) const
44 {
45 if (iColl == 0) {
46 return mHits;
47 }
48 return nullptr;
49 }
50 void FinishEvent() override;
51 void Reset() override;
52 void EndOfEvent() override;
53 void createMaterials();
54 void ConstructGeometry() override;
56 void addAlignableVolumes() const override;
57
58 private:
60 Detector(const Detector& rhs);
61
62 void InitializeParams();
63
64 // defines/sets-up the sensitive volumes
65 void defineSensitiveVolumes();
66
67 // Fills the volume-id lookup tables below; called once from InitializeO2Detector().
68 void buildVolumeIdTables();
69
70 // What a sensitive volume is, in mRegionByVolId
71 enum Region : int8_t { kNotSensitive = 0,
72 kDrift = 1,
73 kAmplification = 2 };
74
75 // addHit
76 template <typename T>
77 void addHit(T x, T y, T z, T locC, T locR, T locT, T tof, int charge, int trackId, int detId, bool drift = false);
78
79 // Create TR hits
80 void createTRhit(int);
81
82 std::vector<Hit>* mHits = nullptr;
83
84 float mFoilDensity;
85 float mGasNobleFraction;
86 float mGasDensity;
87
88 float mMaxMCStepDef;
89
90 bool mTRon; // Switch for TR simulation
91 TRsim* mTR; // Access to TR simulation
92
93 float mWion; // Ionization potential
94
95 // Energy (eV) from which the charge of the current step is made
96 double ionisationEnergy(float edep) const;
97
98 // Checks once that the gas has the delta-ray cut of the collision tables
99 void checkDeltaRayCut();
100 bool mDeltaRayCutChecked = false;
101
102 std::unique_ptr<IonisationModel> mIonisation;
103 double mIonMinBetaGamma = 0.;
104 double mIonMinEkin = 0.;
105
106 Geometry* mGeom = nullptr;
107
108 // Volume-id lookup tables, resolved once at initialisation so that ProcessHits does
109 // integer indexing instead of an sscanf on a volume name at every step. Volume ids are
110 // small and dense, so a flat vector beats a map here.
111 std::vector<int8_t> mRegionByVolId;
112 std::vector<int8_t> mChamberByVolId;
113 std::vector<int8_t> mSectorByVolId;
114
115 // How far above a sensitive volume the chamber and the supermodule sit. This depends on
116 // how the transport engine represents the hierarchy -- a native-Geant4 conversion flattens
117 // the chamber assembly away -- so it is resolved from the tables on the first hit rather
118 // than hard-coded.
119 int mChamberOffset = -1;
120 int mSectorOffset = -1;
121 // The chamber assemblies have no volume id when the engine collapses assemblies (native
122 // Geant4 via VGM); the chamber is then read from the assembly name the VMC still reports.
123 bool mChamberFromName = false;
124
125 template <typename Det>
126 friend class o2::base::DetImpl;
127 ClassDefOverride(Detector, 1);
128};
129
130template <typename T>
131void Detector::addHit(T x, T y, T z, T locC, T locR, T locT, T tof, int charge, int trackId, int detId, bool drift)
132{
133 mHits->emplace_back(x, y, z, locC, locR, locT, tof, charge, trackId, detId, drift);
134}
135
136} // namespace trd
137} // namespace o2
138
139#ifdef USESHM
140namespace o2
141{
142namespace base
143{
144template <>
145struct UseShm<o2::trd::Detector> {
146 static constexpr bool value = true;
147};
148} // namespace base
149} // namespace o2
150#endif
151#endif
Definition of the Detector class.
int16_t charge
Definition RawEventData.h:5
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h trd
Detector()
Default Constructor.
Definition Detector.cxx:36
~Detector() override
Definition Detector.cxx:57
void InitializeO2Detector() override
Definition Detector.cxx:62
void EndOfEvent() override
Definition Detector.cxx:415
void Register() override
Definition Detector.cxx:392
void ConstructGeometry() override
Definition Detector.cxx:617
void addAlignableVolumes() const override
Add alignable top volumes.
Definition Detector.cxx:643
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:177
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:40
void Reset() override
Definition Detector.cxx:408
std::vector< Hit > * getHits(int iColl) const
Definition Detector.h:43
void FinishEvent() override
Definition Detector.cxx:397
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLint y
Definition glcorearb.h:270
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...