CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CastorQIECoder Class Reference

#include <CastorQIECoder.h>

Public Member Functions

unsigned adc (const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
 fC + capid [0..3] -> ADC conversion More...
 
 CastorQIECoder (unsigned long fId=0)
 
float charge (const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
 ADC [0..127] + capid [0..3] -> fC conversion. More...
 
float offset (unsigned fCapId, unsigned fRange) const
 
uint32_t rawId () const
 
void setOffset (unsigned fCapId, unsigned fRange, float fValue)
 
void setSlope (unsigned fCapId, unsigned fRange, float fValue)
 
float slope (unsigned fCapId, unsigned fRange) const
 

Private Attributes

uint32_t mId
 
float mOffset00
 
float mOffset01
 
float mOffset02
 
float mOffset03
 
float mOffset10
 
float mOffset11
 
float mOffset12
 
float mOffset13
 
float mOffset20
 
float mOffset21
 
float mOffset22
 
float mOffset23
 
float mOffset30
 
float mOffset31
 
float mOffset32
 
float mOffset33
 
float mSlope00
 
float mSlope01
 
float mSlope02
 
float mSlope03
 
float mSlope10
 
float mSlope11
 
float mSlope12
 
float mSlope13
 
float mSlope20
 
float mSlope21
 
float mSlope22
 
float mSlope23
 
float mSlope30
 
float mSlope31
 
float mSlope32
 
float mSlope33
 

Detailed Description

Author
Panos Katsas (UoA) POOL object to store calibration mode QIE coder parameters for one channel $Id
Fedor Ratnikov (UMd) POOL object to store QIE coder parameters for one channel $Author: ratnikov
Date:
2008/03/05 10:38:03
Revision:
1.9

Modified for CASTOR by L. Mundim

Definition at line 20 of file CastorQIECoder.h.

Constructor & Destructor Documentation

CastorQIECoder::CastorQIECoder ( unsigned long  fId = 0)
inline

Definition at line 22 of file CastorQIECoder.h.

22  : mId (fId), mOffset00(0), mOffset01(0), mOffset02(0),
23  mOffset03(0), mOffset10(0), mOffset11(0), mOffset12(0), mOffset13(0),
24  mOffset20(0), mOffset21(0), mOffset22(0), mOffset23(0), mOffset30(0),
25  mOffset31(0), mOffset32(0), mOffset33(0), mSlope00(0), mSlope01(0),
26  mSlope02(0), mSlope03(0), mSlope10(0), mSlope11(0), mSlope12(0),
27  mSlope13(0), mSlope20(0), mSlope21(0), mSlope22(0), mSlope23(0),
28  mSlope30(0), mSlope31(0), mSlope32(0), mSlope33(0) {};

Member Function Documentation

unsigned CastorQIECoder::adc ( const CastorQIEShape fShape,
float  fCharge,
unsigned  fCapId 
) const

fC + capid [0..3] -> ADC conversion

Definition at line 24 of file CastorQIECoder.cc.

References newFWLiteAna::bin, CastorQIEShape::highEdge(), offset(), and slope().

Referenced by CastorCoderDb::fC2adc_().

24  {
25  // search for the range
26  for (unsigned range = 0; range < 4; range++) {
27  float qieCharge = fCharge * slope (fCapId, range) + offset (fCapId, range);
28  unsigned minBin = 32*range;
29  float qieChargeMax = fShape.highEdge (minBin + 31);
30  if (qieCharge <= qieChargeMax) {
31  for (unsigned bin = minBin; bin <= minBin + 31; bin++) {
32  if (qieCharge < fShape.highEdge (bin)) {
33  return bin;
34  }
35  }
36  return minBin; // underflow
37  }
38  else if (range == 3) {
39  return 127; // overflow
40  }
41  }
42  return 0; //should never get here
43 }
float highEdge(unsigned fAdc) const
float offset(unsigned fCapId, unsigned fRange) const
float slope(unsigned fCapId, unsigned fRange) const
float CastorQIECoder::charge ( const CastorQIEShape fShape,
unsigned  fAdc,
unsigned  fCapId 
) const

ADC [0..127] + capid [0..3] -> fC conversion.

Definition at line 19 of file CastorQIECoder.cc.

References CastorQIEShape::center(), offset(), CastorQIEShape::range(), and slope().

Referenced by CastorCoderDb::adc2fC_(), CastorPedestalsAnalysis::analyze(), reco::castor::getLinearizedADC(), CastorDbService::makeCastorCalibration(), CastorDbService::makeCastorCalibrationWidth(), CastorPedestalAnalysis::per2CapsHists(), and CastorPSMonitor::processEvent().

19  {
20  unsigned range = fShape.range (fAdc);
21  return (fShape.center (fAdc) - offset (fCapId, range)) / slope (fCapId, range);
22 }
unsigned range(unsigned fAdc) const
float center(unsigned fAdc) const
float offset(unsigned fCapId, unsigned fRange) const
float slope(unsigned fCapId, unsigned fRange) const
float CastorQIECoder::offset ( unsigned  fCapId,
unsigned  fRange 
) const

Definition at line 45 of file CastorQIECoder.cc.

References getHLTprescales::index, and mOffset00.

Referenced by adc(), and charge().

45  {
46  return *((&mOffset00) + index (fRange, fCapId));
47 }
uint32_t CastorQIECoder::rawId ( ) const
inline

Definition at line 42 of file CastorQIECoder.h.

References mId.

42 {return mId;}
void CastorQIECoder::setOffset ( unsigned  fCapId,
unsigned  fRange,
float  fValue 
)

Definition at line 53 of file CastorQIECoder.cc.

References dtNoiseDBValidation_cfg::cerr, getHLTprescales::index, and mOffset00.

53  {
54  if (fCapId < 4U && fRange < 4U) { // fCapId >= 0 and fRange >= 0, since fCapId and fRange are unsigned
55  *((&mOffset00) + index (fRange, fCapId)) = fValue;
56  }
57  else {
58  std::cerr << "CastorQIECoder::setOffset-> Wrong parameters capid/range: " << fCapId << '/' << fRange << std::endl;
59  }
60 }
void CastorQIECoder::setSlope ( unsigned  fCapId,
unsigned  fRange,
float  fValue 
)

Definition at line 62 of file CastorQIECoder.cc.

References dtNoiseDBValidation_cfg::cerr, getHLTprescales::index, and mSlope00.

62  {
63  if (fCapId < 4U && fRange < 4U) { // fCapId >= 0 and fRange >= 0, since fCapId and fRange are unsigned
64  *((&mSlope00) + index (fRange, fCapId)) = fValue;
65  }
66  else {
67  std::cerr << "CastorQIECoder::setSlope-> Wrong parameters capid/range: " << fCapId << '/' << fRange << std::endl;
68  }
69 }
float CastorQIECoder::slope ( unsigned  fCapId,
unsigned  fRange 
) const

Definition at line 49 of file CastorQIECoder.cc.

References getHLTprescales::index, and mSlope00.

Referenced by adc(), charge(), Vispa.Views.LineDecayView.DecayLine::containsPoint(), and Vispa.Views.LineDecayView.DecayLine::transform().

49  {
50  return *((&mSlope00) + index (fRange, fCapId));
51 }

Member Data Documentation

uint32_t CastorQIECoder::mId
private

Definition at line 45 of file CastorQIECoder.h.

Referenced by rawId().

float CastorQIECoder::mOffset00
private

Definition at line 46 of file CastorQIECoder.h.

Referenced by offset(), and setOffset().

float CastorQIECoder::mOffset01
private

Definition at line 47 of file CastorQIECoder.h.

float CastorQIECoder::mOffset02
private

Definition at line 48 of file CastorQIECoder.h.

float CastorQIECoder::mOffset03
private

Definition at line 49 of file CastorQIECoder.h.

float CastorQIECoder::mOffset10
private

Definition at line 50 of file CastorQIECoder.h.

float CastorQIECoder::mOffset11
private

Definition at line 51 of file CastorQIECoder.h.

float CastorQIECoder::mOffset12
private

Definition at line 52 of file CastorQIECoder.h.

float CastorQIECoder::mOffset13
private

Definition at line 53 of file CastorQIECoder.h.

float CastorQIECoder::mOffset20
private

Definition at line 54 of file CastorQIECoder.h.

float CastorQIECoder::mOffset21
private

Definition at line 55 of file CastorQIECoder.h.

float CastorQIECoder::mOffset22
private

Definition at line 56 of file CastorQIECoder.h.

float CastorQIECoder::mOffset23
private

Definition at line 57 of file CastorQIECoder.h.

float CastorQIECoder::mOffset30
private

Definition at line 58 of file CastorQIECoder.h.

float CastorQIECoder::mOffset31
private

Definition at line 59 of file CastorQIECoder.h.

float CastorQIECoder::mOffset32
private

Definition at line 60 of file CastorQIECoder.h.

float CastorQIECoder::mOffset33
private

Definition at line 61 of file CastorQIECoder.h.

float CastorQIECoder::mSlope00
private

Definition at line 62 of file CastorQIECoder.h.

Referenced by setSlope(), and slope().

float CastorQIECoder::mSlope01
private

Definition at line 63 of file CastorQIECoder.h.

float CastorQIECoder::mSlope02
private

Definition at line 64 of file CastorQIECoder.h.

float CastorQIECoder::mSlope03
private

Definition at line 65 of file CastorQIECoder.h.

float CastorQIECoder::mSlope10
private

Definition at line 66 of file CastorQIECoder.h.

float CastorQIECoder::mSlope11
private

Definition at line 67 of file CastorQIECoder.h.

float CastorQIECoder::mSlope12
private

Definition at line 68 of file CastorQIECoder.h.

float CastorQIECoder::mSlope13
private

Definition at line 69 of file CastorQIECoder.h.

float CastorQIECoder::mSlope20
private

Definition at line 70 of file CastorQIECoder.h.

float CastorQIECoder::mSlope21
private

Definition at line 71 of file CastorQIECoder.h.

float CastorQIECoder::mSlope22
private

Definition at line 72 of file CastorQIECoder.h.

float CastorQIECoder::mSlope23
private

Definition at line 73 of file CastorQIECoder.h.

float CastorQIECoder::mSlope30
private

Definition at line 74 of file CastorQIECoder.h.

float CastorQIECoder::mSlope31
private

Definition at line 75 of file CastorQIECoder.h.

float CastorQIECoder::mSlope32
private

Definition at line 76 of file CastorQIECoder.h.

float CastorQIECoder::mSlope33
private

Definition at line 77 of file CastorQIECoder.h.