34{
35
36class BuildTruthTaus
37 : public virtual IBuildTruthTaus
39{
42 IBuildTruthTaus )
43
44public:
45
46 struct TruthTausEvent
47 : public ITruthTausEvent
48 {
56 };
57
58 BuildTruthTaus( const std::string& name );
59
60 virtual ~BuildTruthTaus() = default;
61
62
64
65 virtual void setTruthMatchingMode() override {
66 m_truthMatchingMode = true;
67 };
68
69 virtual StatusCode retrieveTruthTaus()
override;
70 virtual StatusCode retrieveTruthTaus(ITruthTausEvent& truthTausEvent,
const EventContext& ctx)
const override;
71
72 Gaudi::Property<bool> m_bForceCheckTruthMatch{ this, "ForceCheckTruthMatch", false};
73
74protected:
75 StatusCode retrieveTruthTausImpl(TruthTausEvent& truthTausEvent,
const EventContext& ctx)
const;
76
77
78private:
79
80 struct TauTruthInfo
81 {
82 size_t m_iNChargedPions = 0;
83 size_t m_iNNeutralPions = 0;
84 size_t m_iNChargedOthers = 0;
85 size_t m_iNNeutralOthers = 0;
86 size_t m_iNChargedDaughters = 0;
87 std::vector<int> m_vDecayMode;
88
89 bool m_bIsHadronicTau = false;
90
91
92 TLorentzVector m_vTruthVisTLV;
93 TLorentzVector m_vTruthVisTLVCharged;
94 std::vector<TLorentzVector> m_TLVCharged;
95 TLorentzVector m_vTruthVisTLVNeutral;
96 std::vector<TLorentzVector> m_TLVNeutral;
97
98
99 TVector3 m_vDecayVertex;
100 TVector3 m_vProdVertex;
101
102 };
103
104
105 StatusCode buildTruthTausFromTruthParticles(TruthTausEvent& truthTausEvent,
const EventContext& ctx)
const;
108 TauTruthInfo& truthInfo) const;
110
111protected:
112
113 TruthTausEvent m_truthTausEvent;
114
115
116 bool m_bTruthTauAvailable{};
117
118private:
119
120
121 Gaudi::Property<bool> m_bWriteInvisibleFourMomentum{ this, "WriteInvisibleFourMomentum", false};
122 Gaudi::Property<bool> m_bWriteVisibleChargedFourMomentum{ this, "WriteVisibleChargedFourMomentum", false};
123 Gaudi::Property<bool> m_bWriteVisibleChargedFourMomentumComponent{ this, "WriteVisibleChargedFourMomentumComponent", false};
124 Gaudi::Property<bool> m_bWriteVisibleNeutralFourMomentum{ this, "WriteVisibleNeutralFourMomentum", false};
125 Gaudi::Property<bool> m_bWriteVisibleNeutralFourMomentumComponent{ this, "WriteVisibleNeutralFourMomentumComponent", false};
126 Gaudi::Property<bool> m_bWriteDecayModeVector{ this, "WriteDecayModeVector", true};
127 Gaudi::Property<bool> m_bWriteVertices{ this, "WriteVertices", true};
128
129
130 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthTauInputContainer { this, "TruthTauContainerName", "TruthTaus", "Truth tau input container name (truth matching mode)" };
131 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthParticleContainer { this, "TruthParticleContainerName", "TruthParticles", "Truth particles input container name" };
132 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthElectronContainer { this, "TruthElectronContainerName", "TruthElectrons", "Truth electrons input container name" };
133 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthMuonContainer { this, "TruthMuonContainerName", "TruthMuons", "Truth muons input container name" };
134 SG::ReadHandleKey<xAOD::JetContainer> m_truthJetContainer { this, "TruthJetContainerName", "AntiKt4TruthDressedWZJets", "Truth jets input container name" };
135
136 SG::WriteHandleKey<xAOD::TruthParticleContainer> m_truthTauOutputContainer { this, "NewTruthTauContainerName", "TruthTaus", "Truth tau output container name" };
137
138
139 SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> m_originReadDecorKey {this, "inputClassifierParticleOrigin", "TruthParticles.classifierParticleOrigin", "Particle origin"};
140 SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> m_typeReadDecorKey {this, "inputClassifierParticleType", "TruthParticles.classifierParticleType", "Particle type"};
141 SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> m_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", "TruthParticles.classifierParticleOutCome", "Particle outcome"};
142 SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> m_classificationReadDecorKey {this, "inputClassification", "TruthParticles.Classification", "Classification code"};
143
144 SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> m_linkDecoratorKey {this, "originalTruthParticle", "TruthTaus.originalTruthParticle", "Name of the decoration linking to the original truth particle"};
145 SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> m_originDecoratorKey {this, "classifierParticleOrigin", "TruthTaus.classifierParticleOrigin", "Name of the decoration which records the particle origin"};
146 SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> m_typeDecoratorKey {this, "classifierParticleType", "TruthTaus.classifierParticleType", "Name of the decoration which records the particle type"};
147 SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> m_outcomeDecoratorKey {this, "classifierParticleOutCome", "TruthTaus.classifierParticleOutCome", "Name of the decoration which records the particle outcome"};
148 SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> m_classificationDecoratorKey {this, "Classification", "TruthTaus.Classification", "Name of the decoration which records the particle classification"};
149
150 bool m_truthMatchingMode = false;
151
152};
153
154}
std::string depth
tag string for intendation
::StatusCode StatusCode
StatusCode definition for legacy code.
TruthParticleAuxContainer_v2 TruthParticleAuxContainer
Declare the latest version of the truth particle auxiliary container.
TruthParticle_v1 TruthParticle
Typedef to implementation.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.