Project
Loading...
Searching...
No Matches
Hit.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#ifndef ALICEO2_FOCAL_HIT_H
12#define ALICEO2_FOCAL_HIT_H
13
14#include <iosfwd>
17#include <boost/container_hash/hash.hpp>
18
19namespace o2::focal
20{
21
27class Hit : public o2::BasicXYZEHit<float>
28{
29 public:
32 enum class Subsystem_t {
33 EPADS,
34 EPIXELS,
35 HCAL,
36 UNKNOWN
37 };
38
41 struct HitID {
46
47 bool operator==(const HitID& other) const
48 {
49 return mParentID == other.mParentID && mRow == other.mRow && mColumn == other.mColumn && mLayer == other.mLayer;
50 }
51 friend std::ostream& operator<<(std::ostream& stream, const Hit::HitID& channel);
52 };
53
56 struct HitIDHasher {
57
61 size_t operator()(const HitID& s) const
62 {
63 std::size_t seed = 0;
64 boost::hash_combine(seed, s.mParentID);
65 boost::hash_combine(seed, s.mRow);
66 boost::hash_combine(seed, s.mColumn);
67 boost::hash_combine(seed, s.mLayer);
68 return seed;
69 }
70 };
71
73 Hit() = default;
74
83 Hit(int primary, int trackID, int detID, Subsystem_t subsystem, double initialEnergy, const math_utils::Point3D<float>& pos,
84 double tof, double eLoss);
85
87 ~Hit() = default;
88
92 bool operator==(const Hit& other) const;
93
97 bool operator<(const Hit& other) const;
98
102 Hit& operator+=(const Hit& other);
103
106 Subsystem_t getSubsystem() const { return mSubSystem; }
107
110 bool isPixelHit() const { return mSubSystem == Subsystem_t::EPIXELS; }
111
114 bool isPadHit() const { return mSubSystem == Subsystem_t::EPADS; }
115
118 bool isHCALHit() const { return mSubSystem == Subsystem_t::HCAL; }
119
122 int getPrimary() const { return mPrimary; }
123
126 double getInitialEnergy() const { return mInitialEnergy; }
127
130 void setInitialEnergy(double energy) { mInitialEnergy = energy; }
131
134 void setPrimary(int primary) { mPrimary = primary; }
135
138 void printStream(std::ostream& stream) const;
139
140 private:
141 Subsystem_t mSubSystem = Subsystem_t::UNKNOWN;
142 int mPrimary = -1;
143 double mInitialEnergy = 0.;
144
145 ClassDefNV(Hit, 1);
146};
147
152Hit operator+(const Hit& lhs, const Hit& rhs);
153
158std::ostream& operator<<(std::ostream& stream, const Hit& point);
159} // namespace o2::focal
160
161#ifdef USESHM
162namespace std
163{
164template <>
165class allocator<o2::focal::Hit> : public o2::utils::ShmAllocator<o2::focal::Hit>
166{
167};
168} // namespace std
169#endif
170#endif
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
uint16_t pos
Definition RawData.h:3
Common FOCAL hit class for the detector simulation.
Definition Hit.h:28
Subsystem_t getSubsystem() const
Get the type of the subsystem for which the hit was created.
Definition Hit.h:106
bool isPixelHit() const
Check if the hit is a FOCAL-E pixel hit.
Definition Hit.h:110
void printStream(std::ostream &stream) const
Print information of this hit on the output stream.
Definition Hit.cxx:46
bool operator==(const Hit &other) const
Comparison operator for equalness.
Definition Hit.cxx:24
void setPrimary(int primary)
Set index of the incomimg primary particle associated with the hit.
Definition Hit.h:134
void setInitialEnergy(double energy)
Set energy of the incoming primary particle at the entrance of FOCAL.
Definition Hit.h:130
~Hit()=default
Destructor.
Subsystem_t
Subsystem index of the Hit.
Definition Hit.h:32
bool operator<(const Hit &other) const
Comparison operator for smaller.
Definition Hit.cxx:29
Hit & operator+=(const Hit &other)
Operator for incremental sum, adding energy loss of the other hit to this energy loss.
Definition Hit.cxx:40
bool isPadHit() const
Check if the hit is a FOCAL-E pad hit.
Definition Hit.h:114
Hit()=default
Dummy constructor.
double getInitialEnergy() const
Get energy of the incoming primary particle at the entrance of FOCAL.
Definition Hit.h:126
bool isHCALHit() const
Check if the hit is a FOCAL-H hit.
Definition Hit.h:118
int getPrimary() const
Get index of the incomimg primary particle associated with the hit.
Definition Hit.h:122
GLuint GLuint stream
Definition glcorearb.h:1806
Hit operator+(const Hit &lhs, const Hit &rhs)
Sum operator, creating a new hit with the sum of the two energy losses.
Definition Hit.cxx:53
std::ostream & operator<<(std::ostream &in, const IndexExceptionEvent &error)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Hash functor for hit ID.
Definition Hit.h:56
size_t operator()(const HitID &s) const
Functor implementation.
Definition Hit.h:61
Mapped information of a channel.
Definition Hit.h:41
uint8_t mLayer
Layer the was hit.
Definition Hit.h:45
uint8_t mRow
Row of the hit in the calorimeter.
Definition Hit.h:43
int mParentID
parentID of the track creating this hit
Definition Hit.h:42
uint8_t mColumn
Column of the hit in the calorimeter.
Definition Hit.h:44
friend std::ostream & operator<<(std::ostream &stream, const Hit::HitID &channel)
bool operator==(const HitID &other) const
Definition Hit.h:47
VectorOfTObjectPtrs other