Belle II Software development
SVDClusterizerModule.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#pragma once
10
11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/database/DBObjPtr.h>
14
15#include <svd/reconstruction/RawCluster.h>
16#include <svd/reconstruction/SVDClusterTime.h>
17#include <svd/reconstruction/SVDClusterCharge.h>
18#include <svd/reconstruction/SVDClusterPosition.h>
19
20#include <mdst/dataobjects/MCParticle.h>
21#include <svd/dataobjects/SVDShaperDigit.h>
22#include <svd/dataobjects/SVDCluster.h>
23#include <svd/dataobjects/SVDTrueHit.h>
24
25#include <svd/calibration/SVDPulseShapeCalibrations.h>
26#include <svd/calibration/SVDNoiseCalibrations.h>
27#include <svd/calibration/SVDClustering.h>
28#include <svd/calibration/SVDMCClusterPositionFudgeFactor.h>
29#include <svd/calibration/SVDMCClusterTimeFudgeFactor.h>
30#include <svd/dbobjects/SVDRecoConfiguration.h>
31#include <svd/dbobjects/SVDClusterTimeShifter.h>
32#include <framework/dbobjects/HardwareClockSettings.h>
33
34#include <TMath.h>
35
36namespace Belle2 {
42 namespace SVD {
43
49
50 public:
51
54
56 void initialize() override;
57
59 void beginRun() override;
60
62 void event() override;
63
65 void endRun() override;
66
67 protected:
68
69 //1. Collections and relations Names
71 std::string m_svdEventInfoName;
80
91
100
101 // 2. Clustering
103 double m_cutSeed = 5;
105 double m_cutAdjacent = 3;
107 double m_cutCluster = 0;
109 bool m_useDB = true;
110
111 // 3. Cluster Reconstruction Configuration:
114 std::string m_timeRecoWith6SamplesAlgorithm = "not set";
116 std::string m_timeRecoWith3SamplesAlgorithm = "not set";
118 std::string m_chargeRecoWith6SamplesAlgorithm = "not set";
120 std::string m_chargeRecoWith3SamplesAlgorithm = "not set";
122 std::string m_positionRecoWith6SamplesAlgorithm = "not set";
124 std::string m_positionRecoWith3SamplesAlgorithm = "not set";
125
134
143 // 4. Calibration Objects
159 double applyLorentzShiftCorrection(double position, VxdID vxdID, bool isU);
160
166
170 void writeClusterRelations(const Belle2::SVD::RawCluster& rawCluster);
171
176
180 void alterClusterTime();
181
185 void shiftSVDClusterTime();
186
187 };// end class declarations
188
189
190 } //end SVD namespace;
192} // end namespace Belle2
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Base class for Modules.
Definition: Module.h:72
This class defines the dbobject and the methods to access the calibration of the cluster reconstructi...
Definition: SVDClustering.h:29
This class defines the dbobject and the methods to access the SVD cluster position fudge factors for ...
This class defines the dbobject and the methods to access the SVD time fudge factors for MC reconstru...
This class defines the dbobject and the method to access SVD calibrations from the noise local runs.
Class representing a raw cluster candidate during clustering of the SVD.
Definition: RawCluster.h:33
Abstract Class representing the SVD cluster charge.
Abstract Class representing the SVD cluster position.
Abstract Class representing the SVD cluster time.
std::string m_stripChargeRecoWith3SamplesAlgorithm
string storing the strip charge reconstruction algorithm for cluster reconstruction in 3-sample DAQ m...
double applyLorentzShiftCorrection(double position, VxdID vxdID, bool isU)
returns the position of the cluster after lorentz shift correction
SVDClusterCharge * m_charge6SampleClass
cluster charge class for the 6-sample acquisition mode
SVDClusterCharge * m_charge3SampleClass
cluster charge class for the 3-sample acquisition mode
SVDClusterPosition * m_position3SampleClass
cluster position class for the 3-sample acquisition mode
StoreArray< SVDTrueHit > m_storeTrueHits
Collection of SVDTrueHits.
StoreArray< SVDShaperDigit > m_storeDigits
Collection of SVDShaperDigits.
std::string m_relShaperDigitMCParticleName
Name of the relation between SVDShaperDigits and MCParticles.
DBObjPtr< SVDClusterTimeShifter > m_svdClusterTimeShifter
SVDCluster time shift.
void initialize() override
Initialize the module.
StoreArray< MCParticle > m_storeMCParticles
Collection of MCParticles.
SVDMCClusterPositionFudgeFactor m_mcPositionFudgeFactor
SVDMCClusterPositionFudgeFactor db object.
std::string m_storeShaperDigitsName
Name of the collection to use for the SVDShaperDigits.
void event() override
does the actual clustering
SVDNoiseCalibrations m_NoiseCal
SVDNoise calibrations db object.
void endRun() override
delete pointers
double m_cutCluster
Cluster cut in units of m_elNoise, not included (yet?)
std::string m_storeTrueHitsName
Name of the collection to use for the SVDTrueHits.
SVDClustering m_ClusterCal
SVDCluster calibrations db object.
SVDClusterTime * m_time6SampleClass
cluster time class for the 6-sample acquisition mode
std::string m_storeMCParticlesName
Name of the collection to use for the MCParticles.
bool m_shiftSVDClusterTime
if true applies SVDCluster time shift based on cluster-size
void alterClusterPosition()
alter the cluster position (applied on MC to match resolution measured on data)
void writeClusterRelations(const Belle2::SVD::RawCluster &rawCluster)
writes the relations of the SVDClusters with the other StoreArrays
std::string m_chargeRecoWith6SamplesAlgorithm
string storing the cluster charge reconstruction algorithm in 6-sample DAQ mode
std::string m_chargeRecoWith3SamplesAlgorithm
string storing the cluster charge reconstruction algorithm in 3-sample DAQ mode
int m_numberOfAcquiredSamples
number of acquired samples, can be 6 or 3 (1 is not supported!)
std::string m_relShaperDigitTrueHitName
Name of the relation between SVDShaperDigits and SVDTrueHits.
std::string m_positionRecoWith3SamplesAlgorithm
string storing the cluster position reconstruction algorithm in 3-sample DAQ mode
std::string m_stripTimeRecoWith6SamplesAlgorithm
string storing the strip time reconstruction algorithm for cluster position reconstruction in 6-sampl...
void beginRun() override
configure clustering
SVDClusterPosition * m_position6SampleClass
cluster position class for the 6-sample acquisition mode
std::string m_stripChargeRecoWith6SamplesAlgorithm
string storing the strip charge reconstruction algorithm for cluster position reconstruction in 6-sam...
DBObjPtr< HardwareClockSettings > m_hwClock
systems clock
std::string m_svdEventInfoName
Name of the collection to use for the SVDEventInfo.
std::string m_storeClustersName
Name of the collection to use for the SVDClusters.
SVDMCClusterTimeFudgeFactor m_mcTimeFudgeFactor
SVDMCClusterTimeFudgeFactor db object.
double m_cutSeed
Seed cut in units of noise.
std::string m_relClusterShaperDigitName
Name of the relation between SVDClusters and SVDShaperDigits.
void shiftSVDClusterTime()
Apply cluster time shift depending on cluster size.
std::string m_relClusterMCParticleName
Name of the relation between SVDClusters and MCParticles.
void finalizeCluster(Belle2::SVD::RawCluster &rawCluster)
computes charge, position and time of the raw cluster and appends the new SVDCluster to the StoreArra...
std::string m_stripTimeRecoWith3SamplesAlgorithm
string storing the strip time reconstruction algorithm for cluster position reconstruction in 3-sampl...
SVDClusterizerModule()
Constructor defining the parameters.
std::string m_timeRecoWith6SamplesAlgorithm
string storing the cluster time reconstruction algorithm in 6-sample DAQ mode
DBObjPtr< SVDRecoConfiguration > m_recoConfig
SVD Reconstruction Configuration payload.
std::string m_positionRecoWith6SamplesAlgorithm
string storing the cluster position reconstruction algorithm in 6-sample DAQ mode
StoreArray< SVDCluster > m_storeClusters
Collection of SVDClusters.
std::string m_timeRecoWith3SamplesAlgorithm
string storing the cluster time reconstruction algorithm in 3-sample DAQ mode
bool m_useDB
if true takes the clusterizer cuts and reconstruction configuration from the DB objects
SVDClusterTime * m_time3SampleClass
cluster time class for the 3-sample acquisition mode
void alterClusterTime()
alter the cluster time (applied on MC to match resolution measured on data)
double m_cutAdjacent
Adjacent cut in units of noise.
std::string m_relClusterTrueHitName
Name of the relation between SVDClusters and SVDTrueHits.
bool m_returnRawClusterTime
if true cluster time is not calibrated, to be used for time calibration
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.