CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/CondFormats/SiStripObjects/src/SamplingAnalysis.cc

Go to the documentation of this file.
00001 #include "CondFormats/SiStripObjects/interface/SamplingAnalysis.h"
00002 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
00003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
00004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00005 #include <iostream>
00006 #include <sstream>
00007 #include <iomanip>
00008 #include <cmath>
00009 
00010 using namespace sistrip;
00011 
00012 // ----------------------------------------------------------------------------
00013 // 
00014 SamplingAnalysis::SamplingAnalysis( const uint32_t& key ) 
00015   : CommissioningAnalysis(key,"SamplingAnalysis"),
00016     sOnCut_(3),
00017     max_(sistrip::invalid_),
00018     error_(sistrip::invalid_)
00019 {;}
00020 
00021 // ----------------------------------------------------------------------------
00022 // 
00023 SamplingAnalysis::SamplingAnalysis() 
00024   : CommissioningAnalysis("SamplingAnalysis"),
00025     sOnCut_(3),
00026     max_(sistrip::invalid_),
00027     error_(sistrip::invalid_)
00028 {;}
00029 
00030 // ----------------------------------------------------------------------------
00031 // 
00032 void SamplingAnalysis::reset() {
00033   error_ = sistrip::invalid_;
00034   max_ = sistrip::invalid_;
00035 }
00036 
00037 // ----------------------------------------------------------------------------
00038 // 
00039 void SamplingAnalysis::print( std::stringstream& ss, uint32_t not_used ) { 
00040   header( ss );
00041   ss << " Granularity: " << SiStripEnumsAndStrings::granularity(granularity_) << std::endl;
00042   ss << " Delay corresponding to the maximum of the pulse : " << max_ << std::endl
00043      << " Error on the position (from the fit)            : " << error_ << std::endl;
00044 }
00045 
00046 // ----------------------------------------------------------------------------
00047 //
00048 float SamplingAnalysis::limit(float SoNcut) const
00049 {
00050   return 3.814567e+00+8.336601e+00*SoNcut-1.511334e-01*pow(SoNcut,2);
00051 }
00052 
00053 // ----------------------------------------------------------------------------
00054 //
00055 float SamplingAnalysis::correctMeasurement(float mean, float SoNcut) const
00056 {
00057   if(mean>limit(SoNcut))
00058     return -8.124872e+00+9.860108e-01*mean-3.618158e-03*pow(mean,2)+2.037263e-05*pow(mean,3);
00059   else return 0.;
00060 }