28 const IInterface* p ) :
53 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
66 const EventContext& ctx = Gaudi::Hive::currentContext();
69 if(!PV_col.isValid()) {
70 ATH_MSG_ERROR (
"Couldn't retrieve VertexContainer with key PrimaryVertices");
71 return StatusCode::FAILURE;
75 std::vector<bool> mask(PV_col->size(),
false);
88 for(
size_t i = 0; i<s; i++) {
91 for(
size_t i =0; i < 4; i++) {
93 if(origPv==
nullptr)
continue;
94 auto pvit = std::find (PV_col->begin(), PV_col->end(), origPv);
95 if(pvit == PV_col->end()) {
99 size_t x = std::distance(PV_col->begin(), pvit);
106 m_npass += std::accumulate(mask.begin(), mask.end(), 0);
110 std::vector<bool> trackmask(importedTrackParticles->size(),
false);
111 size_t pvnum = mask.size();
112 for(
size_t i =0; i<pvnum;i++){
113 if(mask[i] ==
false)
continue;
114 auto vtx = PV_col->at(i);
115 size_t s = vtx->nTrackParticles();
116 for(
size_t j=0;j<s;j++){
117 auto trackit = std::find(importedTrackParticles->begin(), importedTrackParticles->end(), vtx->trackParticle(j));
118 if(trackit == importedTrackParticles->end()){
122 size_t x = std::distance(importedTrackParticles->begin(), trackit);
123 trackmask.at(
x) =
true;
126 importedTrackParticles.
keep(trackmask);
127 m_tracks_kept += std::accumulate(trackmask.begin(), trackmask.end(), 0);
131 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
: B-physics xAOD helpers.
Handle for requesting thinning for a data object.
storage of the time histories of all the cells
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
const xAOD::Vertex * origPv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
original PV
pv_type
: Enum type of the PV
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Vertex_v1 Vertex
Define the latest version of the vertex class.