Skip to content
Snippets Groups Projects
Commit 3dfcb094 authored by Christopher Rob Jones's avatar Christopher Rob Jones Committed by Christopher Rob Jones
Browse files

RichSmartIDMCUtils: Use boost small vector

parent 863f2f4c
No related branches found
No related tags found
1 merge request!4371DecodedDataFromMCRichHits: Improvements to hit time handling
......@@ -11,9 +11,6 @@
#pragma once
// STL
#include <vector>
// Kernel
#include "Kernel/RichSmartID.h"
......@@ -28,11 +25,23 @@
#include "RichUtils/RichMap.h"
#include "RichUtils/RichPixelCluster.h"
// boost
#include <boost/container/small_vector.hpp>
// STL
#include <vector>
namespace Rich::Future::MC::Relations {
/// Helper class for RichSmartID MC Histories
class SmartIDUtils {
public:
// types
/// Container of history codes
using HistoryCodes = boost::container::small_vector<LHCb::MCRichDigitHistoryCode, 5>;
public:
/// Constructor from a summaries object
SmartIDUtils( const LHCb::MCRichDigitSummarys& histories, const bool EnableDetDescMCDD4HepFix = true );
......@@ -45,15 +54,15 @@ namespace Rich::Future::MC::Relations {
LHCb::MCParticle::ConstVector mcParticles( const LHCb::RichSmartID id ) const;
/// Returns a vector of MCRichDigitHistoryCodes associated to a given cluster
std::vector<LHCb::MCRichDigitHistoryCode> mcDigitHistoryCodes( const Rich::PDPixelCluster& cluster ) const;
HistoryCodes mcDigitHistoryCodes( const Rich::PDPixelCluster& cluster ) const;
/// Returns a vector of MCRichDigitHistoryCodes associated to a given RichSmartID
std::vector<LHCb::MCRichDigitHistoryCode> mcDigitHistoryCodes( const LHCb::RichSmartID id ) const;
HistoryCodes mcDigitHistoryCodes( const LHCb::RichSmartID id ) const;
/// Is the RichSmartID due to true MC Cherenkov radiation from given radiator medium ?
const LHCb::MCParticle* trueCherenkovRadiation( const LHCb::RichSmartID id, const Rich::RadiatorType rad ) const;
/** Is any of the RichSmartIDs in nthe cluster due to true MC Cherenkov radiation
/** Is any of the RichSmartIDs in the cluster due to true MC Cherenkov radiation
* from given radiator medium */
const LHCb::MCParticle* trueCherenkovRadiation( const Rich::PDPixelCluster& cluster,
const Rich::RadiatorType rad ) const;
......@@ -75,7 +84,7 @@ namespace Rich::Future::MC::Relations {
private:
/// Type for vector of pointers to MCRichDigitSummaries
using DigitSummaries = std::vector<const LHCb::MCRichDigitSummary*>;
using DigitSummaries = boost::container::small_vector<const LHCb::MCRichDigitSummary*, 5>;
/// Type for map between RichSmartIDs and MCRichDigitSummary objects
using SummaryMap = Rich::Map<const LHCb::RichSmartID, DigitSummaries>;
......
......@@ -42,8 +42,7 @@ SmartIDUtils::SmartIDUtils( const LHCb::MCRichDigitSummarys& histories, const bo
}
}
std::vector<LHCb::MCRichDigitHistoryCode>
SmartIDUtils::mcDigitHistoryCodes( const Rich::PDPixelCluster& cluster ) const {
SmartIDUtils::HistoryCodes SmartIDUtils::mcDigitHistoryCodes( const Rich::PDPixelCluster& cluster ) const {
// primary ID
auto codes = mcDigitHistoryCodes( cluster.primaryID() );
// now secondary IDs
......@@ -57,8 +56,8 @@ SmartIDUtils::mcDigitHistoryCodes( const Rich::PDPixelCluster& cluster ) const {
return codes;
}
std::vector<LHCb::MCRichDigitHistoryCode> SmartIDUtils::mcDigitHistoryCodes( const LHCb::RichSmartID id ) const {
std::vector<LHCb::MCRichDigitHistoryCode> codes;
SmartIDUtils::HistoryCodes SmartIDUtils::mcDigitHistoryCodes( const LHCb::RichSmartID id ) const {
HistoryCodes codes;
// Does this hit have an entry in the pixel summary map
const auto iEn = m_sumMap.find( id.channelDataOnly() );
if ( iEn != m_sumMap.end() ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment