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

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

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

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