CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondFormats/SiStripObjects/src/CommissioningAnalysis.cc

Go to the documentation of this file.
00001 #include "CondFormats/SiStripObjects/interface/CommissioningAnalysis.h"
00002 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
00003 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
00004 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
00005 #include <iomanip>
00006 
00007 // ----------------------------------------------------------------------------
00008 // 
00009 CommissioningAnalysis::CommissioningAnalysis( const uint32_t& key,
00010                                               const std::string& my_name ) 
00011   : fecKey_( key ),
00012     fedKey_(sistrip::invalid32_),
00013     dcuId_(sistrip::invalid32_),
00014     detId_(sistrip::invalid32_),
00015     myName_(my_name),
00016     errors_(VString(0,""))
00017 {;}
00018 
00019 // ----------------------------------------------------------------------------
00020 // 
00021 CommissioningAnalysis::CommissioningAnalysis( const std::string& my_name ) 
00022   : fecKey_(sistrip::invalid32_),
00023     fedKey_(sistrip::invalid32_),
00024     dcuId_(sistrip::invalid32_),
00025     detId_(sistrip::invalid32_),
00026     myName_(my_name),
00027     errors_(VString(0,""))
00028 {;}
00029 
00030 // ----------------------------------------------------------------------------
00031 // 
00032 void CommissioningAnalysis::header( std::stringstream& ss ) const { 
00033   ss << "[" << myName() << "] Monitorables (65535 means \"invalid\"):" << std::endl;
00034 
00035   //summary(ss);
00036 
00037   SiStripFecKey fec_key( fecKey_ );
00038   ss << " Crate/FEC/Ring/CCU/Mod/LLD     : " 
00039      << fec_key.fecCrate() << "/" 
00040      << fec_key.fecSlot() << "/" 
00041      << fec_key.fecRing() << "/" 
00042      << fec_key.ccuAddr() << "/" 
00043      << fec_key.ccuChan() << "/" 
00044      << fec_key.lldChan() 
00045      << std::endl;
00046 
00047   SiStripFedKey fed_key( fedKey_ );
00048   ss << " FedId/FeUnit/FeChan/FedChannel : " 
00049      << fed_key.fedId() << "/" 
00050      << fed_key.feUnit() << "/" 
00051      << fed_key.feChan() << "/"
00052      << fed_key.fedChannel()
00053      << std::endl;
00054   // if ( fed_key.fedChannel() != sistrip::invalid_ ) { ss << fed_key.fedChannel(); }
00055   // else { ss << "(invalid)"; }
00056   // ss << std::endl;
00057   
00058 //   ss << " FecKey/Fedkey (hex)            : 0x" 
00059 //      << std::hex 
00060 //      << std::setw(8) << std::setfill('0') << fecKey_
00061 //      << " / 0x" 
00062 //      << std::setw(8) << std::setfill('0') << fedKey_
00063 //      << std::dec
00064 //      << std::endl;
00065   
00066   ss << " FecKey (hex/dec)               : 0x" 
00067      << std::hex 
00068      << std::setw(8) << std::setfill('0') << fecKey_ 
00069      << " / "
00070      << std::dec
00071      << std::setw(10) << std::setfill(' ') << fecKey_ 
00072      << std::endl;
00073 
00074   ss << " FedKey (hex/dec)               : 0x" 
00075      << std::hex 
00076      << std::setw(8) << std::setfill('0') << fedKey_ 
00077      << " / "
00078      << std::dec
00079      << std::setw(10) << std::setfill(' ') << fedKey_ 
00080      << std::endl;
00081   
00082   ss << " DcuId (hex/dec)                : 0x" 
00083      << std::hex 
00084      << std::setw(8) << std::setfill('0') << dcuId_ 
00085      << " / "
00086      << std::dec
00087      << std::setw(10) << std::setfill(' ') << dcuId_ 
00088      << std::endl;
00089 
00090   ss << " DetId (hex/dec)                : 0x" 
00091      << std::hex 
00092      << std::setw(8) << std::setfill('0') << detId_ 
00093      << " / "
00094      << std::dec
00095      << std::setw(10) << std::setfill(' ') << detId_ 
00096      << std::endl;
00097   
00098 }
00099 
00100 // ----------------------------------------------------------------------------
00101 // 
00102 void CommissioningAnalysis::summary( std::stringstream& ss ) const { 
00103 
00104   SiStripFecKey fec_key( fecKey_ );
00105   
00106   sistrip::RunType type = SiStripEnumsAndStrings::runType( myName() );
00107   std::string title = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
00108                                          type,
00109                                          sistrip::FED_KEY, 
00110                                          fedKey(),
00111                                          sistrip::LLD_CHAN, 
00112                                          fec_key.lldChan() ).title();
00113   
00114   ss << " Summary"
00115      << ":"
00116      << ( isValid() ? "Valid" : "Invalid" )
00117      << ":"
00118      << sistrip::controlView_ << ":"
00119      << fec_key.fecCrate() << "/" 
00120      << fec_key.fecSlot() << "/" 
00121      << fec_key.fecRing() << "/" 
00122      << fec_key.ccuAddr() << "/" 
00123      << fec_key.ccuChan() 
00124      << ":"
00125      << sistrip::dqmRoot_ << sistrip::dir_ 
00126      << "Collate" << sistrip::dir_ 
00127      << SiStripFecKey( fec_key.fecCrate(),
00128                        fec_key.fecSlot(), 
00129                        fec_key.fecRing(), 
00130                        fec_key.ccuAddr(), 
00131                        fec_key.ccuChan() ).path()
00132      << ":"
00133      << title
00134      << std::endl;
00135   
00136 }