CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
HcalSimParameters Class Reference

#include <HcalSimParameters.h>

Inheritance diagram for HcalSimParameters:
CaloSimParameters

Public Member Functions

int delayQIE () const
 
bool doSiPMSmearing () const
 
bool doTimeSmear () const
 
double fCtoGeV (const DetId &detId) const
 
 HcalSimParameters (double simHitToPhotoelectrons, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase, int firstRing, const std::vector< double > &samplingFactors, double sipmTau)
 
 HcalSimParameters (const edm::ParameterSet &p)
 
double photoelectronsToAnalog (const DetId &detId) const override
 
int pixels (const DetId &detId) const
 
virtual double samplingFactor (const DetId &detId) const
 
void setDbService (const HcalDbService *service)
 
unsigned int signalShape (const DetId &detId) const
 
double simHitToPhotoelectrons (const DetId &detId) const override
 
double sipmCrossTalk (const DetId &detId) const
 
double sipmDarkCurrentuA (const DetId &detId) const
 
std::vector< float > sipmNonlinearity (const DetId &detId) const
 
double sipmTau () const
 
double threshold_currentTDC () const
 
double timeSmearRMS (double ampl) const
 
 ~HcalSimParameters () override
 
- Public Member Functions inherited from CaloSimParameters
int binOfMaximum () const
 
 CaloSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
 
 CaloSimParameters (const edm::ParameterSet &p, bool skipPe2Fc=false)
 
bool doPhotostatistics () const
 whether or not to apply Poisson statistics to photoelectrons More...
 
double photoelectronsToAnalog () const
 the factor which goes from photoelectrons to whatever gets read by ADCs More...
 
int readoutFrameSize () const
 for now, the LinearFrames and trhe digis will be one-to-one. More...
 
void setBinOfMaximum (int binOfMax)
 
void setReadoutFrameSize (int frameSize)
 some datamixing apps need this to be set dynamically More...
 
double simHitToPhotoelectrons () const
 
bool syncPhase () const
 
double timePhase () const
 the adjustment you need to apply to get the signal where you want it More...
 
virtual ~CaloSimParameters ()
 

Private Member Functions

void defaultTimeSmearing ()
 

Private Attributes

int delayQIE_
 
bool doTimeSmear_
 
const HcalDbServicetheDbService
 
int theFirstRing
 
std::vector< double > theSamplingFactors
 
const HcalSiPMCharacteristicstheSiPMcharacteristics
 
bool theSiPMSmearing
 
double theSiPMTau
 
HcalTimeSmearSettings theSmearSettings
 
double threshold_currentTDC_
 

Friends

class HcalSimParameterMap
 

Detailed Description

Definition at line 10 of file HcalSimParameters.h.

Constructor & Destructor Documentation

◆ HcalSimParameters() [1/2]

HcalSimParameters::HcalSimParameters ( double  simHitToPhotoelectrons,
double  samplingFactor,
double  timePhase,
int  readoutFrameSize,
int  binOfMaximum,
bool  doPhotostatistics,
bool  syncPhase,
int  firstRing,
const std::vector< double > &  samplingFactors,
double  sipmTau 
)

Definition at line 12 of file HcalSimParameters.cc.

References defaultTimeSmearing(), and theSiPMSmearing.

23  0.0,
25  timePhase,
29  syncPhase),
30  theDbService(nullptr),
31  theSiPMcharacteristics(nullptr),
34  theSiPMSmearing(false),
35  doTimeSmear_(true),
38 
39  edm::LogInfo("HcalSimParameters:") << " doSiPMsmearing = " << theSiPMSmearing;
40 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
int binOfMaximum() const
bool doPhotostatistics() const
whether or not to apply Poisson statistics to photoelectrons
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
virtual double samplingFactor(const DetId &detId) const
double simHitToPhotoelectrons() const
double timePhase() const
the adjustment you need to apply to get the signal where you want it
std::vector< double > theSamplingFactors
bool syncPhase() const
Log< level::Info, false > LogInfo
const HcalDbService * theDbService
double sipmTau() const

◆ HcalSimParameters() [2/2]

HcalSimParameters::HcalSimParameters ( const edm::ParameterSet p)

Definition at line 42 of file HcalSimParameters.cc.

References defaultTimeSmearing(), and theSiPMSmearing.

