CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType > Class Template Reference

#include <SiPixelTemplateHelper.h>

Inheritance diagram for templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >:
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV > cond::payloadInspector::PlotImpl< IOV_M, 0 > cond::payloadInspector::PlotBase

Public Member Functions

bool fill () override
 
 SiPixelFullPixelIDMap ()
 
- Public Member Functions inherited from cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >
std::shared_ptr< PayloadType > fetchPayload (const cond::Hash &payloadHash)
 
 PlotImage (const std::string &title)
 
std::string serializeData () override
 
- Public Member Functions inherited from cond::payloadInspector::PlotImpl< IOV_M, 0 >
 PlotImpl (const std::string &type, const std::string &title)
 
std::string processData () override
 
 ~PlotImpl () override=default
 
- Public Member Functions inherited from cond::payloadInspector::PlotBase
void addInputParam (const std::string &paramName)
 
cond::persistency::Session dbSession ()
 
template<typename PayloadType >
std::shared_ptr< PayloadType > fetchPayload (const cond::Hash &payloadHash)
 
template<int index>
TagReference getTag ()
 
cond::Tag_t getTagInfo (const std::string &tag)
 
virtual void init ()
 
const std::map< std::string, std::string > & inputParamValues () const
 
bool isSingleIov () const
 
bool isTwoTags () const
 
unsigned int ntags () const
 
std::string payloadType () const
 
 PlotBase ()
 
std::string title () const
 
std::string type () const
 
virtual ~PlotBase ()=default
 

Protected Attributes

bool isTemplate_
 
std::string label_
 
- Protected Attributes inherited from cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >
std::string m_imageFileName
 
- Protected Attributes inherited from cond::payloadInspector::PlotBase
std::set< std::string > m_inputParams
 
std::map< std::string, std::string > m_inputParamValues
 
PlotAnnotations m_plotAnnotations
 
std::vector< std::pair< cond::Time_t, cond::Time_t > > m_tagBoundaries
 
std::vector< std::vector< std::tuple< cond::Time_t, cond::Hash > > > m_tagIovs
 
std::vector< std::string > m_tagNames
 

Additional Inherited Members

- Public Types inherited from cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >
typedef PlotImpl< IOV_M, 0 > Base
 

Detailed Description

template<class PayloadType, class StoreType, class TransientType>
class templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >

Definition at line 419 of file SiPixelTemplateHelper.h.

Constructor & Destructor Documentation

◆ SiPixelFullPixelIDMap()

template<class PayloadType , class StoreType , class TransientType >
templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::SiPixelFullPixelIDMap ( )
inline

Definition at line 422 of file SiPixelTemplateHelper.h.

References templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::isTemplate_, and templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::label_.

424  "SiPixel CPE conditions Map of IDs") {
425  if constexpr (std::is_same_v<PayloadType, SiPixelGenErrorDBObject>) {
426  isTemplate_ = false;
427  label_ = "SiPixelGenErrorDBObject_PayloadInspector";
428  } else {
429  isTemplate_ = true;
430  label_ = "SiPixelTemplateDBObject_PayloadInspector";
431  }
432  }

Member Function Documentation

◆ fill()

template<class PayloadType , class StoreType , class TransientType >
bool templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::fill ( )
inlineoverridevirtual

Implements cond::payloadInspector::PlotImpl< IOV_M, 0 >.

Definition at line 434 of file SiPixelTemplateHelper.h.

References svgfig::canvas(), Phase1PixelSummaryMap::createTrackerBaseMap(), SiPixelPI::displayNotSupported(), mps_splice::entry, Exception, cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::fetchPayload(), MillePedeFileConverter_cfg::fileName, Phase1PixelSummaryMap::fillTrackerMap(), templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::isTemplate_, templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::label_, cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::m_imageFileName, jetsAK4_Puppi_cff::payload, SiPixelPI::phase0size, SiPixelPI::phase1size, Phase1PixelSummaryMap::printTrackerMap(), AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and to_string().

434  {
435  gStyle->SetPalette(1);
436  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
437  auto iov = tag.iovs.front();
438  std::vector<StoreType> thePixelTemp_;
439  std::shared_ptr<PayloadType> payload = this->fetchPayload(std::get<1>(iov));
440 
441  std::string payloadString = (isTemplate_ ? "Templates" : "GenErrors");
442 
443  if (payload.get()) {
444  if (!TransientType::pushfile(*payload, thePixelTemp_)) {
445  throw cms::Exception(label_) << "\nERROR: " << payloadString
446  << " not filled correctly. Check the conditions. Using "
447  << (isTemplate_ ? "SiPixelTemplateDBObject" : "SiPixelGenErrorDBObject")
448  << payload->version() << "\n\n";
449  }
450 
451  Phase1PixelSummaryMap fullMap("", fmt::sprintf("%s IDs", payloadString), fmt::sprintf("%s ID", payloadString));
452  fullMap.createTrackerBaseMap();
453 
454  std::map<unsigned int, short> templMap;
455  if constexpr (std::is_same_v<PayloadType, SiPixelGenErrorDBObject>) {
456  templMap = payload->getGenErrorIDs();
457  } else {
458  templMap = payload->getTemplateIDs();
459  }
460 
461  for (const auto& entry : templMap) {
462  fullMap.fillTrackerMap(entry.first, entry.second);
463  }
464 
465  if (templMap.size() == SiPixelPI::phase0size || templMap.size() > SiPixelPI::phase1size) {
467  << "There are " << templMap.size()
468  << " DetIds in this payload. SiPixelIDs maps are not supported for non-Phase1 Pixel geometries !";
469  TCanvas canvas("Canv", "Canv", 1200, 1000);
470  SiPixelPI::displayNotSupported(canvas, templMap.size());
472  canvas.SaveAs(fileName.c_str());
473  return false;
474  } else {
475  if (templMap.size() < SiPixelPI::phase1size) {
476  edm::LogWarning(label_) << "\n ********* WARNING! ********* \n There are " << templMap.size()
477  << " DetIds in this payload !"
478  << "\n **************************** \n";
479  }
480  }
481 
482  TCanvas canvas("Canv", "Canv", 3000, 2000);
483  fullMap.printTrackerMap(canvas);
484 
485  //fmt::sprintf("#color[2]{%s, IOV %i}",tag.name,std::get<0>(iov));
486 
487  auto ltx = TLatex();
488  ltx.SetTextFont(62);
489  ltx.SetTextSize(0.025);
490  ltx.SetTextAlign(11);
491  ltx.DrawLatexNDC(
492  gPad->GetLeftMargin() + 0.01,
493  gPad->GetBottomMargin() + 0.01,
494  ("#color[4]{" + tag.name + "}, IOV: #color[4]{" + std::to_string(std::get<0>(iov)) + "}").c_str());
495 
497  canvas.SaveAs(fileName.c_str());
498  }
499  return true;
500  }
static const unsigned int phase0size
Log< level::Error, false > LogError
static std::string to_string(const XMLCh *ch)
static const unsigned int phase1size
void displayNotSupported(TCanvas &canv, const unsigned int size)
def canvas(sub, attr)
Definition: svgfig.py:482
Log< level::Warning, false > LogWarning
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)

Member Data Documentation

◆ isTemplate_

template<class PayloadType , class StoreType , class TransientType >
bool templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::isTemplate_
protected

◆ label_

template<class PayloadType , class StoreType , class TransientType >
std::string templateHelper::SiPixelFullPixelIDMap< PayloadType, StoreType, TransientType >::label_
protected