CMS 3D CMS Logo

List of all members | Public Member Functions
ParametersPerChannel< param, PayloadType > Class Template Reference

#include <PPSTimingCalibrationPayloadInspectorHelper.h>

Inheritance diagram for ParametersPerChannel< param, PayloadType >:
cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV > cond::payloadInspector::PlotImpl< IOV_M, 0 > cond::payloadInspector::PlotBase

Public Member Functions

bool fill () override
 
 ParametersPerChannel ()
 
- 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)
 
cond::persistency::Session dbSession ()
 
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 ()
 
const std::map< std::string, std::string > & inputParamValues () const
 
bool isSingleIov () const
 
bool isTwoTags () const
 
unsigned int ntags () const
 
std::string payloadType () const
 
 PlotBase ()
 
std::string title () const
 
std::string type () const
 
virtual ~PlotBase ()=default
 

Additional Inherited Members

- Public Types inherited from cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >
typedef PlotImpl< IOV_M, 0 > Base
 
- 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
 

Detailed Description

template<PPSTimingCalibrationPI::parameter param, class PayloadType>
class ParametersPerChannel< param, PayloadType >

Definition at line 76 of file PPSTimingCalibrationPayloadInspectorHelper.h.

Constructor & Destructor Documentation

◆ ParametersPerChannel()

template<PPSTimingCalibrationPI::parameter param, class PayloadType >
ParametersPerChannel< param, PayloadType >::ParametersPerChannel ( )
inline

Member Function Documentation

◆ fill()

template<PPSTimingCalibrationPI::parameter param, class PayloadType >
bool ParametersPerChannel< param, PayloadType >::fill ( )
inlineoverridevirtual

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

Definition at line 86 of file PPSTimingCalibrationPayloadInspectorHelper.h.

References PPSTimingCalibrationPI::ARM, svgfig::canvas(), EcalCondDB::db, cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::fetchPayload(), MillePedeFileConverter_cfg::fileName, PPSTimingCalibrationPI::getStringFromParamEnum(), mps_fire::i, cond::payloadInspector::PlotBase::inputParamValues(), cond::payloadInspector::PlotImage< PayloadType, cond::payloadInspector::SINGLE_IOV >::m_imageFileName, create_idmaps::n, PPSTimingCalibrationPI::PLANE, PPSTimingCalibrationPI::STATION, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, createPayload::tagname, x, and y.

86  {
87  auto tag = cond::payloadInspector::PlotBase::getTag<0>();
88  auto tagname = tag.name;
89  auto iov = tag.iovs.back();
90  auto m_payload = this->fetchPayload(std::get<1>(iov));
91 
93  auto db = paramValues.find(PPSTimingCalibrationPI::ARM)->second;
94  auto station = paramValues.find(PPSTimingCalibrationPI::STATION)->second;
95  auto plane = paramValues.find(PPSTimingCalibrationPI::PLANE)->second;
96 
97  if (m_payload != nullptr) {
98  TCanvas canvas(
99  "PPSTimingCalibration parameters per channel", "PPSTimingCalibration parameters per channel", 1400, 1000);
100  canvas.cd(1);
101  canvas.SetGrid();
102  const Int_t n = 12;
103  Double_t x[n];
104  Double_t y[n];
105  for (int i = 0; i < n; i++) {
106  y[i] = m_payload->parameters(std::stoi(db), std::stoi(station), std::stoi(plane), i)[param];
107  x[i] = i;
108  }
109 
110  TGraph* graph = new TGraph(n, x, y);
111  graph->SetTitle(("PPSTimingCalibration db = " + db + ", " + "station = " + station + ", " + "plane = " + plane +
112  ", " + PPSTimingCalibrationPI::getStringFromParamEnum(param) + " PER channel; channel; " +
114  .c_str());
115  graph->SetMarkerColor(2);
116  graph->SetMarkerSize(1.5);
117  graph->SetMarkerStyle(21);
118  graph->GetXaxis()->SetRangeUser(-.5, 11.5);
119  graph->GetXaxis()->SetNdivisions(16);
120  graph->GetYaxis()->SetNdivisions(32);
121  graph->Draw("AP");
122 
124  canvas.SaveAs(fileName.c_str());
125 
126  return true;
127  } else {
128  return false;
129  }
130  }
std::string getStringFromParamEnum(const parameter &parameter)
const std::map< std::string, std::string > & inputParamValues() const
def canvas(sub, attr)
Definition: svgfig.py:482
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)