00001 #include "CondFormats/SiStripObjects/interface/CalibrationAnalysis.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 CalibrationAnalysis::CalibrationAnalysis( const uint32_t& key, const bool& deconv, int calchan )
00015 : CommissioningAnalysis(key,"CalibrationAnalysis"),
00016 amplitude_(2,VFloat(128,sistrip::invalid_)),
00017 tail_(2,VFloat(128,sistrip::invalid_)),
00018 riseTime_(2,VFloat(128,sistrip::invalid_)),
00019 timeConstant_(2,VFloat(128,sistrip::invalid_)),
00020 smearing_(2,VFloat(128,sistrip::invalid_)),
00021 chi2_(2,VFloat(128,sistrip::invalid_)),
00022 mean_amplitude_(2,sistrip::invalid_),
00023 mean_tail_(2,sistrip::invalid_),
00024 mean_riseTime_(2,sistrip::invalid_),
00025 mean_timeConstant_(2,sistrip::invalid_),
00026 mean_smearing_(2,sistrip::invalid_),
00027 mean_chi2_(2,sistrip::invalid_),
00028 min_amplitude_(2,sistrip::invalid_),
00029 min_tail_(2,sistrip::invalid_),
00030 min_riseTime_(2,sistrip::invalid_),
00031 min_timeConstant_(2,sistrip::invalid_),
00032 min_smearing_(2,sistrip::invalid_),
00033 min_chi2_(2,sistrip::invalid_),
00034 max_amplitude_(2,sistrip::invalid_),
00035 max_tail_(2,sistrip::invalid_),
00036 max_riseTime_(2,sistrip::invalid_),
00037 max_timeConstant_(2,sistrip::invalid_),
00038 max_smearing_(2,sistrip::invalid_),
00039 max_chi2_(2,sistrip::invalid_),
00040 spread_amplitude_(2,sistrip::invalid_),
00041 spread_tail_(2,sistrip::invalid_),
00042 spread_riseTime_(2,sistrip::invalid_),
00043 spread_timeConstant_(2,sistrip::invalid_),
00044 spread_smearing_(2,sistrip::invalid_),
00045 spread_chi2_(2,sistrip::invalid_),
00046 deconv_(deconv),
00047 calchan_(calchan),
00048 isScan_(false)
00049 {;}
00050
00051
00052
00053 CalibrationAnalysis::CalibrationAnalysis(const bool& deconv, int calchan)
00054 : CommissioningAnalysis("CalibrationAnalysis"),
00055 amplitude_(2,VFloat(128,sistrip::invalid_)),
00056 tail_(2,VFloat(128,sistrip::invalid_)),
00057 riseTime_(2,VFloat(128,sistrip::invalid_)),
00058 timeConstant_(2,VFloat(128,sistrip::invalid_)),
00059 smearing_(2,VFloat(128,sistrip::invalid_)),
00060 chi2_(2,VFloat(128,sistrip::invalid_)),
00061 mean_amplitude_(2,sistrip::invalid_),
00062 mean_tail_(2,sistrip::invalid_),
00063 mean_riseTime_(2,sistrip::invalid_),
00064 mean_timeConstant_(2,sistrip::invalid_),
00065 mean_smearing_(2,sistrip::invalid_),
00066 mean_chi2_(2,sistrip::invalid_),
00067 min_amplitude_(2,sistrip::invalid_),
00068 min_tail_(2,sistrip::invalid_),
00069 min_riseTime_(2,sistrip::invalid_),
00070 min_timeConstant_(2,sistrip::invalid_),
00071 min_smearing_(2,sistrip::invalid_),
00072 min_chi2_(2,sistrip::invalid_),
00073 max_amplitude_(2,sistrip::invalid_),
00074 max_tail_(2,sistrip::invalid_),
00075 max_riseTime_(2,sistrip::invalid_),
00076 max_timeConstant_(2,sistrip::invalid_),
00077 max_smearing_(2,sistrip::invalid_),
00078 max_chi2_(2,sistrip::invalid_),
00079 spread_amplitude_(2,sistrip::invalid_),
00080 spread_tail_(2,sistrip::invalid_),
00081 spread_riseTime_(2,sistrip::invalid_),
00082 spread_timeConstant_(2,sistrip::invalid_),
00083 spread_smearing_(2,sistrip::invalid_),
00084 spread_chi2_(2,sistrip::invalid_),
00085 deconv_(deconv),
00086 calchan_(calchan),
00087 isScan_(false)
00088 {;}
00089
00090
00091
00092 void CalibrationAnalysis::reset() {
00093 amplitude_ = VVFloat(2,VFloat(128,sistrip::invalid_));
00094 tail_ = VVFloat(2,VFloat(128,sistrip::invalid_));
00095 riseTime_ = VVFloat(2,VFloat(128,sistrip::invalid_));
00096 timeConstant_ = VVFloat(2,VFloat(128,sistrip::invalid_));
00097 smearing_ = VVFloat(2,VFloat(128,sistrip::invalid_));
00098 chi2_ = VVFloat(2,VFloat(128,sistrip::invalid_));
00099 mean_amplitude_ = VFloat(2,sistrip::invalid_);
00100 mean_tail_ = VFloat(2,sistrip::invalid_);
00101 mean_riseTime_ = VFloat(2,sistrip::invalid_);
00102 mean_timeConstant_ = VFloat(2,sistrip::invalid_);
00103 mean_smearing_ = VFloat(2,sistrip::invalid_);
00104 mean_chi2_ = VFloat(2,sistrip::invalid_);
00105 min_amplitude_ = VFloat(2,sistrip::invalid_);
00106 min_tail_ = VFloat(2,sistrip::invalid_);
00107 min_riseTime_ = VFloat(2,sistrip::invalid_);
00108 min_timeConstant_ = VFloat(2,sistrip::invalid_);
00109 min_smearing_ = VFloat(2,sistrip::invalid_);
00110 min_chi2_ = VFloat(2,sistrip::invalid_);
00111 max_amplitude_ = VFloat(2,sistrip::invalid_);
00112 max_tail_ = VFloat(2,sistrip::invalid_);
00113 max_riseTime_ = VFloat(2,sistrip::invalid_);
00114 max_timeConstant_ = VFloat(2,sistrip::invalid_);
00115 max_smearing_ = VFloat(2,sistrip::invalid_);
00116 max_chi2_ = VFloat(2,sistrip::invalid_);
00117 spread_amplitude_ = VFloat(2,sistrip::invalid_);
00118 spread_tail_ = VFloat(2,sistrip::invalid_);
00119 spread_riseTime_ = VFloat(2,sistrip::invalid_);
00120 spread_timeConstant_ = VFloat(2,sistrip::invalid_);
00121 spread_smearing_ = VFloat(2,sistrip::invalid_);
00122 spread_chi2_ = VFloat(2,sistrip::invalid_);
00123 }
00124
00125
00126
00127 void CalibrationAnalysis::print( std::stringstream& ss, uint32_t iapv ) {
00128 header( ss );
00129 ss << " Monitorables for APV number : " << iapv;
00130 if ( iapv == 0 ) { ss << " (first of pair)"; }
00131 else if ( iapv == 1 ) { ss << " (second of pair)"; }
00132 ss << std::endl;
00133 ss << " Mean Amplitude of the pulse : " << mean_amplitude_[iapv] << std::endl
00134 << " Mean Tail amplitude after 150ns : " << mean_tail_[iapv] << std::endl
00135 << " Mean Rise time : " << mean_riseTime_[iapv] << std::endl
00136 << " Mean Time constant : " << mean_timeConstant_[iapv] << std::endl
00137 << " Mean Smearing parameter : " << mean_smearing_[iapv] << std::endl
00138 << " Mean Chi2 of the fit : " << mean_chi2_[iapv] << std::endl;
00139 if(deconvMode()) {
00140 ss << "Data obtained in deconvolution mode." << std::endl;
00141 } else {
00142 ss << "Data obtained in peak mode." << std::endl;
00143 }
00144 }
00145