Belle II Software development
SVDROIFinderModule.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 <tracking/modules/roiFinding/svd/SVDROIFinderModule.h>
10#include <framework/datastore/StoreArray.h>
11#include <framework/datastore/RelationArray.h>
12#include <tracking/dataobjects/ROIid.h>
13#include <tracking/dataobjects/SVDIntercept.h>
14#include <tracking/dataobjects/RecoTrack.h>
15#include <tracking/roiFinding/ROIToUnitTranslator.templateDetails.h>
16#include <tracking/roiFinding/VXDInterceptor.templateDetails.h>
17#include <genfit/MaterialEffects.h>
18
19#include <vector>
20
21using namespace Belle2;
22
23//-----------------------------------------------------------------
24// Register the Module
25//-----------------------------------------------------------------
26REG_MODULE(SVDROIFinder);
27
28//-----------------------------------------------------------------
29// Implementation
30//-----------------------------------------------------------------
31
33{
34 //Set module properties
35 setDescription("This module finds the ROI on the SVD planes");
37
38
39 addParam("recoTrackListName", m_recoTracksListName, " name of the list of the fitted tracks", std::string(""));
40
41 addParam("tolerancePhi", m_tolerancePhi, "Tolerance by finding sensor in phi coordinate (radians).", double(0.15));
42
43 addParam("toleranceZ", m_toleranceZ, "Tolerance by finding sensor in Z coordinate (cm).", double(0.5));
44
45 addParam("sigmaSystU", m_sigmaSystU, " systematic sigma in the u local coordinate ", double(0.025));
46 addParam("sigmaSystV", m_sigmaSystV, " systematic sigma in the V local coordinate ", double(0.025));
47 addParam("numSigmaTotU", m_numSigmaTotU, " number of sigmas (total) in the U local coordinate ", double(10));
48 addParam("numSigmaTotV", m_numSigmaTotV, " number of sigmas (total) in the V local coordinate ", double(10));
49 addParam("maxWidthU", m_maxWidthU, " upper limit on width of the ROI in the U local coordinate (cm) ", double(0.5));
50 addParam("maxWidthV", m_maxWidthV, " upper limit on width of the ROI in the V local coordinate (cm) ", double(0.5));
51
52 addParam("SVDInterceptListName", m_SVDInterceptListName, "name of the list of interceptions", std::string(""));
53 addParam("ROIListName", m_ROIListName, "name of the list of ROIs", std::string(""));
54 addParam("ROIFindingForDQM", m_ROIFindingForDQM,
55 "Is this ROI finding for DQM? If false, create SVDIntercepts by extrapolating tracks in both directions. If true, only extrapolate backwards.",
57}
58
60{
61}
62
63
65{
67
68 m_rois.registerInDataStore(m_ROIListName);
69
70 m_intercepts.registerInDataStore(m_SVDInterceptListName);
71
73 m_intercepts.registerRelationTo(m_rois);
74
75
76 if (!genfit::MaterialEffects::getInstance()->isInitialized()) {
77 B2FATAL("Material effects not set up. Please use SetupGenfitExtrapolationModule.");
78 }
79
80}
81
83{
84
85 B2DEBUG(21, "||| SVDROIFinder Parameters:");
86 B2DEBUG(21, " tolerance: phi = " << m_tolerancePhi);
87 B2DEBUG(21, " z = " << m_toleranceZ);
88 B2DEBUG(21, " n sigma: u = " << m_numSigmaTotU);
89 B2DEBUG(21, " v = " << m_numSigmaTotV);
90 B2DEBUG(21, " systematic: u = " << m_sigmaSystU);
91 B2DEBUG(21, " v = " << m_sigmaSystV);
92 B2DEBUG(21, " max width: u = " << m_maxWidthU);
93 B2DEBUG(21, " v = " << m_maxWidthV);
94
104
106 std::vector<float> {3.9, 8.0, 10.4, 13.5},
109
111
112}
113
114
116{
117
118 if (!m_recotracks.isValid()) {
119 B2DEBUG(21, "RecoTracks array is missing, no SVD ROIs");
120 return;
121 }
122
123
124 B2DEBUG(21, "%%%%%%%% Number of RecoTracks in the events = " << m_recotracks.getEntries());
125
126 RelationArray recoTrackToSVDIntercepts(m_recotracks, m_intercepts);
127 recoTrackToSVDIntercepts.create();
128
129 RelationArray SVDInterceptsToROIids(m_intercepts, m_rois);
130 SVDInterceptsToROIids.create();
131
132 m_theSVDInterceptor->fillInterceptList(&m_intercepts, m_recotracks, &recoTrackToSVDIntercepts);
133
134 m_theStripTranslator->fillRoiIDList(&m_intercepts, &m_rois);
135
136}
137
138
140{
142 delete m_theSVDInterceptor;
143}
144
145
147{
148}
149
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
Translator for ROI-geometry-information into a list of pixels or strips.
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
bool create(bool replace=false)
Create an empty relation array in the data store.
double m_maxWidthV
maximum V width of the ROI
std::string m_recoTracksListName
track list name
std::string m_ROIListName
ROI list name.
StoreArray< SVDIntercept > m_intercepts
svd intercept store array
StoreArray< ROIid > m_rois
rois store array
void initialize() override
Initializes the Module.
SVDROIFinderModule()
Constructor of the module.
double m_maxWidthU
maximum U width of the ROI
void event() override
Event loop.
std::string m_SVDInterceptListName
intercept list name
VXDInterceptor< SVDIntercept > * m_theSVDInterceptor
the svd interceptor object
void endRun() override
Deletion of objects at the end of the run.
void terminate() override
Termination action.
StoreArray< RecoTrack > m_recotracks
reco tracks store array
double m_tolerancePhi
determination of interesting planes, tolerance in phi
double m_sigmaSystV
fixed width to add in quadrature to the extrapolation error and obtain the ROI V width
bool m_ROIFindingForDQM
ROI finding for DQM or for data reduction.
double m_numSigmaTotV
number of sigma (stat+syst) determining the U width of the ROI
void beginRun() override
Initializations at the beginning of the run.
~SVDROIFinderModule()
Destructor of the module.
double m_sigmaSystU
fixed width to add in quadrature to the extrapolation error and obtain the ROI U width
ROIinfo m_ROIinfo
contains the parameters that can be changed by the user
double m_numSigmaTotU
number of sigma (stat+syst) determining the U width of the ROI
double m_toleranceZ
determination of interesting planes, tolerance along Z
ROIToUnitTranslator< SVDIntercept > * m_theStripTranslator
the strip translator object
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool isValid() const
Check wether the array was registered.
Definition: StoreArray.h:288
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Definition: StoreArray.h:140
This Class implements the interceptor of the SVD tracks on the PXD layers.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.
double sigmaSystV
fixed width to add in quadrature to the extrapolation error and obtain the ROI V width
Definition: ROIinfo.h:17
double numSigmaTotU
number of sigma (stat+syst) determining the U width of the ROI
Definition: ROIinfo.h:18
double maxWidthU
maximum U width of the ROI
Definition: ROIinfo.h:20
std::string PXDInterceptListName
Intercept list name.
Definition: ROIinfo.h:23
double sigmaSystU
fixed width to add in quadrature to the extrapolation error and obtain the ROI U width
Definition: ROIinfo.h:16
std::string recoTracksListName
track list name
Definition: ROIinfo.h:25
double numSigmaTotV
number of sigma (stat+syst) determining the U width of the ROI
Definition: ROIinfo.h:19
std::string ROIListName
ROI list name.
Definition: ROIinfo.h:24
double maxWidthV
maximum U width of the ROI
Definition: ROIinfo.h:21