|
ATLAS Offline Software
|
Go to the documentation of this file.
28 const IInterface*
p ) :
30 m_TrackContainerName(
"InDetTrackParticles"),
31 m_PVContainerName(
"PrimaryVertices"),
33 m_npass(0), m_tracks_kept(0), m_keepTracks(false)
35 declareInterface<DerivationFramework::IThinningTool>(
this);
51 if(not m_TrackContainerName.key().empty())
ATH_CHECK(m_TrackContainerName.initialize(m_streamName));
52 ATH_CHECK(m_PVContainerName.initialize(m_streamName));
54 return StatusCode::SUCCESS;
59 ATH_MSG_INFO(
"Processed "<< m_ntot <<
" PV, "<< m_npass<<
" were retained ");
60 if(m_keepTracks)
ATH_MSG_INFO(
"Additional tracks kept " << m_tracks_kept);
61 return StatusCode::SUCCESS;
67 const EventContext& ctx = Gaudi::Hive::currentContext();
70 if(!PV_col.isValid()) {
71 ATH_MSG_ERROR (
"Couldn't retrieve VertexContainer with key PrimaryVertices");
72 return StatusCode::FAILURE;
74 m_ntot+=PV_col->size();
76 std::vector<bool>
mask(PV_col->size(),
false);
79 BPhysHelper::PV_MIN_A0,
80 BPhysHelper::PV_MIN_Z0,
81 BPhysHelper::PV_MIN_Z0_BA};
85 for(
auto &
str : m_BPhyCandList) {
88 size_t s = Container->
size();
89 for(
size_t i = 0;
i<
s;
i++) {
92 for(
size_t i =0;
i < 4;
i++) {
94 if(origPv==
nullptr)
continue;
95 auto pvit =
std::find (PV_col->begin(), PV_col->end(), origPv);
96 if(pvit == PV_col->end()) {
111 std::vector<bool> trackmask(importedTrackParticles->size(),
false);
112 size_t pvnum =
mask.size();
113 for(
size_t i =0;
i<pvnum;
i++){
114 if(
mask[
i] ==
false)
continue;
115 auto vtx = PV_col->at(
i);
116 size_t s = vtx->nTrackParticles();
117 for(
size_t j=0;j<
s;j++){
118 auto trackit =
std::find(importedTrackParticles->begin(), importedTrackParticles->end(), vtx->trackParticle(j));
119 if(trackit == importedTrackParticles->end()){
123 size_t x =
std::distance(importedTrackParticles->begin(), trackit);
124 trackmask.at(
x) =
true;
127 importedTrackParticles.
keep(trackmask);
128 m_tracks_kept +=
std::accumulate(trackmask.begin(), trackmask.end(), 0);
132 return StatusCode::SUCCESS;
std::string find(const std::string &s)
return a remapped string
Handle for requesting thinning for a data object.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#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).
pv_type
: Enum type of the PV
::StatusCode StatusCode
StatusCode definition for legacy code.
const xAOD::Vertex * origPv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
original PV
virtual bool isValid() override final
Can the handle be successfully dereferenced?
: B-physics xAOD helpers.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
const T * at(size_type n) const
Access an element, as an rvalue.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
size_type size() const noexcept
Returns the number of elements in the collection.