Project
Loading...
Searching...
No Matches
PreClusterHelper.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
16
#include "
MIDClustering/PreClusterHelper.h
"
17
18
namespace
o2
19
{
20
namespace
mid
21
{
22
23
MpArea
PreClusterHelper::getArea
(
const
PreCluster
& pc)
const
24
{
31
MpArea
first
= mMapping.
stripByLocation
(pc.
firstStrip
, pc.
cathode
, pc.
firstLine
, pc.
firstColumn
, pc.
deId
,
false
);
32
float
firstX =
first
.getXmin();
33
float
firstY =
first
.getYmin();
34
float
lastX = 0., lastY = 0.;
35
if
(pc.
cathode
== 0) {
36
int
nStripsInBetween = pc.
lastStrip
- pc.
firstStrip
+ 16 * (pc.
lastLine
- pc.
firstLine
);
37
lastX =
first
.getXmax();
38
lastY =
first
.getYmax() + nStripsInBetween * mMapping.
getStripSize
(0, 0, pc.
firstColumn
, pc.
deId
);
39
}
else
{
40
MpArea
last = mMapping.
stripByLocation
(pc.
lastStrip
, pc.
cathode
, 0, pc.
lastColumn
, pc.
deId
,
false
);
41
lastX = last.getXmax();
42
lastY = (last.getYmax() >
first
.getYmax()) ? last.getYmax() :
first
.getYmax();
43
if
(firstY > last.getYmin()) {
44
firstY = last.getYmin();
45
}
46
}
47
return
MpArea
{firstX, firstY, lastX, lastY};
48
}
49
50
MpArea
PreClusterHelper::getArea
(
int
column,
const
PreCluster
& pc)
const
51
{
53
if
(column > pc.
lastColumn
|| column < pc.
firstColumn
) {
54
throw
std::runtime_error(
"Required column is not in pre-cluster"
);
55
}
56
int
firstStrip = (column > pc.
firstColumn
) ? 0 : pc.
firstStrip
;
57
int
lastStrip = (column < pc.
lastColumn
) ? mMapping.
getNStripsNBP
(column, pc.
deId
) - 1 : pc.
lastStrip
;
58
59
MpArea
first
= mMapping.
stripByLocation
(firstStrip, 1, 0, column, pc.
deId
,
false
);
60
MpArea
last = mMapping.
stripByLocation
(lastStrip, 1, 0, column, pc.
deId
,
false
);
61
return
MpArea
{
first
.getXmin(),
first
.getYmin(), last.getXmax(), last.getYmax()};
62
}
63
64
}
// namespace mid
65
}
// namespace o2
PreClusterHelper.h
Pre-clusters helper for MID.
int
o2::mid::Mapping::getNStripsNBP
int getNStripsNBP(int column, int deId) const
Definition
Mapping.cxx:159
o2::mid::Mapping::getStripSize
double getStripSize(int strip, int cathode, int column, int deId) const
Definition
Mapping.cxx:140
o2::mid::Mapping::stripByLocation
MpArea stripByLocation(int strip, int cathode, int line, int column, int deId, bool warn=true) const
Definition
Mapping.cxx:487
o2::mid::MpArea
Definition
MpArea.h:26
o2::mid::PreClusterHelper::getArea
MpArea getArea(const PreCluster &pc) const
Definition
PreClusterHelper.cxx:23
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::mid::PreCluster
Definition
PreCluster.h:28
o2::mid::PreCluster::firstLine
uint8_t firstLine
First line.
Definition
PreCluster.h:33
o2::mid::PreCluster::cathode
uint8_t cathode
Cathode.
Definition
PreCluster.h:30
o2::mid::PreCluster::firstColumn
uint8_t firstColumn
First column.
Definition
PreCluster.h:31
o2::mid::PreCluster::lastLine
uint8_t lastLine
Last line.
Definition
PreCluster.h:34
o2::mid::PreCluster::lastStrip
uint8_t lastStrip
Last strip.
Definition
PreCluster.h:36
o2::mid::PreCluster::deId
uint8_t deId
Detection element ID.
Definition
PreCluster.h:29
o2::mid::PreCluster::lastColumn
uint8_t lastColumn
Last column.
Definition
PreCluster.h:32
o2::mid::PreCluster::firstStrip
uint8_t firstStrip
First strip.
Definition
PreCluster.h:35
Detectors
MUON
MID
Clustering
src
PreClusterHelper.cxx
Generated on Tue Feb 25 2025 23:16:24 for Project by
1.9.8