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