|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/EventContext.h"
17 AugOriginalCounts::AugOriginalCounts(
const std::string&
t,
19 const IInterface*
p) :
21 m_TrackContainername(
"InDetTrackParticles"),
22 m_TrackContainerLRTname(
"InDetLargeD0TrackParticles"),
23 m_PVContainername(
"PrimaryVertices")
25 declareInterface<DerivationFramework::IAugmentationTool>(
this);
44 std::string pvstring =
"EventInfo.OriginalCount_";
54 std::string pvUstring =
"EventInfo.OriginalCount_typeUnknown_"+
m_PVContainername.key();
68 trackcon +=
".OriginalCount_";
75 name+=
".OrigNTracks";
87 return StatusCode::SUCCESS;
93 const EventContext& ctx = Gaudi::Hive::currentContext();
99 PV_count(0) = vertices->
size();
109 constexpr
int nvtypes = 5;
110 int nvtc[] = {0, 0, 0, 0, 0};
111 for (
auto vtx : *vertices) {
113 if (
vt >=0 &&
vt < nvtypes ) {
119 PV0_count(0) = nvtc[0];
120 PV1_count(0) = nvtc[1];
121 PV2_count(0) = nvtc[2];
122 PV3_count(0) = nvtc[3];
123 PVUnk_count(0) = nvtc[4];
130 for (
auto vtx : *vertices) {
131 d_nPVTracks(*vtx) = (
int)vtx->nTrackParticles();
139 for (
auto vtx : *vertices) {
140 float sqrtPt2Sum(0.);
141 for (
auto tp : vtx->trackParticleLinks()) {
142 sqrtPt2Sum += std::sqrt(
pow((*tp)->pt(),2));
144 d_pvSqrtPt2Sum(*vtx) = sqrtPt2Sum;
152 track_count(0) = tracks->
size();
157 track_count(0) = tracks->
size();
160 return StatusCode::SUCCESS;
SG::ReadHandleKey< xAOD::VertexContainer > m_PVContainername
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigPVNTracks
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNtype1
virtual StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNTracksLRTKeys
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNtypeUnknown
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNtype3
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual StatusCode addBranches() const override
Main method called for each event.
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_d_nPVTracks
bool m_addSqrtPt2SumToPVs
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNTracksKeys
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNtype2
SG::WriteDecorHandleKey< xAOD::EventInfo > m_OrigNtype0
Augmentation with primary vertex counts (before thinning)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackContainerLRTname
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_OrigSqrtPt2Sum
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackContainername
size_type size() const noexcept
Returns the number of elements in the collection.