CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/DQM/SiStripCommissioningClients/src/DaqScopeModeHistograms.cc

Go to the documentation of this file.
00001 #include "DQM/SiStripCommissioningClients/interface/DaqScopeModeHistograms.h"
00002 #include "CondFormats/SiStripObjects/interface/DaqScopeModeAnalysis.h"
00003 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
00004 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
00005 #include "DQM/SiStripCommissioningAnalysis/interface/DaqScopeModeAlgorithm.h"
00006 #include "DQM/SiStripCommissioningSummary/interface/SummaryGenerator.h"
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008 #include <iostream>
00009 #include <sstream>
00010 #include <iomanip>
00011  
00012 using namespace std;
00013 using namespace sistrip;
00014 
00015 // -----------------------------------------------------------------------------
00017 DaqScopeModeHistograms::DaqScopeModeHistograms( const edm::ParameterSet& pset,
00018                                                 DQMStore* bei ) 
00019   : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("DaqScopeModeParameters"),
00020                              bei,
00021                              sistrip::DAQ_SCOPE_MODE ),
00022     factory_( new Factory )
00023 {
00024   cout << endl // LogTrace(mlDqmClient_) 
00025        << "[DaqScopeModeHistograms::" << __func__ << "]"
00026        << " Constructing object...";
00027 }
00028 
00029 // -----------------------------------------------------------------------------
00031 DaqScopeModeHistograms::~DaqScopeModeHistograms() {
00032   cout << endl // LogTrace(mlDqmClient_) 
00033        << "[DaqScopeModeHistograms::" << __func__ << "]"
00034        << " Constructing object...";
00035 }
00036 
00037 // -----------------------------------------------------------------------------         
00039 void DaqScopeModeHistograms::histoAnalysis( bool debug ) {
00040 
00041   // Clear std::map holding analysis objects
00042   data_.clear();
00043   
00044 //   // Iterate through std::map containing std::vectors of profile histograms
00045 //   CollationsMap::const_iterator iter = collations().begin();
00046 //   for ( ; iter != collations().end(); iter++ ) {
00047     
00048 //     // Check std::vector of histos is not empty (should be 1 histo)
00049 //     if ( iter->second.empty() ) {
00050 //       edm::LogWarning(mlDqmClient_) 
00051 //      << "[DaqScopeModeHistograms::" << __func__ << "]"
00052 //      << " Zero collation histograms found!";
00053 //       continue;
00054 //     }
00055     
00056 //     // Retrieve pointers to profile histos for this FED channel 
00057 //     std::vector<TH1*> histos;
00058 //     Collations::const_iterator ihis = iter->second.begin(); 
00059 //     for ( ; ihis != iter->second.end(); ihis++ ) {
00060 //       TH1F* his = ExtractTObject<TH1F>().extract( ihis->second->getMonitorElement() );
00061 //       if ( his ) { histos.push_back(his); }
00062 //     } 
00063     
00064 //     // Perform histo analysis
00065 //     DaqScopeModeAnalysis anal( iter->first );
00066 //     DaqScopeModeAlgorithm algo( &anal );
00067 //     algo.analysis( histos );
00068 //     data_[iter->first] = anal; 
00069 //     if ( debug ) {
00070 //       std::stringstream ss;
00071 //       anal.print( ss ); 
00072 //       cout << ss.str() << endl;
00073 //     }
00074     
00075 //   }
00076   
00077 //   cout << endl // LogTrace(mlDqmClient_) 
00078 //        << "[DaqScopeModeHistograms::" << __func__ << "]"
00079 //        << " Analyzed histograms for " 
00080 //        << collations().size() 
00081 //        << " FED channels";
00082   
00083 }
00084 
00085 // -----------------------------------------------------------------------------
00087 void DaqScopeModeHistograms::createSummaryHisto( const sistrip::Monitorable& histo, 
00088                                                  const sistrip::Presentation& type, 
00089                                                  const std::string& directory,
00090                                                  const sistrip::Granularity& gran ) {
00091   cout << endl // LogTrace(mlDqmClient_)
00092        << "[DaqScopeModeHistograms::" << __func__ << "]";
00093   
00094   // Check view 
00095   sistrip::View view = SiStripEnumsAndStrings::view(directory);
00096   if ( view == sistrip::UNKNOWN_VIEW ) { return; }
00097 
00098   // Analyze histograms
00099   histoAnalysis( false );
00100 
00101   // Extract data to be histogrammed
00102   factory_->init( histo, type, view, directory, gran );
00103   uint32_t xbins = factory_->extract( data_ );
00104 
00105   // Create summary histogram (if it doesn't already exist)
00106   TH1* summary = histogram( histo, type, view, directory, xbins );
00107 
00108   // Fill histogram with data
00109   factory_->fill( *summary );
00110   
00111 }