Belle II Software  release-06-01-15
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 
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. ");
28  setPropertyFlags(c_ParallelProcessingCertified);
29 
30 }
31 
32 
33 void SVD6SampleEventSkimModule::event()
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
SVD 6-sample event skim module.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
bool isValid() const
Check whether the object was created.
Definition: StoreObjPtr.h:110
#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.