CMS 3D CMS Logo

FastFedCablingHistograms Class Reference

#include <DQM/SiStripCommissioningClients/interface/FastFedCablingHistograms.h>

Inheritance diagram for FastFedCablingHistograms:

CommissioningHistograms FastFedCablingHistosUsingDb

List of all members.

Public Member Functions

 FastFedCablingHistograms (DQMStore *)
 FastFedCablingHistograms (DQMOldReceiver *)
void histoAnalysis (bool debug)
void printAnalyses ()
void printSummary ()
virtual ~FastFedCablingHistograms ()


Detailed Description

Definition at line 9 of file FastFedCablingHistograms.h.


Constructor & Destructor Documentation

FastFedCablingHistograms::FastFedCablingHistograms ( DQMOldReceiver mui  ) 

Definition at line 18 of file FastFedCablingHistograms.cc.

References CommissioningHistograms::factory_, LogTrace, and sistrip::mlDqmClient_.

00019   : CommissioningHistograms( mui, sistrip::FAST_CABLING )
00020 {
00021   factory_ = auto_ptr<FastFedCablingSummaryFactory>( new FastFedCablingSummaryFactory );
00022   LogTrace(mlDqmClient_) 
00023     << "[FastFedCablingHistograms::" << __func__ << "]"
00024     << " Constructing object...";
00025 }

FastFedCablingHistograms::FastFedCablingHistograms ( DQMStore bei  ) 

Definition at line 29 of file FastFedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

00030   : CommissioningHistograms( bei, sistrip::FAST_CABLING )
00031 {
00032   LogTrace(mlDqmClient_) 
00033     << "[FastFedCablingHistograms::" << __func__ << "]"
00034     << " Constructing object...";
00035 }

FastFedCablingHistograms::~FastFedCablingHistograms (  )  [virtual]

Definition at line 39 of file FastFedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

00039                                                     {
00040   LogTrace(mlDqmClient_) 
00041     << "[FastFedCablingHistograms::" << __func__ << "]"
00042     << " Destructing object...";
00043 }


Member Function Documentation

