CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
CommissioningHistosUsingDb Class Reference

#include <CommissioningHistosUsingDb.h>

Inheritance diagram for CommissioningHistosUsingDb:
CommissioningHistograms ApvTimingHistosUsingDb CalibrationHistosUsingDb FastFedCablingHistosUsingDb FineDelayHistosUsingDb LatencyHistosUsingDb NoiseHistosUsingDb OptoScanHistosUsingDb PedestalsHistosUsingDb PedsFullNoiseHistosUsingDb PedsOnlyHistosUsingDb SamplingHistosUsingDb VpspScanHistosUsingDb

Classes

class  DetInfo
 

Public Member Functions

 CommissioningHistosUsingDb (SiStripConfigDb *const, sistrip::RunType=sistrip::UNDEFINED_RUN_TYPE)
 
bool doUploadAnal () const
 
void doUploadAnal (bool)
 
bool doUploadConf () const
 
void doUploadConf (bool)
 
void uploadToConfigDb ()
 
virtual ~CommissioningHistosUsingDb ()
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
 CommissioningHistograms ()
 
virtual void configure (const edm::ParameterSet &, const edm::EventSetup &)
 
void createCollations (const std::vector< std::string > &)
 
virtual void createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
 
void extractHistograms (const std::vector< std::string > &)
 
virtual void histoAnalysis (bool debug)
 
virtual void printAnalyses ()
 
virtual void printSummary ()
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0)
 
virtual ~CommissioningHistograms ()
 

Protected Member Functions

virtual void addDcuDetIds ()
 
void buildDetInfo ()
 
SiStripFedCabling *const cabling () const
 
virtual void create (SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
 
virtual void createAnalyses (SiStripConfigDb::AnalysisDescriptionsV &)
 
SiStripConfigDb *const db () const
 
std::pair< std::string, DetInfodetInfo (const SiStripFecKey &)
 
bool deviceIsPresent (const SiStripFecKey &)
 
void uploadAnalyses ()
 
virtual void uploadConfigurations ()
 
- Protected Member Functions inherited from CommissioningHistograms
DQMStore *const bei () const
 
void clearHistosMap ()
 
Analysesdata ()
 
Factory *const factory ()
 
TH1 * histogram (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1.*sistrip::invalid_, const float &xhigh=1.*sistrip::invalid_)
 
const HistosMaphistos () const
 
const FedToFecMapmapping () const
 
void printHistosMap ()
 
const edm::ParameterSetpset () const
 
const sistrip::RunTypetask () const
 

Private Types

typedef std::map< uint32_t,
DetInfo
DetInfos
 

Private Member Functions

 CommissioningHistosUsingDb ()
 

Private Attributes

SiStripFedCablingcabling_
 
SiStripConfigDbdb_
 
std::map< std::string, DetInfosdetInfo_
 
sistrip::RunType runType_
 
bool uploadAnal_
 
bool uploadConf_
 

Additional Inherited Members

- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t,
CommissioningAnalysis * > 
Analyses
 
typedef Analyses::iterator Analysis
 
typedef SummaryPlotFactory
< CommissioningAnalysis * > 
Factory
 
typedef std::map< uint32_t,
uint32_t > 
FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t,
Histos
HistosMap
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, const std::vector< std::string > &)
 
static void getContents (DQMStore *const, std::vector< std::string > &)
 
static uint32_t runNumber (DQMStore *const, const std::vector< std::string > &)
 
static sistrip::RunType runType (DQMStore *const, const std::vector< std::string > &)
 
- Protected Attributes inherited from CommissioningHistograms
std::auto_ptr< Factoryfactory_
 

Detailed Description

Definition at line 17 of file CommissioningHistosUsingDb.h.

Member Typedef Documentation

typedef std::map<uint32_t,DetInfo> CommissioningHistosUsingDb::DetInfos
private

Definition at line 85 of file CommissioningHistosUsingDb.h.

Constructor & Destructor Documentation

CommissioningHistosUsingDb::CommissioningHistosUsingDb ( SiStripConfigDb * const  db,
sistrip::RunType  type = sistrip::UNDEFINED_RUN_TYPE 
)

