Belle II Software  release-08-01-10
PXDRawHitSorterModule.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 <framework/datastore/StoreArray.h>
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <pxd/dataobjects/PXDRawHit.h>
15 #include <pxd/dataobjects/PXDDigit.h>
16 #include <pxd/dataobjects/PXDDAQStatus.h>
17 #include <string>
18 
19 namespace Belle2 {
24  namespace PXD {
25 
37  class PXDRawHitSorterModule : public Module {
38 
39  public:
42 
44  virtual void initialize() override;
46  virtual void event() override;
47 
48  private:
55 
57  inline bool goodHit(const PXDRawHit* const rawhit) const
58  {
59  short u = rawhit->getColumn();
60  bool goodU = (u == std::min(std::max(u, short(0)), short(249)));
61  short v = rawhit->getRow();
62  bool goodV = (v == std::min(std::max(v, short(0)), short(767)));
63  return (goodU && goodV);
64  }
66  std::string m_storeRawHitsName;
68  std::string m_storeDigitsName;
72  int m_0cut;
75  };//end class declaration
76 
77 
78  } //end PXD namespace;
80 } // end namespace Belle2
81 
Base class for Modules.
Definition: Module.h:72
The PXD Raw Hit class This class stores information about PXD Pixel hits and makes them available in ...
Definition: PXDRawHit.h:24
short getColumn() const
Get u cell id of hit position.
Definition: PXDRawHit.h:76
short getRow() const
Get v cell id of hit position.
Definition: PXDRawHit.h:60
int m_0cut
Minimum charge for a digit to carry.
bool m_trimOutOfRange
Discard out-of-range hits.
virtual void initialize() override
Initialize the module.
bool m_mergeDuplicates
Mode: if true, merge duplicate pixels, otherwise only keep the first.
virtual void event() override
do the sorting
StoreObjPtr< PXDDAQStatus > m_storeDaqStatus
Required input for PXD Daq Status.
std::string m_storeRawHitsName
Name of the collection to use for PXDRawHits.
bool goodHit(const PXDRawHit *const rawhit) const
Utility function to check pixel coordinates.
PXDRawHitSorterModule()
Constructor defining the parameters.
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
StoreArray< PXDRawHit > m_storeRawHits
Required input for PXDRawHit.
StoreArray< PXDDigit > m_storeDigits
Output array for PXDDigits.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.