Belle II Software development
SVDDatabaseTestModule.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/svdCalibration/SVDDatabaseTestModule.h>
10#include <framework/logging/Logger.h>
11
12//#include <svd/dbobjects/SVDPulseShapeCalibrations.h>
13//#include <svd/dbobjects/SVDLocalRunBadStrips.h>
14
15#include <vxd/dataobjects/VxdID.h>
16
17using namespace std;
18using namespace Belle2;
19using namespace Belle2::SVD;
20
21
22//-----------------------------------------------------------------
23// Register the Module
24//-----------------------------------------------------------------
25REG_MODULE(SVDDatabaseTest);
26
27//-----------------------------------------------------------------
28// Implementation
29//-----------------------------------------------------------------
30
32{
33 //Set module properties
34 setDescription("The SVD Test Module for the database interface");
35
36}
37
39{ }
40
43{
44
53 VxdID sensorID(3, 1, 1);
54 /*
55 B2INFO("Noise L3_1_1 side V strip 0 = " << m_obj_noise.getNoise(sensorID, false, 0));
56 B2INFO("Noise L3_1_1 side U strip 0 = " << m_obj_noise.getNoise(sensorID , true, 0));
57 B2INFO("Test the retrieval of the noise in electrons:");
58 B2INFO("Noise L3_1_1 side V strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID, false, 0));
59 B2INFO("Noise L3_1_1 side U strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID , true, 0));
60
61 VxdID sensorID_L4(4, 1, 1);
62 B2INFO("Noise L4_1_1 side V strip 0 = " << m_obj_noise.getNoise(sensorID_L4, false, 0));
63 B2INFO("Noise L4_1_1 side U strip 0 = " << m_obj_noise.getNoise(sensorID_L4 , true, 0));
64 B2INFO("Test the retrieval of the noise in electrons:");
65 B2INFO("Noise L4_1_1 side V strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID_L4, false, 0));
66 B2INFO("Noise L4_1_1 side U strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID_L4 , true, 0));
67
68 B2INFO("~~~~~~~~~~~~~~\n");
69
70 B2INFO("Charge [e] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getChargeFromADC(sensorID, false, 0, 60));
71 B2INFO("ADC counts [a.u.] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getADCFromCharge(sensorID, false, 0, 22500.));
72 B2INFO("Peaking time [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getPeakTime(sensorID, false, 0));
73 B2INFO("Pulse width [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getWidth(sensorID, false, 0));
74 B2INFO("Time Correction [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getTimeShiftCorrection(sensorID, false, 0));
75 B2INFO("~~~~~~~~~~~~~~\n");
76
77 B2INFO("Charge [e] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getChargeFromADC(sensorID, true, 0, 60));
78 B2INFO("ADC counts [a.u.] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getADCFromCharge(sensorID, true, 0, 22500.));
79 B2INFO("Peaking time [ns] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getPeakTime(sensorID, true, 0));
80 B2INFO("Pulse width [ns] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getWidth(sensorID, true, 0));
81 B2INFO("Time Correction [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getTimeShiftCorrection(sensorID, true, 0));
82 B2INFO("~~~~~~~~~~~~~~\n");
83 */
84
85 float beta = m_obj_cog.getCorrectedTime(sensorID, true, 0, 0, 0); //t_RAW = 0
86 float alfa = m_obj_cog.getCorrectedTime(sensorID, true, 0, 1, 0) - beta; //t_RAW = 1 - beta
87 B2INFO("CoG, alfa = " << alfa << ", beta = " << beta);
88
89 /*
90 B2INFO("~~~~~~~~~~~~~~\n");
91 B2INFO("isBad = " << m_obj_badStrip->isBad(1, true, 1));
92 */
93
94
95}
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
double getCorrectedTime(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &raw_time, const int &bin) const
Return the strip time, given the raw strip time.
virtual void initialize() override
Initialize the module.
virtual void event() override
Retrieve calibrations from database.
SVDCoGTimeCalibrations m_obj_cog
CoG calibrations payload.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Namespace to encapsulate code needed for simulation and reconstrucion of the SVD.
Definition: GeoSVDCreator.h:23
Abstract base class for different kinds of events.
STL namespace.