Belle II Software  release-08-01-10
PXDDigitSorterModule.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 <pxd/dataobjects/PXDDigit.h>
13 #include <string>
14 #include <algorithm>
15 
16 namespace Belle2 {
21  namespace PXD {
22 
34  class PXDDigitSorterModule : public Module {
35 
36  public:
39 
41  virtual void initialize() override;
43  virtual void event() override;
44 
45  private:
47  inline bool goodDigit(const PXDDigit* const digit) const
48  {
49  short u = digit->getUCellID();
50  bool goodU = (u == std::min(std::max(u, short(0)), short(249)));
51  short v = digit->getVCellID();
52  bool goodV = (v == std::min(std::max(v, short(0)), short(767)));
53  return (goodU && goodV);
54  }
55 
57  std::string m_storeDigitsName;
59  std::string m_storeTrueHitsName;
65  std::string m_relDigitTrueHitName;
67  std::vector<PXDDigit> m_digitcopy;
72  };//end class declaration
73 
74 
75  } //end PXD namespace;
77 } // end namespace Belle2
Base class for Modules.
Definition: Module.h:72
The PXD digit class.
Definition: PXDDigit.h:27
unsigned short getVCellID() const
Get cell ID in v.
Definition: PXDDigit.h:74
unsigned short getUCellID() const
Get cell ID in u.
Definition: PXDDigit.h:69
PXDDigitSorterModule()
Constructor defining the parameters.
virtual void initialize() override
Initialize the module.
bool m_mergeDuplicates
Mode: if true, merge duplicate pixels, otherwise delete all but the first occurence.
std::string m_relDigitMCParticleName
Name of the relation between PXDDigits and MCParticles.
virtual void event() override
do the sorting
std::string m_storeTrueHitsName
Name of the collection to use for the PXDTrueHits.
std::string m_storeMCParticlesName
Name of the collection to use for the MCParticles.
std::vector< PXDDigit > m_digitcopy
Copy of the Digits needed for sorting.
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
bool goodDigit(const PXDDigit *const digit) const
Utility function to check pixel coordinates.
std::string m_relDigitTrueHitName
Name of the relation between PXDDigits and PXDTrueHits.
bool m_trimDigits
if true, check digit data and discard malformed digits.
Abstract base class for different kinds of events.