CMS 3D CMS Logo

PedsOnlyHistosUsingDb Class Reference

#include <DQM/SiStripCommissioningDbClients/interface/PedsOnlyHistosUsingDb.h>

Inheritance diagram for PedsOnlyHistosUsingDb:

CommissioningHistosUsingDb PedsOnlyHistograms CommissioningHistograms CommissioningHistograms

List of all members.

Public Member Functions

 PedsOnlyHistosUsingDb (DQMStore *, SiStripConfigDb *const )
 PedsOnlyHistosUsingDb (DQMOldReceiver *, SiStripConfigDb *const )
virtual void uploadConfigurations ()
virtual ~PedsOnlyHistosUsingDb ()

Private Member Functions

void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
void update (SiStripConfigDb::FedDescriptionsRange)


Detailed Description

Definition at line 9 of file PedsOnlyHistosUsingDb.h.


Constructor & Destructor Documentation

PedsOnlyHistosUsingDb::PedsOnlyHistosUsingDb ( DQMOldReceiver mui,
SiStripConfigDb * const  db 
)

Definition at line 15 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

00017   : CommissioningHistograms( mui, sistrip::PEDS_ONLY ),
00018     CommissioningHistosUsingDb( db, mui, sistrip::PEDS_ONLY ),
00019     PedsOnlyHistograms( mui )
00020 {
00021   LogTrace(mlDqmClient_) 
00022     << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00023     << " Constructing object...";
00024 }

PedsOnlyHistosUsingDb::PedsOnlyHistosUsingDb ( DQMStore bei,
SiStripConfigDb * const  db 
)

Definition at line 28 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

00030   : CommissioningHistosUsingDb( db, sistrip::PEDS_ONLY ),
00031     PedsOnlyHistograms( bei )
00032 {
00033   LogTrace(mlDqmClient_) 
00034     << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00035     << " Constructing object...";
00036 }

PedsOnlyHistosUsingDb::~PedsOnlyHistosUsingDb (  )  [virtual]

Definition at line 40 of file PedsOnlyHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

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


Member Function Documentation

void PedsOnlyHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV desc,
Analysis  analysis 
) [private, virtual]

Reimplemented from CommissioningHistosUsingDb.

Definition at line 170 of file PedsOnlyHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), SiStripConfigDb::dbParams(), HLT_VtxMuL3::errors, CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), CommissioningAnalysis::getErrorCodes(), SiStripFecKey::i2cAddr(), sistrip::invalid_, PedsOnlyAnalysis::isValid(), SiStripDbParams::partitions(), PedsOnlyAnalysis::pedsMax(), PedsOnlyAnalysis::pedsMean(), PedsOnlyAnalysis::pedsMin(), PedsOnlyAnalysis::pedsSpread(), PedsOnlyAnalysis::rawMax(), PedsOnlyAnalysis::rawMean(), PedsOnlyAnalysis::rawMin(), PedsOnlyAnalysis::rawSpread(), and tmp.

00171                                                         {
00172 
00173 #ifdef USING_NEW_DATABASE_MODEL
00174 
00175   PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>( analysis->second );
00176   if ( !anal ) { return; }
00177   
00178   SiStripFecKey fec_key( anal->fecKey() );
00179   SiStripFedKey fed_key( anal->fedKey() );
00180   
00181   for ( uint16_t iapv = 0; iapv < 2; ++iapv ) {
00182     
00183     // Create description
00184     PedestalsAnalysisDescription* tmp;
00185     tmp = new PedestalsAnalysisDescription( std::vector<uint16_t>(0,0), //@@
00186                                             std::vector<uint16_t>(0,0), //@@
00187                                             anal->pedsMean()[iapv],
00188                                             anal->pedsSpread()[iapv],
00189                                             1.*sistrip::invalid_, //@@
00190                                             1.*sistrip::invalid_, //@@
00191                                             anal->rawMean()[iapv],
00192                                             anal->rawSpread()[iapv],
00193                                             anal->pedsMax()[iapv], 
00194                                             anal->pedsMin()[iapv], 
00195                                             1.*sistrip::invalid_, //@@
00196                                             1.*sistrip::invalid_, //@@
00197                                             anal->rawMax()[iapv],
00198                                             anal->rawMin()[iapv],
00199                                             fec_key.fecCrate(),
00200                                             fec_key.fecSlot(),
00201                                             fec_key.fecRing(),
00202                                             fec_key.ccuAddr(),
00203                                             fec_key.ccuChan(),
00204                                             SiStripFecKey::i2cAddr( fec_key.lldChan(), !iapv ), 
00205                                             db()->dbParams().partitions().begin()->second.partitionName(),
00206                                             db()->dbParams().partitions().begin()->second.runNumber(),
00207                                             anal->isValid(),
00208                                             "",
00209                                             fed_key.fedId(),
00210                                             fed_key.feUnit(),
00211                                             fed_key.feChan(),
00212                                             fed_key.fedApv() );
00213     
00214     // Add comments
00215     typedef std::vector<std::string> Strings;
00216     Strings errors = anal->getErrorCodes();
00217     Strings::const_iterator istr = errors.begin();
00218     Strings::const_iterator jstr = errors.end();
00219     for ( ; istr != jstr; ++istr ) { tmp->addComments( *istr ); }
00220 
00221     // Store description
00222     desc.push_back( tmp );
00223       
00224   }
00225 
00226 #endif
00227 
00228 }

void PedsOnlyHistosUsingDb::update ( SiStripConfigDb::FedDescriptionsRange  feds  )  [private]

Definition at line 82 of file PedsOnlyHistosUsingDb.cc.

References addr, sistrip::APVS_PER_FEDCH, CommissioningHistosUsingDb::cabling(), FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), SiStripFedCabling::connection(), CommissioningHistograms::data(), FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), sistrip::FEDCH_PER_FED, FedChannelConnection::fedId(), SiStripFedKey::feUnit(), sistrip::invalid_, iter, SiStripKey::key(), FedChannelConnection::lldChannel(), sistrip::mlDqmClient_, PedsOnlyAnalysis::peds(), and PedsOnlyAnalysis::raw().

Referenced by uploadConfigurations().

