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 DaqScopeModeHistosUsingDb FastFedCablingHistosUsingDb FineDelayHistosUsingDb LatencyHistosUsingDb NoiseHistosUsingDb OptoScanHistosUsingDb PedestalsHistosUsingDb PedsFullNoiseHistosUsingDb PedsOnlyHistosUsingDb 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, std::string partitionName="")
 
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 (bool getMaskedData=false)
 
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 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::unique_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
Analyses & data(bool getMaskedData=false)
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 291 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().

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

Definition at line 102 of file CommissioningHistosUsingDb.h.

References db_.

Referenced by FastFedCablingHistosUsingDb::addDcuDetIds(), buildDetInfo(), FastFedCablingHistosUsingDb::connections(), DaqScopeModeHistosUsingDb::create(), VpspScanHistosUsingDb::create(), NoiseHistosUsingDb::create(), OptoScanHistosUsingDb::create(), PedestalsHistosUsingDb::create(), PedsFullNoiseHistosUsingDb::create(), PedsOnlyHistosUsingDb::create(), ApvTimingHistosUsingDb::create(), LatencyHistosUsingDb::create(), CalibrationHistosUsingDb::create(), FastFedCablingHistosUsingDb::create(), FineDelayHistosUsingDb::create(), create(), VpspScanHistosUsingDb::update(), OptoScanHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), LatencyHistosUsingDb::update(), CalibrationHistosUsingDb::update(), FineDelayHistosUsingDb::update(), DaqScopeModeHistosUsingDb::uploadConfigurations(), VpspScanHistosUsingDb::uploadConfigurations(), PedsOnlyHistosUsingDb::uploadConfigurations(), PedsFullNoiseHistosUsingDb::uploadConfigurations(), NoiseHistosUsingDb::uploadConfigurations(), OptoScanHistosUsingDb::uploadConfigurations(), ApvTimingHistosUsingDb::uploadConfigurations(), PedestalsHistosUsingDb::uploadConfigurations(), FastFedCablingHistosUsingDb::uploadConfigurations(), LatencyHistosUsingDb::uploadConfigurations(), CalibrationHistosUsingDb::uploadConfigurations(), and FineDelayHistosUsingDb::uploadConfigurations().

102 { return db_; }
std::pair< std::string, CommissioningHistosUsingDb::DetInfo > CommissioningHistosUsingDb::detInfo ( const SiStripFecKey key)
protected

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

397  {
399  if ( tmp.isInvalid() ) { return std::make_pair("",DetInfo()); }
400  std::map<std::string,DetInfos>::const_iterator ii = detInfo_.begin();
401  std::map<std::string,DetInfos>::const_iterator jj = detInfo_.end();
402  for ( ; ii != jj; ++ii ) {
403  DetInfos::const_iterator iii = ii->second.find( tmp.key() );
404  if ( iii != ii->second.end() ) { return std::make_pair(ii->first,iii->second); }
405  }
406  return std::make_pair("",DetInfo());
407 }
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:590
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool CommissioningHistosUsingDb::deviceIsPresent ( const SiStripFecKey key)
protected

Definition at line 411 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(), ApvTimingHistosUsingDb::update(), OptoScanHistosUsingDb::update(), DaqScopeModeHistosUsingDb::update(), PedestalsHistosUsingDb::update(), and CalibrationHistosUsingDb::update().

411  {
413  std::pair<std::string,DetInfo> info = detInfo(key);
414  if ( info.second.dcuId_ != sistrip::invalid32_ ) {
415  if ( key.channel() == 2 && info.second.pairs_ == 2 ) { return false; }
416  else { return true; }
417  } else {
418  std::stringstream ss;
419  ss << "[CommissioningHistosUsingDb::" << __func__ << "]"
420  << " Cannot find module (crate/FEC/ring/CCU/module): "
421  << tmp.fecCrate() << "/"
422  << tmp.fecSlot() << "/"
423  << tmp.fecRing() << "/"
424  << tmp.ccuAddr() << "/"
425  << tmp.ccuChan()
426  << "!";
427  edm::LogWarning(mlDqmClient_) << ss.str();
428  return true;
429  }
430 }
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().