Belle II Software development
ContinuumSuppressionBuilderModule.cc
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#include <analysis/modules/ContinuumSuppressionBuilder/ContinuumSuppressionBuilderModule.h>
10
11#include <analysis/ContinuumSuppression/ContinuumSuppression.h>
12#include <analysis/dataobjects/RestOfEvent.h>
13
14using namespace Belle2;
15
16//-----------------------------------------------------------------
17// Register the Module
18//-----------------------------------------------------------------
19REG_MODULE(ContinuumSuppressionBuilder);
20
21//-----------------------------------------------------------------
22// Implementation
23//-----------------------------------------------------------------
24
26{
27 // Set module properties
28 setDescription("Creates for each Particle in the given ParticleLists a ContinuumSuppression dataobject and makes basf2 relation between them.");
29
30 // Parameter definitions
31 addParam("particleList", m_particleListName, "Name of the ParticleList", std::string(""));
32
33 addParam("ROEMask", m_ROEMask, "ROE mask", std::string(RestOfEvent::c_defaultMaskName));
34
35}
36
38{
39 // Input
40 m_plist.isRequired(m_particleListName);
42
43 if (m_ROEMask.empty()) {
45 }
46
47 if (m_ROEMask == "FS1" or m_ROEMask == "ROE") {
48 B2ERROR("The ROE mask for the continuum suppression must not be called " << m_ROEMask);
49 }
50
51 // Output
52 m_csarray.registerInDataStore(m_ROEMask);
54}
55
57{
58 for (unsigned i = 0; i < m_plist->getListSize(); i++) {
59 addContinuumSuppression(m_plist->getParticle(i), m_ROEMask); // pass the ROEMask to cs.cc here as a second argument.
60 }
61}
62
std::string m_particleListName
Name of the ParticleList.
virtual void initialize() override
initialize the module (setup the data store)
StoreArray< ContinuumSuppression > m_csarray
StoreArray of ContinuumSuppression.
StoreObjPtr< ParticleList > m_plist
input particle list
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
static constexpr const char * c_defaultMaskName
Default mask name.
Definition: RestOfEvent.h:60
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Definition: StoreArray.h:140
void addContinuumSuppression(const Particle *particle, const std::string &maskName)
Adds continuum suppression variables.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.