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// Design and equations: Nicola Nicassio nicola.nicassio@cern.ch
13//
14
15#ifndef ALICEO2_MID_ALICE3_DETECTOR_H
16#define ALICEO2_MID_ALICE3_DETECTOR_H
17
20
23
24#include <TLorentzVector.h>
25#include <TString.h>
26
27namespace o2::mi3
28{
29
30class Detector : public o2::base::DetImpl<Detector>
31{
32 public:
33 Detector(bool active);
34 Detector();
35 ~Detector();
36
37 void ConstructGeometry() override;
38
39 o2::itsmft::Hit* addHit(int trackID, int detID, const TVector3& startPos, const TVector3& endPos,
40 const TVector3& startMom, double startE, double endTime, double eLoss,
41 unsigned char startStatus, unsigned char endStatus);
42
43 // Mandatory overrides
44 void BeginPrimary() override { ; }
45 void FinishPrimary() override { ; }
46 void InitializeO2Detector() override;
47 void PostTrack() override { ; }
48 void PreTrack() override { ; }
49 bool ProcessHits(FairVolume* v = nullptr) override;
50 void EndOfEvent() override;
51 void Register() override;
52 void Reset() override;
53
54 // Custom member functions
55 std::vector<o2::itsmft::Hit>* getHits(int iColl) const
56 {
57 if (!iColl) {
58 return mHits;
59 }
60 return nullptr;
61 }
62
63 void createMaterials();
64 void createGeometry();
65
66 private:
67 // Transient data about track passing the sensor
68 struct TrackData {
69 bool mHitStarted; // hit creation started
70 unsigned char mTrkStatusStart; // track status flag
71 TLorentzVector mPositionStart; // position at entrance
72 TLorentzVector mMomentumStart; // momentum
73 double mEnergyLoss; // energy loss
74 } mTrackData;
75
76 GeometryTGeo* mGeometryTGeo;
77 std::vector<o2::itsmft::Hit>* mHits; // ITSMFT ones for the moment
78
79 // void defineSensitiveVolumes();
80
81 protected:
82 template <typename Det>
83 friend class o2::base::DetImpl;
84 std::vector<MIDLayer> mLayers;
86};
87} // namespace o2::mi3
88
89#ifdef USESHM
90namespace o2
91{
92namespace base
93{
94template <>
95struct UseShm<o2::mi3::Detector> {
96 static constexpr bool value = true;
97};
98} // namespace base
99} // namespace o2
100#endif
101#endif
Definition of the Detector class.
Definition of the ITSMFT Hit class.
void BeginPrimary() override
Definition Detector.h:44
std::vector< o2::itsmft::Hit > * getHits(int iColl) const
Definition Detector.h:55
void PreTrack() override
Definition Detector.h:48
std::vector< MIDLayer > mLayers
Definition Detector.h:84
ClassDefOverride(Detector, 1)
void createMaterials()
Definition Detector.cxx:58
void FinishPrimary() override
Definition Detector.h:45
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:228
void ConstructGeometry() override
Definition Detector.cxx:52
void EndOfEvent() override
Definition Detector.cxx:98
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:144
void InitializeO2Detector() override
Definition Detector.cxx:91
void PostTrack() override
Definition Detector.h:47
void Reset() override
Definition Detector.cxx:137
void Register() override
Definition Detector.cxx:100
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 ...