CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/SimCalorimetry/CastorSim/src/CastorSimParameterMap.cc

Go to the documentation of this file.
00001 #include "SimCalorimetry/CastorSim/src/CastorSimParameterMap.h"
00002 #include "DataFormats/DetId/interface/DetId.h"
00003 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00004 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00005 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
00006 #include <iostream>
00007 
00008 
00009 //some arbitrary numbers for now
00010 CastorSimParameterMap::CastorSimParameterMap() :
00011   theCastorParameters(1., 4.3333,
00012                    2.09 , -4.,
00013                    false)
00014 {
00015 }
00016 /*
00017   CaloSimParameters(double photomultiplierGain, double amplifierGain,
00018                  double samplingFactor, double timePhase,
00019                  int readoutFrameSize, int binOfMaximum,
00020                  bool doPhotostatistics);
00021 */
00022 
00023 CastorSimParameterMap::CastorSimParameterMap(const edm::ParameterSet & p)
00024 :  theCastorParameters( p.getParameter<edm::ParameterSet>("castor") ) 
00025 {
00026 }
00027 
00028 const CaloSimParameters& CastorSimParameterMap::simParameters(const DetId & detId) const 
00029 {
00030     HcalGenericDetId genericId(detId);
00031 
00032     //  if(detId.det()==DetId::Calo && detId.subdetId()==HcalCastorDetId::SubdetectorId)
00033     
00034     if(genericId.isHcalCastorDetId())
00035         return theCastorParameters;
00036     
00037     else
00038         throw cms::Exception("not HcalCastorDetId"); 
00039     
00040 }
00041 
00042 void CastorSimParameterMap::setDbService(const CastorDbService * dbService)
00043 {
00044 theCastorParameters.setDbService(dbService);
00045 }
00046