Belle II Software  release-08-01-10
PXDRawHitMaskingModule.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 <pxd/dataobjects/PXDRawHit.h>
14 #include <string>
15 
16 namespace Belle2 {
21  namespace PXD {
22 
34  class PXDRawHitMaskingModule : public Module {
35 
36  public:
39 
41  virtual void initialize() override;
43  virtual void event() override;
44 
45  private:
49  inline bool goodHit(const PXDRawHit& rawhit) const
50  {
51  short u = rawhit.getColumn();
52  bool goodU = (u == std::min(std::max(u, short(0)), short(249)));
53  short v = rawhit.getRow();
54  bool goodV = (v == std::min(std::max(v, short(0)), short(767)));
55  return (goodU && goodV);
56  }
58  std::string m_storeRawHitsName;
60  std::string m_storeRawHitsNameOut;
62  int m_0cut;
65  };//end class declaration
66 
67 
68  } //end PXD namespace;
70 } // end namespace Belle2
71 
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.
StoreArray< PXDRawHit > m_pxdRawHit
Required input for PXDRawHit.
virtual void initialize() override
Initialize the module.
virtual void event() override
do the filtering
PXDRawHitMaskingModule()
Constructor defining the parameters.
std::string m_storeRawHitsNameOut
Name of the collection to use for Output PXDRawHits.
std::string m_storeRawHitsName
Name of the collection to use for PXDRawHits.
bool goodHit(const PXDRawHit &rawhit) const
Utility function to check pixel coordinates.
StoreArray< PXDRawHit > m_pxdRawHitOut
Required output for PXDRawHit.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.