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 16 of file CommissioningHistosUsingDb.h.

Member Typedef Documentation

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

Definition at line 84 of file CommissioningHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 18 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().

21  runType_(type),
22  db_(db),
23  cabling_(0),
24  detInfo_(),
25  uploadAnal_(true),
26  uploadConf_(false)
27 {
29  << "[" << __PRETTY_FUNCTION__ << "]"
30  << " Constructing object...";
31 
32  // Build FEC cabling object from connections found in DB
33  SiStripFecCabling fec_cabling;
36  } else {
38  }
39 
40  // Build FED cabling from FEC cabling
43  std::stringstream ss;
44  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
45  << " Terse print out of FED cabling:" << std::endl;
46  cabling_->terse(ss);
47  LogTrace(mlDqmClient_) << ss.str();
48 
49  std::stringstream sss;
50  sss << "[CommissioningHistosUsingDb::" << __func__ << "]"
51  << " Summary of FED cabling:" << std::endl;
52  cabling_->summary(sss);
53  edm::LogVerbatim(mlDqmClient_) << sss.str();
54 
55 }
type
Definition: HCALResponse.h:21
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 75 of file CommissioningHistosUsingDb.cc.

References db_, LogTrace, and sistrip::mlDqmClient_.

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

Definition at line 59 of file CommissioningHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

62  db_(0),
63  cabling_(0),
64  detInfo_(),
65  uploadAnal_(false),
66  uploadConf_(false)
67 {
69  << "[" << __PRETTY_FUNCTION__ << "]"
70  << " Constructing object..." << endl;
71 }
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 185 of file CommissioningHistosUsingDb.cc.

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

Referenced by uploadToConfigDb().

185  {
186 
187  if ( !cabling_ ) {
189  << "[CommissioningHistosUsingDb::" << __func__ << "]"
190  << " NULL pointer to SiStripFedCabling object!";
191  return;
192  }
193 
194  Analyses::iterator ianal = data().begin();
195  Analyses::iterator janal = data().end();
196  for ( ; ianal != janal; ++ianal ) {
197 
198  CommissioningAnalysis* anal = ianal->second;
199 
200  if ( !anal ) {
202  << "[CommissioningHistosUsingDb::" << __func__ << "]"
203  << " NULL pointer to CommissioningAnalysis object!";
204  return;
205  }
206 
207  SiStripFedKey fed_key = anal->fedKey();
208  SiStripFecKey fec_key = anal->fecKey();
209 
211  fed_key.fedChannel() );
212 
213  SiStripFedKey fed( conn.fedId(),
214  SiStripFedKey::feUnit( conn.fedCh() ),
215  SiStripFedKey::feChan( conn.fedCh() ) );
216 
217  SiStripFecKey fec( conn.fecCrate(),
218  conn.fecSlot(),
219  conn.fecRing(),
220  conn.ccuAddr(),
221  conn.ccuChan(),
222  conn.lldChannel() );
223 
224  if ( fed_key.path() != fed.path() ) {
225 
226  std::stringstream ss;
227  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
228  << " Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
229  << " Incompatible FED key retrieved from cabling!" << std::endl
230  << " FED key from analysis object : " << fed_key.path() << std::endl
231  << " FED key from cabling object : " << fed.path() << std::endl
232  << " FED id/ch from analysis object: " << fed_key.fedId() << "/" << fed_key.fedChannel() << std::endl
233  << " FED id/ch from cabling object : " << conn.fedId() << "/" << conn.fedCh();
234  edm::LogWarning(mlDqmClient_) << ss.str();
235 
236  } else if ( fec_key.path() != fec.path() ) {
237 
238  std::stringstream ss;
239  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
240  << " Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
241  << " Incompatible FEC key retrieved from cabling!" << std::endl
242  << " FEC key from analysis object : " << fec_key.path() << std::endl
243  << " FEC key from cabling object : " << fec.path();
244  edm::LogWarning(mlDqmClient_) << ss.str();
245 
246  } else {
247 
248  anal->dcuId( conn.dcuId() );
249  anal->detId( conn.detId() );
250 
251  }
252 
253  }
254 
255 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
const uint32_t & fedKey() const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const uint16_t & fedCh() const
static const char mlDqmClient_[]
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:45
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:126
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 298 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(), cuy::ii, info(), edm::isDebugEnabled(), SiStripFecKey::isValid(), findQualityFiles::jj, combine::key, SiStripKey::key(), sistrip::mlDqmClient_, CommissioningHistosUsingDb::DetInfo::pairs_, SiStripDbParams::partitions(), createTree::pp, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by uploadToConfigDb().

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

