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 "CPVBase/Geometry.h"
15
16using namespace o2::cpv;
17
19
20//____________________________________________________________________________
21bool Cluster::operator<(const Cluster& other) const
22{
23 // Compares two Clusters according to their position in the CPV modules
24
25 char cpvmod1 = getModule();
26 char cpvmod2 = other.getModule();
27 if (cpvmod1 != cpvmod2) {
28 return cpvmod1 < cpvmod2;
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::cpv::CPVSimParams::Instance().mSortingDelta) -
36 (int)std::ceil(posOtherX * o2::cpv::CPVSimParams::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 CPV modules
50
51 if (mModule != other.mModule) {
52 return mModule > other.mModule;
53 }
54
55 int rowdifX = (int)std::ceil(mLocalPosX * o2::cpv::CPVSimParams::Instance().mSortingDelta) -
56 (int)std::ceil(other.mLocalPosX * o2::cpv::CPVSimParams::Instance().mSortingDelta);
57 if (rowdifX == 0) {
58 return mLocalPosZ < other.mLocalPosZ;
59 } else {
60 return rowdifX < 0;
61 }
62}
ClassImp(Cluster)
Contains CPV cluster parameters.
Definition Cluster.h:33
float mLocalPosX
Center of gravity position in local module coordunates (phi direction)
Definition Cluster.h:115
char mModule
Module number.
Definition Cluster.h:113
char getModule() const
Definition Cluster.h:70
void getLocalPosition(float &posX, float &posZ) const
Definition Cluster.h:63
float mLocalPosZ
Center of gravity position in local module coordunates (z direction)
Definition Cluster.h:116
float mSortingDelta
used in sorting clusters inverse sorting band in cm
VectorOfTObjectPtrs other