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