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#include <framework/gearbox/GearDir.h>
17
18//c++
19#include <string>
20#include <fstream>
21
22using namespace std;
23using namespace Belle2;
24using namespace plume;
25
26
27//-----------------------------------------------------------------
28// Register the Module
29//-----------------------------------------------------------------
30REG_MODULE(PlumeDigitizer);
31
32//-----------------------------------------------------------------
33// Implementation
34//-----------------------------------------------------------------
35
37{
38 // Set module properties
39 setDescription("PLUME digitizer module");
40
41 //All parameters needed are found in PLUME.xml.
42
43
44}
45
47{
48}
49
51{
52 B2INFO("Initializing PlumeDigitizer");
53 m_plumeHits.registerInDataStore();
54
55 m_plumeSimHits.isRequired();
57
58 //get the sensor parameters and set the parameters of the response function
59 getXMLData();
60 setResponseModel(); // currently empty
61
62}
63
65{
66
67}
68
70{
71
72 //skip events with no plumeSimHits, but continue the event counter
73 if (m_plumeSimHits.getEntries() == 0) {
74 Event++;
75 return;
76 }
77
78
79 for (int i = 0; i < m_plumeSimHits.getEntries(); i++) {
80 PlumeSimHit* aHit = m_plumeSimHits[i];
81
82 // This is where the detailed response function shall be called
83 m_nofPixels = 3;
84 m_posmm_u = aHit->getposOUT_u();
85 m_posmm_v = aHit->getposOUT_v();
86 m_posmm_x = aHit->getposIN_x();
87 m_posmm_y = aHit->getposIN_y();
88 m_posmm_z = aHit->getposIN_z();
89
90 //create PlumeHit
92 m_posmm_z));
93
94 }
95
96 Event++;
97}
98
99
101{
102
103
104 B2INFO("PLUME response model is so far empty, which means constant cluster size.");
105
106}
107
108
110{
111 //GearDir content = GearDir("/Detector/DetectorComponent[@name=\"PLUME\"]/Content/");
112
113 //get the location of the sensors
114// BOOST_FOREACH(const GearDir & activeParams, content.getNodes("Active")) {
115// }
116
117 B2INFO("Parameters gotten from PLUME.xml: ");
118
119}
120
121
123{
124}
125
127{
128}
129
130
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:650
Abstract base class for different kinds of events.
STL namespace.