|
ATLAS Offline Software
|
#include <EgammaTrackParticleThinning.h>
|
std::atomic< unsigned long int > | m_ntot = 0 |
|
std::atomic< unsigned long int > | m_ntotGSF = 0 |
|
std::atomic< unsigned long int > | m_ntotGSFVtx = 0 |
|
std::atomic< unsigned long int > | m_npass = 0 |
|
std::atomic< unsigned long int > | m_nGSFPass = 0 |
|
std::atomic< unsigned long int > | m_nGSFVtxPass = 0 |
|
std::atomic< unsigned long int > | m_nEgammas = 0 |
|
std::atomic< unsigned long int > | m_nSelEgammas = 0 |
|
StringProperty | m_streamName { this, "StreamName", "", "Name of the stream being thinned" } |
|
SG::ReadHandleKey< xAOD::EgammaContainer > | m_egammaKey { this, "SGKey", "", "" } |
|
SG::ThinningHandleKey< xAOD::TrackParticleContainer > | m_inDetSGKey { this, "InDetTrackParticlesKey", "InDetTrackParticles", "" } |
|
SG::ThinningHandleKey< xAOD::TrackParticleContainer > | m_gsfSGKey { this, "GSFTrackParticlesKey", "GSFTrackParticles", "" } |
|
SG::ThinningHandleKey< xAOD::VertexContainer > | m_gsfVtxSGKey { this, "GSFConversionVerticesKey", "", "" } |
|
StringProperty | m_selectionString { this, "SelectionString", "", "" } |
|
BooleanProperty | m_bestMatchOnly { this, "BestMatchOnly", true, "" } |
|
BooleanProperty | m_bestVtxMatchOnly { this, "BestVtxMatchOnly", false, "" } |
|
FloatProperty | m_coneSize { this, "ConeSize", -1.0, "" } |
|
◆ EgammaTrackParticleThinning()
DerivationFramework::EgammaTrackParticleThinning::EgammaTrackParticleThinning |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~EgammaTrackParticleThinning()
DerivationFramework::EgammaTrackParticleThinning::~EgammaTrackParticleThinning |
( |
| ) |
|
|
virtualdefault |
◆ clearGSFVtx()
void DerivationFramework::EgammaTrackParticleThinning::clearGSFVtx |
( |
const EventContext & |
ctx | ) |
const |
|
private |
Definition at line 216 of file EgammaTrackParticleThinning.cxx.
222 unsigned int nGSFVtx = gsfVtxs->
size();
227 std::vector<bool> gsfVtxMask(nGSFVtx,
false);
230 importedGSFConversionVtx.keep(gsfVtxMask);
◆ doThinning()
StatusCode DerivationFramework::EgammaTrackParticleThinning::doThinning |
( |
| ) |
const |
|
overridevirtual |
Definition at line 108 of file EgammaTrackParticleThinning.cxx.
110 const EventContext& ctx = Gaudi::Hive::currentContext();
115 std::unique_ptr<SG::ThinningHandle<xAOD::TrackParticleContainer>>
116 importedTrackParticles =
nullptr;
118 importedTrackParticles =
119 std::make_unique<SG::ThinningHandle<xAOD::TrackParticleContainer>>(
125 ? importedTrackParticles->cptr()
128 unsigned int nTracks = tps ? tps->
size() : 0;
129 unsigned int nGSF = gsfs->
size();
131 ATH_MSG_DEBUG(
"nTracks : " << nTracks <<
" , nGSF : " << nGSF);
132 if (nTracks == 0 && nGSF == 0) {
134 return StatusCode::SUCCESS;
138 std::vector<bool>
mask, gsfMask;
139 mask.assign(nTracks,
false);
140 gsfMask.assign(nGSF,
false);
146 if (!importedEgamma.isValid()) {
148 <<
" found in StoreGate!");
149 return StatusCode::FAILURE;
152 size_t nEgammas(importedEgamma->size());
160 std::vector<int>
entries = m_parser->evaluateAsVector();
164 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string "
165 "used e-gamma objects??");
166 return StatusCode::FAILURE;
169 for (
unsigned int i = 0;
i < nEgammas; ++
i)
171 tofill.push_back(importedEgamma->at(
i));
175 ? tofill.asDataVector() : importedEgamma.cptr();
185 "nor for Photons ??");
192 unsigned int n_pass = 0;
193 for (
unsigned int i = 0;
i < nTracks; ++
i) {
199 unsigned int n_gsf_pass = 0;
200 for (
unsigned int i = 0;
i < nGSF; ++
i) {
208 importedGSFTrackParticles.keep(gsfMask);
210 importedTrackParticles->keep(
mask);
213 return StatusCode::SUCCESS;
◆ finalize()
StatusCode DerivationFramework::EgammaTrackParticleThinning::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode DerivationFramework::EgammaTrackParticleThinning::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 35 of file EgammaTrackParticleThinning.cxx.
42 <<
" as the source collection for GSF track particles");
44 <<
"GSF track particles associated with objects in "
46 <<
" will be marked as kept true in the ThinningHandle "
47 <<
"otherwise as kept false");
54 <<
" as the source collection for inner detector track particles");
56 ATH_MSG_INFO(
"Inner detector track particles refitted to produce"
58 <<
" will be retained when the corresponding "
59 <<
m_gsfSGKey.key() <<
" track particle will be retained");
62 "Inner detector track particles in a cone dr "
64 <<
" obects will be marked as kept true in the ThinningHandle "
65 <<
"otherwise as kept false");
72 <<
" as the source collection for GSF conversion vertices");
74 <<
" GSF conversion vertices will be kept");
83 return StatusCode::SUCCESS;
◆ setElectronMasks()
Definition at line 324 of file EgammaTrackParticleThinning.cxx.
332 for (
const auto *
egamma : *egammas) {
340 "EgammaTrackParticleThinning::setElectronMasks");
350 for (
unsigned int i = 0;
i < nGSFLinks; ++
i) {
351 if (!(
electron->trackParticleLink(
i).isValid())) {
354 int gsfIndex =
electron->trackParticleLink(
i).index();
355 gsfMask[gsfIndex] =
true;
358 orig(*((*gsfs)[gsfIndex]));
360 int inDetIndex = origTrackLink.
index();
361 mask[inDetIndex] =
true;
◆ setPhotonMasks()
Definition at line 234 of file EgammaTrackParticleThinning.cxx.
242 ATH_MSG_ERROR(
"Thinning track particles/vertices associated to photons"
243 "but no conversion vertex key provided");
250 unsigned int nGSFVtx = gsfVtxs->
size(), n_gsfVtx_pass = 0;
251 std::vector<bool> gsfVtxMask(nGSFVtx,
false);
256 for (
const auto*
egamma : *egammas) {
262 "EgammaTrackParticleThinning::setPhotonMasks");
269 std::vector<ElementLink<xAOD::VertexContainer>> vertexLinks =
271 unsigned int nLinks = vertexLinks.size();
276 for (
unsigned int i = 0;
i < nLinks; ++
i) {
277 if (!(vertexLinks[
i])) {
283 gsfVtxMask[vertexLinks[
i].index()] =
true;
289 for (
unsigned int i = 0;
i < nLinks; ++
i) {
293 gsfVtxMask[vertexLinks[
i].index()] =
true;
300 if (!link.isValid()) {
303 gsfMask[link.index()] =
true;
306 orig(*((*gsfs)[link.index()]));
308 int inDetIndex = origTrackLink.
index();
309 mask[inDetIndex] =
true;
315 importedGSFConversionVtx.keep(gsfVtxMask);
316 for (
bool b : gsfVtxMask) {
◆ m_bestMatchOnly
BooleanProperty DerivationFramework::EgammaTrackParticleThinning::m_bestMatchOnly { this, "BestMatchOnly", true, "" } |
|
private |
◆ m_bestVtxMatchOnly
BooleanProperty DerivationFramework::EgammaTrackParticleThinning::m_bestVtxMatchOnly { this, "BestVtxMatchOnly", false, "" } |
|
private |
◆ m_coneSize
FloatProperty DerivationFramework::EgammaTrackParticleThinning::m_coneSize { this, "ConeSize", -1.0, "" } |
|
private |
◆ m_egammaKey
◆ m_gsfSGKey
◆ m_gsfVtxSGKey
◆ m_inDetSGKey
◆ m_nEgammas
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_nEgammas = 0 |
|
mutableprivate |
◆ m_nGSFPass
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_nGSFPass = 0 |
|
mutableprivate |
◆ m_nGSFVtxPass
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_nGSFVtxPass = 0 |
|
mutableprivate |
◆ m_npass
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_npass = 0 |
|
mutableprivate |
◆ m_nSelEgammas
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_nSelEgammas = 0 |
|
mutableprivate |
◆ m_ntot
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_ntot = 0 |
|
mutableprivate |
◆ m_ntotGSF
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_ntotGSF = 0 |
|
mutableprivate |
◆ m_ntotGSFVtx
std::atomic<unsigned long int> DerivationFramework::EgammaTrackParticleThinning::m_ntotGSFVtx = 0 |
|
mutableprivate |
◆ m_selectionString
StringProperty DerivationFramework::EgammaTrackParticleThinning::m_selectionString { this, "SelectionString", "", "" } |
|
private |
◆ m_streamName
StringProperty DerivationFramework::EgammaTrackParticleThinning::m_streamName { this, "StreamName", "", "Name of the stream being thinned" } |
|
private |
The documentation for this class was generated from the following files:
std::atomic< unsigned long int > m_ntotGSF
Electron_v1 Electron
Definition of the current "egamma version".
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_gsfSGKey
std::atomic< unsigned long int > m_ntotGSFVtx
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ThinningHandleKey< xAOD::VertexContainer > m_gsfVtxSGKey
std::atomic< unsigned long int > m_nGSFVtxPass
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
bool isValid() const
Test to see if the link can be dereferenced.
Handle for requesting thinning for a data object.
BooleanProperty m_bestVtxMatchOnly
BooleanProperty m_bestMatchOnly
void clearGSFVtx(const EventContext &ctx) const
void setPhotonMasks(std::vector< bool > &, std::vector< bool > &, const xAOD::EgammaContainer *, const xAOD::TrackParticleContainer *, const xAOD::TrackParticleContainer *) const
std::atomic< unsigned long int > m_npass
std::vector< ElementLink< xAOD::TrackParticleContainer > > trackParticleLinks(const xAOD::TauJet *tau, xAOD::TauJetParameters::TauTrackFlag flag=xAOD::TauJetParameters::TauTrackFlag::classifiedCharged)
StringProperty m_selectionString
std::atomic< unsigned long int > m_ntot
std::atomic< unsigned long int > m_nEgammas
Photon_v1 Photon
Definition of the current "egamma version".
void setElectronMasks(std::vector< bool > &, std::vector< bool > &, const xAOD::EgammaContainer *, const xAOD::TrackParticleContainer *, const xAOD::TrackParticleContainer *) const
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
DataVector adapter that acts like it holds const pointers.
index_type index() const
Get the index of the element inside of its container.
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
std::atomic< unsigned long int > m_nSelEgammas
StringProperty m_streamName
void select(const xAOD::IParticle *particle, float coneSize, const xAOD::TrackParticleContainer *tracks, std::vector< bool > &mask)
std::atomic< unsigned long int > m_nGSFPass
SG::ReadHandleKey< xAOD::EgammaContainer > m_egammaKey
size_type size() const noexcept
Returns the number of elements in the collection.