Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:09

0001 #include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h"
0002 std::string phase2tkutil::getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) {
0003   std::string Disc;
0004   std::ostringstream fname1;
0005   int layer = tTopo->getITPixelLayerNumber(det_id);
0006 
0007   if (layer < 0)
0008     return "";
0009   if (layer < 100) {
0010     fname1 << "Barrel/";
0011     fname1 << "Layer" << layer;
0012     fname1 << "";
0013   } else {
0014     int side = tTopo->pxfSide(det_id);
0015     fname1 << "EndCap_Side" << side << "/";
0016     int disc = tTopo->pxfDisk(det_id);
0017     Disc = (disc < 9) ? "FPix" : "EPix";
0018     fname1 << Disc << "/";
0019     int ring = tTopo->pxfBlade(det_id);
0020     fname1 << "Ring" << ring;
0021   }
0022   return fname1.str();
0023 }
0024 
0025 std::string phase2tkutil::getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) {
0026   std::string Disc;
0027   std::ostringstream fname1;
0028   int layer = tTopo->getOTLayerNumber(det_id);
0029 
0030   if (layer < 0)
0031     return "";
0032   if (layer < 100) {
0033     fname1 << "Barrel/";
0034     fname1 << "Layer" << layer;
0035     fname1 << "";
0036   } else {
0037     int side = tTopo->tidSide(det_id);
0038     fname1 << "EndCap_Side" << side << "/";
0039     int disc = tTopo->tidWheel(det_id);
0040     Disc = (disc < 3) ? "TEDD_1" : "TEDD_2";
0041     fname1 << Disc << "/";
0042     int ring = tTopo->tidRing(det_id);
0043     fname1 << "Ring" << ring;
0044   }
0045   return fname1.str();
0046 }
0047 
0048 typedef dqm::reco::MonitorElement MonitorElement;
0049 typedef dqm::reco::DQMStore DQMStore;
0050 MonitorElement* phase2tkutil::book1DFromPSet(const edm::ParameterSet& hpars, DQMStore::IBooker& ibooker) {
0051   MonitorElement* temp = nullptr;
0052   if (hpars.getParameter<bool>("switch")) {
0053     temp = ibooker.book1D(hpars.getParameter<std::string>("name"),
0054                           hpars.getParameter<std::string>("title"),
0055                           hpars.getParameter<int32_t>("NxBins"),
0056                           hpars.getParameter<double>("xmin"),
0057                           hpars.getParameter<double>("xmax"));
0058   }
0059   return temp;
0060 }
0061 
0062 MonitorElement* phase2tkutil::book2DFromPSet(const edm::ParameterSet& hpars, DQMStore::IBooker& ibooker) {
0063   MonitorElement* temp = nullptr;
0064   if (hpars.getParameter<bool>("switch")) {
0065     temp = ibooker.book2D(hpars.getParameter<std::string>("name"),
0066                           hpars.getParameter<std::string>("title"),
0067                           hpars.getParameter<int32_t>("NxBins"),
0068                           hpars.getParameter<double>("xmin"),
0069                           hpars.getParameter<double>("xmax"),
0070                           hpars.getParameter<int32_t>("NyBins"),
0071                           hpars.getParameter<double>("ymin"),
0072                           hpars.getParameter<double>("ymax"));
0073   }
0074   return temp;
0075 }
0076 
0077 MonitorElement* phase2tkutil::bookProfile1DFromPSet(const edm::ParameterSet& hpars, DQMStore::IBooker& ibooker) {
0078   MonitorElement* temp = nullptr;
0079   if (hpars.getParameter<bool>("switch")) {
0080     temp = ibooker.bookProfile(hpars.getParameter<std::string>("name"),
0081                                hpars.getParameter<std::string>("title"),
0082                                hpars.getParameter<int32_t>("NxBins"),
0083                                hpars.getParameter<double>("xmin"),
0084                                hpars.getParameter<double>("xmax"),
0085                                hpars.getParameter<double>("ymin"),
0086                                hpars.getParameter<double>("ymax"));
0087   }
0088   return temp;
0089 }