CMS 3D CMS Logo

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)
 
void configure (const edm::ParameterSet &, const edm::EventSetup &) override
 
bool doUploadAnal () const
 
void doUploadAnal (bool)
 
bool doUploadConf () const
 
void doUploadConf (bool)
 
void uploadToConfigDb ()
 
 ~CommissioningHistosUsingDb () override
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
 CommissioningHistograms ()
 
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, DetInfoDetInfos
 

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, HistosHistosMap
 
- 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 86 of file CommissioningHistosUsingDb.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file CommissioningHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

23  runType_(type),
24  db_(db),
25  cabling_(nullptr),
26  detInfo_(),
27  uploadAnal_(true),
28  uploadConf_(false)
29 {
31  << "[" << __PRETTY_FUNCTION__ << "]"
32  << " Constructing object...";
33 }
type
Definition: HCALResponse.h:21
static const char mlDqmClient_[]
std::map< std::string, DetInfos > detInfo_
#define LogTrace(id)
CommissioningHistosUsingDb::~CommissioningHistosUsingDb ( )
override

Definition at line 53 of file CommissioningHistosUsingDb.cc.

References db_, LogTrace, and sistrip::mlDqmClient_.

53  {
54  if ( db_ ) { delete db_; }
56  << "[" << __PRETTY_FUNCTION__ << "]"
57  << " Destructing object...";
58 }
static const char mlDqmClient_[]
#define LogTrace(id)
CommissioningHistosUsingDb::CommissioningHistosUsingDb ( )
private

Definition at line 37 of file CommissioningHistosUsingDb.cc.

References LogTrace, and sistrip::mlDqmClient_.

Referenced by CommissioningHistosUsingDb::DetInfo::DetInfo().

40  db_(nullptr),
41  cabling_(nullptr),
42  detInfo_(),
43  uploadAnal_(false),
44  uploadConf_(false)
45 {
47  << "[" << __PRETTY_FUNCTION__ << "]"
48  << " Constructing object..." << endl;
49 }
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 198 of file CommissioningHistosUsingDb.cc.

References cabling_, FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), 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().

198  {
199 
200  if ( !cabling_ ) {
202  << "[CommissioningHistosUsingDb::" << __func__ << "]"
203  << " NULL pointer to SiStripFedCabling object!";
204  return;
205  }
206 
207  Analyses::iterator ianal = data().begin();
208  Analyses::iterator janal = data().end();
209  for ( ; ianal != janal; ++ianal ) {
210 
211  CommissioningAnalysis* anal = ianal->second;
212 
213  if ( !anal ) {
215  << "[CommissioningHistosUsingDb::" << __func__ << "]"
216  << " NULL pointer to CommissioningAnalysis object!";
217  return;
218  }
219 
220  SiStripFedKey fed_key = anal->fedKey();
221  SiStripFecKey fec_key = anal->fecKey();
222 
224  fed_key.fedChannel() );
225 
226  SiStripFedKey fed( conn.fedId(),
227  SiStripFedKey::feUnit( conn.fedCh() ),
228  SiStripFedKey::feChan( conn.fedCh() ) );
229 
230  SiStripFecKey fec( conn.fecCrate(),
231  conn.fecSlot(),
232  conn.fecRing(),
233  conn.ccuAddr(),
234  conn.ccuChan(),
235  conn.lldChannel() );
236 
237  if ( fed_key.path() != fed.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 FED key retrieved from cabling!" << std::endl
243  << " FED key from analysis object : " << fed_key.path() << std::endl
244  << " FED key from cabling object : " << fed.path() << std::endl
245  << " FED id/ch from analysis object: " << fed_key.fedId() << "/" << fed_key.fedChannel() << std::endl
246  << " FED id/ch from cabling object : " << conn.fedId() << "/" << conn.fedCh();
247  edm::LogWarning(mlDqmClient_) << ss.str();
248 
249  } else if ( fec_key.path() != fec.path() ) {
250 
251  std::stringstream ss;
252  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
253  << " Cannot set DCU and DetId values in commissioning analysis object!" << std::endl
254  << " Incompatible FEC key retrieved from cabling!" << std::endl
255  << " FEC key from analysis object : " << fec_key.path() << std::endl
256  << " FEC key from cabling object : " << fec.path();
257  edm::LogWarning(mlDqmClient_) << ss.str();
258 
259  } else {
260 
261  anal->dcuId( conn.dcuId() );
262  anal->detId( conn.detId() );
263 
264  }
265 
266  }
267 
268 }
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.
void CommissioningHistosUsingDb::buildDetInfo ( )
protected

