CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/SimCalorimetry/EcalSimAlgos/src/ESHitResponse.cc

Go to the documentation of this file.
00001 #include "SimCalorimetry/EcalSimAlgos/interface/ESHitResponse.h" 
00002 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVSimParameterMap.h"
00003 #include "SimCalorimetry/CaloSimAlgos/interface/CaloSimParameters.h"
00004 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVHitFilter.h"
00005 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVShape.h"
00006 #include "Geometry/CaloGeometry/interface/CaloGenericDetId.h"
00007 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00008 
00009 
00010 ESHitResponse::ESHitResponse( const CaloVSimParameterMap* parameterMap , 
00011                               const CaloVShape*           shape          ) :
00012    EcalHitResponse( parameterMap , shape )
00013 {
00014    assert( 0 != parameterMap ) ;
00015    assert( 0 != shape ) ;
00016    const ESDetId detId ( ESDetId::detIdFromDenseIndex( 0 ) ) ;
00017    const CaloSimParameters& parameters ( parameterMap->simParameters( detId ) ) ;
00018 
00019    const unsigned int rSize ( parameters.readoutFrameSize() ) ;
00020    const unsigned int nPre  ( parameters.binOfMaximum() - 1 ) ;
00021 
00022    const unsigned int size ( ESDetId::kSizeForDenseIndexing ) ;
00023 
00024    m_vSam.reserve( size ) ;
00025 
00026    for( unsigned int i ( 0 ) ; i != size ; ++i )
00027    {
00028       m_vSam.push_back(
00029          ESSamples( CaloGenericDetId( detId.det(), detId.subdetId(), i ) ,
00030                     rSize, nPre ) ) ;
00031    }
00032 }
00033 
00034 ESHitResponse::~ESHitResponse()
00035 {
00036 }
00037 
00038 unsigned int
00039 ESHitResponse::samplesSize() const
00040 {
00041    return index().size() ;
00042 }
00043 
00044 unsigned int
00045 ESHitResponse::samplesSizeAll() const
00046 {
00047    return ESDetId::kSizeForDenseIndexing ;
00048 }
00049 
00050 const EcalHitResponse::EcalSamples* 
00051 ESHitResponse::operator[]( unsigned int i ) const
00052 {
00053    return &m_vSam[ index()[ i ] ] ;
00054 }
00055 
00056 EcalHitResponse::EcalSamples* 
00057 ESHitResponse::operator[]( unsigned int i )
00058 {
00059    return &m_vSam[ index()[ i ] ] ;
00060 }
00061 
00062 EcalHitResponse::EcalSamples* 
00063 ESHitResponse::vSam( unsigned int i )
00064 {
00065    return &m_vSam[ index()[ i ] ] ;
00066 }
00067 
00068 EcalHitResponse::EcalSamples* 
00069 ESHitResponse::vSamAll( unsigned int i )
00070 {
00071    return &m_vSam[ i ] ;
00072 }
00073 
00074 const EcalHitResponse::EcalSamples* 
00075 ESHitResponse::vSamAll( unsigned int i ) const
00076 {
00077    return &m_vSam[ i ] ;
00078 }