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
13#include "PHOSBase/Geometry.h"
15
16using namespace o2::phos;
17
19
20//____________________________________________________________________________
21bool 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//____________________________________________________________________________
47bool 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}
ClassImp(Cluster)
Contains PHOS cluster parameters.
Definition Cluster.h:39
char module() const
Definition Cluster.h:92
void getLocalPosition(float &posX, float &posZ) const
Definition Cluster.h:76
float mSortingDelta
used in sorting clusters
VectorOfTObjectPtrs other