Definition at line 311 of file CommissioningHistosUsingDb.cc.

References SiStripFecKey::ccuAddr(), SiStripConfigDb::DeviceAddress::ccuAddr_, SiStripFecKey::ccuChan(), SiStripConfigDb::DeviceAddress::ccuChan_, db(), db_, SiStripConfigDb::dbParams(), CommissioningHistosUsingDb::DetInfo::dcuId_, TauDecayModes::dec, 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, crabWrapper::key, SiStripKey::key(), sistrip::mlDqmClient_, CommissioningHistosUsingDb::DetInfo::pairs_, SiStripDbParams::partitions(), createTree::pp, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by uploadToConfigDb().

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

Reimplemented from CommissioningHistograms.

Reimplemented in FineDelayHistosUsingDb, and LatencyHistosUsingDb.

Definition at line 60 of file CommissioningHistosUsingDb.cc.

References SiStripFedCablingBuilderFromDb::buildFecCabling(), SiStripFedCablingBuilderFromDb::buildFecCablingFromDevices(), cabling_, db_, sistrip::FAST_CABLING, edm::EventSetup::get(), SiStripFedCablingBuilderFromDb::getFedCabling(), LogTrace, sistrip::mlDqmClient_, edm::ESHandle< T >::product(), runType_, SiStripFedCabling::summary(), and SiStripFedCabling::terse().

Referenced by FineDelayHistosUsingDb::configure(), and LatencyHistosUsingDb::configure().

61 {
62  if ( !db_ ) {
64  << "[CommissioningHistosUsingDb::" << __func__ << "]"
65  << " NULL pointer to SiStripConfigDb interface!"
66  << " Cannot configure...";
67  } else {
68  // Build FEC cabling object from connections found in DB
69  SiStripFecCabling fec_cabling;
72  } else {
74  }
75 
76  // Build FED cabling from FEC cabling
79  std::stringstream ss;
80  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
81  << " Terse print out of FED cabling:" << std::endl;
82  cabling_->terse(ss);
83  LogTrace(mlDqmClient_) << ss.str();
84 
86  setup.get<TrackerTopologyRcd>().get(tTopo);
87  std::stringstream sss;
88  sss << "[CommissioningHistosUsingDb::" << __func__ << "]"
89  << " Summary of FED cabling:" << std::endl;
90  cabling_->summary(sss, tTopo.product());
91  edm::LogVerbatim(mlDqmClient_) << sss.str();
92  }
93 }
void terse(std::stringstream &) const
static const char mlDqmClient_[]
static void buildFecCabling(SiStripConfigDb *const, SiStripFecCabling &, const sistrip::CablingSource &)
#define LogTrace(id)
static void getFedCabling(const SiStripFecCabling &in, SiStripFedCabling &out)
const T & get() const
Definition: EventSetup.h:59
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void summary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
T const * product() const
Definition: ESHandle.h:86
static void buildFecCablingFromDevices(SiStripConfigDb *const, SiStripFecCabling &)
virtual void CommissioningHistosUsingDb::create ( SiStripConfigDb::AnalysisDescriptionsV ,
Analysis   
)
inlineprotectedvirtual
void CommissioningHistosUsingDb::createAnalyses ( SiStripConfigDb::AnalysisDescriptionsV desc)
protectedvirtual

Definition at line 272 of file CommissioningHistosUsingDb.cc.

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

Referenced by uploadAnalyses(), and uploadConfigurations().

