Project
Loading...
Searching...
No Matches
Cluster.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 "
DataFormatsPHOS/Cluster.h
"
13
#include "
PHOSBase/Geometry.h
"
14
#include "
PHOSBase/PHOSSimParams.h
"
15
16
using namespace
o2::phos
;
17
18
ClassImp
(
Cluster
);
19
20
//____________________________________________________________________________
21
bool
Cluster::operator<(
const
Cluster
&
other
)
const
22
{
23
// Compares two Clusters according to their position in the PHOS modules
24
25
char
phosmod1 =
module
();
26
char
phosmod2 =
other
.module();
27
if
(phosmod1 != phosmod2) {
28
return
phosmod1 < phosmod2;
29
}
30
31
float
posX, posZ;
32
getLocalPosition
(posX, posZ);
33
float
posOtherX, posOtherZ;
34
other
.getLocalPosition(posOtherX, posOtherZ);
35
int
rowdifX = (
int
)std::ceil(posX /
o2::phos::PHOSSimParams::Instance
().
mSortingDelta
) -
36
(
int
)std::ceil(posOtherX /
o2::phos::PHOSSimParams::Instance
().mSortingDelta);
37
if
(rowdifX == 0) {
38
return
posZ > posOtherZ;
39
}
else
{
40
return
rowdifX > 0;
41
}
42
}
43
//____________________________________________________________________________
47
bool
Cluster::operator>(
const
Cluster
&
other
)
const
48
{
49
// Compares two Clusters according to their position in the PHOS modules
50
51
char
phosmod1 =
module
();
52
char
phosmod2 =
other
.module();
53
if
(phosmod1 != phosmod2) {
54
return
phosmod1 > phosmod2;
55
}
56
57
float
posX, posZ;
58
getLocalPosition
(posX, posZ);
59
float
posOtherX, posOtherZ;
60
other
.getLocalPosition(posOtherX, posOtherZ);
61
int
rowdifX = (
int
)std::ceil(posX /
o2::phos::PHOSSimParams::Instance
().
mSortingDelta
) -
62
(
int
)std::ceil(posOtherX /
o2::phos::PHOSSimParams::Instance
().mSortingDelta);
63
if
(rowdifX == 0) {
64
return
posZ < posOtherZ;
65
}
else
{
66
return
rowdifX < 0;
67
}
68
}
Cluster.h
ClassImp
ClassImp(Cluster)
PHOSSimParams.h
Geometry.h
int
o2::conf::ConfigurableParamHelper< PHOSSimParams >::Instance
static const PHOSSimParams & Instance()
Definition
ConfigurableParamHelper.h:81
o2::phos::Cluster
Contains PHOS cluster parameters.
Definition
Cluster.h:39
o2::phos::Cluster::module
char module() const
Definition
Cluster.h:92
o2::phos::Cluster::getLocalPosition
void getLocalPosition(float &posX, float &posZ) const
Definition
Cluster.h:76
o2::phos
Definition
SimTraits.h:135
o2::phos::PHOSSimParams::mSortingDelta
float mSortingDelta
used in sorting clusters
Definition
PHOSSimParams.h:93
other
VectorOfTObjectPtrs other
Definition
test_Algorithm.cxx:501
DataFormats
Detectors
PHOS
src
Cluster.cxx
Generated on Tue Feb 25 2025 23:16:10 for Project by
1.9.8