 |
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;
107 constexpr
int nvtypes = 5;
108 int nvtc[] = {0, 0, 0, 0, 0};
109 for (
auto vtx : *vertices) {
111 if (
vt >=0 &&
vt < nvtypes ) {
117 if(!PV0_count.
isAvailable()) PV0_count(0) = nvtc[0];
118 if(!PV1_count.
isAvailable()) PV1_count(0) = nvtc[1];
119 if(!PV2_count.
isAvailable()) PV2_count(0) = nvtc[2];
120 if(!PV3_count.
isAvailable()) PV3_count(0) = nvtc[3];
121 if(!PVUnk_count.
isAvailable()) PVUnk_count(0) = nvtc[4];
129 for (
auto vtx : *vertices) {
130 d_nPVTracks(*vtx) = (
int)vtx->nTrackParticles();
140 for (
auto vtx : *vertices) {
141 float sqrtPt2Sum(0.);
142 for (
auto tp : vtx->trackParticleLinks()) {
143 sqrtPt2Sum += std::sqrt(
pow((*tp)->pt(),2));
145 d_pvSqrtPt2Sum(*vtx) = sqrtPt2Sum;
162 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.
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_d_nPVTracks
virtual StatusCode addBranches(const EventContext &ctx) const override
Main method called for each event.
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.