43  : CaloSimParameters(p, true),
44  theDbService(nullptr),
45  theFirstRing(p.getParameter<int>("firstRing")),
46  theSamplingFactors(p.getParameter<std::vector<double> >("samplingFactors")),
47  theSiPMSmearing(p.getParameter<bool>("doSiPMSmearing")),
48  doTimeSmear_(p.getParameter<bool>("timeSmearing")),
49  theSiPMTau(p.getParameter<double>("sipmTau")),
50  threshold_currentTDC_(p.getParameter<double>("threshold_currentTDC")),
51  delayQIE_(p.getParameter<int>("delayQIE")) {
53 
54  edm::LogInfo("HcalSimParameters:") << " doSiPMsmearing = " << theSiPMSmearing;
55 }
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
std::vector< double > theSamplingFactors
Log< level::Info, false > LogInfo
const HcalDbService * theDbService

◆ ~HcalSimParameters()

HcalSimParameters::~HcalSimParameters ( )
inlineoverride

Definition at line 24 of file HcalSimParameters.h.

24 {}

Member Function Documentation

◆ defaultTimeSmearing()

void HcalSimParameters::defaultTimeSmearing ( )
private

Definition at line 108 of file HcalSimParameters.cc.

References GeV2fC, and theSmearSettings.

Referenced by HcalSimParameters().

108  {
109  // GeV->ampl (fC), time (ns)
110  theSmearSettings.emplace_back(4.00 * GeV2fC, 4.050);
111  theSmearSettings.emplace_back(20.00 * GeV2fC, 3.300);
112  theSmearSettings.emplace_back(25.00 * GeV2fC, 2.925);
113  theSmearSettings.emplace_back(30.00 * GeV2fC, 2.714);
114  theSmearSettings.emplace_back(37.00 * GeV2fC, 2.496);
115  theSmearSettings.emplace_back(44.50 * GeV2fC, 2.278);
116  theSmearSettings.emplace_back(56.00 * GeV2fC, 2.138);
117  theSmearSettings.emplace_back(63.50 * GeV2fC, 2.022);
118  theSmearSettings.emplace_back(81.00 * GeV2fC, 1.788);
119  theSmearSettings.emplace_back(88.50 * GeV2fC, 1.695);
120  theSmearSettings.emplace_back(114.50 * GeV2fC, 1.716);
121  theSmearSettings.emplace_back(175.50 * GeV2fC, 1.070);
122  theSmearSettings.emplace_back(350.00 * GeV2fC, 1.564);
123  theSmearSettings.emplace_back(99999.00 * GeV2fC, 1.564);
124 }
static const double GeV2fC
HcalTimeSmearSettings theSmearSettings

◆ delayQIE()

int HcalSimParameters::delayQIE ( ) const
inline

Definition at line 43 of file HcalSimParameters.h.

References delayQIE_.

43 { return delayQIE_; }

◆ doSiPMSmearing()

bool HcalSimParameters::doSiPMSmearing ( ) const
inline

Definition at line 42 of file HcalSimParameters.h.

References theSiPMSmearing.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

42 { return theSiPMSmearing; }

◆ doTimeSmear()

bool HcalSimParameters::doTimeSmear ( ) const
inline

Definition at line 37 of file HcalSimParameters.h.

References doTimeSmear_.

37 { return doTimeSmear_; }

◆ fCtoGeV()

double HcalSimParameters::fCtoGeV ( const DetId detId) const

{

Definition at line 75 of file HcalSimParameters.cc.

References cms::cuda::assert(), ecalph2::gains, HcalDbService::getGain(), HcalDbService::getGainWidth(), mps_fire::result, and theDbService.

Referenced by simHitToPhotoelectrons().

75  {
76  assert(theDbService != nullptr);
77  HcalGenericDetId hcalGenDetId(detId);
78  const HcalGain* gains = theDbService->getGain(hcalGenDetId);
79  const HcalGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
80  double result = 0.0;
81  if (!gains || !gwidths) {
82  edm::LogError("HcalAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
83  } else {
84  // only one gain will be recorded per channel, so just use capID 0 for now
85  result = gains->getValue(0);
86  // if(doNoise_)
88  // result += CLHEP::RandGaussQ::shoot(0., gwidths->getValue(0));
89  // }
90  }
91  return result;
92 }
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Log< level::Error, false > LogError
assert(be >=bs)
constexpr float gains[NGAINS]
Definition: EcalConstants.h:11
const HcalGain * getGain(const HcalGenericDetId &fId) const
const HcalDbService * theDbService

◆ photoelectronsToAnalog()

double HcalSimParameters::photoelectronsToAnalog ( const DetId detId) const
overridevirtual

Reimplemented from CaloSimParameters.

Definition at line 99 of file HcalSimParameters.cc.

References cms::cuda::assert(), HcalSiPMParameter::getFCByPE(), HcalDbService::getHcalSiPMParameter(), and theDbService.

Referenced by HcalSiPMHitResponse::addPEnoise().

99  {
100  //now always taken from database for HPDs or SiPMs (HB, HE, HO)
102  return theDbService->getHcalSiPMParameter(detId)->getFCByPE();
103 }
float getFCByPE() const
get fcByPE
assert(be >=bs)
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const

◆ pixels()

int HcalSimParameters::pixels ( const DetId detId) const

Definition at line 150 of file HcalSimParameters.cc.

References cms::cuda::assert(), HcalDbService::getHcalSiPMParameter(), HcalSiPMCharacteristics::getPixels(), HcalSiPMParameter::getType(), theDbService, and theSiPMcharacteristics.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

150  {
154 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
assert(be >=bs)
int getPixels(int type) const
get # of pixels
int getType() const
get SiPM type
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const

◆ samplingFactor()

double HcalSimParameters::samplingFactor ( const DetId detId) const
virtual

the ratio of actual incident energy to deposited energy in the SimHit

Definition at line 94 of file HcalSimParameters.cc.

References HcalDetId::ietaAbs(), theFirstRing, and theSamplingFactors.

Referenced by simHitToPhotoelectrons().

94  {
95  HcalDetId hcalDetId(detId);
96  return theSamplingFactors.at(hcalDetId.ietaAbs() - theFirstRing);
97 }
std::vector< double > theSamplingFactors

◆ setDbService()

void HcalSimParameters::setDbService ( const HcalDbService service)

Definition at line 57 of file HcalSimParameters.cc.

References cms::cuda::assert(), theDbService, and theSiPMcharacteristics.

Referenced by HcalSimParameterMap::setDbService().

57  {
58  assert(service);
60  theSiPMcharacteristics = service->getHcalSiPMCharacteristics();
62 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
assert(be >=bs)
const HcalDbService * theDbService

◆ signalShape()

unsigned int HcalSimParameters::signalShape ( const DetId detId) const

Definition at line 172 of file HcalSimParameters.cc.

References cms::cuda::assert(), HcalDbService::getHcalMCParam(), HcalMCParam::signalShape(), and theDbService.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

172  {
174  return theDbService->getHcalMCParam(detId)->signalShape();
175 }
assert(be >=bs)
const HcalMCParam * getHcalMCParam(const HcalGenericDetId &fId) const
unsigned int signalShape() const
Definition: HcalMCParam.h:38
const HcalDbService * theDbService

◆ simHitToPhotoelectrons()

double HcalSimParameters::simHitToPhotoelectrons ( const DetId detId) const
overridevirtual

Reimplemented from CaloSimParameters.

Definition at line 64 of file HcalSimParameters.cc.

References fCtoGeV(), HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenZDC, CaloSimParameters::photoelectronsToAnalog(), mps_fire::result, samplingFactor(), and CaloSimParameters::simHitToPhotoelectrons().

64  {
65  // the gain is in units of GeV/fC. We want a constant with pe/dGeV
66  // pe/dGeV = (GeV/dGeV) / (GeV/fC) / (fC/pe)
68  if (HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenForward ||
69  HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenZDC) {
70  result = samplingFactor(detId) / fCtoGeV(detId) / photoelectronsToAnalog(detId);
71  }
72  return result;
73 }
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
virtual double samplingFactor(const DetId &detId) const
double simHitToPhotoelectrons() const
double fCtoGeV(const DetId &detId) const

◆ sipmCrossTalk()

double HcalSimParameters::sipmCrossTalk ( const DetId detId) const

Definition at line 161 of file HcalSimParameters.cc.

References cms::cuda::assert(), HcalSiPMCharacteristics::getCrossTalk(), HcalDbService::getHcalSiPMParameter(), HcalSiPMParameter::getType(), theDbService, and theSiPMcharacteristics.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

161  {
165 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
assert(be >=bs)
float getCrossTalk(int type) const
get cross talk
int getType() const
get SiPM type
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const

◆ sipmDarkCurrentuA()

double HcalSimParameters::sipmDarkCurrentuA ( const DetId detId) const

Definition at line 156 of file HcalSimParameters.cc.

References cms::cuda::assert(), HcalSiPMParameter::getDarkCurrent(), HcalDbService::getHcalSiPMParameter(), and theDbService.

Referenced by HcalSiPMHitResponse::addPEnoise().

156  {
159 }
float getDarkCurrent() const
get dark current
assert(be >=bs)
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const

◆ sipmNonlinearity()

std::vector< float > HcalSimParameters::sipmNonlinearity ( const DetId detId) const

Definition at line 166 of file HcalSimParameters.cc.

References cms::cuda::assert(), HcalDbService::getHcalSiPMParameter(), HcalSiPMCharacteristics::getNonLinearities(), HcalSiPMParameter::getType(), theDbService, and theSiPMcharacteristics.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

166  {
170 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
assert(be >=bs)
int getType() const
get SiPM type
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const

◆ sipmTau()

double HcalSimParameters::sipmTau ( ) const
inline

Definition at line 45 of file HcalSimParameters.h.

References theSiPMTau.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

45 { return theSiPMTau; }

◆ threshold_currentTDC()

double HcalSimParameters::threshold_currentTDC ( ) const
inline

Definition at line 44 of file HcalSimParameters.h.

References threshold_currentTDC_.

Referenced by HcalElectronicsSim::analogToDigital().

44 { return threshold_currentTDC_; }

◆ timeSmearRMS()

double HcalSimParameters::timeSmearRMS ( double  ampl) const

Definition at line 126 of file HcalSimParameters.cc.

References first, mps_fire::i, and theSmearSettings.

126  {
128  double smearsigma = 0;
129 
130  for (i = 0; i < theSmearSettings.size(); i++)
131  if (theSmearSettings[i].first > ampl)
132  break;
133 
134  // Smearing occurs only within the envelope definitions.
135  if (i != 0 && (i < theSmearSettings.size())) {
136  double energy1 = theSmearSettings[i - 1].first;
137  double sigma1 = theSmearSettings[i - 1].second;
138  double energy2 = theSmearSettings[i].first;
139  double sigma2 = theSmearSettings[i].second;
140 
141  if (energy2 != energy1)
142  smearsigma = sigma1 + ((sigma2 - sigma1) * (ampl - energy1) / (energy2 - energy1));
143  else
144  smearsigma = (sigma2 + sigma1) / 2.;
145  }
146 
147  return smearsigma;
148 }
uint16_t size_type
HcalTimeSmearSettings theSmearSettings

Friends And Related Function Documentation

◆ HcalSimParameterMap

friend class HcalSimParameterMap
friend

Definition at line 51 of file HcalSimParameters.h.

Member Data Documentation

◆ delayQIE_

int HcalSimParameters::delayQIE_
private

Definition at line 64 of file HcalSimParameters.h.

Referenced by delayQIE().

◆ doTimeSmear_

bool HcalSimParameters::doTimeSmear_
private

Definition at line 60 of file HcalSimParameters.h.

Referenced by doTimeSmear().

◆ theDbService

const HcalDbService* HcalSimParameters::theDbService
private

◆ theFirstRing

int HcalSimParameters::theFirstRing
private

Definition at line 57 of file HcalSimParameters.h.

Referenced by samplingFactor().

◆ theSamplingFactors

std::vector<double> HcalSimParameters::theSamplingFactors
private

Definition at line 58 of file HcalSimParameters.h.

Referenced by samplingFactor().

◆ theSiPMcharacteristics

const HcalSiPMCharacteristics* HcalSimParameters::theSiPMcharacteristics
private

Definition at line 56 of file HcalSimParameters.h.

Referenced by pixels(), setDbService(), sipmCrossTalk(), and sipmNonlinearity().

◆ theSiPMSmearing

bool HcalSimParameters::theSiPMSmearing
private

Definition at line 59 of file HcalSimParameters.h.

Referenced by doSiPMSmearing(), and HcalSimParameters().

◆ theSiPMTau

double HcalSimParameters::theSiPMTau
private

Definition at line 62 of file HcalSimParameters.h.

Referenced by sipmTau().

◆ theSmearSettings

HcalTimeSmearSettings HcalSimParameters::theSmearSettings
private

Definition at line 61 of file HcalSimParameters.h.

Referenced by defaultTimeSmearing(), and timeSmearRMS().

◆ threshold_currentTDC_

double HcalSimParameters::threshold_currentTDC_
private

Definition at line 63 of file HcalSimParameters.h.

Referenced by threshold_currentTDC().