CMS 3D CMS Logo

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

#include <SiPixelGainCalibHelper.h>

Inheritance diagram for gainCalibHelper::SiPixelGainCalibrationBPIXMap< 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
 
 SiPixelGainCalibrationBPIXMap ()
 
- 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::SiPixelGainCalibrationBPIXMap< myType, PayloadType >

Definition at line 1347 of file SiPixelGainCalibHelper.h.

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationBPIXMap()

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

Definition at line 1351 of file SiPixelGainCalibHelper.h.

1357  public:
1359  : cond::payloadInspector::PlotImage<PayloadType, cond::payloadInspector::SINGLE_IOV>(
1360  Form("SiPixelGainCalibration %s Barrel Pixel Map", TypeName[myType])),
1362  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {
1363  if constexpr (std::is_same_v<PayloadType, SiPixelGainCalibrationOffline>) {

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

Member Function Documentation

◆ fill()

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

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

Definition at line 1365 of file SiPixelGainCalibHelper.h.

1366  {
1367  isForHLT_ = true;
1368  label_ = "SiPixelGainCalibrationForHLT_PayloadInspector";
1369  }
1370  };
1371 
1372  bool fill() override {
1373  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
1374  auto iov = tag.iovs.front();
1375 
1376  std::shared_ptr<PayloadType> payload = this->fetchPayload(std::get<1>(iov));
1377 
1378  Phase1PixelROCMaps theBPixGainsMap("");
1379  static constexpr int n_layers = 4;
1380 
1381  std::map<uint32_t, float> GainCalibMap_;
1382  gainCalibPI::fillThePerModuleMap(payload, GainCalibMap_, myType);
1383  if (GainCalibMap_.size() != SiPixelPI::phase1size) {
1384  edm::LogError(label_) << "SiPixelGainCalibration maps are not supported for non-Phase1 Pixel geometries !";
1385  TCanvas canvas("Canv", "Canv", 1200, 1000);
1386  SiPixelPI::displayNotSupported(canvas, GainCalibMap_.size());
1388  canvas.SaveAs(fileName.c_str());
1389  return false;
1390  }
1391 
1392  // hard-coded phase-I
1393  std::array<double, n_layers> minima = {{999., 999., 999., 999.}};
1394 
1395  for (const auto& element : GainCalibMap_) {
1396  int subid = DetId(element.first).subdetId();
1397  if (subid == PixelSubdetector::PixelBarrel) {
1398  auto layer = m_trackerTopo.pxbLayer(DetId(element.first));
1399 
1400  if (element.second < minima.at(layer - 1))
1401  minima.at(layer - 1) = element.second;
1402 
1403  theBPixGainsMap.fillWholeModule(element.first, element.second);
1404  }
1405  }
1406 
1407  gStyle->SetOptStat(0);
1408  //=========================
1409  TCanvas canvas("Summary", "Summary", 1200, 1200);
1410  theBPixGainsMap.drawBarrelMaps(canvas);
1411 
1412  for (unsigned int lay = 1; lay <= n_layers; lay++) {
1413  SiPixelPI::adjustCanvasMargins(canvas.cd(lay), -1, 0.08, 0.1, 0.13);
1414 
1415  auto h_bpix_Gains = theBPixGainsMap.getLayerMaps();
1416 
1417  COUT << " layer:" << lay << " max:" << h_bpix_Gains[lay - 1]->GetMaximum() << " min: " << minima.at(lay - 1)
1418  << std::endl;
1419 
1420  h_bpix_Gains[lay - 1]->GetZaxis()->SetRangeUser(minima.at(lay - 1) - 0.001,
1421  h_bpix_Gains[lay - 1]->GetMaximum() + 0.001);
1422  }
1423 
1424  auto unpacked = SiPixelPI::unpack(std::get<0>(iov));
1425 
1426  for (unsigned int lay = 1; lay <= n_layers; lay++) {
1427  canvas.cd(lay);
1428  auto ltx = TLatex();
1429  ltx.SetTextFont(62);
1430  ltx.SetTextColor(kBlue);
1431  ltx.SetTextSize(0.055);
1432  ltx.SetTextAlign(11);
1433  ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1434  1 - gPad->GetTopMargin() + 0.01,
1435  unpacked.first == 0
1436  ? ("IOV:" + std::to_string(unpacked.second)).c_str()
1437  : (std::to_string(unpacked.first) + "," + std::to_string(unpacked.second)).c_str());

Member Data Documentation

◆ isForHLT_

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

◆ label_

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

◆ m_trackerTopo

template<gainCalibPI::type myType, class PayloadType >
TrackerTopology gainCalibHelper::SiPixelGainCalibrationBPIXMap< myType, PayloadType >::m_trackerTopo
private
gainCalibHelper::SiPixelGainCalibrationBPIXMap::isForHLT_
bool isForHLT_
Definition: SiPixelGainCalibHelper.h:1443
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
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
gainCalibHelper::SiPixelGainCalibrationBPIXMap::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: SiPixelGainCalibHelper.h:1440
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
gainCalibHelper::SiPixelGainCalibrationBPIXMap::fill
bool fill() override
Definition: SiPixelGainCalibHelper.h:1365
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
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
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
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
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
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
gainCalibHelper::SiPixelGainCalibrationBPIXMap::SiPixelGainCalibrationBPIXMap
SiPixelGainCalibrationBPIXMap()
Definition: SiPixelGainCalibHelper.h:1351
SiPixelPI::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: SiPixelPayloadInspectorHelper.h:508
gainCalibHelper::SiPixelGainCalibrationBPIXMap::label_
std::string label_
Definition: SiPixelGainCalibHelper.h:1444