Belle II Software  release-08-01-10
BeamBkgTagSetterModule.h
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 #pragma once
10 
11 #include <framework/core/Module.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <simulation/background/BeamBGTypes.h>
14 #include <framework/dataobjects/BackgroundMetaData.h>
15 #include <string>
16 
17 // SimHits
18 #include <pxd/dataobjects/PXDSimHit.h>
19 #include <svd/dataobjects/SVDSimHit.h>
20 #include <cdc/dataobjects/CDCSimHit.h>
21 #include <top/dataobjects/TOPSimHit.h>
22 #include <arich/dataobjects/ARICHSimHit.h>
23 #include <ecl/dataobjects/ECLSimHit.h>
24 #include <ecl/dataobjects/ECLHit.h>
25 #include <klm/dataobjects/KLMSimHit.h>
26 
27 // BEAST SimHits
28 #include <beast/beamabort/dataobjects/BeamabortSimHit.h>
29 #include <beast/claw/dataobjects/ClawSimHit.h>
30 #include <beast/claws/dataobjects/CLAWSSimHit.h>
31 #include <beast/fangs/dataobjects/FANGSSimHit.h>
32 #include <beast/plume/dataobjects/PlumeSimHit.h>
33 #include <beast/pindiode/dataobjects/PindiodeSimHit.h>
34 #include <beast/he3tube/dataobjects/He3tubeSimHit.h>
35 #include <beast/microtpc/dataobjects/MicrotpcSimHit.h>
36 #include <beast/qcsmonitor/dataobjects/QcsmonitorSimHit.h>
37 #include <beast/bgo/dataobjects/BgoSimHit.h>
38 #include <beast/csi/dataobjects/CsiSimHit.h>
39 
40 
41 namespace Belle2 {
55  class BeamBkgTagSetterModule : public Module {
56 
57  public:
58 
63 
67  virtual ~BeamBkgTagSetterModule();
68 
73  virtual void initialize() override;
74 
79  virtual void beginRun() override;
80 
84  virtual void event() override;
85 
90  virtual void endRun() override;
91 
96  virtual void terminate() override;
97 
98  private:
99 
100  std::string m_backgroundType;
101  double m_realTime;
102  int m_phase;
103  std::string m_specialFor;
135  template<class SIMHIT>
137  {
138  if (!simHits.isValid()) return 0;
139 
140  int numEntries = simHits.getEntries();
141  for (int i = 0; i < numEntries; i++) {
142  SIMHIT* simHit = simHits[i];
143  simHit->setBackgroundTag(m_backgroundTag);
144  }
145  return numEntries;
146  }
147 
148 
149  };
150 
152 } // Belle2 namespace
153 
EFileType
Enum for BG file types.
BG_TAG
Enum for background tags.
A module that sets m_backgroundTag variable in SimHits (see BackgroundMetaData.h).
int setBackgroundTag(StoreArray< SIMHIT > &simHits)
functions that set background tag in SimHits
StoreArray< FANGSSimHit > m_fngSimHits
beast simulated hits
StoreArray< PindiodeSimHit > m_pinSimHits
beast simulated hits
int m_phase
Phase that corresponds to beam background sample.
StoreArray< BeamabortSimHit > m_diaSimHits
beast simulated hits
background::BeamBGTypes m_bgTypes
defined BG types
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
StoreArray< KLMSimHit > m_klmSimHits
KLM simulated hits.
StoreArray< PXDSimHit > m_pxdSimHits
PXD simulated hits.
BackgroundMetaData::EFileType m_fileType
file type to set
virtual void endRun() override
End-of-run action.
std::string m_specialFor
ordinary or special file for ECL, PXD
virtual void terminate() override
Termination action.
StoreArray< ECLSimHit > m_eclSimHits
ECL simulated hits.
StoreArray< CLAWSSimHit > m_clw2SimHits
beast simulated hits
StoreArray< ARICHSimHit > m_arichSimHits
ARICH simulated hits.
StoreArray< MicrotpcSimHit > m_tpcSimHits
beast simulated hits
virtual ~BeamBkgTagSetterModule()
Destructor.
double m_realTime
real time that corresponds to beam background sample
StoreArray< CDCSimHit > m_cdcSimHits
CDC simulated hits.
virtual void beginRun() override
Called when entering a new run.
StoreArray< BgoSimHit > m_bgoSimHits
beast simulated hits
StoreArray< QcsmonitorSimHit > m_sciSimHits
beast simulated hits
StoreArray< ECLHit > m_eclHits
ECL simulated hits (short version)
StoreArray< CsiSimHit > m_csiSimHits
beast simulated hits
StoreArray< He3tubeSimHit > m_he3SimHits
beast simulated hits
BackgroundMetaData::BG_TAG m_backgroundTag
background tag to set (from BG type)
StoreArray< ClawSimHit > m_clw1SimHits
beast simulated hits
StoreArray< SVDSimHit > m_svdSimHits
SVD simulated hits.
StoreArray< TOPSimHit > m_topSimHits
TOP simulated hits.
StoreArray< PlumeSimHit > m_plmSimHits
beast simulated hits
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
bool isValid() const
Check wether the array was registered.
Definition: StoreArray.h:288
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
Class to define BG types and to convert between BG types and tags or v.v.
Definition: BeamBGTypes.h:27
Abstract base class for different kinds of events.