Belle II Software  release-08-01-10
OnlyWriteOutParticleLists.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/OnlyWriteOutParticleLists/OnlyWriteOutParticleLists.h>
10 #include <framework/datastore/DataStore.h>
11 #include <analysis/dataobjects/ParticleList.h>
12 
13 using namespace Belle2;
14 
15 REG_MODULE(OnlyWriteOutParticleLists);
16 
18 {
19  setDescription("Marks all objects in DataStore except those of type ParticleList as WrtieOut=False. Intedend to run before outputting an index file to remove unnecessary arrays.");
20 }
21 
23 {
24  for (auto& entry : DataStore::Instance().getStoreEntryMap(DataStore::c_Event)) {
25  entry.second.dontWriteOut = entry.second.objClass != ParticleList::Class();
26  }
27 }
28 
29 
30 
31 
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:59
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
virtual void initialize() override
Initialises the module.
REG_MODULE(arichBtest)
Register the Module.
Abstract base class for different kinds of events.