Belle II Software  release-06-01-15
MCDecayFinderModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 #include <framework/core/Module.h>
11 #include <analysis/modules/MCDecayFinder/DecayTree.h>
12 #include <analysis/DecayDescriptor/DecayDescriptor.h>
13 #include <analysis/dataobjects/ParticleList.h>
14 #include <analysis/dataobjects/ParticleExtraInfoMap.h>
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <framework/datastore/StoreArray.h>
17 #include <mdst/dataobjects/MCParticle.h>
18 
19 namespace Belle2 {
27  class MCDecayFinderModule : public Module {
28  private:
29 
31  std::string m_strDecay;
32  std::string m_listName;
33  std::string m_antiListName;
35  bool m_writeOut;
36  std::string m_particleStore;
44  public:
50  virtual void initialize() override;
52  virtual void event() override;
54  DecayTree<MCParticle>* match(const MCParticle* mcp, const DecayDescriptor* d, bool isCC);
56  int write(DecayTree<MCParticle>* decay);
58  void appendParticles(const MCParticle* gen, std::vector<const MCParticle*>& children);
61  };
63 }
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
This is a helper class for the MCDecayFinderModule.
Definition: DecayTree.h:20
Find decays in MCParticle list matching a given DecayString.
bool m_isSelfConjugatedParticle
Is the particle list for a self-conjugated particle.
std::string m_antiListName
Name of output anti-particle list.
int getNDaughtersRecursive(const DecayDescriptor *d)
Recursively get number of daughters of given DecayDescriptor.
virtual void initialize() override
Initialises the module.
virtual void event() override
Method called for each event.
StoreArray< MCParticle > m_mcparticles
StoreArray of MCParticles.
std::string m_listName
Name of output particle list.
StoreArray< Particle > m_particles
StoreArray of Particles.
int write(DecayTree< MCParticle > *decay)
Create Particle from matched MCParticle and write to Particle list.
StoreObjPtr< ParticleList > m_outputList
output particle list
std::string m_strDecay
Decay string to build the decay descriptor.
std::string m_particleStore
name of Particle store array
void appendParticles(const MCParticle *gen, std::vector< const MCParticle * > &children)
Recursively gather all MC daughters of gen.
DecayTree< MCParticle > * match(const MCParticle *mcp, const DecayDescriptor *d, bool isCC)
Search for MCParticles matching the given DecayString.
StoreObjPtr< ParticleList > m_antiOutputList
output anti-particle list
DecayDescriptor m_decaydescriptor
Decay descriptor of decays to look for.
bool m_writeOut
toggle output particle list btw.
StoreObjPtr< ParticleExtraInfoMap > m_extraInfoMap
object pointer to ParticleExtraInfoMaps
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Abstract base class for different kinds of events.