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_TOF_DETECTOR_H_
13#define ALICEO2_TOF_DETECTOR_H_
14
16#include "TOFBase/Geo.h"
17
20
21class FairVolume;
22
23namespace o2
24{
25namespace tof
26{
27class HitType : public o2::BasicXYZEHit<float>
28{
29 public:
30 using BasicXYZEHit<float>::BasicXYZEHit;
31};
32} // namespace tof
33} // namespace o2
34
35#ifdef USESHM
36namespace std
37{
38template <>
39class allocator<o2::tof::HitType> : public o2::utils::ShmAllocator<o2::tof::HitType>
40{
41};
42} // namespace std
43#endif
44
45namespace o2
46{
47namespace tof
48{
49
50class Detector : public o2::base::DetImpl<Detector>
51{
52 public:
54 kAir = 1,
55 kNomex = 2,
56 kG10 = 3,
60 kFre = 7,
61 kCuS = 8,
62 kGlass = 9,
63 kWater = 10,
64 kCable = 11,
66 kCopper = 13,
68 kCrates = 15,
69 kHoneyHoles = 16
70 };
71
72 Detector() = default;
73
74 Detector(Bool_t active);
75
76 ~Detector() override;
77
78 void InitializeO2Detector() final;
79
80 Bool_t ProcessHits(FairVolume* v = nullptr) final;
81
82 void Register() override;
83
84 std::vector<HitType>* getHits(int iColl) const
85 {
86 if (iColl == 0) {
87 return mHits;
88 }
89 return nullptr;
90 }
91
92 void Reset() final;
93 void EndOfEvent() final;
94
95 void CreateMaterials();
96 void ConstructGeometry() final;
97 void addAlignableVolumes() const override;
98
99 void setTOFholes(Bool_t flag = kTRUE) { mTOFHoles = flag; }
100
101 protected:
102 virtual void DefineGeometry(Float_t xtof, Float_t ytof, Float_t zlenA) final;
103 virtual void MaterialMixer(Float_t* p, const Float_t* const a, const Float_t* const m, Int_t n) const final;
104
105 private:
107 Detector(const Detector& rhs);
108
109 void createModules(Float_t xtof, Float_t ytof, Float_t zlenA, Float_t xFLT, Float_t yFLT, Float_t zFLTA) const;
110 void makeStripsInModules(Float_t ytof, Float_t zlenA) const;
111 void createModuleCovers(Float_t xtof, Float_t zlenA) const;
112 void createBackZone(Float_t xtof, Float_t ytof, Float_t zlenA) const;
113 void makeFrontEndElectronics(Float_t xtof) const;
114 void makeFEACooling(Float_t xtof) const;
115 void makeNinoMask(Float_t xtof) const;
116 void makeSuperModuleCooling(Float_t xtof, Float_t ytof, Float_t zlenA) const;
117 void makeSuperModuleServices(Float_t xtof, Float_t ytof, Float_t zlenA) const;
118 void makeReadoutCrates(Float_t ytof) const;
119
120 void makeModulesInBTOFvolumes(Float_t ytof, Float_t zlenA) const;
121 void makeCoversInBTOFvolumes() const;
122 void makeBackInBTOFvolumes(Float_t ytof) const;
123
124 bool isMergable(HitType hit1, HitType hit2)
125 {
126 if (hit1.GetTrackID() != hit2.GetTrackID()) {
127 return false;
128 }
129
130 if (std::abs(hit1.GetTime() - hit2.GetTime()) > 1.0 /*1 ns*/) {
131 return false;
132 }
133
134 return true;
135 }
136
137 Int_t mEventNr; // event count
138 Int_t mTOFSectors[o2::tof::Geo::NSECTORS];
139 Bool_t mTOFHoles; // flag to allow for holes in front of the PHOS
140 Int_t mLastChannelID = -1;
141
143 std::vector<HitType>* mHits;
144
145 template <typename Det>
146 friend class o2::base::DetImpl;
147 ClassDefOverride(Detector, 1);
148};
149} // namespace tof
150} // namespace o2
151
152#ifdef USESHM
153namespace o2
154{
155namespace base
156{
157template <>
158struct UseShm<o2::tof::Detector> {
159 static constexpr bool value = true;
160};
161} // namespace base
162} // namespace o2
163#endif
164
165#endif
Definition of the Detector class.
int GetTrackID() const
Definition BaseHits.h:30
E GetTime() const
Definition BaseHits.h:71
void setTOFholes(Bool_t flag=kTRUE)
Definition Detector.h:99
~Detector() override
Definition Detector.cxx:49
virtual void MaterialMixer(Float_t *p, const Float_t *const a, const Float_t *const m, Int_t n) const final
Definition Detector.cxx:284
void ConstructGeometry() final
Definition Detector.cxx:299
void Register() override
Definition Detector.cxx:108
void InitializeO2Detector() final
Definition Detector.cxx:54
void addAlignableVolumes() const override
declare alignable volumes of detector
Bool_t ProcessHits(FairVolume *v=nullptr) final
Definition Detector.cxx:64
void EndOfEvent() final
Definition Detector.cxx:315
Detector()=default
virtual void DefineGeometry(Float_t xtof, Float_t ytof, Float_t zlenA) final
Definition Detector.cxx:316
void Reset() final
Definition Detector.cxx:113
std::vector< HitType > * getHits(int iColl) const
Definition Detector.h:84
static constexpr Int_t NSECTORS
Definition Geo.h:120
GLdouble n
Definition glcorearb.h:1982
const GLfloat * m
Definition glcorearb.h:4066
const GLdouble * v
Definition glcorearb.h:832
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.