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 1477 of file SiPixelGainCalibHelper.h.

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationFPIXMap()

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

Definition at line 1481 of file SiPixelGainCalibHelper.h.

1488  public:
1490  : cond::payloadInspector::PlotImage<PayloadType, cond::payloadInspector::SINGLE_IOV>(
1491  Form("SiPixelGainCalibration %s Forward Pixel Map", TypeName[myType])),
1493  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 1495 of file SiPixelGainCalibHelper.h.

1497  {
1498  isForHLT_ = true;
1499  label_ = "SiPixelGainCalibrationForHLT_PayloadInspector";
1500  }
1501  }
1502 
1503  bool fill() override {
1504  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
1505  auto iov = tag.iovs.front();
1506  std::shared_ptr<PayloadType> payload = this->fetchPayload(std::get<1>(iov));
1507 
1508  static const int n_rings = 2;
1509  std::array<TH2D*, n_rings> h_fpix_Gains;
1510  int divide_roc = 1;
1511 
1512  // --------------------- BOOK HISTOGRAMS
1513  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1514  int n = ring == 1 ? 92 : 140;
1515  float y = ring == 1 ? 11.5 : 17.5;
1516  std::string name = "occ_Gains_ring_" + std::to_string(ring);
1517  std::string title = "; Disk # ; Blade/Panel #";
1518 
1519  h_fpix_Gains[ring - 1] =
1520  new TH2D(name.c_str(), title.c_str(), 56 * divide_roc, -3.5, 3.5, n * divide_roc, -y, y);
1521  }
1522 
1523  std::map<uint32_t, float> GainCalibMap_;
1524  gainCalibPI::fillThePerModuleMap(payload, GainCalibMap_, myType);
1525  if (GainCalibMap_.size() != SiPixelPI::phase1size) {
1526  edm::LogError(label_) << "SiPixelGainCalibration maps are not supported for non-Phase1 Pixel geometries !";
1527  TCanvas canvas("Canv", "Canv", 1200, 1000);
1528  SiPixelPI::displayNotSupported(canvas, GainCalibMap_.size());
1530  canvas.SaveAs(fileName.c_str());
1531  return false;
1532  }
1533 
1534  // hardcoded phase-I
1535  std::array<double, 2> minima = {{999., 999.}};
1536 
1537  for (const auto& element : GainCalibMap_) {
1538  int subid = DetId(element.first).subdetId();
1539  if (subid == PixelSubdetector::PixelEndcap) {
1540  auto ring = SiPixelPI::ring(DetId(element.first), m_trackerTopo, true);
1541  auto s_blade = SiPixelPI::signed_blade(DetId(element.first), m_trackerTopo, true);
1542  auto s_disk = SiPixelPI::signed_disk(DetId(element.first), m_trackerTopo, true);
1543  auto s_blade_panel = SiPixelPI::signed_blade_panel(DetId(element.first), m_trackerTopo, true);
1544  auto panel = m_trackerTopo.pxfPanel(element.first);
1545 
1546  COUT << "ring:" << ring << " blade: " << s_blade << " panel: " << panel
1547  << " signed blade/panel: " << s_blade_panel << " disk: " << s_disk << std::endl;
1548 
1549  if (element.second < minima.at(ring - 1))
1550  minima.at(ring - 1) = element.second;
1551 
1552  auto rocsToMask = SiPixelPI::maskedForwardRocsToBins(ring, s_blade, panel, s_disk);
1553  for (const auto& bin : rocsToMask) {
1554  h_fpix_Gains[ring - 1]->SetBinContent(bin.first, bin.second, element.second);
1555  }
1556  }
1557  }
1558 
1559  gStyle->SetOptStat(0);
1560  //=========================
1561  TCanvas canvas("Summary", "Summary", 1200, 600);
1562  canvas.Divide(2, 1);
1563 
1564  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1565  SiPixelPI::adjustCanvasMargins(canvas.cd(ring), -1, 0.08, 0.1, 0.13);
1566 
1567  COUT << " ringer:" << ring << " max:" << h_fpix_Gains[ring - 1]->GetMaximum() << " min: " << minima.at(ring - 1)
1568  << std::endl;
1569 
1570  SiPixelPI::dress_occup_plot(canvas, h_fpix_Gains[ring - 1], 0, ring, 1, true, true, false);
1571  h_fpix_Gains[ring - 1]->GetZaxis()->SetRangeUser(minima.at(ring - 1) - 0.001,
1572  h_fpix_Gains[ring - 1]->GetMaximum() + 0.001);
1573  }
1574 
1575  auto unpacked = SiPixelPI::unpack(std::get<0>(iov));
1576 
1577  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1578  canvas.cd(ring);
1579  auto ltx = TLatex();
1580  ltx.SetTextFont(62);
1581  ltx.SetTextColor(kBlue);
1582  ltx.SetTextSize(0.05);
1583  ltx.SetTextAlign(11);
1584  ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1585  1 - gPad->GetTopMargin() + 0.01,
1586  unpacked.first == 0

Member Data Documentation

◆ isForHLT_

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

Definition at line 1592 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
svgfig.canvas
def canvas(*sub, **attr)
Definition: svgfig.py:482
DDAxes::y
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::m_imageFileName
std::string m_imageFileName
Definition: PayloadInspector.h:868
gainCalibHelper::SiPixelGainCalibrationFPIXMap::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: SiPixelGainCalibHelper.h:1589
gainCalibHelper::SiPixelGainCalibrationFPIXMap::SiPixelGainCalibrationFPIXMap
SiPixelGainCalibrationFPIXMap()
Definition: SiPixelGainCalibHelper.h:1481
SiPixelPI::signed_disk
int signed_disk(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:198
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
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:1592
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::PlotImage
PlotImage(const std::string &title)
Definition: PayloadInspector.h:855
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
SiPixelPI::displayNotSupported
void displayNotSupported(TCanvas &canv, const unsigned int size)
Definition: SiPixelPayloadInspectorHelper.h:990
gainCalibHelper::SiPixelGainCalibrationFPIXMap::fill
bool fill() override
Definition: SiPixelGainCalibHelper.h:1495
gainCalibHelper::SiPixelGainCalibrationFPIXMap::label_
std::string label_
Definition: SiPixelGainCalibHelper.h:1593
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
SiPixelPI::signed_blade
int signed_blade(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:178
gainCalibHelper::TypeName
constexpr char const * TypeName[2]
Definition: SiPixelGainCalibHelper.h:286
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::payloadInspector::PlotBase::title
std::string title() const
Definition: PayloadInspector.cc:42
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:185
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:863
SiPixelPI::signed_blade_panel
int signed_blade_panel(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:188
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
COUT
#define COUT
Definition: PVValidationHelpers.h:13
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiPixelPI::dress_occup_plot
void dress_occup_plot(TCanvas &canv, TH2 *h, int lay, int ring=0, int phase=0, bool half_shift=true, bool mark_zero=true, bool standard_palette=true)
Definition: SiPixelPayloadInspectorHelper.h:218
cond::payloadInspector::SINGLE_IOV
Definition: PayloadInspector.h:289
StandaloneTrackerTopology::fromTrackerParametersXMLFile
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
Definition: StandaloneTrackerTopology.cc:168
SiPixelPI::maskedForwardRocsToBins
std::vector< std::pair< int, int > > maskedForwardRocsToBins(int ring, int blade, int panel, int disk)
Definition: SiPixelPayloadInspectorHelper.h:885
SiPixelPI::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: SiPixelPayloadInspectorHelper.h:505