CMS 3D CMS Logo

SiStripLAFakeESSource.cc

Go to the documentation of this file.
00001 #include "CalibTracker/SiStripLorentzAngle/plugins/SiStripLAFakeESSource.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
00004 
00005 
00006 #include <iostream>
00007 #include<cmath>
00008 
00009 
00010 SiStripLAFakeESSource::SiStripLAFakeESSource( const edm::ParameterSet& conf_ ) {
00011 
00012   edm::LogInfo("SiStripLAFakeESSource::SiStripLAFakeESSource");
00013 
00014   setWhatProduced( this );
00015   findingRecord<SiStripLorentzAngleRcd>();
00016 
00017 
00018   fp_ = conf_.getParameter<edm::FileInPath>("file");
00019   appliedVoltage_   = conf_.getParameter<double>("AppliedVoltage");
00020   chargeMobility_   = conf_.getParameter<double>("ChargeMobility");
00021   temperature_      = conf_.getParameter<double>("Temperature");
00022   temperatureerror_      = conf_.getParameter<double>("TemperatureError");
00023   rhall_            = conf_.getParameter<double>("HoleRHAllParameter");
00024   holeBeta_         = conf_.getParameter<double>("HoleBeta");
00025   holeSaturationVelocity_ = conf_.getParameter<double>("HoleSaturationVelocity");
00026 
00027 
00028 }
00029 
00030 
00031 std::auto_ptr<SiStripLorentzAngle> SiStripLAFakeESSource::produce( const SiStripLorentzAngleRcd& ) { 
00032   
00033   SiStripLorentzAngle * obj = new SiStripLorentzAngle();
00034 
00035   SiStripDetInfoFileReader reader(fp_.fullPath());
00036   //  SiStripDetInfoFileReader reader("");
00037 
00038   const std::vector<uint32_t> DetIds = reader.getAllDetIds();
00039   float mulow = chargeMobility_*std::pow((temperature_/300.),-2.5);
00040   float vsat = holeSaturationVelocity_*std::pow((temperature_/300.),0.52);
00041   float beta = holeBeta_*std::pow((temperature_/300.),0.17);
00042   
00043   for(std::vector<uint32_t>::const_iterator detit=DetIds.begin(); detit!=DetIds.end(); detit++){
00044 
00045     const float & thickness=reader.getThickness(*detit);
00046     float e = appliedVoltage_/thickness;
00047     float mu = ( mulow/(pow(double((1+pow((mulow*e/vsat),beta))),1./beta)));
00048     float hallMobility = 1.E-4*mu*rhall_;
00049     
00050     
00051     if ( ! obj->putLorentzAngle(*detit, hallMobility) )
00052       edm::LogError("SiStripLAFakeESSource::produce ")<<" detid already exists"<<std::endl;
00053     
00054   }
00055   
00056 
00057   return std::auto_ptr<SiStripLorentzAngle>(obj);
00058 
00059 
00060 }
00061 
00062 
00063 void SiStripLAFakeESSource::setIntervalFor( const edm::eventsetup::EventSetupRecordKey&, 
00064                                                 const edm::IOVSyncValue& iosv, 
00065                                                 edm::ValidityInterval& oValidity ) {
00066 
00067   edm::ValidityInterval infinity( iosv.beginOfTime(), iosv.endOfTime() );
00068   oValidity = infinity;
00069   
00070 }
00071 

Generated on Tue Jun 9 17:25:51 2009 for CMSSW by  doxygen 1.5.4