Belle II Software
light-2406-ragdoll
ExtraInfoRemoverModule.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/ExtraInfoRemover/ExtraInfoRemoverModule.h>
10
#include <analysis/dataobjects/ParticleList.h>
11
12
using namespace
std
;
13
using namespace
Belle2
;
14
15
// Register module in the framework
16
REG_MODULE
(ExtraInfoRemover);
17
18
ExtraInfoRemoverModule::ExtraInfoRemoverModule
() :
Module
()
19
{
20
//Set module properties
21
setDescription
(
"Deletes the ExtraInfo from each particle in the given ParticleLists."
);
22
setPropertyFlags
(
c_ParallelProcessingCertified
);
23
//Parameter definition
24
addParam
(
"particleLists"
,
m_strParticleLists
,
"List of ParticleLists"
, vector<string>());
25
addParam
(
"removeEventExtraInfo"
,
m_removeEventExtraInfo
,
"If True, also eventExtraInfo will be removed"
,
false
);
26
27
}
28
29
void
ExtraInfoRemoverModule::initialize
()
30
{
31
}
32
33
void
ExtraInfoRemoverModule::event
()
34
{
35
36
for
(
auto
& iList :
m_strParticleLists
) {
37
38
StoreObjPtr<ParticleList>
particleList(iList);
39
if
(!particleList.isValid()) {
40
B2INFO(
"ParticleList "
<< iList <<
" not found"
);
41
continue
;
42
}
else
{
43
for
(
unsigned
int
i = 0; i < particleList->getListSize(); ++i) {
44
Particle
* iParticle = particleList ->getParticle(i);
45
iParticle->
removeExtraInfo
();
46
}
47
}
48
}
49
50
if
(
m_removeEventExtraInfo
) {
51
m_eventExtraInfo
->removeExtraInfo();
52
}
53
54
}
Belle2::ExtraInfoRemoverModule::initialize
virtual void initialize() override
Initialises the module.
Definition:
ExtraInfoRemoverModule.cc:29
Belle2::ExtraInfoRemoverModule::m_removeEventExtraInfo
bool m_removeEventExtraInfo
Removes or not EventExtraInfo.
Definition:
ExtraInfoRemoverModule.h:35
Belle2::ExtraInfoRemoverModule::event
virtual void event() override
Method called for each event.
Definition:
ExtraInfoRemoverModule.cc:33
Belle2::ExtraInfoRemoverModule::m_strParticleLists
std::vector< std::string > m_strParticleLists
Name of the lists.
Definition:
ExtraInfoRemoverModule.h:32
Belle2::ExtraInfoRemoverModule::ExtraInfoRemoverModule
ExtraInfoRemoverModule()
Constructor.
Definition:
ExtraInfoRemoverModule.cc:18
Belle2::ExtraInfoRemoverModule::m_eventExtraInfo
StoreObjPtr< EventExtraInfo > m_eventExtraInfo
event extra info object pointer
Definition:
ExtraInfoRemoverModule.h:38
Belle2::Module
Base class for Modules.
Definition:
Module.h:72
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition:
Module.cc:214
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition:
Module.cc:208
Belle2::Module::c_ParallelProcessingCertified
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition:
Module.h:80
Belle2::Particle
Class to store reconstructed particles.
Definition:
Particle.h:75
Belle2::Particle::removeExtraInfo
void removeExtraInfo()
Remove all stored extra info fields.
Definition:
Particle.cc:1284
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition:
StoreObjPtr.h:96
Belle2::Module::addParam
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition:
Module.h:560
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition:
Module.h:650
Belle2
Abstract base class for different kinds of events.
Definition:
ClusterUtils.h:24
std
STL namespace.
analysis
modules
ExtraInfoRemover
src
ExtraInfoRemoverModule.cc
Generated on Tue Jul 9 2024 23:26:37 for Belle II Software by
1.9.6