CMS 3D CMS Logo

ApvTimingHistograms Class Reference

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

Inheritance diagram for ApvTimingHistograms:

CommissioningHistograms ApvTimingHistosUsingDb

List of all members.

Public Member Functions

 ApvTimingHistograms (DQMStore *)
 ApvTimingHistograms (DQMOldReceiver *)
void histoAnalysis (bool debug)
virtual ~ApvTimingHistograms ()


Detailed Description

Definition at line 9 of file ApvTimingHistograms.h.


Constructor & Destructor Documentation

ApvTimingHistograms::ApvTimingHistograms ( DQMOldReceiver mui  ) 

Definition at line 18 of file ApvTimingHistograms.cc.

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

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

ApvTimingHistograms::ApvTimingHistograms ( DQMStore bei  ) 

Definition at line 29 of file ApvTimingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

ApvTimingHistograms::~ApvTimingHistograms (  )  [virtual]

Definition at line 39 of file ApvTimingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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


Member Function Documentation

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

Reimplemented from CommissioningHistograms.

Definition at line 47 of file ApvTimingHistograms.cc.

References CommissioningAlgorithm::analysis(), begin, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), count, CommissioningHistograms::data(), empty, lat::endl(), HLT_VtxMuL3::errors, extract(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), ApvTimingAnalysis::foundTickMark(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), sistrip::invalid_, ApvTimingAnalysis::isValid(), iter, SiStripFecKey::lldChan(), LogTrace, max, min, sistrip::mlDqmClient_, ApvTimingAnalysis::refTime(), ss, ApvTimingAnalysis::time(), TrackValidation_HighPurity_cff::valid, and sistrip::valid_.

