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

bool doSiPMSmearing () const
 
bool doTimeSmear () const
 
double fCtoGeV (const DetId &detId) const
 
 HcalSimParameters (const edm::ParameterSet &p)
 
 HcalSimParameters (double simHitToPhotoelectrons, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase, int firstRing, const std::vector< double > &samplingFactors, double sipmTau)
 
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 (const edm::ParameterSet &p, bool skipPe2Fc=false)
 
 CaloSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
 
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

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.

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 }

References defaultTimeSmearing(), and theSiPMSmearing.

◆ HcalSimParameters() [2/2]

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

Definition at line 42 of file HcalSimParameters.cc.

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")) {
52 
53  edm::LogInfo("HcalSimParameters:") << " doSiPMsmearing = " << theSiPMSmearing;
54 }

References defaultTimeSmearing(), and theSiPMSmearing.

◆ ~HcalSimParameters()

HcalSimParameters::~HcalSimParameters ( )
inlineoverride

Definition at line 24 of file HcalSimParameters.h.

24 {}

Member Function Documentation

◆ defaultTimeSmearing()

void HcalSimParameters::defaultTimeSmearing ( )
private

Definition at line 107 of file HcalSimParameters.cc.

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

References GeV2fC, and theSmearSettings.

Referenced by HcalSimParameters().

◆ doSiPMSmearing()

bool HcalSimParameters::doSiPMSmearing ( ) const
inline

Definition at line 42 of file HcalSimParameters.h.

42 { return theSiPMSmearing; }

References theSiPMSmearing.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

◆ doTimeSmear()

bool HcalSimParameters::doTimeSmear ( ) const
inline

Definition at line 37 of file HcalSimParameters.h.

37 { return doTimeSmear_; }

References doTimeSmear_.

◆ fCtoGeV()

double HcalSimParameters::fCtoGeV ( const DetId detId) const

