9#include <svd/modules/svdReconstruction/SVDMissingAPVsClusterCreatorModule.h>
11#include <framework/datastore/DataStore.h>
12#include <framework/logging/Logger.h>
14#include <vxd/geometry/GeoCache.h>
15#include <svd/geometry/SensorInfo.h>
35 , m_mapping(m_xmlFileName)
38 setDescription(
"This module produces clusters in the middle of a region read by a disabled APV. It can be run only after the SVDClusterizer because it does not register the SVDClusters StoreArray in the DataStore, but only add clusters.");
42 "SVDCluster collection name",
string(
""));
51 addParam(
"nFakeClusters",
m_nFakeClusters,
"number of fake clusters equally distributed in the dead area",
int(4));
59 m_map->prepareListOfMissingAPVs();
60 B2DEBUG(29,
" found a total of " <<
m_map->getNumberOfMissingAPVs() <<
" missing APVs in the channel mapping");
75 B2DEBUG(29,
"SVDMissingAPVsClusterCreator Parameters (in default system unit, *=cannot be set directly):");
77 B2DEBUG(29,
" 1. COLLECTIONS:");
88 for (
int nAPV = 0; nAPV <
m_map->getNumberOfMissingAPVs(); nAPV++) {
98 double pitch = isU ? info.getUPitch(0) : info.getVPitch(0);
100 float halfChip_position = isU ? info.getUCellPosition(floatingStrip) : info.getVCellPosition(floatingStrip);
101 const int Nstrips = 128;
102 float positionError = Nstrips * pitch /
sqrt(12);
116 float chip_halfWidth = pitch * Nstrips / 2;
117 float firstStrip_position = halfChip_position - chip_halfWidth;
120 float fakeCluster_position = firstStrip_position + fakeCluster_width / 2;
122 m_storeClusters.
appendNew(sensorID, isU, fakeCluster_position, positionError, time, timeError, charge, seedCharge, size,
126 fakeCluster_position = fakeCluster_position + fakeCluster_width;
127 m_storeClusters.
appendNew(sensorID, isU, fakeCluster_position, positionError, time, timeError, charge, seedCharge, size,
bool hasChanged()
Check whether the object has changed since the last call to hasChanged of the accessor).
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
std::string getFileName() const
Get the name of the downloaded payload file.
int m_size
size of the cluster
float m_time
time of the cluster, in ns
int m_firstFrame
first frame
virtual void initialize() override
Initialize the module.
virtual void event() override
do the clustering
DBObjPtr< PayloadFile > m_mapping
channel mapping payload
float m_SNR
SNR of the cluster.
static std::string m_xmlFileName
< channel mapping xml filename
float m_charge
total charge of the cluster, in e-
virtual void beginRun() override
check if channel mapping is changed
std::string m_storeClustersName
name of the collection to use for the SVDClusters
float m_timeError
time error of the cluster, in ns
SVDMissingAPVsClusterCreatorModule()
Constructor defining the parameters.
std::unique_ptr< SVDOnlineToOfflineMap > m_map
channel mapping map
float m_seedCharge
seed charge of the cluster, in e-
StoreArray< SVDCluster > m_storeClusters
Collection of SVDClusters.
int m_nFakeClusters
number of fake clusters
const std::string & getName() const
Return name under which the object is saved in the DataStore.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double sqrt(double a)
sqrt for double
Namespace to encapsulate code needed for simulation and reconstrucion of the SVD.
Abstract base class for different kinds of events.
struct to hold missing APVs informations
float m_halfStrip
floating strip in the middle of the APV
VxdID m_sensorID
Sensor ID.
bool m_isUSide
True if u-side of the sensor.