Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:40

0001 #include "CondFormats/SiStripObjects/interface/SamplingAnalysis.h"
0002 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
0003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include <iostream>
0006 #include <sstream>
0007 #include <iomanip>
0008 #include <cmath>
0009 
0010 using namespace sistrip;
0011 
0012 // ----------------------------------------------------------------------------
0013 //
0014 SamplingAnalysis::SamplingAnalysis(const uint32_t& key)
0015     : CommissioningAnalysis(key, "SamplingAnalysis"), sOnCut_(3), max_(sistrip::invalid_), error_(sistrip::invalid_) {
0016   ;
0017 }
0018 
0019 // ----------------------------------------------------------------------------
0020 //
0021 SamplingAnalysis::SamplingAnalysis()
0022     : CommissioningAnalysis("SamplingAnalysis"), sOnCut_(3), max_(sistrip::invalid_), error_(sistrip::invalid_) {
0023   ;
0024 }
0025 
0026 // ----------------------------------------------------------------------------
0027 //
0028 void SamplingAnalysis::reset() {
0029   error_ = sistrip::invalid_;
0030   max_ = sistrip::invalid_;
0031 }
0032 
0033 // ----------------------------------------------------------------------------
0034 //
0035 void SamplingAnalysis::print(std::stringstream& ss, uint32_t not_used) {
0036   header(ss);
0037   ss << " Granularity: " << SiStripEnumsAndStrings::granularity(granularity_) << std::endl;
0038   ss << " Delay corresponding to the maximum of the pulse : " << max_ << std::endl
0039      << " Error on the position (from the fit)            : " << error_ << std::endl;
0040 }
0041 
0042 // ----------------------------------------------------------------------------
0043 //
0044 float SamplingAnalysis::limit(float SoNcut) const {
0045   return 3.814567e+00 + 8.336601e+00 * SoNcut - 1.511334e-01 * pow(SoNcut, 2);
0046 }
0047 
0048 // ----------------------------------------------------------------------------
0049 //
0050 float SamplingAnalysis::correctMeasurement(float mean, float SoNcut) const {
0051   if (mean > limit(SoNcut))
0052     return -8.124872e+00 + 9.860108e-01 * mean - 3.618158e-03 * pow(mean, 2) + 2.037263e-05 * pow(mean, 3);
0053   else
0054     return 0.;
0055 }