CMS 3D CMS Logo

SiStripTkMaps.h
Go to the documentation of this file.
1 #ifndef DQM_TRACKERREMAPPER_SISTRIPTKMAPS_H
2 #define DQM_TRACKERREMAPPER_SISTRIPTKMAPS_H
3 
4 // CMSSW includes
12 
13 // ROOT includes
14 #include "TArrow.h"
15 #include "TPaletteAxis.h"
16 #include "TGaxis.h"
17 #include "TCanvas.h"
18 #include "TColor.h"
19 #include "TGraph.h"
20 #include "TLatex.h"
21 #include "TH2Poly.h"
22 #include "TStyle.h"
23 
24 // STL includes
25 #include <fstream>
26 #include <iostream>
27 #include <map>
28 #include <string>
29 #include <vector>
30 
31 // boost includes
32 #include <boost/tokenizer.hpp>
33 #include <boost/range/adaptor/indexed.hpp>
34 
35 #define MYOUT LogDebug("SiStripTkMaps")
36 
37 /*--------------------------------------------------------------------
38 / Ancillary class to build SiStrip Tracker maps
39 /--------------------------------------------------------------------*/
41 public:
42  SiStripTkMaps(const char* option)
43  : m_option{option},
45  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {}
46 
47  ~SiStripTkMaps() = default;
48 
49  void bookMap(const std::string mapTitle, const std::string zAxisTitle);
50  void fill(long rawid, double val);
51  void drawMap(TCanvas& canvas, std::string option = "");
52 
53  //============================================================================
54  inline const TH2Poly* getTheMap() { return m_trackerMap; }
55 
56  //============================================================================
57  inline const std::string& getTheMapTitle() { return m_mapTitle; }
58 
59  //============================================================================
60  inline const std::string& getTheZAxisTitle() { return m_zAxisTitle; }
61 
62  //============================================================================
63  inline const std::vector<unsigned int>& getTheFilledIds() { return m_detIdVector; }
64 
65  //============================================================================
66  inline const std::vector<double>& getTheFilledValues() { return m_values; }
67 
68  //============================================================================
69  inline void setZAxisRange(double xmin, double xmax) { m_trackerMap->GetZaxis()->SetRangeUser(xmin, xmax); }
70 
71 private:
72  // private members
73  Option_t* m_option;
76  double m_axmin, m_axmax;
77  std::map<long, std::shared_ptr<TGraph>> m_bins;
78  std::vector<unsigned int> m_detIdVector;
79  std::vector<double> m_values;
81  TH2Poly* m_trackerMap{nullptr};
82 
83  // private methods
84  //============================================================================
85  void dressMap(TCanvas& canv);
86  void drawArrows(
87  const float x_X1, const float x_X2, const float x_Y1, const float y_Y2, const char* x_label, const char* y_label);
88  void adjustCanvasMargins(TVirtualPad* pad, const float top, const float bottom, const float left, const float right);
89  void readVertices(double& minx, double& maxx, double& miny, double& maxy);
90 };
91 
92 #endif
svgfig.canvas
def canvas(*sub, **attr)
Definition: svgfig.py:482
PixelBarrelName.h
MessageLogger.h
SiStripTkMaps::m_mapTitle
std::string m_mapTitle
Definition: SiStripTkMaps.h:74
SiStripTkMaps::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, const float top, const float bottom, const float left, const float right)
Definition: SiStripTkMaps.cc:206
SiStripTkMaps::getTheMap
const TH2Poly * getTheMap()
Definition: SiStripTkMaps.h:54
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
TrackerTopology
Definition: TrackerTopology.h:16
SiStripTkMaps::getTheFilledIds
const std::vector< unsigned int > & getTheFilledIds()
Definition: SiStripTkMaps.h:63
SiStripTkMaps::setZAxisRange
void setZAxisRange(double xmin, double xmax)
Definition: SiStripTkMaps.h:69
SiStripTkMaps
Definition: SiStripTkMaps.h:40
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
SiStripTkMaps::SiStripTkMaps
SiStripTkMaps(const char *option)
Definition: SiStripTkMaps.h:42
SiStripTkMaps::m_option
Option_t * m_option
Definition: SiStripTkMaps.h:73
FileInPath.h
edm::FileInPath
Definition: FileInPath.h:64
StandaloneTrackerTopology.h
SiStripTkMaps::m_values
std::vector< double > m_values
Definition: SiStripTkMaps.h:79
SiStripTkMaps::m_axmax
double m_axmax
Definition: SiStripTkMaps.h:76
SiStripTkMaps::bookMap
void bookMap(const std::string mapTitle, const std::string zAxisTitle)
Definition: SiStripTkMaps.cc:35
SiStripTkMaps::~SiStripTkMaps
~SiStripTkMaps()=default
SiStripTkMaps::m_bins
std::map< long, std::shared_ptr< TGraph > > m_bins
Definition: SiStripTkMaps.h:77
SiStripTkMaps::getTheFilledValues
const std::vector< double > & getTheFilledValues()
Definition: SiStripTkMaps.h:66
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripTkMaps::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: SiStripTkMaps.h:80
SiStripTkMaps::m_zAxisTitle
std::string m_zAxisTitle
Definition: SiStripTkMaps.h:75
SiStripTkMaps::m_detIdVector
std::vector< unsigned int > m_detIdVector
Definition: SiStripTkMaps.h:78
SiStripTkMaps::dressMap
void dressMap(TCanvas &canv)
Definition: SiStripTkMaps.cc:111
SiStripTkMaps::fill
void fill(long rawid, double val)
Definition: SiStripTkMaps.cc:64
SiStripTkMaps::drawArrows
void drawArrows(const float x_X1, const float x_X2, const float x_Y1, const float y_Y2, const char *x_label, const char *y_label)
Definition: SiStripTkMaps.cc:176
SiStripTkMaps::m_trackerMap
TH2Poly * m_trackerMap
Definition: SiStripTkMaps.h:81
SiStripTkMaps::getTheMapTitle
const std::string & getTheMapTitle()
Definition: SiStripTkMaps.h:57
SiStripTkMaps::drawMap
void drawMap(TCanvas &canvas, std::string option="")
Definition: SiStripTkMaps.cc:70
heppy_batch.val
val
Definition: heppy_batch.py:351
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
PXBDetId.h
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
PXFDetId.h
SiStripTkMaps::getTheZAxisTitle
const std::string & getTheZAxisTitle()
Definition: SiStripTkMaps.h:60
SiStripTkMaps::readVertices
void readVertices(double &minx, double &maxx, double &miny, double &maxy)
Definition: SiStripTkMaps.cc:223
StandaloneTrackerTopology::fromTrackerParametersXMLFile
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
Definition: StandaloneTrackerTopology.cc:168
SiStripTkMaps::m_axmin
double m_axmin
Definition: SiStripTkMaps.h:76
PixelEndcapName.h