Belle II Software  release-06-02-00
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 
13 using namespace Belle2;
14 
15 //-----------------------------------------------------------------
16 // Register the Module
17 //-----------------------------------------------------------------
18 REG_MODULE(ContinuumSuppressionBuilder)
19 
20 //-----------------------------------------------------------------
21 // Implementation
22 //-----------------------------------------------------------------
23 
25 {
26  // Set module properties
27  setDescription("Creates for each Particle in the given ParticleLists a ContinuumSuppression dataobject and makes basf2 relation between them.");
28 
29  // Parameter definitions
30  addParam("particleList", m_particleListName, "Name of the ParticleList", std::string(""));
31 
32  addParam("ROEMask", m_ROEMask, "ROE mask", std::string(""));
33 
34 }
35 
37 {
38  // Input
39  m_plist.isRequired(m_particleListName);
41 
42  // Output
43  m_csarray.registerInDataStore();
45 }
46 
48 {
49  for (unsigned i = 0; i < m_plist->getListSize(); i++) {
50  addContinuumSuppression(m_plist->getParticle(i), m_ROEMask); // pass the ROEMask to cs.cc here as a second argument.
51  }
52 }
53 
Creates for each Particle in given ParticleList an ContinuumSuppression dataobject and makes basf2 re...
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
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.
#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.