Project
Loading...
Searching...
No Matches
TrackMCStudyTypes.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
14namespace o2::trackstudy
15{
16
18
19// get longest number of clusters on consecutive layers
21{
22 if (nITSCl < 2) {
23 return nITSCl;
24 }
25 int longest = 0, current = 0;
26 for (int i = 0; i < 7; i++) {
27 if (pattITSCl & (0x1 << i)) {
28 longest = ++current;
29 } else {
30 current = 0;
31 }
32 }
33 return longest;
34}
35
36// check how many clusters ITS-TPC afterburner could see (consecutively occupied layers starting from the last one)
38{
39 int ncl = 0;
40 if (nITSCl) {
41 for (int i = 6; i > 2; i--) {
42 if (pattITSCl & (0x1 << i)) {
43 ncl++;
44 } else {
45 break;
46 }
47 }
48 }
49 return ncl;
50}
51
52// lowest ITS layer with cluster
54{
55 if (nITSCl) {
56 for (int i = 0; i < 7; i++) {
57 if (pattITSCl & (0x1 << i)) {
58 return i;
59 }
60 }
61 }
62 return -1;
63}
64
65// highest ITS layer with cluster
67{
68 if (nITSCl) {
69 for (int i = 7; i--;) {
70 if (pattITSCl & (0x1 << i)) {
71 return i;
72 }
73 }
74 }
75 return -1;
76}
77
78} // namespace o2::trackstudy
int32_t i