Newer
Older
/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
Sergei Zharko
committed
SPDX-License-Identifier: GPL-3.0-only
Authors: Sergey Gorbunov, Sergei Zharko [committer] */
/************************************************************************************************************
* @file L1Constants.h
* @brief Compile-time constants definition for the L1 tracking algorithm
* @since 02.06.2022
* @author S.Zharko <s.zharko@gsi.de>
***********************************************************************************************************/
#ifndef L1Constants_h
#define L1Constants_h 1
Sergei Zharko
committed
/// Namespace contains compile-time constants definition for the L1 tracking algorithm
namespace L1Constants
{
Sergei Zharko
committed
/// Array sizes
namespace size
{
Sergei Zharko
committed
/// Amount of coefficients in field approximations
constexpr int kMaxNFieldApproxCoefficients {21}; // TODO: May be it is better to use the polynomial
// order instead of this?
Sergei Zharko
committed
/// Order of polynomial to approximate field in the vicinity of station plane
constexpr int kMaxFieldApproxPolynomialOrder {5};
Sergei Zharko
committed
/// Amount of bits to code a station, thread or triplet. This values determine the ma
Sergei Zharko
committed
constexpr unsigned int kStationBits = 6u; ///< Amount of bits to code one station
constexpr unsigned int kThreadBits = 6u; ///< Amount of bits to code one thread
constexpr unsigned int kTripletBits = 32u - kStationBits - kThreadBits; ///< Amount of bits to code one triplet
constexpr int kMaxNdetectors = 5; ///< Max number of tracking detectors
constexpr int kMaxNstations = 1u << kStationBits; ///< Max number of stations, 2^6 = 64
constexpr int kMaxNthreads = 1u << kThreadBits; ///< Max number of threads, 2^6 = 64
constexpr int kMaxNtriplets = 1u << kTripletBits; ///< Max number of triplets, 2^20 = 1,048,576
// TODO: Clarify the meaning of these coefficients
constexpr int kCoeff = 64 / 4; ///< TODO:
constexpr int kPortionLeftHits = 1024 / kCoeff; ///< portion of left hits
constexpr int kPortionLeftHitsP = 1024 / kCoeff / fvec::size(); ///< portion of left hits per one vector word
constexpr int kMaxPortionDoublets = 10000 / 5 * 64 / 2 / kCoeff; ///< Max size of the doublets portion
constexpr int kMaxPortionTriplets = 10000 * 5 * 64 / 2 / kCoeff; ///< Max size of the triplets portion
constexpr int kMaxPortionTripletsP = kMaxPortionTriplets / fvec::size(); ///< Max size of the triplets portion
} // namespace size
Sergei Zharko
committed
/// Control flags
namespace control
{
Sergei Zharko
committed
/// Flag for the radiation length tables usage
Sergei Zharko
committed
/// true - material budget tables will be used,
Sergei Zharko
committed
/// false - basic station material info is used
constexpr bool kIfUseRadLengthTable {true};
/// Flag for calling the CAMergeClones procedure ... TODO
constexpr bool kIfMergeClones {true};
/// Flag: input data QA level
/// - 0: no checks will be done
/// - 1: only number of hits and strips as well as validity of hits first and last indexes will be checked
/// - 2: hits sorting is checked
/// - 3: every hit is checked for consistency
/// \note The larger Level corresponds to more precise checks, but is followed by larger time penalty
constexpr int kInputDataQaLevel = 0; // WARNING: other options does not work properly, more tests are needed!
Sergei Zharko
committed
} // namespace control
Sergei Zharko
committed
/// Physics constants
namespace phys
{
/* Particle masses used for track fit */
Sergei Zharko
committed
constexpr float kMuonMass = 0.10565800f; ///< Muon mass [GeV/c2]
constexpr float kElectronMass = 0.000511f; ///< Electron mass [GeV/c2]
} // namespace phys
Sergei Zharko
committed
Sergei Zharko
committed
/// Miscellaneous constants
namespace misc
{
constexpr int kAssertionLevel = 0; ///< Assertion level
constexpr int kAlignment = 16; ///< Default alignment of data (bytes)
} // namespace misc
/// NoInit constants (aliases)
Sergei Zharko
committed
constexpr float kF = L1NaN::SetNaN<float>();
constexpr double kD = L1NaN::SetNaN<double>();
constexpr int k32I = L1NaN::SetNaN<int>();
constexpr unsigned int k32U = L1NaN::SetNaN<unsigned int>();
} // end namespace L1Constants
Sergei Zharko
committed
#endif // L1Constants_h