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);
34 Detector();
35 ~Detector();
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();
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
75 void createMaterials();
76 void createGeometry();
77
78 private:
79 // Transient data about track passing the sensor
80 struct TrackData {
81 bool mHitStarted; // hit creation started
82 unsigned char mTrkStatusStart; // track status flag
83 TLorentzVector mPositionStart; // position at entrance
84 TLorentzVector mMomentumStart; // momentum
85 double mEnergyLoss; // energy loss
86 } mTrackData;
87 GeometryTGeo* mGeometryTGeo;
88 std::vector<o2::itsmft::Hit>* mHits; // ITSMFT ones for the moment
89 std::vector<TRKLayer> mLayers;
90 TRKServices mServices;
91
92 void defineSensitiveVolumes();
93
94 template <typename Det>
95 friend class o2::base::DetImpl;
96 ClassDefOverride(Detector, 1);
97};
98} // namespace trk
99} // namespace o2
100
101#ifdef USESHM
102namespace o2
103{
104namespace base
105{
106template <>
107struct UseShm<o2::trk::Detector> {
108 static constexpr bool value = true;
109};
110} // namespace base
111} // namespace o2
112#endif
113#endif
Definition of the Detector class.
Definition of the ITSMFT Hit class.
void Reset() override
Definition Detector.cxx:280
void Register() override
Definition Detector.cxx:269
void ConstructGeometry() override
Definition Detector.cxx:69
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:372
void InitializeO2Detector() override
Definition Detector.cxx:242
void FinishPrimary() override
Definition Detector.h:51
void PostTrack() override
Definition Detector.h:53
std::vector< o2::itsmft::Hit > * getHits(int iColl) const
Definition Detector.h:61
void configFromFile(std::string fileName="alice3_TRK_layout.txt")
Definition Detector.cxx:133
void EndOfEvent() override
Definition Detector.cxx:267
static o2::base::Detector * create(bool active)
Definition Detector.h:38
void configToFile(std::string fileName="alice3_TRK_layout.txt")
Definition Detector.cxx:164
void PreTrack() override
Definition Detector.h:54
void buildTRKNewVacuumVessel()
Definition Detector.cxx:96
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:287
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...