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 "TMath.h"
#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 371 of file QwMollerADC_Channel.cc.

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

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