00082                                                                              {
00083  
00084   // Iterate through feds and update fed descriptions
00085   uint16_t updated = 0;
00086   SiStripConfigDb::FedDescriptionsV::const_iterator ifed;
00087   for ( ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
00088     
00089     for ( uint16_t ichan = 0; ichan < sistrip::FEDCH_PER_FED; ichan++ ) {
00090 
00091       // Build FED and FEC keys
00092       const FedChannelConnection& conn = cabling()->connection( (*ifed)->getFedId(), ichan );
00093       if ( conn.fecCrate() == sistrip::invalid_ ||
00094            conn.fecSlot() == sistrip::invalid_ ||
00095            conn.fecRing() == sistrip::invalid_ ||
00096            conn.ccuAddr() == sistrip::invalid_ ||
00097            conn.ccuChan() == sistrip::invalid_ ||
00098            conn.lldChannel() == sistrip::invalid_ ) { continue; }
00099       SiStripFedKey fed_key( conn.fedId(), 
00100                              SiStripFedKey::feUnit( conn.fedCh() ),
00101                              SiStripFedKey::feChan( conn.fedCh() ) );
00102       SiStripFecKey fec_key( conn.fecCrate(), 
00103                              conn.fecSlot(), 
00104                              conn.fecRing(), 
00105                              conn.ccuAddr(), 
00106                              conn.ccuChan(), 
00107                              conn.lldChannel() );
00108 
00109       // Locate appropriate analysis object 
00110       Analyses::const_iterator iter = data().find( fec_key.key() );
00111       if ( iter != data().end() ) {
00112 
00113         // Check if analysis is valid
00114         if ( !iter->second->isValid() ) { continue; }
00115         
00116         PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>( iter->second );
00117         if ( !anal ) { 
00118           edm::LogError(mlDqmClient_)
00119             << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00120             << " NULL pointer to analysis object!";
00121           continue; 
00122         }
00123         
00124         // Iterate through APVs and strips
00125         for ( uint16_t iapv = 0; iapv < sistrip::APVS_PER_FEDCH; iapv++ ) {
00126           for ( uint16_t istr = 0; istr < anal->peds()[iapv].size(); istr++ ) { 
00127             
00128             static float high_threshold = 5.;
00129             static float low_threshold  = 2.;
00130             static bool  disable_strip  = false;
00131             Fed9U::Fed9UStripDescription data( static_cast<uint32_t>( anal->peds()[iapv][istr] ), 
00132                                                high_threshold, 
00133                                                low_threshold, 
00134                                                anal->raw()[iapv][istr], //@@ raw noise!
00135                                                disable_strip );
00136             Fed9U::Fed9UAddress addr( ichan, iapv, istr );
00137             (*ifed)->getFedStrips().setStrip( addr, data );
00138             
00139           }
00140         }
00141         updated++;
00142       
00143       } else {
00144         edm::LogWarning(mlDqmClient_) 
00145           << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00146           << " Unable to find pedestals/noise for FedKey/Id/Ch: " 
00147           << hex << setw(8) << setfill('0') << fed_key.key() << dec << "/"
00148           << (*ifed)->getFedId() << "/"
00149           << ichan
00150           << " and device with FEC/slot/ring/CCU/LLD " 
00151           << fec_key.fecCrate() << "/"
00152           << fec_key.fecSlot() << "/"
00153           << fec_key.fecRing() << "/"
00154           << fec_key.ccuAddr() << "/"
00155           << fec_key.ccuChan() << "/"
00156           << fec_key.channel();
00157       }
00158     }
00159   }
00160 
00161   edm::LogVerbatim(mlDqmClient_) 
00162     << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00163     << " Updated FED pedestals/noise for " 
00164     << updated << " channels";
00165 
00166 }

void PedsOnlyHistosUsingDb::uploadConfigurations (  )  [virtual]

Reimplemented from CommissioningHistosUsingDb.

Definition at line 48 of file PedsOnlyHistosUsingDb.cc.

References CommissioningHistosUsingDb::db(), CommissioningHistosUsingDb::doUploadConf(), SiStripConfigDb::getFedDescriptions(), LogTrace, sistrip::mlDqmClient_, update(), and SiStripConfigDb::uploadFedDescriptions().

00048                                                  {
00049   LogTrace(mlDqmClient_) 
00050     << "[PedsOnlyHistosUsingDb::" << __func__ << "]";
00051 
00052   if ( !db() ) {
00053     edm::LogError(mlDqmClient_) 
00054       << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00055       << " NULL pointer to SiStripConfigDb interface!"
00056       << " Aborting upload...";
00057     return;
00058   }
00059   
00060   // Update FED descriptions with new peds/noise values
00061   SiStripConfigDb::FedDescriptionsRange feds = db()->getFedDescriptions(); 
00062   update( feds );
00063   if ( doUploadConf() ) { 
00064     edm::LogVerbatim(mlDqmClient_) 
00065       << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00066       << " Uploading pedestals/noise to DB...";
00067     db()->uploadFedDescriptions(); 
00068     edm::LogVerbatim(mlDqmClient_) 
00069       << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00070       << " Completed database upload of " << feds.size() 
00071       << " FED descriptions!";
00072   } else {
00073     edm::LogWarning(mlDqmClient_) 
00074       << "[PedsOnlyHistosUsingDb::" << __func__ << "]"
00075       << " TEST only! No pedestals/noise values will be uploaded to DB...";
00076   }
00077   
00078 }


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