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 (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 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
 choice of the ADC time alignment (synchronous for LHC, asynchronous for test beams) More...
 
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
 

Friends

class HcalSimParameterMap
 

Detailed Description

Definition at line 10 of file HcalSimParameters.h.

Constructor & Destructor Documentation

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.

21  theDbService(nullptr),
22  theSiPMcharacteristics(nullptr),
25  theSiPMSmearing(false),
26  doTimeSmear_(true),
28 {
30 
31  edm::LogInfo("HcalSimParameters:") << " doSiPMsmearing = " << theSiPMSmearing;
32 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
double sipmTau() const
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
double timePhase() const
the adjustment you need to apply to get the signal where you want it
double simHitToPhotoelectrons() const
std::vector< double > theSamplingFactors
virtual double samplingFactor(const DetId &detId) const
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
const HcalDbService * theDbService
int binOfMaximum() const
bool syncPhase() const
choice of the ADC time alignment (synchronous for LHC, asynchronous for test beams) ...
HcalSimParameters::HcalSimParameters ( const edm::ParameterSet p)

Definition at line 34 of file HcalSimParameters.cc.

References defaultTimeSmearing(), and theSiPMSmearing.

35 : CaloSimParameters(p,true),
36  theDbService(nullptr),
37  theFirstRing( p.getParameter<int>("firstRing") ),
38  theSamplingFactors( p.getParameter<std::vector<double> >("samplingFactors") ),
39  theSiPMSmearing( p.getParameter<bool>("doSiPMSmearing") ),
40  doTimeSmear_( p.getParameter<bool>("timeSmearing") ),
41  theSiPMTau( p.getParameter<double>("sipmTau") )
42 {
44 
45  edm::LogInfo("HcalSimParameters:") << " doSiPMsmearing = " << theSiPMSmearing;
46 }
T getParameter(std::string const &) const
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
std::vector< double > theSamplingFactors
const HcalDbService * theDbService
HcalSimParameters::~HcalSimParameters ( )
inlineoverride

Member Function Documentation

void HcalSimParameters::defaultTimeSmearing ( )
private

Definition at line 111 of file HcalSimParameters.cc.

References GeV2fC, and theSmearSettings.

Referenced by HcalSimParameters().

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

Definition at line 40 of file HcalSimParameters.h.

References theSiPMSmearing.

Referenced by HcalSiPMHitResponse::makeSiPMSignal().

40 { return theSiPMSmearing; }
bool HcalSimParameters::doTimeSmear ( ) const
inline

Definition at line 35 of file HcalSimParameters.h.

References doTimeSmear_, pixels(), and timeSmearRMS().

Referenced by HcalTimeSlewSim::delay().

35 { return doTimeSmear_; }
double HcalSimParameters::fCtoGeV ( const DetId detId) const

{

Definition at line 70 of file HcalSimParameters.cc.

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

Referenced by simHitToPhotoelectrons(), and ~HcalSimParameters().

71 {
72  assert(theDbService != nullptr);
73  HcalGenericDetId hcalGenDetId(detId);
74  const HcalGain* gains = theDbService->getGain(hcalGenDetId);
75  const HcalGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
76  double result = 0.0;
77  if (!gains || !gwidths )
78  {
79  edm::LogError("HcalAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
80  }
81  else
82  {
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 }
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGain.h:22
const HcalGain * getGain(const HcalGenericDetId &fId) const
const HcalDbService * theDbService
double HcalSimParameters::photoelectronsToAnalog ( const DetId detId) const
overridevirtual

Reimplemented from CaloSimParameters.

Definition at line 100 of file HcalSimParameters.cc.

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

Referenced by HcalSiPMHitResponse::addPEnoise().

101 {
102  //now always taken from database for HPDs or SiPMs (HB, HE, HO)
103  assert(theDbService);
104  return theDbService->getHcalSiPMParameter(detId)->getFCByPE();
105 }
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
float getFCByPE() const
get fcByPE
int HcalSimParameters::pixels ( const DetId detId) const

Definition at line 154 of file HcalSimParameters.cc.

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

Referenced by doTimeSmear(), and HcalSiPMHitResponse::makeSiPMSignal().

154  {
155  assert(theDbService);
157  return theSiPMcharacteristics->getPixels(type);
158 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
type
Definition: HCALResponse.h:21
int getType() const
get SiPM type
const HcalDbService * theDbService
int getPixels(int type) const
get # of pixels
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
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.

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

Referenced by simHitToPhotoelectrons(), and ~HcalSimParameters().

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

Definition at line 48 of file HcalSimParameters.cc.

References HcalDbService::getHcalSiPMCharacteristics(), theDbService, and theSiPMcharacteristics.

Referenced by HcalSimParameterMap::setDbService(), and ~HcalSimParameters().

49 {
50  assert(service);
51  theDbService = service;
53  assert(theSiPMcharacteristics);
54 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalDbService * theDbService
unsigned int HcalSimParameters::signalShape ( const DetId detId) const

Definition at line 179 of file HcalSimParameters.cc.

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

Referenced by HcalSiPMHitResponse::makeSiPMSignal(), and sipmTau().

179  {
180  assert(theDbService);
181  return theDbService->getHcalMCParam(detId)->signalShape();
182 }
const HcalMCParam * getHcalMCParam(const HcalGenericDetId &fId) const
unsigned int signalShape() const
Definition: HcalMCParam.h:40
const HcalDbService * theDbService
double HcalSimParameters::simHitToPhotoelectrons ( const DetId detId) const
overridevirtual

Reimplemented from CaloSimParameters.

Definition at line 56 of file HcalSimParameters.cc.

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

57 {
58  // the gain is in units of GeV/fC. We want a constant with pe/dGeV
59  // pe/dGeV = (GeV/dGeV) / (GeV/fC) / (fC/pe)
61  if(HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenForward
62  || HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenZDC)
63  {
64  result = samplingFactor(detId) / fCtoGeV(detId) / photoelectronsToAnalog(detId);
65  }
66  return result;
67 }
double fCtoGeV(const DetId &detId) const
double simHitToPhotoelectrons() const
virtual double samplingFactor(const DetId &detId) const
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
double HcalSimParameters::sipmCrossTalk ( const DetId detId) const

Definition at line 166 of file HcalSimParameters.cc.

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

Referenced by HcalSiPMHitResponse::makeSiPMSignal(), and sipmTau().

167 {
168  assert(theDbService);
170  return theSiPMcharacteristics->getCrossTalk(type);
171 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
type
Definition: HCALResponse.h:21
int getType() const
get SiPM type
float getCrossTalk(int type) const
get cross talk
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
double HcalSimParameters::sipmDarkCurrentuA ( const DetId detId) const

Definition at line 160 of file HcalSimParameters.cc.

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

Referenced by HcalSiPMHitResponse::addPEnoise(), and sipmTau().

161 {
162  assert(theDbService);
164 }
float getDarkCurrent() const
get dark current
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
std::vector< float > HcalSimParameters::sipmNonlinearity ( const DetId detId) const

Definition at line 172 of file HcalSimParameters.cc.

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

Referenced by HcalSiPMHitResponse::makeSiPMSignal(), and sipmTau().

173 {
174  assert(theDbService);
177 }
const HcalSiPMCharacteristics * theSiPMcharacteristics
type
Definition: HCALResponse.h:21
int getType() const
get SiPM type
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
const HcalDbService * theDbService
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
double HcalSimParameters::sipmTau ( ) const
inline
double HcalSimParameters::timeSmearRMS ( double  ampl) const

Definition at line 129 of file HcalSimParameters.cc.

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

Referenced by HcalTimeSlewSim::delay(), and doTimeSmear().

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

Friends And Related Function Documentation

friend class HcalSimParameterMap
friend

Definition at line 48 of file HcalSimParameters.h.

Member Data Documentation

bool HcalSimParameters::doTimeSmear_
private

Definition at line 57 of file HcalSimParameters.h.

Referenced by doTimeSmear().

const HcalDbService* HcalSimParameters::theDbService
private
int HcalSimParameters::theFirstRing
private

Definition at line 54 of file HcalSimParameters.h.

Referenced by samplingFactor().

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

Definition at line 55 of file HcalSimParameters.h.

Referenced by samplingFactor().

const HcalSiPMCharacteristics* HcalSimParameters::theSiPMcharacteristics
private

Definition at line 53 of file HcalSimParameters.h.

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

bool HcalSimParameters::theSiPMSmearing
private

Definition at line 56 of file HcalSimParameters.h.

Referenced by doSiPMSmearing(), and HcalSimParameters().

double HcalSimParameters::theSiPMTau
private

Definition at line 59 of file HcalSimParameters.h.

Referenced by sipmTau().

HcalTimeSmearSettings HcalSimParameters::theSmearSettings
private

Definition at line 58 of file HcalSimParameters.h.

Referenced by defaultTimeSmearing(), and timeSmearRMS().