 |
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")
43 std::string pvstring =
"EventInfo.OriginalCount_";
53 std::string pvUstring =
"EventInfo.OriginalCount_typeUnknown_"+
m_PVContainername.key();
67 trackcon +=
".OriginalCount_";
74 name+=
".OrigNTracks";
86 return StatusCode::SUCCESS;
92 const EventContext& ctx = Gaudi::Hive::currentContext();
108 constexpr
int nvtypes = 5;
109 int nvtc[] = {0, 0, 0, 0, 0};
110 for (
auto vtx : *vertices) {
112 if (
vt >=0 &&
vt < nvtypes ) {
118 if(!PV0_count.
isAvailable()) PV0_count(0) = nvtc[0];
119 if(!PV1_count.
isAvailable()) PV1_count(0) = nvtc[1];
120 if(!PV2_count.
isAvailable()) PV2_count(0) = nvtc[2];
121 if(!PV3_count.
isAvailable()) PV3_count(0) = nvtc[3];
122 if(!PVUnk_count.
isAvailable()) PVUnk_count(0) = nvtc[4];
130 for (
auto vtx : *vertices) {
131 d_nPVTracks(*vtx) = (
int)vtx->nTrackParticles();
141 for (
auto vtx : *vertices) {
142 float sqrtPt2Sum(0.);
143 for (
auto tp : vtx->trackParticleLinks()) {
144 sqrtPt2Sum += std::sqrt(
pow((*tp)->pt(),2));
146 d_pvSqrtPt2Sum(*vtx) = sqrtPt2Sum;
163 return StatusCode::SUCCESS;
SG::ReadHandleKey< xAOD::VertexContainer > m_PVContainername
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
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
constexpr int pow(int base, int exp) noexcept
size_type size() const noexcept
Returns the number of elements in the collection.