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_PHOS_HIT_H
13#define ALICEO2_PHOS_HIT_H
14
17
18namespace o2
19{
20namespace phos
21{
24class Hit : public o2::BasicXYZEHit<float>
25{
26 public:
28 Hit() = default;
29
42 Hit(Int_t trackID, Int_t detID, const math_utils::Point3D<float>& pos, const math_utils::Vector3D<float>& mom, Double_t totE, Double_t tof,
43 Double_t eLoss)
44 : o2::BasicXYZEHit<float>(pos.X(), pos.Y(), pos.Z(), tof, eLoss, trackID, detID),
45 mPvector(mom),
46 mInitialEnergy(totE)
47 {
48 }
49
50 Hit& operator=(const Hit& hit) = default;
51
54 Bool_t operator==(const Hit& rhs) const;
55
58 Bool_t operator<(const Hit& rhs) const;
59
63 Hit& operator+=(const Hit& rhs);
64
68 Hit operator+(const Hit& rhs) const;
69
71 ~Hit() = default;
72
75 Double_t getInitialEnergy() const { return mInitialEnergy; }
76
77 void addEnergyLoss(Double_t eloss) { SetEnergyLoss(GetEnergyLoss() + eloss); }
78
81 void PrintStream(std::ostream& stream) const;
82
83 private:
84 math_utils::Vector3D<float> mPvector; // Momentum Vector
85 Double32_t mInitialEnergy; // Energy of the parent particle that entered the PHOS front surface
86
87 ClassDefNV(Hit, 1);
88};
89
90std::ostream& operator<<(std::ostream& stream, const Hit& point);
91} // namespace phos
92} // namespace o2
93
94#ifdef USESHM
95namespace std
96{
97template <>
98class allocator<o2::phos::Hit> : public o2::utils::ShmAllocator<o2::phos::Hit>
99{
100};
101} // namespace std
102#endif
103
104#endif /* Hit_h */
uint16_t pos
Definition RawData.h:3
float GetEnergyLoss() const
Definition BaseHits.h:103
void SetEnergyLoss(float val)
Definition BaseHits.h:104
PHOS simulation hit information.
Definition Hit.h:25
Hit & operator+=(const Hit &rhs)
Adds energy loss from the other Hit to this Hit.
Definition Hit.cxx:48
Hit()=default
Default constructor.
Bool_t operator<(const Hit &rhs) const
Sorting points according to parent particle and detector volume.
Definition Hit.cxx:35
void PrintStream(std::ostream &stream) const
Writing Hit information to an output stream;.
Definition Hit.cxx:18
Double_t getInitialEnergy() const
Get the initial energy of the primary particle entering PHOS.
Definition Hit.h:75
Hit(Int_t trackID, Int_t detID, const math_utils::Point3D< float > &pos, const math_utils::Vector3D< float > &mom, Double_t totE, Double_t tof, Double_t eLoss)
Hit constructor.
Definition Hit.h:42
Bool_t operator==(const Hit &rhs) const
Check whether the points are from the same SuperParent and in the same detector volume.
Definition Hit.cxx:43
Hit operator+(const Hit &rhs) const
Creates a new Hit based on this Hit but adding the energy loss of the right hand side.
Definition Hit.cxx:57
Hit & operator=(const Hit &hit)=default
~Hit()=default
Destructor.
void addEnergyLoss(Double_t eloss)
Definition Hit.h:77
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &in, const BadChannelsMap &bcm)
Printing bad channel map on the stream.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.