CMS 3D CMS Logo

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( DQMOldReceiver* mui ) 
00018   : CommissioningHistograms( mui, sistrip::DAQ_SCOPE_MODE ),
00019     factory_( new Factory )
00020 {
00021   cout << endl // LogTrace(mlDqmClient_) 
00022        << "[DaqScopeModeHistograms::" << __func__ << "]"
00023        << " Constructing object...";
00024 }
00025 
00026 // -----------------------------------------------------------------------------
00028 DaqScopeModeHistograms::~DaqScopeModeHistograms() {
00029   cout << endl // LogTrace(mlDqmClient_) 
00030        << "[DaqScopeModeHistograms::" << __func__ << "]"
00031        << " Constructing object...";
00032 }
00033 
00034 // -----------------------------------------------------------------------------         
00036 void DaqScopeModeHistograms::histoAnalysis( bool debug ) {
00037 
00038   // Clear std::map holding analysis objects
00039   data_.clear();
00040   
00041 //   // Iterate through std::map containing std::vectors of profile histograms
00042 //   CollationsMap::const_iterator iter = collations().begin();
00043 //   for ( ; iter != collations().end(); iter++ ) {
00044     
00045 //     // Check std::vector of histos is not empty (should be 1 histo)
00046 //     if ( iter->second.empty() ) {
00047 //       edm::LogWarning(mlDqmClient_) 
00048 //      << "[DaqScopeModeHistograms::" << __func__ << "]"
00049 //      << " Zero collation histograms found!";
00050 //       continue;
00051 //     }
00052     
00053 //     // Retrieve pointers to profile histos for this FED channel 
00054 //     std::vector<TH1*> histos;
00055 //     Collations::const_iterator ihis = iter->second.begin(); 
00056 //     for ( ; ihis != iter->second.end(); ihis++ ) {
00057 //       TH1F* his = ExtractTObject<TH1F>().extract( ihis->second->getMonitorElement() );
00058 //       if ( his ) { histos.push_back(his); }
00059 //     } 
00060     
00061 //     // Perform histo analysis
00062 //     DaqScopeModeAnalysis anal( iter->first );
00063 //     DaqScopeModeAlgorithm algo( &anal );
00064 //     algo.analysis( histos );
00065 //     data_[iter->first] = anal; 
00066 //     if ( debug ) {
00067 //       std::stringstream ss;
00068 //       anal.print( ss ); 
00069 //       cout << ss.str() << endl;
00070 //     }
00071     
00072 //   }
00073   
00074 //   cout << endl // LogTrace(mlDqmClient_) 
00075 //        << "[DaqScopeModeHistograms::" << __func__ << "]"
00076 //        << " Analyzed histograms for " 
00077 //        << collations().size() 
00078 //        << " FED channels";
00079   
00080 }
00081 
00082 // -----------------------------------------------------------------------------
00084 void DaqScopeModeHistograms::createSummaryHisto( const sistrip::Monitorable& histo, 
00085                                                  const sistrip::Presentation& type, 
00086                                                  const std::string& directory,
00087                                                  const sistrip::Granularity& gran ) {
00088   cout << endl // LogTrace(mlDqmClient_)
00089        << "[DaqScopeModeHistograms::" << __func__ << "]";
00090   
00091   // Check view 
00092   sistrip::View view = SiStripEnumsAndStrings::view(directory);
00093   if ( view == sistrip::UNKNOWN_VIEW ) { return; }
00094 
00095   // Analyze histograms
00096   histoAnalysis( false );
00097 
00098   // Extract data to be histogrammed
00099   factory_->init( histo, type, view, directory, gran );
00100   uint32_t xbins = factory_->extract( data_ );
00101 
00102   // Create summary histogram (if it doesn't already exist)
00103   TH1* summary = histogram( histo, type, view, directory, xbins );
00104 
00105   // Fill histogram with data
00106   factory_->fill( *summary );
00107   
00108 }

Generated on Tue Jun 9 17:33:28 2009 for CMSSW by  doxygen 1.5.4