diff --git a/Kernel/Run2_LHCbKernel/CMakeLists.txt b/Kernel/Run2_LHCbKernel/CMakeLists.txt index 10093d56f89696c914af0832bc6d6ed0fe6d6964..fd46f09c7ec5ad594d21ea76ba7582edc3b5e8f4 100644 --- a/Kernel/Run2_LHCbKernel/CMakeLists.txt +++ b/Kernel/Run2_LHCbKernel/CMakeLists.txt @@ -25,6 +25,8 @@ gaudi_add_library(Run2_LHCbKernel src/MuonTileID.cpp src/OTChannelID.cpp src/RichDetectorType.cpp + src/RichParticleIDType.cpp + src/RichRadiatorType.cpp src/RichSmartID.cpp src/STChannelID.cpp src/TTNames.cpp diff --git a/Kernel/Run2_LHCbKernel/dict/dictionary.h b/Kernel/Run2_LHCbKernel/dict/dictionary.h index d4c8877dab9bdc051646bdc3d4f7fbfb9197d753..9bc430efb94014244b781ca067b85626db4d4bcc 100755 --- a/Kernel/Run2_LHCbKernel/dict/dictionary.h +++ b/Kernel/Run2_LHCbKernel/dict/dictionary.h @@ -22,6 +22,13 @@ #include "Run2_Kernel/STChannelID.h" #include "Run2_Kernel/TTNames.h" #include "Run2_Kernel/VeloChannelID.h" +#include "Run2_Kernel/RichDetectorType.h" +#include "Run2_Kernel/RichParticleIDType.h" +#include "Run2_Kernel/RichRadIntersection.h" +#include "Run2_Kernel/RichRadiatorType.h" +#include "Run2_Kernel/RichSide.h" +#include "Run2_Kernel/RichSmartID.h" +#include "Run2_Kernel/RichTraceMode.h" #include <map> #include <utility> #include <vector> @@ -51,6 +58,11 @@ namespace { std::vector<std::pair<LHCb::Run2::STChannelID, int>> m_std_vector_std_pair_STChannelID_int; std::vector<std::pair<LHCb::Run2::VeloChannelID, int>> m_std_vector_std_pair_VeloChannelID_int; std::vector<std::pair<double, LHCb::Run2::CaloCellID>> m_std_vector_std_pair_double_CaloCellID; + Rich::Run2::Detectors m_RICH_Detectors; + Rich::Run2::Particles m_RICH_Particles; + Rich::Run2::Radiators m_RICH_Radiators; + Rich::Run2::Sides m_RICH_Sides; + // end instantiations }; } // namespace diff --git a/Kernel/Run2_LHCbKernel/dict/selection.xml b/Kernel/Run2_LHCbKernel/dict/selection.xml index aaaa3693c76e148c5be57f81049a07a91e8b1691..2eae14dc95e69a8f2d78e2f83350b8b6bae0c283 100755 --- a/Kernel/Run2_LHCbKernel/dict/selection.xml +++ b/Kernel/Run2_LHCbKernel/dict/selection.xml @@ -13,6 +13,13 @@ <!--- These should really be moved to GaudiKernel or Reflex --> <class name = "std::vector<std::pair<std::string,double> >" /> <class name ="std::map<std::pair<int,unsigned int>,unsigned int>"/> + <class name = "Rich::Run2::Detectors" /> + <class name = "Rich::Run2::Particles" /> + <class name = "Rich::Run2::RadIntersection" /> + <class name = "Rich::Run2::RadIntersection::Sorter" /> + <class name = "Rich::Run2::RadIntersection::Vector" /> + <class name = "Rich::Run2::Radiators" /> + <class name = "Rich::Run2::Sides" /> <class name="LHCb::Run2::CaloCellID"/> <class name="LHCb::Run2::HCCellID"/> <class name="LHCb::Run2::ITNames"/> @@ -47,11 +54,11 @@ <enum name="LHCb::Run2::RichSmartID::IDType"/> <function name="LHCb::Run2::Packer::getBit"/> <function name="LHCb::Run2::Packer::setBit"/> - <function pattern="Rich::detectors*" /> - <function pattern="Rich::particles*" /> - <function pattern="Rich::radiators*" /> - <function pattern="Rich::sides*" /> - <function pattern="Rich::text*" /> + <function pattern="Rich::Run2::detectors*" /> + <function pattern="Rich::Run2::particles*" /> + <function pattern="Rich::Run2::radiators*" /> + <function pattern="Rich::Run2::sides*" /> + <function pattern="Rich::Run2::text*" /> <!-- Counters in TES --> <!--- Add here all interfaces from Kernel directory --> <!--- Next should really be in L0Event, is an L0DUReport return type --> diff --git a/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichParticleIDType.h b/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichParticleIDType.h index a84b198701599dd0988bdfe16346a84d8d8bbf19..9dbd1217394df3e5c2c9f64a652c04dbd9941031 100644 --- a/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichParticleIDType.h +++ b/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichParticleIDType.h @@ -58,18 +58,18 @@ namespace Rich { }; /// Text conversion for Rich::ParticleIDType enumeration - std::string text( const Rich::ParticleIDType particle ); + std::string text( const Rich::Run2::ParticleIDType particle ); /// Type for container of particle types - typedef std::vector<ParticleIDType> Particles; + typedef std::vector<Rich::Run2::ParticleIDType> Particles; // using Particles = std::vector<ParticleIDType>; /// Access a vector of all valid particle ID types const Particles& particles() noexcept; /// Implement textual ostream << method for Rich::ParticleIDType enumeration - inline std::ostream& operator<<( std::ostream& s, const Rich::ParticleIDType particle ) { - return s << Rich::text( particle ); + inline std::ostream& operator<<( std::ostream& s, const Rich::Run2::ParticleIDType particle ) { + return s << Rich::Run2::text( particle ); } /// Type for fixed size arrays with mass hypothesis information diff --git a/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichTraceMode.h b/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichTraceMode.h index 7c8a699a0e6fbed33baace2aac2d8bc4f3860723..d79249b73be0d8f08804ecdba743f0df40e8b608 100644 --- a/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichTraceMode.h +++ b/Kernel/Run2_LHCbKernel/include/Run2_Kernel/RichTraceMode.h @@ -56,8 +56,8 @@ namespace LHCb { RichTraceMode(); /// Constructor with configuration values - explicit RichTraceMode( const LHCb::RichTraceMode::DetectorPlaneBoundary bound, - const LHCb::RichTraceMode::DetectorPrecision detPrec = LHCb::RichTraceMode::FlatPDs, + explicit RichTraceMode( const LHCb::Run2::RichTraceMode::DetectorPlaneBoundary bound, + const LHCb::Run2::RichTraceMode::DetectorPrecision detPrec = LHCb::Run2::RichTraceMode::FlatPDs, const bool forcedSide = false, const bool respectOuter = false, const bool respectMirrSegs = false, const bool checkBeamPipeIntersects = false, const bool checkPDKaptonShadowing = false, const bool aeroRefraction = false ); @@ -66,7 +66,7 @@ namespace LHCb { ~RichTraceMode() {} /// Tests if the given ray tracing result was successful, within the bounds presented by the configured mode - bool traceWasOK( const LHCb::RichTraceMode::RayTraceResult& result ) const; + bool traceWasOK( const LHCb::Run2::RichTraceMode::RayTraceResult& result ) const; /// Print this RichTraceMode in a human readable way std::ostream& fillStream( std::ostream& os ) const; @@ -78,16 +78,16 @@ namespace LHCb { void setData( unsigned int value ); /// Retrieve The PD modelling precision to use - LHCb::RichTraceMode::DetectorPrecision detPrecision() const; + LHCb::Run2::RichTraceMode::DetectorPrecision detPrecision() const; /// Update The PD modelling precision to use - void setDetPrecision( const LHCb::RichTraceMode::DetectorPrecision& value ); + void setDetPrecision( const LHCb::Run2::RichTraceMode::DetectorPrecision& value ); /// Retrieve The PD tube and panel acceptance mode - LHCb::RichTraceMode::DetectorPlaneBoundary detPlaneBound() const; + LHCb::Run2::RichTraceMode::DetectorPlaneBoundary detPlaneBound() const; /// Update The PD tube and panel acceptance mode - void setDetPlaneBound( const LHCb::RichTraceMode::DetectorPlaneBoundary& value ); + void setDetPlaneBound( const LHCb::Run2::RichTraceMode::DetectorPlaneBoundary& value ); /// Retrieve Flag to force the side to use in the ray-tracing bool forcedSide() const; @@ -157,41 +157,41 @@ namespace LHCb { }; // class RichTraceMode - inline std::ostream& operator<<( std::ostream& s, LHCb::RichTraceMode::RayTraceResult e ) { + inline std::ostream& operator<<( std::ostream& s, LHCb::Run2::RichTraceMode::RayTraceResult e ) { switch ( e ) { - case LHCb::RichTraceMode::RayTraceFailed: + case LHCb::Run2::RichTraceMode::RayTraceFailed: return s << "RayTraceFailed"; - case LHCb::RichTraceMode::OutsidePDPanel: + case LHCb::Run2::RichTraceMode::OutsidePDPanel: return s << "OutsidePDPanel"; - case LHCb::RichTraceMode::InPDPanel: + case LHCb::Run2::RichTraceMode::InPDPanel: return s << "InPDPanel"; - case LHCb::RichTraceMode::InPDTube: + case LHCb::Run2::RichTraceMode::InPDTube: return s << "InPDTube"; default: return s << "ERROR wrong value " << int( e ) << " for enum LHCb::RichTraceMode::RayTraceResult"; } } - inline std::ostream& operator<<( std::ostream& s, LHCb::RichTraceMode::DetectorPrecision e ) { + inline std::ostream& operator<<( std::ostream& s, LHCb::Run2::RichTraceMode::DetectorPrecision e ) { switch ( e ) { - case LHCb::RichTraceMode::FlatPDs: + case LHCb::Run2::RichTraceMode::FlatPDs: return s << "FlatPDs"; - case LHCb::RichTraceMode::SphericalPDs: + case LHCb::Run2::RichTraceMode::SphericalPDs: return s << "SphericalPDs"; - case LHCb::RichTraceMode::FullPDs: + case LHCb::Run2::RichTraceMode::FullPDs: return s << "FullPDs"; default: return s << "ERROR wrong value " << int( e ) << " for enum LHCb::RichTraceMode::DetectorPrecision"; } } - inline std::ostream& operator<<( std::ostream& s, LHCb::RichTraceMode::DetectorPlaneBoundary e ) { + inline std::ostream& operator<<( std::ostream& s, LHCb::Run2::RichTraceMode::DetectorPlaneBoundary e ) { switch ( e ) { - case LHCb::RichTraceMode::IgnorePDAcceptance: + case LHCb::Run2::RichTraceMode::IgnorePDAcceptance: return s << "IgnorePDAcceptance"; - case LHCb::RichTraceMode::RespectPDPanel: + case LHCb::Run2::RichTraceMode::RespectPDPanel: return s << "RespectPDPanel"; - case LHCb::RichTraceMode::RespectPDTubes: + case LHCb::Run2::RichTraceMode::RespectPDTubes: return s << "RespectPDTubes"; default: return s << "ERROR wrong value " << int( e ) << " for enum LHCb::RichTraceMode::DetectorPlaneBoundary"; diff --git a/Kernel/Run2_LHCbKernel/src/RichParticleIDType.cpp b/Kernel/Run2_LHCbKernel/src/RichParticleIDType.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a4d0e050d918000f6eab1bd8a4e9a74809699cc0 --- /dev/null +++ b/Kernel/Run2_LHCbKernel/src/RichParticleIDType.cpp @@ -0,0 +1,53 @@ +/*****************************************************************************\ +* (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration * +* * +* This software is distributed under the terms of the GNU General Public * +* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". * +* * +* In applying this licence, CERN does not waive the privileges and immunities * +* granted to it by virtue of its status as an Intergovernmental Organization * +* or submit itself to any jurisdiction. * +\*****************************************************************************/ + +//----------------------------------------------------------------------------- +/** @file RichParticleIDType.cpp + * + * Implementation file for enumeration : Rich::ParticleIDType + * + * @author Chris Jones Christopher.Rob.Jones@cern.ch + * @date 2002-06-19 + */ +//----------------------------------------------------------------------------- + +// local +#include "Run2_Kernel/RichParticleIDType.h" + +// Text conversion for ParticleIDType enumeration +std::string Rich::Run2::text( const Rich::Run2::ParticleIDType particle ) { + switch ( particle ) { + case Rich::Run2::Electron: + return "electron"; + case Rich::Run2::Muon: + return "muon"; + case Rich::Run2::Pion: + return "pion"; + case Rich::Run2::Kaon: + return "kaon"; + case Rich::Run2::Proton: + return "proton"; + case Rich::Run2::BelowThreshold: + return "below_threshold"; + case Rich::Run2::Deuteron: + return "deuteron"; + case Rich::Run2::Unknown: + return "unknown"; + default: + return "?"; // should never happen + } +} + +const Rich::Run2::Particles& Rich::Run2::particles() noexcept { + static Rich::Run2::Particles pids = {Rich::Run2::Electron, Rich::Run2::Muon, Rich::Run2::Pion, Rich::Run2::Kaon, + Rich::Run2::Proton, Rich::Run2::Deuteron, Rich::Run2::BelowThreshold}; + return pids; +} diff --git a/Kernel/Run2_LHCbKernel/src/RichRadiatorType.cpp b/Kernel/Run2_LHCbKernel/src/RichRadiatorType.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a88ed580c9d98875620393dd4dd2ae538e43b85e --- /dev/null +++ b/Kernel/Run2_LHCbKernel/src/RichRadiatorType.cpp @@ -0,0 +1,50 @@ +/*****************************************************************************\ +* (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration * +* * +* This software is distributed under the terms of the GNU General Public * +* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". * +* * +* In applying this licence, CERN does not waive the privileges and immunities * +* granted to it by virtue of its status as an Intergovernmental Organization * +* or submit itself to any jurisdiction. * +\*****************************************************************************/ +//----------------------------------------------------------------------------- +/** @file RichRadiatorType.cpp + * + * Implementation file for enumeration : Rich::RadiatorType + * + * @author Chris Jones Christopher.Rob.Jones@cern.ch + * @date 2002-06-10 + */ +//----------------------------------------------------------------------------- + +// local +#include "Run2_Kernel/RichRadiatorType.h" + +// Text conversion for RadiatorType enumeration +std::string Rich::Run2::text( const Rich::Run2::RadiatorType radiator ) { + switch ( radiator ) { + case Rich::Run2::Aerogel: + return "Aerogel"; + case Rich::Run2::Rich1Gas: + return "Rich1Gas"; + case Rich::Run2::Rich2Gas: + return "Rich2Gas"; + case Rich::Run2::GasQuartzWin: + return "GasQuartzWin"; + case Rich::Run2::HPDQuartzWin: + return "HPDQuartzWin"; + case Rich::Run2::Nitrogen: + return "Nitrogen"; + case Rich::Run2::AerogelFilter: + return "AerogelFilter"; + case Rich::Run2::CO2: + return "Rich CO2"; + case Rich::Run2::PMTQuartzWin: + return "PMTQuartzWin"; + case Rich::Run2::InvalidRadiator: + return "Invalid Radiator"; + default: + return "SHOULD NEVER SEE THIS"; + } +}