void FastFedCablingHistograms::histoAnalysis ( bool  debug  )  [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 47 of file FastFedCablingHistograms.cc.

References CommissioningAlgorithm::analysis(), begin, count, CommissioningHistograms::data(), empty, end, lat::endl(), HLT_VtxMuL3::errors, extract(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), FastFedCablingAnalysis::isValid(), iter, LogTrace, CommissioningHistograms::mapping(), sistrip::mlDqmClient_, ss, and TrackValidation_HighPurity_cff::valid.

00047                                                          {
00048   LogTrace(mlDqmClient_)
00049     << "[FastFedCablingHistograms::" << __func__ << "]";
00050 
00051   // Some initialisation
00052   uint16_t valid = 0;
00053   HistosMap::const_iterator iter;
00054   Analyses::iterator ianal;
00055   std::map<std::string,uint16_t> errors;
00056   
00057   // Clear map holding analysis objects
00058   for ( ianal = data().begin(); ianal != data().end(); ianal++ ) { 
00059     if ( ianal->second ) { delete ianal->second; }
00060   } 
00061   data().clear();
00062   
00063   // Iterate through map containing histograms
00064   for ( iter = histos().begin(); 
00065         iter != histos().end(); iter++ ) {
00066     
00067     // Check vector of histos is not empty
00068     if ( iter->second.empty() ) {
00069       edm::LogWarning(mlDqmClient_)
00070         << "[FastFedCablingHistograms::" << __func__ << "]"
00071         << " Zero histograms found!";
00072       continue;
00073     }
00074     
00075     // Retrieve pointers to histos
00076     std::vector<TH1*> profs;
00077     Histos::const_iterator ihis = iter->second.begin(); 
00078     for ( ; ihis != iter->second.end(); ihis++ ) {
00079       TProfile* prof = ExtractTObject<TProfile>().extract( (*ihis)->me_ );
00080       if ( prof ) { profs.push_back(prof); }
00081     } 
00082     
00083     // Perform histo analysis
00084     FastFedCablingAnalysis* anal = new FastFedCablingAnalysis( iter->first );
00085     FastFedCablingAlgorithm algo( anal );
00086     FedToFecMap::const_iterator ifed = mapping().find( iter->first );
00087     if ( ifed != mapping().end() ) { anal->fecKey( ifed->second ); }
00088     algo.analysis( profs );
00089     data()[iter->first] = anal; 
00090     if ( anal->isValid() ) { valid++; }
00091     if ( !anal->getErrorCodes().empty() ) { 
00092       errors[anal->getErrorCodes()[0]]++;
00093     }
00094     
00095   }
00096   
00097   if ( !histos().empty() ) {
00098     edm::LogVerbatim(mlDqmClient_) 
00099       << "[FastFedCablingHistograms::" << __func__ << "]"
00100       << " Analyzed histograms for " << histos().size() 
00101       << " FED channels, of which " << valid 
00102       << " (" << 100 * valid / histos().size()
00103       << "%) are valid.";
00104     if ( !errors.empty() ) {
00105       uint16_t count = 0;
00106       std::stringstream ss;
00107       ss << std::endl;
00108       std::map<std::string,uint16_t>::const_iterator ii;
00109       for ( ii = errors.begin(); ii != errors.end(); ++ii ) { 
00110         ss << " " << ii->first << ": " << ii->second << std::endl;
00111         count += ii->second;
00112       }
00113       edm::LogWarning(mlDqmClient_) 
00114         << "[FastFedCablingHistograms::" << __func__ << "]"
00115         << " Found " << count << " error strings: "
00116         << ss.str();
00117     }
00118   } else {
00119     edm::LogWarning(mlDqmClient_) 
00120       << "[FastFedCablingHistograms::" << __func__ << "]"
00121       << " No histograms to analyze!";
00122   }
00123   
00124 }

void FastFedCablingHistograms::printAnalyses (  )  [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 128 of file FastFedCablingHistograms.cc.

References FastFedCablingAnalysis::badTrimDac(), CommissioningHistograms::data(), FastFedCablingAnalysis::isDirty(), FastFedCablingAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, FastFedCablingAnalysis::print(), and ss.

00128                                              {
00129   Analyses::iterator ianal = data().begin();
00130   Analyses::iterator janal = data().end();
00131   for ( ; ianal != janal; ++ianal ) { 
00132 
00133     FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( ianal->second );
00134     if ( !anal ) { 
00135       edm::LogError(mlDqmClient_)
00136         << "[FastFedCablingHistograms::" << __func__ << "]"
00137         << " NULL pointer to analysis object!";
00138       continue; 
00139     }
00140 
00141     std::stringstream ss;
00142     anal->print( ss ); 
00143     if ( anal->isValid() &&
00144          !(anal->isDirty()) && 
00145          !(anal->badTrimDac()) ) { LogTrace(mlDqmClient_) << ss.str(); 
00146     } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
00147 
00148   }
00149 
00150 }

void FastFedCablingHistograms::printSummary (  )  [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 154 of file FastFedCablingHistograms.cc.

References FastFedCablingAnalysis::badTrimDac(), CommissioningHistograms::data(), FastFedCablingAnalysis::isDirty(), FastFedCablingAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, and FastFedCablingAnalysis::summary().

00154                                             {
00155 
00156   std::stringstream good;
00157   std::stringstream bad;
00158   
00159   Analyses::iterator ianal = data().begin();
00160   Analyses::iterator janal = data().end();
00161   for ( ; ianal != janal; ++ianal ) { 
00162 
00163     FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( ianal->second );
00164     if ( !anal ) { 
00165       edm::LogError(mlDqmClient_)
00166         << "[FastFedCablingHistograms::" << __func__ << "]"
00167         << " NULL pointer to analysis object!";
00168       continue; 
00169     }
00170 
00171     if ( anal->isValid() &&
00172          !(anal->isDirty()) && 
00173          !(anal->badTrimDac()) ) { 
00174       anal->summary( good ); 
00175     } else { anal->summary( bad ); }
00176 
00177   }
00178 
00179   if ( good.str().empty() ) { good << "None found!"; }
00180   LogTrace(mlDqmClient_) 
00181     << "[FastFedCablingHistograms::" << __func__ << "]"
00182     << " Printing summary of good analyses:" << "\n"
00183     << good.str();
00184   
00185   if ( bad.str().empty() ) { return; } //@@ bad << "None found!"; }
00186   LogTrace(mlDqmClient_) 
00187     << "[FastFedCablingHistograms::" << __func__ << "]"
00188     << " Printing summary of bad analyses:" << "\n"
00189     << bad.str();
00190   
00191 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:41 2009 for CMSSW by  doxygen 1.5.4