File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
DataFormats/Detectors/TOF Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff line change @@ -98,12 +98,26 @@ int Diagnostic::getCrate(ULong64_t pattern) const
9898
9999int 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+
107121void Diagnostic::fill (const Diagnostic& diag)
108122{
109123 LOG (DEBUG) << " Filling diagnostic word" ;
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments