CMS 3D CMS Logo

List of all members | Static Public Member Functions
SiPixelGainUtilities Struct Reference

#include <SiPixelGainCalibrationForHLTUtilities.h>

Static Public Member Functions

ALPAKA_FN_HOST_ACC ALPAKA_FN_ACC static ALPAKA_FN_INLINE std::pair< float, float > getPedAndGain (const SiPixelGainCalibrationForHLTSoAConstView &view, uint32_t moduleInd, int col, int row, bool &isDeadColumn, bool &isNoisyColumn)
 

Detailed Description

Definition at line 10 of file SiPixelGainCalibrationForHLTUtilities.h.

Member Function Documentation

◆ getPedAndGain()

ALPAKA_FN_HOST_ACC ALPAKA_FN_ACC static ALPAKA_FN_INLINE std::pair<float, float> SiPixelGainUtilities::getPedAndGain ( const SiPixelGainCalibrationForHLTSoAConstView view,
uint32_t  moduleInd,
int  col,
int  row,
bool &  isDeadColumn,
bool &  isNoisyColumn 
)
inlinestatic

Definition at line 11 of file SiPixelGainCalibrationForHLTUtilities.h.

References ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::ALPAKA_ASSERT_ACC(), cuy::col, mps_fire::end, ALCARECOEcalPhiSym_cff::float, HLT_IsoTrack_cff::offset, alignCSCRings::s, and isotrackNtupler::start.

Referenced by calibPixel::CalibDigis< debug >::operator()().

17  {
18  auto start = view.modStarts()[moduleInd];
19  auto end = view.modEnds()[moduleInd];
20  auto nCols = view.modCols()[moduleInd];
21  // determine what averaged data block we are in (there should be 1 or 2 of these depending on if plaquette is 1 by X or 2 by X
22  unsigned int lengthOfColumnData = (end - start) / nCols;
23  unsigned int lengthOfAveragedDataInEachColumn = 2; // we always only have two values per column averaged block
24  unsigned int numberOfDataBlocksToSkip = row / view.numberOfRowsAveragedOver();
25 
26  auto offset = start + col * lengthOfColumnData + lengthOfAveragedDataInEachColumn * numberOfDataBlocksToSkip;
28  ALPAKA_ASSERT_ACC(offset < 3088384);
29  ALPAKA_ASSERT_ACC(0 == offset % 2);
30 
31  auto lp = view.v_pedestals();
32  auto s = lp[offset / 2];
33 
34  isDeadColumn = (s.ped & 0xFF) == view.deadFlag();
35  isNoisyColumn = (s.ped & 0xFF) == view.noisyFlag();
36  float decodeGain = float(s.gain & 0xFF) * view.gainPrecision() + view.minGain();
37  float decodePed = float(s.ped & 0xFF) * view.pedPrecision() + view.minPed();
38 
39  return std::make_pair(decodePed, decodeGain);
40  };
Definition: start.py:1
col
Definition: cuy.py:1009