Belle II Software prerelease-11-00-00a
BadBoardADCDetector Class Referenceabstract

Marks hits as background based on the result of a filter. More...

#include <BadBoardADCDetector.h>

Inheritance diagram for BadBoardADCDetector:
Collaboration diagram for BadBoardADCDetector:

Public Types

using IOTypes
 Types that should be served to apply on invocation.
 
using IOTypes
 Types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 
using IOVectors
 Vector types that should be served to apply on invocation.
 

Public Member Functions

 BadBoardADCDetector ()
 Default constructor.
 
std::string getDescription () final
 Short description of the findlet.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
void initialize () final
 Initialization.
 
void beginRun () final
 begin run
 
void apply (std::vector< TrackingUtilities::CDCWireHit > &wireHits) final
 Main algorithm marking hit as background.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector
 Short hand for ToRangeImpl.
 
using ToVector
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = Findlet<TrackingUtilities::CDCWireHit&>
 Type of the base class.
 

Private Attributes

int m_badADCaverageMin = 1000
 Min ADC value for the average.
 
int m_badADCaverageMax = 0
 Max ADC value for the average.
 
int m_badTOTaverageMin = 15
 Min TOT value for the average.
 
DBObjPtr< CDCBadBoardsm_badBoardsFromDB
 Pointer to the CDCBadBoards payload.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happened before.
 
bool m_initialized
 Flag to keep track whether initialization happened before.
 
bool m_terminated = false
 Flag to keep track whether termination happened before.
 
bool m_terminated
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Marks hits as background based on the result of a filter.

Definition at line 28 of file BadBoardADCDetector.h.

Member Typedef Documentation

◆ IOTypes [1/2]

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOTypes [2/2]

using IOTypes
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors [1/2]

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ IOVectors [2/2]

using IOVectors
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Super

using Super = Findlet<TrackingUtilities::CDCWireHit&>
private

Type of the base class.

Definition at line 32 of file BadBoardADCDetector.h.

◆ ToVector [1/2]

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

◆ ToVector [2/2]

using ToVector
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ BadBoardADCDetector()

Default constructor.

Definition at line 22 of file BadBoardADCDetector.cc.

23{
24}

Member Function Documentation

◆ addProcessingSignalListener() [1/2]

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 55 of file CompositeProcessingSignalListener.cc.

56{
58}
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
References to subordinary signal processing listener contained in this findlet.

◆ addProcessingSignalListener() [2/2]

