CMS 3D CMS Logo

Public Member Functions

FastFedCablingHistograms Class Reference

#include <FastFedCablingHistograms.h>

Inheritance diagram for FastFedCablingHistograms:
CommissioningHistograms FastFedCablingHistosUsingDb

List of all members.

Public Member Functions

 FastFedCablingHistograms (const edm::ParameterSet &pset, DQMStore *)
void histoAnalysis (bool debug)
void printAnalyses ()
void printSummary ()
virtual ~FastFedCablingHistograms ()

Detailed Description

Definition at line 8 of file FastFedCablingHistograms.h.


Constructor & Destructor Documentation

FastFedCablingHistograms::FastFedCablingHistograms ( const edm::ParameterSet pset,
DQMStore bei 
)

Definition at line 18 of file FastFedCablingHistograms.cc.

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

  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FastFedCablingParameters"),
                             bei,
                             sistrip::FAST_CABLING )
{
  factory_ = auto_ptr<FastFedCablingSummaryFactory>( new FastFedCablingSummaryFactory );
  LogTrace(mlDqmClient_) 
    << "[FastFedCablingHistograms::" << __func__ << "]"
    << " Constructing object...";
}
FastFedCablingHistograms::~FastFedCablingHistograms ( ) [virtual]

Definition at line 32 of file FastFedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

                                                    {
  LogTrace(mlDqmClient_) 
    << "[FastFedCablingHistograms::" << __func__ << "]"
    << " Destructing object...";
}

Member Function Documentation

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

Reimplemented from CommissioningHistograms.

Definition at line 40 of file FastFedCablingHistograms.cc.

References CommissioningAlgorithm::analysis(), begin, prof2calltree::count, CommissioningHistograms::data(), relativeConstraints::empty, end, benchmark_cfg::errors, extract(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), cuy::ii, FastFedCablingAnalysis::isValid(), LogTrace, CommissioningHistograms::mapping(), sistrip::mlDqmClient_, CommissioningHistograms::pset(), and TrackValidation_HighPurity_cff::valid.

                                                         {
  LogTrace(mlDqmClient_)
    << "[FastFedCablingHistograms::" << __func__ << "]";

  // Some initialisation
  uint16_t valid = 0;
  HistosMap::const_iterator iter;
  Analyses::iterator ianal;
  std::map<std::string,uint16_t> errors;
  
  // Clear map holding analysis objects
  for ( ianal = data().begin(); ianal != data().end(); ianal++ ) { 
    if ( ianal->second ) { delete ianal->second; }
  } 
  data().clear();
  
  // Iterate through map containing histograms
  for ( iter = histos().begin(); 
        iter != histos().end(); iter++ ) {
    
    // Check vector of histos is not empty
    if ( iter->second.empty() ) {
      edm::LogWarning(mlDqmClient_)
        << "[FastFedCablingHistograms::" << __func__ << "]"
        << " Zero histograms found!";
      continue;
    }
    
    // Retrieve pointers to histos
    std::vector<TH1*> profs;
    Histos::const_iterator ihis = iter->second.begin(); 
    for ( ; ihis != iter->second.end(); ihis++ ) {
      TProfile* prof = ExtractTObject<TProfile>().extract( (*ihis)->me_ );
      if ( prof ) { profs.push_back(prof); }
    } 
    
    // Perform histo analysis
    FastFedCablingAnalysis* anal = new FastFedCablingAnalysis( iter->first );
    FastFedCablingAlgorithm algo( this->pset(), anal );
    FedToFecMap::const_iterator ifed = mapping().find( iter->first );
    if ( ifed != mapping().end() ) { anal->fecKey( ifed->second ); }
    algo.analysis( profs );
    data()[iter->first] = anal; 
    if ( anal->isValid() ) { valid++; }
    if ( !anal->getErrorCodes().empty() ) { 
      errors[anal->getErrorCodes()[0]]++;
    }
    
  }
  
  if ( !histos().empty() ) {
    edm::LogVerbatim(mlDqmClient_) 
      << "[FastFedCablingHistograms::" << __func__ << "]"
      << " Analyzed histograms for " << histos().size() 
      << " FED channels, of which " << valid 
      << " (" << 100 * valid / histos().size()
      << "%) are valid.";
    if ( !errors.empty() ) {
      uint16_t count = 0;
      std::stringstream ss;
      ss << std::endl;
      std::map<std::string,uint16_t>::const_iterator ii;
      for ( ii = errors.begin(); ii != errors.end(); ++ii ) { 
        ss << " " << ii->first << ": " << ii->second << std::endl;
        count += ii->second;
      }
      edm::LogWarning(mlDqmClient_) 
        << "[FastFedCablingHistograms::" << __func__ << "]"
        << " Found " << count << " error strings: "
        << ss.str();
    }
  } else {
    edm::LogWarning(mlDqmClient_) 
      << "[FastFedCablingHistograms::" << __func__ << "]"
      << " No histograms to analyze!";
  }
  
}
void FastFedCablingHistograms::printAnalyses ( ) [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 121 of file FastFedCablingHistograms.cc.

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

                                             {
  Analyses::iterator ianal = data().begin();
  Analyses::iterator janal = data().end();
  for ( ; ianal != janal; ++ianal ) { 

    FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( ianal->second );
    if ( !anal ) { 
      edm::LogError(mlDqmClient_)
        << "[FastFedCablingHistograms::" << __func__ << "]"
        << " NULL pointer to analysis object!";
      continue; 
    }

    std::stringstream ss;
    anal->print( ss ); 
    if ( anal->isValid() &&
         !(anal->isDirty()) && 
         !(anal->badTrimDac()) ) { LogTrace(mlDqmClient_) << ss.str(); 
    } else { edm::LogWarning(mlDqmClient_) << ss.str(); }

  }

}
void FastFedCablingHistograms::printSummary ( ) [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 147 of file FastFedCablingHistograms.cc.

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

                                            {

  std::stringstream good;
  std::stringstream bad;
  
  Analyses::iterator ianal = data().begin();
  Analyses::iterator janal = data().end();
  for ( ; ianal != janal; ++ianal ) { 

    FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( ianal->second );
    if ( !anal ) { 
      edm::LogError(mlDqmClient_)
        << "[FastFedCablingHistograms::" << __func__ << "]"
        << " NULL pointer to analysis object!";
      continue; 
    }

    if ( anal->isValid() &&
         !(anal->isDirty()) && 
         !(anal->badTrimDac()) ) { 
      anal->summary( good ); 
    } else { anal->summary( bad ); }

  }

  if ( good.str().empty() ) { good << "None found!"; }
  LogTrace(mlDqmClient_) 
    << "[FastFedCablingHistograms::" << __func__ << "]"
    << " Printing summary of good analyses:" << "\n"
    << good.str();
  
  if ( bad.str().empty() ) { return; } //@@ bad << "None found!"; }
  LogTrace(mlDqmClient_) 
    << "[FastFedCablingHistograms::" << __func__ << "]"
    << " Printing summary of bad analyses:" << "\n"
    << bad.str();
  
}