|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/ThreadLocalContext.h"
22 const IInterface*
p ) :
42 ATH_CHECK( m_inDetSGKey.initialize (m_streamName) );
43 ATH_MSG_INFO(
"Using " << m_inDetSGKey <<
"as the source collection for inner detector track particles");
46 return StatusCode::FAILURE;
47 }
else {
ATH_MSG_INFO(
"Inner detector track particles associated with objects in " << m_jetSGKey <<
" will be retained in this format with the rest being thinned away");}
50 if (!m_selectionString.empty()) {
51 ATH_CHECK(initializeParser(m_selectionString) );
53 return StatusCode::SUCCESS;
59 ATH_MSG_INFO(
"Processed "<< m_ntot <<
" tracks, "<< m_npass<<
" were retained ");
61 return StatusCode::SUCCESS;
67 const EventContext& ctx = Gaudi::Hive::currentContext();
74 unsigned int nTracks = importedTrackParticles->size();
75 if (nTracks==0)
return StatusCode::SUCCESS;
78 std::vector<bool>
mask;
79 mask.assign(nTracks,
false);
83 if (evtStore()->
retrieve(importedJets,m_jetSGKey).isFailure()) {
84 ATH_MSG_ERROR(
"No jet collection with name " << m_jetSGKey <<
" found in StoreGate!");
85 return StatusCode::FAILURE;
88 unsigned int nJets(importedJets->
size());
89 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
92 if (!m_selectionString.empty()) {
93 std::vector<int>
entries = m_parser->evaluateAsVector();
97 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
98 return StatusCode::FAILURE;
101 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[
i]==1) jetToCheck.push_back((*importedJets)[
i]);
107 if (m_selectionString==
"") {
110 const std::vector< ElementLink<xAOD::TrackParticleContainer> >& SV1_trackParticleLinks =
115 int index = (*tp)->index();
122 const std::vector< ElementLink<xAOD::TrackParticleContainer> >& SV1_trackParticleLinks =
127 int index = (*tp)->index();
134 for (
unsigned int i=0;
i<nTracks; ++
i) {
135 if (
mask[
i]) ++m_npass;
141 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
Const iterator class for DataVector/DataList.
Handle for requesting thinning for a data object.
#define ATH_MSG_VERBOSE(x)
Handle for requesting thinning for a data object.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
::StatusCode StatusCode
StatusCode definition for legacy code.
const TPELVec_t & SV1_TrackParticleLinks() const
get vector of SV1 TrackParticle ElementLinks
virtual StatusCode finalize() override
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
virtual StatusCode doThinning() const override
std::string m_selectionString
size_type size() const noexcept
Returns the number of elements in the collection.
SV1TrackThinning(const std::string &t, const std::string &n, const IInterface *p)
virtual StatusCode initialize() override
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.