ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::TruthCollectionMaker Class Reference

#include <TruthCollectionMaker.h>

Inheritance diagram for DerivationFramework::TruthCollectionMaker:
Collaboration diagram for DerivationFramework::TruthCollectionMaker:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode finalize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Attributes

std::atomic< unsigned int > m_ntotpart {}
std::atomic< unsigned int > m_npasspart {}
SG::ReadHandleKey< xAOD::TruthParticleContainerm_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
SG::WriteHandleKey< xAOD::TruthParticleContainerm_outputParticlesKey {this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"}
Gaudi::Property< std::string > m_partString {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"}
Gaudi::Property< bool > m_do_compress {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"}
Gaudi::Property< bool > m_do_sherpa {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"}
Gaudi::Property< bool > m_keep_navigation_info {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_linkDecoratorKey {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"}
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_hadronOriginDecoratorKey {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"}
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_originReadDecorKey {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"}
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_typeReadDecorKey {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"}
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"}
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_classificationReadDecorKey {this, "inputClassification", m_particlesKey, "Classification", "Classification code"}
ServiceHandle< StoreGateSvcm_metaStore {this, "MetaDataStore", "MetaDataStore"}
 Handle on the metadata store for init.

Detailed Description

Definition at line 29 of file TruthCollectionMaker.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::TruthCollectionMaker::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 79 of file TruthCollectionMaker.cxx.

80{
81 // Event context for AthenaMT
82
83 // Set up for some metadata handling
84 // TODO: this isn't MT compliant. This information should go into the config level and avoid meta store
85 static const bool is_sherpa = [this]() {
86 bool is_sherpa = false;
87 if (m_metaStore->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")){
88 // Note that I'd like to get this out of metadata in general, but it seems that the
89 // metadata isn't fully available in initialize, and since this is a const function
90 // I can only do the retrieve every event, rather than lazy-initializing, since this
91 // metadata ought not change during a run
92 const xAOD::TruthMetaDataContainer* truthMetaData(nullptr);
93 // Shamelessly stolen from the file meta data tool
94 if (m_metaStore->retrieve(truthMetaData).isSuccess() && !truthMetaData->empty()){
95 // Let's just be super sure...
96 const std::string gens = truthMetaData->at(0)->generators();
97 is_sherpa = (gens.find("sherpa")==std::string::npos &&
98 gens.find("Sherpa")==std::string::npos &&
99 gens.find("SHERPA")==std::string::npos) ? false : true;
100 } // Seems to be the only sure way...
101 else {
102 ATH_MSG_WARNING("Found xAODTruthMetaDataContainer empty! Configuring to be NOT Sherpa.");
103 }
104 ATH_MSG_INFO("From metadata configured: Sherpa? " << is_sherpa);
105 } else {
106 ATH_MSG_WARNING("Could not find metadata container in storegate; assuming NOT Sherpa");
107 }
108 return is_sherpa;
109 }();
110
111 // Retrieve truth collections
112 SG::ReadHandle<xAOD::TruthParticleContainer> truthParticles(m_particlesKey,ctx);
113 if (!truthParticles.isValid()) {
114 ATH_MSG_ERROR("Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
115 return StatusCode::FAILURE;
116 }
117
118 // Create the new particle containers and WriteHandles
119 SG::WriteHandle<xAOD::TruthParticleContainer> newParticlesWriteHandle(m_outputParticlesKey, ctx);
120 ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
121 std::make_unique<xAOD::TruthParticleAuxContainer>()));
122 ATH_MSG_DEBUG( "Recorded new TruthParticleContainer with key: " << (m_outputParticlesKey.key()));
123
124 // Set up a mask with the same entries as the full collections
125 unsigned int nParticles = truthParticles->size();
126 m_ntotpart += nParticles;
127
128 // Set up decor readers
129 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > originReadDecor(m_originReadDecorKey, ctx);
130 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > typeReadDecor(m_typeReadDecorKey, ctx);
131 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > outcomeReadDecor(m_outcomeReadDecorKey, ctx);
132 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > classificationReadDecor(m_classificationReadDecorKey, ctx);
133
134 // Set up decorators
135 SG::WriteDecorHandle<xAOD::TruthParticleContainer, ElementLink<xAOD::TruthParticleContainer> > linkDecorator(m_linkDecoratorKey, ctx);
136 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > originDecorator(m_originDecoratorKey, ctx);
137 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > typeDecorator(m_typeDecoratorKey, ctx);
138 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > outcomeDecorator(m_outcomeDecoratorKey, ctx);
139 SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > classificationDecorator(m_classificationDecoratorKey, ctx);
140 SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > motherIDDecorator(m_motherIDDecoratorKey, ctx);
141 SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > daughterIDDecorator(m_daughterIDDecoratorKey, ctx);
142 SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > hadronOriginDecorator(m_hadronOriginDecoratorKey, ctx);
143
144 // Execute the text parsers and update the mask
145 if (!m_partString.empty()) {
146 std::vector<int> entries = m_parser->evaluateAsVector();
147 unsigned int nEntries = entries.size();
148 // check the sizes are compatible
149 if (nParticles != nEntries ) {
150 ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string used TruthParticles?");
151 return StatusCode::FAILURE;
152 } else {
153 // add relevant particles to new collection
154
155 //---------------
156 //This is some code to *add* new particles. Probably a good idea to break this off as a sub-function, but I'll let James C decide where that should go.
157 //---------------
158
159 //Let's check if we want to build W/Z bosons
160 bool SherpaW = false;
161 bool SherpaZ = false;
162 if (m_partString.value().find("24") != std::string::npos && m_do_sherpa && is_sherpa) {
163 SherpaW = true;
164 }
165 if (m_partString.value().find("23") != std::string::npos && m_do_sherpa && is_sherpa) {
166 SherpaZ = true;
167 }
168 if ((SherpaW or SherpaZ) && is_sherpa){
169 if (std::accumulate(entries.begin(),entries.end(),0) > 0){ //We actually have some W and Z bosons in there.
170 SherpaW = false;
171 SherpaZ = false;
172 }
173 }
174
175 if ((SherpaW || SherpaZ) && is_sherpa){
176 // Currently only handles un-ambiguous cases
177 std::vector<const xAOD::TruthParticle*> status_nonPhysical;
178 for (unsigned int i=0; i<nParticles; ++i) {
179 // Nullptr check
180 if (!truthParticles->at(i)) continue;
181 // Only collect leptons
182 if (!MC::isSMLepton(truthParticles->at(i))) continue;
183 // Gather by status
184 if (!MC::isPhysical(truthParticles->at(i))) status_nonPhysical.push_back( truthParticles->at(i) );
185 } // Done with loop over truth particles
186 // Boson cases that we can actually deal with -- generically up to VVV
187 if ((status_nonPhysical.size()==2 || status_nonPhysical.size()==4 || status_nonPhysical.size()==6) && (SherpaZ || SherpaW)){
188 // Basic boson pairing...
189 int gens[3] = {0,0,0};
190 for (size_t i=0;i<status_nonPhysical.size();++i){
191 if (status_nonPhysical[i]->absPdgId()<13) gens[0]++;
192 else if (status_nonPhysical[i]->absPdgId()<15) gens[1]++;
193 else gens[2]++;
194 } // Loop over status_nonPhysical particles
195 // Should only have even numbers per generation. Any number greater than 2 or ==1 and we're dead
196 if (gens[0]>2 || gens[0]==1 || gens[1]>2 || gens[1]==1 || gens[2]>2 || gens[2]==1){
197 // In agreeing with Sherpa authors, these are Q-M ambiguous states. Do not let users be evil.
198 ATH_MSG_VERBOSE("Too many leptons of one generation. Cannot make bosons. Give up");
199 return StatusCode::SUCCESS;
200 }
201 std::vector<const xAOD::TruthParticle*> boson;
202 for (size_t i=0;i<status_nonPhysical.size();++i){
203 if (status_nonPhysical[i]->absPdgId()<13) boson.push_back(status_nonPhysical[i]);
204 else if (gens[0]==0 && status_nonPhysical[i]->absPdgId()<15) boson.push_back(status_nonPhysical[i]);
205 else if (gens[0]==0 && gens[1]==0) boson.push_back(status_nonPhysical[i]);
206 if (boson.size()==2){
207 // Make a boson! Just have to figure out _which_ boson!
208 int pdg_id=0;
209 // Easy case: Z boson
210 if (boson[0]->pdgId()==-boson[1]->pdgId()) pdg_id=23;
211 else if (std::abs(boson[0]->pdgId()+boson[1]->pdgId())!=1){
212 // No idea what you were
213 ATH_MSG_WARNING("Do not know how to interpret as a boson: " << boson[0]->pdgId() << " " << boson[1]->pdgId());
214 } else {
215 // W boson
216 pdg_id=24*(boson[0]->pdgId()+boson[1]->pdgId());
217 }
218 if ( (SherpaW && MC::isW(pdg_id)) ||
219 (SherpaZ && MC::isZ(pdg_id)) ){
220 // Make a Z or a W
221 xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
222 newParticlesWriteHandle->push_back( xTruthParticle );
224 if (boson[0]->hasProdVtx()) {
225 if ((boson[0]->prodVtx()->nIncomingParticles() > 0) && (boson[0]->prodVtx()->incomingParticle(0)!=nullptr)) {
226 motherIDDecorator(*xTruthParticle) = boson[0]->prodVtx()->incomingParticle(0)->pdgId();
227 } else {motherIDDecorator(*xTruthParticle) = 0;}
228 } else {motherIDDecorator(*xTruthParticle) = 0;}
229 if (boson[0]->hasDecayVtx()) {
230 if ((boson[0]->decayVtx()->nOutgoingParticles() > 0) && (boson[0]->decayVtx()->outgoingParticle(0)!=nullptr)) {
231 daughterIDDecorator(*xTruthParticle) = boson[0]->decayVtx()->outgoingParticle(0)->pdgId();
232 } else {daughterIDDecorator(*xTruthParticle) = 0;}
233 } else {daughterIDDecorator(*xTruthParticle) = 0;}
234 }
235 // Set with what makes sense here
236 xTruthParticle->setPdgId(pdg_id);
237 // Set dummy values
238 xTruthParticle->setUid(HepMC::INVALID_PARTICLE_ID);
239 xTruthParticle->setStatus(3);
240 // Use the sum of the momenta
241 xAOD::IParticle::FourMom_t new_mom = boson[0]->p4()+boson[1]->p4();
242 xTruthParticle->setM(new_mom.M());
243 xTruthParticle->setPx(new_mom.Px());
244 xTruthParticle->setPy(new_mom.Py());
245 xTruthParticle->setPz(new_mom.Pz());
246 xTruthParticle->setE(new_mom.E());
247 }
248 // Now clear the vectors
249 boson.clear();
250 // And move to the next generation
251 if (gens[0]==0 && gens[1]==0) gens[2]=0;
252 else if (gens[0]==0) gens[1]=0;
253 else gens[0]=0;
254 } // Done making a boson
255 } // Done looping over particles
256 }
257 if (status_nonPhysical.size()==1 || status_nonPhysical.size()==3 || status_nonPhysical.size()==5 || status_nonPhysical.size()>6){
258 ATH_MSG_WARNING(status_nonPhysical.size() << " leptons found in the Sherpa event record. Not sure how to deal with this.");
259 }
260 return StatusCode::SUCCESS;
261 }
262 for (unsigned int i=0; i<nParticles; ++i) {
263 ElementLink<xAOD::TruthParticleContainer> eltp(*truthParticles,i);
264 if (entries[i]==1) {
265 //In TRUTH3, we want to remove all particles but the first and last in a decay chain. This is off in TRUTH1. The first and last particles in the decay chain are decorated as such.
266
267 const xAOD::TruthParticle* theParticle = (*truthParticles)[i];
268 if (m_do_compress){
269 bool same_as_mother = false;
270 bool same_as_daughter = false;
271 if (theParticle->hasProdVtx()){
272 if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
273 if (theParticle->prodVtx()->incomingParticle(0)->pdgId() == theParticle->pdgId()){
274 same_as_mother = true;
275 }
276 }
277 }
278 if (theParticle->hasDecayVtx()){
279 if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
280 if (theParticle->decayVtx()->outgoingParticle(0)->pdgId() == theParticle->pdgId()){
281 same_as_daughter = true;
282 }
283 }
284 }
285 if (same_as_mother && same_as_daughter){
286 entries[i]=0;
287 continue;
288 }
289 }
290 xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
291 newParticlesWriteHandle->push_back( xTruthParticle );
293 if (theParticle->hasProdVtx()) {
294 if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
295 motherIDDecorator(*xTruthParticle) = theParticle->prodVtx()->incomingParticle(0)->pdgId();
296 } else {motherIDDecorator(*xTruthParticle) = 0;}
297 } else {motherIDDecorator(*xTruthParticle) = 0;}
298 if (theParticle->hasDecayVtx()) {
299 if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
300 daughterIDDecorator(*xTruthParticle) = theParticle->decayVtx()->outgoingParticle(0)->pdgId();
301 } else {daughterIDDecorator(*xTruthParticle) = 0;}
302 } else {daughterIDDecorator(*xTruthParticle) = 0;}
303 }
304 // Fill with numerical content
305 *xTruthParticle=*theParticle;
306 // Copy over the decorations if they are available
307 typeDecorator(*xTruthParticle) =
308 typeReadDecor(*theParticle);
309
310 originDecorator(*xTruthParticle) =
311 originReadDecor(*theParticle);
312
313 outcomeDecorator(*xTruthParticle) =
314 outcomeReadDecor(*theParticle);
315
316 classificationDecorator(*xTruthParticle) =
317 classificationReadDecor(*theParticle);
318
319 if (m_outputParticlesKey.key()=="TruthHFHadrons"){ // FIXME Cannot find any other reference to this container name in Athena...
320 static const SG::ConstAccessor<int> TopHadronOriginFlagAcc("TopHadronOriginFlag"); // FIXME This should be a ReadDecorHandle
321 hadronOriginDecorator(*xTruthParticle) =
322 TopHadronOriginFlagAcc.withDefault (*theParticle, 0); // FIXME avoid using withDefault as it masks configuration/scheduling issues?
323 }
324
325 if(m_keep_navigation_info) linkDecorator(*xTruthParticle) = eltp;
326 }
327 }
328 }
329 // Count the mask
330 for (unsigned int i=0; i<nParticles; ++i) if (entries[i]) ++m_npasspart;
331 }
332
333 return StatusCode::SUCCESS;
334}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originReadDecorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeReadDecorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_linkDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationReadDecorKey
Gaudi::Property< std::string > m_partString
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hadronOriginDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeReadDecorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
TLorentzVector FourMom_t
Definition of the 4-momentum type.
void setPy(float value)
Set the y component of the particle's momentum.
void setUid(int value)
Set unique ID.
void setM(float value)
Also store the mass.
void setE(float value)
Set the energy of the particle.
int pdgId() const
PDG ID code.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
void setPz(float value)
Set the z component of the particle's momentum.
bool hasProdVtx() const
Check for a production vertex on this particle.
bool hasDecayVtx() const
Check for a decay vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
void setStatus(int value)
Set status code.
void setPdgId(int pid)
Set PDG ID code.
void setPx(float value)
Set the x component of the particle's momentum.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
size_t nIncomingParticles() const
Get the number of incoming particles.
double entries
Definition listroot.cxx:49
constexpr int INVALID_PARTICLE_ID
bool isZ(const T &p)
bool isSMLepton(const T &p)
APID: the fourth generation leptons are not standard model leptons.
bool isW(const T &p)
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
TruthMetaDataContainer_v1 TruthMetaDataContainer
Declare the latest version of the truth vertex container.
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ finalize()

StatusCode DerivationFramework::TruthCollectionMaker::finalize ( )
finaloverridevirtual

Definition at line 69 of file TruthCollectionMaker.cxx.

70{
71 ATH_MSG_VERBOSE("finalize() ...");
72 //ATH_MSG_INFO("Processed "<< m_ntotvtx <<" truth vertices, "<< m_npassvtx << " were retained ");
73 ATH_MSG_INFO("Processed "<< m_ntotpart <<" truth particles, "<< m_npasspart << " were retained ");
74 ATH_CHECK( finalizeParser() );
75 return StatusCode::SUCCESS;
76}

◆ initialize()

StatusCode DerivationFramework::TruthCollectionMaker::initialize ( )
finaloverridevirtual

Definition at line 29 of file TruthCollectionMaker.cxx.

30{
31 ATH_MSG_VERBOSE("initialize() ...");
32 // Input truth particles
33 ATH_CHECK( m_particlesKey.initialize() );
34 ATH_MSG_INFO("Using " << m_particlesKey.key() << " as the input truth container key");
35
36 // Output (new) truth particles
37 ATH_CHECK(m_outputParticlesKey.initialize());
38 ATH_MSG_INFO("New truth particles container key: " << m_outputParticlesKey.key() );
39
40 if (m_partString.empty()) {
41 ATH_MSG_FATAL("No selection string provided");
42 return StatusCode::FAILURE;
43 } else {ATH_MSG_INFO("Truth particle selection string: " << m_partString );}
44
45 // Set up the text-parsing machinery for thinning the truth directly according to user cuts
46 if (!m_partString.empty()) {
47 ATH_CHECK( initializeParser(m_partString) );
48 }
49
50 // Initialise read handle keys
51 ATH_CHECK(m_originReadDecorKey.initialize());
52 ATH_CHECK(m_typeReadDecorKey.initialize());
53 ATH_CHECK(m_outcomeReadDecorKey.initialize());
55
56 // Initialise decorator handle keys
57 ATH_CHECK(m_linkDecoratorKey.initialize());
58 ATH_CHECK(m_originDecoratorKey.initialize());
59 ATH_CHECK(m_typeDecoratorKey.initialize());
60 ATH_CHECK(m_outcomeDecoratorKey.initialize());
65
66 return StatusCode::SUCCESS;
67}
#define ATH_MSG_FATAL(x)

Member Data Documentation

◆ m_classificationDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"}
private

Definition at line 64 of file TruthCollectionMaker.h.

65{this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"};

◆ m_classificationReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_classificationReadDecorKey {this, "inputClassification", m_particlesKey, "Classification", "Classification code"}
private

Definition at line 81 of file TruthCollectionMaker.h.

82{this, "inputClassification", m_particlesKey, "Classification", "Classification code"};

◆ m_daughterIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"}
private

Definition at line 68 of file TruthCollectionMaker.h.

69{this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"};

◆ m_do_compress

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_do_compress {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"}
private

Definition at line 49 of file TruthCollectionMaker.h.

50{this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"};

◆ m_do_sherpa

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_do_sherpa {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"}
private

Definition at line 51 of file TruthCollectionMaker.h.

52{this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"};

◆ m_hadronOriginDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_hadronOriginDecoratorKey {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"}
private

Definition at line 70 of file TruthCollectionMaker.h.

71{this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"};

◆ m_keep_navigation_info

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_keep_navigation_info {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"}
private

Definition at line 53 of file TruthCollectionMaker.h.

54{this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"};

◆ m_linkDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_linkDecoratorKey {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"}
private

Definition at line 56 of file TruthCollectionMaker.h.

57{this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"};

◆ m_metaStore

ServiceHandle<StoreGateSvc> DerivationFramework::TruthCollectionMaker::m_metaStore {this, "MetaDataStore", "MetaDataStore"}
private

Handle on the metadata store for init.

Definition at line 84 of file TruthCollectionMaker.h.

84{this, "MetaDataStore", "MetaDataStore"};

◆ m_motherIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"}
private

Definition at line 66 of file TruthCollectionMaker.h.

67{this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"};

◆ m_npasspart

std::atomic<unsigned int> DerivationFramework::TruthCollectionMaker::m_npasspart {}
mutableprivate

Definition at line 40 of file TruthCollectionMaker.h.

40{};

◆ m_ntotpart

std::atomic<unsigned int> DerivationFramework::TruthCollectionMaker::m_ntotpart {}
mutableprivate

Definition at line 39 of file TruthCollectionMaker.h.

39{};

◆ m_originDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
private

Definition at line 58 of file TruthCollectionMaker.h.

59{this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};

◆ m_originReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_originReadDecorKey {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"}
private

Definition at line 75 of file TruthCollectionMaker.h.

76{this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"};

◆ m_outcomeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 62 of file TruthCollectionMaker.h.

63{this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};

◆ m_outcomeReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"}
private

Definition at line 79 of file TruthCollectionMaker.h.

80{this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"};

◆ m_outputParticlesKey

SG::WriteHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outputParticlesKey {this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"}
private

Definition at line 44 of file TruthCollectionMaker.h.

45{this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"};

◆ m_particlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
private

Definition at line 42 of file TruthCollectionMaker.h.

43{this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"};

◆ m_partString

Gaudi::Property<std::string> DerivationFramework::TruthCollectionMaker::m_partString {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"}
private

Definition at line 47 of file TruthCollectionMaker.h.

48{this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"};

◆ m_typeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
private

Definition at line 60 of file TruthCollectionMaker.h.

61{this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"};

◆ m_typeReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_typeReadDecorKey {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"}
private

Definition at line 77 of file TruthCollectionMaker.h.

78{this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"};

The documentation for this class was generated from the following files: