From 782ea2aebcb0c3ab6276f1da18bfd28c580b9d34 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:55:55 +0100 Subject: [PATCH 01/38] Solved includes conflicts --- FT/FTMonitors/src/FTClusterMonitor.cpp | 12 ++-- FT/FTMonitors/src/FTDigitMonitor.cpp | 16 ++--- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 12 ++-- Pr/PrAlgorithms/src/PrForwardTracking.cpp | 6 +- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 67 +++++++++++++++++++ Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 6 +- Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp | 3 +- .../include/PrKernel/PrFTZoneHandler.h | 6 +- Pr/PrMCTools/src/PrClustersResidual.cpp | 6 +- Pr/PrMCTools/src/PrFTHitsMonitor.cpp | 12 ++-- Pr/PrMCTools/src/PrPlotFTHits.cpp | 6 +- .../src/SciFiTrackForwarding.cpp | 8 +-- .../src/ParameterizedKalmanFit.cpp | 4 +- Tr/TrackTools/src/FTHitExpectation.cpp | 6 +- Tr/TrackTools/src/FTMeasurementProvider.cpp | 6 +- 15 files changed, 124 insertions(+), 52 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index 381616b4c0..f6f39a802f 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -10,7 +10,7 @@ \*****************************************************************************/ #include "Event/FTLiteCluster.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" @@ -38,14 +38,14 @@ namespace { } // namespace class FTClusterMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; - void operator()( const FTLiteClusters&, const DeFTDetector& ) const override; + void operator()( const FTLiteClusters&, const DeFT& ) const override; private: AIDA::IHistogram1D* m_lcps = nullptr; @@ -91,7 +91,7 @@ DECLARE_COMPONENT( FTClusterMonitor ) FTClusterMonitor::FTClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ) : Consumer( name, pSvcLocator, {KeyValue{"ClusterLocation", LHCb::FTLiteClusterLocation::Default}, - KeyValue{"FTDetectorLocation", DeFTDetectorLocation::Default}} ) {} + KeyValue{"FTDetectorLocation", DeFTLocation::Default}} ) {} //============================================================================= StatusCode FTClusterMonitor::initialize() { @@ -181,7 +181,7 @@ StatusCode FTClusterMonitor::initialize() { } //============================================================================= -void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFTDetector& deFT ) const { +void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& deFT ) const { if ( deFT.version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index 4980d4e9b0..3ac6c30544 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -10,7 +10,7 @@ \*****************************************************************************/ // Include files #include "Event/FTDigit.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" @@ -32,16 +32,16 @@ */ class FTDigitMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTDigitMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; - void operator()( const LHCb::FTDigit::FTDigits& digits, const DeFTDetector& ) const override; + void operator()( const LHCb::FTDigit::FTDigits& digits, const DeFT& ) const override; private: - void fillHistograms( const LHCb::FTDigit& Digit, const DeFTDetector& deFT ) const; + void fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deFT ) const; }; // Declaration of the Algorithm Factory @@ -50,7 +50,7 @@ DECLARE_COMPONENT( FTDigitMonitor ) FTDigitMonitor::FTDigitMonitor( const std::string& name, ISvcLocator* pSvcLocator ) : Consumer( name, pSvcLocator, {KeyValue{"DigitLocation", LHCb::FTDigitLocation::Default}, - KeyValue{"FTDetectorLocation", DeFTDetectorLocation::Default}} ) {} + KeyValue{"FTDetectorLocation", DeFTLocation::Default}} ) {} //============================================================================= // Initialization //============================================================================= @@ -63,7 +63,7 @@ StatusCode FTDigitMonitor::initialize() { //============================================================================= // Main execution //============================================================================= -void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, const DeFTDetector& deFT ) const { +void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, const DeFT& deFT ) const { if ( deFT.version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; @@ -71,7 +71,7 @@ void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, cons plot( DigitsCont.size(), "nDigits", "Number of digits; Digits/event; Events", 0., 60e3, 50 ); } -void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFTDetector& deFT ) const { +void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deFT ) const { plot( Digit.adcCount(), "ADCCounts", "Charge in 2bit ADC; Charge/digit [ADC]; Number of digits", -0.5, 3.5, 4 ); diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index b9caa6c014..f1eb6f6660 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -19,7 +19,7 @@ // from LHCb #include "Event/FTLiteCluster.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "Kernel/FTChannelID.h" #include "Kernel/FastClusterContainer.h" @@ -45,15 +45,15 @@ namespace { } // namespace class FTNZSClusterMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTNZSClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; void operator()( const FTLiteClusters& clustersNZS, const FTLiteClusters& clustersNZSdigits, - const DeFTDetector& deFT ) const override; + const DeFT& deFT ) const override; private: FTNZSHist createFTNZSHist( string histName, string histTitle, string xAxis, string yAxis, float xMin, float xMax, @@ -101,7 +101,7 @@ FTNZSClusterMonitor::FTNZSClusterMonitor( const string& name, ISvcLocator* pSvcL : Consumer( name, pSvcLocator, {KeyValue{"ClusterLocationNZS", LHCb::FTLiteClusterLocation::Default + "NZS"}, KeyValue{"ClusterLocationfromNZSdigits", LHCb::FTLiteClusterLocation::Default + "fromNZSdigits"}, - KeyValue{"FTDetectorLocation", DeFTDetectorLocation::Default}} ) {} + KeyValue{"FTDetectorLocation", DeFTLocation::Default}} ) {} //============================================================================= StatusCode FTNZSClusterMonitor::initialize() { @@ -210,7 +210,7 @@ StatusCode FTNZSClusterMonitor::initialize() { //============================================================================= void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const FTLiteClusters& clustersNZSdigits, - const DeFTDetector& deFT ) const { + const DeFT& deFT ) const { if ( deFT.version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); diff --git a/Pr/PrAlgorithms/src/PrForwardTracking.cpp b/Pr/PrAlgorithms/src/PrForwardTracking.cpp index 220e272f87..6e14408822 100644 --- a/Pr/PrAlgorithms/src/PrForwardTracking.cpp +++ b/Pr/PrAlgorithms/src/PrForwardTracking.cpp @@ -22,7 +22,7 @@ #include "Event/StateVector.h" #include "Event/Track.h" #include "FTDAQ/FTInfo.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "Kernel/ILHCbMagnetSvc.h" #include "LHCbMath/SIMDWrapper.h" @@ -1786,8 +1786,8 @@ namespace LHCb::Pr::Forward { StatusCode initialize() override { auto sc = base_class_t::initialize(); if ( sc.isFailure() ) return sc; - this->template addConditionDerivation( - {DeFTDetectorLocation::Default}, this->template inputLocation() ); + this->template addConditionDerivation( + {DeFTLocation::Default}, this->template inputLocation() ); return sc; } diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index def776a63e..fa7d4b3e9c 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -20,6 +20,7 @@ #include "DetDesc/Condition.h" #include "Event/FTCluster.h" #include "Event/FTLiteCluster.h" +#include "DetDesc/ConditionAccessorHolder.h" #include "Event/PrSciFiHits.h" #include "Event/PrSeedTracks.h" #include "Event/StateParameters.h" @@ -842,10 +843,76 @@ namespace LHCb::Pr { return StatusCode::FAILURE; } +<<<<<<< HEAD // Zones cache, retrieved from the detector store // Zones cache this->template addConditionDerivation( {DeFTDetectorLocation::Default}, this->template inputLocation() ); +======= + // Zones cache, retrieved from the detector store + // Zones cache + this->template addConditionDerivation( {DeFTLocation::Default}, + this->template inputLocation() ); + + return StatusCode::SUCCESS; +} + +//============================================================================= +// Main execution +//============================================================================= +Tracks PrHybridSeeding::operator()( const PrSciFiHits& hits, ZoneCache const& zoneCache ) const { + + // Containers + TrackCandidates trackCandidates; //---LoH: probably could be changed to array(static_vector) + XCandidates xCandidates; //---LoH: probably could be changed to static_vector + TrackToRecover trackToRecover; //---LoH: probably could be changed to static_vector + + trackCandidates[0].reserve( m_nTrackCandidates ); + trackCandidates[1].reserve( m_nTrackCandidates ); + xCandidates[0].reserve( m_nXTrackCandidates ); + xCandidates[1].reserve( m_nXTrackCandidates ); + trackToRecover[0].reserve( m_nXTrackCandidates ); + trackToRecover[1].reserve( m_nXTrackCandidates ); + + //========================================================== + // Hits are ready to be processed + //========================================================== + unsigned int nHits = hits.size(); + PrFTHitHandler oriHitHandler = makeHitHandler( hits ); + SmallDexes oriSmallDexes( nHits, 0 ); + updateSmallDexes( oriSmallDexes, oriHitHandler ); + + PrFTHitHandler tmpHitHandler; + SmallDexes smallDexes = oriSmallDexes; + + PrFTHitHandler* hitHandler = &oriHitHandler; + //======================================================== + //------------------MAIN SEQUENCE IS HERE----------------- + //======================================================== + auto main_loop = [&]( auto icase ) { + //----- Loop through lower and upper half + std::array nTracksBefore; + for ( unsigned int part = 0; nParts > part; ++part ) { + nTracksBefore[part] = trackCandidates[part].size(); + xCandidates[part].clear(); // x candidates up cleaned every Case! + findXProjections( hits, zoneCache, part, icase, *hitHandler, xCandidates ); + if ( m_removeClonesX ) { + removeClonesX( part, xCandidates ); + } //---LoH: this probably should be encoded in the logic. Clone tracks are close to each other. + addStereo addStereoCase( *this, trackToRecover ); + addStereoCase( hits, zoneCache, part, *hitHandler, trackCandidates, xCandidates ); + } + // Flag found Hits at the end of each single case ( exclude the latest one ) + if ( ( icase + 1 < NCases ) ) { + for ( unsigned int part = 0; nParts > part; ++part ) + flagHits( icase, part, trackCandidates, nTracksBefore[part], hits, smallDexes, *hitHandler ); + tmpHitHandler = consolidateHitHandler( *hitHandler ); + hitHandler = &tmpHitHandler; + updateSmallDexes( smallDexes, *hitHandler ); + } + }; + LHCb::Utils::unwind<0, NCases>( main_loop ); +>>>>>>> 5e250dcf9 (Removing DeFTDetector mentions. Need to adapt findMat, findModule, DeFTLocation) return sc; } diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 0c6748f867..50885094b4 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -12,7 +12,7 @@ #include "DetDesc/Condition.h" #include "DetDesc/ConditionAccessorHolder.h" #include "Event/FTLiteCluster.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiAlg/Transformer.h" #include "PrKernel/FTMatsCache.h" #include "PrKernel/PrFTHitHandler.h" @@ -50,7 +50,7 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, + addConditionDerivation( {DeFTLocation::Default}, inputLocation() ); std::array clusRes = {0.05, 0.08, 0.11, 0.14, 0.17, 0.20, 0.23, 0.26, 0.29}; if ( m_updatedRes ) { clusRes = {0.5, 0.1, 0.1, 0.1, 0.080, 0.163, 0.38, 0.48, 0.58}; } @@ -76,7 +76,7 @@ PrFTHitHandler PrStoreFTHit::operator()( const FTLiteClusters& clusters, PrFTHitHandler hitHandler( clusters.size() ); if ( msgLevel( MSG::DEBUG ) ) debug() << "Retrieved " << clusters.size() << " clusters" << endmsg; - for ( uint16_t iQuarter = 0; iQuarter < DeFTDetector::nQuarters; ++iQuarter ) { + for ( uint16_t iQuarter = 0; iQuarter < DeFT::nQuarters; ++iQuarter ) { uint info = ( iQuarter >> 1 ) | ( ( ( iQuarter << 4 ) ^ ( iQuarter << 5 ) ^ 128u ) & 128u ); auto r = ranges::views::transform( clusters.range( iQuarter ), [&]( LHCb::FTLiteCluster clus ) -> PrHit { diff --git a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp index 6a0f444b18..dd204ea0b6 100644 --- a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp +++ b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp @@ -13,6 +13,7 @@ #include "Event/PrSciFiHits.h" #include "FTDAQ/FTInfo.h" #include "FTDet/DeFTDetector.h" +#include "GaudiAlg/Transformer.h" #include "Kernel/FTChannelID.h" #include "Kernel/LHCbID.h" #include "LHCbAlgs/Transformer.h" @@ -54,7 +55,7 @@ namespace LHCb::Pr::FT { StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, + addConditionDerivation( {DeFTLocation::Default}, inputLocation() ); } ); } diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index 500498367a..a669dbbc01 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -12,7 +12,7 @@ // Include files #include "FTDAQ/FTInfo.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "Kernel/DetectorSegment.h" #include "PrKernel/PrHitZone.h" @@ -33,7 +33,7 @@ namespace FTZoneCache { class PrFTZoneHandler final { public: - PrFTZoneHandler( DeFTDetector const& ftDet ) { + PrFTZoneHandler( DeFT const& ftDet ) { for ( auto station : ftDet.stations() ) { for ( auto layer : station->layers() ) { int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); @@ -102,7 +102,7 @@ namespace FTZoneCache { std::array zoneDzDy{std::numeric_limits::signaling_NaN()}; std::array zoneZPos{std::numeric_limits::signaling_NaN()}; ZoneCache() = default; // Needed by DD4hep even if unused ! - ZoneCache( const DeFTDetector& ftDet ) : handler( ftDet ) { + ZoneCache( const DeFT& ftDet ) : handler( ftDet ) { for ( int i{0}; i < PrFTInfo::NFTLayers; ++i ) { zoneZPos[2 * i] = handler.zone( 2 * i ).z(); zoneZPos[2 * i + 1] = handler.zone( 2 * i + 1 ).z(); diff --git a/Pr/PrMCTools/src/PrClustersResidual.cpp b/Pr/PrMCTools/src/PrClustersResidual.cpp index 1df8fbde4a..7383de46b9 100644 --- a/Pr/PrMCTools/src/PrClustersResidual.cpp +++ b/Pr/PrMCTools/src/PrClustersResidual.cpp @@ -17,7 +17,7 @@ #include "Event/ODIN.h" #include "Event/Track.h" #include "FTDAQ/FTInfo.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiAlg/GaudiHistoTool.h" #include "GaudiAlg/GaudiTupleAlg.h" #include "Kernel/FTChannelID.h" @@ -135,7 +135,7 @@ private: DataObjectReadHandle> m_HitsInTES{this, "PrFTHitHandler", "/Event/FT/FTHits"}; // need the ftDet to produce the pseudochannel conversion numbering in occupancy plot for v61 - DeFTDetector* m_ftDet = nullptr; + DeFT* m_ftDet = nullptr; }; // Declaration of the Algorithm Factory @@ -169,7 +169,7 @@ StatusCode PrClustersResidual::initialize() { // Main execution //============================================================================= StatusCode PrClustersResidual::execute() { - m_ftDet = getDet( DeFTDetectorLocation::Default ); + m_ftDet = getDet( DeFTLocation::Default ); if ( !m_ftDet ) { error() << " Cannot load the FTDetector from default location" << endmsg; return StatusCode::FAILURE; diff --git a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp index 0f4868011f..875767d8f5 100644 --- a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp +++ b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp @@ -16,7 +16,7 @@ #include "Event/LinksByKey.h" #include "Event/MCHit.h" #include "Event/MCParticle.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/MsgStream.h" @@ -57,8 +57,8 @@ namespace { class PrFTHitsMonitor final : public Gaudi::Functional::Consumer> { + const MCHits&, const MCParticles&, const DeFT& ), + LHCb::DetDesc::usesBaseAndConditions> { public: PrFTHitsMonitor( const std::string& name, ISvcLocator* pSvcLocator ) : Consumer( name, pSvcLocator, @@ -67,10 +67,10 @@ public: KeyValue{"FTHits2MCHitLinksLocation", LHCb::FTLiteClusterLocation::Default + "2MCHits"}, KeyValue{"MCHitsLocation", LHCb::MCHitLocation::FT}, KeyValue{"MCParticleLocation", LHCb::MCParticleLocation::Default}, - KeyValue{"DeFT", DeFTDetectorLocation::Default}} ) {} + KeyValue{"DeFT", DeFTLocation::Default}} ) {} void operator()( const FTHits&, const FTLiteClusters&, const LHCb::LinksByKey&, const MCHits&, const MCParticles&, - const DeFTDetector& ) const override; + const DeFT& ) const override; Gaudi::Property m_isGlobal{this, "isGlobal", true, "Boolean for choosing global coordinate system"}; Gaudi::Property m_performStudy{this, "performStudy", false, @@ -83,7 +83,7 @@ public: DECLARE_COMPONENT( PrFTHitsMonitor ) void PrFTHitsMonitor::operator()( const FTHits& FThits, const FTLiteClusters& clusters, const LHCb::LinksByKey& links, - const MCHits& mchits, const MCParticles&, const DeFTDetector& DeFT ) const { + const MCHits& mchits, const MCParticles&, const DeFT& DeFT ) const { std::map> mcHitForId; links.applyToAllLinks( [&mcHitForId, &mchits]( unsigned int id, unsigned int mcHitKey, float ) { diff --git a/Pr/PrMCTools/src/PrPlotFTHits.cpp b/Pr/PrMCTools/src/PrPlotFTHits.cpp index b15733ab3f..79756dc20a 100644 --- a/Pr/PrMCTools/src/PrPlotFTHits.cpp +++ b/Pr/PrMCTools/src/PrPlotFTHits.cpp @@ -19,7 +19,11 @@ #include "Event/MCVertex.h" #include "Event/Track.h" #include "FTDAQ/FTInfo.h" -#include "FTDet/DeFTDetector.h" +#include "GaudiAlg/GaudiAlgorithm.h" +#include "GaudiAlg/GaudiHistoAlg.h" +#include "GaudiAlg/GaudiHistoTool.h" +#include "GaudiAlg/IHistoTool.h" +#include "GaudiKernel/AnyDataHandle.h" #include "Linker/AllLinks.h" #include "Linker/LinkedFrom.h" #include "Linker/LinkedTo.h" diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index 62ee00d75f..87f30b5cc4 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -16,7 +16,7 @@ #include "Event/PrLongTracks.h" #include "Event/PrUpstreamTracks.h" #include "Event/StateParameters.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "Kernel/ILHCbMagnetSvc.h" #include "PrKernel/PrFTZoneHandler.h" @@ -118,7 +118,7 @@ namespace { FTZoneCache::PrFTZoneHandler zoneHandler; - GeomCache( DeFTDetector const& ftDet ) : zoneHandler( ftDet ) { + GeomCache( DeFT const& ftDet ) : zoneHandler( ftDet ) { // get the layer z-positions and slopes to cache them for later usage for ( int i{0}; i < 12; ++i ) { // the first 12 values are the bottom layers @@ -483,8 +483,8 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, - inputLocation() ); + addConditionDerivation( {DeFTLocation::Default}, + inputLocation() ); // factor of -1 because everything was trained with magdown, so for magdown we want factor = 1, magup = -1 m_magscalefactor = -1 * m_magFieldSvc->signedRelativeCurrent(); diff --git a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp index 53cb13fcdb..b5e9ba6d71 100644 --- a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp +++ b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp @@ -11,7 +11,7 @@ // Include files #include "Event/ODIN.h" #include "Event/State.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "Kernel/Trajectory.h" #include "LHCbMath/Similarity.h" @@ -51,7 +51,7 @@ StatusCode ParameterizedKalmanFit::initialize() { if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; // Check the FT geometry version - DeFTDetector* m_deFT = getDet( DeFTDetectorLocation::Default ); + DeFT* m_deFT = getDet( DeFTLocation::Default ); if ( m_deFT->version() < 62 ) { error() << "This version requires FTDet v6.2 or higher" << endmsg; return StatusCode::FAILURE; diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index 8576209820..a3c13f93f6 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -19,7 +19,7 @@ #include "Event/State.h" #include "Event/Track.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiKernel/SystemOfUnits.h" #include "LHCbMath/GeomFun.h" #include "Line.h" @@ -72,7 +72,7 @@ private: Gaudi::XYZPoint intersection( const Tf::Tsa::Line3D& line, const Gaudi::Plane3D& aPlane ) const; - DeFTDetector* m_ftDet = nullptr; + DeFT* m_ftDet = nullptr; }; DECLARE_COMPONENT( FTHitExpectation ) @@ -85,7 +85,7 @@ StatusCode FTHitExpectation::initialize() { if ( sc.isFailure() ) return Error( "Failed to initialize", sc ); // Get all layers (need to know the z-plane of each layer) - m_ftDet = getDet( DeFTDetectorLocation::Default ); + m_ftDet = getDet( DeFTLocation::Default ); if ( m_ftDet->version() < 61 ) return Error( "This version requires FTDet v6.1 or higher", StatusCode::FAILURE ); return StatusCode::SUCCESS; diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index bdc504a974..81ee65242d 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -20,7 +20,7 @@ #include "MeasurementProviderProjector.h" #include "Event/FTLiteCluster.h" -#include "FTDet/DeFTDetector.h" +#include "Detector/DeFT.h" #include "GaudiAlg/GaudiTool.h" #include "GaudiKernel/DataObjectHandle.h" @@ -38,7 +38,7 @@ public: } private: - const DeFTDetector* m_det = nullptr; + const DeFT* m_det = nullptr; DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; @@ -58,7 +58,7 @@ StatusCode FTMeasurementProvider::initialize() { if ( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); } // Retrieve the detector element - m_det = getDet( DeFTDetectorLocation::Default ); + m_det = getDet( DeFTLocation::Default ); setProperty( "Tolerance", 0.002 * Gaudi::Units::mm ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return sc; -- GitLab From b6b79b674f9757a9f7268450b731b7da811f811e Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:46:05 +0100 Subject: [PATCH 02/38] Reverted to FTDet/DeFT --- FT/FTMonitors/src/FTClusterMonitor.cpp | 20 ++++++++++++------- FT/FTMonitors/src/FTDigitMonitor.cpp | 24 ++++++++++++++--------- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 22 +++++++++++++-------- Pr/PrAlgorithms/src/PrForwardTracking.cpp | 8 +++++++- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 8 +++++++- Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp | 8 ++++++++ 6 files changed, 64 insertions(+), 26 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index f6f39a802f..20778f4048 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -10,7 +10,13 @@ \*****************************************************************************/ #include "Event/FTLiteCluster.h" -#include "Detector/DeFT.h" +#ifdef USE_DD4HEP +# include "Detector/FT/DeFT.h" +using DeFT = LHCb::Detector::DeFT; +#else +#include "FTDet/DeFTDetector.h" +using DeFT = DeFTDetector; +#endif #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" @@ -38,14 +44,14 @@ namespace { } // namespace class FTClusterMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; - void operator()( const FTLiteClusters&, const DeFT& ) const override; + void operator()( const FTLiteClusters&, const LHCb::Detector::DeFT& ) const override; private: AIDA::IHistogram1D* m_lcps = nullptr; @@ -181,9 +187,9 @@ StatusCode FTClusterMonitor::initialize() { } //============================================================================= -void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& deFT ) const { +void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const LHCb::Detector::DeFT& deFT ) const { - if ( deFT.version() < 61 ) { + if ( deFT->version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; @@ -194,7 +200,7 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d // Loop over FTLiteCluster for ( const auto& cluster : clusters.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const DeFTModule* mod = deFT.findModule( chanID ); + const LHCb::Detector::DeFTModule* mod = deFT->findModule( chanID ); size_t q_ID = chanID.moniModuleID(); uint SiPM_ID = chanID.moniSiPMID(); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index 3ac6c30544..aae8098a60 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -10,7 +10,13 @@ \*****************************************************************************/ // Include files #include "Event/FTDigit.h" -#include "Detector/DeFT.h" +#ifdef USE_DD4HEP +# include "Detector/FT/DeFT.h" +using DeFT = LHCb::Detector::DeFT; +#else +#include "FTDet/DeFTDetector.h" +using DeFT = DeFTDetector; +#endif #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" @@ -32,16 +38,16 @@ */ class FTDigitMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTDigitMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; - void operator()( const LHCb::FTDigit::FTDigits& digits, const DeFT& ) const override; + void operator()( const LHCb::FTDigit::FTDigits& digits, const LHCb::Detector::DeFT& ) const override; private: - void fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deFT ) const; + void fillHistograms( const LHCb::FTDigit& Digit, const LHCb::Detector::DeFT& deFT ) const; }; // Declaration of the Algorithm Factory @@ -63,15 +69,15 @@ StatusCode FTDigitMonitor::initialize() { //============================================================================= // Main execution //============================================================================= -void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, const DeFT& deFT ) const { - if ( deFT.version() < 61 ) { +void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, const LHCb::Detector::DeFT& deFT ) const { + if ( deFT->version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; for ( const auto& Digit : DigitsCont.range() ) { fillHistograms( Digit, deFT ); } plot( DigitsCont.size(), "nDigits", "Number of digits; Digits/event; Events", 0., 60e3, 50 ); } -void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deFT ) const { +void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const LHCb::Detector::DeFT& deFT ) const { plot( Digit.adcCount(), "ADCCounts", "Charge in 2bit ADC; Charge/digit [ADC]; Number of digits", -0.5, 3.5, 4 ); @@ -82,7 +88,7 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deF plot( (float)chanID.sipmInModule(), "DigitsPerSiPM", "Digits per SiPM; SiPMID; Digits", -0.5, 15.5, 16 ); plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); - const DeFTModule* module = deFT.findModule( chanID ); + const LHCb::Detector::DeFTModule* module = deFT->findModule( chanID ); if ( module != nullptr ) { int pseudoChannel = module->pseudoChannel( chanID ); plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index f1eb6f6660..7cbaa5ae71 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -19,7 +19,13 @@ // from LHCb #include "Event/FTLiteCluster.h" -#include "Detector/DeFT.h" +#ifdef USE_DD4HEP +# include "Detector/FT/DeFT.h" +using DeFT = LHCb::Detector::DeFT; +#else +#include "FTDet/DeFTDetector.h" +using DeFT = DeFTDetector; +#endif #include "Kernel/FTChannelID.h" #include "Kernel/FastClusterContainer.h" @@ -45,15 +51,15 @@ namespace { } // namespace class FTNZSClusterMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTNZSClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; void operator()( const FTLiteClusters& clustersNZS, const FTLiteClusters& clustersNZSdigits, - const DeFT& deFT ) const override; + const LHCb::Detector::DeFT& deFT ) const override; private: FTNZSHist createFTNZSHist( string histName, string histTitle, string xAxis, string yAxis, float xMin, float xMax, @@ -210,9 +216,9 @@ StatusCode FTNZSClusterMonitor::initialize() { //============================================================================= void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const FTLiteClusters& clustersNZSdigits, - const DeFT& deFT ) const { + const LHCb::Detector::DeFT& deFT ) const { - if ( deFT.version() < 61 ) { + if ( deFT->version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; @@ -225,7 +231,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F // Loop over NZS FTLiteCluster for ( const auto& cluster : clustersNZS.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const DeFTModule* mod = deFT.findModule( chanID ); + const LHCb::Detector::DeFTModule* mod = deFT->findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); @@ -273,7 +279,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F clustersInSiPM = 0; for ( const auto& cluster : clustersNZSdigits.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const DeFTModule* mod = deFT.findModule( chanID ); + const LHCb::Detector::DeFTModule* mod = deFT->findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); diff --git a/Pr/PrAlgorithms/src/PrForwardTracking.cpp b/Pr/PrAlgorithms/src/PrForwardTracking.cpp index 6e14408822..fd339f7749 100644 --- a/Pr/PrAlgorithms/src/PrForwardTracking.cpp +++ b/Pr/PrAlgorithms/src/PrForwardTracking.cpp @@ -22,7 +22,13 @@ #include "Event/StateVector.h" #include "Event/Track.h" #include "FTDAQ/FTInfo.h" -#include "Detector/DeFT.h" +#ifdef USE_DD4HEP +# include "Detector/FT/DeFT.h" +using DeFT = LHCb::Detector::DeFT; +#else +#include "FTDet/DeFTDetector.h" +using DeFT = DeFTDetector; +#endif #include "Kernel/ILHCbMagnetSvc.h" #include "LHCbMath/SIMDWrapper.h" diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 50885094b4..6030f3557d 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -12,7 +12,13 @@ #include "DetDesc/Condition.h" #include "DetDesc/ConditionAccessorHolder.h" #include "Event/FTLiteCluster.h" -#include "Detector/DeFT.h" +#ifdef USE_DD4HEP +# include "Detector/FT/DeFT.h" +using DeFT = LHCb::Detector::DeFT; +#else +#include "FTDet/DeFTDetector.h" +using DeFT = DeFTDetector; +#endif #include "GaudiAlg/Transformer.h" #include "PrKernel/FTMatsCache.h" #include "PrKernel/PrFTHitHandler.h" diff --git a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp index dd204ea0b6..dda31f79c3 100644 --- a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp +++ b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp @@ -20,6 +20,14 @@ #include "LHCbMath/bit_cast.h" #include "PrKernel/FTMatsCache.h" +#ifdef USE_DD4HEP +# include "Detector/FT/DeFT.h" +using DeFT = LHCb::Detector::DeFT; +#else +#include "FTDet/DeFTDetector.h" +using DeFT = DeFTDetector; +#endif + #include #include #include -- GitLab From 3a8f77200846add51d4fe091a2aca93ce4167a1a Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 22 Sep 2021 12:18:53 +0200 Subject: [PATCH 03/38] Changed references to DeFTMat --- Tr/TrackFitEvent/include/Event/Measurement.h | 2 +- Tr/TrackFitEvent/src/Measurement.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tr/TrackFitEvent/include/Event/Measurement.h b/Tr/TrackFitEvent/include/Event/Measurement.h index 2a8b529f02..a88325d113 100644 --- a/Tr/TrackFitEvent/include/Event/Measurement.h +++ b/Tr/TrackFitEvent/include/Event/Measurement.h @@ -26,7 +26,7 @@ class DeUTSector; // FT -class DeFTMat; +#include "FTDet/DeFTMat.h" // Muon class DeMuonChamber; diff --git a/Tr/TrackFitEvent/src/Measurement.cpp b/Tr/TrackFitEvent/src/Measurement.cpp index 3ee40ce642..0c053d9b58 100644 --- a/Tr/TrackFitEvent/src/Measurement.cpp +++ b/Tr/TrackFitEvent/src/Measurement.cpp @@ -9,11 +9,11 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ #include "Event/Measurement.h" -#include "FTDet/DeFTMat.h" #include "Kernel/ROOTExtensions.h" #include "MuonDet/DeMuonChamber.h" #include "UTDet/DeUTSector.h" #include "VPDet/DeVPSensor.h" +#include "FTDet/DeFTMat.h" Gaudi::XYZPoint LHCb::Measurement::toLocal( const Gaudi::XYZPoint& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toLocal( globalPoint ); }, -- GitLab From b761af0160c8bed905a946a47b8188d46fa57e7c Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:46:27 +0100 Subject: [PATCH 04/38] Reverted to FTDet/DeFT --- Pr/PrAlgorithms/src/PrForwardTracking.cpp | 8 +------- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 3 ++- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 8 +------- Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp | 9 +-------- Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h | 2 +- Pr/PrMCTools/src/PrClustersResidual.cpp | 4 ++-- Pr/PrMCTools/src/PrFTHitsMonitor.cpp | 4 ++-- Pr/PrMCTools/src/PrPlotFTHits.cpp | 1 + Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp | 4 ++-- Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp | 4 ++-- Tr/TrackTools/src/FTHitExpectation.cpp | 4 ++-- Tr/TrackTools/src/FTMeasurementProvider.cpp | 4 ++-- 12 files changed, 19 insertions(+), 36 deletions(-) diff --git a/Pr/PrAlgorithms/src/PrForwardTracking.cpp b/Pr/PrAlgorithms/src/PrForwardTracking.cpp index fd339f7749..7ed66d05fc 100644 --- a/Pr/PrAlgorithms/src/PrForwardTracking.cpp +++ b/Pr/PrAlgorithms/src/PrForwardTracking.cpp @@ -22,13 +22,7 @@ #include "Event/StateVector.h" #include "Event/Track.h" #include "FTDAQ/FTInfo.h" -#ifdef USE_DD4HEP -# include "Detector/FT/DeFT.h" -using DeFT = LHCb::Detector::DeFT; -#else #include "FTDet/DeFTDetector.h" -using DeFT = DeFTDetector; -#endif #include "Kernel/ILHCbMagnetSvc.h" #include "LHCbMath/SIMDWrapper.h" @@ -1793,7 +1787,7 @@ namespace LHCb::Pr::Forward { auto sc = base_class_t::initialize(); if ( sc.isFailure() ) return sc; this->template addConditionDerivation( - {DeFTLocation::Default}, this->template inputLocation() ); + {DeFTDetectorLocation::Default}, this->template inputLocation() ); return sc; } diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index fa7d4b3e9c..dfeab6ffb1 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -21,6 +21,7 @@ #include "Event/FTCluster.h" #include "Event/FTLiteCluster.h" #include "DetDesc/ConditionAccessorHolder.h" +#include "FTDet/DeFTDetector.h" #include "Event/PrSciFiHits.h" #include "Event/PrSeedTracks.h" #include "Event/StateParameters.h" @@ -851,7 +852,7 @@ namespace LHCb::Pr { ======= // Zones cache, retrieved from the detector store // Zones cache - this->template addConditionDerivation( {DeFTLocation::Default}, + this->template addConditionDerivation( {DeFTDetectorLocation::Default}, this->template inputLocation() ); return StatusCode::SUCCESS; diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 6030f3557d..71c1ed1157 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -12,13 +12,7 @@ #include "DetDesc/Condition.h" #include "DetDesc/ConditionAccessorHolder.h" #include "Event/FTLiteCluster.h" -#ifdef USE_DD4HEP -# include "Detector/FT/DeFT.h" -using DeFT = LHCb::Detector::DeFT; -#else #include "FTDet/DeFTDetector.h" -using DeFT = DeFTDetector; -#endif #include "GaudiAlg/Transformer.h" #include "PrKernel/FTMatsCache.h" #include "PrKernel/PrFTHitHandler.h" @@ -56,7 +50,7 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTLocation::Default}, + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); std::array clusRes = {0.05, 0.08, 0.11, 0.14, 0.17, 0.20, 0.23, 0.26, 0.29}; if ( m_updatedRes ) { clusRes = {0.5, 0.1, 0.1, 0.1, 0.080, 0.163, 0.38, 0.48, 0.58}; } diff --git a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp index dda31f79c3..b86eb6faef 100644 --- a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp +++ b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp @@ -19,14 +19,7 @@ #include "LHCbAlgs/Transformer.h" #include "LHCbMath/bit_cast.h" #include "PrKernel/FTMatsCache.h" - -#ifdef USE_DD4HEP -# include "Detector/FT/DeFT.h" -using DeFT = LHCb::Detector::DeFT; -#else #include "FTDet/DeFTDetector.h" -using DeFT = DeFTDetector; -#endif #include #include @@ -63,7 +56,7 @@ namespace LHCb::Pr::FT { StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTLocation::Default}, + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); } ); } diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index a669dbbc01..a1df97b2e9 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -12,7 +12,7 @@ // Include files #include "FTDAQ/FTInfo.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "Kernel/DetectorSegment.h" #include "PrKernel/PrHitZone.h" diff --git a/Pr/PrMCTools/src/PrClustersResidual.cpp b/Pr/PrMCTools/src/PrClustersResidual.cpp index 7383de46b9..0d70f202a5 100644 --- a/Pr/PrMCTools/src/PrClustersResidual.cpp +++ b/Pr/PrMCTools/src/PrClustersResidual.cpp @@ -17,7 +17,7 @@ #include "Event/ODIN.h" #include "Event/Track.h" #include "FTDAQ/FTInfo.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "GaudiAlg/GaudiHistoTool.h" #include "GaudiAlg/GaudiTupleAlg.h" #include "Kernel/FTChannelID.h" @@ -169,7 +169,7 @@ StatusCode PrClustersResidual::initialize() { // Main execution //============================================================================= StatusCode PrClustersResidual::execute() { - m_ftDet = getDet( DeFTLocation::Default ); + m_ftDet = getDet( DeFTDetectorLocation::Default ); if ( !m_ftDet ) { error() << " Cannot load the FTDetector from default location" << endmsg; return StatusCode::FAILURE; diff --git a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp index 875767d8f5..c97cf3e8d7 100644 --- a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp +++ b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp @@ -16,7 +16,7 @@ #include "Event/LinksByKey.h" #include "Event/MCHit.h" #include "Event/MCParticle.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/MsgStream.h" @@ -67,7 +67,7 @@ public: KeyValue{"FTHits2MCHitLinksLocation", LHCb::FTLiteClusterLocation::Default + "2MCHits"}, KeyValue{"MCHitsLocation", LHCb::MCHitLocation::FT}, KeyValue{"MCParticleLocation", LHCb::MCParticleLocation::Default}, - KeyValue{"DeFT", DeFTLocation::Default}} ) {} + KeyValue{"DeFT", DeFTDetectorLocation::Default}} ) {} void operator()( const FTHits&, const FTLiteClusters&, const LHCb::LinksByKey&, const MCHits&, const MCParticles&, const DeFT& ) const override; diff --git a/Pr/PrMCTools/src/PrPlotFTHits.cpp b/Pr/PrMCTools/src/PrPlotFTHits.cpp index 79756dc20a..f4b92be707 100644 --- a/Pr/PrMCTools/src/PrPlotFTHits.cpp +++ b/Pr/PrMCTools/src/PrPlotFTHits.cpp @@ -18,6 +18,7 @@ #include "Event/MCTrackInfo.h" #include "Event/MCVertex.h" #include "Event/Track.h" +#include "FTDet/DeFTDetector.h" #include "FTDAQ/FTInfo.h" #include "GaudiAlg/GaudiAlgorithm.h" #include "GaudiAlg/GaudiHistoAlg.h" diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index 87f30b5cc4..135f7781cd 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -16,7 +16,7 @@ #include "Event/PrLongTracks.h" #include "Event/PrUpstreamTracks.h" #include "Event/StateParameters.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "Kernel/ILHCbMagnetSvc.h" #include "PrKernel/PrFTZoneHandler.h" @@ -483,7 +483,7 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTLocation::Default}, + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); // factor of -1 because everything was trained with magdown, so for magdown we want factor = 1, magup = -1 diff --git a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp index b5e9ba6d71..79b12c7458 100644 --- a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp +++ b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp @@ -11,7 +11,7 @@ // Include files #include "Event/ODIN.h" #include "Event/State.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "Kernel/Trajectory.h" #include "LHCbMath/Similarity.h" @@ -51,7 +51,7 @@ StatusCode ParameterizedKalmanFit::initialize() { if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg; // Check the FT geometry version - DeFT* m_deFT = getDet( DeFTLocation::Default ); + DeFT* m_deFT = getDet( DeFTDetectorLocation::Default ); if ( m_deFT->version() < 62 ) { error() << "This version requires FTDet v6.2 or higher" << endmsg; return StatusCode::FAILURE; diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index a3c13f93f6..658c6b8a15 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -19,7 +19,7 @@ #include "Event/State.h" #include "Event/Track.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "GaudiKernel/SystemOfUnits.h" #include "LHCbMath/GeomFun.h" #include "Line.h" @@ -85,7 +85,7 @@ StatusCode FTHitExpectation::initialize() { if ( sc.isFailure() ) return Error( "Failed to initialize", sc ); // Get all layers (need to know the z-plane of each layer) - m_ftDet = getDet( DeFTLocation::Default ); + m_ftDet = getDet( DeFTDetectorLocation::Default ); if ( m_ftDet->version() < 61 ) return Error( "This version requires FTDet v6.1 or higher", StatusCode::FAILURE ); return StatusCode::SUCCESS; diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index 81ee65242d..3e642e364f 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -20,7 +20,7 @@ #include "MeasurementProviderProjector.h" #include "Event/FTLiteCluster.h" -#include "Detector/DeFT.h" +#include "FTDet/DeFTDetector.h" #include "GaudiAlg/GaudiTool.h" #include "GaudiKernel/DataObjectHandle.h" @@ -58,7 +58,7 @@ StatusCode FTMeasurementProvider::initialize() { if ( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); } // Retrieve the detector element - m_det = getDet( DeFTLocation::Default ); + m_det = getDet( DeFTDetectorLocation::Default ); setProperty( "Tolerance", 0.002 * Gaudi::Units::mm ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return sc; -- GitLab From cb84b46fcf83e87ae7d793c7d9f1988785ddf3a9 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 22 Sep 2021 16:18:52 +0200 Subject: [PATCH 05/38] Corrected compilation issues --- FT/FTMonitors/src/FTClusterMonitor.cpp | 20 +++++++------------ FT/FTMonitors/src/FTDigitMonitor.cpp | 24 +++++++++-------------- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 22 ++++++++------------- 3 files changed, 24 insertions(+), 42 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index 20778f4048..dbbe1d7b8f 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -10,13 +10,7 @@ \*****************************************************************************/ #include "Event/FTLiteCluster.h" -#ifdef USE_DD4HEP -# include "Detector/FT/DeFT.h" -using DeFT = LHCb::Detector::DeFT; -#else #include "FTDet/DeFTDetector.h" -using DeFT = DeFTDetector; -#endif #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" @@ -44,14 +38,14 @@ namespace { } // namespace class FTClusterMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; - void operator()( const FTLiteClusters&, const LHCb::Detector::DeFT& ) const override; + void operator()( const FTLiteClusters&, const DeFT& ) const override; private: AIDA::IHistogram1D* m_lcps = nullptr; @@ -97,7 +91,7 @@ DECLARE_COMPONENT( FTClusterMonitor ) FTClusterMonitor::FTClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ) : Consumer( name, pSvcLocator, {KeyValue{"ClusterLocation", LHCb::FTLiteClusterLocation::Default}, - KeyValue{"FTDetectorLocation", DeFTLocation::Default}} ) {} + KeyValue{"FTDetectorLocation", DeFTDetectorLocation::Default}} ) {} //============================================================================= StatusCode FTClusterMonitor::initialize() { @@ -187,9 +181,9 @@ StatusCode FTClusterMonitor::initialize() { } //============================================================================= -void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const LHCb::Detector::DeFT& deFT ) const { +void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& deFT ) const { - if ( deFT->version() < 61 ) { + if ( deFT.version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; @@ -200,7 +194,7 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const LHCb::D // Loop over FTLiteCluster for ( const auto& cluster : clusters.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const LHCb::Detector::DeFTModule* mod = deFT->findModule( chanID ); + const DeFTModule* mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniModuleID(); uint SiPM_ID = chanID.moniSiPMID(); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index aae8098a60..96cd011f56 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -10,13 +10,7 @@ \*****************************************************************************/ // Include files #include "Event/FTDigit.h" -#ifdef USE_DD4HEP -# include "Detector/FT/DeFT.h" -using DeFT = LHCb::Detector::DeFT; -#else #include "FTDet/DeFTDetector.h" -using DeFT = DeFTDetector; -#endif #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" @@ -38,16 +32,16 @@ using DeFT = DeFTDetector; */ class FTDigitMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTDigitMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; - void operator()( const LHCb::FTDigit::FTDigits& digits, const LHCb::Detector::DeFT& ) const override; + void operator()( const LHCb::FTDigit::FTDigits& digits, const DeFT& ) const override; private: - void fillHistograms( const LHCb::FTDigit& Digit, const LHCb::Detector::DeFT& deFT ) const; + void fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deFT ) const; }; // Declaration of the Algorithm Factory @@ -56,7 +50,7 @@ DECLARE_COMPONENT( FTDigitMonitor ) FTDigitMonitor::FTDigitMonitor( const std::string& name, ISvcLocator* pSvcLocator ) : Consumer( name, pSvcLocator, {KeyValue{"DigitLocation", LHCb::FTDigitLocation::Default}, - KeyValue{"FTDetectorLocation", DeFTLocation::Default}} ) {} + KeyValue{"FTDetectorLocation", DeFTDetectorLocation::Default}} ) {} //============================================================================= // Initialization //============================================================================= @@ -69,15 +63,15 @@ StatusCode FTDigitMonitor::initialize() { //============================================================================= // Main execution //============================================================================= -void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, const LHCb::Detector::DeFT& deFT ) const { - if ( deFT->version() < 61 ) { +void FTDigitMonitor::operator()( const LHCb::FTDigit::FTDigits& DigitsCont, const DeFT& deFT ) const { + if ( deFT.version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; for ( const auto& Digit : DigitsCont.range() ) { fillHistograms( Digit, deFT ); } plot( DigitsCont.size(), "nDigits", "Number of digits; Digits/event; Events", 0., 60e3, 50 ); } -void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const LHCb::Detector::DeFT& deFT ) const { +void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deFT ) const { plot( Digit.adcCount(), "ADCCounts", "Charge in 2bit ADC; Charge/digit [ADC]; Number of digits", -0.5, 3.5, 4 ); @@ -88,7 +82,7 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const LHCb::Det plot( (float)chanID.sipmInModule(), "DigitsPerSiPM", "Digits per SiPM; SiPMID; Digits", -0.5, 15.5, 16 ); plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); - const LHCb::Detector::DeFTModule* module = deFT->findModule( chanID ); + const DeFTModule* module = deFT.findModule( chanID ); if ( module != nullptr ) { int pseudoChannel = module->pseudoChannel( chanID ); plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index 7cbaa5ae71..ef45f83221 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -19,13 +19,7 @@ // from LHCb #include "Event/FTLiteCluster.h" -#ifdef USE_DD4HEP -# include "Detector/FT/DeFT.h" -using DeFT = LHCb::Detector::DeFT; -#else #include "FTDet/DeFTDetector.h" -using DeFT = DeFTDetector; -#endif #include "Kernel/FTChannelID.h" #include "Kernel/FastClusterContainer.h" @@ -51,15 +45,15 @@ namespace { } // namespace class FTNZSClusterMonitor - : public Gaudi::Functional::Consumer> { + : public Gaudi::Functional::Consumer> { public: FTNZSClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); StatusCode initialize() override; void operator()( const FTLiteClusters& clustersNZS, const FTLiteClusters& clustersNZSdigits, - const LHCb::Detector::DeFT& deFT ) const override; + const DeFT& deFT ) const override; private: FTNZSHist createFTNZSHist( string histName, string histTitle, string xAxis, string yAxis, float xMin, float xMax, @@ -107,7 +101,7 @@ FTNZSClusterMonitor::FTNZSClusterMonitor( const string& name, ISvcLocator* pSvcL : Consumer( name, pSvcLocator, {KeyValue{"ClusterLocationNZS", LHCb::FTLiteClusterLocation::Default + "NZS"}, KeyValue{"ClusterLocationfromNZSdigits", LHCb::FTLiteClusterLocation::Default + "fromNZSdigits"}, - KeyValue{"FTDetectorLocation", DeFTLocation::Default}} ) {} + KeyValue{"FTDetectorLocation", DeFTDetectorLocation::Default}} ) {} //============================================================================= StatusCode FTNZSClusterMonitor::initialize() { @@ -216,9 +210,9 @@ StatusCode FTNZSClusterMonitor::initialize() { //============================================================================= void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const FTLiteClusters& clustersNZSdigits, - const LHCb::Detector::DeFT& deFT ) const { + const DeFT& deFT ) const { - if ( deFT->version() < 61 ) { + if ( deFT.version() < 61 ) { throw GaudiException( "This version requires FTDet v6.1 or higher", "", StatusCode::FAILURE ); }; @@ -231,7 +225,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F // Loop over NZS FTLiteCluster for ( const auto& cluster : clustersNZS.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const LHCb::Detector::DeFTModule* mod = deFT->findModule( chanID ); + const DeFTModule* mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); @@ -279,7 +273,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F clustersInSiPM = 0; for ( const auto& cluster : clustersNZSdigits.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const LHCb::Detector::DeFTModule* mod = deFT->findModule( chanID ); + const DeFTModule* mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); -- GitLab From 140b56a8a42afdba6ac8590f8751b2942fb757b8 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Wed, 22 Sep 2021 14:19:46 +0000 Subject: [PATCH 06/38] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/16436465 --- FT/FTMonitors/src/FTClusterMonitor.cpp | 5 ++--- FT/FTMonitors/src/FTDigitMonitor.cpp | 5 ++--- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 2 +- Pr/PrAlgorithms/src/PrForwardTracking.cpp | 4 ++-- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 3 +-- Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp | 4 +--- Pr/PrMCTools/src/PrPlotFTHits.cpp | 2 +- Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp | 3 +-- Tr/TrackFitEvent/src/Measurement.cpp | 2 +- Tr/TrackTools/src/FTMeasurementProvider.cpp | 2 +- 10 files changed, 13 insertions(+), 19 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index dbbe1d7b8f..3bedef3d25 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -37,9 +37,8 @@ namespace { using std::to_string; } // namespace -class FTClusterMonitor - : public Gaudi::Functional::Consumer> { +class FTClusterMonitor : public Gaudi::Functional::Consumer> { public: FTClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index 96cd011f56..74614c75fc 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -31,9 +31,8 @@ * @date 2020-02-17 */ -class FTDigitMonitor - : public Gaudi::Functional::Consumer> { +class FTDigitMonitor : public Gaudi::Functional::Consumer> { public: FTDigitMonitor( const std::string& name, ISvcLocator* pSvcLocator ); diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index ef45f83221..d61f316757 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -45,7 +45,7 @@ namespace { } // namespace class FTNZSClusterMonitor - : public Gaudi::Functional::Consumer> { public: FTNZSClusterMonitor( const std::string& name, ISvcLocator* pSvcLocator ); diff --git a/Pr/PrAlgorithms/src/PrForwardTracking.cpp b/Pr/PrAlgorithms/src/PrForwardTracking.cpp index 7ed66d05fc..683482ebed 100644 --- a/Pr/PrAlgorithms/src/PrForwardTracking.cpp +++ b/Pr/PrAlgorithms/src/PrForwardTracking.cpp @@ -1786,8 +1786,8 @@ namespace LHCb::Pr::Forward { StatusCode initialize() override { auto sc = base_class_t::initialize(); if ( sc.isFailure() ) return sc; - this->template addConditionDerivation( - {DeFTDetectorLocation::Default}, this->template inputLocation() ); + this->template addConditionDerivation( {DeFTDetectorLocation::Default}, + this->template inputLocation() ); return sc; } diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 71c1ed1157..af33cac607 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -50,8 +50,7 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, - inputLocation() ); + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); std::array clusRes = {0.05, 0.08, 0.11, 0.14, 0.17, 0.20, 0.23, 0.26, 0.29}; if ( m_updatedRes ) { clusRes = {0.5, 0.1, 0.1, 0.1, 0.080, 0.163, 0.38, 0.48, 0.58}; } std::transform( clusRes.begin(), clusRes.end(), m_invClusResolution.begin(), []( auto c ) { return 1.f / c; } ); diff --git a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp index b86eb6faef..0632e2475f 100644 --- a/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp +++ b/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp @@ -19,7 +19,6 @@ #include "LHCbAlgs/Transformer.h" #include "LHCbMath/bit_cast.h" #include "PrKernel/FTMatsCache.h" -#include "FTDet/DeFTDetector.h" #include #include @@ -56,8 +55,7 @@ namespace LHCb::Pr::FT { StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, - inputLocation() ); + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); } ); } diff --git a/Pr/PrMCTools/src/PrPlotFTHits.cpp b/Pr/PrMCTools/src/PrPlotFTHits.cpp index f4b92be707..d3fcdd1d00 100644 --- a/Pr/PrMCTools/src/PrPlotFTHits.cpp +++ b/Pr/PrMCTools/src/PrPlotFTHits.cpp @@ -18,8 +18,8 @@ #include "Event/MCTrackInfo.h" #include "Event/MCVertex.h" #include "Event/Track.h" -#include "FTDet/DeFTDetector.h" #include "FTDAQ/FTInfo.h" +#include "FTDet/DeFTDetector.h" #include "GaudiAlg/GaudiAlgorithm.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiAlg/GaudiHistoTool.h" diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index 135f7781cd..fdcac2d17e 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -483,8 +483,7 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, - inputLocation() ); + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); // factor of -1 because everything was trained with magdown, so for magdown we want factor = 1, magup = -1 m_magscalefactor = -1 * m_magFieldSvc->signedRelativeCurrent(); diff --git a/Tr/TrackFitEvent/src/Measurement.cpp b/Tr/TrackFitEvent/src/Measurement.cpp index 0c053d9b58..3ee40ce642 100644 --- a/Tr/TrackFitEvent/src/Measurement.cpp +++ b/Tr/TrackFitEvent/src/Measurement.cpp @@ -9,11 +9,11 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ #include "Event/Measurement.h" +#include "FTDet/DeFTMat.h" #include "Kernel/ROOTExtensions.h" #include "MuonDet/DeMuonChamber.h" #include "UTDet/DeUTSector.h" #include "VPDet/DeVPSensor.h" -#include "FTDet/DeFTMat.h" Gaudi::XYZPoint LHCb::Measurement::toLocal( const Gaudi::XYZPoint& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toLocal( globalPoint ); }, diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index 3e642e364f..c07811a415 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -38,7 +38,7 @@ public: } private: - const DeFT* m_det = nullptr; + const DeFT* m_det = nullptr; DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; -- GitLab From 0d3f3d21e8734c0bbb137e71199b9bbc74e450b7 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:50:43 +0100 Subject: [PATCH 07/38] Solved rebase conflict --- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 67 ------------------------- 1 file changed, 67 deletions(-) diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index dfeab6ffb1..f3eb853b0c 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -844,77 +844,10 @@ namespace LHCb::Pr { return StatusCode::FAILURE; } -<<<<<<< HEAD // Zones cache, retrieved from the detector store // Zones cache this->template addConditionDerivation( {DeFTDetectorLocation::Default}, this->template inputLocation() ); -======= - // Zones cache, retrieved from the detector store - // Zones cache - this->template addConditionDerivation( {DeFTDetectorLocation::Default}, - this->template inputLocation() ); - - return StatusCode::SUCCESS; -} - -//============================================================================= -// Main execution -//============================================================================= -Tracks PrHybridSeeding::operator()( const PrSciFiHits& hits, ZoneCache const& zoneCache ) const { - - // Containers - TrackCandidates trackCandidates; //---LoH: probably could be changed to array(static_vector) - XCandidates xCandidates; //---LoH: probably could be changed to static_vector - TrackToRecover trackToRecover; //---LoH: probably could be changed to static_vector - - trackCandidates[0].reserve( m_nTrackCandidates ); - trackCandidates[1].reserve( m_nTrackCandidates ); - xCandidates[0].reserve( m_nXTrackCandidates ); - xCandidates[1].reserve( m_nXTrackCandidates ); - trackToRecover[0].reserve( m_nXTrackCandidates ); - trackToRecover[1].reserve( m_nXTrackCandidates ); - - //========================================================== - // Hits are ready to be processed - //========================================================== - unsigned int nHits = hits.size(); - PrFTHitHandler oriHitHandler = makeHitHandler( hits ); - SmallDexes oriSmallDexes( nHits, 0 ); - updateSmallDexes( oriSmallDexes, oriHitHandler ); - - PrFTHitHandler tmpHitHandler; - SmallDexes smallDexes = oriSmallDexes; - - PrFTHitHandler* hitHandler = &oriHitHandler; - //======================================================== - //------------------MAIN SEQUENCE IS HERE----------------- - //======================================================== - auto main_loop = [&]( auto icase ) { - //----- Loop through lower and upper half - std::array nTracksBefore; - for ( unsigned int part = 0; nParts > part; ++part ) { - nTracksBefore[part] = trackCandidates[part].size(); - xCandidates[part].clear(); // x candidates up cleaned every Case! - findXProjections( hits, zoneCache, part, icase, *hitHandler, xCandidates ); - if ( m_removeClonesX ) { - removeClonesX( part, xCandidates ); - } //---LoH: this probably should be encoded in the logic. Clone tracks are close to each other. - addStereo addStereoCase( *this, trackToRecover ); - addStereoCase( hits, zoneCache, part, *hitHandler, trackCandidates, xCandidates ); - } - // Flag found Hits at the end of each single case ( exclude the latest one ) - if ( ( icase + 1 < NCases ) ) { - for ( unsigned int part = 0; nParts > part; ++part ) - flagHits( icase, part, trackCandidates, nTracksBefore[part], hits, smallDexes, *hitHandler ); - tmpHitHandler = consolidateHitHandler( *hitHandler ); - hitHandler = &tmpHitHandler; - updateSmallDexes( smallDexes, *hitHandler ); - } - }; - LHCb::Utils::unwind<0, NCases>( main_loop ); ->>>>>>> 5e250dcf9 (Removing DeFTDetector mentions. Need to adapt findMat, findModule, DeFTLocation) - return sc; } -- GitLab From 1dcfeec1d11fe0e7dd2640a47b38fcfb36302c3c Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:51:14 +0100 Subject: [PATCH 08/38] Solved rebase conflict --- FT/FTMonitors/src/FTClusterMonitor.cpp | 2 +- FT/FTMonitors/src/FTDigitMonitor.cpp | 10 ++++---- Pr/PrAlgorithms/src/.#PrForwardTracking.cpp | 1 + Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 2 +- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 7 ++++-- .../include/PrKernel/PrFTZoneHandler.h | 3 +++ .../src/SciFiTrackForwardingStoreHit.cpp | 6 +++-- Tr/TrackTools/src/FTHitExpectation.cpp | 24 ++++++++++++------- Tr/TrackTools/src/FTMeasurementProvider.cpp | 2 +- 9 files changed, 35 insertions(+), 22 deletions(-) create mode 120000 Pr/PrAlgorithms/src/.#PrForwardTracking.cpp diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index 3bedef3d25..4aa9bc2642 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -193,7 +193,7 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d // Loop over FTLiteCluster for ( const auto& cluster : clusters.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const DeFTModule* mod = deFT.findModule( chanID ); + const auto mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniModuleID(); uint SiPM_ID = chanID.moniSiPMID(); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index 74614c75fc..e8d25a9402 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -81,12 +81,10 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deF plot( (float)chanID.sipmInModule(), "DigitsPerSiPM", "Digits per SiPM; SiPMID; Digits", -0.5, 15.5, 16 ); plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); - const DeFTModule* module = deFT.findModule( chanID ); - if ( module != nullptr ) { - int pseudoChannel = module->pseudoChannel( chanID ); - plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., - 12288., 192 ); - } + const auto module = deFT.findModule( chanID ); + int pseudoChannel = module.pseudoChannel( chanID ); + plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., + 12288., 192 ); } //============================================================================= diff --git a/Pr/PrAlgorithms/src/.#PrForwardTracking.cpp b/Pr/PrAlgorithms/src/.#PrForwardTracking.cpp new file mode 120000 index 0000000000..172a609d54 --- /dev/null +++ b/Pr/PrAlgorithms/src/.#PrForwardTracking.cpp @@ -0,0 +1 @@ +lohenry@lblhcbpr20.cern.ch.241200:1627457284 \ No newline at end of file diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index f3eb853b0c..a1def6c3b9 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -846,7 +846,7 @@ namespace LHCb::Pr { // Zones cache, retrieved from the detector store // Zones cache - this->template addConditionDerivation( + this->template addConditionDerivation( {DeFTDetectorLocation::Default}, this->template inputLocation() ); return sc; } diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index feaca2f0b9..d587a2adec 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -29,8 +29,8 @@ namespace FTMatsCache { std::array dxdy{}; std::array dzdy{}; std::array globaldy{}; - std::array mirrorPoint{}; - std::array ddx{}; + std::array mirrorPoint{}; + std::array ddx{}; float uBegin{}; float halfChannelPitch{}; @@ -46,6 +46,8 @@ namespace FTMatsCache { sipmPitch = first_mat->sipmPitch(); uBegin = first_mat->uBegin(); halfChannelPitch = first_mat->halfChannelPitch(); + // ftDet.applyToAllMats(); + /* for ( const auto* station : ftDet.stations() ) { for ( const auto* layer : station->layers() ) { for ( const auto* quarter : layer->quarters() ) { @@ -69,6 +71,7 @@ namespace FTMatsCache { } } } + */ }; } // namespace FTMatsCache diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index a1df97b2e9..b08893813b 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -34,6 +34,8 @@ namespace FTZoneCache { public: PrFTZoneHandler( DeFT const& ftDet ) { + //FIXME applyToAllLayers() + /* for ( auto station : ftDet.stations() ) { for ( auto layer : station->layers() ) { int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); @@ -49,6 +51,7 @@ namespace FTZoneCache { this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers } } + */ } /// Standard constructor PrFTZoneHandler() = default; diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index 244f5ca681..46afe44022 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -47,7 +47,7 @@ namespace { float m_uBegin; float m_halfChannelPitch; - MatsCache( const DeFTDetector& ftDet ) { + MatsCache( const DeFT& ftDet ) { auto const first_mat = ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; // This parameters are constant accross all mats: @@ -55,7 +55,8 @@ namespace { m_sipmPitch = first_mat->sipmPitch(); m_uBegin = first_mat->uBegin(); m_halfChannelPitch = first_mat->halfChannelPitch(); - + //FIXME + /* for ( auto station : ftDet.stations() ) { for ( auto layer : station->layers() ) { for ( auto quarter : layer->quarters() ) { @@ -79,6 +80,7 @@ namespace { } } } + */ } }; } // namespace diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index 658c6b8a15..4e3a6dd9a5 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -105,6 +105,8 @@ IHitExpectation::Info FTHitExpectation::expectation( const LHCb::Track& aTrack, []( const LHCb::LHCbID& id ) { return id.isFT(); } ); // Loop over all layers + //applyToAllChildren FIXME + /* for ( auto station : m_ftDet->stations() ) { for ( auto layer : station->layers() ) { @@ -123,6 +125,7 @@ IHitExpectation::Info FTHitExpectation::expectation( const LHCb::Track& aTrack, } } } + */ return info; } @@ -138,30 +141,32 @@ bool FTHitExpectation::findIntersectingMat( const DeFTLayer* layer, const LHCb:: Tf::Tsa::Line3D aLine3D = Tf::Tsa::createLine3D( tanLine, line, layerZ ); // find intersection point of track and plane of layer - const Gaudi::Plane3D layerPlane = layer->plane(); + const auto layerPlane = layer->plane(); intersectionPoint = intersection( aLine3D, layerPlane ); // find the module that is hit - const DeFTModule* module = layer->findModule( intersectionPoint ); - if ( module == nullptr ) return false; + const auto module = layer->findModule( intersectionPoint ); + if ( !module ) return false; // find intersection point of track and plane of module // (to account for misalignments between module and layer) tanLine = aParab.tangent( intersectionPoint.z() ); aLine3D = Tf::Tsa::createLine3D( tanLine, line, intersectionPoint.z() ); - const Gaudi::Plane3D modulePlane = module->plane(); + const auto modulePlane = module->plane(); intersectionPoint = intersection( aLine3D, modulePlane ); // Find the corresponding mat - mat = module->findMat( intersectionPoint ); - + const auto foundMat = module->findMat( intersectionPoint ); // check if intersection point is inside the fibres of the module - return ( mat == nullptr ) ? false : mat->isInside( intersectionPoint ); + if (!mat) return false; + return mat->isInside( intersectionPoint ); } void FTHitExpectation::collect( const LHCb::Track& aTrack, std::vector& ids, IGeometryInfo const& geometry ) const { // Loop over all layers + //FIXME + /* for ( auto station : m_ftDet->stations() ) { for ( auto layer : station->layers() ) { @@ -171,9 +176,9 @@ void FTHitExpectation::collect( const LHCb::Track& aTrack, std::vectortoLocal( intersectionPoint ); + Gaudi::XYZPoint localP = mat.toLocal( intersectionPoint ); float frac; - LHCb::FTChannelID ftChan = mat->calculateChannelAndFrac( localP.x(), frac ); + LHCb::FTChannelID ftChan = mat.calculateChannelAndFrac( localP.x(), frac ); // Add the channels // JvT: Without the fraction the bare FTChannelID is pretty useless... @@ -181,6 +186,7 @@ void FTHitExpectation::collect( const LHCb::Track& aTrack, std::vector i [&, clusters = m_clustersDh.get()]( const LHCb::LHCbID& id ) { /// The clusters are not sorted anymore, so we can use a find_if /// to find the element corresponding to the channel ID - const DeFTMat* ftMat = m_det->findMat( id.ftID() ); + const auto ftMat = m_det->findMat( id.ftID() ); const auto& c = clusters->range( id.ftID().uniqueQuarter() - 16u ); -- GitLab From 3b58c00213636de257614aefbdb2c2cfc53d7fd1 Mon Sep 17 00:00:00 2001 From: lohenry Date: Tue, 5 Oct 2021 09:51:33 +0200 Subject: [PATCH 09/38] Untested changes --- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 8 +-- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 53 ++++++++----------- Pr/PrMCTools/src/PrClustersResidual.cpp | 4 +- Pr/PrMCTools/src/PrFTHitsMonitor.cpp | 4 +- .../src/SciFiTrackForwardingStoreHit.cpp | 49 ++++++++--------- Tr/TrackTools/src/FTHitExpectation.cpp | 13 ++--- Tr/TrackTools/src/FTMeasurementProvider.cpp | 10 ++-- 7 files changed, 63 insertions(+), 78 deletions(-) diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index d61f316757..7573beca61 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -225,7 +225,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F // Loop over NZS FTLiteCluster for ( const auto& cluster : clustersNZS.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const DeFTModule* mod = deFT.findModule( chanID ); + const auto mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); @@ -236,7 +236,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F m_lcpm_NZS->fillNZS( chanID.module() ); m_lcpsipm_NZS->fillNZS( chanID.sipmInModule() ); m_lcpc_NZS->fillNZS( chanID.channel() ); - if ( mod != nullptr ) { m_lcppc_NZS->fillNZS( pseudoChannel ); } + if ( mod ) { m_lcppc_NZS->fillNZS( pseudoChannel ); } m_lcf_NZS->fillNZS( cluster.fraction() ); m_lcs_NZS->fillNZS( cluster.pseudoSize() ); @@ -273,7 +273,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F clustersInSiPM = 0; for ( const auto& cluster : clustersNZSdigits.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const DeFTModule* mod = deFT.findModule( chanID ); + const auto mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); @@ -284,7 +284,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F m_lcpm_NZS->fillDigit( chanID.module() ); m_lcpsipm_NZS->fillDigit( chanID.sipmInModule() ); m_lcpc_NZS->fillDigit( chanID.channel() ); - if ( mod != nullptr ) { m_lcppc_NZS->fillDigit( pseudoChannel ); } + if ( mod ) { m_lcppc_NZS->fillDigit( pseudoChannel ); } m_lcf_NZS->fillDigit( cluster.fraction() ); m_lcs_NZS->fillDigit( cluster.pseudoSize() ); diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index d587a2adec..43a828b1f8 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -39,39 +39,28 @@ namespace FTMatsCache { MatsCache() = default; // Needed by DD4hep even if unsed ! MatsCache( const DeFTDetector& ftDet ) { - const auto* first_mat = - ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 )->modules().at( 0 )->mats().at( 0 ); + const auto first_mat = ftDet.firstMat();//FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 )->modules().at( 0 )->mats().at( 0 ); // This parameters are constant accross all mats: - dieGap = first_mat->dieGap(); - sipmPitch = first_mat->sipmPitch(); - uBegin = first_mat->uBegin(); - halfChannelPitch = first_mat->halfChannelPitch(); - // ftDet.applyToAllMats(); - /* - for ( const auto* station : ftDet.stations() ) { - for ( const auto* layer : station->layers() ) { - for ( const auto* quarter : layer->quarters() ) { - for ( const auto* module : quarter->modules() ) { - for ( const auto* mat : module->mats() ) { - const auto index = mat->elementID().uniqueMat(); - - assert( dieGap == mat->dieGap() && "Unexpected difference in dieGap" ); - assert( sipmPitch == mat->sipmPitch() && "Unexpected difference in sipmPitch" ); - assert( uBegin == mat->uBegin() && "Unexpected difference in uBegin" ); - assert( halfChannelPitch == mat->halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); - - mirrorPoint[index] = mat->mirrorPoint(); - ddx[index] = mat->ddx(); - dxdy[index] = mat->dxdy(); - dzdy[index] = mat->dzdy(); - globaldy[index] = mat->globaldy(); - } - } - } - } - } - } - */ + dieGap = first_mat.dieGap(); + sipmPitch = first_mat.sipmPitch(); + uBegin = first_mat.uBegin(); + halfChannelPitch = first_mat.halfChannelPitch(); + auto assertFunc = [&dieGap, &sipmPitch, &uBegin, &halfChannelPitch] (const DeFTMat mat){ + assert( dieGap == mat->dieGap() && "Unexpected difference in dieGap" ); + assert( sipmPitch == mat->sipmPitch() && "Unexpected difference in sipmPitch" ); + assert( uBegin == mat->uBegin() && "Unexpected difference in uBegin" ); + assert( halfChannelPitch == mat->halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); + }; + ftDet.applyToAllMats(assertFunc); + auto func = [&mirrorPoint, &ddx, &dxdy, &dzdy, &globaldy] (const DeFTMat mat){ + const auto index = mat->elementID().uniqueMat(); + mirrorPoint[index] = mat->mirrorPoint(); + ddx[index] = mat->ddx(); + dxdy[index] = mat->dxdy(); + dzdy[index] = mat->dzdy(); + globaldy[index] = mat->globaldy(); + }; + ftDet.applyToAllMats(func); }; } // namespace FTMatsCache diff --git a/Pr/PrMCTools/src/PrClustersResidual.cpp b/Pr/PrMCTools/src/PrClustersResidual.cpp index 0d70f202a5..3c9327cd06 100644 --- a/Pr/PrMCTools/src/PrClustersResidual.cpp +++ b/Pr/PrMCTools/src/PrClustersResidual.cpp @@ -270,8 +270,8 @@ void PrClustersResidual::Occupancy( const PrFTHitHandler& FTHitHandler ) */ auto quarter = liteCluster.channelID().quarter(); const auto chanID = liteCluster.channelID(); - const DeFTModule* module = m_ftDet->findModule( chanID ); - if ( module == nullptr ) { + const auto module = m_ftDet.findModule( chanID ); + if ( !module ) { error() << "Cannot find Module associated to FTChannelID : " << chanID << endmsg; error() << "Abort Occupancy plot checking" << endmsg; return; diff --git a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp index c97cf3e8d7..c0e014da0e 100644 --- a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp +++ b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp @@ -138,10 +138,10 @@ void PrFTHitsMonitor::operator()( const FTHits& FThits, const FTLiteClusters& cl if ( result == mcHitForId.end() ) continue; for ( auto& mcHit : ( *result ).second ) { - auto mcHit_local = mat->geometry()->toLocal( mcHit->midPoint() ); + auto mcHit_local = mat->geometry()->toLocal( mcHit->midPoint() );//FIXME const Gaudi::XYZPoint FThit = Gaudi::XYZPoint( hit.x( mcHit->midPoint().Y() ), 0, hit.z( mcHit->midPoint().Y() ) ); - auto FThit_local = mat->geometry()->toLocal( FThit ); + auto FThit_local = mat->geometry()->toLocal( FThit );//FIXME Gaudi::XYZVector residual; std::string name_addition = ""; if ( m_isGlobal ) { diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index 46afe44022..b85fb9f752 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -48,39 +48,34 @@ namespace { float m_halfChannelPitch; MatsCache( const DeFT& ftDet ) { - auto const first_mat = ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; - + auto const first_mat = ftDet.getFirstMat();//FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; + // This parameters are constant accross all mats: m_dieGap = first_mat->dieGap(); m_sipmPitch = first_mat->sipmPitch(); m_uBegin = first_mat->uBegin(); m_halfChannelPitch = first_mat->halfChannelPitch(); + //First assert things + auto assertFunc = [&m_dieGap, &m_sipmPitch, &m_uBegin, &m_halfChannelPitch] (const DeFTMat& mat){ + assert( m_dieGap == mat->dieGap() && "Unexpected difference in dieGap" ); + assert( m_sipmPitch == mat->sipmPitch() && "Unexpected difference in sipmPitch" ); + assert( m_uBegin == mat->uBegin() && "Unexpected difference in uBegin" ); + assert( m_halfChannelPitch == mat->halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); + }; + ftDet.applyToAllMats(assertFunc); //FIXME - /* - for ( auto station : ftDet.stations() ) { - for ( auto layer : station->layers() ) { - for ( auto quarter : layer->quarters() ) { - for ( auto module : quarter->modules() ) { - for ( auto mat : module->mats() ) { - auto index = mat->elementID().uniqueMat(); - - auto dxdy = mat->dxdy(); - auto mirrorPoint = mat->mirrorPoint(); - auto ddx = mat->ddx(); - - m_mats_x0[index] = mirrorPoint.x() - mirrorPoint.y() * dxdy; - m_mats_dx[index] = ddx.x() - ddx.y() * dxdy; - - assert( m_dieGap == mat->dieGap() && "Unexpected difference in dieGap" ); - assert( m_sipmPitch == mat->sipmPitch() && "Unexpected difference in sipmPitch" ); - assert( m_uBegin == mat->uBegin() && "Unexpected difference in uBegin" ); - assert( m_halfChannelPitch == mat->halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); - } - } - } - } - } - */ + auto func = [&m_mats_x0, &m_mats_dx] (const DeFTMat& mat){ + auto index = mat->elementID().uniqueMat(); + + auto dxdy = mat->dxdy(); + auto mirrorPoint = mat->mirrorPoint(); + auto ddx = mat->ddx(); + + m_mats_x0[index] = mirrorPoint.x() - mirrorPoint.y() * dxdy; + m_mats_dx[index] = ddx.x() - ddx.y() * dxdy; + + }; + ftDet.applyToAllMats(func); } }; } // namespace diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index 4e3a6dd9a5..63e48fcbee 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -67,7 +67,7 @@ public: IGeometryInfo const& geometry ) const override; private: - bool findIntersectingMat( const DeFTLayer* layer, const LHCb::Track& aTrack, const DeFTMat*& mat, + bool findIntersectingMat( const DeFTLayer layer, const LHCb::Track& aTrack, const DeFTMat*& mat, Gaudi::XYZPoint& intersectionPoint, IGeometryInfo const& geometry ) const; Gaudi::XYZPoint intersection( const Tf::Tsa::Line3D& line, const Gaudi::Plane3D& aPlane ) const; @@ -130,7 +130,7 @@ IHitExpectation::Info FTHitExpectation::expectation( const LHCb::Track& aTrack, return info; } -bool FTHitExpectation::findIntersectingMat( const DeFTLayer* layer, const LHCb::Track& aTrack, const DeFTMat*& mat, +bool FTHitExpectation::findIntersectingMat( const DeFTLayer* layer, const LHCb::Track& aTrack, const DeFTMat* mat, Gaudi::XYZPoint& intersectionPoint, IGeometryInfo const& geometry ) const { // make a Line3D from the track @@ -147,19 +147,20 @@ bool FTHitExpectation::findIntersectingMat( const DeFTLayer* layer, const LHCb:: // find the module that is hit const auto module = layer->findModule( intersectionPoint ); if ( !module ) return false; - + // find intersection point of track and plane of module // (to account for misalignments between module and layer) tanLine = aParab.tangent( intersectionPoint.z() ); aLine3D = Tf::Tsa::createLine3D( tanLine, line, intersectionPoint.z() ); - const auto modulePlane = module->plane(); + const auto modulePlane = module->plane(); intersectionPoint = intersection( aLine3D, modulePlane ); // Find the corresponding mat const auto foundMat = module->findMat( intersectionPoint ); // check if intersection point is inside the fibres of the module - if (!mat) return false; - return mat->isInside( intersectionPoint ); + if (!foundMat) return false; + mat = static_cast(foundMat);//FIXME + return foundMat->isInside( intersectionPoint ); } void FTHitExpectation::collect( const LHCb::Track& aTrack, std::vector& ids, diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index 3c4bea6a8d..064c13e490 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -38,7 +38,7 @@ public: } private: - const DeFT* m_det = nullptr; + const DeFT m_det = nullptr; DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; @@ -77,7 +77,7 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i [&, clusters = m_clustersDh.get()]( const LHCb::LHCbID& id ) { /// The clusters are not sorted anymore, so we can use a find_if /// to find the element corresponding to the channel ID - const auto ftMat = m_det->findMat( id.ftID() ); + const auto ftMat = m_det.findMat( id.ftID() ); const auto& c = clusters->range( id.ftID().uniqueQuarter() - 16u ); @@ -91,9 +91,9 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i StatusCode::FAILURE ); } - return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), - ftMat->trajectory( itH->channelID(), itH->fraction() ), - 0.04 + 0.01 * itH->pseudoSize(), // need a better error parametrization + return LHCb::Measurement{itH->channelID(), ftMat.globalZ(), + ftMat.trajectory( itH->channelID(), itH->fraction() ), + 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization ftMat}; } ); } -- GitLab From 384965bb7281a622fef18d6defb7fa6223a28ffc Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Tue, 5 Oct 2021 15:10:09 +0200 Subject: [PATCH 10/38] First compiling version of FTHitExpectation --- Pr/PrAlgorithms/src/.#PrForwardTracking.cpp | 1 - Tr/TrackTools/src/FTHitExpectation.cpp | 88 ++++++++++----------- 2 files changed, 41 insertions(+), 48 deletions(-) delete mode 120000 Pr/PrAlgorithms/src/.#PrForwardTracking.cpp diff --git a/Pr/PrAlgorithms/src/.#PrForwardTracking.cpp b/Pr/PrAlgorithms/src/.#PrForwardTracking.cpp deleted file mode 120000 index 172a609d54..0000000000 --- a/Pr/PrAlgorithms/src/.#PrForwardTracking.cpp +++ /dev/null @@ -1 +0,0 @@ -lohenry@lblhcbpr20.cern.ch.241200:1627457284 \ No newline at end of file diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index 63e48fcbee..d7f72aea16 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -67,7 +67,7 @@ public: IGeometryInfo const& geometry ) const override; private: - bool findIntersectingMat( const DeFTLayer layer, const LHCb::Track& aTrack, const DeFTMat*& mat, + bool findIntersectingMat( const DeFTLayer& layer, const LHCb::Track& aTrack, const DeFTMat*& mat, Gaudi::XYZPoint& intersectionPoint, IGeometryInfo const& geometry ) const; Gaudi::XYZPoint intersection( const Tf::Tsa::Line3D& line, const Gaudi::Plane3D& aPlane ) const; @@ -106,46 +106,42 @@ IHitExpectation::Info FTHitExpectation::expectation( const LHCb::Track& aTrack, // Loop over all layers //applyToAllChildren FIXME - /* - for ( auto station : m_ftDet->stations() ) { - for ( auto layer : station->layers() ) { - - const DeFTMat* mat; - Gaudi::XYZPoint intersectionPoint; - bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); - - if ( expectHit ) { - ++( info.nExpected ); - - // Check of this layer is present in the hits - auto itIter = std::find_if( ftHits.begin(), ftHits.end(), [&mat]( const LHCb::LHCbID& id ) { - return id.ftID().uniqueLayer() == mat->elementID().uniqueLayer(); - } ); - if ( itIter != ftHits.end() ) ++info.nFound; - } - } - } - */ + auto func = [this,&aTrack, &geometry,&info,&ftHits] (const DeFTLayer& layer) { + const DeFTMat* mat; + Gaudi::XYZPoint intersectionPoint; + bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); + + if ( expectHit ) { + ++( info.nExpected ); + + // Check of this layer is present in the hits + auto itIter = std::find_if( ftHits.begin(), ftHits.end(), [&mat]( const LHCb::LHCbID& id ) { + return id.ftID().uniqueLayer() == mat->elementID().uniqueLayer(); + } ); + if ( itIter != ftHits.end() ) ++info.nFound; + } + }; + m_ftDet->applyToAllLayers(func); return info; } -bool FTHitExpectation::findIntersectingMat( const DeFTLayer* layer, const LHCb::Track& aTrack, const DeFTMat* mat, +bool FTHitExpectation::findIntersectingMat( const DeFTLayer& layer, const LHCb::Track& aTrack, const DeFTMat*& mat, Gaudi::XYZPoint& intersectionPoint, IGeometryInfo const& geometry ) const { // make a Line3D from the track - double layerZ = layer->globalZ(); + double layerZ = layer.globalZ(); Tf::Tsa::Line line = yLine( aTrack, layerZ, geometry ); Tf::Tsa::Parabola aParab = xParabola( aTrack, layerZ, geometry ); Tf::Tsa::Line tanLine = aParab.tangent( layerZ ); Tf::Tsa::Line3D aLine3D = Tf::Tsa::createLine3D( tanLine, line, layerZ ); // find intersection point of track and plane of layer - const auto layerPlane = layer->plane(); + const auto layerPlane = layer.plane(); intersectionPoint = intersection( aLine3D, layerPlane ); // find the module that is hit - const auto module = layer->findModule( intersectionPoint ); + const auto module = layer.findModule( intersectionPoint ); if ( !module ) return false; // find intersection point of track and plane of module @@ -159,7 +155,8 @@ bool FTHitExpectation::findIntersectingMat( const DeFTLayer* layer, const LHCb:: const auto foundMat = module->findMat( intersectionPoint ); // check if intersection point is inside the fibres of the module if (!foundMat) return false; - mat = static_cast(foundMat);//FIXME + // mat = static_cast(foundMat);//FIXME + mat = &(*foundMat);//FIXME return foundMat->isInside( intersectionPoint ); } @@ -167,27 +164,24 @@ void FTHitExpectation::collect( const LHCb::Track& aTrack, std::vectorstations() ) { - for ( auto layer : station->layers() ) { - - const DeFTMat* mat; - Gaudi::XYZPoint intersectionPoint; - bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); - - if ( expectHit ) { - // Find the channel that is closest - Gaudi::XYZPoint localP = mat.toLocal( intersectionPoint ); - float frac; - LHCb::FTChannelID ftChan = mat.calculateChannelAndFrac( localP.x(), frac ); - - // Add the channels - // JvT: Without the fraction the bare FTChannelID is pretty useless... - if ( std::abs( frac ) <= 0.5f ) ids.push_back( LHCb::LHCbID( ftChan ) ); - } - } - } - */ + auto func = [this,&aTrack, &geometry, &ids] (const DeFTLayer& layer) { + const DeFTMat* mat; + Gaudi::XYZPoint intersectionPoint; + bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); + + if ( expectHit ) { + // Find the channel that is closest + Gaudi::XYZPoint localP = mat->toLocal( intersectionPoint ); + float frac; + LHCb::FTChannelID ftChan = mat->calculateChannelAndFrac( localP.x(), frac ); + + // Add the channels + // JvT: Without the fraction the bare FTChannelID is pretty useless... + if ( std::abs( frac ) <= 0.5f ) ids.push_back( LHCb::LHCbID( ftChan ) ); + } + }; + m_ftDet->applyToAllLayers(func); + } unsigned int FTHitExpectation::nExpected( const LHCb::Track& aTrack, IGeometryInfo const& geometry ) const { -- GitLab From b3fa7b4f80541a2c1508737c48413d1c475533fc Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 7 Oct 2021 11:57:10 +0200 Subject: [PATCH 11/38] Apply to all layers formulation --- Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index b08893813b..1288a9edaa 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -34,24 +34,19 @@ namespace FTZoneCache { public: PrFTZoneHandler( DeFT const& ftDet ) { - //FIXME applyToAllLayers() - /* - for ( auto station : ftDet.stations() ) { - for ( auto layer : station->layers() ) { + auto func = [this] (const DeFTLayer*) { int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); - + //fixme DetectorSegment seg( 0, layer->globalZ(), layer->dxdy(), layer->dzdy(), 0., 0. ); float xmax = 0.5f * layer->sizeX(); float ymax = 0.5f * layer->sizeY(); - // The setGeometry defines the z at y=0, the dxDy and the dzDy, as well as the isX properties of the zone. // This is important, since these are used in the following. // They are set once for each zone in this method. this->MakeZone( 2 * id + 1, seg, -xmax, xmax, -25.f, ymax ); // Small overlap (25 mm) for stereo layers this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers - } - } - */ + }; + ftDet.applyToAllLayers(func); } /// Standard constructor PrFTZoneHandler() = default; -- GitLab From 975c67887e31c8d6888aef4e1e2fa2cb61916b8a Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:51:36 +0100 Subject: [PATCH 12/38] Solved rebase conflict --- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index 43a828b1f8..5487de362b 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -37,8 +37,7 @@ namespace FTMatsCache { float dieGap{}; float sipmPitch{}; - MatsCache() = default; // Needed by DD4hep even if unsed ! - MatsCache( const DeFTDetector& ftDet ) { + MatsCache( const DeFT& ftDet ) { const auto first_mat = ftDet.firstMat();//FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 )->modules().at( 0 )->mats().at( 0 ); // This parameters are constant accross all mats: dieGap = first_mat.dieGap(); -- GitLab From 758fc557c8b73e1f4143eda153423b38ecc187f2 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:52:01 +0100 Subject: [PATCH 13/38] Solved rebase conflict --- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index a1def6c3b9..9c4b411671 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -17,7 +17,6 @@ */ // Gaudi -#include "DetDesc/Condition.h" #include "Event/FTCluster.h" #include "Event/FTLiteCluster.h" #include "DetDesc/ConditionAccessorHolder.h" -- GitLab From 05f5b3f9efd70453c7baecc0cbc9a2d7a263b4f7 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:57:07 +0100 Subject: [PATCH 14/38] Solved conflicts --- Pr/PrAlgorithms/src/PrForwardTracking.cpp | 3 +- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 1 + Pr/PrAlgorithms/src/PrLongLivedTracking.cpp | 5 +-- Pr/PrAlgorithms/src/PrResidualUTHits.cpp | 2 - Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 3 +- Pr/PrAlgorithms/src/PrStoreUTHit.cpp | 4 +- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 41 ++++++++++--------- .../include/PrKernel/PrFTZoneHandler.h | 13 +++--- Pr/PrMCTools/src/PrClustersResidual.cpp | 4 +- Pr/PrMCTools/src/PrPlotFTHits.cpp | 2 + .../src/ParameterizedKalmanFit.cpp | 2 + Tr/TrackTools/src/FTMeasurementProvider.cpp | 2 +- 12 files changed, 42 insertions(+), 40 deletions(-) diff --git a/Pr/PrAlgorithms/src/PrForwardTracking.cpp b/Pr/PrAlgorithms/src/PrForwardTracking.cpp index 683482ebed..10236f9e06 100644 --- a/Pr/PrAlgorithms/src/PrForwardTracking.cpp +++ b/Pr/PrAlgorithms/src/PrForwardTracking.cpp @@ -10,8 +10,7 @@ \*****************************************************************************/ // from Gaudi -#include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" +#include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/GaudiTupleTool.h" #include "GaudiAlg/Transformer.h" diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index 9c4b411671..f9e3b92834 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -17,6 +17,7 @@ */ // Gaudi +#include "DetDesc/GenericConditionAccessorHolder.h" #include "Event/FTCluster.h" #include "Event/FTLiteCluster.h" #include "DetDesc/ConditionAccessorHolder.h" diff --git a/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp b/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp index 9f7ce7fea8..a67f2ef867 100644 --- a/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp +++ b/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp @@ -27,14 +27,13 @@ #include "GaudiAlg/FixTESPath.h" #include "GaudiAlg/Transformer.h" +#include "DetDesc/GenericConditionAccessorHolder.h" + // from Gaudi #include "GaudiKernel/Point3DTypes.h" #include "GaudiKernel/StdArrayAsProperty.h" #include "GaudiKernel/SystemOfUnits.h" -#include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" - #include using ROOT::Math::CholeskyDecomp; diff --git a/Pr/PrAlgorithms/src/PrResidualUTHits.cpp b/Pr/PrAlgorithms/src/PrResidualUTHits.cpp index bbcd88776c..84526d8c9d 100644 --- a/Pr/PrAlgorithms/src/PrResidualUTHits.cpp +++ b/Pr/PrAlgorithms/src/PrResidualUTHits.cpp @@ -9,8 +9,6 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ // Include files -#include "DetDesc/Condition.h" -#include "DetDesc/GenericConditionAccessorHolder.h" #include "DetDesc/IConditionDerivationMgr.h" #include "Event/ODIN.h" #include "Event/PrLongTracks.h" diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index af33cac607..20f909c974 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -9,8 +9,7 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" +#include "DetDesc/GenericConditionAccessorHolder.h" #include "Event/FTLiteCluster.h" #include "FTDet/DeFTDetector.h" #include "GaudiAlg/Transformer.h" diff --git a/Pr/PrAlgorithms/src/PrStoreUTHit.cpp b/Pr/PrAlgorithms/src/PrStoreUTHit.cpp index 8673b8c440..381f2b49ea 100644 --- a/Pr/PrAlgorithms/src/PrStoreUTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreUTHit.cpp @@ -8,8 +8,8 @@ * granted to it by virtue of its status as an Intergovernmental Organization * * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" + +#include "DetDesc/GenericConditionAccessorHolder.h" #include "Event/RawBank.h" #include "GaudiAlg/Transformer.h" #include "Kernel/IUTReadoutTool.h" diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index 5487de362b..9396dfb444 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -20,7 +20,7 @@ #endif namespace FTMatsCache { - + struct MatsCache { /** * partial SoA cache for mats, reserve enough (here 4096 which is more than enough) @@ -40,26 +40,27 @@ namespace FTMatsCache { MatsCache( const DeFT& ftDet ) { const auto first_mat = ftDet.firstMat();//FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 )->modules().at( 0 )->mats().at( 0 ); // This parameters are constant accross all mats: - dieGap = first_mat.dieGap(); - sipmPitch = first_mat.sipmPitch(); - uBegin = first_mat.uBegin(); - halfChannelPitch = first_mat.halfChannelPitch(); - auto assertFunc = [&dieGap, &sipmPitch, &uBegin, &halfChannelPitch] (const DeFTMat mat){ - assert( dieGap == mat->dieGap() && "Unexpected difference in dieGap" ); - assert( sipmPitch == mat->sipmPitch() && "Unexpected difference in sipmPitch" ); - assert( uBegin == mat->uBegin() && "Unexpected difference in uBegin" ); - assert( halfChannelPitch == mat->halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); + this->dieGap = first_mat.dieGap(); + this->sipmPitch = first_mat.sipmPitch(); + this->uBegin = first_mat.uBegin(); + this->halfChannelPitch = first_mat.halfChannelPitch(); + auto assertFunc = [this] (const DeFTMat& mat){ + assert( this->dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); + assert( this->sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); + assert( this->uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); + assert( this->halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); }; - ftDet.applyToAllMats(assertFunc); - auto func = [&mirrorPoint, &ddx, &dxdy, &dzdy, &globaldy] (const DeFTMat mat){ - const auto index = mat->elementID().uniqueMat(); - mirrorPoint[index] = mat->mirrorPoint(); - ddx[index] = mat->ddx(); - dxdy[index] = mat->dxdy(); - dzdy[index] = mat->dzdy(); - globaldy[index] = mat->globaldy(); + // ftDet.applyToAllMats(assertFunc); + auto func = [this] (const DeFTMat& mat){ + const auto index = mat.elementID().uniqueMat(); + //FIXME + this->mirrorPoint[index] = mat.mirrorPoint(); + this->ddx[index] = mat.ddx(); + this->dxdy[index] = mat.dxdy(); + this->dzdy[index] = mat.dzdy(); + this->globaldy[index] = mat.globaldy(); }; - ftDet.applyToAllMats(func); + // ftDet.applyToAllMats(func); + }; }; - } // namespace FTMatsCache diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index 1288a9edaa..c6a0c9e9af 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -34,12 +34,13 @@ namespace FTZoneCache { public: PrFTZoneHandler( DeFT const& ftDet ) { - auto func = [this] (const DeFTLayer*) { - int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); - //fixme - DetectorSegment seg( 0, layer->globalZ(), layer->dxdy(), layer->dzdy(), 0., 0. ); - float xmax = 0.5f * layer->sizeX(); - float ymax = 0.5f * layer->sizeY(); + auto func = [this] (const DeFTLayer& layer) { + // int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); + int id = layer.layerID(); + //fixme + DetectorSegment seg( 0, layer.globalZ(), layer.dxdy(), layer.dzdy(), 0., 0. ); + float xmax = 0.5f * layer.sizeX(); + float ymax = 0.5f * layer.sizeY(); // The setGeometry defines the z at y=0, the dxDy and the dzDy, as well as the isX properties of the zone. // This is important, since these are used in the following. // They are set once for each zone in this method. diff --git a/Pr/PrMCTools/src/PrClustersResidual.cpp b/Pr/PrMCTools/src/PrClustersResidual.cpp index 3c9327cd06..b527f13308 100644 --- a/Pr/PrMCTools/src/PrClustersResidual.cpp +++ b/Pr/PrMCTools/src/PrClustersResidual.cpp @@ -270,13 +270,13 @@ void PrClustersResidual::Occupancy( const PrFTHitHandler& FTHitHandler ) */ auto quarter = liteCluster.channelID().quarter(); const auto chanID = liteCluster.channelID(); - const auto module = m_ftDet.findModule( chanID ); + const auto module = m_ftDet->findModule( chanID ); if ( !module ) { error() << "Cannot find Module associated to FTChannelID : " << chanID << endmsg; error() << "Abort Occupancy plot checking" << endmsg; return; } - int pseudochannel = module->pseudoChannel( chanID ); + int pseudochannel = module.pseudoChannel( chanID ); //--- runs from [0 to 12,287] (96 SiPm *128 channels/SiPm) //--- 4 quartes [0,1,2,3] , 128 channels squeezed to 1 value. (Occupancy in terms of Hits/SiPM array [128 // channels] diff --git a/Pr/PrMCTools/src/PrPlotFTHits.cpp b/Pr/PrMCTools/src/PrPlotFTHits.cpp index d3fcdd1d00..87929ecc83 100644 --- a/Pr/PrMCTools/src/PrPlotFTHits.cpp +++ b/Pr/PrMCTools/src/PrPlotFTHits.cpp @@ -941,3 +941,5 @@ StatusCode PrPlotFTHits::finalize() { always() << "Ciao, for the occupancy plots, normalize the histograms for the amount of events processed" << endmsg; return GaudiHistoAlg::finalize(); // must be called after all other actions } + +//============================================================================= diff --git a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp index 79b12c7458..c050421a6f 100644 --- a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp +++ b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp @@ -1,3 +1,4 @@ +#ifdef FIXME /*****************************************************************************\ * (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration * * * @@ -485,3 +486,4 @@ bool ParameterizedKalmanFit::PredictState( int forward, int nHit, Gaudi::Vector5 } return Succes; } +#endif diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index 064c13e490..62d6b4128c 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -38,7 +38,7 @@ public: } private: - const DeFT m_det = nullptr; + DeFT m_det = nullptr; DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; -- GitLab From dedb3670b331d286d9215557ca2818846c600032 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 14 Oct 2021 11:11:40 +0200 Subject: [PATCH 15/38] Fixed some conflicts --- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index 7573beca61..0f0f21a1f4 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -236,7 +236,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F m_lcpm_NZS->fillNZS( chanID.module() ); m_lcpsipm_NZS->fillNZS( chanID.sipmInModule() ); m_lcpc_NZS->fillNZS( chanID.channel() ); - if ( mod ) { m_lcppc_NZS->fillNZS( pseudoChannel ); } + m_lcppc_NZS->fillNZS( pseudoChannel ); m_lcf_NZS->fillNZS( cluster.fraction() ); m_lcs_NZS->fillNZS( cluster.pseudoSize() ); @@ -284,7 +284,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F m_lcpm_NZS->fillDigit( chanID.module() ); m_lcpsipm_NZS->fillDigit( chanID.sipmInModule() ); m_lcpc_NZS->fillDigit( chanID.channel() ); - if ( mod ) { m_lcppc_NZS->fillDigit( pseudoChannel ); } + m_lcppc_NZS->fillDigit( pseudoChannel ); m_lcf_NZS->fillDigit( cluster.fraction() ); m_lcs_NZS->fillDigit( cluster.pseudoSize() ); -- GitLab From a51e802a796000392f7579815037d61f80014374 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 14 Oct 2021 15:06:38 +0200 Subject: [PATCH 16/38] Changed the access to toLocal --- Pr/PrMCTools/src/PrFTHitsMonitor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp index c0e014da0e..4259ad690c 100644 --- a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp +++ b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp @@ -136,12 +136,11 @@ void PrFTHitsMonitor::operator()( const FTHits& FThits, const FTLiteClusters& cl << "(" << hit.x() << ", 0, " << hit.z() << ")" << std::endl; auto result = mcHitForId.find( hit.id().ftID() ); if ( result == mcHitForId.end() ) continue; - for ( auto& mcHit : ( *result ).second ) { - auto mcHit_local = mat->geometry()->toLocal( mcHit->midPoint() );//FIXME + auto mcHit_local = mat.toLocal( mcHit->midPoint() );//FIXME const Gaudi::XYZPoint FThit = Gaudi::XYZPoint( hit.x( mcHit->midPoint().Y() ), 0, hit.z( mcHit->midPoint().Y() ) ); - auto FThit_local = mat->geometry()->toLocal( FThit );//FIXME + auto FThit_local = mat.toLocal( FThit );//FIXME Gaudi::XYZVector residual; std::string name_addition = ""; if ( m_isGlobal ) { -- GitLab From 1307598c1833e648859c522e81beb8a29a44b4ac Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 14 Oct 2021 17:00:41 +0200 Subject: [PATCH 17/38] Small changes --- FT/FTMonitors/src/FTClusterMonitor.cpp | 4 +- FT/FTMonitors/src/FTDigitMonitor.cpp | 2 +- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 2 +- Pr/PrAlgorithms/src/PrLongLivedTracking.cpp | 2 +- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 2 +- Pr/PrAlgorithms/src/PrStoreUTHit.cpp | 2 +- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 4 +- Pr/PrMCTools/src/VPClusterEfficiency.cpp | 3 +- Pr/PrVeloUT/src/PrVeloUT.cpp | 4 +- .../src/SciFiTrackForwardingStoreHit.cpp | 40 +++++++++---------- 10 files changed, 32 insertions(+), 33 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index 4aa9bc2642..37b5b644f5 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -15,7 +15,7 @@ #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/PhysicalConstants.h" #include "GaudiKernel/SystemOfUnits.h" -#include +#include #include #include "Kernel/FTChannelID.h" @@ -204,7 +204,7 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d m_lcpm->fill( to_unsigned( chanID.module() ) ); m_lcpsipm->fill( chanID.sipmInModule() ); m_lcpc->fill( chanID.channel() ); - if ( mod != nullptr ) { m_lcppc->fill( pseudoChannel ); } + m_lcppc->fill( pseudoChannel ); m_lcf->fill( cluster.fraction() ); m_lcs->fill( cluster.pseudoSize() ); m_lcsf->fill( cluster.pseudoSize(), cluster.fraction() ); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index e8d25a9402..eff4c34d72 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -19,7 +19,7 @@ #include "Kernel/FastClusterContainer.h" #include #include -#include +#include #include #include #include diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index 0f0f21a1f4..d265f8fefc 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -13,7 +13,7 @@ #include "GaudiAlg/Consumer.h" #include "GaudiAlg/GaudiHistoAlg.h" #include "GaudiKernel/SystemOfUnits.h" -#include +#include #include #include diff --git a/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp b/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp index a67f2ef867..ccf2753d6c 100644 --- a/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp +++ b/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp @@ -27,7 +27,7 @@ #include "GaudiAlg/FixTESPath.h" #include "GaudiAlg/Transformer.h" -#include "DetDesc/GenericConditionAccessorHolder.h" +#include "DetDesc/ConditionAccessorHolder.h"//FIXME // from Gaudi #include "GaudiKernel/Point3DTypes.h" diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 20f909c974..c288e95fbc 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -74,7 +74,7 @@ PrFTHitHandler PrStoreFTHit::operator()( const FTLiteClusters& clusters, PrFTHitHandler hitHandler( clusters.size() ); if ( msgLevel( MSG::DEBUG ) ) debug() << "Retrieved " << clusters.size() << " clusters" << endmsg; - for ( uint16_t iQuarter = 0; iQuarter < DeFT::nQuarters; ++iQuarter ) { + for ( uint16_t iQuarter = 0; iQuarter < LHCb::Detector::FT::nQuarters; ++iQuarter ) { uint info = ( iQuarter >> 1 ) | ( ( ( iQuarter << 4 ) ^ ( iQuarter << 5 ) ^ 128u ) & 128u ); auto r = ranges::views::transform( clusters.range( iQuarter ), [&]( LHCb::FTLiteCluster clus ) -> PrHit { diff --git a/Pr/PrAlgorithms/src/PrStoreUTHit.cpp b/Pr/PrAlgorithms/src/PrStoreUTHit.cpp index 381f2b49ea..b7174ac223 100644 --- a/Pr/PrAlgorithms/src/PrStoreUTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreUTHit.cpp @@ -9,7 +9,7 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include "DetDesc/GenericConditionAccessorHolder.h" +#include "DetDesc/ConditionAccessorHolder.h"//FIXME #include "Event/RawBank.h" #include "GaudiAlg/Transformer.h" #include "Kernel/IUTReadoutTool.h" diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index 9396dfb444..dcbc798a51 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -50,7 +50,7 @@ namespace FTMatsCache { assert( this->uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); assert( this->halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); }; - // ftDet.applyToAllMats(assertFunc); + ftDet.applyToAllMats(assertFunc); auto func = [this] (const DeFTMat& mat){ const auto index = mat.elementID().uniqueMat(); //FIXME @@ -60,7 +60,7 @@ namespace FTMatsCache { this->dzdy[index] = mat.dzdy(); this->globaldy[index] = mat.globaldy(); }; - // ftDet.applyToAllMats(func); + ftDet.applyToAllMats(func); }; }; } // namespace FTMatsCache diff --git a/Pr/PrMCTools/src/VPClusterEfficiency.cpp b/Pr/PrMCTools/src/VPClusterEfficiency.cpp index 213c96306c..e0a9755a1f 100644 --- a/Pr/PrMCTools/src/VPClusterEfficiency.cpp +++ b/Pr/PrMCTools/src/VPClusterEfficiency.cpp @@ -8,8 +8,7 @@ * granted to it by virtue of its status as an Intergovernmental Organization * * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include "DetDesc/ConditionAccessor.h" -#include "DetDesc/ConditionAccessorHolder.h" +#include "DetDesc/GenericConditionAccessorHolder.h" #include "Event/LinksByKey.h" #include "Event/MCHit.h" #include "Event/MCParticle.h" diff --git a/Pr/PrVeloUT/src/PrVeloUT.cpp b/Pr/PrVeloUT/src/PrVeloUT.cpp index 5f7ddd93f4..a87bdbc873 100644 --- a/Pr/PrVeloUT/src/PrVeloUT.cpp +++ b/Pr/PrVeloUT/src/PrVeloUT.cpp @@ -9,8 +9,8 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ // Include files -#include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" +#include "DetDesc/Condition.h"//FIXME +#include "DetDesc/ConditionAccessorHolder.h"//FIXME #include "Event/PrUpstreamTracks.h" #include "Event/PrVeloTracks.h" #include "GaudiAlg/ISequencerTimerTool.h" diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index b85fb9f752..18132cb3b4 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -48,31 +48,31 @@ namespace { float m_halfChannelPitch; MatsCache( const DeFT& ftDet ) { - auto const first_mat = ftDet.getFirstMat();//FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; + auto const first_mat = ftDet.firstMat();//FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; // This parameters are constant accross all mats: - m_dieGap = first_mat->dieGap(); - m_sipmPitch = first_mat->sipmPitch(); - m_uBegin = first_mat->uBegin(); - m_halfChannelPitch = first_mat->halfChannelPitch(); + m_dieGap = first_mat.dieGap(); + m_sipmPitch = first_mat.sipmPitch(); + m_uBegin = first_mat.uBegin(); + m_halfChannelPitch = first_mat.halfChannelPitch(); //First assert things - auto assertFunc = [&m_dieGap, &m_sipmPitch, &m_uBegin, &m_halfChannelPitch] (const DeFTMat& mat){ - assert( m_dieGap == mat->dieGap() && "Unexpected difference in dieGap" ); - assert( m_sipmPitch == mat->sipmPitch() && "Unexpected difference in sipmPitch" ); - assert( m_uBegin == mat->uBegin() && "Unexpected difference in uBegin" ); - assert( m_halfChannelPitch == mat->halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); + auto assertFunc = [this] (const DeFTMat& mat){ + assert( this->m_dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); + assert( this->m_sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); + assert( this->m_uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); + assert( this->m_halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); }; ftDet.applyToAllMats(assertFunc); //FIXME - auto func = [&m_mats_x0, &m_mats_dx] (const DeFTMat& mat){ - auto index = mat->elementID().uniqueMat(); + auto func = [this] (const DeFTMat& mat){ + auto index = mat.elementID().uniqueMat(); - auto dxdy = mat->dxdy(); - auto mirrorPoint = mat->mirrorPoint(); - auto ddx = mat->ddx(); - - m_mats_x0[index] = mirrorPoint.x() - mirrorPoint.y() * dxdy; - m_mats_dx[index] = ddx.x() - ddx.y() * dxdy; + auto dxdy = mat.dxdy(); + auto mirrorPoint = mat.mirrorPoint(); + auto ddx = mat.ddx(); + + this->m_mats_x0[index] = mirrorPoint.x() - mirrorPoint.y() * dxdy; + this->m_mats_dx[index] = ddx.x() - ddx.y() * dxdy; }; ftDet.applyToAllMats(func); @@ -93,8 +93,8 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, - inputLocation() ); + addConditionDerivation( {DeFTDetectorLocation::Default}, + inputLocation() ); // TODO: this should be ~80 micron; get this from a tool? // std::array clusRes = {0.05f, 0.08f, 0.11f, 0.14f, 0.17f, 0.20f, 0.23f, 0.26f, 0.29f}; -- GitLab From dfafb670ef756379a5cff6cd828d5c32ac24b09c Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 14 Oct 2021 17:01:00 +0200 Subject: [PATCH 18/38] Added the applytoallchildren --- Tr/TrackTools/src/FTHitExpectation.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index d7f72aea16..fe553593a8 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -105,7 +105,6 @@ IHitExpectation::Info FTHitExpectation::expectation( const LHCb::Track& aTrack, []( const LHCb::LHCbID& id ) { return id.isFT(); } ); // Loop over all layers - //applyToAllChildren FIXME auto func = [this,&aTrack, &geometry,&info,&ftHits] (const DeFTLayer& layer) { const DeFTMat* mat; Gaudi::XYZPoint intersectionPoint; -- GitLab From 372f7b6cf7b3c1761331ba3bca9196af75cbd546 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:57:40 +0100 Subject: [PATCH 19/38] Solved conflicts --- Pr/PrMCTools/src/PrPlotFTHits.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Pr/PrMCTools/src/PrPlotFTHits.cpp b/Pr/PrMCTools/src/PrPlotFTHits.cpp index 87929ecc83..633f1dbc86 100644 --- a/Pr/PrMCTools/src/PrPlotFTHits.cpp +++ b/Pr/PrMCTools/src/PrPlotFTHits.cpp @@ -20,11 +20,6 @@ #include "Event/Track.h" #include "FTDAQ/FTInfo.h" #include "FTDet/DeFTDetector.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiHistoAlg.h" -#include "GaudiAlg/GaudiHistoTool.h" -#include "GaudiAlg/IHistoTool.h" -#include "GaudiKernel/AnyDataHandle.h" #include "Linker/AllLinks.h" #include "Linker/LinkedFrom.h" #include "Linker/LinkedTo.h" @@ -176,11 +171,9 @@ StatusCode PrPlotFTHits::initialize() { return GaudiHistoAlg::initialize().andThen( [&]() -> StatusCode { static const std::string histoDir = "Track/"; if ( "" == histoTopDir() ) setHistoTopDir( histoDir ); - StatusCode sc = m_histoTool.retrieve(); if ( sc.isFailure() ) { return sc; } m_ghtool = dynamic_cast( m_histoTool.get() ); - // -- catch the possible failure of the dynamic cast if ( !m_ghtool ) { error() << "Dynamic cast of Gaudi Histogramming Tool failed!" << endmsg; @@ -941,5 +934,4 @@ StatusCode PrPlotFTHits::finalize() { always() << "Ciao, for the occupancy plots, normalize the histograms for the amount of events processed" << endmsg; return GaudiHistoAlg::finalize(); // must be called after all other actions } - //============================================================================= -- GitLab From f8bfb9b39d066a0d1eb0c7895a9bc40d793b381f Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Sat, 23 Oct 2021 16:13:45 +0200 Subject: [PATCH 20/38] Broke FTMeasurementProvider for now, but corrected the rest --- Tr/TrackFitEvent/include/Event/Measurement.h | 10 ++++++++++ Tr/TrackFitEvent/src/Measurement.cpp | 7 ++++++- .../tests/src/test_measurement_minimize.cpp | 4 ++++ Tr/TrackTools/src/FTMeasurementProvider.cpp | 6 +++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Tr/TrackFitEvent/include/Event/Measurement.h b/Tr/TrackFitEvent/include/Event/Measurement.h index a88325d113..ffdf931e87 100644 --- a/Tr/TrackFitEvent/include/Event/Measurement.h +++ b/Tr/TrackFitEvent/include/Event/Measurement.h @@ -75,7 +75,13 @@ namespace LHCb { class Measurement final { public: struct FT { +#ifdef USE_DD4HEP + DeFTMat detElem{}; + auto& mat() const {return detElem;} +#else const DeFTMat* detElem = nullptr; + auto& mat() const {return *detElem;} +#endif }; struct Muon { const DeMuonChamber* detElem = nullptr; @@ -140,7 +146,11 @@ namespace LHCb { : Measurement{id, z, errMeas, std::move( traj ), UT{elem}} {} /// FT constructor +#ifdef USE_DD4HEP + Measurement( LHCbID id, double z, LHCb::LineTraj traj, double errMeas, const DeFTMat elem ) +#else Measurement( LHCbID id, double z, LHCb::LineTraj traj, double errMeas, const DeFTMat* elem ) +#endif : Measurement{id, z, errMeas, std::move( traj ), FT{elem}} {} /// Muon constructor diff --git a/Tr/TrackFitEvent/src/Measurement.cpp b/Tr/TrackFitEvent/src/Measurement.cpp index 3ee40ce642..7da305cb33 100644 --- a/Tr/TrackFitEvent/src/Measurement.cpp +++ b/Tr/TrackFitEvent/src/Measurement.cpp @@ -17,28 +17,33 @@ Gaudi::XYZPoint LHCb::Measurement::toLocal( const Gaudi::XYZPoint& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toLocal( globalPoint ); }, + [&globalPoint]( const FT& ft ) { return ft.mat().toLocal( globalPoint ); }, [&globalPoint]( const VP& vp ) { return vp.sensor().toLocal( globalPoint ); } ); } Gaudi::XYZVector LHCb::Measurement::toLocal( const Gaudi::XYZVector& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toLocal( globalPoint ); }, []( const UT& ) -> Gaudi::XYZVector { throw std::string( "UT has no toGlobal(XYZVector) method" ); }, + [&globalPoint]( const FT& ft ) { return ft.mat().toLocal( globalPoint ); }, [&globalPoint]( const VP& vp ) { return vp.sensor().toLocal( globalPoint ); } ); } Gaudi::XYZPoint LHCb::Measurement::toGlobal( const Gaudi::XYZPoint& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toGlobal( globalPoint ); }, - [&globalPoint]( const VP& vp ) { return vp.sensor().toGlobal( globalPoint ); } ); + [&globalPoint]( const FT& ft ) { return ft.mat().toGlobal( globalPoint ); }, + [&globalPoint]( const VP& vp ) { return vp.sensor().toGlobal( globalPoint ); } ); } Gaudi::XYZVector LHCb::Measurement::toGlobal( const Gaudi::XYZVector& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toGlobal( globalPoint ); }, []( const UT& ) -> Gaudi::XYZVector { throw std::string( "UT has no toGlobal(XYZVector) method" ); }, + [&globalPoint]( const FT& ft ) { return ft.mat().toGlobal( globalPoint ); }, [&globalPoint]( const VP& vp ) { return vp.sensor().toGlobal( globalPoint ); } ); } std::string LHCb::Measurement::name() const { return visit( []( const auto& m ) { return m.detElem->name(); }, + []( const FT& ft ) -> std::string { return ft.mat().name(); }, []( const VP& vp ) -> std::string { return vp.sensor().name(); } ); } diff --git a/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp b/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp index 10492c89bf..41817954bc 100644 --- a/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp +++ b/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp @@ -29,7 +29,11 @@ namespace { {-0x1.1fba36p+11, -0x1.2f59a2p+11, 0x1.2362e4p+13} ); // need this for the constructor but it doesn't need to actually point to something + #ifdef USE_DD4HEP + DeVPSensor det{}; + #else DeVPSensor* det = nullptr; + #endif // input: ID, z, trajectory, err, SubInfo LHCb::Measurement meas{LHCb::LHCbID(), 0x1.23a898p+13, meas_trajectory, 0, det}; diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index 62d6b4128c..3032bba192 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -38,7 +38,11 @@ public: } private: +#ifdef USE_DD4HEP + DeFT m_det{}; +#else DeFT m_det = nullptr; +#endif DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; @@ -58,7 +62,7 @@ StatusCode FTMeasurementProvider::initialize() { if ( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); } // Retrieve the detector element - m_det = getDet( DeFTDetectorLocation::Default ); + // m_det = getDet( DeFTDetectorLocation::Default );//FIXME setProperty( "Tolerance", 0.002 * Gaudi::Units::mm ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return sc; -- GitLab From c37fa9eb3fd0c860cc85344f00ff627275cfa942 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Sun, 24 Oct 2021 13:48:55 +0200 Subject: [PATCH 21/38] Adapted to fully optional --- FT/FTMonitors/src/FTClusterMonitor.cpp | 2 +- FT/FTMonitors/src/FTDigitMonitor.cpp | 2 +- Pr/PrMCTools/src/PrClustersResidual.cpp | 2 +- Pr/PrMCTools/src/PrFTHitsMonitor.cpp | 4 ++-- Tr/TrackTools/src/FTMeasurementProvider.cpp | 15 +++++++++------ 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index 37b5b644f5..ccd73b2652 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -194,7 +194,7 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d for ( const auto& cluster : clusters.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); const auto mod = deFT.findModule( chanID ); - + size_t q_ID = chanID.moniModuleID(); uint SiPM_ID = chanID.moniSiPMID(); int pseudoChannel = mod->pseudoChannel( chanID ); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index eff4c34d72..74d3cf1f44 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -82,7 +82,7 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deF plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); const auto module = deFT.findModule( chanID ); - int pseudoChannel = module.pseudoChannel( chanID ); + int pseudoChannel = module->pseudoChannel( chanID ); plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., 12288., 192 ); } diff --git a/Pr/PrMCTools/src/PrClustersResidual.cpp b/Pr/PrMCTools/src/PrClustersResidual.cpp index b527f13308..b04be913e8 100644 --- a/Pr/PrMCTools/src/PrClustersResidual.cpp +++ b/Pr/PrMCTools/src/PrClustersResidual.cpp @@ -276,7 +276,7 @@ void PrClustersResidual::Occupancy( const PrFTHitHandler& FTHitHandler ) error() << "Abort Occupancy plot checking" << endmsg; return; } - int pseudochannel = module.pseudoChannel( chanID ); + int pseudochannel = module->pseudoChannel( chanID ); //--- runs from [0 to 12,287] (96 SiPm *128 channels/SiPm) //--- 4 quartes [0,1,2,3] , 128 channels squeezed to 1 value. (Occupancy in terms of Hits/SiPM array [128 // channels] diff --git a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp index 4259ad690c..36cbb36864 100644 --- a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp +++ b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp @@ -137,10 +137,10 @@ void PrFTHitsMonitor::operator()( const FTHits& FThits, const FTLiteClusters& cl auto result = mcHitForId.find( hit.id().ftID() ); if ( result == mcHitForId.end() ) continue; for ( auto& mcHit : ( *result ).second ) { - auto mcHit_local = mat.toLocal( mcHit->midPoint() );//FIXME + auto mcHit_local = mat->toLocal( mcHit->midPoint() );//FIXME const Gaudi::XYZPoint FThit = Gaudi::XYZPoint( hit.x( mcHit->midPoint().Y() ), 0, hit.z( mcHit->midPoint().Y() ) ); - auto FThit_local = mat.toLocal( FThit );//FIXME + auto FThit_local = mat->toLocal( FThit );//FIXME Gaudi::XYZVector residual; std::string name_addition = ""; if ( m_isGlobal ) { diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index 3032bba192..c154a41cd1 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -41,7 +41,7 @@ private: #ifdef USE_DD4HEP DeFT m_det{}; #else - DeFT m_det = nullptr; + DeFT* m_det = nullptr; #endif DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; @@ -62,7 +62,7 @@ StatusCode FTMeasurementProvider::initialize() { if ( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); } // Retrieve the detector element - // m_det = getDet( DeFTDetectorLocation::Default );//FIXME + // m_det = getDet( DeFTDetectorLocation::Default );//FIXME ADDCONDITION setProperty( "Tolerance", 0.002 * Gaudi::Units::mm ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return sc; @@ -81,8 +81,11 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i [&, clusters = m_clustersDh.get()]( const LHCb::LHCbID& id ) { /// The clusters are not sorted anymore, so we can use a find_if /// to find the element corresponding to the channel ID +#ifdef USE_DD4HEP const auto ftMat = m_det.findMat( id.ftID() ); - + #else + const auto ftMat = m_det->findMat( id.ftID() ); +#endif const auto& c = clusters->range( id.ftID().uniqueQuarter() - 16u ); auto itH = id.isFT() ? std::find_if( c.begin(), c.end(), @@ -95,9 +98,9 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i StatusCode::FAILURE ); } - return LHCb::Measurement{itH->channelID(), ftMat.globalZ(), - ftMat.trajectory( itH->channelID(), itH->fraction() ), + return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), + ftMat->trajectory( itH->channelID(), itH->fraction() ), 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization - ftMat}; + *ftMat}; } ); } -- GitLab From 4053dbb5127091c1785bf43b72a862ab07ab0dbd Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 25 Oct 2021 10:34:03 +0200 Subject: [PATCH 22/38] Full DetDesc compatibility --- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 2 +- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 7 +++++++ .../src/SciFiTrackForwardingStoreHit.cpp | 7 +++++++ .../src/ParameterizedKalmanFit.cpp | 5 +---- .../src/ParameterizedKalmanFit.h | 2 +- Tr/TrackTools/src/FTMeasurementProvider.cpp | 18 ++++++++---------- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index c288e95fbc..09426de06b 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -74,7 +74,7 @@ PrFTHitHandler PrStoreFTHit::operator()( const FTLiteClusters& clusters, PrFTHitHandler hitHandler( clusters.size() ); if ( msgLevel( MSG::DEBUG ) ) debug() << "Retrieved " << clusters.size() << " clusters" << endmsg; - for ( uint16_t iQuarter = 0; iQuarter < LHCb::Detector::FT::nQuarters; ++iQuarter ) { + for ( uint16_t iQuarter = 0; iQuarter < 4; ++iQuarter ) {//FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP uint info = ( iQuarter >> 1 ) | ( ( ( iQuarter << 4 ) ^ ( iQuarter << 5 ) ^ 128u ) & 128u ); auto r = ranges::views::transform( clusters.range( iQuarter ), [&]( LHCb::FTLiteCluster clus ) -> PrHit { diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index dcbc798a51..d1bd4c1bdc 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -40,10 +40,17 @@ namespace FTMatsCache { MatsCache( const DeFT& ftDet ) { const auto first_mat = ftDet.firstMat();//FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 )->modules().at( 0 )->mats().at( 0 ); // This parameters are constant accross all mats: + #ifdef USE_DD4HEP this->dieGap = first_mat.dieGap(); this->sipmPitch = first_mat.sipmPitch(); this->uBegin = first_mat.uBegin(); this->halfChannelPitch = first_mat.halfChannelPitch(); + #else + this->dieGap = first_mat->dieGap(); + this->sipmPitch = first_mat->sipmPitch(); + this->uBegin = first_mat->uBegin(); + this->halfChannelPitch = first_mat->halfChannelPitch(); + #endif auto assertFunc = [this] (const DeFTMat& mat){ assert( this->dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); assert( this->sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index 18132cb3b4..aecfa5b507 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -51,10 +51,17 @@ namespace { auto const first_mat = ftDet.firstMat();//FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; // This parameters are constant accross all mats: + #ifdef USE_DD4HEP m_dieGap = first_mat.dieGap(); m_sipmPitch = first_mat.sipmPitch(); m_uBegin = first_mat.uBegin(); m_halfChannelPitch = first_mat.halfChannelPitch(); + #else + m_dieGap = first_mat->dieGap(); + m_sipmPitch = first_mat->sipmPitch(); + m_uBegin = first_mat->uBegin(); + m_halfChannelPitch = first_mat->halfChannelPitch(); + #endif //First assert things auto assertFunc = [this] (const DeFTMat& mat){ assert( this->m_dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); diff --git a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp index c050421a6f..fac870596c 100644 --- a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp +++ b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp @@ -1,4 +1,3 @@ -#ifdef FIXME /*****************************************************************************\ * (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration * * * @@ -15,6 +14,7 @@ #include "FTDet/DeFTDetector.h" #include "Kernel/Trajectory.h" #include "LHCbMath/Similarity.h" +#include "DetDesc/DetectorElement.h" // local #include "ParameterizedKalmanFit.h" @@ -58,8 +58,6 @@ StatusCode ParameterizedKalmanFit::initialize() { return StatusCode::FAILURE; } - m_magFieldSvc = svc( "MagneticFieldSvc", true ); - info() << "Use parameters from " << m_ParamFileLocation.value() + "/Mag*" << endmsg; m_ParExtrUp = std::make_unique( m_ParamFileLocation, Polarity::Up, m_UseOneParameterSet ); @@ -486,4 +484,3 @@ bool ParameterizedKalmanFit::PredictState( int forward, int nHit, Gaudi::Vector5 } return Succes; } -#endif diff --git a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.h b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.h index 6c8f2fcb22..73291fa351 100644 --- a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.h +++ b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.h @@ -107,7 +107,7 @@ private: "MeasurementProvider/MeasurementProvider"}; // Magnet field service in order to load the correct parameters - ILHCbMagnetSvc* m_magFieldSvc = nullptr; + ServiceHandle m_magFieldSvc{this, "MagneticField", "MagneticFieldSvc"}; //################# // 1. Main method diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index c154a41cd1..f1ee758763 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -38,11 +38,7 @@ public: } private: -#ifdef USE_DD4HEP - DeFT m_det{}; -#else DeFT* m_det = nullptr; -#endif DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; @@ -62,7 +58,7 @@ StatusCode FTMeasurementProvider::initialize() { if ( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); } // Retrieve the detector element - // m_det = getDet( DeFTDetectorLocation::Default );//FIXME ADDCONDITION + m_det = getDet( DeFTDetectorLocation::Default );//FIXME ADDCONDITION setProperty( "Tolerance", 0.002 * Gaudi::Units::mm ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return sc; @@ -81,11 +77,7 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i [&, clusters = m_clustersDh.get()]( const LHCb::LHCbID& id ) { /// The clusters are not sorted anymore, so we can use a find_if /// to find the element corresponding to the channel ID -#ifdef USE_DD4HEP - const auto ftMat = m_det.findMat( id.ftID() ); - #else const auto ftMat = m_det->findMat( id.ftID() ); -#endif const auto& c = clusters->range( id.ftID().uniqueQuarter() - 16u ); auto itH = id.isFT() ? std::find_if( c.begin(), c.end(), @@ -97,10 +89,16 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i throw GaudiException( "Can not find FTLiteCluster for given lhcbID", __func__, StatusCode::FAILURE ); } - + #ifdef USE_DD4HEP return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), ftMat->trajectory( itH->channelID(), itH->fraction() ), 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization *ftMat}; + #else + return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), + ftMat->trajectory( itH->channelID(), itH->fraction() ), + 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization + ftMat}; + #endif } ); } -- GitLab From 3817709a79932f6474a6d6d8f8620760041fdf60 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Mon, 29 Nov 2021 14:54:19 +0100 Subject: [PATCH 23/38] Fixed formatting --- FT/FTMonitors/src/FTClusterMonitor.cpp | 4 +- FT/FTMonitors/src/FTDigitMonitor.cpp | 6 +- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 4 +- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 4 +- Pr/PrAlgorithms/src/PrLongLivedTracking.cpp | 2 +- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 2 +- Pr/PrAlgorithms/src/PrStoreUTHit.cpp | 2 +- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 45 +++++++------- .../include/PrKernel/PrFTZoneHandler.h | 22 +++---- Pr/PrMCTools/src/PrClustersResidual.cpp | 6 +- Pr/PrMCTools/src/PrFTHitsMonitor.cpp | 4 +- Pr/PrVeloUT/src/PrVeloUT.cpp | 4 +- .../src/SciFiTrackForwardingStoreHit.cpp | 57 +++++++++--------- .../src/ParameterizedKalmanFit.cpp | 2 +- Tr/TrackFitEvent/include/Event/Measurement.h | 9 +-- Tr/TrackFitEvent/src/Measurement.cpp | 8 +-- .../tests/src/test_measurement_minimize.cpp | 8 +-- Tr/TrackTools/src/FTHitExpectation.cpp | 59 +++++++++--------- Tr/TrackTools/src/FTMeasurementProvider.cpp | 60 +++++++++---------- 19 files changed, 154 insertions(+), 154 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index ccd73b2652..1844722af9 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -193,8 +193,8 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d // Loop over FTLiteCluster for ( const auto& cluster : clusters.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const auto mod = deFT.findModule( chanID ); - + const auto mod = deFT.findModule( chanID ); + size_t q_ID = chanID.moniModuleID(); uint SiPM_ID = chanID.moniSiPMID(); int pseudoChannel = mod->pseudoChannel( chanID ); diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index 74d3cf1f44..13e8550937 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -81,10 +81,10 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deF plot( (float)chanID.sipmInModule(), "DigitsPerSiPM", "Digits per SiPM; SiPMID; Digits", -0.5, 15.5, 16 ); plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); - const auto module = deFT.findModule( chanID ); - int pseudoChannel = module->pseudoChannel( chanID ); + const auto module = deFT.findModule( chanID ); + int pseudoChannel = module->pseudoChannel( chanID ); plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., - 12288., 192 ); + 12288., 192 ); } //============================================================================= diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index d265f8fefc..0491af8929 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -225,7 +225,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F // Loop over NZS FTLiteCluster for ( const auto& cluster : clustersNZS.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const auto mod = deFT.findModule( chanID ); + const auto mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); @@ -273,7 +273,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F clustersInSiPM = 0; for ( const auto& cluster : clustersNZSdigits.range() ) { LHCb::FTChannelID chanID = cluster.channelID(); - const auto mod = deFT.findModule( chanID ); + const auto mod = deFT.findModule( chanID ); size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index f9e3b92834..5f2554aa6a 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -846,8 +846,8 @@ namespace LHCb::Pr { // Zones cache, retrieved from the detector store // Zones cache - this->template addConditionDerivation( - {DeFTDetectorLocation::Default}, this->template inputLocation() ); + this->template addConditionDerivation( {DeFTDetectorLocation::Default}, + this->template inputLocation() ); return sc; } diff --git a/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp b/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp index ccf2753d6c..ce5a17e495 100644 --- a/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp +++ b/Pr/PrAlgorithms/src/PrLongLivedTracking.cpp @@ -27,7 +27,7 @@ #include "GaudiAlg/FixTESPath.h" #include "GaudiAlg/Transformer.h" -#include "DetDesc/ConditionAccessorHolder.h"//FIXME +#include "DetDesc/ConditionAccessorHolder.h" //FIXME // from Gaudi #include "GaudiKernel/Point3DTypes.h" diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 09426de06b..71f096b88e 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -74,7 +74,7 @@ PrFTHitHandler PrStoreFTHit::operator()( const FTLiteClusters& clusters, PrFTHitHandler hitHandler( clusters.size() ); if ( msgLevel( MSG::DEBUG ) ) debug() << "Retrieved " << clusters.size() << " clusters" << endmsg; - for ( uint16_t iQuarter = 0; iQuarter < 4; ++iQuarter ) {//FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP + for ( uint16_t iQuarter = 0; iQuarter < 4; ++iQuarter ) { // FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP uint info = ( iQuarter >> 1 ) | ( ( ( iQuarter << 4 ) ^ ( iQuarter << 5 ) ^ 128u ) & 128u ); auto r = ranges::views::transform( clusters.range( iQuarter ), [&]( LHCb::FTLiteCluster clus ) -> PrHit { diff --git a/Pr/PrAlgorithms/src/PrStoreUTHit.cpp b/Pr/PrAlgorithms/src/PrStoreUTHit.cpp index b7174ac223..ff5010bcec 100644 --- a/Pr/PrAlgorithms/src/PrStoreUTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreUTHit.cpp @@ -9,7 +9,7 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include "DetDesc/ConditionAccessorHolder.h"//FIXME +#include "DetDesc/ConditionAccessorHolder.h" //FIXME #include "Event/RawBank.h" #include "GaudiAlg/Transformer.h" #include "Kernel/IUTReadoutTool.h" diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index d1bd4c1bdc..12428869ba 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -20,15 +20,15 @@ #endif namespace FTMatsCache { - + struct MatsCache { /** * partial SoA cache for mats, reserve enough (here 4096 which is more than enough) * space for all mats ( all mats should be less than 2 * 8 mats * 12 modules * 12 layers) */ - std::array dxdy{}; - std::array dzdy{}; - std::array globaldy{}; + std::array dxdy{}; + std::array dzdy{}; + std::array globaldy{}; std::array mirrorPoint{}; std::array ddx{}; @@ -38,36 +38,37 @@ namespace FTMatsCache { float sipmPitch{}; MatsCache( const DeFT& ftDet ) { - const auto first_mat = ftDet.firstMat();//FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 )->modules().at( 0 )->mats().at( 0 ); - // This parameters are constant accross all mats: - #ifdef USE_DD4HEP + const auto first_mat = ftDet.firstMat(); // FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 + // )->modules().at( 0 )->mats().at( 0 ); +// This parameters are constant accross all mats: +#ifdef USE_DD4HEP this->dieGap = first_mat.dieGap(); this->sipmPitch = first_mat.sipmPitch(); this->uBegin = first_mat.uBegin(); this->halfChannelPitch = first_mat.halfChannelPitch(); - #else +#else this->dieGap = first_mat->dieGap(); this->sipmPitch = first_mat->sipmPitch(); this->uBegin = first_mat->uBegin(); this->halfChannelPitch = first_mat->halfChannelPitch(); - #endif - auto assertFunc = [this] (const DeFTMat& mat){ - assert( this->dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); - assert( this->sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); - assert( this->uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); - assert( this->halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); - }; - ftDet.applyToAllMats(assertFunc); - auto func = [this] (const DeFTMat& mat){ - const auto index = mat.elementID().uniqueMat(); - //FIXME +#endif + auto assertFunc = [this]( const DeFTMat& mat ) { + assert( this->dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); + assert( this->sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); + assert( this->uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); + assert( this->halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); + }; + ftDet.applyToAllMats( assertFunc ); + auto func = [this]( const DeFTMat& mat ) { + const auto index = mat.elementID().uniqueMat(); + // FIXME this->mirrorPoint[index] = mat.mirrorPoint(); this->ddx[index] = mat.ddx(); this->dxdy[index] = mat.dxdy(); this->dzdy[index] = mat.dzdy(); - this->globaldy[index] = mat.globaldy(); - }; - ftDet.applyToAllMats(func); + this->globaldy[index] = mat.globaldy(); + }; + ftDet.applyToAllMats( func ); }; }; } // namespace FTMatsCache diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index c6a0c9e9af..618ab603ae 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -34,20 +34,20 @@ namespace FTZoneCache { public: PrFTZoneHandler( DeFT const& ftDet ) { - auto func = [this] (const DeFTLayer& layer) { + auto func = [this]( const DeFTLayer& layer ) { // int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); int id = layer.layerID(); - //fixme - DetectorSegment seg( 0, layer.globalZ(), layer.dxdy(), layer.dzdy(), 0., 0. ); - float xmax = 0.5f * layer.sizeX(); - float ymax = 0.5f * layer.sizeY(); - // The setGeometry defines the z at y=0, the dxDy and the dzDy, as well as the isX properties of the zone. - // This is important, since these are used in the following. - // They are set once for each zone in this method. - this->MakeZone( 2 * id + 1, seg, -xmax, xmax, -25.f, ymax ); // Small overlap (25 mm) for stereo layers - this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers + // fixme + DetectorSegment seg( 0, layer.globalZ(), layer.dxdy(), layer.dzdy(), 0., 0. ); + float xmax = 0.5f * layer.sizeX(); + float ymax = 0.5f * layer.sizeY(); + // The setGeometry defines the z at y=0, the dxDy and the dzDy, as well as the isX properties of the zone. + // This is important, since these are used in the following. + // They are set once for each zone in this method. + this->MakeZone( 2 * id + 1, seg, -xmax, xmax, -25.f, ymax ); // Small overlap (25 mm) for stereo layers + this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers }; - ftDet.applyToAllLayers(func); + ftDet.applyToAllLayers( func ); } /// Standard constructor PrFTZoneHandler() = default; diff --git a/Pr/PrMCTools/src/PrClustersResidual.cpp b/Pr/PrMCTools/src/PrClustersResidual.cpp index b04be913e8..991005bf02 100644 --- a/Pr/PrMCTools/src/PrClustersResidual.cpp +++ b/Pr/PrMCTools/src/PrClustersResidual.cpp @@ -268,9 +268,9 @@ void PrClustersResidual::Occupancy( const PrFTHitHandler& FTHitHandler ) It requires to have the m_ftDet as private member of the algorithm and also modify the CMakeLists to compile PrMCTools linking the Det/FTDet package. */ - auto quarter = liteCluster.channelID().quarter(); - const auto chanID = liteCluster.channelID(); - const auto module = m_ftDet->findModule( chanID ); + auto quarter = liteCluster.channelID().quarter(); + const auto chanID = liteCluster.channelID(); + const auto module = m_ftDet->findModule( chanID ); if ( !module ) { error() << "Cannot find Module associated to FTChannelID : " << chanID << endmsg; error() << "Abort Occupancy plot checking" << endmsg; diff --git a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp index 36cbb36864..5f1ab968ca 100644 --- a/Pr/PrMCTools/src/PrFTHitsMonitor.cpp +++ b/Pr/PrMCTools/src/PrFTHitsMonitor.cpp @@ -137,10 +137,10 @@ void PrFTHitsMonitor::operator()( const FTHits& FThits, const FTLiteClusters& cl auto result = mcHitForId.find( hit.id().ftID() ); if ( result == mcHitForId.end() ) continue; for ( auto& mcHit : ( *result ).second ) { - auto mcHit_local = mat->toLocal( mcHit->midPoint() );//FIXME + auto mcHit_local = mat->toLocal( mcHit->midPoint() ); // FIXME const Gaudi::XYZPoint FThit = Gaudi::XYZPoint( hit.x( mcHit->midPoint().Y() ), 0, hit.z( mcHit->midPoint().Y() ) ); - auto FThit_local = mat->toLocal( FThit );//FIXME + auto FThit_local = mat->toLocal( FThit ); // FIXME Gaudi::XYZVector residual; std::string name_addition = ""; if ( m_isGlobal ) { diff --git a/Pr/PrVeloUT/src/PrVeloUT.cpp b/Pr/PrVeloUT/src/PrVeloUT.cpp index a87bdbc873..553f681a8f 100644 --- a/Pr/PrVeloUT/src/PrVeloUT.cpp +++ b/Pr/PrVeloUT/src/PrVeloUT.cpp @@ -9,8 +9,8 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ // Include files -#include "DetDesc/Condition.h"//FIXME -#include "DetDesc/ConditionAccessorHolder.h"//FIXME +#include "DetDesc/Condition.h" //FIXME +#include "DetDesc/ConditionAccessorHolder.h" //FIXME #include "Event/PrUpstreamTracks.h" #include "Event/PrVeloTracks.h" #include "GaudiAlg/ISequencerTimerTool.h" diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index aecfa5b507..4fb526f3e6 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -48,41 +48,41 @@ namespace { float m_halfChannelPitch; MatsCache( const DeFT& ftDet ) { - auto const first_mat = ftDet.firstMat();//FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; - - // This parameters are constant accross all mats: - #ifdef USE_DD4HEP + auto const first_mat = + ftDet.firstMat(); // FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; + +// This parameters are constant accross all mats: +#ifdef USE_DD4HEP m_dieGap = first_mat.dieGap(); m_sipmPitch = first_mat.sipmPitch(); m_uBegin = first_mat.uBegin(); m_halfChannelPitch = first_mat.halfChannelPitch(); - #else +#else m_dieGap = first_mat->dieGap(); m_sipmPitch = first_mat->sipmPitch(); m_uBegin = first_mat->uBegin(); m_halfChannelPitch = first_mat->halfChannelPitch(); - #endif - //First assert things - auto assertFunc = [this] (const DeFTMat& mat){ - assert( this->m_dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); - assert( this->m_sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); - assert( this->m_uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); - assert( this->m_halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); - }; - ftDet.applyToAllMats(assertFunc); - //FIXME - auto func = [this] (const DeFTMat& mat){ - auto index = mat.elementID().uniqueMat(); - - auto dxdy = mat.dxdy(); - auto mirrorPoint = mat.mirrorPoint(); - auto ddx = mat.ddx(); - - this->m_mats_x0[index] = mirrorPoint.x() - mirrorPoint.y() * dxdy; - this->m_mats_dx[index] = ddx.x() - ddx.y() * dxdy; - - }; - ftDet.applyToAllMats(func); +#endif + // First assert things + auto assertFunc = [this]( const DeFTMat& mat ) { + assert( this->m_dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); + assert( this->m_sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); + assert( this->m_uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); + assert( this->m_halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); + }; + ftDet.applyToAllMats( assertFunc ); + // FIXME + auto func = [this]( const DeFTMat& mat ) { + auto index = mat.elementID().uniqueMat(); + + auto dxdy = mat.dxdy(); + auto mirrorPoint = mat.mirrorPoint(); + auto ddx = mat.ddx(); + + this->m_mats_x0[index] = mirrorPoint.x() - mirrorPoint.y() * dxdy; + this->m_mats_dx[index] = ddx.x() - ddx.y() * dxdy; + }; + ftDet.applyToAllMats( func ); } }; } // namespace @@ -100,8 +100,7 @@ public: StatusCode initialize() override { return Transformer::initialize().andThen( [&] { - addConditionDerivation( {DeFTDetectorLocation::Default}, - inputLocation() ); + addConditionDerivation( {DeFTDetectorLocation::Default}, inputLocation() ); // TODO: this should be ~80 micron; get this from a tool? // std::array clusRes = {0.05f, 0.08f, 0.11f, 0.14f, 0.17f, 0.20f, 0.23f, 0.26f, 0.29f}; diff --git a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp index fac870596c..75c0a10ee9 100644 --- a/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp +++ b/Tr/ParameterizedKalman/src/ParameterizedKalmanFit.cpp @@ -9,12 +9,12 @@ * or submit itself to any jurisdiction. * \*****************************************************************************/ // Include files +#include "DetDesc/DetectorElement.h" #include "Event/ODIN.h" #include "Event/State.h" #include "FTDet/DeFTDetector.h" #include "Kernel/Trajectory.h" #include "LHCbMath/Similarity.h" -#include "DetDesc/DetectorElement.h" // local #include "ParameterizedKalmanFit.h" diff --git a/Tr/TrackFitEvent/include/Event/Measurement.h b/Tr/TrackFitEvent/include/Event/Measurement.h index ffdf931e87..b49c7141e5 100644 --- a/Tr/TrackFitEvent/include/Event/Measurement.h +++ b/Tr/TrackFitEvent/include/Event/Measurement.h @@ -77,10 +77,10 @@ namespace LHCb { struct FT { #ifdef USE_DD4HEP DeFTMat detElem{}; - auto& mat() const {return detElem;} + auto& mat() const { return detElem; } #else - const DeFTMat* detElem = nullptr; - auto& mat() const {return *detElem;} + const DeFTMat* detElem = nullptr; + auto& mat() const { return *detElem; } #endif }; struct Muon { @@ -151,7 +151,8 @@ namespace LHCb { #else Measurement( LHCbID id, double z, LHCb::LineTraj traj, double errMeas, const DeFTMat* elem ) #endif - : Measurement{id, z, errMeas, std::move( traj ), FT{elem}} {} + : Measurement{id, z, errMeas, std::move( traj ), FT{elem}} { + } /// Muon constructor Measurement( LHCbID id, double z, LHCb::LineTraj traj, double errMeas, const DeMuonChamber* elem ) diff --git a/Tr/TrackFitEvent/src/Measurement.cpp b/Tr/TrackFitEvent/src/Measurement.cpp index 7da305cb33..1cdd75ae59 100644 --- a/Tr/TrackFitEvent/src/Measurement.cpp +++ b/Tr/TrackFitEvent/src/Measurement.cpp @@ -17,7 +17,7 @@ Gaudi::XYZPoint LHCb::Measurement::toLocal( const Gaudi::XYZPoint& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toLocal( globalPoint ); }, - [&globalPoint]( const FT& ft ) { return ft.mat().toLocal( globalPoint ); }, + [&globalPoint]( const FT& ft ) { return ft.mat().toLocal( globalPoint ); }, [&globalPoint]( const VP& vp ) { return vp.sensor().toLocal( globalPoint ); } ); } @@ -30,8 +30,8 @@ Gaudi::XYZVector LHCb::Measurement::toLocal( const Gaudi::XYZVector& globalPoint Gaudi::XYZPoint LHCb::Measurement::toGlobal( const Gaudi::XYZPoint& globalPoint ) const { return visit( [&globalPoint]( const auto& m ) { return m.detElem->toGlobal( globalPoint ); }, - [&globalPoint]( const FT& ft ) { return ft.mat().toGlobal( globalPoint ); }, - [&globalPoint]( const VP& vp ) { return vp.sensor().toGlobal( globalPoint ); } ); + [&globalPoint]( const FT& ft ) { return ft.mat().toGlobal( globalPoint ); }, + [&globalPoint]( const VP& vp ) { return vp.sensor().toGlobal( globalPoint ); } ); } Gaudi::XYZVector LHCb::Measurement::toGlobal( const Gaudi::XYZVector& globalPoint ) const { @@ -43,7 +43,7 @@ Gaudi::XYZVector LHCb::Measurement::toGlobal( const Gaudi::XYZVector& globalPoin std::string LHCb::Measurement::name() const { return visit( []( const auto& m ) { return m.detElem->name(); }, - []( const FT& ft ) -> std::string { return ft.mat().name(); }, + []( const FT& ft ) -> std::string { return ft.mat().name(); }, []( const VP& vp ) -> std::string { return vp.sensor().name(); } ); } diff --git a/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp b/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp index 41817954bc..1eace5dbc9 100644 --- a/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp +++ b/Tr/TrackFitEvent/tests/src/test_measurement_minimize.cpp @@ -28,12 +28,12 @@ namespace { LHCb::LineTraj const meas_trajectory( {-0x1.3a22b4p+11, -0x1.814f77ffffff5p+3, 0x1.23a876p+13}, {-0x1.1fba36p+11, -0x1.2f59a2p+11, 0x1.2362e4p+13} ); - // need this for the constructor but it doesn't need to actually point to something - #ifdef USE_DD4HEP +// need this for the constructor but it doesn't need to actually point to something +#ifdef USE_DD4HEP DeVPSensor det{}; - #else +#else DeVPSensor* det = nullptr; - #endif +#endif // input: ID, z, trajectory, err, SubInfo LHCb::Measurement meas{LHCb::LHCbID(), 0x1.23a898p+13, meas_trajectory, 0, det}; diff --git a/Tr/TrackTools/src/FTHitExpectation.cpp b/Tr/TrackTools/src/FTHitExpectation.cpp index fe553593a8..3a6c6f9e93 100644 --- a/Tr/TrackTools/src/FTHitExpectation.cpp +++ b/Tr/TrackTools/src/FTHitExpectation.cpp @@ -105,22 +105,22 @@ IHitExpectation::Info FTHitExpectation::expectation( const LHCb::Track& aTrack, []( const LHCb::LHCbID& id ) { return id.isFT(); } ); // Loop over all layers - auto func = [this,&aTrack, &geometry,&info,&ftHits] (const DeFTLayer& layer) { - const DeFTMat* mat; - Gaudi::XYZPoint intersectionPoint; - bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); - - if ( expectHit ) { - ++( info.nExpected ); - - // Check of this layer is present in the hits - auto itIter = std::find_if( ftHits.begin(), ftHits.end(), [&mat]( const LHCb::LHCbID& id ) { - return id.ftID().uniqueLayer() == mat->elementID().uniqueLayer(); - } ); - if ( itIter != ftHits.end() ) ++info.nFound; - } + auto func = [this, &aTrack, &geometry, &info, &ftHits]( const DeFTLayer& layer ) { + const DeFTMat* mat; + Gaudi::XYZPoint intersectionPoint; + bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); + + if ( expectHit ) { + ++( info.nExpected ); + + // Check of this layer is present in the hits + auto itIter = std::find_if( ftHits.begin(), ftHits.end(), [&mat]( const LHCb::LHCbID& id ) { + return id.ftID().uniqueLayer() == mat->elementID().uniqueLayer(); + } ); + if ( itIter != ftHits.end() ) ++info.nFound; + } }; - m_ftDet->applyToAllLayers(func); + m_ftDet->applyToAllLayers( func ); return info; } @@ -137,50 +137,49 @@ bool FTHitExpectation::findIntersectingMat( const DeFTLayer& layer, const LHCb:: // find intersection point of track and plane of layer const auto layerPlane = layer.plane(); - intersectionPoint = intersection( aLine3D, layerPlane ); + intersectionPoint = intersection( aLine3D, layerPlane ); // find the module that is hit const auto module = layer.findModule( intersectionPoint ); if ( !module ) return false; - + // find intersection point of track and plane of module // (to account for misalignments between module and layer) - tanLine = aParab.tangent( intersectionPoint.z() ); - aLine3D = Tf::Tsa::createLine3D( tanLine, line, intersectionPoint.z() ); - const auto modulePlane = module->plane(); - intersectionPoint = intersection( aLine3D, modulePlane ); + tanLine = aParab.tangent( intersectionPoint.z() ); + aLine3D = Tf::Tsa::createLine3D( tanLine, line, intersectionPoint.z() ); + const auto modulePlane = module->plane(); + intersectionPoint = intersection( aLine3D, modulePlane ); // Find the corresponding mat const auto foundMat = module->findMat( intersectionPoint ); // check if intersection point is inside the fibres of the module - if (!foundMat) return false; + if ( !foundMat ) return false; // mat = static_cast(foundMat);//FIXME - mat = &(*foundMat);//FIXME + mat = &( *foundMat ); // FIXME return foundMat->isInside( intersectionPoint ); } void FTHitExpectation::collect( const LHCb::Track& aTrack, std::vector& ids, IGeometryInfo const& geometry ) const { // Loop over all layers - //FIXME - auto func = [this,&aTrack, &geometry, &ids] (const DeFTLayer& layer) { + // FIXME + auto func = [this, &aTrack, &geometry, &ids]( const DeFTLayer& layer ) { const DeFTMat* mat; Gaudi::XYZPoint intersectionPoint; bool expectHit = findIntersectingMat( layer, aTrack, mat, intersectionPoint, geometry ); - + if ( expectHit ) { // Find the channel that is closest Gaudi::XYZPoint localP = mat->toLocal( intersectionPoint ); float frac; LHCb::FTChannelID ftChan = mat->calculateChannelAndFrac( localP.x(), frac ); - + // Add the channels // JvT: Without the fraction the bare FTChannelID is pretty useless... if ( std::abs( frac ) <= 0.5f ) ids.push_back( LHCb::LHCbID( ftChan ) ); - } + } }; - m_ftDet->applyToAllLayers(func); - + m_ftDet->applyToAllLayers( func ); } unsigned int FTHitExpectation::nExpected( const LHCb::Track& aTrack, IGeometryInfo const& geometry ) const { diff --git a/Tr/TrackTools/src/FTMeasurementProvider.cpp b/Tr/TrackTools/src/FTMeasurementProvider.cpp index f1ee758763..6fc0195097 100644 --- a/Tr/TrackTools/src/FTMeasurementProvider.cpp +++ b/Tr/TrackTools/src/FTMeasurementProvider.cpp @@ -38,7 +38,7 @@ public: } private: - DeFT* m_det = nullptr; + DeFT* m_det = nullptr; DataObjectReadHandle m_clustersDh{this, "ClusterLocation", LHCb::FTLiteClusterLocation::Default}; }; @@ -58,7 +58,7 @@ StatusCode FTMeasurementProvider::initialize() { if ( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); } // Retrieve the detector element - m_det = getDet( DeFTDetectorLocation::Default );//FIXME ADDCONDITION + m_det = getDet( DeFTDetectorLocation::Default ); // FIXME ADDCONDITION setProperty( "Tolerance", 0.002 * Gaudi::Units::mm ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ ); return sc; @@ -73,32 +73,32 @@ void FTMeasurementProvider::addToMeasurements( LHCb::span i const LHCb::ZTrajectory& ) const { measurements.reserve( measurements.size() + ids.size() ); assert( std::all_of( ids.begin(), ids.end(), []( LHCb::LHCbID id ) { return id.isFT(); } ) ); - std::transform( ids.begin(), ids.end(), std::back_inserter( measurements ), - [&, clusters = m_clustersDh.get()]( const LHCb::LHCbID& id ) { - /// The clusters are not sorted anymore, so we can use a find_if - /// to find the element corresponding to the channel ID - const auto ftMat = m_det->findMat( id.ftID() ); - const auto& c = clusters->range( id.ftID().uniqueQuarter() - 16u ); - - auto itH = id.isFT() ? std::find_if( c.begin(), c.end(), - [&id]( const LHCb::FTLiteCluster clus ) { - return clus.channelID() == id.ftID(); - } ) - : c.end(); - if ( itH == c.end() ) { - throw GaudiException( "Can not find FTLiteCluster for given lhcbID", __func__, - StatusCode::FAILURE ); - } - #ifdef USE_DD4HEP - return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), - ftMat->trajectory( itH->channelID(), itH->fraction() ), - 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization - *ftMat}; - #else - return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), - ftMat->trajectory( itH->channelID(), itH->fraction() ), - 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization - ftMat}; - #endif - } ); + std::transform( + ids.begin(), ids.end(), std::back_inserter( measurements ), + [&, clusters = m_clustersDh.get()]( const LHCb::LHCbID& id ) { + /// The clusters are not sorted anymore, so we can use a find_if + /// to find the element corresponding to the channel ID + const auto ftMat = m_det->findMat( id.ftID() ); + const auto& c = clusters->range( id.ftID().uniqueQuarter() - 16u ); + + auto itH = + id.isFT() + ? std::find_if( c.begin(), c.end(), + [&id]( const LHCb::FTLiteCluster clus ) { return clus.channelID() == id.ftID(); } ) + : c.end(); + if ( itH == c.end() ) { + throw GaudiException( "Can not find FTLiteCluster for given lhcbID", __func__, StatusCode::FAILURE ); + } +#ifdef USE_DD4HEP + return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), + ftMat->trajectory( itH->channelID(), itH->fraction() ), + 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization + *ftMat}; +#else + return LHCb::Measurement{itH->channelID(), ftMat->globalZ(), + ftMat->trajectory( itH->channelID(), itH->fraction() ), + 0.04 + 0.01 * itH->pseudoSize(), // FIXME need a better error parametrization + ftMat}; +#endif + } ); } -- GitLab From 3455ddd18da9f21421cdf74a2fe4594351561595 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 27 Oct 2021 10:08:06 +0200 Subject: [PATCH 24/38] Adding back tests --- FT/FTMonitors/src/FTClusterMonitor.cpp | 7 ++++--- FT/FTMonitors/src/FTDigitMonitor.cpp | 9 ++++++--- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 12 ++++++------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index 1844722af9..cbd30dd6da 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -197,14 +197,14 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d size_t q_ID = chanID.moniModuleID(); uint SiPM_ID = chanID.moniSiPMID(); - int pseudoChannel = mod->pseudoChannel( chanID ); // Draw cluster channel properties m_lcps->fill( to_unsigned( chanID.station() ) ); m_lcpm->fill( to_unsigned( chanID.module() ) ); m_lcpsipm->fill( chanID.sipmInModule() ); m_lcpc->fill( chanID.channel() ); - m_lcppc->fill( pseudoChannel ); + if (mod) + m_lcppc->fill( mod->pseudoChannel( chanID ) ); m_lcf->fill( cluster.fraction() ); m_lcs->fill( cluster.pseudoSize() ); m_lcsf->fill( cluster.pseudoSize(), cluster.fraction() ); @@ -216,7 +216,8 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d m_fracpq[q_ID]->fill( cluster.fraction() ); m_pseusizepq[q_ID]->fill( cluster.pseudoSize() ); m_sipmpq[q_ID]->fill( SiPM_ID ); - m_lcipchpq[q_ID]->fill( pseudoChannel ); + if (mod) + m_lcipchpq[q_ID]->fill( mod->pseudoChannel( chanID ) ); } if ( m_drawHistsPerStation ) { m_lcpst[to_unsigned( mod->stationID() ) - 1]->fill( chanID.moniModuleIDstation() ); } if ( m_drawHistsPerModule ) { m_lcichpm[to_unsigned( mod->moduleID() )]->fill( chanID.moniChannelID() ); } diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index 13e8550937..b5374c1fac 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -82,9 +82,12 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deF plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); const auto module = deFT.findModule( chanID ); - int pseudoChannel = module->pseudoChannel( chanID ); - plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., - 12288., 192 ); + if (module) + { + int pseudoChannel = module->pseudoChannel( chanID ); + plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., + 12288., 192 ); + } } //============================================================================= diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index 0491af8929..c4e3c78880 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -229,14 +229,14 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); - int pseudoChannel = mod->pseudoChannel( chanID ); // Fill cluster channel properties m_lcps_NZS->fillNZS( chanID.station() ); m_lcpm_NZS->fillNZS( chanID.module() ); m_lcpsipm_NZS->fillNZS( chanID.sipmInModule() ); m_lcpc_NZS->fillNZS( chanID.channel() ); - m_lcppc_NZS->fillNZS( pseudoChannel ); + if (mod) + m_lcppc_NZS->fillNZS( mod->pseudoChannel( chanID ) ); m_lcf_NZS->fillNZS( cluster.fraction() ); m_lcs_NZS->fillNZS( cluster.pseudoSize() ); @@ -248,7 +248,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F m_fracpq_NZS.at( q_ID ).fillNZS( cluster.fraction() ); m_pseusizepq_NZS.at( q_ID ).fillNZS( cluster.pseudoSize() ); m_sipmpq_NZS.at( q_ID ).fillNZS( SiPM_ID ); - m_lcipchpq_NZS.at( q_ID ).fillNZS( pseudoChannel ); + m_lcipchpq_NZS.at( q_ID ).fillNZS( mod->pseudoChannel( chanID ) ); } if ( m_drawHistsPerStation ) { m_lcpst_NZS.at( to_unsigned( mod->stationID() ) - 1 ).fillNZS( chanID.moniModuleIDstation() ); @@ -277,14 +277,14 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F size_t q_ID = chanID.moniQuarterID(); uint SiPM_ID = chanID.moniSiPMID(); - int pseudoChannel = mod->pseudoChannel( chanID ); // Draw cluster channel properties m_lcps_NZS->fillDigit( chanID.station() ); m_lcpm_NZS->fillDigit( chanID.module() ); m_lcpsipm_NZS->fillDigit( chanID.sipmInModule() ); m_lcpc_NZS->fillDigit( chanID.channel() ); - m_lcppc_NZS->fillDigit( pseudoChannel ); + if (mod) + m_lcppc_NZS->fillDigit( mod->pseudoChannel( chanID ) ); m_lcf_NZS->fillDigit( cluster.fraction() ); m_lcs_NZS->fillDigit( cluster.pseudoSize() ); @@ -298,7 +298,7 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F m_fracpq_NZS.at( q_ID ).fillDigit( cluster.fraction() ); m_pseusizepq_NZS.at( q_ID ).fillDigit( cluster.pseudoSize() ); m_sipmpq_NZS.at( q_ID ).fillDigit( SiPM_ID ); - m_lcipchpq_NZS.at( q_ID ).fillDigit( pseudoChannel ); + m_lcipchpq_NZS.at( q_ID ).fillDigit( mod->pseudoChannel( chanID ) ); } if ( m_drawHistsPerStation ) { m_lcpst_NZS.at( to_unsigned( mod->stationID() ) - 1 ).fillDigit( chanID.moniModuleIDstation() ); -- GitLab From 0f05fa83cee4e4288b9e442935331e47c6c1f3f0 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 27 Oct 2021 10:24:42 +0200 Subject: [PATCH 25/38] Solved warnings --- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 5 +---- .../src/SciFiTrackForwardingStoreHit.cpp | 8 ++------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index 12428869ba..c1302ef3f7 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -52,14 +52,11 @@ namespace FTMatsCache { this->uBegin = first_mat->uBegin(); this->halfChannelPitch = first_mat->halfChannelPitch(); #endif - auto assertFunc = [this]( const DeFTMat& mat ) { + auto func = [this]( const DeFTMat& mat ) { assert( this->dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); assert( this->sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); assert( this->uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); assert( this->halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); - }; - ftDet.applyToAllMats( assertFunc ); - auto func = [this]( const DeFTMat& mat ) { const auto index = mat.elementID().uniqueMat(); // FIXME this->mirrorPoint[index] = mat.mirrorPoint(); diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index 4fb526f3e6..a1f645c535 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -63,16 +63,12 @@ namespace { m_uBegin = first_mat->uBegin(); m_halfChannelPitch = first_mat->halfChannelPitch(); #endif - // First assert things - auto assertFunc = [this]( const DeFTMat& mat ) { + // FIXME + auto func = [this]( const DeFTMat& mat ) { assert( this->m_dieGap == mat.dieGap() && "Unexpected difference in dieGap" ); assert( this->m_sipmPitch == mat.sipmPitch() && "Unexpected difference in sipmPitch" ); assert( this->m_uBegin == mat.uBegin() && "Unexpected difference in uBegin" ); assert( this->m_halfChannelPitch == mat.halfChannelPitch() && "Unexpected difference in halfChannelPitch" ); - }; - ftDet.applyToAllMats( assertFunc ); - // FIXME - auto func = [this]( const DeFTMat& mat ) { auto index = mat.elementID().uniqueMat(); auto dxdy = mat.dxdy(); -- GitLab From f53968852178f1c2f8a811c0861f788257c498c3 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 27 Oct 2021 11:42:44 +0200 Subject: [PATCH 26/38] Fixed DetDesc --- .../include/PrKernel/PrFTZoneHandler.h | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index 618ab603ae..7d37d3889a 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -34,9 +34,10 @@ namespace FTZoneCache { public: PrFTZoneHandler( DeFT const& ftDet ) { + #ifdef USE_DD4HEP auto func = [this]( const DeFTLayer& layer ) { - // int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); - int id = layer.layerID(); + int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); + // int id = layer.layerID(); // fixme DetectorSegment seg( 0, layer.globalZ(), layer.dxdy(), layer.dzdy(), 0., 0. ); float xmax = 0.5f * layer.sizeX(); @@ -48,6 +49,23 @@ namespace FTZoneCache { this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers }; ftDet.applyToAllLayers( func ); + #else + for ( auto station : ftDet.stations() ) { + for ( auto layer : station->layers() ) { + int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); + + DetectorSegment seg( 0, layer->globalZ(), layer->dxdy(), layer->dzdy(), 0., 0. ); + float xmax = 0.5f * layer->sizeX(); + float ymax = 0.5f * layer->sizeY(); + + // The setGeometry defines the z at y=0, the dxDy and the dzDy, as well as the isX properties of the zone. + // This is important, since these are used in the following. + // They are set once for each zone in this method. + this->MakeZone( 2 * id + 1, seg, -xmax, xmax, -25.f, ymax ); // Small overlap (25 mm) for stereo layers + this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers + } + } + #endif } /// Standard constructor PrFTZoneHandler() = default; -- GitLab From e61833240978da09c2b7beb377882102486e7f3d Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 27 Oct 2021 17:23:16 +0200 Subject: [PATCH 27/38] Corrected mistake --- Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index 7d37d3889a..98ce799dff 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -36,8 +36,7 @@ namespace FTZoneCache { PrFTZoneHandler( DeFT const& ftDet ) { #ifdef USE_DD4HEP auto func = [this]( const DeFTLayer& layer ) { - int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); - // int id = layer.layerID(); + int id = layer.layerID(); // fixme DetectorSegment seg( 0, layer.globalZ(), layer.dxdy(), layer.dzdy(), 0., 0. ); float xmax = 0.5f * layer.sizeX(); -- GitLab From 9f41432b30098545fc276e6615b3f5649e077c47 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 28 Oct 2021 13:15:10 +0200 Subject: [PATCH 28/38] Corrected nQuarters error --- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 71f096b88e..45e35e4fe7 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -74,7 +74,7 @@ PrFTHitHandler PrStoreFTHit::operator()( const FTLiteClusters& clusters, PrFTHitHandler hitHandler( clusters.size() ); if ( msgLevel( MSG::DEBUG ) ) debug() << "Retrieved " << clusters.size() << " clusters" << endmsg; - for ( uint16_t iQuarter = 0; iQuarter < 4; ++iQuarter ) { // FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP + for ( uint16_t iQuarter = 0; iQuarter < 3*4*4; ++iQuarter ) { // FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP uint info = ( iQuarter >> 1 ) | ( ( ( iQuarter << 4 ) ^ ( iQuarter << 5 ) ^ 128u ) & 128u ); auto r = ranges::views::transform( clusters.range( iQuarter ), [&]( LHCb::FTLiteCluster clus ) -> PrHit { -- GitLab From c26432d6f313f196aa64f773e9a3e4245368df62 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Thu, 28 Oct 2021 11:15:54 +0000 Subject: [PATCH 29/38] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/17210237 --- FT/FTMonitors/src/FTClusterMonitor.cpp | 10 ++++------ FT/FTMonitors/src/FTDigitMonitor.cpp | 13 ++++++------- FT/FTMonitors/src/FTNZSClusterMonitor.cpp | 14 ++++++-------- Pr/PrAlgorithms/src/PrStoreFTHit.cpp | 2 +- Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h | 8 ++++---- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/FT/FTMonitors/src/FTClusterMonitor.cpp b/FT/FTMonitors/src/FTClusterMonitor.cpp index cbd30dd6da..8336fb4551 100644 --- a/FT/FTMonitors/src/FTClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTClusterMonitor.cpp @@ -195,16 +195,15 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d LHCb::FTChannelID chanID = cluster.channelID(); const auto mod = deFT.findModule( chanID ); - size_t q_ID = chanID.moniModuleID(); - uint SiPM_ID = chanID.moniSiPMID(); + size_t q_ID = chanID.moniModuleID(); + uint SiPM_ID = chanID.moniSiPMID(); // Draw cluster channel properties m_lcps->fill( to_unsigned( chanID.station() ) ); m_lcpm->fill( to_unsigned( chanID.module() ) ); m_lcpsipm->fill( chanID.sipmInModule() ); m_lcpc->fill( chanID.channel() ); - if (mod) - m_lcppc->fill( mod->pseudoChannel( chanID ) ); + if ( mod ) m_lcppc->fill( mod->pseudoChannel( chanID ) ); m_lcf->fill( cluster.fraction() ); m_lcs->fill( cluster.pseudoSize() ); m_lcsf->fill( cluster.pseudoSize(), cluster.fraction() ); @@ -216,8 +215,7 @@ void FTClusterMonitor::operator()( const FTLiteClusters& clusters, const DeFT& d m_fracpq[q_ID]->fill( cluster.fraction() ); m_pseusizepq[q_ID]->fill( cluster.pseudoSize() ); m_sipmpq[q_ID]->fill( SiPM_ID ); - if (mod) - m_lcipchpq[q_ID]->fill( mod->pseudoChannel( chanID ) ); + if ( mod ) m_lcipchpq[q_ID]->fill( mod->pseudoChannel( chanID ) ); } if ( m_drawHistsPerStation ) { m_lcpst[to_unsigned( mod->stationID() ) - 1]->fill( chanID.moniModuleIDstation() ); } if ( m_drawHistsPerModule ) { m_lcichpm[to_unsigned( mod->moduleID() )]->fill( chanID.moniChannelID() ); } diff --git a/FT/FTMonitors/src/FTDigitMonitor.cpp b/FT/FTMonitors/src/FTDigitMonitor.cpp index b5374c1fac..8c60c47797 100644 --- a/FT/FTMonitors/src/FTDigitMonitor.cpp +++ b/FT/FTMonitors/src/FTDigitMonitor.cpp @@ -81,13 +81,12 @@ void FTDigitMonitor::fillHistograms( const LHCb::FTDigit& Digit, const DeFT& deF plot( (float)chanID.sipmInModule(), "DigitsPerSiPM", "Digits per SiPM; SiPMID; Digits", -0.5, 15.5, 16 ); plot( (float)chanID.channel(), "DigitsPerChannel", "Digits per channel; Channel; Digits", -0.5, 127.5, 128 ); - const auto module = deFT.findModule( chanID ); - if (module) - { - int pseudoChannel = module->pseudoChannel( chanID ); - plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., - 12288., 192 ); - } + const auto module = deFT.findModule( chanID ); + if ( module ) { + int pseudoChannel = module->pseudoChannel( chanID ); + plot( pseudoChannel, "DigitsPerPseudoChannel", "Digits per pseudochannel;Pseudochannel;Digits/(64 channels)", 0., + 12288., 192 ); + } } //============================================================================= diff --git a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp index c4e3c78880..fed6171d81 100644 --- a/FT/FTMonitors/src/FTNZSClusterMonitor.cpp +++ b/FT/FTMonitors/src/FTNZSClusterMonitor.cpp @@ -227,16 +227,15 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F LHCb::FTChannelID chanID = cluster.channelID(); const auto mod = deFT.findModule( chanID ); - size_t q_ID = chanID.moniQuarterID(); - uint SiPM_ID = chanID.moniSiPMID(); + size_t q_ID = chanID.moniQuarterID(); + uint SiPM_ID = chanID.moniSiPMID(); // Fill cluster channel properties m_lcps_NZS->fillNZS( chanID.station() ); m_lcpm_NZS->fillNZS( chanID.module() ); m_lcpsipm_NZS->fillNZS( chanID.sipmInModule() ); m_lcpc_NZS->fillNZS( chanID.channel() ); - if (mod) - m_lcppc_NZS->fillNZS( mod->pseudoChannel( chanID ) ); + if ( mod ) m_lcppc_NZS->fillNZS( mod->pseudoChannel( chanID ) ); m_lcf_NZS->fillNZS( cluster.fraction() ); m_lcs_NZS->fillNZS( cluster.pseudoSize() ); @@ -275,16 +274,15 @@ void FTNZSClusterMonitor::operator()( const FTLiteClusters& clustersNZS, const F LHCb::FTChannelID chanID = cluster.channelID(); const auto mod = deFT.findModule( chanID ); - size_t q_ID = chanID.moniQuarterID(); - uint SiPM_ID = chanID.moniSiPMID(); + size_t q_ID = chanID.moniQuarterID(); + uint SiPM_ID = chanID.moniSiPMID(); // Draw cluster channel properties m_lcps_NZS->fillDigit( chanID.station() ); m_lcpm_NZS->fillDigit( chanID.module() ); m_lcpsipm_NZS->fillDigit( chanID.sipmInModule() ); m_lcpc_NZS->fillDigit( chanID.channel() ); - if (mod) - m_lcppc_NZS->fillDigit( mod->pseudoChannel( chanID ) ); + if ( mod ) m_lcppc_NZS->fillDigit( mod->pseudoChannel( chanID ) ); m_lcf_NZS->fillDigit( cluster.fraction() ); m_lcs_NZS->fillDigit( cluster.pseudoSize() ); diff --git a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp index 45e35e4fe7..caef5b6974 100644 --- a/Pr/PrAlgorithms/src/PrStoreFTHit.cpp +++ b/Pr/PrAlgorithms/src/PrStoreFTHit.cpp @@ -74,7 +74,7 @@ PrFTHitHandler PrStoreFTHit::operator()( const FTLiteClusters& clusters, PrFTHitHandler hitHandler( clusters.size() ); if ( msgLevel( MSG::DEBUG ) ) debug() << "Retrieved " << clusters.size() << " clusters" << endmsg; - for ( uint16_t iQuarter = 0; iQuarter < 3*4*4; ++iQuarter ) { // FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP + for ( uint16_t iQuarter = 0; iQuarter < 3 * 4 * 4; ++iQuarter ) { // FIXME: is LHCb::Detector::FT::nQuarters in DD4HEP uint info = ( iQuarter >> 1 ) | ( ( ( iQuarter << 4 ) ^ ( iQuarter << 5 ) ^ 128u ) & 128u ); auto r = ranges::views::transform( clusters.range( iQuarter ), [&]( LHCb::FTLiteCluster clus ) -> PrHit { diff --git a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h index 98ce799dff..2744773c58 100644 --- a/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h +++ b/Pr/PrKernel/include/PrKernel/PrFTZoneHandler.h @@ -34,9 +34,9 @@ namespace FTZoneCache { public: PrFTZoneHandler( DeFT const& ftDet ) { - #ifdef USE_DD4HEP +#ifdef USE_DD4HEP auto func = [this]( const DeFTLayer& layer ) { - int id = layer.layerID(); + int id = layer.layerID(); // fixme DetectorSegment seg( 0, layer.globalZ(), layer.dxdy(), layer.dzdy(), 0., 0. ); float xmax = 0.5f * layer.sizeX(); @@ -48,7 +48,7 @@ namespace FTZoneCache { this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers }; ftDet.applyToAllLayers( func ); - #else +#else for ( auto station : ftDet.stations() ) { for ( auto layer : station->layers() ) { int id = 4 * ( station->stationID() - 1 ) + layer->layerID(); @@ -64,7 +64,7 @@ namespace FTZoneCache { this->MakeZone( 2 * id, seg, -xmax, xmax, -ymax, 25.f ); // Small overlap (25 mm) for stereo layers } } - #endif +#endif } /// Standard constructor PrFTZoneHandler() = default; -- GitLab From b84975538c3ff4c7563d8444dc0fb640e1519651 Mon Sep 17 00:00:00 2001 From: Ben Couturier Date: Fri, 12 Nov 2021 18:31:45 +0100 Subject: [PATCH 30/38] Fixed derivations names and included GenericConditionAccessor --- Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp | 8 +++++--- .../src/SciFiTrackForwardingStoreHit.cpp | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index fdcac2d17e..e228db9f50 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -8,9 +8,9 @@ * granted to it by virtue of its status as an Intergovernmental Organization * * or submit itself to any jurisdiction. * \*****************************************************************************/ - +#include #include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" +#include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" #include "Event/PrLongTracks.h" @@ -118,6 +118,8 @@ namespace { FTZoneCache::PrFTZoneHandler zoneHandler; + GeomCache( ) = default; + GeomCache( DeFT const& ftDet ) : zoneHandler( ftDet ) { // get the layer z-positions and slopes to cache them for later usage for ( int i{0}; i < 12; ++i ) { @@ -478,7 +480,7 @@ public: : Transformer( name, pSvcLocator, {KeyValue{"HitsLocation", "Rec/SciFiTrackForwarding/Hits"}, KeyValue{"InputTracks", "Rec/Track/UT"}, - KeyValue{"GeometryCache", "AlgorithmSpecific-" + name + "-ZoneHandlerCache"}}, + KeyValue{"GeometryCache", "FT:" + name + "-ZoneHandlerCache"}}, KeyValue{"Output", "Rec/Track/FT"} ) {} StatusCode initialize() override { diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index a1f645c535..32a08685b8 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -8,8 +8,9 @@ * granted to it by virtue of its status as an Intergovernmental Organization * * or submit itself to any jurisdiction. * \*****************************************************************************/ +#include #include "DetDesc/Condition.h" -#include "DetDesc/ConditionAccessorHolder.h" +#include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" #include "Kernel/LHCbID.h" @@ -26,6 +27,7 @@ #include + /** @class SciFiTrackForwardingStoreHit SciFiTrackForwardingStoreHit.cpp * * \brief Transforms FTLiteClusters into the input format needed by the SciFiTrackForwarding @@ -47,6 +49,8 @@ namespace { float m_uBegin; float m_halfChannelPitch; + MatsCache( ) = default; + MatsCache( const DeFT& ftDet ) { auto const first_mat = ftDet.firstMat(); // FIXME ftDet.stations()[0]->layers()[0]->quarters()[0]->modules()[0]->mats()[0]; @@ -91,7 +95,8 @@ public: SciFiTrackForwardingStoreHit( const std::string& name, ISvcLocator* pSvcLocator ) : Transformer( name, pSvcLocator, {KeyValue{"HitsLocation", LHCb::FTLiteClusterLocation::Default}, - KeyValue{"MatsCache", "AlgorithmSpecific-" + name + "-MatsCache"}}, + //KeyValue{"MatsCache", "AlgorithmSpecific-" + name + "-MatsCache"}}, + KeyValue{"MatsCache", "FT:" + name + "-MatsCache"}}, KeyValue{"Output", "Rec/SciFiTrackForwarding/Hits"} ) {} StatusCode initialize() override { -- GitLab From fb5740975ef29a5914018126124cd5d24edf6537 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Mon, 15 Nov 2021 09:10:25 +0000 Subject: [PATCH 31/38] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/17597105 --- Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp | 4 ++-- .../src/SciFiTrackForwardingStoreHit.cpp | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index e228db9f50..ee814bee1d 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -8,10 +8,10 @@ * granted to it by virtue of its status as an Intergovernmental Organization * * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include #include "DetDesc/Condition.h" #include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" +#include #include "Event/PrLongTracks.h" #include "Event/PrUpstreamTracks.h" @@ -118,7 +118,7 @@ namespace { FTZoneCache::PrFTZoneHandler zoneHandler; - GeomCache( ) = default; + GeomCache() = default; GeomCache( DeFT const& ftDet ) : zoneHandler( ftDet ) { // get the layer z-positions and slopes to cache them for later usage diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index 32a08685b8..be94ba7c48 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -8,10 +8,10 @@ * granted to it by virtue of its status as an Intergovernmental Organization * * or submit itself to any jurisdiction. * \*****************************************************************************/ -#include #include "DetDesc/Condition.h" #include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" +#include #include "Kernel/LHCbID.h" @@ -27,7 +27,6 @@ #include - /** @class SciFiTrackForwardingStoreHit SciFiTrackForwardingStoreHit.cpp * * \brief Transforms FTLiteClusters into the input format needed by the SciFiTrackForwarding @@ -49,7 +48,7 @@ namespace { float m_uBegin; float m_halfChannelPitch; - MatsCache( ) = default; + MatsCache() = default; MatsCache( const DeFT& ftDet ) { auto const first_mat = @@ -95,7 +94,7 @@ public: SciFiTrackForwardingStoreHit( const std::string& name, ISvcLocator* pSvcLocator ) : Transformer( name, pSvcLocator, {KeyValue{"HitsLocation", LHCb::FTLiteClusterLocation::Default}, - //KeyValue{"MatsCache", "AlgorithmSpecific-" + name + "-MatsCache"}}, + // KeyValue{"MatsCache", "AlgorithmSpecific-" + name + "-MatsCache"}}, KeyValue{"MatsCache", "FT:" + name + "-MatsCache"}}, KeyValue{"Output", "Rec/SciFiTrackForwarding/Hits"} ) {} -- GitLab From c4749300f3cd1edb462a05ff12d9dacdabc22d2c Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 25 Nov 2021 16:27:44 +0100 Subject: [PATCH 32/38] Protecting DD4HEP include --- Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index ee814bee1d..98cd832875 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -11,7 +11,9 @@ #include "DetDesc/Condition.h" #include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" +#ifdef USE_DD4HEP #include +#endif #include "Event/PrLongTracks.h" #include "Event/PrUpstreamTracks.h" -- GitLab From bb2eb7cb259c32623c144c8f95f8c43a27b89e6b Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Thu, 25 Nov 2021 16:28:40 +0100 Subject: [PATCH 33/38] Protecting DD4HEP include --- Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index be94ba7c48..1f99c48030 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -11,7 +11,9 @@ #include "DetDesc/Condition.h" #include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" +#ifdef USE_DD4HEP #include +#endif #include "Kernel/LHCbID.h" -- GitLab From 0dce99445a46cbb63933b0643266feda5673bfe5 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Thu, 25 Nov 2021 15:29:17 +0000 Subject: [PATCH 34/38] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/17872548 --- Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp | 2 +- Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp index 98cd832875..4f98c370ac 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwarding.cpp @@ -12,7 +12,7 @@ #include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" #ifdef USE_DD4HEP -#include +# include #endif #include "Event/PrLongTracks.h" diff --git a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp index 1f99c48030..f1577e100f 100644 --- a/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp +++ b/Pr/SciFiTrackForwarding/src/SciFiTrackForwardingStoreHit.cpp @@ -12,7 +12,7 @@ #include "DetDesc/GenericConditionAccessorHolder.h" #include "GaudiAlg/Transformer.h" #ifdef USE_DD4HEP -#include +# include #endif #include "Kernel/LHCbID.h" -- GitLab From 1bad4c0e56a065e902bac70dd4565da5b7a39ef7 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Mon, 29 Nov 2021 14:03:17 +0000 Subject: [PATCH 35/38] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/17947610 --- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index 5f2554aa6a..ecb4cb603b 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -17,11 +17,10 @@ */ // Gaudi +#include "DetDesc/ConditionAccessorHolder.h" #include "DetDesc/GenericConditionAccessorHolder.h" #include "Event/FTCluster.h" #include "Event/FTLiteCluster.h" -#include "DetDesc/ConditionAccessorHolder.h" -#include "FTDet/DeFTDetector.h" #include "Event/PrSciFiHits.h" #include "Event/PrSeedTracks.h" #include "Event/StateParameters.h" -- GitLab From b630c7dd0fff8ee3cb37e23f2a857b0f98bd6318 Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Tue, 30 Nov 2021 21:35:00 +0100 Subject: [PATCH 36/38] Removed additional include --- Pr/PrAlgorithms/src/PrHybridSeeding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp index ecb4cb603b..734ae681b5 100644 --- a/Pr/PrAlgorithms/src/PrHybridSeeding.cpp +++ b/Pr/PrAlgorithms/src/PrHybridSeeding.cpp @@ -17,7 +17,7 @@ */ // Gaudi -#include "DetDesc/ConditionAccessorHolder.h" +//#include "DetDesc/ConditionAccessorHolder.h" #include "DetDesc/GenericConditionAccessorHolder.h" #include "Event/FTCluster.h" #include "Event/FTLiteCluster.h" -- GitLab From 8e2acdd106c1f0a2b2252d64758805c513b0245f Mon Sep 17 00:00:00 2001 From: Louis Henry Date: Wed, 1 Dec 2021 11:41:12 +0100 Subject: [PATCH 37/38] Added default constructor to MatsCache --- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index c1302ef3f7..724580c397 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -37,10 +37,10 @@ namespace FTMatsCache { float dieGap{}; float sipmPitch{}; + MatsCache( ) { }; //Needed for DD4HEP MatsCache( const DeFT& ftDet ) { - const auto first_mat = ftDet.firstMat(); // FIXME ftDet.stations().at( 0 )->layers().at( 0 )->quarters().at( 0 - // )->modules().at( 0 )->mats().at( 0 ); -// This parameters are constant accross all mats: + const auto first_mat = ftDet.firstMat(); + // This parameters are constant accross all mats: #ifdef USE_DD4HEP this->dieGap = first_mat.dieGap(); this->sipmPitch = first_mat.sipmPitch(); -- GitLab From 6052de7dc9799bdadf84c28d449ebe293e772f25 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Wed, 1 Dec 2021 10:41:54 +0000 Subject: [PATCH 38/38] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Rec/-/jobs/18004610 --- Pr/PrKernel/include/PrKernel/FTMatsCache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pr/PrKernel/include/PrKernel/FTMatsCache.h b/Pr/PrKernel/include/PrKernel/FTMatsCache.h index 724580c397..88058b0be0 100644 --- a/Pr/PrKernel/include/PrKernel/FTMatsCache.h +++ b/Pr/PrKernel/include/PrKernel/FTMatsCache.h @@ -37,7 +37,7 @@ namespace FTMatsCache { float dieGap{}; float sipmPitch{}; - MatsCache( ) { }; //Needed for DD4HEP + MatsCache(){}; // Needed for DD4HEP MatsCache( const DeFT& ftDet ) { const auto first_mat = ftDet.firstMat(); // This parameters are constant accross all mats: -- GitLab