Definition at line 259 of file CommissioningHistosUsingDb.cc.

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

Referenced by uploadAnalyses().

259  {
260 
262  << "[CommissioningHistosUsingDb::" << __func__ << "]"
263  << " Creating AnalysisDescriptions...";
264 
265  desc.clear();
266 
267 // uint16_t size = 0;
268 // std::stringstream ss;
269 // ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
270 // << " Analysis descriptions:" << std::endl;
271 
272  Analyses::iterator ianal = data().begin();
273  Analyses::iterator janal = data().end();
274  for ( ; ianal != janal; ++ianal ) {
275 
276  // create analysis description
277  create( desc, ianal );
278 
279 // // debug
280 // if ( ianal->second ) {
281 // if ( desc.size()/2 > size ) { // print every 2nd description
282 // size = desc.size()/2;
283 // ianal->second->print(ss);
284 // ss << (*(desc.end()-2))->toString();
285 // ss << (*(desc.end()-1))->toString();
286 // ss << std::endl;
287 // }
288 // }
289 
290  }
291 
292 // LogTrace(mlDqmClient_) << ss.str();
293 
294 }
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 404 of file CommissioningHistosUsingDb.cc.

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

Referenced by deviceIsPresent().

404  {
406  if ( tmp.isInvalid() ) { return std::make_pair("",DetInfo()); }
407  std::map<std::string,DetInfos>::const_iterator ii = detInfo_.begin();
408  std::map<std::string,DetInfos>::const_iterator jj = detInfo_.end();
409  for ( ; ii != jj; ++ii ) {
410  DetInfos::const_iterator iii = ii->second.find( tmp.key() );
411  if ( iii != ii->second.end() ) { return std::make_pair(ii->first,iii->second); }
412  }
413  return std::make_pair("",DetInfo());
414 }
int ii
Definition: cuy.py:588
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:45
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool CommissioningHistosUsingDb::deviceIsPresent ( const SiStripFecKey key)
protected

Definition at line 418 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().

418  {
420  std::pair<std::string,DetInfo> info = detInfo(key);
421  if ( info.second.dcuId_ != sistrip::invalid32_ ) {
422  if ( key.channel() == 2 && info.second.pairs_ == 2 ) { return false; }
423  else { return true; }
424  } else {
425  std::stringstream ss;
426  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
427  << " Cannot find module (crate/FEC/ring/CCU/module): "
428  << tmp.fecCrate() << "/"
429  << tmp.fecSlot() << "/"
430  << tmp.fecRing() << "/"
431  << tmp.ccuAddr() << "/"
432  << tmp.ccuChan()
433  << "!";
434  edm::LogWarning(mlDqmClient_) << ss.str();
435  return true;
436  }
437 }
static const TGPicture * info(bool iBackgroundIsBlack)
static const uint32_t invalid32_
Definition: Constants.h:15
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:45
std::pair< std::string, DetInfo > detInfo(const SiStripFecKey &)
const uint16_t & channel() const
Definition: SiStripKey.h:128
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 93 of file CommissioningHistosUsingDb.cc.

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

Referenced by uploadToConfigDb().

