-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathDetector.h
More file actions
107 lines (90 loc) · 3.11 KB
/
Detector.h
File metadata and controls
107 lines (90 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef ALICEO2_IOTOF_DETECTOR_H
#define ALICEO2_IOTOF_DETECTOR_H
#include "DetectorsBase/Detector.h"
#include "ITSMFTSimulation/Hit.h"
#include "IOTOFSimulation/Layer.h"
// #include "IOTOFSimulation/TRKServices.h"
#include "IOTOFBase/GeometryTGeo.h"
#include <TLorentzVector.h>
#include <TString.h>
namespace o2
{
namespace iotof
{
class Detector : public o2::base::DetImpl<Detector>
{
public:
Detector(bool active);
Detector();
~Detector();
void ConstructGeometry() override;
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);
// Mandatory overrides
void BeginPrimary() override { ; }
void FinishPrimary() override { ; }
void InitializeO2Detector() override;
void PostTrack() override { ; }
void PreTrack() override { ; }
bool ProcessHits(FairVolume* v = nullptr) override;
void EndOfEvent() override;
void Register() override;
void Reset() override;
// Custom memer functions
std::vector<o2::itsmft::Hit>* getHits(int iColl) const
{
if (!iColl) {
return mHits;
}
return nullptr;
}
void configLayers(bool itof = true, bool otof = true, bool ftof = true, bool btof = true, std::string pattern = "", bool itofSegmented = false, bool otofSegmented = false, const float x2x0 = 0.02f, const float sensorThickness = 0.0050f);
void configServices();
void createMaterials();
void createGeometry();
private:
// Transient data about track passing the sensor
struct TrackData {
bool mHitStarted; // hit creation started
unsigned char mTrkStatusStart; // track status flag
TLorentzVector mPositionStart; // position at entrance
TLorentzVector mMomentumStart; // momentum
double mEnergyLoss; // energy loss
} mTrackData; //! transient data
GeometryTGeo* mGeometryTGeo; //!
std::vector<o2::itsmft::Hit>* mHits; // ITSMFT ones for the moment
ITOFLayer mITOFLayer; //!
OTOFLayer mOTOFLayer; //!
FTOFLayer mFTOFLayer; //!
BTOFLayer mBTOFLayer; //!
void defineSensitiveVolumes();
template <typename Det>
friend class o2::base::DetImpl;
ClassDefOverride(Detector, 1);
};
} // namespace iotof
} // namespace o2
#ifdef USESHM
namespace o2
{
namespace base
{
template <>
struct UseShm<o2::iotof::Detector> {
static constexpr bool value = true;
};
} // namespace base
} // namespace o2
#endif
#endif