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
12#ifndef ALICEO2_EMCAL_HIT_H
13#define ALICEO2_EMCAL_HIT_H
14
17
18namespace o2
19{
20namespace emcal
21{
27class Hit : public o2::BasicXYZEHit<float>
28{
29 public:
31 Hit() = default;
32
46 Hit(Int_t primary, Int_t trackID, Int_t detID, Double_t initialEnergy, const math_utils::Point3D<float>& pos,
47 const math_utils::Vector3D<float>& mom, Double_t tof, Double_t eLoss)
48 : o2::BasicXYZEHit<float>(pos.X(), pos.Y(), pos.Z(), tof, eLoss, trackID, detID),
49 mPvector(mom),
50 mPrimary(primary),
51 mInitialEnergy(initialEnergy)
52 {
53 }
54
57 Bool_t operator==(const Hit& rhs) const;
58
61 Bool_t operator<(const Hit& rhs) const;
62
66 Hit& operator+=(const Hit& rhs);
67
69 ~Hit() = default;
70
73 Double_t GetInitialEnergy() const { return mInitialEnergy; }
74
77 Int_t GetPrimary() const { return mPrimary; }
78
81 void SetInitialEnergy(Double_t energy) { mInitialEnergy = energy; }
82
85 void SetPrimary(Int_t primary) { mPrimary = primary; }
86
89 void PrintStream(std::ostream& stream) const;
90
91 private:
93 Int_t mPrimary;
94 Double32_t mInitialEnergy;
95
96 ClassDefNV(Hit, 1);
97};
98
103Hit operator+(const Hit& lhs, const Hit& rhs);
104
109std::ostream& operator<<(std::ostream& stream, const Hit& point);
110} // namespace emcal
111} // namespace o2
112
113#ifdef USESHM
114namespace std
115{
116template <>
117class allocator<o2::emcal::Hit> : public o2::utils::ShmAllocator<o2::emcal::Hit>
118{
119};
120} // namespace std
121#endif
122
123#endif /* Point_h */
uint16_t pos
Definition RawData.h:3
EMCAL simulation hit information.
Definition Hit.h:28
Hit & operator+=(const Hit &rhs)
Adds energy loss from the other point to this point.
Definition Hit.cxx:38
Bool_t operator<(const Hit &rhs) const
Sorting points according to parent particle and detector volume.
Definition Hit.cxx:25
Double_t GetInitialEnergy() const
Get the initial energy of the primary particle entering EMCAL.
Definition Hit.h:73
~Hit()=default
Destructor.
void PrintStream(std::ostream &stream) const
Writing point information to an output stream;.
Definition Hit.cxx:18
void SetInitialEnergy(Double_t energy)
Set initial energy of the primary particle entering EMCAL.
Definition Hit.h:81
Int_t GetPrimary() const
Get Primary particles at the origin of the hit.
Definition Hit.h:77
Bool_t operator==(const Hit &rhs) const
Check whether the points are from the same parent and in the same detector volume.
Definition Hit.cxx:33
Hit()=default
Default constructor.
Hit(Int_t primary, Int_t trackID, Int_t detID, Double_t initialEnergy, const math_utils::Point3D< float > &pos, const math_utils::Vector3D< float > &mom, Double_t tof, Double_t eLoss)
Hit constructor.
Definition Hit.h:46
void SetPrimary(Int_t primary)
Set primary particles at the origin of the hit.
Definition Hit.h:85
GLuint GLuint stream
Definition glcorearb.h:1806
Hit operator+(const Hit &lhs, const Hit &rhs)
Creates a new point base on this point but adding the energy loss of the right hand side.
Definition Hit.cxx:44
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.
Definition Cell.cxx:355
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.