ATLAS Offline Software
ThinningDecisionBase.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 /**
5  * @file AthenaKernel/ThinningDecisionBase.icc
6  * @author scott snyder <snyder@bnl.gov>
7  * @date Sep, 2019
8  * @brief Hold thinning decisions for one container.
9  */
10 
11 
12 namespace SG {
13 
14 
15 /**
16  *@ brief Return true if element @c ndx should be thinned.
17  */
18 inline
19 bool ThinningDecisionBase::thinned (size_t ndx) const
20 {
21  return m_mask.test (ndx);
22 }
23 
24 
25 /**
26  * @brief Return the total size of the container being thinned.
27  */
28 inline
29 size_t ThinningDecisionBase::size() const
30 {
31  return m_mask.size();
32 }
33 
34 
35 /**
36  * @brief Return the index corresponding to @c ndxOrig after thinning.
37  * @param ndxOrig Original container index.
38  *
39  * Returns the index at which element @c ndxOrig ends up after thinning.
40  * If the element was thinned away, returns @c RemovedIdx.
41  *
42  * This information is available only after @c buildIndexMap has been called.
43  */
44 inline
45 size_t ThinningDecisionBase::index (size_t ndxOrig) const
46 {
47  return m_indexMap.at (ndxOrig);
48 }
49 
50 
51 } // namespace SG