Belle II Software  release-05-02-19
PXDClusterizerModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <pxd/modules/pxdReconstruction/PXDClusterizerModule.h>
12 
13 #include <framework/datastore/DataStore.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/datastore/RelationArray.h>
16 #include <framework/logging/Logger.h>
17 
18 #include <vxd/geometry/GeoCache.h>
19 
20 #include <mdst/dataobjects/MCParticle.h>
21 #include <pxd/dataobjects/PXDDigit.h>
22 #include <pxd/dataobjects/PXDCluster.h>
23 #include <pxd/dataobjects/PXDTrueHit.h>
24 #include <pxd/geometry/SensorInfo.h>
25 
26 #include <pxd/reconstruction/PXDClusterPositionEstimator.h>
27 
28 using namespace std;
29 using namespace Belle2;
30 using namespace Belle2::PXD;
31 
32 //-----------------------------------------------------------------
33 // Register the Module
34 //-----------------------------------------------------------------
35 REG_MODULE(PXDClusterizer);
36 
37 //-----------------------------------------------------------------
38 // Implementation
39 //-----------------------------------------------------------------
40 
41 PXDClusterizerModule::PXDClusterizerModule() : Module()
42  , m_elNoise(0.7), m_cutSeed(5.0), m_cutAdjacent(3.0), m_cutCluster(8.0)
43  , m_cutAdjacentSignal(0), m_sizeHeadTail(3), m_clusterCacheSize(0)
44 {
45  //Set module properties
46  setDescription("Cluster PXDHits");
48 
49  addParam("ElectronicNoise", m_elNoise,
50  "Noise added by the electronics, set in ADU", m_elNoise);
51  addParam("NoiseSN", m_cutAdjacent,
52  "SN for digits to be considered for clustering", m_cutAdjacent);
53  addParam("SeedSN", m_cutSeed, "SN for digits to be considered as seed",
54  m_cutSeed);
55  addParam("ClusterSN", m_cutCluster, "Minimum SN for clusters", m_cutCluster);
56  addParam("ClusterCacheSize", m_clusterCacheSize,
57  "Maximum desired number of sensor rows", 0);
58  addParam("HeadTailSize", m_sizeHeadTail,
59  "Minimum cluster size to switch to Analog head tail algorithm for cluster center",
61  addParam("Digits", m_storeDigitsName, "Digits collection name", string(""));
62  addParam("Clusters", m_storeClustersName, "Cluster collection name",
63  string(""));
64  addParam("TrueHits", m_storeTrueHitsName, "TrueHit collection name",
65  string(""));
66  addParam("MCParticles", m_storeMCParticlesName, "MCParticles collection name",
67  string(""));
68 
69 }
70 
72 {
73  //Register collections
78 
79  storeClusters.registerInDataStore(DataStore::c_ErrorIfAlreadyRegistered);
80  storeDigits.isRequired();
81  storeTrueHits.isOptional();
82  storeMCParticles.isOptional();
83 
84  RelationArray relClusterDigits(storeClusters, storeDigits);
85  RelationArray relClusterTrueHits(storeClusters, storeTrueHits);
86  RelationArray relClusterMCParticles(storeClusters, storeMCParticles);
87  RelationArray relDigitMCParticles(storeDigits, storeMCParticles);
88  RelationArray relDigitTrueHits(storeDigits, storeTrueHits);
89 
90  relClusterDigits.registerInDataStore();
91  //Relations to Simulation objects are only needed if the parent one already
92  //exists
93  if (relDigitTrueHits.isOptional()) {
94  relClusterTrueHits.registerInDataStore();
95  }
96  if (relDigitMCParticles.isOptional()) {
97  relClusterMCParticles.registerInDataStore();
98  }
99 
100  //Now save all names to speed creation later, mainly if they had default names
101  m_storeClustersName = storeClusters.getName();
102  m_storeDigitsName = storeDigits.getName();
103  m_storeTrueHitsName = storeTrueHits.getName();
104  m_storeMCParticlesName = storeMCParticles.getName();
105 
106  m_relClusterDigitName = relClusterDigits.getName();
107  m_relClusterTrueHitName = relClusterTrueHits.getName();
108  m_relClusterMCParticleName = relClusterMCParticles.getName();
109  m_relDigitTrueHitName = relDigitTrueHits.getName();
110  m_relDigitMCParticleName = relDigitMCParticles.getName();
111 
112  B2DEBUG(20,
113  "PXDClusterizer Parameters (in default system units, *=cannot be set directly):");
114  B2DEBUG(20, " --> ElectronicNoise: " << m_elNoise);
115  B2DEBUG(20, " --> NoiseSN: " << m_cutAdjacent);
116  B2DEBUG(20, " --> SeedSN: " << m_cutSeed);
117  B2DEBUG(20, " --> ClusterSN: " << m_cutCluster);
118  B2DEBUG(20,
119  " --> MCParticles: " << DataStore::arrayName<MCParticle>(m_storeMCParticlesName));
120  B2DEBUG(20,
121  " --> Digits: " << DataStore::arrayName<PXDDigit>(m_storeDigitsName));
122  B2DEBUG(20,
123  " --> Clusters: " << DataStore::arrayName<PXDCluster>(m_storeClustersName));
124  B2DEBUG(20,
125  " --> TrueHits: " << DataStore::arrayName<PXDTrueHit>(m_storeTrueHitsName));
126  B2DEBUG(20, " --> DigitMCRel: " << m_relDigitMCParticleName);
127  B2DEBUG(20, " --> ClusterMCRel: " << m_relClusterMCParticleName);
128  B2DEBUG(20, " --> ClusterDigitRel: " << m_relClusterDigitName);
129  B2DEBUG(20, " --> DigitTrueRel: " << m_relDigitTrueHitName);
130  B2DEBUG(20, " --> ClusterTrueRel: " << m_relClusterTrueHitName);
131 
132 
135  if (m_clusterCacheSize > 0)
136  m_cache = std::unique_ptr<ClusterCache>(new ClusterCache(m_clusterCacheSize));
137  else
138  m_cache = std::unique_ptr<ClusterCache>(new ClusterCache());
139 }
140 
142 {
143  const StoreArray<MCParticle> storeMCParticles(m_storeMCParticlesName);
144  const StoreArray<PXDTrueHit> storeTrueHits(m_storeTrueHitsName);
145  const StoreArray<PXDDigit> storeDigits(m_storeDigitsName);
147 
148  storeClusters.clear();
149 
150  RelationArray relClusterMCParticle(storeClusters, storeMCParticles,
152  if (relClusterMCParticle) relClusterMCParticle.clear();
153 
154  RelationArray relClusterDigit(storeClusters, storeDigits,
156  if (relClusterDigit) relClusterDigit.clear();
157 
158  RelationArray relClusterTrueHit(storeClusters, storeTrueHits,
160  if (relClusterTrueHit) relClusterTrueHit.clear();
161 
162  int nPixels = storeDigits.getEntries();
163  if (nPixels == 0)
164  return;
165 
166  //Build lookup tables for relations
167  RelationArray relDigitMCParticle(storeDigits, storeMCParticles, m_relDigitMCParticleName);
168  RelationArray relDigitTrueHit(storeDigits, storeTrueHits, m_relDigitTrueHitName);
169  createRelationLookup(relDigitMCParticle, m_mcRelation, storeDigits.getEntries());
170  createRelationLookup(relDigitTrueHit, m_trueRelation, storeDigits.getEntries());
171 
172  m_cache->clear();
173 
174  //We require all pixels are already sorted and directly cluster them. Once
175  //the sensorID changes, we write out all existing clusters and continue.
176  VxdID sensorID(0);
177  //To check sorting
178  Pixel lastPixel;
179  for (int i = 0; i < nPixels; i++) {
180  const PXDDigit* const storeDigit = storeDigits[i];
181  Pixel px(storeDigit, i);
182  //New sensor, write clusters
183  if (sensorID != storeDigit->getSensorID()) {
184  writeClusters(sensorID);
185  sensorID = storeDigit->getSensorID();
186  //Load the correct noise map for the new sensor
187  m_noiseMap.setSensorID(sensorID);
188  } else if (px <= lastPixel) {
189  //Check for sorting as precaution
190  B2FATAL("Pixels are not sorted correctly, please include the "
191  "PXDDigitSorter module before running the Clusterizer or fix "
192  "the input to be ordered by v,u in ascending order");
193  }
194  //Remember last pixel to check sorting
195  lastPixel = px;
196 
197  //Ignore digits with not enough signal. Has to be done after the check of
198  //the SensorID to make sure we compare to the correct noise level
199  if (!m_noiseMap(px, m_cutAdjacent)) continue;
200 
201  // TODO: If we would like to cluster across dead channels we would need a
202  // sorted list of dead pixels. Assuming we have such a list m_deadChannels
203  // containing Pixel instances with all dead channels of this sensor and
204  // m_currentDeadChannel is an iterator to that list (initialized to
205  // begin(m_deadChannels) when the sensorID changes), we would do
206  //
207  // while(m_currentDeadChannel != end(m_deadChannels) && *m_currentDeadChannel < px){
208  // m_cache->findCluster(m_currentDeadChannel->getU(), m_currentDeadChannel->getV());
209  // m_currentDeadChannel++;
210  // }
211  //
212  // This would have the effect of marking the pixel address as belonging
213  // to a cluster but would not modify the clusters itself (except for
214  // possible merging of clusters) so we would end up with clusters that
215  // contain holes or are disconnected.
216 
217  // Find correct cluster and add pixel to cluster
218  try {
219  m_cache->findCluster(px.getU(), px.getV()).add(px);
220  } catch (std::out_of_range& e) {
221  B2WARNING("PXD clustering: Ignoring pixel " << px.getU() << "," << px.getV() << ": " << e.what());
222  }
223  }
224  writeClusters(sensorID);
225 }
226 
227 void PXDClusterizerModule::createRelationLookup(const RelationArray& relation, RelationLookup& lookup, size_t digits)
228 {
229  lookup.clear();
230  //If we don't have a relation we don't build a lookuptable
231  if (!relation) return;
232  //Resize to number of digits and set all values
233  lookup.resize(digits);
234  for (const RelationElement& element : relation) {
235  lookup[element.getFromIndex()] = &element;
236  }
237 }
238 
239 void PXDClusterizerModule::fillRelationMap(const RelationLookup& lookup, std::map<unsigned int, float>& relation,
240  unsigned int index)
241 {
242  //If the lookup table is not empty and the element is set
243  if (!lookup.empty() && lookup[index]) {
244  const RelationElement& element = *lookup[index];
245  const unsigned int size = element.getSize();
246  //Add all Relations to the map
247  for (unsigned int i = 0; i < size; ++i) {
248  //negative weights are from ignored particles, we don't like them and
249  //thus ignore them :D
250  if (element.getWeight(i) < 0) continue;
251  relation[element.getToIndex(i)] += element.getWeight(i);
252  }
253  }
254 }
255 
257 {
258  if (m_cache->empty())
259  return;
260 
261  //Get all datastore elements
262  const StoreArray<MCParticle> storeMCParticles(m_storeMCParticlesName);
263  const StoreArray<PXDDigit> storeDigits(m_storeDigitsName);
264  const StoreArray<PXDTrueHit> storeTrueHits(m_storeTrueHitsName);
266  RelationArray relClusterMCParticle(storeClusters, storeMCParticles,
268  RelationArray relClusterDigit(storeClusters, storeDigits,
270  RelationArray relClusterTrueHit(storeClusters, storeTrueHits,
272 
273  //Get Geometry information
274  const SensorInfo& info = dynamic_cast<const SensorInfo&>(VXD::GeoCache::get(
275  sensorID));
276 
277  map<unsigned int, float> mc_relations;
278  map<unsigned int, float> truehit_relations;
279  vector<pair<unsigned int, float> > digit_weights;
280 
281 
282  for (ClusterCandidate& cls : *m_cache) {
283  //Check for noise cuts
284  if (!(cls.size() > 0 && m_noiseMap(cls.getCharge(), m_cutCluster) && m_noiseMap(cls.getSeed(), m_cutSeed))) continue;
285 
286  double rho(0);
287  ClusterProjection projU, projV;
288  mc_relations.clear();
289  truehit_relations.clear();
290  digit_weights.clear();
291  digit_weights.reserve(cls.size());
292 
293  const Pixel& seed = cls.getSeed();
294 
295  for (const PXD::Pixel& px : cls.pixels()) {
296  //Add the Pixel information to the two projections
297  projU.add(px.getU(), info.getUCellPosition(px.getU()), px.getCharge());
298  projV.add(px.getV(), info.getVCellPosition(px.getV()), px.getCharge());
299 
300  //Obtain relations from MCParticles
301  fillRelationMap(m_mcRelation, mc_relations, px.getIndex());
302  //Obtain relations from PXDTrueHits
303  fillRelationMap(m_trueRelation, truehit_relations, px.getIndex());
304  //Save the weight of the digits for the Cluster->Digit relation
305  digit_weights.emplace_back(px.getIndex(), px.getCharge());
306  }
307  projU.finalize();
308  projV.finalize();
309 
310  const double pitchU = info.getUPitch();
311  const double pitchV = info.getVPitch(projV.getPos());
312  // Calculate shape correlation coefficient: only for non-trivial shapes
313  if (projU.getSize() > 1 && projV.getSize() > 1) {
314  // Add in-pixel position noise to smear the correlation
315  double posUU = cls.getCharge() * pitchU * pitchU / 12.0;
316  double posVV = cls.getCharge() * pitchV * pitchV / 12.0;
317  double posUV(0);
318  for (const Pixel& px : cls.pixels()) {
319  const double du = info.getUCellPosition(px.getU()) - projU.getPos();
320  const double dv = info.getVCellPosition(px.getV()) - projV.getPos();
321  posUU += px.getCharge() * du * du;
322  posVV += px.getCharge() * dv * dv;
323  posUV += px.getCharge() * du * dv;
324  }
325  rho = posUV / sqrt(posUU * posVV);
326  }
327 
328  //Calculate position and error with u as primary axis, fixed pitch size
329  calculatePositionError(cls, projU, projV, pitchU, pitchU, pitchU);
330  //Calculate position and error with v as primary axis, possibly different pitch sizes
331  calculatePositionError(cls, projV, projU, info.getVPitch(projV.getMinPos()), pitchV, info.getVPitch(projV.getMaxPos()));
332 
333  TVector3 lorentzShift = info.getLorentzShift(projU.getPos(), projV.getPos());
334  projU.setPos(projU.getPos() - lorentzShift.X());
335  projV.setPos(projV.getPos() - lorentzShift.Y());
336  B2DEBUG(20, "Lorentz shift: " << lorentzShift.X() << " " << lorentzShift.Y());
337 
338  // Pre classification of cluster looking at pitch type of pixels and if they touch sensor edges
339  int clusterkind = PXDClusterPositionEstimator::getInstance().getClusterkind(cls.pixels(), sensorID);
340 
341  // Compute sorted set of pixel
342  // FIXME: I am not 100% sure if cls.pixels() are sorted => ask PeterQ or Martin Ritter
343  set<Pixel> pixelSet(cls.pixels().begin(), cls.pixels().end());
344 
345  // Compute classifier variables needed for later retrival of position correction in PXD CKF
346  vector<float> sectorEtaValues = {0, 0, 0, 0};
347  sectorEtaValues[0] = PXDClusterPositionEstimator::getInstance().computeEta(pixelSet, projV.getMinCell(), projV.getSize(), +1.0,
348  +1.0);
349  sectorEtaValues[1] = PXDClusterPositionEstimator::getInstance().computeEta(pixelSet, projV.getMinCell(), projV.getSize(), -1.0,
350  +1.0);
351  sectorEtaValues[2] = PXDClusterPositionEstimator::getInstance().computeEta(pixelSet, projV.getMinCell(), projV.getSize(), -1.0,
352  -1.0);
353  sectorEtaValues[3] = PXDClusterPositionEstimator::getInstance().computeEta(pixelSet, projV.getMinCell(), projV.getSize(), +1.0,
354  -1.0);
355 
356  vector<int> sectorShapeIndices = { -1, -1, -1, -1};
357  sectorShapeIndices[0] = PXDClusterPositionEstimator::getInstance().computeShapeIndex(pixelSet, projU.getMinCell(),
358  projV.getMinCell(), projV.getSize(), +1.0, +1.0);
359  sectorShapeIndices[1] = PXDClusterPositionEstimator::getInstance().computeShapeIndex(pixelSet, projU.getMinCell(),
360  projV.getMinCell(), projV.getSize(), -1.0, +1.0);
361  sectorShapeIndices[2] = PXDClusterPositionEstimator::getInstance().computeShapeIndex(pixelSet, projU.getMinCell(),
362  projV.getMinCell(), projV.getSize(), -1.0, -1.0);
363  sectorShapeIndices[3] = PXDClusterPositionEstimator::getInstance().computeShapeIndex(pixelSet, projU.getMinCell(),
364  projV.getMinCell(), projV.getSize(), +1.0, -1.0);
365 
366  //Store Cluster into Datastore ...
367  int clsIndex = storeClusters.getEntries();
368  storeClusters.appendNew(sensorID, projU.getPos(), projV.getPos(), projU.getError(), projV.getError(),
369  rho, cls.getCharge(), seed.getCharge(),
370  cls.size(), projU.getSize(), projV.getSize(), projU.getMinCell(), projV.getMinCell(), clusterkind,
371  sectorEtaValues, sectorShapeIndices
372  );
373 
374  //Create Relations to this Digit
375  if (!mc_relations.empty()) relClusterMCParticle.add(clsIndex, mc_relations.begin(), mc_relations.end());
376  if (!truehit_relations.empty()) relClusterTrueHit.add(clsIndex, truehit_relations.begin(), truehit_relations.end());
377  relClusterDigit.add(clsIndex, digit_weights.begin(), digit_weights.end());
378  }
379 
380  m_cache->clear();
381 }
382 
384  const ClusterProjection& secondary, double minPitch, double centerPitch, double maxPitch)
385 {
386  if (primary.getSize() >= static_cast<unsigned int>(m_sizeHeadTail)) { //Analog head tail
387  //Average charge in the central area
388  const double centerCharge = primary.getCenterCharge() / (primary.getSize() - 2);
389  const double minCharge = (primary.getMinCharge() < centerCharge) ? primary.getMinCharge() : centerCharge;
390  const double maxCharge = (primary.getMaxCharge() < centerCharge) ? primary.getMaxCharge() : centerCharge;
391  primary.setPos(0.5 * (primary.getMinPos() + primary.getMaxPos()
392  + (maxCharge * maxPitch - minCharge * minPitch) / centerCharge));
393  const double snHead = centerCharge / m_cutAdjacentSignal / minPitch;
394  const double snTail = centerCharge / m_cutAdjacentSignal / maxPitch;
395  const double landauHead = minCharge / centerCharge * minPitch;
396  const double landauTail = maxCharge / centerCharge * maxPitch;
397  primary.setError(0.5 * sqrt(1.0 / snHead / snHead + 1.0 / snTail / snTail
398  + 0.5 * landauHead * landauHead + 0.5 * landauTail * landauTail));
399  } else if (primary.getSize() <= 2) { // Add a phantom charge to second strip
400  primary.setError(centerPitch * (secondary.getSize() + 2) * m_cutAdjacentSignal / (primary.getCharge() +
401  (secondary.getSize() + 3) * m_cutAdjacentSignal));
402  } else {
403  const double sn = cls.getSeedCharge() / m_elNoise;
404  primary.setError(2.0 * centerPitch / sn);
405  }
406 }
Belle2::StoreArray::appendNew
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:256
Belle2::RelationArray::clear
void clear() override
Clear all elements from the relation.
Definition: RelationArray.h:279
Belle2::RelationArray
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:72
Belle2::PXD::PXDClusterizerModule::m_cache
std::unique_ptr< ClusterCache > m_cache
cache of the last seen clusters to speed up clustering
Definition: PXDClusterizerModule.h:138
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::PXD::PXDClusterizerModule::m_cutAdjacent
double m_cutAdjacent
Noise cut in sigma.
Definition: PXDClusterizerModule.h:108
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::PXD::ClusterCandidate
Class representing a possible cluster during clustering of the PXD It supports merging of different c...
Definition: ClusterCandidate.h:41
Belle2::PXD::PXDClusterizerModule::m_relDigitTrueHitName
std::string m_relDigitTrueHitName
Name of the relation between PXDDigits and PXDTrueHits.
Definition: PXDClusterizerModule.h:128
Belle2::VXD::GeoCache::get
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:141
Belle2::PXD::NoiseMap::setSensorID
virtual void setSensorID(VxdID)
Set the sensorID currently used.
Definition: NoiseMap.h:49
Belle2::PXD::ClusterProjection::getMinPos
double getMinPos() const
Return the position of the minimum cell of the cluster.
Definition: ClusterProjection.h:79
Belle2::PXD::PXDClusterizerModule::m_elNoise
double m_elNoise
Noise in ADU.
Definition: PXDClusterizerModule.h:104
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module::c_ParallelProcessingCertified
@ 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:82
Belle2::PXD::ClusterCandidate::getSeedCharge
float getSeedCharge() const
get the seed charge of the cluster
Definition: ClusterCandidate.h:88
Belle2::PXD::PXDClusterizerModule::m_relClusterMCParticleName
std::string m_relClusterMCParticleName
Name of the relation between PXDClusters and MCParticles.
Definition: PXDClusterizerModule.h:124
Belle2::PXD::ClusterProjection::getMinCharge
double getMinCharge() const
Return the charge in the minimum cell of the cluster.
Definition: ClusterProjection.h:73
Belle2::PXD::PXDClusterizerModule::RelationLookup
std::vector< const RelationElement * > RelationLookup
Container for a RelationArray Lookup table.
Definition: PXDClusterizerModule.h:57
Belle2::PXD::PXDClusterizerModule::m_cutAdjacentSignal
double m_cutAdjacentSignal
Signal in ADU for Adjacent cut, basically m_elNoise*m_cutAdjacent.
Definition: PXDClusterizerModule.h:112
Belle2::PXD::PXDClusterPositionEstimator::computeShapeIndex
int computeShapeIndex(const std::set< Pixel > &pixels, int uStart, int vStart, int vSize, double thetaU, double thetaV) const
Return the shape index of the pixels.
Definition: PXDClusterPositionEstimator.cc:190
Belle2::StoreAccessorBase::isOptional
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
Definition: StoreAccessorBase.h:95
Belle2::PXD::Pixel
Class to represent one pixel, used in clustering for fast access.
Definition: Pixel.h:47
Belle2::StoreAccessorBase::getName
const std::string & getName() const
Return name under which the object is saved in the DataStore.
Definition: StoreAccessorBase.h:130
Belle2::PXD::ClusterProjection::getMaxCharge
double getMaxCharge() const
Return the charge in the maximum cell of the cluster.
Definition: ClusterProjection.h:75
Belle2::PXD::PXDClusterizerModule::calculatePositionError
void calculatePositionError(const ClusterCandidate &cls, ClusterProjection &primary, const ClusterProjection &secondary, double minPitch, double centerPitch, double maxPitch)
Calculate position and error for a given cluster.
Definition: PXDClusterizerModule.cc:383
Belle2::PXD::PXDClusterizerModule::m_relClusterDigitName
std::string m_relClusterDigitName
Name of the relation between PXDClusters and PXDDigits.
Definition: PXDClusterizerModule.h:126
Belle2::PXD::ClusterProjection::getMinCell
unsigned int getMinCell() const
Return the minimum cell part of the cluster.
Definition: ClusterProjection.h:67
Belle2::StoreAccessorBase::registerInDataStore
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Definition: StoreAccessorBase.h:54
Belle2::PXD::ClusterProjection::setError
void setError(double error)
Set the error of the cluster.
Definition: ClusterProjection.h:86
Belle2::PXD::PXDClusterizerModule::m_storeTrueHitsName
std::string m_storeTrueHitsName
Name of the collection to use for the PXDTrueHits.
Definition: PXDClusterizerModule.h:118
Belle2::PXD::PXDClusterizerModule::m_mcRelation
RelationLookup m_mcRelation
Lookup table for PXDDigit->MCParticle relation.
Definition: PXDClusterizerModule.h:143
Belle2::PXDDigit
The PXD digit class.
Definition: PXDDigit.h:38
Belle2::PXD::ClusterProjection::getSize
unsigned int getSize() const
Return the projected size of the cluster.
Definition: ClusterProjection.h:65
Belle2::PXD::PXDClusterizerModule::m_relDigitMCParticleName
std::string m_relDigitMCParticleName
Name of the relation between PXDDigits and MCParticles.
Definition: PXDClusterizerModule.h:122
Belle2::PXD::PXDClusterPositionEstimator::getInstance
static PXDClusterPositionEstimator & getInstance()
Main (and only) way to access the PXDClusterPositionEstimator.
Definition: PXDClusterPositionEstimator.cc:51
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::RelationElement
Class to store a single element of a relation.
Definition: RelationElement.h:33
Belle2::PXD::PXDClusterizerModule::m_cutCluster
double m_cutCluster
Cluster cut in sigma.
Definition: PXDClusterizerModule.h:110
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::PXD::NoiseMap::setNoiseLevel
void setNoiseLevel(float noise)
Set the noise level.
Definition: NoiseMap.h:44
Belle2::PXDDigit::getSensorID
VxdID getSensorID() const
Get the sensor ID.
Definition: PXDDigit.h:75
Belle2::PXD::ClusterProjection::getCenterCharge
double getCenterCharge() const
Return the center charge of the cluster, that is total charge minus minimum and maximum cell charge.
Definition: ClusterProjection.h:77
Belle2::PXD::PXDClusterizerModule::writeClusters
void writeClusters(VxdID sensorID)
Write clusters to collection.
Definition: PXDClusterizerModule.cc:256
Belle2::PXD::ClusterProjection::add
void add(unsigned int cell, float position, float charge)
Add Pixel information to the projection.
Definition: ClusterProjection.h:112
Belle2::PXD::SensorInfo
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
Definition: SensorInfo.h:34
Belle2::PXD
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Definition: PXDCalibrationUtilities.h:28
Belle2::PXD::ClusterProjection::getPos
double getPos() const
Return the projected position of the cluster.
Definition: ClusterProjection.h:61
Belle2::PXD::PXDClusterizerModule::m_cutSeed
double m_cutSeed
Seed cut in sigma.
Definition: PXDClusterizerModule.h:106
Belle2::StoreArray::clear
void clear() override
Delete all entries in this array.
Definition: StoreArray.h:217
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXD::PXDClusterPositionEstimator::getClusterkind
int getClusterkind(const PXDCluster &cluster) const
Return kind of cluster needed to find cluster position correction.
Definition: PXDClusterPositionEstimator.cc:228
Belle2::PXD::PXDClusterizerModule::m_clusterCacheSize
int m_clusterCacheSize
Size of cluster Cache (0 = default)
Definition: PXDClusterizerModule.h:136
Belle2::PXD::ClusterProjection::getMaxPos
double getMaxPos() const
Return the position of the maximum cell of the cluster.
Definition: ClusterProjection.h:81
Belle2::PXD::ClusterCache
Class to remember recently assigned clusters This class will remember the current and the last pixel ...
Definition: ClusterCache.h:88
Belle2::PXD::PXDClusterizerModule::m_storeDigitsName
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
Definition: PXDClusterizerModule.h:114
Belle2::PXD::PXDClusterizerModule::createRelationLookup
void createRelationLookup(const RelationArray &relation, RelationLookup &lookup, size_t digits)
Create lookup maps for Relations We do not use the RelationIndex as we know much more about the relat...
Definition: PXDClusterizerModule.cc:227
Belle2::RelationArray::add
void add(index_type from, index_type to, weight_type weight=1.0)
Add a new element to the relation.
Definition: RelationArray.h:291
Belle2::PXD::PXDClusterizerModule::initialize
virtual void initialize() override
Initialize the module.
Definition: PXDClusterizerModule.cc:71
Belle2::PXD::Pixel::getV
unsigned short getV() const
Return the CellID in v.
Definition: Pixel.h:79
Belle2::DataStore::c_ErrorIfAlreadyRegistered
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition: DataStore.h:74
Belle2::PXD::ClusterProjection::getError
double getError() const
Return the error of the cluster.
Definition: ClusterProjection.h:63
Belle2::Module::addParam
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:562
Belle2::PXD::ClusterProjection::finalize
void finalize()
Finish calculation of center of gravity and set correct cluster size.
Definition: ClusterProjection.h:54
Belle2::PXD::ClusterProjection
Helper struct to collect information about the 1D projection of a Pixel cluster.
Definition: ClusterProjection.h:37
Belle2::PXD::Pixel::getU
unsigned short getU() const
Return the CellID in u.
Definition: Pixel.h:77
Belle2::PXD::PXDClusterPositionEstimator::computeEta
float computeEta(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV) const
Return the normed charge ratio between head and tail pixels (size>=2) or the charge of the seed (size...
Definition: PXDClusterPositionEstimator.cc:84
Belle2::PXD::PXDClusterizerModule::m_trueRelation
RelationLookup m_trueRelation
Lookup table for PXDDigit->PXDTrueHit relation.
Definition: PXDClusterizerModule.h:145
Belle2::PXD::ClusterProjection::setPos
void setPos(double pos)
Set the position of the cluster.
Definition: ClusterProjection.h:84
Belle2::PXD::PXDClusterizerModule::event
virtual void event() override
do the clustering
Definition: PXDClusterizerModule.cc:141
Belle2::StoreArray< PXDCluster >
Belle2::PXD::PXDClusterizerModule::m_noiseMap
NoiseMap m_noiseMap
Noise map for the currently active sensor.
Definition: PXDClusterizerModule.h:140
Belle2::PXD::PXDClusterizerModule::m_sizeHeadTail
int m_sizeHeadTail
Size of the cluster at which we switch from Center of Gravity to Analog Head Tail.
Definition: PXDClusterizerModule.h:133
Belle2::PXD::ClusterProjection::getCharge
double getCharge() const
Return the total charge of the cluster.
Definition: ClusterProjection.h:71
Belle2::PXD::PXDClusterizerModule::fillRelationMap
void fillRelationMap(const RelationLookup &lookup, std::map< unsigned int, float > &relation, unsigned int index)
Add the relation from a given PXDDigit index to a map.
Definition: PXDClusterizerModule.cc:239
Belle2::StoreArray::getEntries
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:226
Belle2::PXD::PXDClusterizerModule::m_storeMCParticlesName
std::string m_storeMCParticlesName
Name of the collection to use for the MCParticles.
Definition: PXDClusterizerModule.h:120
Belle2::PXD::PXDClusterizerModule::m_storeClustersName
std::string m_storeClustersName
Name of the collection to use for the PXDClusters.
Definition: PXDClusterizerModule.h:116
Belle2::PXD::PXDClusterizerModule::m_relClusterTrueHitName
std::string m_relClusterTrueHitName
Name of the relation between PXDClusters and PXDTrueHits.
Definition: PXDClusterizerModule.h:130