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 {
42 public:
43
45 typedef std::vector<const RelationElement*> RelationLookup;
46
49
52
54 virtual void initialize() override;
55
57 virtual void beginRun() override;
58
60 virtual void event() override;
61
63 virtual void endRun() override;
64
66 virtual void terminate() override;
67
68
69 private:
70
84
86 float m_amplitude = 0;
89
91 float m_chi2 = 0;
92
94 float m_DeltaT = 31.44; //ns
95
97 bool m_StopCreationReco = false;
98
99 protected:
100
115 void createRelationLookup(const RelationArray& relation, RelationLookup& lookup,
116 size_t digits);
117
123 void fillRelationMap(const RelationLookup& lookup, std::map<unsigned int, float>&
124 relation, unsigned int index);
125
126 // Relation lookups
131
133 std::string m_svdEventInfoName = "SVDEventInfo";
135 std::string m_storeMCParticlesName = "MCParticles";
137 std::string m_storeTrueHitsName = "SVDTrueHits";
139 std::string m_storeShaperDigitsName = "SVDShaperDigits";
141 std::string m_storeRecoDigitsName = "SVDRecoDigits";
144
146 bool m_calEventT0 = true;
147 bool m_corrPeakTime = true;
157
160
168 float CalculateAmplitudeError(VxdID ThisSensorID, bool ThisSide, int ThisCellID);
170 float CalculateChi2();
171
172 //calibration objects
179
180 };
182}
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Base class for Modules.
Definition: Module.h:72
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
This module builds the SVDRecoDigits (calibrated and fitted strips) from the SVDShaperDigits.
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.
virtual void endRun() override
This method is called if the current run ends.
std::string m_storeTrueHitsName
Name of the collection to use for the SVDTrueHits.
virtual ~SVDCoGTimeEstimatorModule()
default destructor
virtual void terminate() override
This method is called at the end of the event processing.
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.
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 void beginRun() override
Called when entering a new run.
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:33
Abstract base class for different kinds of events.