00047                                                     {
00048   LogTrace(mlDqmClient_)
00049     << "[ApvTimingHistograms::" << __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   // Reset minimum / maximum delays
00064   float time_min =  1. * sistrip::invalid_;
00065   float time_max = -1. * sistrip::invalid_;
00066   uint32_t device_min = sistrip::invalid_;
00067   uint32_t device_max = sistrip::invalid_;
00068   
00069   // Iterate through map containing histograms
00070   for ( iter = histos().begin();
00071         iter != histos().end(); iter++ ) {
00072     
00073     // Check vector of histos is not empty
00074     if ( iter->second.empty() ) {
00075       edm::LogWarning(mlDqmClient_) 
00076         << "[ApvTimingHistograms::" << __func__ << "]"
00077         << " Zero histograms found!";
00078       continue;
00079     }
00080     
00081     // Retrieve pointers to histos
00082     std::vector<TH1*> profs;
00083     Histos::const_iterator ihis = iter->second.begin(); 
00084     for ( ; ihis != iter->second.end(); ihis++ ) {
00085       TProfile* prof = ExtractTObject<TProfile>().extract( (*ihis)->me_ );
00086       if ( prof ) { profs.push_back(prof); }
00087     } 
00088     
00089     // Perform histo analysis
00090     ApvTimingAnalysis* anal = new ApvTimingAnalysis( iter->first );
00091     ApvTimingAlgorithm algo( anal );
00092     algo.analysis( profs );
00093     data()[iter->first] = anal; 
00094 
00095     // Check if tick mark found
00096     if ( !anal->foundTickMark() ) { continue; }
00097     
00098     // Find maximum time
00099     if ( anal->time() > time_max ) { 
00100       time_max = anal->time(); 
00101       device_max = iter->first;
00102     }
00103     
00104     // Find minimum time
00105     if ( anal->time() < time_min ) { 
00106       time_min = anal->time(); 
00107       device_min = iter->first;
00108     }
00109     
00110   }
00111   
00112   // Adjust maximum (and minimum) delay(s) to find optimum sampling point(s)
00113   if ( time_max > sistrip::valid_ ||
00114        time_max < -1.*sistrip::valid_ ) { 
00115 
00116     edm::LogWarning(mlDqmClient_)
00117       << "[ApvTimingHistograms::" << __func__ << "]"
00118       << " Unable to set maximum time! Found unexpected value: "
00119       << time_max;
00120     
00121   } else {
00122     
00123     SiStripFecKey min( device_min );
00124     edm::LogVerbatim(mlDqmClient_)
00125       << "[ApvTimingHistograms::" << __func__ << "]"
00126       << " Crate/FEC/Ring/CCU/module/channel: " 
00127       << min.fecCrate() << "/" 
00128       << min.fecSlot() << "/" 
00129       << min.fecRing() << "/" 
00130       << min.ccuAddr() << "/"
00131       << min.ccuChan() << "/"
00132       << min.lldChan() 
00133       << " has minimum time for tick mark rising edge [ns]: " << time_min;
00134     
00135     SiStripFecKey max( device_max );
00136     edm::LogVerbatim(mlDqmClient_)
00137       << "[ApvTimingHistograms::" << __func__ << "]"
00138       << " Crate/FEC/Ring/CCU/module/channel: " 
00139       << max.fecCrate() << "/" 
00140       << max.fecSlot() << "/" 
00141       << max.fecRing() << "/" 
00142       << max.ccuAddr() << "/"
00143       << max.ccuChan() << "/"
00144       << max.lldChan() 
00145       << " has maximum time for tick mark rising edge [ns]: " << time_max;
00146 
00147     edm::LogVerbatim(mlDqmClient_)
00148       << "[ApvTimingHistograms::" << __func__ << "]"
00149       << " Difference b/w minimum and maximum times"
00150       << " for tick mark rising edges [ns] is: " << ( time_max - time_min );
00151 
00152   }
00153   
00154   // Set reference time for all analysis objects
00155   for ( ianal = data().begin(); ianal != data().end(); ianal++ ) { 
00156     ApvTimingAnalysis* anal = dynamic_cast<ApvTimingAnalysis*>(ianal->second);
00157     if ( !anal ) { continue; }
00158     anal->refTime( time_max ); 
00159     if ( anal->isValid() ) { valid++; }
00160     if ( !anal->getErrorCodes().empty() ) { 
00161       errors[anal->getErrorCodes()[0]]++;
00162     }
00163   }
00164 
00165   if ( !histos().empty() ) {
00166     edm::LogVerbatim(mlDqmClient_) 
00167       << "[ApvTimingHistograms::" << __func__ << "]"
00168       << " Analyzed histograms for " << histos().size() 
00169       << " FED channels, of which " << valid 
00170       << " (" << 100 * valid / histos().size()
00171       << "%) are valid.";
00172   } else {
00173     edm::LogWarning(mlDqmClient_) 
00174       << "[ApvTimingHistograms::" << __func__ << "]"
00175       << " No histograms to analyze!";
00176   }
00177 
00178   if ( !histos().empty() ) {
00179     edm::LogVerbatim(mlDqmClient_) 
00180       << "[ApvTimingHistograms::" << __func__ << "]"
00181       << " Analyzed histograms for " << histos().size() 
00182       << " FED channels, of which " << valid 
00183       << " (" << 100 * valid / histos().size()
00184       << "%) are valid.";
00185     if ( !errors.empty() ) {
00186       uint16_t count = 0;
00187       std::stringstream ss;
00188       ss << std::endl;
00189       std::map<std::string,uint16_t>::const_iterator ii;
00190       for ( ii = errors.begin(); ii != errors.end(); ++ii ) { 
00191         ss << " " << ii->first << ": " << ii->second << std::endl;
00192         count += ii->second;
00193       }
00194       edm::LogWarning(mlDqmClient_) 
00195         << "[ApvTimingHistograms::" << __func__ << "]"
00196         << " Found " << count << " errors ("
00197         << 100 * count / histos().size() << "%): " 
00198         << ss.str();
00199     }
00200   } else {
00201     edm::LogWarning(mlDqmClient_) 
00202       << "[ApvTimingHistograms::" << __func__ << "]"
00203       << " No histograms to analyze!";
00204   }
00205   
00206 }


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