CMS 3D CMS Logo

Public Member Functions | Protected Attributes

CalibrationHistograms Class Reference

#include <CalibrationHistograms.h>

Inheritance diagram for CalibrationHistograms:
CommissioningHistograms CalibrationHistosUsingDb

List of all members.

Public Member Functions

 CalibrationHistograms (const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::CALIBRATION)
void histoAnalysis (bool debug)
void printAnalyses ()
virtual ~CalibrationHistograms ()

Protected Attributes

int calchan_
int isha_
int vfs_

Detailed Description

Definition at line 9 of file CalibrationHistograms.h.


Constructor & Destructor Documentation

CalibrationHistograms::CalibrationHistograms ( const edm::ParameterSet pset,
DQMStore bei,
const sistrip::RunType task = sistrip::CALIBRATION 
)

Definition at line 19 of file CalibrationHistograms.cc.

References calchan_, sistrip::collate_, CommissioningHistograms::factory_, DQMStore::get(), MonitorElement::getIntValue(), isha_, LogTrace, sistrip::mlDqmClient_, sistrip::root_, groupFilesInBlocks::temp, and vfs_.

  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("CalibrationParameters"),
                             bei,
                             task ),
    calchan_(0),
    isha_(-1),
    vfs_(-1)
{
  LogTrace(mlDqmClient_) 
       << "[CalibrationHistograms::" << __func__ << "]"
       << " Constructing object...";
  std::string temp = std::string(sistrip::collate_) + "/" + sistrip::root_;
  factory_ = auto_ptr<CalibrationSummaryFactory>( new CalibrationSummaryFactory );
  MonitorElement* calchanElement = bei->get(temp + "/calchan");
  if(calchanElement) {
    calchan_ = calchanElement->getIntValue();
    edm::LogVerbatim(mlDqmClient_)
      << "[CalibrationHistograms::" << __func__ << "]"
      << "CalChan value is " << calchan_;
  } else {
    edm::LogWarning(mlDqmClient_)
      << "[CalibrationHistograms::" << __func__ << "]"
      << "CalChan value not found. Using " << calchan_;
  }
  MonitorElement* ishaElement = bei->get(temp + "/isha");
  if(ishaElement) isha_ = ishaElement->getIntValue() ;
  MonitorElement* vfsElement = bei->get(temp + "/vfs");
  if(vfsElement) vfs_ = vfsElement->getIntValue() ;
}
CalibrationHistograms::~CalibrationHistograms ( ) [virtual]

Definition at line 53 of file CalibrationHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

                                              {
  LogTrace(mlDqmClient_) 
       << "[CalibrationHistograms::" << __func__ << "]"
       << " Deleting object...";
}

Member Function Documentation

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

Reimplemented from CommissioningHistograms.

Definition at line 61 of file CalibrationHistograms.cc.

References CommissioningAlgorithm::analysis(), begin, calchan_, sistrip::CALIBRATION_DECO, CommissioningHistograms::data(), extract(), CommissioningHistograms::histos(), sistrip::mlDqmClient_, CommissioningHistograms::pset(), and CommissioningHistograms::task().

                                                      {

  // Clear map holding analysis objects
  Analyses::iterator ianal;
  for ( ianal = data().begin(); ianal != data().end(); ianal++ ) {
    if ( ianal->second ) { delete ianal->second; }
  }
  data().clear();
  
  // Iterate through map containing vectors of profile histograms
  HistosMap::const_iterator iter = histos().begin();
  for ( ; iter != histos().end(); iter++ ) {
    // Check vector of histos is not empty (should be 1 histo)
    if ( iter->second.empty() ) {
      edm::LogWarning(mlDqmClient_)
           << "[CalibrationHistograms::" << __func__ << "]"
           << " Zero collation histograms found!";
      continue;
    }
    
    // Retrieve pointers to 1D histos for this FED channel 
    vector<TH1*> profs;
    Histos::const_iterator ihis = iter->second.begin();
    for ( ; ihis != iter->second.end(); ihis++ ) {
      TH1F* prof = ExtractTObject<TH1F>().extract( (*ihis)->me_ );
      if ( prof ) { profs.push_back(prof); }
    } 
    // Perform histo analysis 
    CalibrationAnalysis* anal = new CalibrationAnalysis( iter->first, (task()==sistrip::CALIBRATION_DECO), calchan_ );
    CalibrationAlgorithm algo( this->pset(), anal );
    algo.analysis( profs );
    data()[iter->first] = anal; 
    
 }
 
}
void CalibrationHistograms::printAnalyses ( ) [virtual]

Reimplemented from CommissioningHistograms.

Definition at line 100 of file CalibrationHistograms.cc.

References CommissioningHistograms::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,0 );
      ianal->second->print( ss,1 );
      if ( ianal->second->isValid() ) { LogTrace(mlDqmClient_) << ss.str();
      } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
    }
  }
}

Member Data Documentation

int CalibrationHistograms::vfs_ [protected]