{

Definition at line 74 of file HcalSimParameters.cc.

74  {
75  assert(theDbService != nullptr);
76  HcalGenericDetId hcalGenDetId(detId);
77  const HcalGain* gains = theDbService->getGain(hcalGenDetId);
78  const HcalGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
79  double result = 0.0;
80  if (!gains || !gwidths) {
81  edm::LogError("HcalAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
82  } else {
83  // only one gain will be recorded per channel, so just use capID 0 for now
84  result = gains->getValue(0);
85  // if(doNoise_)
87  // result += CLHEP::RandGaussQ::shoot(0., gwidths->getValue(0));
88  // }
89  }
90  return result;
91 }

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

Referenced by simHitToPhotoelectrons().

◆ photoelectronsToAnalog()

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

Reimplemented from CaloSimParameters.

Definition at line 98 of file HcalSimParameters.cc.

98  {
99  //now always taken from database for HPDs or SiPMs (HB, HE, HO)
101  return theDbService->getHcalSiPMParameter(detId)->getFCByPE();
102 }

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

Referenced by HcalSiPMHitResponse::addPEnoise().

◆ pixels()

int HcalSimParameters::pixels ( const DetId detId) 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 93 of file HcalSimParameters.cc.

93  {
94  HcalDetId hcalDetId(detId);
95  return theSamplingFactors.at(hcalDetId.ietaAbs() - theFirstRing);
96 }

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

Referenced by simHitToPhotoelectrons().

◆ setDbService()

void HcalSimParameters::setDbService ( const HcalDbService service)

Definition at line 56 of file HcalSimParameters.cc.

56  {
57  assert(service);
59  theSiPMcharacteristics = service->getHcalSiPMCharacteristics();
61 }

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

Referenced by HcalSimParameterMap::setDbService().

◆ signalShape()

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

◆ simHitToPhotoelectrons()

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

Reimplemented from CaloSimParameters.

Definition at line 63 of file HcalSimParameters.cc.

63  {
64  // the gain is in units of GeV/fC. We want a constant with pe/dGeV
65  // pe/dGeV = (GeV/dGeV) / (GeV/fC) / (fC/pe)
67  if (HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenForward ||
68  HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenZDC) {
69  result = samplingFactor(detId) / fCtoGeV(detId) / photoelectronsToAnalog(detId);
70  }
71  return result;
72 }

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

◆ sipmCrossTalk()

double HcalSimParameters::sipmCrossTalk ( const DetId detId) const

◆ sipmDarkCurrentuA()

double HcalSimParameters::sipmDarkCurrentuA ( const DetId detId) const

◆ sipmNonlinearity()

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

◆ sipmTau()

double HcalSimParameters::sipmTau ( ) const
inline

Definition at line 45 of file HcalSimParameters.h.

45 { return theSiPMTau; }

References theSiPMTau.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

◆ threshold_currentTDC()

double HcalSimParameters::threshold_currentTDC ( ) const
inline

Definition at line 44 of file HcalSimParameters.h.

44 { return threshold_currentTDC_; }

References threshold_currentTDC_.

Referenced by HcalElectronicsSim::analogToDigital().

◆ timeSmearRMS()

double HcalSimParameters::timeSmearRMS ( double  ampl) const

Definition at line 125 of file HcalSimParameters.cc.

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

References dqmdumpme::first, mps_fire::i, and theSmearSettings.

Friends And Related Function Documentation

◆ HcalSimParameterMap

friend class HcalSimParameterMap
friend

Definition at line 51 of file HcalSimParameters.h.

Member Data Documentation

◆ 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().

service
Definition: service.py:1
mps_fire.i
i
Definition: mps_fire.py:355
HcalDbService::getGainWidth
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:312
HcalSimParameters::theSiPMTau
double theSiPMTau
Definition: HcalSimParameters.h:62
HcalGain::getValue
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGain.h:21
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalSimParameters::theFirstRing
int theFirstRing
Definition: HcalSimParameters.h:57
HcalSimParameters::threshold_currentTDC_
double threshold_currentTDC_
Definition: HcalSimParameters.h:63
CaloSimParameters::doPhotostatistics
bool doPhotostatistics() const
whether or not to apply Poisson statistics to photoelectrons
Definition: CaloSimParameters.h:54
CaloSimParameters::photoelectronsToAnalog
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
Definition: CaloSimParameters.h:38
CaloSimParameters::readoutFrameSize
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
Definition: CaloSimParameters.h:45
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HcalSimParameters::theSiPMcharacteristics
const HcalSiPMCharacteristics * theSiPMcharacteristics
Definition: HcalSimParameters.h:56
edm::LogInfo
Definition: MessageLogger.h:254
HcalSiPMParameter::getFCByPE
float getFCByPE() const
get fcByPE
Definition: HcalSiPMParameter.h:12
HcalSiPMCharacteristics::getNonLinearities
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
Definition: HcalSiPMCharacteristics.cc:77
cms::cuda::assert
assert(be >=bs)
HcalSiPMParameter::getDarkCurrent
float getDarkCurrent() const
get dark current
Definition: HcalSiPMParameter.h:14
HcalDbService::getGain
const HcalGain * getGain(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:305
CaloSimParameters::simHitToPhotoelectrons
double simHitToPhotoelectrons() const
Definition: CaloSimParameters.h:34
CaloSimParameters::CaloSimParameters
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
Definition: CaloSimParameters.cc:5
hcalSimParameters_cfi.firstRing
firstRing
Definition: hcalSimParameters_cfi.py:41
CaloSimParameters::timePhase
double timePhase() const
the adjustment you need to apply to get the signal where you want it
Definition: CaloSimParameters.h:42
HcalSiPMCharacteristics::getCrossTalk
float getCrossTalk(int type) const
get cross talk
Definition: HcalSiPMCharacteristics.cc:88
dqmdumpme.first
first
Definition: dqmdumpme.py:55
GeV2fC
static const double GeV2fC
Definition: HcalSimParameters.cc:105
HcalDbService::getHcalMCParam
const HcalMCParam * getHcalMCParam(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:398
HcalGenericDetId::HcalGenZDC
Definition: HcalGenericDetId.h:24
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
HcalSimParameters::samplingFactor
virtual double samplingFactor(const DetId &detId) const
Definition: HcalSimParameters.cc:93
HcalSimParameters::theSmearSettings
HcalTimeSmearSettings theSmearSettings
Definition: HcalSimParameters.h:61
HcalGain
Definition: HcalGain.h:16
hcalSimParameters_cfi.samplingFactors
samplingFactors
Definition: hcalSimParameters_cfi.py:45
edm::LogError
Definition: MessageLogger.h:183
HcalSimParameters::theSamplingFactors
std::vector< double > theSamplingFactors
Definition: HcalSimParameters.h:58
HcalDetId
Definition: HcalDetId.h:12
HcalSiPMParameter::getType
int getType() const
get SiPM type
Definition: HcalSiPMParameter.h:10
HcalSimParameters::defaultTimeSmearing
void defaultTimeSmearing()
Definition: HcalSimParameters.cc:107
HcalSimParameters::theSiPMSmearing
bool theSiPMSmearing
Definition: HcalSimParameters.h:59
CaloSimParameters::syncPhase
bool syncPhase() const
Definition: CaloSimParameters.h:58
HcalMCParam::signalShape
unsigned int signalShape() const
Definition: HcalMCParam.h:38
type
type
Definition: HCALResponse.h:21
HcalDbService::getHcalSiPMParameter
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:382
HcalSimParameters::fCtoGeV
double fCtoGeV(const DetId &detId) const
Definition: HcalSimParameters.cc:74
mps_fire.result
result
Definition: mps_fire.py:303
HcalSimParameters::theDbService
const HcalDbService * theDbService
Definition: HcalSimParameters.h:55
HcalGenericDetId::HcalGenForward
Definition: HcalGenericDetId.h:22
HcalSimParameters::sipmTau
double sipmTau() const
Definition: HcalSimParameters.h:45
HcalSiPMCharacteristics::getPixels
int getPixels(int type) const
get # of pixels
Definition: HcalSiPMCharacteristics.cc:72
HcalGainWidth
Definition: HcalGainWidth.h:15
CaloSimParameters::binOfMaximum
int binOfMaximum() const
Definition: CaloSimParameters.h:47
HcalSimParameters::doTimeSmear_
bool doTimeSmear_
Definition: HcalSimParameters.h:60