Belle II Software  release-06-00-14
SVDStripMaskingModule.cc
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 #include <svd/modules/svdReconstruction/SVDStripMaskingModule.h>
10 
11 using namespace Belle2;
12 using namespace std;
13 
14 //-----------------------------------------------------------------
15 // Register the Module
16 //-----------------------------------------------------------------
17 REG_MODULE(SVDStripMasking)
18 
19 //-----------------------------------------------------------------
20 // Implementation
21 //-----------------------------------------------------------------
22 
24 {
25  setDescription("Remove from the SVDShaperDigit list the hot strips read in the SVDHotStripsCalibrations from the DB.");
26  setPropertyFlags(c_ParallelProcessingCertified);
27 
28  addParam("ShaperDigits", m_storeShaperDigitsName,
29  "ShaperDigits collection name", string(""));
30  addParam("ShaperDigitsUnmasked", m_SVDShaperDigitsUnmasked,
31  "Good ShaperDigits collection name, kept", string(""));
32  addParam("ShaperDigitsMasked", m_SVDShaperDigitsMasked,
33  "ShaperDigits collection name", string(""));
34  addParam("createHotStripsList", m_createOutside,
35  "create the StoreArray of hot strips", bool(false));
36 
37 }
38 
39 
40 SVDStripMaskingModule::~SVDStripMaskingModule()
41 {
42 }
43 
44 
46 {
47  m_storeShaper.isRequired(m_storeShaperDigitsName);
48 
49  m_selectorIN.registerSubset(m_storeShaper, m_SVDShaperDigitsUnmasked);
50  // m_selectorIN.inheritAllRelations();
51 
52  if (m_createOutside) {
53  m_selectorOUT.registerSubset(m_storeShaper, m_SVDShaperDigitsMasked);
54  // m_selectorOUT.inheritAllRelations();
55  }
56 
57 }
58 
59 
61 {
62 
63  // If no digits, nothing to do
64  if (!m_storeShaper || !m_storeShaper.getEntries()) return;
65 
66  m_selectorIN.select([&](const SVDShaperDigit * shaper) { return ! m_HotStripsCalib.isHot(shaper->getSensorID(), shaper->isUStrip(), shaper->getCellID());});
67 
68  if (m_createOutside)
69  m_selectorOUT.select([&](const SVDShaperDigit * shaper) { return m_HotStripsCalib.isHot(shaper->getSensorID(), shaper->isUStrip(), shaper->getCellID());});
70 
71  B2DEBUG(27, " shaper digits = " << m_storeShaper.getEntries() <<
72  ", shaper digits Unmasked = " << (((StoreArray<SVDShaperDigit>*)(m_selectorIN.getSubSet()))->getEntries()));
73 
74  if (m_createOutside)
75  B2DEBUG(27, " shaper digits = " << m_storeShaper.getEntries() <<
76  ", shaper digits Unmasked = " << (((StoreArray<SVDShaperDigit>*)(m_selectorIN.getSubSet()))->getEntries()) <<
77  ", shaper digits Masked = " << (((StoreArray<SVDShaperDigit>*)(m_selectorOUT.getSubSet()))->getEntries()));
78 
79 }
80 
81 
82 
Base class for Modules.
Definition: Module.h:72
The SVD ShaperDigit class.
VxdID getSensorID() const
Get the sensor ID.
short int getCellID() const
Get strip ID.
bool isUStrip() const
Get strip direction.
This module removes the strips to be masked read form the SVDHotStripsCalibration.
virtual void initialize() override
Initialize the SVDStripMasking.
virtual void event() override
This method is the core of the SVDStripMasking.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.