ATLAS Offline Software
EgammaTrackParticleThinning.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // EgammaTrackParticleThinning.h, (c) ATLAS Detector software
8 
9 #ifndef DERIVATIONFRAMEWORK_EGAMMATRACKPARTICLETHINNING_H
10 #define DERIVATIONFRAMEWORK_EGAMMATRACKPARTICLETHINNING_H
11 
12 #include <atomic>
13 #include <string>
14 #include <vector>
15 
19 #include "GaudiKernel/ToolHandle.h"
24 
26 
27 #include "GaudiKernel/ThreadLocalContext.h"
28 
29 namespace DerivationFramework {
30 
32  : public extends<ExpressionParserUser<AthAlgTool>, IThinningTool>
33 {
34 public:
35  EgammaTrackParticleThinning(const std::string& t,
36  const std::string& n,
37  const IInterface* p);
39  virtual StatusCode initialize() override;
40  virtual StatusCode finalize() override;
41  virtual StatusCode doThinning() const override;
42 
43 private:
44  mutable std::atomic<unsigned long int> m_ntot = 0;
45  mutable std::atomic<unsigned long int> m_ntotGSF = 0;
46  mutable std::atomic<unsigned long int> m_ntotGSFVtx = 0;
47  mutable std::atomic<unsigned long int> m_npass = 0;
48  mutable std::atomic<unsigned long int> m_nGSFPass = 0;
49  mutable std::atomic<unsigned long int> m_nGSFVtxPass = 0;
50  mutable std::atomic<unsigned long int> m_nEgammas = 0;
51  mutable std::atomic<unsigned long int> m_nSelEgammas = 0;
52 
53  StringProperty
54  m_streamName{ this, "StreamName", "", "Name of the stream being thinned" };
55 
57 
59  m_inDetSGKey{ this, "InDetTrackParticlesKey", "InDetTrackParticles", "" };
60 
62  m_gsfSGKey{ this, "GSFTrackParticlesKey", "GSFTrackParticles", "" };
63 
65  m_gsfVtxSGKey{ this, "GSFConversionVerticesKey", "", "" };
66 
67  StringProperty m_selectionString{ this, "SelectionString", "", "" };
68 
69  BooleanProperty m_bestMatchOnly{ this, "BestMatchOnly", true, "" };
70  BooleanProperty m_bestVtxMatchOnly{ this, "BestVtxMatchOnly", false, "" };
71  FloatProperty m_coneSize{ this, "ConeSize", -1.0, "" };
72 
73  void setPhotonMasks(std::vector<bool>&,
74  std::vector<bool>&,
75  const xAOD::EgammaContainer*,
77  const xAOD::TrackParticleContainer*) const;
78  void setElectronMasks(std::vector<bool>&,
79  std::vector<bool>&,
80  const xAOD::EgammaContainer*,
82  const xAOD::TrackParticleContainer*) const;
83  void clearGSFVtx(const EventContext& ctx) const;
84 };
85 }
86 
87 #endif // DERIVATIONFRAMEWORK_EGAMMATRACKPARTICLETHINNING_H
DerivationFramework::EgammaTrackParticleThinning::m_ntotGSF
std::atomic< unsigned long int > m_ntotGSF
Definition: EgammaTrackParticleThinning.h:45
DerivationFramework::EgammaTrackParticleThinning::m_gsfSGKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_gsfSGKey
Definition: EgammaTrackParticleThinning.h:62
DerivationFramework::EgammaTrackParticleThinning::m_ntotGSFVtx
std::atomic< unsigned long int > m_ntotGSFVtx
Definition: EgammaTrackParticleThinning.h:46
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition: ThinningHandleKey.h:38
DerivationFramework::EgammaTrackParticleThinning::m_gsfVtxSGKey
SG::ThinningHandleKey< xAOD::VertexContainer > m_gsfVtxSGKey
Definition: EgammaTrackParticleThinning.h:65
DerivationFramework::EgammaTrackParticleThinning::m_nGSFVtxPass
std::atomic< unsigned long int > m_nGSFVtxPass
Definition: EgammaTrackParticleThinning.h:49
ExpressionParserUser.h
DerivationFramework::EgammaTrackParticleThinning
Definition: EgammaTrackParticleThinning.h:33
IThinningTool.h
DerivationFramework::EgammaTrackParticleThinning::finalize
virtual StatusCode finalize() override
Definition: EgammaTrackParticleThinning.cxx:87
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
DerivationFramework::EgammaTrackParticleThinning::m_bestVtxMatchOnly
BooleanProperty m_bestVtxMatchOnly
Definition: EgammaTrackParticleThinning.h:70
DerivationFramework::EgammaTrackParticleThinning::m_bestMatchOnly
BooleanProperty m_bestMatchOnly
Definition: EgammaTrackParticleThinning.h:69
DerivationFramework::EgammaTrackParticleThinning::clearGSFVtx
void clearGSFVtx(const EventContext &ctx) const
Definition: EgammaTrackParticleThinning.cxx:216
EgammaContainer.h
DerivationFramework::EgammaTrackParticleThinning::setPhotonMasks
void setPhotonMasks(std::vector< bool > &, std::vector< bool > &, const xAOD::EgammaContainer *, const xAOD::TrackParticleContainer *, const xAOD::TrackParticleContainer *) const
Definition: EgammaTrackParticleThinning.cxx:234
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
DerivationFramework::EgammaTrackParticleThinning::~EgammaTrackParticleThinning
virtual ~EgammaTrackParticleThinning()
beamspotman.n
n
Definition: beamspotman.py:731
DerivationFramework::EgammaTrackParticleThinning::doThinning
virtual StatusCode doThinning() const override
Definition: EgammaTrackParticleThinning.cxx:108
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::EgammaTrackParticleThinning::m_npass
std::atomic< unsigned long int > m_npass
Definition: EgammaTrackParticleThinning.h:47
AthAlgTool.h
DerivationFramework::EgammaTrackParticleThinning::m_coneSize
FloatProperty m_coneSize
Definition: EgammaTrackParticleThinning.h:71
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DerivationFramework::EgammaTrackParticleThinning::m_selectionString
StringProperty m_selectionString
Definition: EgammaTrackParticleThinning.h:67
DerivationFramework::EgammaTrackParticleThinning::initialize
virtual StatusCode initialize() override
Definition: EgammaTrackParticleThinning.cxx:35
DerivationFramework::EgammaTrackParticleThinning::m_ntot
std::atomic< unsigned long int > m_ntot
Definition: EgammaTrackParticleThinning.h:44
DerivationFramework::EgammaTrackParticleThinning::m_nEgammas
std::atomic< unsigned long int > m_nEgammas
Definition: EgammaTrackParticleThinning.h:50
DerivationFramework::EgammaTrackParticleThinning::setElectronMasks
void setElectronMasks(std::vector< bool > &, std::vector< bool > &, const xAOD::EgammaContainer *, const xAOD::TrackParticleContainer *, const xAOD::TrackParticleContainer *) const
Definition: EgammaTrackParticleThinning.cxx:324
VertexContainer.h
TracksInCone.h
DerivationFramework::EgammaTrackParticleThinning::m_inDetSGKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
Definition: EgammaTrackParticleThinning.h:59
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
DerivationFramework::EgammaTrackParticleThinning::m_nSelEgammas
std::atomic< unsigned long int > m_nSelEgammas
Definition: EgammaTrackParticleThinning.h:51
DerivationFramework::EgammaTrackParticleThinning::m_streamName
StringProperty m_streamName
Definition: EgammaTrackParticleThinning.h:54
DerivationFramework::EgammaTrackParticleThinning::m_nGSFPass
std::atomic< unsigned long int > m_nGSFPass
Definition: EgammaTrackParticleThinning.h:48
DerivationFramework::EgammaTrackParticleThinning::m_egammaKey
SG::ReadHandleKey< xAOD::EgammaContainer > m_egammaKey
Definition: EgammaTrackParticleThinning.h:56
TrackParticleContainer.h
DerivationFramework::EgammaTrackParticleThinning::EgammaTrackParticleThinning
EgammaTrackParticleThinning(const std::string &t, const std::string &n, const IInterface *p)
Definition: EgammaTrackParticleThinning.cxx:22