Belle II Software  release-08-01-10
SVD6SampleEventSkimModule.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 <svd/modules/svdSkims/SVD6SampleEventSkimModule.h>
10 #include <svd/dataobjects/SVDEventInfo.h>
11 
12 using namespace std;
13 using namespace Belle2;
14 
15 //-----------------------------------------------------------------
16 // Register the Module
17 //-----------------------------------------------------------------
18 REG_MODULE(SVD6SampleEventSkim);
19 
20 //-----------------------------------------------------------------
21 // Implementation
22 //-----------------------------------------------------------------
23 
24 SVD6SampleEventSkimModule::SVD6SampleEventSkimModule() : Module()
25 {
26 // Set module properties
27  setDescription("Skim Module for the SVD 6-sample acquired events, in either the 6-sample only or the 3-mixed-6 sample DAQ modes. ");
29 
30 }
31 
32 
34 {
35 
36  int retvalue = 0;
37 
38  //first check SVDEventInfo name
39  StoreObjPtr<SVDEventInfo> temp_eventinfo("SVDEventInfo");
40  std::string m_svdEventInfoName = "SVDEventInfo";
41  if (!temp_eventinfo.isValid())
42  m_svdEventInfoName = "SVDEventInfoSim";
43  StoreObjPtr<SVDEventInfo> eventinfo(m_svdEventInfoName);
44  if (!eventinfo) B2ERROR("No SVDEventInfo!");
45 
46  if (eventinfo->getNSamples() == 6)
47  retvalue = 1;
48 
49  setReturnValue(retvalue);
50 
51 }
52 
53 
54 
55 
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition: Module.cc:220
@ 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
void event() override
Event processor.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
bool isValid() const
Check whether the object was created.
Definition: StoreObjPtr.h:111
#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.