Belle II Software development
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
41namespace Belle2 {
53
54 public:
55
60
65
70 virtual void initialize() override;
71
76 virtual void beginRun() override;
77
81 virtual void event() override;
82
87 virtual void endRun() override;
88
93 virtual void terminate() override;
94
95 private:
96
97 std::string m_backgroundType;
98 double m_realTime;
99 int m_phase;
100 std::string m_specialFor;
132 template<class SIMHIT>
134 {
135 if (!simHits.isValid()) return 0;
136
137 int numEntries = simHits.getEntries();
138 for (int i = 0; i < numEntries; i++) {
139 SIMHIT* simHit = simHits[i];
140 simHit->setBackgroundTag(m_backgroundTag);
141 }
142 return numEntries;
143 }
144
145
146 };
147
149} // Belle2 namespace
150
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.