Belle II Software  release-05-01-25
PXDRawHitSorterModule.h
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 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <pxd/dataobjects/PXDRawHit.h>
17 #include <pxd/dataobjects/PXDDigit.h>
18 #include <pxd/dataobjects/PXDDAQStatus.h>
19 #include <string>
20 
21 namespace Belle2 {
26  namespace PXD {
27 
39  class PXDRawHitSorterModule : public Module {
40 
41  public:
44 
46  virtual void initialize() override;
48  virtual void event() override;
49 
50  private:
52  StoreArray<PXDRawHit> m_storeRawHits;
54  StoreObjPtr<PXDDAQStatus> m_storeDaqStatus;
56  StoreArray<PXDDigit> m_storeDigits;
57 
59  inline bool goodHit(const PXDRawHit* const rawhit) const
60  {
61  short u = rawhit->getColumn();
62  bool goodU = (u == std::min(std::max(u, short(0)), short(249)));
63  short v = rawhit->getRow();
64  bool goodV = (v == std::min(std::max(v, short(0)), short(767)));
65  return (goodU && goodV);
66  }
68  std::string m_storeRawHitsName;
70  std::string m_storeDigitsName;
72  bool m_mergeDuplicates;
74  int m_0cut;
77  };//end class declaration
78 
79 
80  } //end PXD namespace;
82 } // end namespace Belle2
83 
Belle2::PXD::PXDRawHitSorterModule::m_storeDigitsName
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
Definition: PXDRawHitSorterModule.h:78
Belle2::PXD::PXDRawHitSorterModule::initialize
virtual void initialize() override
Initialize the module.
Definition: PXDRawHitSorterModule.cc:53
Belle2::PXD::PXDRawHitSorterModule::m_mergeDuplicates
bool m_mergeDuplicates
Mode: if true, merge duplicate pixels, otherwise only keep the first.
Definition: PXDRawHitSorterModule.h:80
Belle2::PXD::PXDRawHitSorterModule::m_trimOutOfRange
bool m_trimOutOfRange
Discard out-of-range hits.
Definition: PXDRawHitSorterModule.h:84
Belle2::PXD::PXDRawHitSorterModule::event
virtual void event() override
do the sorting
Definition: PXDRawHitSorterModule.cc:63
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXD::PXDRawHitSorterModule::m_storeRawHits
StoreArray< PXDRawHit > m_storeRawHits
Required input for PXDRawHit.
Definition: PXDRawHitSorterModule.h:60
Belle2::PXD::PXDRawHitSorterModule::m_storeDigits
StoreArray< PXDDigit > m_storeDigits
Output array for PXDDigits.
Definition: PXDRawHitSorterModule.h:64
Belle2::PXD::PXDRawHitSorterModule::PXDRawHitSorterModule
PXDRawHitSorterModule()
Constructor defining the parameters.
Definition: PXDRawHitSorterModule.cc:36
Belle2::PXD::PXDRawHitSorterModule::m_storeRawHitsName
std::string m_storeRawHitsName
Name of the collection to use for PXDRawHits.
Definition: PXDRawHitSorterModule.h:76
Belle2::PXD::PXDRawHitSorterModule::m_0cut
int m_0cut
Minimum charge for a digit to carry.
Definition: PXDRawHitSorterModule.h:82
Belle2::PXD::PXDRawHitSorterModule::goodHit
bool goodHit(const PXDRawHit *const rawhit) const
Utility function to check pixel coordinates.
Definition: PXDRawHitSorterModule.h:67
Belle2::PXD::PXDRawHitSorterModule::m_storeDaqStatus
StoreObjPtr< PXDDAQStatus > m_storeDaqStatus
Required input for PXD Daq Status.
Definition: PXDRawHitSorterModule.h:62