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_HMPID_DETECTOR_H_
13#define ALICEO2_HMPID_DETECTOR_H_
14
15#include <vector>
17#include "DataFormatsHMP/Hit.h"
18
19class TGeoVolume;
20class TGeoHMatrix;
21
22namespace o2
23{
24namespace hmpid
25{
26class Detector : public o2::base::DetImpl<Detector>
27{
28 public:
29 Detector(Bool_t active = true);
30 ~Detector() override = default;
31
32 std::vector<o2::hmpid::HitType>* getHits(int iColl) const
33 {
34 if (iColl == 0) {
35 return mHits;
36 }
37 return nullptr;
38 }
39
40 void InitializeO2Detector() override;
41 bool isMTSafe() const override { return true; }
42 bool ProcessHits(FairVolume* v) override;
43 o2::hmpid::HitType* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId);
44 void GenFee(float qtot);
45 Bool_t IsLostByFresnel();
46 float Fresnel(float ene, float pdoti, Bool_t pola);
47 void Register() override;
48 void Reset() override;
49 // void AddAlignableVolumes() const;
50 void IdealPosition(int iCh, TGeoHMatrix* pMatrix);
51 void IdealPositionCradle(int iCh, TGeoHMatrix* pMatrix);
52 void createMaterials();
53 void ConstructGeometry() override;
54 void ConstructOpGeometry() override;
56 void EndOfEvent() override { Reset(); }
57
58 // for the geometry sub-parts
59 TGeoVolume* createAbsorber(int chamber, float tickness);
60 TGeoVolume* createChamber(int number);
61 TGeoVolume* CreateCradle();
62 TGeoVolume* CradleBaseVolume(TGeoMedium* med, double l[7], const char* name);
63
64 private:
65 // copy constructor for CloneModule
66 Detector(const Detector&);
67
68 std::vector<o2::hmpid::HitType>* mHits = nullptr;
69 enum EMedia {
70 kAir = 1,
71 kRoha = 2,
72 kSiO2 = 3,
73 kC6F14 = 4,
74 kCH4 = 5,
75 kCsI = 6,
76 kAl = 7,
77 kCu = 8,
78 kW = 9,
79 kNeo = 10,
80 kAr = 11
81 };
82
83 std::vector<TGeoVolume*> mSensitiveVolumes;
84
85 // Define volume IDs
86 int mHpad0VolID = -1;
87 int mHpad1VolID = -1;
88 int mHpad2VolID = -1;
89 int mHpad3VolID = -1;
90 int mHpad4VolID = -1;
91 int mHpad5VolID = -1;
92 int mHpad6VolID = -1;
93
94 int mHcel0VolID = -1;
95 int mHcel1VolID = -1;
96 int mHcel2VolID = -1;
97 int mHcel3VolID = -1;
98 int mHcel4VolID = -1;
99 int mHcel5VolID = -1;
100 int mHcel6VolID = -1;
101
102 // state of a charged-particle hit being built across steps in ProcessHits
103 Float_t mMipEloss = 0;
104 Double_t mMipEntry[3] = {0, 0, 0};
105
106 template <typename Det>
107 friend class o2::base::DetImpl;
108 ClassDefOverride(Detector, 1);
109};
110
111} // end namespace hmpid
112} // end namespace o2
113
114// enable shared mem for HMPID
115#ifdef USESHM
116namespace o2
117{
118namespace base
119{
120template <>
121struct UseShm<o2::hmpid::Detector> {
122 static constexpr bool value = true;
123};
124} // namespace base
125} // namespace o2
126#endif
127
128#endif /* ALICEO2_HMPID_DETECTOR_H_ */
Definition of the Detector class.
int16_t time
Definition RawEventData.h:4
Detector()
Default Constructor.
Definition Detector.cxx:36
float Fresnel(float ene, float pdoti, Bool_t pola)
Definition Detector.cxx:306
TGeoVolume * createAbsorber(int chamber, float tickness)
Definition Detector.cxx:541
void Register() override
Definition Detector.cxx:364
o2::hmpid::HitType * AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId)
Definition Detector.cxx:178
void InitializeO2Detector() override
Definition Detector.cxx:49
Bool_t IsLostByFresnel()
Definition Detector.cxx:282
bool ProcessHits(FairVolume *v) override
Definition Detector.cxx:72
TGeoVolume * createChamber(int number)
Definition Detector.cxx:554
void ConstructOpGeometry() override
TGeoVolume * CreateCradle()
Definition Detector.cxx:861
void EndOfEvent() override
Definition Detector.h:56
void GenFee(float qtot)
Definition Detector.cxx:184
void IdealPositionCradle(int iCh, TGeoHMatrix *pMatrix)
Definition Detector.cxx:414
TGeoVolume * CradleBaseVolume(TGeoMedium *med, double l[7], const char *name)
void ConstructGeometry() override
void Reset() override
Definition Detector.cxx:366
void IdealPosition(int iCh, TGeoHMatrix *pMatrix)
Definition Detector.cxx:373
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:41
void defineOpticalProperties()
~Detector() override=default
std::vector< o2::hmpid::HitType > * getHits(int iColl) const
Definition Detector.h:32
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
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 ...