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