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 | exposeParameters (ModuleParamList *moduleParamList __attribute__((unused)), const std::string &prefix __attribute__((unused))) |
| Forward prefixed parameters of this findlet to the module parameter list.
|
|
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 36 of file AsicBackgroundDetector.h.
◆ applyAsicFilter()
void applyAsicFilter |
( |
std::vector< CDCWireHit * > & |
wireHits | ) |
|
|
private |
Algorithm marking hit as background for each CDC ASIC.
This is abnormal situation, detected for few runs, related to CDC unpacker. Hits are to be marked as background.
Definition at line 95 of file AsicBackgroundDetector.cc.
102 if (wireHits.size() > 8) {
103 B2ERROR(
"Number of hits per asic should not exceed 8, observe too many hits." <<
LogVar(
"nHits", wireHits.size()));
105 for (
auto& hit : wireHits) {
106 (*hit)->setBackgroundFlag();
107 (*hit)->setTakenFlag();
112 B2ASSERT(
"Number of hits per asic should be above 0 and can not exceed 8",
113 (wireHits.size() <= 8) && (wireHits.size() > 0));
117 for (
auto& hit : wireHits) {
118 short tdc = hit->getHit()->getTDCCount();
119 times.push_back(tdc);
121 sort(times.begin(), times.end());
122 int mid = times.size() / 2;
123 double median = times.size() % 2 == 0 ? (times[mid] + times[mid - 1]) / 2 : times[mid];
128 int adcOffMedian = 0;
129 for (
auto& hit : wireHits) {
130 int adc = hit->getHit()->getADCCount();
133 if (adc > adcOnMedian) adcOnMedian = adc;
135 if (adc > adcOffMedian) adcOffMedian = adc;
139 if ((nbg < times.size())
142 && (adcOnMedian < adcOffMedian)
146 for (
auto& hit : wireHits) {
148 (*hit)->setBackgroundFlag();
149 (*hit)->setTakenFlag();
The documentation for this class was generated from the following files: