Project
Loading...
Searching...
No Matches
Hit.cxx
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#include "EMCALBase/Hit.h"
13
15
16using namespace o2::emcal;
17
18void Hit::PrintStream(std::ostream& stream) const
19{
20 stream << "EMCAL point: Track " << GetTrackID() << " in detector segment " << GetDetectorID()
21 << " at position (" << GetX() << "|" << GetY() << "|" << GetZ() << "), energy loss " << GetEnergyLoss()
22 << ", initial (parent) energy " << mInitialEnergy;
23}
24
25Bool_t Hit::operator<(const Hit& rhs) const
26{
27 if (GetTrackID() != rhs.GetTrackID()) {
28 return GetTrackID() < rhs.GetTrackID();
29 }
30 return GetDetectorID() < rhs.GetDetectorID();
31}
32
33Bool_t Hit::operator==(const Hit& rhs) const
34{
35 return (GetDetectorID() == rhs.GetDetectorID()) && (GetTrackID() == rhs.GetTrackID());
36}
37
39{
40 SetEnergyLoss(GetEnergyLoss() + rhs.GetEnergyLoss());
41 return *this;
42}
43
44Hit o2::emcal::operator+(const Hit& lhs, const Hit& rhs)
45{
46 Hit result(lhs);
47 result.SetEnergyLoss(result.GetEnergyLoss() + rhs.GetEnergyLoss());
48 return result;
49}
50
51std::ostream& o2::emcal::operator<<(std::ostream& stream, const Hit& p)
52{
54 return stream;
55}
ClassImp(o2::emcal::Hit)
int GetTrackID() const
Definition BaseHits.h:30
float GetEnergyLoss() const
Definition BaseHits.h:103
void SetEnergyLoss(float val)
Definition BaseHits.h:104
T GetZ() const
Definition BaseHits.h:66
T GetY() const
Definition BaseHits.h:65
T GetX() const
Definition BaseHits.h:64
short GetDetectorID() const
Definition BaseHits.h:73
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
void PrintStream(std::ostream &stream) const
Writing point information to an output stream;.
Definition Hit.cxx:18
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
GLuint64EXT * result
Definition glcorearb.h:5662
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