CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/SimCalorimetry/HcalTestBeam/src/HcalTBSimParameterMap.cc

Go to the documentation of this file.
00001 #include "SimCalorimetry/HcalTestBeam/interface/HcalTBSimParameterMap.h"
00002 #include "DataFormats/DetId/interface/DetId.h"
00003 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00004 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00005   
00006 
00007 HcalTBSimParameterMap::HcalTBSimParameterMap() :
00008   theHBParameters(2000., std::vector<double>(16, 0.3305), 117, 5, 10, 5, 
00009                   true, false, 1, std::vector<double>(16, 117.)),
00010   theHEParameters(2000., std::vector<double>(16, 0.3305), 178, 5, 10, 5, 
00011                   true, false, 16, std::vector<double>(16, 178.)),
00012   theHOParameters(4000., std::vector<double>(16, 0.3065), 217, 5, 10, 5, 
00013                   true, false, 1, std::vector<double>(16, 217.)) {}
00014 
00015 /*
00016   CaloSimParameters(double photomultiplierGain, double amplifierGain,
00017                  double samplingFactor, double timePhase,
00018                  int readoutFrameSize, int binOfMaximum,
00019                  bool doPhotostatistics)
00020 */
00021 
00022 HcalTBSimParameterMap::HcalTBSimParameterMap(const edm::ParameterSet & p) :
00023   theHBParameters(p.getUntrackedParameter<double>("photomultiplierGainTBHB",2000.),
00024                   p.getUntrackedParameter<std::vector<double> >("photoelectronsToAnalogTBHB",std::vector<double>(16, 0.3305)),
00025                   p.getUntrackedParameter<double>("samplingFactorTBHB",117),
00026                   p.getUntrackedParameter<double>("timePhaseTBHB",5),
00027                   p.getUntrackedParameter<int>("readoutFrameSizeTB",10),
00028                   p.getUntrackedParameter<int>("binOfMaximumTBHB",5),
00029                   p.getUntrackedParameter<bool>("doPhotostatisticsTB",true),
00030                   p.getUntrackedParameter<bool>("syncPhaseTB",true),
00031                   p.getUntrackedParameter<int>("firstRingTBHB",1), 
00032                   p.getUntrackedParameter<std::vector<double> >("samplingFactorsTBHB", std::vector<double>(16, 117.)) ),
00033   theHEParameters(p.getUntrackedParameter<double>("photomultiplierGainTBHE",2000.),
00034                   p.getUntrackedParameter<std::vector<double> >("photoelectronsToAnalogTBHE",std::vector<double>(16, 0.3305)),
00035                   p.getUntrackedParameter<double>("samplingFactorTBHE",178),
00036                   p.getUntrackedParameter<double>("timePhaseTBHE",5),
00037                   p.getUntrackedParameter<int>("readoutFrameSizeTB",10),
00038                   p.getUntrackedParameter<int>("binOfMaximumTBHE",5),
00039                   p.getUntrackedParameter<bool>("doPhotostatisticsTB",true),
00040                   p.getUntrackedParameter<bool>("syncPhaseTB",true),
00041                   p.getUntrackedParameter<int>("firstRingTBHE",16), 
00042                   p.getUntrackedParameter<std::vector<double> >("samplingFactorsTBHE", std::vector<double>(16, 178.)) ),
00043   theHOParameters(p.getUntrackedParameter<double>("photomultiplierGainTBHE",4000.),
00044                   p.getUntrackedParameter<std::vector<double> >("photoelectronsToAnalogTBHO",std::vector<double>(16, 3065)),
00045                   p.getUntrackedParameter<double>("samplingFactorTBHO",217),
00046                   p.getUntrackedParameter<double>("timePhaseTBHO",5),
00047                   p.getUntrackedParameter<int>("readoutFrameSizeTB",10),
00048                   p.getUntrackedParameter<int>("binOfMaximumTBHO",5),
00049                   p.getUntrackedParameter<bool>("doPhotostatisticsTB",true),
00050                   p.getUntrackedParameter<bool>("syncPhaseTB",true),
00051                   p.getUntrackedParameter<int>("firstRingTBHO",1), 
00052                   p.getUntrackedParameter<std::vector<double> >("samplingFactorsTBHO", std::vector<double>(16, 217.)) ) {}
00053 
00054 
00055 const CaloSimParameters & HcalTBSimParameterMap::simParameters(const DetId & detId) const {
00056   HcalDetId hcalDetId(detId);
00057   if(hcalDetId.subdet() == HcalBarrel) {
00058     return theHBParameters;
00059   } else if(hcalDetId.subdet() == HcalEndcap) {
00060     return theHEParameters;
00061   } else {
00062     return theHOParameters;
00063   }
00064 }
00065