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_TPC_Detector_H_
13#define AliceO2_TPC_Detector_H_
14
15#include "DetectorsBase/Detector.h" // for Detector
16#include "Rtypes.h" // for Int_t, Double32_t, Double_t, Bool_t, etc
17#include "TLorentzVector.h" // for TLorentzVector
18#include "TString.h"
19
20#include "TPCSimulation/Point.h"
21#include "TPCBase/Sector.h"
23
24class FairVolume; // lines 10-10
25
26namespace o2
27{
28namespace tpc
29{
30
31class Detector : public o2::base::DetImpl<Detector>
32{
33
34 public:
36 enum EMedium {
37 kAir = 0,
40 kCO2 = 3,
42 kAl = 4,
44 kNomex = 6,
46 kMylar = 8,
51 kEpoxy = 13,
52 kCu = 14,
53 kSi = 15,
54 kG10 = 16,
56 kSteel = 18,
57 kPeek = 19,
59 kWater = 22,
60 kBrass = 23,
62 kEpoxy1 = 25,
63 kAlumina1 = 26
64 };
69 Detector(Bool_t Active);
70
71 // Factory method
73 {
74 return new Detector(active);
75 }
76
79
81 ~Detector() override;
82
84 void InitializeO2Detector() override;
85 bool isMTSafe() const override { return true; }
86
90 // virtual Bool_t ProcessHitsOrig( FairVolume* v=0);
91 Bool_t ProcessHits(FairVolume* v = nullptr) override;
92
94 void Register() override;
95
97 std::vector<HitGroup>* getHits(Int_t iColl) const
98 {
99 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
100 return mHitsPerSectorCollection[iColl];
101 }
102 return nullptr;
103 }
104
106 std::string getHitBranchNames(int coll) const override;
107
109 void Reset() override;
110
112 void ConstructGeometry() override;
113
117 Point* addHit(float x, float y, float z, float time, float nElectrons, float trackID, float detID);
118
120
125 template <typename T>
126 static T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
127 {
128 return o2::tpc::BetheBlochAleph(bg, kp1, kp2, kp3, kp4, kp5);
129 }
130
137 Double_t Gamma(Double_t k);
138
143 void EndOfEvent() override;
144 void FinishPrimary() override { ; }
145 void FinishRun() override { ; }
146 void BeginPrimary() override { ; }
147 void PostTrack() override { ; }
148 void PreTrack() override { ; }
149
150 void SetSpecialPhysicsCuts() override;
151
152 void SetGeoFileName(const TString file) { mGeoFileName = file; }
153 const TString& GetGeoFileName() const { return mGeoFileName; }
154
155 private:
156 int mHitCounter = 0;
157 int mElectronCounter = 0;
158 int mStepCounter = 0;
159 double mLastReferenceR = 0;
160 ElementalHit mHitLast{};
161 HitGroup* mCurrentGroup = nullptr;
162 int mOldTrackId = -1;
163 int mOldSectorId = -1;
164 int mGroupCounter = 0;
165
167 virtual void CreateMaterials();
168
171 void GeantHack();
172
174 void LoadGeometryFromFile();
176 void ConstructTPCGeometry();
177
179 void defineSensitiveVolumes();
180
181 // needed by base implementation
182 bool setHits(Int_t iColl, std::vector<HitGroup>* ptr)
183 {
184 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
185 mHitsPerSectorCollection[iColl] = ptr;
186 // more entries to set?
187 if (iColl < Sector::MAXSECTOR - 1) {
188 return true;
189 }
190 }
191 return false;
192 }
193
195 std::vector<HitGroup>* mHitsPerSectorCollection[Sector::MAXSECTOR];
196
197 TString mGeoFileName;
198 // size_t mEventNr; //!< current event number
199 // Events are not successive in MT mode
200
202 Detector(const Detector& rhs);
203 Detector& operator=(const Detector&);
204
205 template <typename Det>
206 friend class o2::base::DetImpl;
207 ClassDefOverride(Detector, 1);
208};
209
210} // namespace tpc
211} // namespace o2
212
213#ifdef USESHM
214namespace o2
215{
216namespace base
217{
218template <>
219struct UseShm<o2::tpc::Detector> {
220 static constexpr bool value = true;
221};
222} // namespace base
223} // namespace o2
224#endif
225
226#endif // AliceO2_TPC_Detector_H_
Definition of the Detector class.
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 Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
Class for TPC Point.
TBranch * ptr
Detector & operator=(const Detector &)
Definition Detector.cxx:46
Detector()
Default Constructor.
Definition Detector.cxx:36
void BeginPrimary() override
Definition Detector.h:146
void Reset() override
void ConstructGeometry() override
void PreTrack() override
Definition Detector.h:148
Point * addHit(float x, float y, float z, float time, float nElectrons, float trackID, float detID)
Bool_t ProcessHits(FairVolume *v=nullptr) override
void FinishPrimary() override
Definition Detector.h:144
const TString & GetGeoFileName() const
Definition Detector.h:153
static T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
Copied from AliRoot - should go to someplace else.
Definition Detector.h:126
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:85
~Detector() override
void InitializeO2Detector() override
void PostTrack() override
Definition Detector.h:147
void Register() override
std::vector< HitGroup > * getHits(Int_t iColl) const
Definition Detector.h:97
void FinishRun() override
Definition Detector.h:145
std::string getHitBranchNames(int coll) const override
void EndOfEvent() override
void SetGeoFileName(const TString file)
Definition Detector.h:152
void SetSpecialPhysicsCuts() override
Detector(Bool_t Active)
static o2::base::Detector * create(bool active)
Definition Detector.h:72
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 ...