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)
 
std::string data () const
 
cond::persistency::Session dbSession ()
 
bool exec_process (const std::string &connectionString, const std::vector< std::tuple< std::string, cond::Time_t, cond::Time_t >> &tagsWithTimeBoundaries)
 
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 ()
 
boost::python::list inputParams () const
 
const std::map< std::string, std::string > & inputParamValues () const
 
bool isSingleIov () const
 
bool isTwoTags () const
 
unsigned int ntags () const
 
std::string payloadType () const
 
 PlotBase ()
 
bool process (const std::string &connectionString, const boost::python::list &tagsWithTimeBoundaries)
 
void setInputParamValues (const boost::python::dict &values)
 
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 414 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 418 of file SiPixelTemplateHelper.h.

418  :
420  : cond::payloadInspector::PlotImage<PayloadType, cond::payloadInspector::SINGLE_IOV>(
421  "SiPixel CPE conditions Map of IDs") {
422  if constexpr (std::is_same_v<PayloadType, SiPixelGenErrorDBObject>) {
423  isTemplate_ = false;
424  label_ = "SiPixelGenErrorDBObject_PayloadInspector";
425  } else {
426  isTemplate_ = true;
427  label_ = "SiPixelTemplateDBObject_PayloadInspector";
428  }

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

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 430 of file SiPixelTemplateHelper.h.

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

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, jets_cff::payload, SiPixelPI::phase0size, SiPixelPI::phase1size, Phase1PixelSummaryMap::printTrackerMap(), AlCaHLTBitMon_QueryRunRegistry::string, and makeGlobalPositionRcd_cfg::tag.

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
svgfig.canvas
def canvas(*sub, **attr)
Definition: svgfig.py:482
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::m_imageFileName
std::string m_imageFileName
Definition: PayloadInspector.h:910
templateHelper::SiPixelFullPixelIDMap::isTemplate_
bool isTemplate_
Definition: SiPixelTemplateHelper.h:499
mps_splice.entry
entry
Definition: mps_splice.py:68
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::PlotImage
PlotImage(const std::string &title)
Definition: PayloadInspector.h:897
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
SiPixelPI::displayNotSupported
void displayNotSupported(TCanvas &canv, const unsigned int size)
Definition: SiPixelPayloadInspectorHelper.h:782
templateHelper::SiPixelFullPixelIDMap::SiPixelFullPixelIDMap
SiPixelFullPixelIDMap()
Definition: SiPixelTemplateHelper.h:418
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SiPixelPI::phase0size
static const unsigned int phase0size
Definition: SiPixelPayloadInspectorHelper.h:42
jets_cff.payload
payload
Definition: jets_cff.py:32
cond
Definition: plugin.cc:23
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
Phase1PixelSummaryMap
Definition: Phase1PixelSummaryMap.h:56
SiPixelPI::phase1size
static const unsigned int phase1size
Definition: SiPixelPayloadInspectorHelper.h:43
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::fetchPayload
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
Definition: PayloadInspector.h:905
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
templateHelper::SiPixelFullPixelIDMap::label_
std::string label_
Definition: SiPixelTemplateHelper.h:500
Exception
Definition: hltDiff.cc:245
cond::payloadInspector::SINGLE_IOV
Definition: PayloadInspector.h:295