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

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationFPIXMap()

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

Definition at line 1233 of file SiPixelGainCalibHelper.h.

1239  public:
1241  : cond::payloadInspector::PlotImage<PayloadType, cond::payloadInspector::SINGLE_IOV>(
1242  Form("SiPixelGainCalibration %s Forward Pixel Map", TypeName[myType])),
1244  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {
1245  if constexpr (std::is_same_v<PayloadType, SiPixelGainCalibrationOffline>) {

References StandaloneTrackerTopology::fromTrackerParametersXMLFile(), contentValuesFiles::fullPath, gainCalibHelper::SiPixelGainCalibrationFPIXMap< myType, PayloadType >::isForHLT_, 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 1247 of file SiPixelGainCalibHelper.h.

1248  {
1249  isForHLT_ = true;
1250  label_ = "SiPixelGainCalibrationForHLT_PayloadInspector";
1251  }
1252  }
1253 
1254  bool fill() override {
1255  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
1256  auto iov = tag.iovs.front();
1257  std::shared_ptr<PayloadType> payload = this->fetchPayload(std::get<1>(iov));
1258 
1259  static const int n_rings = 2;
1260  std::array<TH2D*, n_rings> h_fpix_Gains;
1261  int divide_roc = 1;
1262 
1263  // --------------------- BOOK HISTOGRAMS
1264  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1265  int n = ring == 1 ? 92 : 140;
1266  float y = ring == 1 ? 11.5 : 17.5;
1267  std::string name = "occ_Gains_ring_" + std::to_string(ring);
1268  std::string title = "; Disk # ; Blade/Panel #";
1269 
1270  h_fpix_Gains[ring - 1] =
1271  new TH2D(name.c_str(), title.c_str(), 56 * divide_roc, -3.5, 3.5, n * divide_roc, -y, y);
1272  }
1273 
1274  std::map<uint32_t, float> GainCalibMap_;
1275  gainCalibPI::fillThePerModuleMap(payload, GainCalibMap_, myType);
1276  if (GainCalibMap_.size() != SiPixelPI::phase1size) {
1277  edm::LogError(label_) << "SiPixelGainCalibration maps are not supported for non-Phase1 Pixel geometries !";
1278  TCanvas canvas("Canv", "Canv", 1200, 1000);
1279  SiPixelPI::displayNotSupported(canvas, GainCalibMap_.size());
1281  canvas.SaveAs(fileName.c_str());
1282  return false;
1283  }
1284 
1285  // hardcoded phase-I
1286  std::array<double, 2> minima = {{999., 999.}};
1287 
1288  for (const auto& element : GainCalibMap_) {
1289  int subid = DetId(element.first).subdetId();
1290  if (subid == PixelSubdetector::PixelEndcap) {
1291  auto ring = SiPixelPI::ring(DetId(element.first), m_trackerTopo, true);
1292  auto s_blade = SiPixelPI::signed_blade(DetId(element.first), m_trackerTopo, true);
1293  auto s_disk = SiPixelPI::signed_disk(DetId(element.first), m_trackerTopo, true);
1294  auto s_blade_panel = SiPixelPI::signed_blade_panel(DetId(element.first), m_trackerTopo, true);
1295  auto panel = m_trackerTopo.pxfPanel(element.first);
1296 
1297  COUT << "ring:" << ring << " blade: " << s_blade << " panel: " << panel
1298  << " signed blade/panel: " << s_blade_panel << " disk: " << s_disk << std::endl;
1299 
1300  if (element.second < minima.at(ring - 1))
1301  minima.at(ring - 1) = element.second;
1302 
1303  auto rocsToMask = SiPixelPI::maskedForwardRocsToBins(ring, s_blade, panel, s_disk);
1304  for (const auto& bin : rocsToMask) {
1305  h_fpix_Gains[ring - 1]->SetBinContent(bin.first, bin.second, element.second);
1306  }
1307  }
1308  }
1309 
1310  gStyle->SetOptStat(0);
1311  //=========================
1312  TCanvas canvas("Summary", "Summary", 1200, 600);
1313  canvas.Divide(2, 1);
1314 
1315  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1316  SiPixelPI::adjustCanvasMargins(canvas.cd(ring), -1, 0.08, 0.1, 0.13);
1317 
1318  COUT << " ringer:" << ring << " max:" << h_fpix_Gains[ring - 1]->GetMaximum() << " min: " << minima.at(ring - 1)
1319  << std::endl;
1320 
1321  SiPixelPI::dress_occup_plot(canvas, h_fpix_Gains[ring - 1], 0, ring, 1, true, true, false);
1322  h_fpix_Gains[ring - 1]->GetZaxis()->SetRangeUser(minima.at(ring - 1) - 0.001,
1323  h_fpix_Gains[ring - 1]->GetMaximum() + 0.001);
1324  }
1325 
1326  auto unpacked = SiPixelPI::unpack(std::get<0>(iov));
1327 
1328  for (unsigned int ring = 1; ring <= n_rings; ring++) {
1329  canvas.cd(ring);
1330  auto ltx = TLatex();
1331  ltx.SetTextFont(62);
1332  ltx.SetTextColor(kBlue);
1333  ltx.SetTextSize(0.05);
1334  ltx.SetTextAlign(11);
1335  ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1336  1 - gPad->GetTopMargin() + 0.01,
1337  unpacked.first == 0
1338  ? ("IOV:" + std::to_string(unpacked.second)).c_str()

Member Data Documentation

◆ isForHLT_

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

◆ 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:44
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:845
gainCalibHelper::SiPixelGainCalibrationFPIXMap::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: SiPixelGainCalibHelper.h:1341
gainCalibHelper::SiPixelGainCalibrationFPIXMap::SiPixelGainCalibrationFPIXMap
SiPixelGainCalibrationFPIXMap()
Definition: SiPixelGainCalibHelper.h:1233
SiPixelPI::signed_disk
int signed_disk(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:128
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:93
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
gainCalibHelper::SiPixelGainCalibrationFPIXMap::isForHLT_
bool isForHLT_
Definition: SiPixelGainCalibHelper.h:1344
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::PlotImage
PlotImage(const std::string &title)
Definition: PayloadInspector.h:832
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
SiPixelPI::displayNotSupported
void displayNotSupported(TCanvas &canv, const unsigned int size)
Definition: SiPixelPayloadInspectorHelper.h:971
gainCalibHelper::SiPixelGainCalibrationFPIXMap::fill
bool fill() override
Definition: SiPixelGainCalibHelper.h:1247
gainCalibHelper::SiPixelGainCalibrationFPIXMap::label_
std::string label_
Definition: SiPixelGainCalibHelper.h:1345
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:108
gainCalibHelper::TypeName
constexpr char const * TypeName[2]
Definition: SiPixelGainCalibHelper.h:200
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
jets_cff.payload
payload
Definition: jets_cff.py:34
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:99
edm::LogError
Definition: MessageLogger.h:183
SiPixelPI::phase1size
static const unsigned int phase1size
Definition: SiPixelPayloadInspectorHelper.h:41
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::fetchPayload
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
Definition: PayloadInspector.h:840
SiPixelPI::signed_blade_panel
int signed_blade_panel(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:118
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:148
cond::payloadInspector::SINGLE_IOV
Definition: PayloadInspector.h:265
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:803
SiPixelPI::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: SiPixelPayloadInspectorHelper.h:435