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_TRK_DETECTOR_H
13#define ALICEO2_TRK_DETECTOR_H
14
17
22
23#include <TLorentzVector.h>
24#include <TString.h>
25
26namespace o2
27{
28namespace trk
29{
30
31class Detector : public o2::base::DetImpl<Detector>
32{
33 public:
34 static constexpr Int_t mNumberOfVolumes = 44;
35 static constexpr Int_t mNumberOfVolumesVD = 36;
36
37 Detector(bool active);
40
41 // Factory method
43 {
44 return new Detector(active);
45 }
46
47 void ConstructGeometry() override;
48
49 o2::itsmft::Hit* addHit(int trackID, int detID, const TVector3& startPos, const TVector3& endPos,
50 const TVector3& startMom, double startE, double endTime, double eLoss,
51 unsigned char startStatus, unsigned char endStatus);
52
53 // Mandatory overrides
54 void BeginPrimary() override { ; }
55 void FinishPrimary() override { ; }
56 void InitializeO2Detector() override;
57 void PostTrack() override { ; }
58 void PreTrack() override { ; }
59 bool ProcessHits(FairVolume* v = nullptr) override;
60 void EndOfEvent() override;
61 void Register() override;
62 void Reset() override;
63
64 // Custom memer functions
65 std::vector<o2::itsmft::Hit>* getHits(int iColl) const
66 {
67 if (!iColl) {
68 return mHits;
69 }
70 return nullptr;
71 }
72
73 void configDefault();
74 void buildTRKNewVacuumVessel();
75 void configFromFile(std::string fileName = "alice3_TRK_layout.txt");
76 void configToFile(std::string fileName = "alice3_TRK_layout.txt");
77
78 void configServices(); // To get special conf from CLI options
80 void createGeometry();
81
82 private:
83 // Transient data about track passing the sensor
84 struct TrackData {
85 bool mHitStarted; // hit creation started
86 unsigned char mTrkStatusStart; // track status flag
87 TLorentzVector mPositionStart; // position at entrance
88 TLorentzVector mMomentumStart; // momentum
89 double mEnergyLoss; // energy loss
90 } mTrackData;
91 GeometryTGeo* mGeometryTGeo;
92 std::vector<o2::itsmft::Hit>* mHits; // ITSMFT ones for the moment
93 std::vector<TRKLayer> mLayers;
94 TRKServices mServices; // Houses the services of the TRK, but not the Iris tracker
95 std::vector<TRKPetalCase> mPetalCases; // Houses the Iris tracker and its services. Created fully in the beam pipe
96
97 std::vector<std::string> mFirstOrLastLayers; // Names of the first or last layers
98 bool InsideFirstOrLastLayer(std::string layerName);
99
100 void defineSensitiveVolumes();
101
102 protected:
103 std::vector<int> mSensorID;
104 std::vector<TString> mSensorName;
105
106 public:
107 static constexpr Int_t sNumberVDPetalCases = 4;
108 int getNumberOfLayers() const { return mLayers.size(); }
109 int getNumberOfLayersVD() const { return mPetalCases[0].mPetalLayers.size(); }
110 int getNumberOfDisksVD() const { return mPetalCases[0].mPetalDisks.size(); }
111
112 void Print(FairVolume* vol, int volume, int subDetID, int layer, int stave, int halfstave, int chipID) const;
113
114 template <typename Det>
115 friend class o2::base::DetImpl;
117};
118} // namespace trk
119} // namespace o2
120
121#ifdef USESHM
122namespace o2
123{
124namespace base
125{
126template <>
127struct UseShm<o2::trk::Detector> {
128 static constexpr bool value = true;
129};
130} // namespace base
131} // namespace o2
132#endif
133#endif
Definition of the Detector class.
Definition of the ITSMFT Hit class.
Detector()
Default Constructor.
Definition Detector.cxx:36
void Reset() override
void Register() override
ClassDefOverride(Detector, 1)
void ConstructGeometry() override
void BeginPrimary() override
Definition Detector.h:54
o2::itsmft::Hit * addHit(int trackID, int detID, const TVector3 &startPos, const TVector3 &endPos, const TVector3 &startMom, double startE, double endTime, double eLoss, unsigned char startStatus, unsigned char endStatus)
Definition Detector.cxx:471
void InitializeO2Detector() override
void FinishPrimary() override
Definition Detector.h:55
static constexpr Int_t sNumberVDPetalCases
layer names
Definition Detector.h:107
static constexpr Int_t mNumberOfVolumesVD
hardcoded for the current geometry = 8 MLOT layers + 36 volumes in the VD. TODO: automatize or change...
Definition Detector.h:35
void PostTrack() override
Definition Detector.h:57
static constexpr Int_t mNumberOfVolumes
Definition Detector.h:34
std::vector< o2::itsmft::Hit > * getHits(int iColl) const
Definition Detector.h:65
void EndOfEvent() override
static o2::base::Detector * create(bool active)
Definition Detector.h:42
void PreTrack() override
Definition Detector.h:58
int getNumberOfLayers() const
Number of VD petals.
Definition Detector.h:108
int getNumberOfLayersVD() const
Number of TRK layers.
Definition Detector.h:109
bool ProcessHits(FairVolume *v=nullptr) override
std::vector< int > mSensorID
Definition Detector.h:103
int getNumberOfDisksVD() const
Definition Detector.h:110
std::vector< TString > mSensorName
layer identifiers
Definition Detector.h:104
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...