93  {
94 
95  if ( !db_ ) {
97  << "[CommissioningHistosUsingDb::" << __func__ << "]"
98  << " NULL pointer to SiStripConfigDb interface!"
99  << " Aborting upload...";
100  return;
101  }
102 
104  SiStripDbParams::SiStripPartitions::const_iterator ip = db_->dbParams().partitions().begin();
105  SiStripDbParams::SiStripPartitions::const_iterator jp = db_->dbParams().partitions().end();
106  for ( ; ip != jp; ++ip ) {
107 
109  << "[CommissioningHistosUsingDb::" << __func__ << "]"
110  << " Starting from partition " << ip->first
111  << " with versions:\n" << std::dec
112  << " Conn: " << ip->second.cabVersion().first << "." << ip->second.cabVersion().second << "\n"
113  << " FED: " << ip->second.fedVersion().first << "." << ip->second.fedVersion().second << "\n"
114  << " FEC: " << ip->second.fecVersion().first << "." << ip->second.fecVersion().second << "\n"
115  << " Mask: " << ip->second.maskVersion().first << "." << ip->second.maskVersion().second;
116 
117  // Upload commissioning analysis results
119  createAnalyses( anals );
120 
122  << "[CommissioningHistosUsingDb::" << __func__ << "]"
123  << " Created analysis descriptions for "
124  << anals.size() << " devices";
125 
126  // Update analysis descriptions with new commissioning results
127  if ( uploadAnal_ ) {
128  if ( uploadConf_ ) {
130  << "[CommissioningHistosUsingDb::" << __func__ << "]"
131  << " Uploading major version of analysis descriptions to DB"
132  << " (will be used for physics)...";
133  }
134  else {
136  << "[CommissioningHistosUsingDb::" << __func__ << "]"
137  << " Uploading minor version of analysis descriptions to DB"
138  << " (will not be used for physics)...";
139  }
140  db_->clearAnalysisDescriptions( ip->second.partitionName() );
141  db_->addAnalysisDescriptions( ip->second.partitionName(), anals );
142  db_->uploadAnalysisDescriptions( uploadConf_, ip->second.partitionName() );
144  << "[CommissioningHistosUsingDb::" << __func__ << "]"
145  << " Upload of analysis descriptions to DB finished!";
146  }
147  else {
149  << "[CommissioningHistosUsingDb::" << __func__ << "]"
150  << " TEST! No analysis descriptions will be uploaded to DB...";
151  }
152 
153  if ( uploadConf_ ) {
154  SiStripDbParams::SiStripPartitions::const_iterator ip = db_->dbParams().partitions().begin();
155  SiStripDbParams::SiStripPartitions::const_iterator jp = db_->dbParams().partitions().end();
156  for ( ; ip != jp; ++ip ) {
157  DeviceFactory* df = db_->deviceFactory();
158  tkStateVector states = df->getCurrentStates();
159  tkStateVector::const_iterator istate = states.begin();
160  tkStateVector::const_iterator jstate = states.end();
161  while ( istate != jstate ) {
162  if ( *istate && ip->first == (*istate)->getPartitionName() ) { break; }
163  istate++;
164  }
165  // Set versions if state was found
166  if ( istate != states.end() ) {
168  << "[CommissioningHistosUsingDb::" << __func__ << "]"
169  << " Created new version for partition " << ip->first
170  << ". Current state:\n" << std::dec
171  << " Conn: " << (*istate)->getConnectionVersionMajorId() << "." << (*istate)->getConnectionVersionMinorId() << "\n"
172  << " FED: " << (*istate)->getFedVersionMajorId() << "." << (*istate)->getFedVersionMinorId() << "\n"
173  << " FEC: " << (*istate)->getFecVersionMajorId() << "." << (*istate)->getFecVersionMinorId() << "\n"
174  << " Mask: " << (*istate)->getMaskVersionMajorId() << "." << (*istate)->getMaskVersionMinorId();
175  }
176  }
177  }
178 
179  }
180 
181 }
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 82 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 86 of file CommissioningHistosUsingDb.h.

Referenced by buildDetInfo(), and detInfo().

sistrip::RunType CommissioningHistosUsingDb::runType_
private

Definition at line 78 of file CommissioningHistosUsingDb.h.

Referenced by CommissioningHistosUsingDb().

bool CommissioningHistosUsingDb::uploadAnal_
private

Definition at line 88 of file CommissioningHistosUsingDb.h.

Referenced by doUploadAnal(), and uploadAnalyses().

bool CommissioningHistosUsingDb::uploadConf_
private

Definition at line 90 of file CommissioningHistosUsingDb.h.

Referenced by doUploadConf(), and uploadAnalyses().