Belle II Software  release-08-01-10
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/svdROIFinder/SVDROIFinderModule.h>
10 #include <framework/datastore/StoreArray.h>
11 #include <framework/datastore/RelationArray.h>
12 #include <genfit/MaterialEffects.h>
13 
14 using namespace Belle2;
15 
16 //-----------------------------------------------------------------
17 // Register the Module
18 //-----------------------------------------------------------------
19 REG_MODULE(SVDROIFinder);
20 
21 //-----------------------------------------------------------------
22 // Implementation
23 //-----------------------------------------------------------------
24 
26 {
27  //Set module properties
28  setDescription("This module finds the ROI on the SVD planes");
30 
31 
32  addParam("recoTrackListName", m_recoTracksListName, " name of the list of the fitted tracks", std::string(""));
33 
34  addParam("tolerancePhi", m_tolerancePhi, "Tolerance by finding sensor in phi coordinate (radians).", double(0.15));
35 
36  addParam("toleranceZ", m_toleranceZ, "Tolerance by finding sensor in Z coordinate (cm).", double(0.5));
37 
38  addParam("sigmaSystU", m_sigmaSystU, " systematic sigma in the u local coordinate ", double(0.025));
39  addParam("sigmaSystV", m_sigmaSystV, " systematic sigma in the V local coordinate ", double(0.025));
40  addParam("numSigmaTotU", m_numSigmaTotU, " number of sigmas (total) in the U local coordinate ", double(10));
41  addParam("numSigmaTotV", m_numSigmaTotV, " number of sigmas (total) in the V local coordinate ", double(10));
42  addParam("maxWidthU", m_maxWidthU, " upper limit on width of the ROI in the U local coordinate (cm) ", double(0.5));
43  addParam("maxWidthV", m_maxWidthV, " upper limit on width of the ROI in the V local coordinate (cm) ", double(0.5));
44 
45  addParam("SVDInterceptListName", m_SVDInterceptListName, "name of the list of interceptions", std::string(""));
46  addParam("ROIListName", m_ROIListName, "name of the list of ROIs", std::string(""));
47 
48 }
49 
51 {
52 }
53 
54 
56 {
58 
59  m_rois.registerInDataStore(m_ROIListName);
60 
61  m_intercepts.registerInDataStore(m_SVDInterceptListName);
62 
64  m_intercepts.registerRelationTo(m_rois);
65 
66 
67  if (!genfit::MaterialEffects::getInstance()->isInitialized()) {
68  B2FATAL("Material effects not set up. Please use SetupGenfitExtrapolationModule.");
69  }
70 
71 }
72 
74 {
75 
76  B2DEBUG(21, "||| SVDROIFinder Parameters:");
77  B2DEBUG(21, " tolerance: phi = " << m_tolerancePhi);
78  B2DEBUG(21, " z = " << m_toleranceZ);
79  B2DEBUG(21, " n sigma: u = " << m_numSigmaTotU);
80  B2DEBUG(21, " v = " << m_numSigmaTotV);
81  B2DEBUG(21, " systematic: u = " << m_sigmaSystU);
82  B2DEBUG(21, " v = " << m_sigmaSystV);
83  B2DEBUG(21, " max width: u = " << m_maxWidthU);
84  B2DEBUG(21, " v = " << m_maxWidthV);
85 
95 
97 
99 
100 }
101 
102 
104 {
105 
106  if (!m_recotracks.isValid()) {
107  B2DEBUG(21, "RecoTracks array is missing, no SVD ROIs");
108  return;
109  }
110 
111 
112  B2DEBUG(21, "%%%%%%%% Number of RecoTracks in the events = " << m_recotracks.getEntries());
113 
114  RelationArray recoTrackToSVDIntercepts(m_recotracks, m_intercepts);
115  recoTrackToSVDIntercepts.create();
116 
117  RelationArray SVDInterceptsToROIids(m_intercepts, m_rois);
118  SVDInterceptsToROIids.create();
119 
120  m_theSVDInterceptor->fillInterceptList(&m_intercepts, m_recotracks, &recoTrackToSVDIntercepts);
121 
123 
124 }
125 
126 
128 {
129  delete m_theStripTranslator;
130  delete m_theSVDInterceptor;
131 }
132 
133 
135 {
136 }
137 
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.
void fillRoiIDList(StoreArray< SVDIntercept > *listOfIntercepts, StoreArray< ROIid > *ROIidList)
Append the ROIid to the list listToBeFilled.
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.
This Class implements the interceptor of the SVD tracks on the PXD layers.
void fillInterceptList(StoreArray< SVDIntercept > *listToBeFilled, const StoreArray< RecoTrack > &trackList, RelationArray *recoTrackToSVDIntercepts)
Fill the list of PXD intecepts corresponding to the list of track candidates.
double m_maxWidthV
maximum V width of the ROI
std::string m_recoTracksListName
track list name
SVDInterceptor * m_theSVDInterceptor
the svd interceptor object
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
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
ROIStripTranslator * m_theStripTranslator
the strip translator object
double m_sigmaSystV
fixed width to add in quadrature to the extrapolation error and obtain the ROI V width
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
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
REG_MODULE(arichBtest)
Register the Module.
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
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