Definition at line 19 of file CommissioningHistosUsingDb.cc.

References SiStripFedCablingBuilderFromDb::buildFecCabling(), SiStripFedCablingBuilderFromDb::buildFecCablingFromDevices(), cabling_, db_, sistrip::FAST_CABLING, SiStripFedCablingBuilderFromDb::getFedCabling(), LogTrace, sistrip::mlDqmClient_, runType_, SiStripFedCabling::summary(), and SiStripFedCabling::terse().

22  runType_(type),
23  db_(db),
24  cabling_(0),
25  detInfo_(),
26  uploadAnal_(true),
27  uploadConf_(false)
28 {
30  << "[" << __PRETTY_FUNCTION__ << "]"
31  << " Constructing object...";
32 
33  // Build FEC cabling object from connections found in DB
34  SiStripFecCabling fec_cabling;
37  } else {
39  }
40 
41  // Build FED cabling from FEC cabling
44  std::stringstream ss;
45  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
46  << " Terse print out of FED cabling:" << std::endl;
47  cabling_->terse(ss);
48  LogTrace(mlDqmClient_) << ss.str();
49 
50  std::stringstream sss;
51  sss << "[CommissioningHistosUsingDb::" << __func__ << "]"
52  << " Summary of FED cabling:" << std::endl;
53  cabling_->summary(sss);
54  edm::LogVerbatim(mlDqmClient_) << sss.str();
55 
56 }
type
Definition: HCALResponse.h:22
void terse(std::stringstream &) const
static const char mlDqmClient_[]
std::map< std::string, DetInfos > detInfo_
static void buildFecCabling(SiStripConfigDb *const, SiStripFecCabling &, const sistrip::CablingSource &)
void summary(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
#define LogTrace(id)
static void getFedCabling(const SiStripFecCabling &in, SiStripFedCabling &out)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static void buildFecCablingFromDevices(SiStripConfigDb *const, SiStripFecCabling &)
CommissioningHistosUsingDb::~CommissioningHistosUsingDb ( )
virtual

Definition at line 76 of file CommissioningHistosUsingDb.cc.

References db_, LogTrace, and sistrip::mlDqmClient_.

76  {
77  if ( db_ ) { delete db_; }
79  << "[" << __PRETTY_FUNCTION__ << "]"
80  << " Destructing object...";
81 }
static const char mlDqmClient_[]
#define LogTrace(id)
CommissioningHistosUsingDb::CommissioningHistosUsingDb ( )
private

Definition at line 60 of file CommissioningHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

63  db_(0),
64  cabling_(0),
65  detInfo_(),
66  uploadAnal_(false),
67  uploadConf_(false)
68 {
70  << "[" << __PRETTY_FUNCTION__ << "]"
71  << " Constructing object..." << endl;
72 }
static const char mlDqmClient_[]
std::map< std::string, DetInfos > detInfo_
#define LogTrace(id)

Member Function Documentation

void CommissioningHistosUsingDb::addDcuDetIds ( )
protectedvirtual

Reimplemented in FastFedCablingHistosUsingDb.

Definition at line 186 of file CommissioningHistosUsingDb.cc.

References cabling_, FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), results_mgr::conn, SiStripFedCabling::connection(), CommissioningHistograms::data(), CommissioningAnalysis::dcuId(), FedChannelConnection::dcuId(), CommissioningAnalysis::detId(), FedChannelConnection::detId(), FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), CommissioningAnalysis::fecKey(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), SiStripFedKey::fedChannel(), SiStripFedKey::fedId(), FedChannelConnection::fedId(), CommissioningAnalysis::fedKey(), SiStripFedKey::feUnit(), FedChannelConnection::lldChannel(), sistrip::mlDqmClient_, and SiStripKey::path().

Referenced by uploadToConfigDb().

186  {
187 
188  if ( !cabling_ ) {
190  << "[CommissioningHistosUsingDb::" << __func__ << "]"
191  << " NULL pointer to SiStripFedCabling object!";
192  return;
193  }
194 
195  Analyses::iterator ianal = data().begin();
196  Analyses::iterator janal = data().end();
197  for ( ; ianal != janal; ++ianal ) {
198 
199  CommissioningAnalysis* anal = ianal->second;
200 
201  if ( !anal ) {
203  << "[CommissioningHistosUsingDb::" << __func__ << "]"
204  << " NULL pointer to CommissioningAnalysis object!";
205  return;
206  }
207 
208  SiStripFedKey fed_key = anal->fedKey();
209  SiStripFecKey fec_key = anal->fecKey();
210 
212  fed_key.fedChannel() );
213 
214  SiStripFedKey fed( conn.fedId(),
215  SiStripFedKey::feUnit( conn.fedCh() ),
216  SiStripFedKey::feChan( conn.fedCh() ) );
217 
218  SiStripFecKey fec( conn.fecCrate(),
219  conn.fecSlot(),
220  conn.fecRing(),
221  conn.ccuAddr(),
222  conn.ccuChan(),
223  conn.lldChannel() );
224 
225  if ( fed_key.path() != fed.path() ) {
226 
227  std::stringstream ss;
228  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
229  << " Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
230  << " Incompatible FED key retrieved from cabling!" << std::endl
231  << " FED key from analysis object : " << fed_key.path() << std::endl
232  << " FED key from cabling object : " << fed.path() << std::endl
233  << " FED id/ch from analysis object: " << fed_key.fedId() << "/" << fed_key.fedChannel() << std::endl
234  << " FED id/ch from cabling object : " << conn.fedId() << "/" << conn.fedCh();
235  edm::LogWarning(mlDqmClient_) << ss.str();
236 
237  } else if ( fec_key.path() != fec.path() ) {
238 
239  std::stringstream ss;
240  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
241  << " Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
242  << " Incompatible FEC key retrieved from cabling!" << std::endl
243  << " FEC key from analysis object : " << fec_key.path() << std::endl
244  << " FEC key from cabling object : " << fec.path();
245  edm::LogWarning(mlDqmClient_) << ss.str();
246 
247  } else {
248 
249  anal->dcuId( conn.dcuId() );
250  anal->detId( conn.detId() );
251 
252  }
253 
254  }
255 
256 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
const uint32_t & fedKey() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
const uint16_t & fedCh() const
static const char mlDqmClient_[]
const FedChannelConnection & connection(uint16_t fed_id, uint16_t fed_ch) const
uint16_t lldChannel() const
const uint16_t & fedId() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
const uint16_t & fecRing() const
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint32_t & dcuId() const
const uint16_t & ccuChan() const
const uint32_t & fecKey() const
const std::string & path() const
Definition: SiStripKey.h:127
uint16_t fedChannel() const
const uint16_t & ccuAddr() const
const uint32_t & dcuId() const
const uint16_t & feUnit() const
const uint16_t & feChan() const
const uint32_t & detId() const
const uint16_t & fedId() const
Abstract base for derived classes that provide analysis of commissioning histograms.
tuple conn
Definition: results_mgr.py:53
void CommissioningHistosUsingDb::buildDetInfo ( )
protected

Definition at line 299 of file CommissioningHistosUsingDb.cc.

References SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, db(), db_, SiStripConfigDb::dbParams(), CommissioningHistosUsingDb::DetInfo::dcuId_, CommissioningHistosUsingDb::DetInfo::detId_, detInfo_, SiStripConfigDb::deviceAddress(), SiStripFecKey::fecCrate(), SiStripConfigDb::DeviceAddress::fecCrate_, SiStripFecKey::fecRing(), SiStripConfigDb::DeviceAddress::fecRing_, SiStripFecKey::fecSlot(), SiStripConfigDb::DeviceAddress::fecSlot_, SiStripConfigDb::findDcuDetId(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), info, edm::isDebugEnabled(), SiStripFecKey::isValid(), findQualityFiles::jj, combine::key, SiStripKey::key(), sistrip::mlDqmClient_, CommissioningHistosUsingDb::DetInfo::pairs_, SiStripDbParams::partitions(), and createTree::pp.

Referenced by uploadToConfigDb().

299  {
300 
301  detInfo_.clear();
302 
303  if ( !db() ) {
305  << "[CommissioningHistosUsingDb::" << __func__ << "]"
306  << " NULL pointer to SiStripConfigDb interface!";
307  return;
308  }
309 
310  SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
311  SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
312  for ( ; ii != jj; ++ii ) {
313 
314  // Retrieve DCUs and DetIds for given partition
315  std::string pp = ii->second.partitionName();
318 
319  // Iterate through DCUs
320  SiStripConfigDb::DeviceDescriptionsV::const_iterator idcu = dcus.begin();
321  SiStripConfigDb::DeviceDescriptionsV::const_iterator jdcu = dcus.end();
322  for ( ; idcu != jdcu; ++idcu ) {
323 
324  // Extract DCU-FEH description
325  dcuDescription* dcu = dynamic_cast<dcuDescription*>( *idcu );
326  if ( !dcu ) { continue; }
327  if ( dcu->getDcuType() != "FEH" ) { continue; }
328 
329  // S.L. 29/1/2010
330  // HARDCODED!!! We have a broken module, known from Pisa integration tests
331  // We could really use a better solutin for this than hardcode it!!!
332  if ( dcu->getDcuHardId() == 16448250 ) continue; // fake dcu (0xfafafa)
333 
334  // Find TkDcuInfo object corresponding to given DCU description
335  SiStripConfigDb::DcuDetIdsV::const_iterator idet = dets.end();
336  idet = SiStripConfigDb::findDcuDetId( dets.begin(), dets.end(), dcu->getDcuHardId() );
337  if ( idet == dets.begin() ) { continue; }
338 
339  // Extract TkDcuInfo object
340  TkDcuInfo* det = idet->second;
341  if ( !det ) { continue; }
342 
343  // Build FEC key
344  const SiStripConfigDb::DeviceAddress& addr = db()->deviceAddress( *dcu );
345  SiStripFecKey fec_key( addr.fecCrate_,
346  addr.fecSlot_,
347  addr.fecRing_,
348  addr.ccuAddr_,
349  addr.ccuChan_ );
350 
351  // Build DetInfo object
352  DetInfo info;
353  info.dcuId_ = det->getDcuHardId();
354  info.detId_ = det->getDetId();
355  info.pairs_ = det->getApvNumber()/2;
356 
357  // Add it to map
358  if ( fec_key.isValid() ) { detInfo_[pp][fec_key.key()] = info; }
359 
360  }
361  }
362 
363  // Debug
364  if ( edm::isDebugEnabled() ) {
365  std::stringstream ss;
366  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
367  << " List of modules for "
368  << detInfo_.size()
369  << " partitions, with their DCUids, DetIds, and nApvPairs: " << std::endl;
370  std::map<std::string,DetInfos>::const_iterator ii = detInfo_.begin();
371  std::map<std::string,DetInfos>::const_iterator jj = detInfo_.end();
372  for ( ; ii != jj; ++ii ) {
373  ss << " Partition \"" << ii->first
374  << "\" has " << ii->second.size()
375  << " modules:"
376  << std::endl;
377  DetInfos::const_iterator iii = ii->second.begin();
378  DetInfos::const_iterator jjj = ii->second.end();
379  for ( ; iii != jjj; ++iii ) {
380  SiStripFecKey key = iii->first;
381  ss << " module= "
382  << key.fecCrate() << "/"
383  << key.fecSlot() << "/"
384  << key.fecRing() << "/"
385  << key.ccuAddr() << "/"
386  << key.ccuChan() << ", "
387  << std::hex
388  << " DCUid= "
389  << std::setw(8) << std::setfill('0') << iii->second.dcuId_
390  << " DetId= "
391  << std::setw(8) << std::setfill('0') << iii->second.detId_
392  << std::dec
393  << " nPairs= "
394  << iii->second.pairs_
395  << std::endl;
396  }
397  }
398  //LogTrace(mlDqmClient_) << ss.str();
399  }
400 
401 }
bool isDebugEnabled()
DcuDetIds::range DcuDetIdsRange
const uint16_t & fecRing() const
tuple pp
Definition: createTree.py:15
static const char mlDqmClient_[]
const uint16_t & fecSlot() const
std::map< std::string, DetInfos > detInfo_
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
const_iterator_range partitions() const
static DcuDetIdsV::const_iterator findDcuDetId(DcuDetIdsV::const_iterator begin, DcuDetIdsV::const_iterator end, uint32_t dcu_id)
Definition: DcuDetIds.cc:396
DeviceDescriptions::range DeviceDescriptionsRange
DeviceAddress deviceAddress(const deviceDescription &)
const uint16_t & fecCrate() const
const SiStripDbParams & dbParams() const
const uint16_t & ccuAddr() const
list key
Definition: combine.py:13
const uint16_t & ccuChan() const
SiStripConfigDb *const db() const
DeviceDescriptionsRange getDeviceDescriptions(std::string partition="")
DcuDetIdsRange getDcuDetIds(std::string partition="")
Definition: DcuDetIds.cc:11
SiStripFedCabling *const CommissioningHistosUsingDb::cabling ( ) const
inlineprotected
virtual void CommissioningHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV ,
Analysis   
)
inlineprotectedvirtual
void CommissioningHistosUsingDb::createAnalyses ( SiStripConfigDb::AnalysisDescriptionsV desc)
protectedvirtual

Definition at line 260 of file CommissioningHistosUsingDb.cc.

References create(), CommissioningHistograms::data(), LogTrace, and sistrip::mlDqmClient_.

Referenced by uploadAnalyses().

260  {
261 
263  << "[CommissioningHistosUsingDb::" << __func__ << "]"
264  << " Creating AnalysisDescriptions...";
265 
266  desc.clear();
267 
268 // uint16_t size = 0;
269 // std::stringstream ss;
270 // ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
271 // << " Analysis descriptions:" << std::endl;
272 
273  Analyses::iterator ianal = data().begin();
274  Analyses::iterator janal = data().end();
275  for ( ; ianal != janal; ++ianal ) {
276 
277  // create analysis description
278  create( desc, ianal );
279 
280 // // debug
281 // if ( ianal->second ) {
282 // if ( desc.size()/2 > size ) { // print every 2nd description
283 // size = desc.size()/2;
284 // ianal->second->print(ss);
285 // ss << (*(desc.end()-2))->toString();
286 // ss << (*(desc.end()-1))->toString();
287 // ss << std::endl;
288 // }
289 // }
290 
291  }
292 
293 // LogTrace(mlDqmClient_) << ss.str();
294 
295 }
static const char mlDqmClient_[]
#define LogTrace(id)
virtual void create(SiStripConfigDb::AnalysisDescriptionsV &, Analysis)
SiStripConfigDb *const CommissioningHistosUsingDb::db ( ) const
inlineprotected
std::pair< std::string, CommissioningHistosUsingDb::DetInfo > CommissioningHistosUsingDb::detInfo ( const SiStripFecKey key)
protected

Definition at line 405 of file CommissioningHistosUsingDb.cc.

References sistrip::CCU_CHAN, detInfo_, SiStripFecKey::isInvalid(), findQualityFiles::jj, SiStripKey::key(), and tmp.

Referenced by deviceIsPresent().

405  {
407  if ( tmp.isInvalid() ) { return std::make_pair("",DetInfo()); }
408  std::map<std::string,DetInfos>::const_iterator ii = detInfo_.begin();
409  std::map<std::string,DetInfos>::const_iterator jj = detInfo_.end();
410  for ( ; ii != jj; ++ii ) {
411  DetInfos::const_iterator iii = ii->second.find( tmp.key() );
412  if ( iii != ii->second.end() ) { return std::make_pair(ii->first,iii->second); }
413  }
414  return std::make_pair("",DetInfo());
415 }
std::map< std::string, DetInfos > detInfo_
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool CommissioningHistosUsingDb::deviceIsPresent ( const SiStripFecKey key)
protected

Definition at line 419 of file CommissioningHistosUsingDb.cc.

References sistrip::CCU_CHAN, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), SiStripKey::channel(), detInfo(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), info, sistrip::invalid32_, sistrip::mlDqmClient_, and tmp.

Referenced by ApvTimingHistosUsingDb::update(), VpspScanHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), PedestalsHistosUsingDb::update(), and OptoScanHistosUsingDb::update().

419  {
421  std::pair<std::string,DetInfo> info = detInfo(key);
422  if ( info.second.dcuId_ != sistrip::invalid32_ ) {
423  if ( key.channel() == 2 && info.second.pairs_ == 2 ) { return false; }
424  else { return true; }
425  } else {
426  std::stringstream ss;
427  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
428  << " Cannot find module (crate/FEC/ring/CCU/module): "
429  << tmp.fecCrate() << "/"
430  << tmp.fecSlot() << "/"
431  << tmp.fecRing() << "/"
432  << tmp.ccuAddr() << "/"
433  << tmp.ccuChan()
434  << "!";
435  edm::LogWarning(mlDqmClient_) << ss.str();
436  return true;
437  }
438 }
static const uint32_t invalid32_
Definition: Constants.h:16
static const char mlDqmClient_[]
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
std::pair< std::string, DetInfo > detInfo(const SiStripFecKey &)
const uint16_t & channel() const
Definition: SiStripKey.h:129
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool CommissioningHistosUsingDb::doUploadAnal ( ) const
inline
void CommissioningHistosUsingDb::doUploadAnal ( bool  upload)
inline
bool CommissioningHistosUsingDb::doUploadConf ( ) const
inline
void CommissioningHistosUsingDb::doUploadConf ( bool  upload)
inline
void CommissioningHistosUsingDb::uploadAnalyses ( )
protected

Definition at line 94 of file CommissioningHistosUsingDb.cc.

References SiStripConfigDb::addAnalysisDescriptions(), SiStripConfigDb::clearAnalysisDescriptions(), createAnalyses(), db_, SiStripConfigDb::dbParams(), SiStripConfigDb::deviceFactory(), sistrip::mlDqmClient_, SiStripDbParams::partitions(), uploadAnal_, SiStripConfigDb::uploadAnalysisDescriptions(), and uploadConf_.

Referenced by uploadToConfigDb().

94  {
95 
96  if ( !db_ ) {
98  << "[CommissioningHistosUsingDb::" << __func__ << "]"
99  << " NULL pointer to SiStripConfigDb interface!"
100  << " Aborting upload...";
101  return;
102  }
103 
105  SiStripDbParams::SiStripPartitions::const_iterator ip = db_->dbParams().partitions().begin();
106  SiStripDbParams::SiStripPartitions::const_iterator jp = db_->dbParams().partitions().end();
107  for ( ; ip != jp; ++ip ) {
108 
110  << "[CommissioningHistosUsingDb::" << __func__ << "]"
111  << " Starting from partition " << ip->first
112  << " with versions:\n" << std::dec
113  << " Conn: " << ip->second.cabVersion().first << "." << ip->second.cabVersion().second << "\n"
114  << " FED: " << ip->second.fedVersion().first << "." << ip->second.fedVersion().second << "\n"
115  << " FEC: " << ip->second.fecVersion().first << "." << ip->second.fecVersion().second << "\n"
116  << " Mask: " << ip->second.maskVersion().first << "." << ip->second.maskVersion().second;
117 
118  // Upload commissioning analysis results
120  createAnalyses( anals );
121 
123  << "[CommissioningHistosUsingDb::" << __func__ << "]"
124  << " Created analysis descriptions for "
125  << anals.size() << " devices";
126 
127  // Update analysis descriptions with new commissioning results
128  if ( uploadAnal_ ) {
129  if ( uploadConf_ ) {
131  << "[CommissioningHistosUsingDb::" << __func__ << "]"
132  << " Uploading major version of analysis descriptions to DB"
133  << " (will be used for physics)...";
134  }
135  else {
137  << "[CommissioningHistosUsingDb::" << __func__ << "]"
138  << " Uploading minor version of analysis descriptions to DB"
139  << " (will not be used for physics)...";
140  }
141  db_->clearAnalysisDescriptions( ip->second.partitionName() );
142  db_->addAnalysisDescriptions( ip->second.partitionName(), anals );
143  db_->uploadAnalysisDescriptions( uploadConf_, ip->second.partitionName() );
145  << "[CommissioningHistosUsingDb::" << __func__ << "]"
146  << " Upload of analysis descriptions to DB finished!";
147  }
148  else {
150  << "[CommissioningHistosUsingDb::" << __func__ << "]"
151  << " TEST! No analysis descriptions will be uploaded to DB...";
152  }
153 
154  if ( uploadConf_ ) {
155  SiStripDbParams::SiStripPartitions::const_iterator ip = db_->dbParams().partitions().begin();
156  SiStripDbParams::SiStripPartitions::const_iterator jp = db_->dbParams().partitions().end();
157  for ( ; ip != jp; ++ip ) {
158  DeviceFactory* df = db_->deviceFactory();
159  tkStateVector states = df->getCurrentStates();
160  tkStateVector::const_iterator istate = states.begin();
161  tkStateVector::const_iterator jstate = states.end();
162  while ( istate != jstate ) {
163  if ( *istate && ip->first == (*istate)->getPartitionName() ) { break; }
164  istate++;
165  }
166  // Set versions if state was found
167  if ( istate != states.end() ) {
169  << "[CommissioningHistosUsingDb::" << __func__ << "]"
170  << " Created new version for partition " << ip->first
171  << ". Current state:\n" << std::dec
172  << " Conn: " << (*istate)->getConnectionVersionMajorId() << "." << (*istate)->getConnectionVersionMinorId() << "\n"
173  << " FED: " << (*istate)->getFedVersionMajorId() << "." << (*istate)->getFedVersionMinorId() << "\n"
174  << " FEC: " << (*istate)->getFecVersionMajorId() << "." << (*istate)->getFecVersionMinorId() << "\n"
175  << " Mask: " << (*istate)->getMaskVersionMajorId() << "." << (*istate)->getMaskVersionMinorId();
176  }
177  }
178  }
179 
180  }
181 
182 }
DeviceFactory *const deviceFactory(std::string method_name="") const
void uploadAnalysisDescriptions(bool calibration_for_physics=false, std::string partition="")
void addAnalysisDescriptions(std::string partition, AnalysisDescriptionsV &)
static const char mlDqmClient_[]
const_iterator_range partitions() const
void clearAnalysisDescriptions(std::string partition="")
const SiStripDbParams & dbParams() const
virtual void createAnalyses(SiStripConfigDb::AnalysisDescriptionsV &)
std::vector< AnalysisDescription * > AnalysisDescriptionsV
virtual void CommissioningHistosUsingDb::uploadConfigurations ( )
inlineprotectedvirtual
void CommissioningHistosUsingDb::uploadToConfigDb ( )

Member Data Documentation

SiStripFedCabling* CommissioningHistosUsingDb::cabling_
private

Definition at line 83 of file CommissioningHistosUsingDb.h.

Referenced by addDcuDetIds(), cabling(), and CommissioningHistosUsingDb().

SiStripConfigDb* CommissioningHistosUsingDb::db_
private
std::map<std::string,DetInfos> CommissioningHistosUsingDb::detInfo_
private

Definition at line 87 of file CommissioningHistosUsingDb.h.

Referenced by buildDetInfo(), and detInfo().

sistrip::RunType CommissioningHistosUsingDb::runType_
private

Definition at line 79 of file CommissioningHistosUsingDb.h.

Referenced by CommissioningHistosUsingDb().

bool CommissioningHistosUsingDb::uploadAnal_
private

Definition at line 89 of file CommissioningHistosUsingDb.h.

Referenced by doUploadAnal(), and uploadAnalyses().

bool CommissioningHistosUsingDb::uploadConf_
private

Definition at line 91 of file CommissioningHistosUsingDb.h.

Referenced by doUploadConf(), and uploadAnalyses().