Belle II Software  release-05-02-19
SVDDatabaseTestModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Laura Zani
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <svd/modules/svdCalibration/SVDDatabaseTestModule.h>
12 #include <framework/logging/Logger.h>
13 
14 //#include <svd/dbobjects/SVDPulseShapeCalibrations.h>
15 //#include <svd/dbobjects/SVDLocalRunBadStrips.h>
16 
17 #include <vxd/dataobjects/VxdID.h>
18 
19 using namespace std;
20 using namespace Belle2;
21 using namespace Belle2::SVD;
22 
23 
24 //-----------------------------------------------------------------
25 // Register the Module
26 //-----------------------------------------------------------------
27 REG_MODULE(SVDDatabaseTest)
28 
29 //-----------------------------------------------------------------
30 // Implementation
31 //-----------------------------------------------------------------
32 
34 {
35  //Set module properties
36  setDescription("The SVD Test Module for the database interface");
37 
38 }
39 
40 void SVDDatabaseTestModule::initialize()
41 { }
42 
44 void SVDDatabaseTestModule::event()
45 {
46 
55  VxdID sensorID(3, 1, 1);
56  /*
57  B2INFO("Noise L3_1_1 side V strip 0 = " << m_obj_noise.getNoise(sensorID, false, 0));
58  B2INFO("Noise L3_1_1 side U strip 0 = " << m_obj_noise.getNoise(sensorID , true, 0));
59  B2INFO("Test the retrieval of the noise in electrons:");
60  B2INFO("Noise L3_1_1 side V strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID, false, 0));
61  B2INFO("Noise L3_1_1 side U strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID , true, 0));
62 
63  VxdID sensorID_L4(4, 1, 1);
64  B2INFO("Noise L4_1_1 side V strip 0 = " << m_obj_noise.getNoise(sensorID_L4, false, 0));
65  B2INFO("Noise L4_1_1 side U strip 0 = " << m_obj_noise.getNoise(sensorID_L4 , true, 0));
66  B2INFO("Test the retrieval of the noise in electrons:");
67  B2INFO("Noise L4_1_1 side V strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID_L4, false, 0));
68  B2INFO("Noise L4_1_1 side U strip 0 [electrons]= " << m_obj_noise.getNoiseInElectrons(sensorID_L4 , true, 0));
69 
70  B2INFO("~~~~~~~~~~~~~~\n");
71 
72  B2INFO("Charge [e] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getChargeFromADC(sensorID, false, 0, 60));
73  B2INFO("ADC counts [a.u.] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getADCFromCharge(sensorID, false, 0, 22500.));
74  B2INFO("Peaking time [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getPeakTime(sensorID, false, 0));
75  B2INFO("Pulse width [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getWidth(sensorID, false, 0));
76  B2INFO("Time Correction [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getTimeShiftCorrection(sensorID, false, 0));
77  B2INFO("~~~~~~~~~~~~~~\n");
78 
79  B2INFO("Charge [e] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getChargeFromADC(sensorID, true, 0, 60));
80  B2INFO("ADC counts [a.u.] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getADCFromCharge(sensorID, true, 0, 22500.));
81  B2INFO("Peaking time [ns] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getPeakTime(sensorID, true, 0));
82  B2INFO("Pulse width [ns] L3_1_1 side U strip 0 = " << m_obj_pulseShape.getWidth(sensorID, true, 0));
83  B2INFO("Time Correction [ns] L3_1_1 side V strip 0 = " << m_obj_pulseShape.getTimeShiftCorrection(sensorID, true, 0));
84  B2INFO("~~~~~~~~~~~~~~\n");
85  */
86 
87  float beta = m_obj_cog.getCorrectedTime(sensorID, true, 0, 0, 0); //t_RAW = 0
88  float alfa = m_obj_cog.getCorrectedTime(sensorID, true, 0, 1, 0) - beta; //t_RAW = 1 - beta
89  B2INFO("CoG, alfa = " << alfa << ", beta = " << beta);
90 
91  /*
92  B2INFO("~~~~~~~~~~~~~~\n");
93  B2INFO("isBad = " << m_obj_badStrip->isBad(1, true, 1));
94  */
95 
96 
97 }
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::SVD::SVDDatabaseTestModule
Return the calibration results for the noises and the constants measured during the svd local runs (c...
Definition: SVDDatabaseTestModule.h:45
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVD
Namespace to encapsulate code needed for simulation and reconstrucion of the SVD.
Definition: GeoSVDCreator.h:35