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

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationBPIXMap()

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

Definition at line 1350 of file SiPixelGainCalibHelper.h.

1356  public:
1358  : cond::payloadInspector::PlotImage<PayloadType, cond::payloadInspector::SINGLE_IOV>(
1359  Form("SiPixelGainCalibration %s Barrel Pixel Map", TypeName[myType])),
1361  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {
1362  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 1364 of file SiPixelGainCalibHelper.h.

1365  {
1366  isForHLT_ = true;
1367  label_ = "SiPixelGainCalibrationForHLT_PayloadInspector";
1368  }
1369  };
1370 
1371  bool fill() override {
1372  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
1373  auto iov = tag.iovs.front();
1374 
1375  std::shared_ptr<PayloadType> payload = this->fetchPayload(std::get<1>(iov));
1376 
1377  static const int n_layers = 4;
1378  int nlad_list[n_layers] = {6, 14, 22, 32};
1379  int divide_roc = 1;
1380 
1381  // --------------------- BOOK HISTOGRAMS
1382  std::array<TH2D*, n_layers> h_bpix_Gains;
1383 
1384  for (unsigned int lay = 1; lay <= 4; lay++) {
1385  int nlad = nlad_list[lay - 1];
1386 
1387  std::string name = "occ_Gain_Layer_" + std::to_string(lay);
1388  std::string title = "; Module # ; Ladder #";
1389  h_bpix_Gains[lay - 1] = new TH2D(name.c_str(),
1390  title.c_str(),
1391  72 * divide_roc,
1392  -4.5,
1393  4.5,
1394  (nlad * 4 + 2) * divide_roc,
1395  -nlad - 0.5,
1396  nlad + 0.5);
1397  }
1398 
1399  std::map<uint32_t, float> GainCalibMap_;
1400  gainCalibPI::fillThePerModuleMap(payload, GainCalibMap_, myType);
1401  if (GainCalibMap_.size() != SiPixelPI::phase1size) {
1402  edm::LogError(label_) << "SiPixelGainCalibration maps are not supported for non-Phase1 Pixel geometries !";
1403  TCanvas canvas("Canv", "Canv", 1200, 1000);
1404  SiPixelPI::displayNotSupported(canvas, GainCalibMap_.size());
1406  canvas.SaveAs(fileName.c_str());
1407  return false;
1408  }
1409 
1410  // hard-coded phase-I
1411  std::array<double, 4> minima = {{999., 999., 999., 999.}};
1412 
1413  for (const auto& element : GainCalibMap_) {
1414  int subid = DetId(element.first).subdetId();
1415  if (subid == PixelSubdetector::PixelBarrel) {
1416  auto layer = m_trackerTopo.pxbLayer(DetId(element.first));
1417  auto s_ladder = SiPixelPI::signed_ladder(DetId(element.first), m_trackerTopo, true);
1418  auto s_module = SiPixelPI::signed_module(DetId(element.first), m_trackerTopo, true);
1419 
1420  auto ladder = m_trackerTopo.pxbLadder(DetId(element.first));
1421  auto module = m_trackerTopo.pxbModule(DetId(element.first));
1422  COUT << "layer:" << layer << " ladder:" << ladder << " module:" << module << " signed ladder: " << s_ladder
1423  << " signed module: " << s_module << std::endl;
1424 
1425  if (element.second < minima.at(layer - 1))
1426  minima.at(layer - 1) = element.second;
1427 
1428  auto rocsToMask = SiPixelPI::maskedBarrelRocsToBins(layer, s_ladder, s_module);
1429  for (const auto& bin : rocsToMask) {
1430  h_bpix_Gains[layer - 1]->SetBinContent(bin.first, bin.second, element.second);
1431  }
1432  }
1433  }
1434 
1435  gStyle->SetOptStat(0);
1436  //=========================
1437  TCanvas canvas("Summary", "Summary", 1200, 1200);
1438  canvas.Divide(2, 2);
1439 
1440  for (unsigned int lay = 1; lay <= 4; lay++) {
1441  SiPixelPI::adjustCanvasMargins(canvas.cd(lay), -1, 0.08, 0.1, 0.13);
1442 
1443  COUT << " layer:" << lay << " max:" << h_bpix_Gains[lay - 1]->GetMaximum() << " min: " << minima.at(lay - 1)
1444  << std::endl;
1445 
1446  SiPixelPI::dress_occup_plot(canvas, h_bpix_Gains[lay - 1], lay, 0, 1, true, true, false);
1447  h_bpix_Gains[lay - 1]->GetZaxis()->SetRangeUser(minima.at(lay - 1) - 0.001,
1448  h_bpix_Gains[lay - 1]->GetMaximum() + 0.001);
1449  }
1450 
1451  auto unpacked = SiPixelPI::unpack(std::get<0>(iov));
1452 
1453  for (unsigned int lay = 1; lay <= 4; lay++) {
1454  canvas.cd(lay);
1455  auto ltx = TLatex();
1456  ltx.SetTextFont(62);
1457  ltx.SetTextColor(kBlue);
1458  ltx.SetTextSize(0.055);
1459  ltx.SetTextAlign(11);
1460  ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1461  1 - gPad->GetTopMargin() + 0.01,
1462  unpacked.first == 0
1463  ? ("IOV:" + std::to_string(unpacked.second)).c_str()
1464  : (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:1470
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
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::m_imageFileName
std::string m_imageFileName
Definition: PayloadInspector.h:868
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
gainCalibHelper::SiPixelGainCalibrationBPIXMap::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: SiPixelGainCalibHelper.h:1467
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
gainCalibHelper::SiPixelGainCalibrationBPIXMap::fill
bool fill() override
Definition: SiPixelGainCalibHelper.h:1364
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
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: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::maskedBarrelRocsToBins
std::vector< std::pair< int, int > > maskedBarrelRocsToBins(int layer, int ladder, int module)
Definition: SiPixelPayloadInspectorHelper.h:779
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
SiPixelPI::signed_module
int signed_module(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:147
COUT
#define COUT
Definition: PVValidationHelpers.h:13
TrackerTopology::pxbModule
unsigned int pxbModule(const DetId &id) const
Definition: TrackerTopology.h:160
PVValHelper::ladder
Definition: PVValidationHelpers.h:72
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
SiPixelPI::signed_ladder
int signed_ladder(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:135
StandaloneTrackerTopology::fromTrackerParametersXMLFile
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
Definition: StandaloneTrackerTopology.cc:168
gainCalibHelper::SiPixelGainCalibrationBPIXMap::SiPixelGainCalibrationBPIXMap
SiPixelGainCalibrationBPIXMap()
Definition: SiPixelGainCalibHelper.h:1350
SiPixelPI::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: SiPixelPayloadInspectorHelper.h:505
gainCalibHelper::SiPixelGainCalibrationBPIXMap::label_
std::string label_
Definition: SiPixelGainCalibHelper.h:1471