Skip to content

Commit e39cb68

Browse files
noferinishahor02
authored andcommitted
add multilevel TOF noisy thresholds
1 parent b3ec620 commit e39cb68

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

DataFormats/Detectors/TOF/include/DataFormatsTOF/Diagnostic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Diagnostic
5959
int getSlot(ULong64_t pattern) const;
6060
int getCrate(ULong64_t pattern) const;
6161
int getChannel(ULong64_t pattern) const;
62+
int getNoisyLevel(ULong64_t pattern) const;
6263

6364
private:
6465
std::map<ULong64_t, uint32_t> mVector; // diagnostic frequency vector (key/pattern , frequency)

DataFormats/Detectors/TOF/src/Diagnostic.cxx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,26 @@ int Diagnostic::getCrate(ULong64_t pattern) const
9898

9999
int Diagnostic::getChannel(ULong64_t pattern) const
100100
{
101-
if (getSlot(pattern) == 14 && getCrate(pattern) == 0 && pattern != 0) {
101+
if (getSlot(pattern) == 14) {
102102
return (pattern & 262143);
103103
}
104104
return -1;
105105
}
106106

107+
int Diagnostic::getNoisyLevel(ULong64_t pattern) const
108+
{
109+
if (getChannel(pattern)) {
110+
if (pattern & (1 << 20)) {
111+
return 3;
112+
} else if (pattern & (1 << 19)) {
113+
return 2;
114+
} else {
115+
return 1;
116+
}
117+
}
118+
return 0;
119+
}
120+
107121
void Diagnostic::fill(const Diagnostic& diag)
108122
{
109123
LOG(DEBUG) << "Filling diagnostic word";

Detectors/TOF/base/src/WindowFiller.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,17 @@ void WindowFiller::fillDiagnosticFrequency()
486486

487487
for (int i = 0; i < Geo::NCHANNELS; i++) {
488488
if (mChannelCounts[i] >= masknoise) {
489+
int additionalMask = 0;
490+
491+
if (mChannelCounts[i] >= masknoise * 10) {
492+
additionalMask += (1 << 19); // > 10 kHZ (if masknoise = 1 kHz)
493+
if (mChannelCounts[i] >= masknoise * 100) {
494+
additionalMask += (1 << 20); // > 100 kHZ (if masknoise = 1 kHz)
495+
}
496+
}
497+
489498
//Fill noisy in diagnostic
490-
mDiagnosticFrequency.fillNoisy(i);
499+
mDiagnosticFrequency.fillNoisy(i + additionalMask);
491500
}
492501
}
493502
}

0 commit comments

Comments
 (0)