Belle II Software development
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
16namespace Belle2 {
21 namespace PXD {
22
32
33 public:
36
38 virtual void initialize() override;
40 virtual void event() override;
41
42 private:
44 inline bool goodDigit(const PXDDigit* const digit) const
45 {
46 short u = digit->getUCellID();
47 bool goodU = (u == std::min(std::max(u, short(0)), short(249)));
48 short v = digit->getVCellID();
49 bool goodV = (v == std::min(std::max(v, short(0)), short(767)));
50 return (goodU && goodV);
51 }
52
54 std::string m_storeDigitsName;
64 std::vector<PXDDigit> m_digitcopy;
69 };//end class declaration
70
71
72 } //end PXD namespace;
74} // 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.