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
89 // virtual Bool_t ProcessHitsOrig( FairVolume* v=0);
90 Bool_t ProcessHits(FairVolume* v = nullptr) override;
91
93 void Register() override;
94
96 std::vector<HitGroup>* getHits(Int_t iColl) const
97 {
98 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
99 return mHitsPerSectorCollection[iColl];
100 }
101 return nullptr;
102 }
103
105 std::string getHitBranchNames(int coll) const override;
106
108 void Reset() override;
109
111 void ConstructGeometry() override;
112
116 Point* addHit(float x, float y, float z, float time, float nElectrons, float trackID, float detID);
117
119
124 template <typename T>
125 static T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
126 {
127 return o2::tpc::BetheBlochAleph(bg, kp1, kp2, kp3, kp4, kp5);
128 }
129
136 Double_t Gamma(Double_t k);
137
142 void EndOfEvent() override;
143 void FinishPrimary() override { ; }
144 void FinishRun() override { ; }
145 void BeginPrimary() override { ; }
146 void PostTrack() override { ; }
147 void PreTrack() override { ; }
148
149 void SetGeoFileName(const TString file) { mGeoFileName = file; }
150 const TString& GetGeoFileName() const { return mGeoFileName; }
151
152 private:
153 int mHitCounter = 0;
154 int mElectronCounter = 0;
155 int mStepCounter = 0;
156 ElementalHit mHitLast{};
157
159 virtual void CreateMaterials();
160
163 void GeantHack();
164
166 void LoadGeometryFromFile();
168 void ConstructTPCGeometry();
169
171 void defineSensitiveVolumes();
172
173 // needed by base implementation
174 bool setHits(Int_t iColl, std::vector<HitGroup>* ptr)
175 {
176 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
177 mHitsPerSectorCollection[iColl] = ptr;
178 // more entries to set?
179 if (iColl < Sector::MAXSECTOR - 1) {
180 return true;
181 }
182 }
183 return false;
184 }
185
187 std::vector<HitGroup>* mHitsPerSectorCollection[Sector::MAXSECTOR];
188
189 TString mGeoFileName;
190 // size_t mEventNr; //!< current event number
191 // Events are not successive in MT mode
192
194 Detector(const Detector& rhs);
195 Detector& operator=(const Detector&);
196
197 template <typename Det>
198 friend class o2::base::DetImpl;
199 ClassDefOverride(Detector, 1);
200};
201
202} // namespace tpc
203} // namespace o2
204
205#ifdef USESHM
206namespace o2
207{
208namespace base
209{
210template <>
211struct UseShm<o2::tpc::Detector> {
212 static constexpr bool value = true;
213};
214} // namespace base
215} // namespace o2
216#endif
217
218#endif // AliceO2_TPC_Detector_H_
Definition of the Detector class.
int16_t time
Definition RawEventData.h:4
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:145
void Reset() override
void ConstructGeometry() override
void PreTrack() override
Definition Detector.h:147
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:143
const TString & GetGeoFileName() const
Definition Detector.h:150
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:125
~Detector() override
void InitializeO2Detector() override
void PostTrack() override
Definition Detector.h:146
void Register() override
std::vector< HitGroup > * getHits(Int_t iColl) const
Definition Detector.h:96
void FinishRun() override
Definition Detector.h:144
std::string getHitBranchNames(int coll) const override
void EndOfEvent() override
void SetGeoFileName(const TString file)
Definition Detector.h:149
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
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
T T T T kp4
T T T T T kp5
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...