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 SetSpecialPhysicsCuts() override;
150
151 void SetGeoFileName(const TString file) { mGeoFileName = file; }
152 const TString& GetGeoFileName() const { return mGeoFileName; }
153
154 private:
155 int mHitCounter = 0;
156 int mElectronCounter = 0;
157 int mStepCounter = 0;
158 double mLastReferenceR = 0;
159 ElementalHit mHitLast{};
160 HitGroup* mCurrentGroup = nullptr;
161 int mOldTrackId = -1;
162 int mOldSectorId = -1;
163 int mGroupCounter = 0;
164
166 virtual void CreateMaterials();
167
170 void GeantHack();
171
173 void LoadGeometryFromFile();
175 void ConstructTPCGeometry();
176
178 void defineSensitiveVolumes();
179
180 // needed by base implementation
181 bool setHits(Int_t iColl, std::vector<HitGroup>* ptr)
182 {
183 if (iColl >= 0 && iColl < Sector::MAXSECTOR) {
184 mHitsPerSectorCollection[iColl] = ptr;
185 // more entries to set?
186 if (iColl < Sector::MAXSECTOR - 1) {
187 return true;
188 }
189 }
190 return false;
191 }
192
194 std::vector<HitGroup>* mHitsPerSectorCollection[Sector::MAXSECTOR];
195
196 TString mGeoFileName;
197 // size_t mEventNr; //!< current event number
198 // Events are not successive in MT mode
199
201 Detector(const Detector& rhs);
202 Detector& operator=(const Detector&);
203
204 template <typename Det>
205 friend class o2::base::DetImpl;
206 ClassDefOverride(Detector, 1);
207};
208
209} // namespace tpc
210} // namespace o2
211
212#ifdef USESHM
213namespace o2
214{
215namespace base
216{
217template <>
218struct UseShm<o2::tpc::Detector> {
219 static constexpr bool value = true;
220};
221} // namespace base
222} // namespace o2
223#endif
224
225#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:152
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:151
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 ...