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
14
15#ifndef ALICEO2_FT3_DETECTOR_H_
16#define ALICEO2_FT3_DETECTOR_H_
17
18#include "Rtypes.h" // for Int_t, Double_t, Float_t, Bool_t, etc
19
20#include "DetectorsBase/Detector.h" // for Detector
21#include "DetectorsBase/GeometryManager.h" // for getSensID
22#include "DetectorsCommonDataFormats/DetID.h" // for Detector
23#include "DataFormatsTRKFT3/Hit.h" // for Hit
24
25#include "TArrayD.h" // for TArrayD
26#include "TGeoManager.h" // for gGeoManager, TGeoManager (ptr only)
27#include "TLorentzVector.h" // for TLorentzVector
28#include "TVector3.h" // for TVector3
29
30#include <unordered_map>
31#include <vector>
32
33class FairVolume;
34class TGeoVolume;
35
36class TParticle;
37
38class TString;
39
40namespace o2::ft3
41{
42class GeometryTGeo;
43class FT3BaseParam;
44class FT3Layer;
45
46class Detector : public o2::base::DetImpl<Detector>
47{
48 public:
53
55 Detector();
56
58 ~Detector() override;
59
61 void InitializeO2Detector() override;
62
64 Bool_t ProcessHits(FairVolume* v = nullptr) override;
65
67 void Register() override;
68
70 std::vector<o2::trkft3::Hit>* getHits(Int_t iColl) const
71 {
72 if (iColl == 0) {
73 return mHits;
74 }
75 return nullptr;
76 }
77
79 void Reset() override;
80
82 void ConstructGeometry() override;
83
85 o2::trkft3::Hit* addHit(int trackID, int detID, const TVector3& startPos, const TVector3& endPos,
86 const TVector3& startMom, double startE, double endTime, double eLoss,
87 unsigned char startStatus, unsigned char endStatus);
88
89 Int_t chipVolUID(Int_t id) const { return o2::base::GeometryManager::getSensID(o2::detectors::DetID::FT3, id); }
90
91 void EndOfEvent() override;
92
93 void FinishPrimary() override { ; }
94 virtual void finishRun() { ; }
95 void BeginPrimary() override { ; }
96 void PostTrack() override { ; }
97 void PreTrack() override { ; }
98
99 static constexpr int IdxForwardDisks = 0;
100 static constexpr int IdxBackwardDisks = 1;
102 size_t getNumberOfLayers() const
103 {
105 LOG(fatal) << "Number of layers in the two directions are different! Returning 0.";
106 }
107 return mLayerName[IdxBackwardDisks].size();
108 }
109
110 void buildBasicFT3(const FT3BaseParam& param);
111 void buildFT3V1();
112 void buildFT3V3b();
113 void buildFT3Scoping();
115 void buildFT3ScopingV3();
116
117 protected:
118 std::array<std::vector<TString>, 2> mLayerName; // Two sets of layer names, one per direction (forward/backward)
119
120 private:
122 struct TrackData { // this is transient
123 bool mHitStarted;
124 unsigned char mTrkStatusStart;
125 TLorentzVector mPositionStart;
126 TLorentzVector mMomentumStart;
127 double mEnergyLoss;
128 } mTrackData;
129
131 std::vector<o2::trkft3::Hit>* mHits;
132
134 virtual void createMaterials();
135
137 void createGeometry();
138
140 void defineSensitiveVolumes();
141
142 Detector(const Detector&);
143
144 Detector& operator=(const Detector&);
145
146 std::array<std::vector<FT3Layer>, 2> mLayers; // Two sets of layers, one per direction (forward/backward)
147 bool mIsPipeActivated = true;
148
149 template <typename Det>
150 friend class o2::base::DetImpl;
151 ClassDefOverride(Detector, 2);
152};
153
154} // namespace o2::ft3
155
156#ifdef USESHM
157namespace o2
158{
159namespace base
160{
161template <>
162struct UseShm<o2::ft3::Detector> {
163 static constexpr bool value = true;
164};
165} // namespace base
166} // namespace o2
167#endif
168
169#endif
Definition of the Detector class.
Definition of the GeometryManager class.
static int getSensID(o2::detectors::DetID detid, int sensid)
std::array< std::vector< TString >, 2 > mLayerName
Definition Detector.h:118
void buildFT3ScopingV3()
Definition Detector.cxx:252
~Detector() override
Default destructor.
Definition Detector.cxx:367
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:405
static constexpr int IdxBackwardDisks
Definition Detector.h:100
void BeginPrimary() override
Definition Detector.h:95
void EndOfEvent() override
Definition Detector.cxx:524
static constexpr int IdxForwardDisks
Definition Detector.h:99
o2::trkft3::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)
This method is an example of how to add your own point of type Hit to the clones array.
Definition Detector.cxx:666
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:527
void ConstructGeometry() override
Base class to create the detector geometry.
Definition Detector.cxx:547
size_t getNumberOfLayers() const
Returns the number of layers.
Definition Detector.h:102
Detector()
Default constructor.
Definition Detector.cxx:56
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:414
void PreTrack() override
Definition Detector.h:97
void buildBasicFT3(const FT3BaseParam &param)
Definition Detector.cxx:64
Detector(Bool_t active)
std::vector< o2::trkft3::Hit > * getHits(Int_t iColl) const
Gets the produced collections.
Definition Detector.h:70
Int_t chipVolUID(Int_t id) const
Definition Detector.h:89
void buildFT3NewVacuumVessel()
Definition Detector.cxx:187
void FinishPrimary() override
Definition Detector.h:93
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:539
void PostTrack() override
Definition Detector.h:96
virtual void finishRun()
Definition Detector.h:94
GLsizeiptr size
Definition glcorearb.h:659
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLenum GLfloat param
Definition glcorearb.h:271
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"