JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwMollerADC_Channel.cc File Reference

Implementation for Moller ADC channel decoding and management. More...

#include "QwMollerADC_Channel.h"
#include <stdexcept>
#include "QwLog.h"
#include "QwUnits.h"
#include "QwBlinder.h"
#include "QwHistogramHelper.h"
+ Include dependency graph for QwMollerADC_Channel.cc:

Go to the source code of this file.

Functions

 __attribute__ ((no_sanitize("signed-integer-overflow"))) void QwMollerADC_Channel
 
std::ostream & operator<< (std::ostream &stream, const QwMollerADC_Channel &channel)
 

Detailed Description

Implementation for Moller ADC channel decoding and management.

Definition in file QwMollerADC_Channel.cc.

Function Documentation

◆ __attribute__()

__attribute__ ( (no_sanitize("signed-integer-overflow")) )

Definition at line 370 of file QwMollerADC_Channel.cc.

371 {
372 fNumberOfSamples = fNumberOfSamples_map;
373 fHardwareBlockSum_raw = 0;
374// Double_t hwsum_test = 0.0;
375// std::cout << "*******In QwMollerADC_Channel::SetRawEventData for channel:\t" << this->GetElementName() << std::endl;
376 for (Int_t i = 0; i < fBlocksPerEvent; i++)
377 {
378 Double_t block_raw = (fBlock[i] / fCalibrationFactor + fPedestal) * fNumberOfSamples / (fBlocksPerEvent * 1.0);
379 if (std::abs(block_raw) >= pow(2,29)) {
380 block_raw = std::copysign(pow(2,29)-1, block_raw);
381 QwWarning << "QwMollerADC_Channel::SetRawEventData: Overflow in conversion to raw data for channel "
382 << this->GetElementName() << ": ("
383 << "fBlock[i] = " << fBlock[i] << " / "
384 << "fCalibrationFactor = " << fCalibrationFactor << " + "
385 << "fPedestal = " << fPedestal << ") * "
386 << "fNumberOfSamples = " << fNumberOfSamples << " / "
387 << "fBlocksPerEvent = " << fBlocksPerEvent << ". "
388 << "Capping value to " << block_raw << "."
389 << QwLog::endl;
390 }
391 fBlock_raw[i] = Int_t(block_raw);
392 fHardwareBlockSum_raw += fBlock_raw[i];
393
394 double_t block = fBlock[i] / fCalibrationFactor;
395 double_t sigma = fMockGaussianSigma / fCalibrationFactor;
396 fBlockSumSq_raw[i] = (sigma*sigma + block*block)*fNumberOfSamples_map / (fBlocksPerEvent * 1.0);
397 fBlock_min[i] = (block - 3.0 * sigma) * double_t(fNumberOfSamples_map) / (fBlocksPerEvent * 1.0);
398 fBlock_max[i] = (block + 3.0 * sigma) * double_t(fNumberOfSamples_map) / (fBlocksPerEvent * 1.0);
399
400 fBlockSumSq_raw[4] += fBlockSumSq_raw[i];
401 fBlock_min[4] = TMath::Min(fBlock_min[i],fBlock_min[4]);
402 fBlock_max[4] = TMath::Max(fBlock_max[i],fBlock_max[4]);
403 }
404
405
406
407 fSoftwareBlockSum_raw = fHardwareBlockSum_raw;
408
409 return;
410}
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297

References QwLog::endl(), and QwWarning.

+ Here is the call graph for this function:

◆ operator<<()

std::ostream & operator<< ( std::ostream & stream,
const QwMollerADC_Channel & channel )

Definition at line 1736 of file QwMollerADC_Channel.cc.

1737{
1738 stream << channel.GetHardwareSum();
1739 return stream;
1740}
Double_t GetHardwareSum() const