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 <vector> // for vector
19#include "DetectorsBase/GeometryManager.h" // for getSensID
20#include "DetectorsBase/Detector.h" // for Detector
21#include "DetectorsCommonDataFormats/DetID.h" // for Detector
22#include "ITSMFTSimulation/Hit.h" // for Hit
23#include "Rtypes.h" // for Int_t, Double_t, Float_t, Bool_t, etc
24#include "TArrayD.h" // for TArrayD
25#include "TGeoManager.h" // for gGeoManager, TGeoManager (ptr only)
26#include "TLorentzVector.h" // for TLorentzVector
27#include "TVector3.h" // for TVector3
28
29class FairVolume;
30class TGeoVolume;
31
32class TParticle;
33
34class TString;
35
36namespace o2::ft3
37{
38class GeometryTGeo;
39class FT3BaseParam;
40class FT3Layer;
41
42class Detector : public o2::base::DetImpl<Detector>
43{
44 public:
49
51 Detector();
52
54 ~Detector() override;
55
57 void InitializeO2Detector() override;
58
60 Bool_t ProcessHits(FairVolume* v = nullptr) override;
61
63 void Register() override;
64
66 std::vector<o2::itsmft::Hit>* getHits(Int_t iColl) const
67 {
68 if (iColl == 0) {
69 return mHits;
70 }
71 return nullptr;
72 }
73
75 void Reset() override;
76
78 void ConstructGeometry() override;
79
81 o2::itsmft::Hit* addHit(int trackID, int detID, const TVector3& startPos, const TVector3& endPos,
82 const TVector3& startMom, double startE, double endTime, double eLoss,
83 unsigned char startStatus, unsigned char endStatus);
84
85 Int_t chipVolUID(Int_t id) const { return o2::base::GeometryManager::getSensID(o2::detectors::DetID::FT3, id); }
86
87 void EndOfEvent() override;
88
89 void FinishPrimary() override { ; }
90 virtual void finishRun() { ; }
91 void BeginPrimary() override { ; }
92 void PostTrack() override { ; }
93 void PreTrack() override { ; }
94
95 static constexpr int IdxForwardDisks = 0;
96 static constexpr int IdxBackwardDisks = 1;
98 size_t getNumberOfLayers() const
99 {
101 LOG(fatal) << "Number of layers in the two directions are different! Returning 0.";
102 }
103 return mLayerName[IdxBackwardDisks].size();
104 }
105
106 void buildBasicFT3(const FT3BaseParam& param);
107 void buildFT3V1();
108 void buildFT3V3b();
109 void buildFT3Scoping();
111 void buildFT3ScopingV3();
112
113 protected:
114 std::vector<Int_t> mLayerID;
115 std::array<std::vector<TString>, 2> mLayerName; // Two sets of layer names, one per direction (forward/backward)
116
117 private:
119 struct TrackData { // this is transient
120 bool mHitStarted;
121 unsigned char mTrkStatusStart;
122 TLorentzVector mPositionStart;
123 TLorentzVector mMomentumStart;
124 double mEnergyLoss;
125 } mTrackData;
126
128 std::vector<o2::itsmft::Hit>* mHits;
129
131 virtual void createMaterials();
132
134 void createGeometry();
135
137 void defineSensitiveVolumes();
138
139 Detector(const Detector&);
140
141 Detector& operator=(const Detector&);
142
143 std::array<std::vector<FT3Layer>, 2> mLayers; // Two sets of layers, one per direction (forward/backward)
144 bool mIsPipeActivated = true;
145
146 template <typename Det>
147 friend class o2::base::DetImpl;
148 ClassDefOverride(Detector, 1);
149};
150
151} // namespace o2::ft3
152
153#ifdef USESHM
154namespace o2
155{
156namespace base
157{
158template <>
159struct UseShm<o2::ft3::Detector> {
160 static constexpr bool value = true;
161};
162} // namespace base
163} // namespace o2
164#endif
165
166#endif
Definition of the Detector class.
Definition of the GeometryManager class.
Definition of the ITSMFT Hit class.
static int getSensID(o2::detectors::DetID detid, int sensid)
std::array< std::vector< TString >, 2 > mLayerName
Definition Detector.h:115
void buildFT3ScopingV3()
Definition Detector.cxx:255
~Detector() override
Default destructor.
Definition Detector.cxx:389
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:428
static constexpr int IdxBackwardDisks
Definition Detector.h:96
void BeginPrimary() override
Definition Detector.h:91
void EndOfEvent() override
Definition Detector.cxx:545
static constexpr int IdxForwardDisks
Definition Detector.h:95
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)
This method is an example of how to add your own point of type Hit to the clones array.
Definition Detector.cxx:674
void Register() override
Registers the produced collections in FAIRRootManager.
Definition Detector.cxx:548
std::vector< o2::itsmft::Hit > * getHits(Int_t iColl) const
Gets the produced collections.
Definition Detector.h:66
void ConstructGeometry() override
Base class to create the detector geometry.
Definition Detector.cxx:568
size_t getNumberOfLayers() const
Returns the number of layers.
Definition Detector.h:98
Detector()
Default constructor.
Definition Detector.cxx:55
Bool_t ProcessHits(FairVolume *v=nullptr) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
Definition Detector.cxx:437
std::vector< Int_t > mLayerID
Definition Detector.h:114
void PreTrack() override
Definition Detector.h:93
void buildBasicFT3(const FT3BaseParam &param)
Definition Detector.cxx:63
Detector(Bool_t active)
Int_t chipVolUID(Int_t id) const
Definition Detector.h:85
void buildFT3NewVacuumVessel()
Definition Detector.cxx:189
void FinishPrimary() override
Definition Detector.h:89
void Reset() override
Has to be called after each event to reset the containers.
Definition Detector.cxx:560
void PostTrack() override
Definition Detector.h:92
virtual void finishRun()
Definition Detector.h:90
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"