Skip to content
Snippets Groups Projects
Commit ba1d8b04 authored by Louis Henry's avatar Louis Henry
Browse files

Add specific constructor to FTSourceID from a layer and a local bank index in the layer

parent 433720a6
No related branches found
No related tags found
No related merge requests found
Pipeline #6036589 failed with stages
in 5 minutes
......@@ -95,6 +95,18 @@ namespace LHCb::Detector {
shift<Mask::quarter>( quarter ) | shift<Mask::dataLink>( dataLink ) | shift<Mask::port>( port );
}
/// Explicit constructor from the layer and the position in the layer
constexpr FTSourceID( FTChannelID::StationID station, FTChannelID::LayerID layer, unsigned int localBankIdx_layer ) {
auto quarter = FTChannelID::QuarterID{localBankIdx_layer/FTConstants::RawBank::BankProperties::NbBanksPerQuarter};
unsigned int iBankInQuarter = localBankIdx_layer % FTConstants::RawBank::BankProperties::NbBanksPerQuarter;
unsigned int dataLink = (iBankInQuarter == 0)? 0 : 1+(iBankInQuarter-1)/2;
unsigned int port = (iBankInQuarter == 0)? 0 : iBankInQuarter-1 % 2;
unsigned int sourceHeader =
is_left( quarter ) ? LHCb::Detector::FT::RawBank::leftHeader : LHCb::Detector::FT::RawBank::rightHeader;
m_sourceID = shift<Mask::header>( sourceHeader ) | shift<Mask::station>( station ) | shift<Mask::layer>( layer ) |
shift<Mask::quarter>( quarter ) | shift<Mask::dataLink>( dataLink ) | shift<Mask::port>( port );
}
/// Explicit constructor from geometrical location string
/// Assumes a 'name' formatted as TxLxQxDxPx
constexpr FTSourceID( std::string_view name )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment