Go to the documentation of this file.00001 #include "DQM/SiStripCommissioningClients/interface/FedTimingHistograms.h"
00002 #include "CondFormats/SiStripObjects/interface/FedTimingAnalysis.h"
00003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
00004 #include "DQM/SiStripCommissioningAnalysis/interface/FedTimingAlgorithm.h"
00005 #include "DQM/SiStripCommissioningSummary/interface/SummaryGenerator.h"
00006 #include <iostream>
00007 #include <sstream>
00008 #include <iomanip>
00009
00010 using namespace std;
00011
00012
00014 FedTimingHistograms::FedTimingHistograms( const edm::ParameterSet& pset,
00015 DQMStore* bei )
00016 : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FedTimingParameters"),
00017 bei,
00018 sistrip::FED_TIMING ),
00019 factory_( new Factory ),
00020 optimumSamplingPoint_(15.),
00021 minDelay_(sistrip::invalid_),
00022 maxDelay_(-1.*sistrip::invalid_),
00023 deviceWithMinDelay_(sistrip::invalid_),
00024 deviceWithMaxDelay_(sistrip::invalid_)
00025 {
00026 cout << "[" << __PRETTY_FUNCTION__ << "]"
00027 << " Created object for APV TIMING histograms" << endl;
00028 }
00029
00030
00032 FedTimingHistograms::~FedTimingHistograms() {
00033 cout << "[" << __PRETTY_FUNCTION__ << "]" << endl;
00034 }
00035
00036
00038 void FedTimingHistograms::histoAnalysis( bool debug ) {
00039
00040
00041 data_.clear();
00042
00043
00044 float time_min = 1. * sistrip::invalid_;
00045 float time_max = -1. * sistrip::invalid_;
00046 uint32_t device_min = sistrip::invalid_;
00047 uint32_t device_max = sistrip::invalid_;
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 if ( time_max > sistrip::maximum_ ||
00106 time_max < -1.*sistrip::maximum_ ) {
00107 cerr << "[" << __PRETTY_FUNCTION__ << "]"
00108 << " Unable to set maximum time! Found unexpected value: "
00109 << time_max << endl;
00110 return;
00111 }
00112
00113 SiStripFecKey max( device_max );
00114 cout << " Device (FEC/slot/ring/CCU/module/channel) "
00115 << max.fecCrate() << "/"
00116 << max.fecSlot() << "/"
00117 << max.fecRing() << "/"
00118 << max.ccuAddr() << "/"
00119 << max.ccuChan() << "/"
00120 << " has maximum delay (rising edge) [ns]:" << time_max << endl;
00121
00122 SiStripFecKey min( device_min );
00123 cout << " Device (FEC/slot/ring/CCU/module/channel): "
00124 << min.fecCrate() << "/"
00125 << min.fecSlot() << "/"
00126 << min.fecRing() << "/"
00127 << min.ccuAddr() << "/"
00128 << min.ccuChan() << "/"
00129 << " has minimum delay (rising edge) [ns]:" << time_min << endl;
00130
00131
00132 std::map<uint32_t,FedTimingAnalysis>::iterator ianal = data_.begin();
00133 for ( ; ianal != data_.end(); ianal++ ) {
00134 ianal->second.max( time_max );
00135 static uint16_t cntr = 0;
00136 if ( debug ) {
00137 std::stringstream ss;
00138 ianal->second.print( ss );
00139 cout << ss.str() << endl;
00140 cntr++;
00141 }
00142 }
00143
00144 }
00145
00146
00148 void FedTimingHistograms::createSummaryHisto( const sistrip::Monitorable& histo,
00149 const sistrip::Presentation& type,
00150 const std::string& directory,
00151 const sistrip::Granularity& gran ) {
00152 cout << "[" << __PRETTY_FUNCTION__ <<"]" << endl;
00153
00154
00155 sistrip::View view = SiStripEnumsAndStrings::view(directory);
00156 if ( view == sistrip::UNKNOWN_VIEW ) { return; }
00157
00158
00159 histoAnalysis( false );
00160
00161
00162 factory_->init( histo, type, view, directory, gran );
00163 uint32_t xbins = factory_->extract( data_ );
00164
00165
00166 TH1* summary = histogram( histo, type, view, directory, xbins );
00167
00168
00169 factory_->fill( *summary );
00170
00171 }