Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:33

0001 #include "SimCalorimetry/EcalSimAlgos/interface/ESHitResponse.h"
0002 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVSimParameterMap.h"
0003 #include "SimCalorimetry/CaloSimAlgos/interface/CaloSimParameters.h"
0004 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVHitFilter.h"
0005 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVShape.h"
0006 #include "Geometry/CaloGeometry/interface/CaloGenericDetId.h"
0007 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0008 
0009 ESHitResponse::ESHitResponse(const CaloVSimParameterMap* parameterMap, const CaloVShape* shape)
0010     : EcalHitResponse(parameterMap, shape) {
0011   assert(nullptr != parameterMap);
0012   assert(nullptr != shape);
0013   const ESDetId detId(ESDetId::detIdFromDenseIndex(0));
0014   const CaloSimParameters& parameters(parameterMap->simParameters(detId));
0015 
0016   const unsigned int rSize(parameters.readoutFrameSize());
0017   const unsigned int nPre(parameters.binOfMaximum() - 1);
0018 
0019   const unsigned int size(ESDetId::kSizeForDenseIndexing);
0020 
0021   m_vSam.reserve(size);
0022 
0023   for (unsigned int i(0); i != size; ++i) {
0024     m_vSam.emplace_back(CaloGenericDetId(detId.det(), detId.subdetId(), i), rSize, nPre);
0025   }
0026 }
0027 
0028 ESHitResponse::~ESHitResponse() {}
0029 
0030 unsigned int ESHitResponse::samplesSize() const { return index().size(); }
0031 
0032 unsigned int ESHitResponse::samplesSizeAll() const { return ESDetId::kSizeForDenseIndexing; }
0033 
0034 const EcalHitResponse::EcalSamples* ESHitResponse::operator[](unsigned int i) const { return &m_vSam[index()[i]]; }
0035 
0036 EcalHitResponse::EcalSamples* ESHitResponse::operator[](unsigned int i) { return &m_vSam[index()[i]]; }
0037 
0038 EcalHitResponse::EcalSamples* ESHitResponse::vSam(unsigned int i) { return &m_vSam[index()[i]]; }
0039 
0040 EcalHitResponse::EcalSamples* ESHitResponse::vSamAll(unsigned int i) { return &m_vSam[i]; }
0041 
0042 const EcalHitResponse::EcalSamples* ESHitResponse::vSamAll(unsigned int i) const { return &m_vSam[i]; }