CMS 3D CMS Logo

HcalSimParameters Class Reference

#include <SimCalorimetry/HcalSimAlgos/interface/HcalSimParameters.h>

Inheritance diagram for HcalSimParameters:

CaloSimParameters

List of all members.

Public Member Functions

double fCtoGeV (const DetId &detId) const
 HcalSimParameters (const edm::ParameterSet &p)
 HcalSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase, int firstRing, const std::vector< double > &samplingFactors)
virtual double photoelectronsToAnalog (const DetId &detId) const
virtual double samplingFactor (const DetId &detId) const
 the ratio of actual incident energy to deposited energy in the SimHit
void setDbService (const HcalDbService *service)
virtual double simHitToPhotoelectrons (const DetId &detId) const
virtual ~HcalSimParameters ()

Private Attributes

const HcalDbServicetheDbService
int theFirstRing
std::vector< double > theSamplingFactors


Detailed Description

Definition at line 8 of file HcalSimParameters.h.


Constructor & Destructor Documentation

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

Definition at line 11 of file HcalSimParameters.cc.

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

Definition at line 24 of file HcalSimParameters.cc.

00025 :  CaloSimParameters(p),
00026    theDbService(0),
00027    theFirstRing( p.getParameter<int>("firstRing") ),
00028    theSamplingFactors( p.getParameter<std::vector<double> >("samplingFactors") )
00029 {
00030 }

virtual HcalSimParameters::~HcalSimParameters (  )  [inline, virtual]

Definition at line 18 of file HcalSimParameters.h.

00018 {}


Member Function Documentation

double HcalSimParameters::fCtoGeV ( const DetId detId  )  const

{

Definition at line 46 of file HcalSimParameters.cc.

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

Referenced by simHitToPhotoelectrons().

00047 {
00048   assert(theDbService != 0);
00049   HcalGenericDetId hcalGenDetId(detId);
00050   const HcalGain* gains = theDbService->getGain(hcalGenDetId);
00051   const HcalGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
00052   if (!gains || !gwidths )
00053   {
00054     edm::LogError("HcalAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
00055   }
00056   // only one gain will be recorded per channel, so just use capID 0 for now
00057   
00058   double result = gains->getValue(0);
00059 //  if(doNoise_)
00061 //    result += RandGaussQ::shoot(0.,  gwidths->getValue(0));
00062 //  }
00063   return result;
00064 }

virtual double HcalSimParameters::photoelectronsToAnalog ( const DetId detId  )  const [inline, virtual]

Reimplemented from CaloSimParameters.

Definition at line 23 of file HcalSimParameters.h.

References CaloSimParameters::photoelectronsToAnalog().

00023                                                                    {
00024     return CaloSimParameters::photoelectronsToAnalog();
00025   }

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

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

Definition at line 66 of file HcalSimParameters.cc.

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

Referenced by simHitToPhotoelectrons().

00067 {
00068   HcalDetId hcalDetId(detId);
00069   return theSamplingFactors.at(hcalDetId.ietaAbs()-theFirstRing);
00070 }

void HcalSimParameters::setDbService ( const HcalDbService service  )  [inline]

Definition at line 20 of file HcalSimParameters.h.

References theDbService.

Referenced by HcalSimParameterMap::setDbService().

00020 {theDbService = service;}

double HcalSimParameters::simHitToPhotoelectrons ( const DetId detId  )  const [virtual]

Reimplemented from CaloSimParameters.

Definition at line 32 of file HcalSimParameters.cc.

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

00033 {
00034   // the gain is in units of GeV/fC.  We want a constant with pe/dGeV
00035   // pe/dGeV = (GeV/dGeV) / (GeV/fC) / (fC/pe) 
00036   double result = CaloSimParameters::simHitToPhotoelectrons(detId);
00037   if(HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenForward
00038      || HcalGenericDetId(detId).genericSubdet() != HcalGenericDetId::HcalGenZDC)
00039     { 
00040       result = samplingFactor(detId) / fCtoGeV(detId) / photoelectronsToAnalog(detId);
00041     }
00042   return result;
00043 }


Member Data Documentation

const HcalDbService* HcalSimParameters::theDbService [private]

Definition at line 35 of file HcalSimParameters.h.

Referenced by fCtoGeV(), and setDbService().

int HcalSimParameters::theFirstRing [private]

Definition at line 36 of file HcalSimParameters.h.

Referenced by samplingFactor().

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

Definition at line 37 of file HcalSimParameters.h.

Referenced by samplingFactor().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:56 2009 for CMSSW by  doxygen 1.5.4