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_IOTOF_DETECTOR_H
13#define ALICEO2_IOTOF_DETECTOR_H
14
17
19// #include "IOTOFSimulation/TRKServices.h"
21
22#include <TLorentzVector.h>
23#include <TString.h>
24
25namespace o2
26{
27namespace iotof
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 memer 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 configLayers(bool itof = true, bool otof = true, bool ftof = true, bool btof = true);
64
65 void configServices();
66 void createMaterials();
67 void createGeometry();
68
69 private:
70 // Transient data about track passing the sensor
71 struct TrackData {
72 bool mHitStarted; // hit creation started
73 unsigned char mTrkStatusStart; // track status flag
74 TLorentzVector mPositionStart; // position at entrance
75 TLorentzVector mMomentumStart; // momentum
76 double mEnergyLoss; // energy loss
77 } mTrackData;
78
79 GeometryTGeo* mGeometryTGeo;
80 std::vector<o2::itsmft::Hit>* mHits; // ITSMFT ones for the moment
81 ITOFLayer mITOFLayer;
82 OTOFLayer mOTOFLayer;
83 FTOFLayer mFTOFLayer;
84 BTOFLayer mBTOFLayer;
85
86 void defineSensitiveVolumes();
87
88 template <typename Det>
89 friend class o2::base::DetImpl;
90 ClassDefOverride(Detector, 1);
91};
92} // namespace iotof
93} // namespace o2
94
95#ifdef USESHM
96namespace o2
97{
98namespace base
99{
100template <>
101struct UseShm<o2::iotof::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 Reset() override
Definition Detector.cxx:188
void BeginPrimary() override
Definition Detector.h:44
bool ProcessHits(FairVolume *v=nullptr) override
Definition Detector.cxx:195
std::vector< o2::itsmft::Hit > * getHits(int iColl) const
Definition Detector.h:55
void PostTrack() override
Definition Detector.h:47
void configLayers(bool itof=true, bool otof=true, bool ftof=true, bool btof=true)
Definition Detector.cxx:59
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:279
void PreTrack() override
Definition Detector.h:48
void Register() override
Definition Detector.cxx:177
void ConstructGeometry() override
Definition Detector.cxx:53
void InitializeO2Detector() override
Definition Detector.cxx:139
void FinishPrimary() override
Definition Detector.h:45
void EndOfEvent() override
Definition Detector.cxx:175
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 ...