CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Attributes
gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType > Class Template Reference

#include <SiPixelGainCalibHelper.h>

Inheritance diagram for gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >:
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV > cond::payloadInspector::PlotImpl< IOV_M, 0 > cond::payloadInspector::PlotBase

Public Member Functions

bool fill () override
 
 SiPixelGainCalibrationFPIXMap ()
 
- 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 isForHLT_
 
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
 

Private Attributes

TrackerTopology m_trackerTopo
 

Additional Inherited Members

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

Detailed Description

template<gainCalibPI::type myType, class PayloadType>
class gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >

Definition at line 1450 of file SiPixelGainCalibHelper.h.

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationFPIXMap()

template<gainCalibPI::type myType, class PayloadType >
gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::SiPixelGainCalibrationFPIXMap ( )
inline

Definition at line 1454 of file SiPixelGainCalibHelper.h.

1461  public:
1463  : cond::payloadInspector::PlotImage<PayloadType, cond::payloadInspector::SINGLE_IOV>(
1464  Form("SiPixelGainCalibration %s Forward Pixel Map", TypeName[myType])),
1466  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {

References StandaloneTrackerTopology::fromTrackerParametersXMLFile(), contentValuesFiles::fullPath, gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::m_trackerTopo, and gainCalibHelper::TypeName.

Member Function Documentation

◆ fill()

template<gainCalibPI::type myType, class PayloadType >
bool gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::fill ( )
inlineoverridevirtual

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

Definition at line 1468 of file SiPixelGainCalibHelper.h.

1470  {
1471  isForHLT_ = true;
1472  label_ = "SiPixelGainCalibrationForHLT_PayloadInspector";
1473  }
1474  }
1475 
1476  bool fill() override {
1477  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
1478  auto iov = tag.iovs.front();
1479  std::shared_ptr<PayloadType> payload = this->fetchPayload(std::get<1>(iov));
1480 
1481  Phase1PixelROCMaps theFPixGainsMap("");
1482  static constexpr int n_rings = 2;
1483 
1484  std::map<uint32_t, float> GainCalibMap_;
1485  gainCalibPI::fillThePerModuleMap(payload, GainCalibMap_, myType);
1486  if (GainCalibMap_.size() != SiPixelPI::phase1size) {
1487  edm::LogError(label_) << "SiPixelGainCalibration maps are not supported for non-Phase1 Pixel geometries !";
1488  TCanvas canvas("Canv", "Canv", 1200, 1000);
1489  SiPixelPI::displayNotSupported(canvas, GainCalibMap_.size());
1491  canvas.SaveAs(fileName.c_str());
1492  return false;
1493  }
1494 
1495  // hardcoded phase-I
1496  std::array<double, n_rings> minima = {{999., 999.}};
1497 
1498  for (const auto& element : GainCalibMap_) {
1499  int subid = DetId(element.first).subdetId();
1500  if (subid == PixelSubdetector::PixelEndcap) {
1501  auto ring = SiPixelPI::ring(DetId(element.first), m_trackerTopo, true);
1502 
1503  if (element.second < minima.at(ring - 1))
1504  minima.at(ring - 1) = element.second;
1505 
1506  theFPixGainsMap.fillWholeModule(element.first, element.second);
1507  }
1508  }
1509 
1510  gStyle->SetOptStat(0);
1511  //=========================
1512  TCanvas canvas("Summary", "Summary", 1200, 600);
1513  theFPixGainsMap.drawForwardMaps(canvas);
1514 
1515  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1516  SiPixelPI::adjustCanvasMargins(canvas.cd(ring), -1, 0.08, 0.1, 0.13);
1517 
1518  auto h_fpix_Gains = theFPixGainsMap.getRingMaps();
1519 
1520  COUT << " ring:" << ring << " max:" << h_fpix_Gains[ring - 1]->GetMaximum() << " min: " << minima.at(ring - 1)
1521  << std::endl;
1522 
1523  h_fpix_Gains[ring - 1]->GetZaxis()->SetRangeUser(minima.at(ring - 1) - 0.001,
1524  h_fpix_Gains[ring - 1]->GetMaximum() + 0.001);
1525  }
1526 
1527  auto unpacked = SiPixelPI::unpack(std::get<0>(iov));
1528 
1529  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1530  canvas.cd(ring);
1531  auto ltx = TLatex();
1532  ltx.SetTextFont(62);
1533  ltx.SetTextColor(kBlue);
1534  ltx.SetTextSize(0.05);
1535  ltx.SetTextAlign(11);
1536  ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1537  1 - gPad->GetTopMargin() + 0.01,
1538  unpacked.first == 0

Member Data Documentation

◆ isForHLT_

template<gainCalibPI::type myType, class PayloadType >
bool gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::isForHLT_
protected

Definition at line 1544 of file SiPixelGainCalibHelper.h.

◆ label_

template<gainCalibPI::type myType, class PayloadType >
std::string gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::label_
protected

◆ m_trackerTopo

template<gainCalibPI::type myType, class PayloadType >
TrackerTopology gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::m_trackerTopo
private
SiPixelPI::unpack
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
Definition: SiPixelPayloadInspectorHelper.h:114
Phase1PixelROCMaps
Definition: Phase1PixelROCMaps.h:80
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
gainCalibHelper::SiPixelGainCalibrationFPIXMap::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: SiPixelGainCalibHelper.h:1541
gainCalibHelper::SiPixelGainCalibrationFPIXMap::SiPixelGainCalibrationFPIXMap
SiPixelGainCalibrationFPIXMap()
Definition: SiPixelGainCalibHelper.h:1454
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
SiPixelPI::ring
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:163
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
gainCalibHelper::SiPixelGainCalibrationFPIXMap::isForHLT_
bool isForHLT_
Definition: SiPixelGainCalibHelper.h:1544
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
gainCalibHelper::SiPixelGainCalibrationFPIXMap::fill
bool fill() override
Definition: SiPixelGainCalibHelper.h:1468
gainCalibHelper::SiPixelGainCalibrationFPIXMap::label_
std::string label_
Definition: SiPixelGainCalibHelper.h:1545
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
gainCalibHelper::TypeName
constexpr char const * TypeName[2]
Definition: SiPixelGainCalibHelper.h:287
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
jets_cff.payload
payload
Definition: jets_cff.py:32
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond
Definition: plugin.cc:23
gainCalibHelper::gainCalibPI::fillThePerModuleMap
static void fillThePerModuleMap(const std::shared_ptr< PayloadType > &payload, AvgMap &map, gainCalibPI::type theType)
Definition: SiPixelGainCalibHelper.h:186
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
COUT
#define COUT
Definition: PVValidationHelpers.h:13
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >
cond::payloadInspector::SINGLE_IOV
Definition: PayloadInspector.h:295
StandaloneTrackerTopology::fromTrackerParametersXMLFile
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
Definition: StandaloneTrackerTopology.cc:168
SiPixelPI::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: SiPixelPayloadInspectorHelper.h:508