ATLAS Offline Software
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
ITkPixelByteStreamCnv
src
ITkPixLayout.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*
5
* Author: Ondra Kovanda, ondrej.kovanda at cern.ch
6
* Date: 04/2024
7
* Description: ITkPix* chip layout template. This aims for a contiguously stored
8
* array of arbitrary type, representing the individual pixels in
9
* ITkPix* chips with a 'physically' motivated (col, row) access
10
*/
11
12
#ifndef ITKPIXLAYOUT_H
13
#define ITKPIXLAYOUT_H
14
15
#include <array>
16
#include <cstdint>
17
18
template
<
class
T>
class
ITkPixLayout
{
19
20
public
:
21
22
ITkPixLayout
(){};
23
24
T&
operator()
(
const
uint16_t col,
const
uint16_t row){
25
26
//Columns are stored after one another
27
return
m_pixels
[ col * 384 + row ];
28
29
}
30
31
T
operator()
(
const
uint16_t col,
const
uint16_t row)
const
{
32
33
//Columns are stored after one another
34
return
m_pixels
[ col * 384 + row ];
35
36
}
37
38
int
nHits
()
const
{
39
40
//count hits
41
int
hits = 0;
42
for
(
const
auto
&
pixel
:
m_pixels
)
if
(
pixel
) hits++;
43
return
hits;
44
45
}
46
47
private
:
48
49
//All chips will always have 400*384 pixels
50
std::array<T, 153600>
m_pixels
= {};
51
52
};
53
54
#endif
SiliconTech::pixel
@ pixel
Definition
FPGATrackSimTypes.h:25
ITkPixLayout::operator()
T operator()(const uint16_t col, const uint16_t row) const
Definition
ITkPixLayout.h:31
ITkPixLayout::operator()
T & operator()(const uint16_t col, const uint16_t row)
Definition
ITkPixLayout.h:24
ITkPixLayout::nHits
int nHits() const
Definition
ITkPixLayout.h:38
ITkPixLayout< uint16_t >::m_pixels
std::array< uint16_t, 153600 > m_pixels
Definition
ITkPixLayout.h:50
ITkPixLayout::ITkPixLayout
ITkPixLayout()
Definition
ITkPixLayout.h:22
Generated on
for ATLAS Offline Software by
1.14.0