/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Classes | Public Member Functions | Private Attributes
DynChgCorrUtil Class Reference

#include <DynChgCorrUtil.h>

Collaboration diagram for DynChgCorrUtil:
Collaboration graph
[legend]

List of all members.

Classes

struct  ChannelData

Public Member Functions

 DynChgCorrUtil (GaudiTool *parentTool, IPmtCalibSvc *calibSvc)
double getBias (int pmtIdx, const DayaBay::DetectorSensor &detSens, double rawChg, int trigSec, int trigNanoSec, double hitOffsetNanoSec, ServiceMode svcMode)

Private Attributes

GaudiTool * parentTool
IPmtCalibSvcm_calibSvc
ChannelData m_chData [NUM_PMTS]

Detailed Description

Definition at line 13 of file DynChgCorrUtil.h.


Constructor & Destructor Documentation

DynChgCorrUtil::DynChgCorrUtil ( GaudiTool *  parentTool,
IPmtCalibSvc calibSvc 
) [inline]

Definition at line 16 of file DynChgCorrUtil.h.

    : parentTool(parentTool), m_calibSvc(calibSvc) {}

Member Function Documentation

double DynChgCorrUtil::getBias ( int  pmtIdx,
const DayaBay::DetectorSensor detSens,
double  rawChg,
int  trigSec,
int  trigNanoSec,
double  hitOffsetNanoSec,
ServiceMode  svcMode 
)

Definition at line 16 of file DynChgCorrUtil.cc.

{
  if (pmtIdx < 0 || pmtIdx > 191)
    return 0;

  double corr = 0;              // the correction

  ChannelData& chData = m_chData[pmtIdx];
  if (chData.prevHitChg == 0) {
    const PedBiasCalibData *calibData
      = m_calibSvc->pedBiasCalibData(detSens, svcMode);
    if (!calibData)
      parentTool->error() << "Can't get PedBiasCalibData!" << std::endl;
      
    chData.fn = ShapedPulseFn(*calibData);
  }

  else {
    double dt = (trigSec - chData.prevTrigSec) * 1e9
      + (trigNanoSec - chData.prevTrigNanoSec)
      + (hitOffsetNanoSec - chData.prevHitOffsetNanoSec);

    if (dt < DTIME_THRESHOLD) {
      corr = chData.fn.eval(chData.prevHitChg, dt);

      parentTool->debug() << "Applying charge correction for pmt #"
                          << pmtIdx+1 << ": " << "dt=" << dt << ", "
                          << "prevChg=" << chData.prevHitChg << ", "
                          << "corr=" << corr << endreq;
    }
  }

  chData.prevTrigSec = trigSec;
  chData.prevTrigNanoSec = trigNanoSec;
  chData.prevHitOffsetNanoSec = hitOffsetNanoSec;
  chData.prevHitChg = rawChg - corr;

  return corr;
}

Member Data Documentation

GaudiTool* DynChgCorrUtil::parentTool [private]

Definition at line 24 of file DynChgCorrUtil.h.

Definition at line 25 of file DynChgCorrUtil.h.

Definition at line 37 of file DynChgCorrUtil.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:14:11 for CalibAlg by doxygen 1.7.4