 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ACTSTRK_HITSUMMARYDATAUTILS_H
6 #define ACTSTRK_HITSUMMARYDATAUTILS_H
18 #include <type_traits>
23 template <
typename T_EnumClass >
28 namespace HitCategory {
68 constexpr
static unsigned short makeKey(
unsigned short region,
unsigned short layer,
int eta_mod) {
120 if (!detector_elements || id_hash>=detector_elements->
size() || !(*detector_elements)[id_hash]) {
137 else if (detEl->
isSCT()) {
146 for (
auto &[stat_key, stat_hits, stat_outlier_hits, stat_shared_hits] :
m_stat) {
147 if (stat_key ==
key) {
154 m_stat.emplace_back( std::make_tuple(
key,
165 for (
const auto &[stat_key, stat_hits, stat_outlier_hits, stat_shared_hits] :
m_stat) {
167 m_hits.at(region) += stat_hits;
172 for (
unsigned int region_i=0; region_i<
unknown+1; ++region_i) {
221 template <
unsigned short HIT_
SELECTION>
225 for (
const auto &[stat_key, stat_hits, stat_outlier_hits, stat_shared_hits] :
m_stat) {
231 total += stat_outlier_hits;
234 total += stat_shared_hits;
242 std::vector< std::tuple<unsigned short, uint8_t, uint8_t, uint8_t> >
m_stat;
247 static constexpr std::array<uint8_t, unknown+1>
s_type
270 double inv_n =
m_n>0 ? 1/
m_n : 0 ;
275 double inv_n =
m_n>0 ? 1./
m_n : 0 ;
291 const typename ActsTrk::TrackContainer::ConstTrackProxy &
track,
295 &measurement_to_summary_type,
296 SumOfValues &chi2_stat_out,
297 HitSummaryData &hit_info_out,
298 std::vector<ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > ¶m_state_idx_out,
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
void computeSummaries()
Compute the varius summaries.
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Helper class to gather statistics and compute the biased variance.
void gatherTrackSummaryData(const ActsTrk::TrackContainer &tracksContainer, const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const std::array< const InDetDD::SiDetectorElementCollection *, to_underlying(xAOD::UncalibMeasType::nTypes)> &siDetEleColl, const std::array< unsigned short, to_underlying(xAOD::UncalibMeasType::nTypes)> &measurement_to_summary_type, SumOfValues &chi2_stat_out, HitSummaryData &hit_info_out, std::vector< ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > ¶m_state_idx_out, std::array< std::array< uint8_t, to_underlying(HitCategory::N)>, to_underlying(xAOD::UncalibMeasType::nTypes)> &special_hit_counts_out)
Helper to gather track summary information from the track states of the specified track.
uint8_t contributingHits(DetectorRegion region) const
return the number of hits in a certain detector region.
constexpr std::underlying_type< T_EnumClass >::type to_underlying(T_EnumClass an_enum)
Helper to convert class enum into an integer.
uint8_t contributingSharedHits(DetectorRegion region) const
return the number of shared hits in a certain detector region.
constexpr static unsigned short LAYER_REGION_MASK
constexpr static unsigned short SIGNED_ETA_MOD_MASK
@ u
Enums for curvilinear frames.
constexpr static unsigned short makeKey(unsigned short region, unsigned short layer, int eta_mod)
Compute a counter key for the given region, layer and module eta module index.
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
static constexpr std::array< uint8_t, unknown+1 > s_type
constexpr static unsigned short REGION_MASK
std::array< uint8_t, Total+1 > m_outlierHits
constexpr static unsigned short SIGNED_ETA_MOD_BITS
Helper class to gather hit summary information for e.g.
uint8_t contributingOutlierHits(DetectorRegion region) const
return the number of outliers in a certain detector region.
bool addHit(const InDetDD::SiDetectorElementCollection *detector_elements, unsigned int id_hash, EHitSelection hit_selection)
update summaries to take the given hit into account.
std::array< uint8_t, Total+1 > m_hits
uint8_t contributingLayers(DetectorRegion region) const
return the number of layers contributing to the hit collection in the given detector region.
virtual DetectorType type() const
Type of element.
constexpr static uint8_t layerFromKey(unsigned short key)
extract the layer index from the given key.
std::vector< std::tuple< unsigned short, uint8_t, uint8_t, uint8_t > > m_stat
uint8_t sum(DetectorRegion region, uint8_t layer) const
return the total number of hits, outliers, and/or shared hits in the givrn detector region and layer.
int layer_disk(const Identifier &id) const
int eta_module(const Identifier &id) const
std::array< uint8_t, Total+1 > m_sharedHits
int layer_disk(const Identifier &id) const
constexpr static unsigned short LAYER_MASK
constexpr static unsigned short REGION_BITS
double biasedVariance() const
int eta_module(const Identifier &id) const
std::array< uint8_t, Total+1 > m_layers
constexpr static DetectorRegion regionFromKey(unsigned short key)
extract the region index from the given key.
constexpr static unsigned short LAYER_BITS
Athena definition of the Eigen plugin.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
DetectorRegion
Regions for which hit counts are computed.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual Identifier identify() const override final
identifier of this detector element (inline)
void reset()
reset all summary counters to zero.
std::array< double, 2 > meanAndBiasedVariance() const