void addProcessingSignalListener ( ProcessingSignalListener * psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 53 of file CompositeProcessingSignalListener.cc.

56{
58}
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition Findlet.h:26

◆ apply()

void apply ( std::vector< TrackingUtilities::CDCWireHit > & wireHits)
final

Main algorithm marking hit as background.

Definition at line 60 of file BadBoardADCDetector.cc.

61{
62 CDC::CDCGeometryPar& geometryPar = CDC::CDCGeometryPar::Instance();
63 // first loop: average ADC per board
64 std::map <int, double> BoardADC;
65 std::map <int, double> BoardTOT;
66 std::map <int, int> BoardCount;
67 for (auto& wireHit : wireHits) {
68 auto board = geometryPar.getBoardID(wireHit.getWireID());
69 BoardCount[board] += 1;
70 BoardADC[board] += (*wireHit.getHit()).getADCCount();
71 BoardTOT[board] += (*wireHit.getHit()).getTOT();
72 };
73 // now compute the averages:
74 for (auto& pair : BoardADC) {
75 int board = pair.first;
76 BoardADC[board] /= BoardCount[board];
77 BoardTOT[board] /= BoardCount[board];
78 }
79
80 // second loop, set flag if board is problematic:
81 for (auto& wireHit : wireHits) {
82 auto board = geometryPar.getBoardID(wireHit.getWireID());
83 if ((BoardADC[board] > m_badADCaverageMin) || (BoardADC[board] <= m_badADCaverageMax))
84 wireHit->setBoardWithBadADCFlag();
85 if (BoardTOT[board] > m_badTOTaverageMin)
86 wireHit->setBoardWithBadTOTFlag();
87 }
88
89 // 3rd loop, over all boards, update list of them. Include boards with no hits at all
90 Belle2::TrackingUtilities::StoreWrappedObjPtr< std::vector<unsigned int> > storeVector("CDCDeadBoardsVector");
91
92 storeVector.create();
93
94 // TODO: decide if need the dead boards from the payload. Should be not possible that this method fails to detect those!?
95 double dummyEff = 0; // needed by isDeadBoard function else unused
96 // Note that board 0 is absent, the loop starts from 1.
97 for (unsigned int iBoard = 1; iBoard < c_nBoards; iBoard += 1) {
98 if (BoardCount.find(iBoard) == BoardCount.end() || m_badBoardsFromDB->isDeadBoard(iBoard, dummyEff)) {
99 storeVector->push_back(iBoard);
100 }
101 }
102}
unsigned short getBoardID(const WireID &wID) const
Returns frontend board id. corresponding to the wire id.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
int m_badTOTaverageMin
Min TOT value for the average.
int m_badADCaverageMin
Min ADC value for the average.
DBObjPtr< CDCBadBoards > m_badBoardsFromDB
Pointer to the CDCBadBoards payload.
int m_badADCaverageMax
Max ADC value for the average.

◆ beginEvent() [1/2]

void beginEvent ( )
overridevirtualinherited

Receive and dispatch signal for the start of a new event.

Reimplemented from ProcessingSignalListener.

Reimplemented in DATCONFPGAFindlet, SpacePointTagger< AResult, ACluster >, SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, MonopoleStereoHitFinder, MonopoleStereoHitFinderQuadratic, SegmentCreatorMCTruth, SegmentFinderFacetAutomaton, SegmentTrackCombiner, SegmentTrackTruthVarSet, StereoHitFinder, StereoHitTruthVarSet, TrackFinderAutomaton, TrackFinderSegmentPairAutomaton, TrackFinderSegmentTripleAutomaton, TruthAxialSegmentPairVarSet, TruthSegmentVarSet, TruthTrackVarSet, WireHitMCMultiLoopBlocker, FindletStoreArrayInput< TWrappedFindlet >, SharingHitsMatcher< ACollectorItem, ACollectionItem >, SharingHitsMatcher< Belle2::TrackingUtilities::CDCTrack, Belle2::TrackingUtilities::CDCSegment2D >, StoreVectorSwapper< IOType, a_alwaysWrite >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCFacet >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCSegment2D >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCSegmentPair >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCSegmentTriple >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCTrack >, StoreVectorSwapper< Belle2::TrackingUtilities::CDCWireHit, true >, RecoTrackStorer, ROIFinder, and SVDHoughTracking.

Definition at line 31 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
virtual void beginEvent()
Receive signal for the start of a new event.
ProcessingSignalListener()
Allow default construction.

◆ beginEvent() [2/2]

void beginEvent ( )
overrideinherited

Receive and dispatch signal for the start of a new event.

Definition at line 36 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
void beginEvent() override
Receive and dispatch signal for the start of a new event.

◆ beginRun()

void beginRun ( )
finalvirtual

begin run

Reimplemented from ProcessingSignalListener.

Definition at line 32 of file BadBoardADCDetector.cc.

33{
34 // checking validity once per run should be sufficient
35 if (not m_badBoardsFromDB.isValid()) B2FATAL("CDCBadBoards payload not found!");
36}

◆ endRun() [1/2]

void endRun ( )
overridevirtualinherited

Receive and dispatch signal for the end of the run.

Reimplemented from ProcessingSignalListener.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
virtual void endRun()
Receive signal for the end of the run.

◆ endRun() [2/2]

void endRun ( )
overrideinherited

Receive and dispatch signal for the end of the run.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

◆ exposeParameters()

void exposeParameters ( ModuleParamList * moduleParamList,
const std::string & prefix )
finalvirtual

Expose the parameters to a module.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 43 of file BadBoardADCDetector.cc.

45{
46 moduleParamList->addParameter(TrackingUtilities::prefixed(prefix, "badADCaverageMin"),
48 "Minimal value of average ADC to consider board bad",
50 moduleParamList->addParameter(TrackingUtilities::prefixed(prefix, "badADCaverageMax"),
52 "Maximal value of average ADC to consider a board as bad",
54 moduleParamList->addParameter(TrackingUtilities::prefixed(prefix, "badTOTaverageMin"),
56 "Minimal value of average TOT to consider board bad",
58}
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ getDescription()

std::string getDescription ( )
finalvirtual

Short description of the findlet.

Reimplemented from Findlet< TrackingUtilities::CDCWireHit & >.

Definition at line 38 of file BadBoardADCDetector.cc.

39{
40 return "Detect boards with bad ADC values and mark hits accordingly";
41}

◆ getNProcessingSignalListener() [1/2]

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ getNProcessingSignalListener() [2/2]

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 56 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
finalvirtual

Initialization.

Reimplemented from ProcessingSignalListener.

Definition at line 26 of file BadBoardADCDetector.cc.

27{
28 Belle2::TrackingUtilities::StoreWrappedObjPtr< std::vector<unsigned int> > storeVector("CDCDeadBoardsVector");
29 storeVector.registerInDataStore();
30}

◆ terminate() [1/2]

◆ terminate() [2/2]

void terminate ( )
overrideinherited

Receive and dispatch Signal for termination of the event processing.

Definition at line 42 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
void terminate() override
Receive and dispatch Signal for termination of the event processing.

Member Data Documentation

◆ m_badADCaverageMax

int m_badADCaverageMax = 0
private

Max ADC value for the average.

Definition at line 60 of file BadBoardADCDetector.h.

◆ m_badADCaverageMin

int m_badADCaverageMin = 1000
private

Min ADC value for the average.

Definition at line 57 of file BadBoardADCDetector.h.

◆ m_badBoardsFromDB

DBObjPtr<CDCBadBoards> m_badBoardsFromDB
private

Pointer to the CDCBadBoards payload.

Definition at line 66 of file BadBoardADCDetector.h.

◆ m_badTOTaverageMin

int m_badTOTaverageMin = 15
private

Min TOT value for the average.

Definition at line 63 of file BadBoardADCDetector.h.

◆ m_initialized [1/2]

bool m_initialized
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initialized [2/2]

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs [1/2]

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_initializedAs [2/2]

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_subordinaryProcessingSignalListeners [1/2]

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 60 of file CompositeProcessingSignalListener.h.

◆ m_subordinaryProcessingSignalListeners [2/2]

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 60 of file CompositeProcessingSignalListener.h.

◆ m_terminated [1/2]

bool m_terminated
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_terminated [2/2]

bool m_terminated = false
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.


The documentation for this class was generated from the following files: