Marks hits as background based on the result of a filter.
More...
#include <AsicBackgroundDetector.h>
|
using | IOTypes = std::tuple< AIOTypes... > |
| Types that should be served to apply on invokation.
|
|
using | IOVectors = std::tuple< std::vector< AIOTypes >... > |
| Vector types that should be served to apply on invokation.
|
|
|
| AsicBackgroundDetector ()=default |
| Default constructor.
|
|
void | initialize () final |
| Access database here:
|
|
void | beginRun () final |
| Reload channel map if needed.
|
|
std::string | getDescription () final |
| Short description of the findlet.
|
|
virtual void | exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final |
| Expose the parameters to a module.
|
|
virtual void | apply (std::vector< 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 | 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.
|
|
|
using | ToVector = typename ToVectorImpl< T >::Type |
| Short hand for ToRangeImpl.
|
|
Marks hits as background based on the result of a filter.
Definition at line 26 of file AsicBackgroundDetector.h.
◆ applyAsicFilter()
void applyAsicFilter |
( |
std::vector< CDCWireHit * > & |
wireHits | ) |
|
|
private |
Algorithm marking hit as background for each CDC ASIC.
Extra information:
This is abnormal situation, detected for few runs, related to CDC unpacker. Hits are to be marked as background.
Definition at line 93 of file AsicBackgroundDetector.cc.
100 if (wireHits.size() > 8) {
102 auto eWire = wireHits[0]->getWireID().getEWire();
103 auto board =
m_map[eWire].first;
106 B2ERROR(
"Number of hits per asic should not exceed 8, observe too many hits."
107 <<
LogVar(
"nHits", wireHits.size())
108 <<
LogVar(
"Board ID", board));
111 B2WARNING(
"Number of hits per asic should not exceed 8, observe too many hits."
112 <<
LogVar(
"nHits", wireHits.size())
113 <<
LogVar(
"Board ID", board));
117 for (
auto& hit : wireHits) {
118 (*hit)->setBackgroundFlag();
119 (*hit)->setTakenFlag();
126 for (
auto& hit : wireHits) {
127 short tdc = hit->getHit()->getTDCCount();
128 times.push_back(tdc);
130 sort(times.begin(), times.end());
131 int mid = times.size() / 2;
132 double median = times.size() % 2 == 0 ? (times[mid] + times[mid - 1]) / 2 : times[mid];
136 int adcOffMedian = 0;
137 for (
auto& hit : wireHits) {
138 int adc = hit->getHit()->getADCCount();
141 if (adc > adcOnMedian) adcOnMedian = adc;
143 if (adc > adcOffMedian) adcOffMedian = adc;
147 if ((nbg < times.size())
150 && (adcOnMedian < adcOffMedian)
154 for (
auto& hit : wireHits) {
156 (*hit)->setBackgroundFlag();
157 (*hit)->setTakenFlag();
double m_deviation_from_median
distance from median TDC, to be considered as bg.
size_t m_nsignal_max
max. number of signal-like hits in ASIC for background check
std::map< int, std::pair< int, int > > m_map
map from ewire to board/channel ID
size_t m_max_asic_error_messages
max. number of logged error messages for number of hits per ASIC check
size_t m_minimal_hit_number
min. number of hits in ASIC for background check
Class to store variables with their name which were sent to the logging service.
The documentation for this class was generated from the following files: