diff --git a/Digi/DigiAlg/src/BuildMCTrackInfo.cpp b/Digi/DigiAlg/src/BuildMCTrackInfo.cpp index 1894d6261eeb5c484b517fdf586374c8f4ceead9..e87abb5944fc40957307bd782547ad2139d68fda 100755 --- a/Digi/DigiAlg/src/BuildMCTrackInfo.cpp +++ b/Digi/DigiAlg/src/BuildMCTrackInfo.cpp @@ -33,6 +33,7 @@ */ class BuildMCTrackInfo final : public GaudiAlgorithm { using GaudiAlgorithm::GaudiAlgorithm; + static constexpr int shiftT = 2; public: StatusCode initialize() override; ///< Algorithm initialization @@ -44,17 +45,17 @@ protected: result |= MCTrackInfo::maskTT1; } else if ( 1 == sta ) { result |= MCTrackInfo::maskTT2; - } else if ( 2 == sta ) { + } else if ( shiftT + 0 == sta ) { if ( isX ) result |= MCTrackInfo::maskT1X; else result |= MCTrackInfo::maskT1S; - } else if ( 3 == sta ) { + } else if ( shiftT + 1 == sta ) { if ( isX ) result |= MCTrackInfo::maskT2X; else result |= MCTrackInfo::maskT2S; - } else if ( 4 == sta ) { + } else if ( shiftT + 2 == sta ) { if ( isX ) result |= MCTrackInfo::maskT3X; else @@ -67,17 +68,17 @@ protected: result |= MCTrackInfo::maskAccTT1; } else if ( 1 == sta ) { result |= MCTrackInfo::maskAccTT2; - } else if ( 2 == sta ) { + } else if ( shiftT + 0 == sta ) { if ( isX ) result |= MCTrackInfo::maskAccT1X; else result |= MCTrackInfo::maskAccT1S; - } else if ( 3 == sta ) { + } else if ( shiftT + 1 == sta ) { if ( isX ) result |= MCTrackInfo::maskAccT2X; else result |= MCTrackInfo::maskAccT2S; - } else if ( 4 == sta ) { + } else if ( shiftT + 2 == sta ) { if ( isX ) result |= MCTrackInfo::maskAccT3X; else @@ -225,13 +226,14 @@ StatusCode BuildMCTrackInfo::execute() { for ( const auto& cluster : clusters->range() ) { LHCb::Detector::FTChannelID channelID = cluster.channelID(); // Create station to be in the range 2-4 - int sta = to_unsigned( channelID.station() ) + 1; + int shiftedStation = channelID.globalStationIdx() + shiftT; for ( auto part = ftLink.first( channelID ); part; part = ftLink.next() ) { if ( mcParts == part->parent() ) { MCNum = part->key(); - updateBit( station[MCNum], sta, channelID.isX() ); + updateBit( station[MCNum], shiftedStation, channelID.isX() ); if ( isVerbose ) - verbose() << "MC " << MCNum << " FT Sta " << sta << " lay " << to_unsigned( channelID.layer() ) << endmsg; + verbose() << "MC " << MCNum << " FT Sta " << shiftedStation << " lay " << to_unsigned( channelID.layer() ) + << endmsg; } } } @@ -343,9 +345,9 @@ void BuildMCTrackInfo::computeAcceptance( std::vector<int>& station ) { << endmsg; continue; } - int sta = ftSta->stationID() + 1; // station 1-3 => 2-4 - bool isX = ftLay->stereoAngle() == 0; - updateAccBit( station[MCNum], sta, isX ); + int shiftedStation = ftSta->stationIdx() + shiftT; // station 0-2 + 2, layerID 0-3 xuvx + bool isX = ( ftLay->layerID() % 4 == 0 || ftLay->layerID() % 4 == 3 ); // FIXME: hardcoded + updateAccBit( station[MCNum], shiftedStation, isX ); } } }