Belle II Software development
PlumeDigitizerModule.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 <beast/plume/modules/PlumeDigitizerModule.h>
10#include <beast/plume/dataobjects/PlumeSimHit.h>
11#include <beast/plume/dataobjects/PlumeHit.h>
12
13#include <mdst/dataobjects/MCParticle.h>
14#include <framework/datastore/StoreArray.h>
15#include <framework/logging/Logger.h>
16
17//c++
18#include <string>
19
20using namespace std;
21using namespace Belle2;
22using namespace plume;
23
24
25//-----------------------------------------------------------------
26// Register the Module
27//-----------------------------------------------------------------
28REG_MODULE(PlumeDigitizer);
29
30//-----------------------------------------------------------------
31// Implementation
32//-----------------------------------------------------------------
33
35{
36 // Set module properties
37 setDescription("PLUME digitizer module");
38
39 //All parameters needed are found in PLUME.xml.
40
41
42}
43
45{
46}
47
49{
50 B2INFO("Initializing PlumeDigitizer");
51 m_plumeHits.registerInDataStore();
52
53 m_plumeSimHits.isRequired();
55
56 //get the sensor parameters and set the parameters of the response function
57 getXMLData();
58 setResponseModel(); // currently empty
59
60}
61
63{
64
65}
66
68{
69
70 //skip events with no plumeSimHits, but continue the event counter
71 if (m_plumeSimHits.getEntries() == 0) {
72 Event++;
73 return;
74 }
75
76
77 for (int i = 0; i < m_plumeSimHits.getEntries(); i++) {
78 PlumeSimHit* aHit = m_plumeSimHits[i];
79
80 // This is where the detailed response function shall be called
81 m_nofPixels = 3;
82 m_posmm_u = aHit->getposOUT_u();
83 m_posmm_v = aHit->getposOUT_v();
84 m_posmm_x = aHit->getposIN_x();
85 m_posmm_y = aHit->getposIN_y();
86 m_posmm_z = aHit->getposIN_z();
87
88 //create PlumeHit
90 m_posmm_z));
91
92 }
93
94 Event++;
95}
96
97
99{
100
101
102 B2INFO("PLUME response model is so far empty, which means constant cluster size.");
103
104}
105
106
108{
109 //GearDir content = GearDir("/Detector/DetectorComponent[@name=\"PLUME\"]/Content/");
110
111 //get the location of the sensors
112// for (const GearDir& activeParams : content.getNodes("Active")) {
113// }
114
115 B2INFO("Parameters gotten from PLUME.xml: ");
116
117}
118
119
121{
122}
123
125{
126}
127
128
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
ClassPlumeHit - digitization simulated hit for the Microtpc detector.
Definition: PlumeHit.h:26
Class PlumeSimHit - Geant4 simulated hit for the PLUME detector.
Definition: PlumeSimHit.h:27
float getposIN_x() const
incoming track position x in G4 ref, in mm
Definition: PlumeSimHit.h:74
float getposOUT_v() const
outcoming track position v in sensor ref, in mm
Definition: PlumeSimHit.h:88
int getsensorID() const
sensor ID
Definition: PlumeSimHit.h:60
float getposIN_y() const
incoming track position y in G4 ref, in mm
Definition: PlumeSimHit.h:76
float getposOUT_u() const
outcoming track position u in sensor ref, in mm
Definition: PlumeSimHit.h:86
float getposIN_z() const
incoming track position z in G4 ref, in mm
Definition: PlumeSimHit.h:78
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
StoreArray< PlumeHit > m_plumeHits
collection of PlumeHit saved in the datastore by the module
StoreArray< PlumeSimHit > m_plumeSimHits
PLUME SimHits.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual void endRun() override
End-of-run action.
virtual void getXMLData()
reads data from PLUME.xml: ladder location, pixel pitch, epitaxial thickness, integration time
virtual void terminate() override
Termination action.
virtual void beginRun() override
Called when entering a new run.
virtual void setResponseModel()
set the parameters of the response model
PlumeDigitizerModule()
Constructor: Sets the description, the properties and the parameters of the module.
StoreArray< MCParticle > m_particles
PLUME particles.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:649
Abstract base class for different kinds of events.
STL namespace.