Belle II Software development
SVDCoGTimeEstimatorModule.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
10#pragma once
11
12#include <framework/core/Module.h>
13#include <framework/datastore/RelationArray.h>
14#include <framework/datastore/StoreArray.h>
15#include <svd/dataobjects/SVDEventInfo.h>
16#include <svd/dataobjects/SVDShaperDigit.h>
17#include <svd/dataobjects/SVDRecoDigit.h>
18#include <svd/calibration/SVDPulseShapeCalibrations.h>
19#include <svd/calibration/SVDNoiseCalibrations.h>
20#include <svd/calibration/SVDCoGTimeCalibrations.h>
21
22#include <mdst/dataobjects/MCParticle.h>
23#include <svd/dataobjects/SVDTrueHit.h>
24
25#include <string>
26
27namespace Belle2 {
32
40
42 public:
43
45 typedef std::vector<const RelationElement*> RelationLookup;
46
49
51 virtual ~SVDCoGTimeEstimatorModule() override;
52
54 virtual void initialize() override;
55
57 virtual void event() override;
58
59
60 private:
61
65
68
70
75
77 float m_amplitude = 0;
80
82 float m_chi2 = 0;
83
85 float m_DeltaT = 31.44; //ns
86
88 bool m_StopCreationReco = false;
89
90 protected:
91
106 void createRelationLookup(const RelationArray& relation, RelationLookup& lookup,
107 size_t digits);
108
114 void fillRelationMap(const RelationLookup& lookup, std::map<unsigned int, float>&
115 relation, unsigned int index);
116
117 // Relation lookups
122
124 std::string m_svdEventInfoName = "SVDEventInfo";
126 std::string m_storeMCParticlesName = "MCParticles";
128 std::string m_storeTrueHitsName = "SVDTrueHits";
130 std::string m_storeShaperDigitsName = "SVDShaperDigits";
132 std::string m_storeRecoDigitsName = "SVDRecoDigits";
135
137 bool m_calEventT0 = true;
138 bool m_corrPeakTime = true;
139
148
151
159 float CalculateAmplitudeError(VxdID ThisSensorID, bool ThisSide, int ThisCellID);
161 static float CalculateChi2();
162
163 //calibration objects
167
170
171 };
172
173}
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
Module()
Constructor.
Definition Module.cc:30
Low-level class to create/modify relations between StoreArrays.
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
std::string m_storeRecoDigitsName
Name of the collection to use for the SVDRecoDigits.
float m_chi2
Chi2, to be defined here.
SVDCoGTimeEstimatorModule()
Constructor defining the parameters.
StoreArray< SVDTrueHit > m_storeTrueHits
SVDTrueHits store array.
float CalculateAmplitudeError(VxdID ThisSensorID, bool ThisSide, int ThisCellID)
Function to calculate the amplitude error as the noise of the strip.
std::string m_relShaperDigitMCParticleName
Name of the relation between SVDShaperDigits and MCParticles.
SVDCoGTimeCalibrations m_TimeCal
SVD CoG Time calibrations db object.
bool m_corrPeakTime
correction of peakTime per strip from local calibrations
virtual void initialize() override
Initialize the SVDCoGTimeEstimator.
StoreArray< MCParticle > m_storeMCParticles
MCParticles Store array.
std::string m_storeShaperDigitsName
Name of the collection to use for the SVDShaperDigits.
virtual void event() override
This method is the core of the SVDCoGTimeEstimator.
std::vector< const RelationElement * > RelationLookup
Container for a RelationArray Lookup table.
std::string m_relRecoDigitTrueHitName
Name of the relation between SVDRecoDigits and SVDTrueHits.
float CalculateAmplitude(Belle2::SVDShaperDigit::APVFloatSamples samples)
Function to calculate the amplitude of the shaper, obtained as the largest of the 6 samples.
SVDNoiseCalibrations m_NoiseCal
SVDNoise calibrations db object.
std::string m_storeTrueHitsName
Name of the collection to use for the SVDTrueHits.
std::string m_relRecoDigitMCParticleName
Name of the relation between SVDRecoDigits and MCParticles.
float m_AmplitudeArbitraryError
Approximate ADC error on each sample.
void fillRelationMap(const RelationLookup &lookup, std::map< unsigned int, float > &relation, unsigned int index)
Add the relation from a given SVDShaperDigit index to a map.
std::string m_storeMCParticlesName
Name of the collection to use for the MCParticles.
StoreArray< SVDRecoDigit > m_storeReco
SVDRecoDigits store array.
float CalculateWeightedMeanPeakTimeError(Belle2::SVDShaperDigit::APVFloatSamples samples)
Function to calculate the peak time error.
SVDPulseShapeCalibrations m_PulseShapeCal
SVDPulseShaper calibrations db object.
static float CalculateChi2()
Function to calculate chi2, that is not used here, so just set at 0.01.
std::string m_relShaperDigitTrueHitName
Name of the relation between SVDShaperDigits and SVDTrueHits.
RelationLookup m_trueRelation
Lookup table for SVDShaperDigit->SVDTrueHit relation.
virtual ~SVDCoGTimeEstimatorModule() override
default destructor
StoreArray< SVDShaperDigit > m_storeShaper
store arrays
float m_weightedMeanTime
The peak time estimation.
std::string m_svdEventInfoName
Name of the SVDEventInfo object.
void createRelationLookup(const RelationArray &relation, RelationLookup &lookup, size_t digits)
Create lookup maps for relations FIXME: This has to be significantly simplified here,...
float m_DeltaT
Time width of a sampling.
RelationLookup m_mcRelation
Lookup table for SVDShaperDigit->MCParticle relation.
bool m_StopCreationReco
To stop creation of the SVDShaperDigit if something is wrong.
StoreObjPtr< SVDEventInfo > m_storeSVDEvtInfo
storage for SVDEventInfo object
float m_weightedMeanTimeError
The peak time estimation error.
bool m_calEventT0
Parameters for the corrections.
float CalculateWeightedMeanPeakTime(Belle2::SVDShaperDigit::APVFloatSamples samples)
Function to calculate the peak time, obtained as the weighted mean of the time of the samples,...
float m_amplitudeError
The shaper amplitude estimation error.
float m_amplitude
The shaper amplitude estimation.
std::string m_relRecoDigitShaperDigitName
Name of the relation between SVDRecoDigits and SVDShaperDigits.
This class defines the dbobject and the method to access SVD calibrations from the noise local runs.
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
array of APVFloatSampleType objects
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
Class to uniquely identify a any structure of the PXD and SVD.
Definition VxdID.h:32
Abstract base class for different kinds of events.