CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Attributes

FedCablingHistograms Class Reference

#include <FedCablingHistograms.h>

Inheritance diagram for FedCablingHistograms:
CommissioningHistograms

List of all members.

Public Types

typedef std::map< uint32_t,
FedCablingAnalysis * > 
Analyses
typedef SummaryPlotFactory
< FedCablingAnalysis * > 
Factory

Public Member Functions

void createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
 FedCablingHistograms (const edm::ParameterSet &pset, DQMStore *)
void histoAnalysis (bool debug)
void printAnalyses ()
virtual ~FedCablingHistograms ()

Protected Attributes

Analyses data_
std::auto_ptr< Factoryfactory_

Detailed Description

Definition at line 11 of file FedCablingHistograms.h.


Member Typedef Documentation

Reimplemented from CommissioningHistograms.

Definition at line 19 of file FedCablingHistograms.h.

Reimplemented from CommissioningHistograms.

Definition at line 18 of file FedCablingHistograms.h.


Constructor & Destructor Documentation

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

Definition at line 19 of file FedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FedCablingParameters"),
                             bei,
                             sistrip::FED_CABLING ),
    factory_( new Factory )
{
  LogTrace(mlDqmClient_) 
    << "[FedCablingHistograms::" << __func__ << "]"
    << " Constructing object...";
}
FedCablingHistograms::~FedCablingHistograms ( ) [virtual]

Definition at line 33 of file FedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void FedCablingHistograms::createSummaryHisto ( const sistrip::Monitorable histo,
const sistrip::Presentation type,
const std::string &  dir,
const sistrip::Granularity gran 
) [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 116 of file FedCablingHistograms.cc.

References data_, factory_, histoAnalysis(), CommissioningHistograms::histogram(), LogTrace, sistrip::mlDqmClient_, summarizeEdmComparisonLogfiles::summary, sistrip::UNKNOWN_VIEW, SiStripEnumsAndStrings::view(), and fw3dlego::xbins.

                                                                                {
  LogTrace(mlDqmClient_)
    << "[FedCablingHistograms::" << __func__ << "]";
  
  // Check view 
  sistrip::View view = SiStripEnumsAndStrings::view(dir);
  if ( view == sistrip::UNKNOWN_VIEW ) { return; }
  
  // Analyze histograms if not done already
  if ( data_.empty() ) { histoAnalysis( false ); }
  
  // Extract data to be histogrammed
  uint32_t xbins = factory_->init( histo, type, view, dir, gran, data_ );
  
  // Create summary histogram (if it doesn't already exist)
  TH1* summary = histogram( histo, type, view, dir, xbins );

  // Fill histogram with data
  factory_->fill( *summary );
  
}
void FedCablingHistograms::histoAnalysis ( bool  debug) [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 41 of file FedCablingHistograms.cc.

References CommissioningAlgorithm::analysis(), begin, data_, extract(), CommissioningHistograms::histos(), FedCablingAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, CommissioningHistograms::pset(), and TrackValidation_HighPurity_cff::valid.

Referenced by createSummaryHisto().

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

  uint16_t valid = 0;
  HistosMap::const_iterator iter;
  Analyses::iterator ianal;
  
  // 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_)
        << "[FedCablingHistograms::" << __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
    FedCablingAnalysis* anal = new FedCablingAnalysis( iter->first );
    FedCablingAlgorithm algo( this->pset(), anal );
    algo.analysis( profs );
    data_[iter->first] = anal; 
    if ( anal->isValid() ) { valid++; }
    
  }
  
  if ( !histos().empty() ) {
    edm::LogVerbatim(mlDqmClient_) 
      << "[FedCablingHistograms::" << __func__ << "]"
      << " Analyzed histograms for " << histos().size() 
      << " FED channels, of which " << valid 
      << " (" << 100 * valid / histos().size()
      << "%) are valid.";
  } else {
    edm::LogWarning(mlDqmClient_) 
      << "[FedCablingHistograms::" << __func__ << "]"
      << " No histograms to analyze!";
  }
  
}
void FedCablingHistograms::printAnalyses ( ) [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 101 of file FedCablingHistograms.cc.

References data_, LogTrace, and sistrip::mlDqmClient_.

                                         {
  Analyses::iterator ianal = data_.begin();
  Analyses::iterator janal = data_.end();
  for ( ; ianal != janal; ++ianal ) { 
    if ( ianal->second ) { 
      std::stringstream ss;
      ianal->second->print( ss ); 
      if ( ianal->second->isValid() ) { LogTrace(mlDqmClient_) << ss.str(); 
      } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
    }
  }
}

Member Data Documentation

Reimplemented from CommissioningHistograms.

Definition at line 35 of file FedCablingHistograms.h.

Referenced by createSummaryHisto(), histoAnalysis(), and printAnalyses().

std::auto_ptr<Factory> FedCablingHistograms::factory_ [protected]

Reimplemented from CommissioningHistograms.

Definition at line 37 of file FedCablingHistograms.h.

Referenced by createSummaryHisto().