CMS 3D CMS Logo

Namespaces | Functions | Variables
CastorSimpleRecAlgo.cc File Reference
#include "RecoLocalCalo/CastorReco/interface/CastorSimpleRecAlgo.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CalibCalorimetry/CastorCalib/interface/CastorTimeSlew.h"
#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Namespaces

 CastorSimpleRecAlgoImpl
 

Functions

template<class Digi , class RecHit >
bool CastorSimpleRecAlgoImpl::corrSaturation (RecHit &rechit, const CastorCoder &coder, const CastorCalibrations &calibs, const Digi &digi, const int &maxADCvalue, const double &satCorrConst, int ifirst, int n)
 
template<class Digi >
bool CastorSimpleRecAlgoImpl::isSaturated (const Digi &digi, const int &maxADCvalue, int ifirst, int n)
 
template<class Digi , class RecHit >
RecHit CastorSimpleRecAlgoImpl::reco (const Digi &digi, const CastorCoder &coder, const CastorCalibrations &calibs, int ifirst, int n, bool slewCorrect, const CastorPulseContainmentCorrection *corr, CastorTimeSlew::BiasSetting slewFlavor)
 
static float timeshift_ns_hf (float wpksamp)
 Same as above, but for the HF PMTs. More...
 

Variables

static const float actual_ns_hf [num_bins_hf]
 
constexpr double MaximumFractionalError = 0.0005
 
static const int num_bins_hf = 100
 
static const float scale_hf = 0.999301
 
static const float wpksamp0_hf = 0.500635
 

Function Documentation

◆ timeshift_ns_hf()

float timeshift_ns_hf ( float  wpksamp)
static

Same as above, but for the HF PMTs.

Timeshift correction for HPDs based on the position of the peak ADC measurement. Allows for an accurate determination of the relative phase of the pulse shape from the HPD. Calculated based on a weighted sum of the -1,0,+1 samples relative to the peak as follows: wpksamp = (0*sample[0] + 1*sample[1] + 2*sample[2]) / (sample[0] + sample[1] + sample[2]) where sample[1] is the maximum ADC sample value.

Definition at line 300 of file CastorSimpleRecAlgo.cc.

300  {
301  float flx = (num_bins_hf * (wpksamp - wpksamp0_hf) / scale_hf);
302  int index = (int)flx;
303  float yval;
304 
305  if (index < 0)
306  return actual_ns_hf[0];
307  else if (index >= num_bins_hf - 1)
308  return actual_ns_hf[num_bins_hf - 1];
309 
310  // else interpolate:
311  float y1 = actual_ns_hf[index];
312  float y2 = actual_ns_hf[index + 1];
313 
314  // float delta_x = 1/(float)num_bins_hf;
315  // yval = y1 + (y2-y1)*(flx-(float)index)/delta_x;
316 
317  yval = y1 + (y2 - y1) * (flx - (float)index);
318  return yval;
319 }

References actual_ns_hf, createfilelist::int, num_bins_hf, scale_hf, wpksamp0_hf, testProducerWithPsetDescEmpty_cfi::y1, and testProducerWithPsetDescEmpty_cfi::y2.

Referenced by CastorSimpleRecAlgoImpl::reco().

Variable Documentation

◆ actual_ns_hf

const float actual_ns_hf[num_bins_hf]
static

Definition at line 197 of file CastorSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

◆ MaximumFractionalError

constexpr double MaximumFractionalError = 0.0005
constexpr

Definition at line 8 of file CastorSimpleRecAlgo.cc.

Referenced by CastorSimpleRecAlgo::CastorSimpleRecAlgo().

◆ num_bins_hf

const int num_bins_hf = 100
static

Definition at line 195 of file CastorSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

◆ scale_hf

const float scale_hf = 0.999301
static

Definition at line 194 of file CastorSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

◆ wpksamp0_hf

const float wpksamp0_hf = 0.500635
static

Definition at line 193 of file CastorSimpleRecAlgo.cc.

Referenced by timeshift_ns_hf().

actual_ns_hf
static const float actual_ns_hf[num_bins_hf]
Definition: CastorSimpleRecAlgo.cc:197
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
scale_hf
static const float scale_hf
Definition: CastorSimpleRecAlgo.cc:194
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
num_bins_hf
static const int num_bins_hf
Definition: CastorSimpleRecAlgo.cc:195
createfilelist.int
int
Definition: createfilelist.py:10
wpksamp0_hf
static const float wpksamp0_hf
Definition: CastorSimpleRecAlgo.cc:193
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46