CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/SimCalorimetry/EcalSimAlgos/src/EEHitResponse.cc

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