272  {
273 
275  << "[CommissioningHistosUsingDb::" << __func__ << "]"
276  << " Creating AnalysisDescriptions...";
277 
278  desc.clear();
279 
280 // uint16_t size = 0;
281 // std::stringstream ss;
282 // ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
283 // << " Analysis descriptions:" << std::endl;
284 
285  Analyses::iterator ianal = data().begin();
286  Analyses::iterator janal = data().end();
287  for ( ; ianal != janal; ++ianal ) {
288 
289  // create analysis description
290  create( desc, ianal );
291 
292 // // debug
293 // if ( ianal->second ) {
294 // if ( desc.size()/2 > size ) { // print every 2nd description
295 // size = desc.size()/2;
296 // ianal->second->print(ss);
297 // ss << (*(desc.end()-2))->toString();
298 // ss << (*(desc.end()-1))->toString();
299 // ss << std::endl;
300 // }
301 // }
302 
303  }
304 
305 // LogTrace(mlDqmClient_) << ss.str();
306 
307 }
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 417 of file CommissioningHistosUsingDb.cc.

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

Referenced by CommissioningHistosUsingDb::DetInfo::DetInfo(), and deviceIsPresent().

417  {
419  if ( tmp.isInvalid() ) { return std::make_pair("",DetInfo()); }
420  std::map<std::string,DetInfos>::const_iterator ii = detInfo_.begin();
421  std::map<std::string,DetInfos>::const_iterator jj = detInfo_.end();
422  for ( ; ii != jj; ++ii ) {
423  DetInfos::const_iterator iii = ii->second.find( tmp.key() );
424  if ( iii != ii->second.end() ) { return std::make_pair(ii->first,iii->second); }
425  }
426  return std::make_pair("",DetInfo());
427 }
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
ii
Definition: cuy.py:588
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool CommissioningHistosUsingDb::deviceIsPresent ( const SiStripFecKey key)
protected

Definition at line 431 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 CommissioningHistosUsingDb::DetInfo::DetInfo(), VpspScanHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), PedestalsHistosUsingDb::update(), OptoScanHistosUsingDb::update(), and ApvTimingHistosUsingDb::update().

431  {
433  std::pair<std::string,DetInfo> info = detInfo(key);
434  if ( info.second.dcuId_ != sistrip::invalid32_ ) {
435  if ( key.channel() == 2 && info.second.pairs_ == 2 ) { return false; }
436  else { return true; }
437  } else {
438  std::stringstream ss;
439  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
440  << " Cannot find module (crate/FEC/ring/CCU/module): "
441  << tmp.fecCrate() << "/"
442  << tmp.fecSlot() << "/"
443  << tmp.fecRing() << "/"
444  << tmp.ccuAddr() << "/"
445  << tmp.ccuChan()
446  << "!";
447  edm::LogWarning(mlDqmClient_) << ss.str();
448  return true;
449  }
450 }
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

Definition at line 97 of file CommissioningHistosUsingDb.h.

References alcaDQMUpload::upload(), and uploadAnal_.

bool CommissioningHistosUsingDb::doUploadConf ( ) const
inline
void CommissioningHistosUsingDb::doUploadConf ( bool  upload)
inline

Definition at line 96 of file CommissioningHistosUsingDb.h.

References alcaDQMUpload::upload(), and uploadConf_.

void CommissioningHistosUsingDb::uploadAnalyses ( )
protected

Definition at line 106 of file CommissioningHistosUsingDb.cc.

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

Referenced by uploadConfigurations(), and uploadToConfigDb().

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

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

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

Definition at line 88 of file CommissioningHistosUsingDb.h.

Referenced by buildDetInfo(), and detInfo().

sistrip::RunType CommissioningHistosUsingDb::runType_
private

Definition at line 80 of file CommissioningHistosUsingDb.h.

Referenced by configure().

bool CommissioningHistosUsingDb::uploadAnal_
private

Definition at line 90 of file CommissioningHistosUsingDb.h.

Referenced by doUploadAnal(), and uploadAnalyses().

bool CommissioningHistosUsingDb::uploadConf_
private

Definition at line 92 of file CommissioningHistosUsingDb.h.

Referenced by doUploadConf(), and uploadAnalyses().