ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParametersIdHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRK_TRACKPARAMETERSIDHELPER_H
6#define TRK_TRACKPARAMETERSIDHELPER_H
7
9
10#include "CaloGeoHelpers/CaloSampling.h"
12
13typedef unsigned int TrackParametersIdentifier;
14
15namespace Trk {
16
59
62 bool isEntryToVolume ) const {
64 // check whether techology matches calo
65 if( tech < AtlasDetDescr::fFirstAtlasCaloTechnology || tech > AtlasDetDescr::fLastAtlasCaloTechnology ){
66 m_validField.encode(1,id);
67 }else{
68 m_technologyField.encode(tech,id);
69 unsigned int ientry = isEntryToVolume ? 1 : 0;
70 m_isEntryToLayerField.encode(ientry,id);
71 m_caloSamplingField.encode(sample,id);
72 setVersion(id);
73 }
74 return id;
75 }
76
78 return !m_validField.decode(id);
79 }
80
84
86 // check if identifier is valid
87 if( !isValid(id) ) { return AtlasDetDescr::fUndefined;}
88 return static_cast<AtlasDetDescr::AtlasDetTechnology>(m_technologyField.decode(id));
89 }
90
92 // check if identifier is valid
93 if( !isValid(id) ) { return CaloSampling::Unknown;}
94 return static_cast<CaloSampling::CaloSample>(m_caloSamplingField.decode(id));
95 }
96
100
106
107}
108
109#endif
unsigned int TrackParametersIdentifier
A class managing bits belonging to a range of bits.
Definition BitField.h:14
static const unsigned int m_version
static const BitField< unsigned int > m_caloSamplingField
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
void setVersion(TrackParametersIdentifier &id) const
set version bits
bool isValid(TrackParametersIdentifier id) const
returns true if the id is valid
TrackParametersIdentifier encode(AtlasDetDescr::AtlasDetTechnology, CaloSampling::CaloSample, bool isEntryToVolume) const
Encodes a TrackParametersIdentifier from AtlasDetDescr::AtlasDetTechnology and CaloSampling::CaloSamp...
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid.
static const BitField< unsigned int > m_technologyField
TrackParametersIdentifier encodeInValidIdentifier() const
create invalid identifier
AtlasDetDescr::AtlasDetTechnology technology(TrackParametersIdentifier id) const
AtlasDetTechnology encoded in id, returns AtlasDetDescr::fUndefined if id is not valid.
static const BitField< unsigned int > m_versionField
static const BitField< unsigned int > m_validField
static const BitField< unsigned int > m_isEntryToLayerField
AtlasDetTechnology
A simple enum of ATLAS detector technologies.
Ensure that the ATLAS eigen extensions are properly loaded.