Project
Loading...
Searching...
No Matches
PadRegionInfo.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
12#include <cmath>
13
15
16namespace o2
17{
18namespace tpc
19{
20
21PadRegionInfo::PadRegionInfo(const unsigned char region,
22 const unsigned char partition,
23 const unsigned char numberOfPadRows,
24 const float padHeight,
25 const float padWidth,
26 const float radiusFirstRow,
27 const unsigned char rowOffset,
28 const float xhelper,
29 const unsigned char globalRowOffset)
30 : mRegion{region}, mPartition{partition}, mNumberOfPadRows{numberOfPadRows}, mPadHeight{padHeight}, mPadWidth{padWidth}, mInvPadHeight{1.f / padHeight}, mInvPadWidth{1.f / padWidth}, mRadiusFirstRow{radiusFirstRow}, mRowOffset{rowOffset}, mXhelper{xhelper}, mNumberOfPads{0}, mGlobalRowOffset{globalRowOffset}, mPadsPerRow(numberOfPadRows)
31{
32 init();
33}
34
35void PadRegionInfo::init()
36{
37
38 const float ks = mPadHeight / mPadWidth * tan(1.74532925199432948e-01); // tan(10deg)
39 // initialize number of pads per row
40 for (unsigned char irow = 0; irow < mNumberOfPadRows; ++irow) {
41 mPadsPerRow[irow] = 2 * std::floor(ks * (irow + mRowOffset) + mXhelper);
42 mNumberOfPads += mPadsPerRow[irow];
43 }
44}
45
46} // namespace tpc
47} // namespace o2
PadRegionInfo()=default
default constructor
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...