CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions
PfCalibration< T > Class Template Reference
Inheritance diagram for PfCalibration< T >:
cond::payloadInspector::PlotImage< PerformancePayloadFromTFormula, SINGLE_IOV > cond::payloadInspector::PlotImpl< IOV_M, 0 > cond::payloadInspector::PlotBase

Public Member Functions

bool fill () override
 
 PfCalibration ()
 
- Public Member Functions inherited from cond::payloadInspector::PlotImage< PerformancePayloadFromTFormula, SINGLE_IOV >
std::shared_ptr< PerformancePayloadFromTFormulafetchPayload (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< PerformancePayloadFromTFormula, SINGLE_IOV >
typedef PlotImpl< IOV_M, 0 > Base
 
- Protected Attributes inherited from cond::payloadInspector::PlotImage< PerformancePayloadFromTFormula, 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<PerformanceResult::ResultType T>
class PfCalibration< T >

Definition at line 68 of file PfCalibration_PayloadInspector.cc.

Constructor & Destructor Documentation

◆ PfCalibration()

template<PerformanceResult::ResultType T>
PfCalibration< T >::PfCalibration ( )
inline

Member Function Documentation

◆ fill()

template<PerformanceResult::ResultType T>
bool PfCalibration< T >::fill ( )
inlineoverridevirtual

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

Definition at line 72 of file PfCalibration_PayloadInspector.cc.

References svgfig::canvas(), MillePedeFileConverter_cfg::fileName, pfMETCorrectionType0_cfi::formula, functType, TH2PolyOfflineMaps::limits, jetsAK4_Puppi_cff::payload, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and createPayload::tagname.

72  {
73  auto tag = PlotBase::getTag<0>();
74  auto iov = tag.iovs.front();
75  std::string tagname = tag.name;
76  auto payload = fetchPayload(std::get<1>(iov));
77 
78  if (!payload.get())
79  return false;
80 
81  int pos = ((PerformancePayloadFromTFormulaExposed*)payload.get())->resultPos(T);
82  auto formula = payload->formulaPayload();
83  auto formula_vec = formula.formulas();
84  auto limits_vec = formula.limits();
85  if (pos < 0 || pos > (int)formula_vec.size()) {
86  edm::LogError("PfCalibration") << "Will not display image for " << functType[T]
87  << " as it's not contained in the payload!";
88  return false;
89  }
90  TCanvas canvas("PfCalibration", "PfCalibration", 1500, 800);
91  canvas.cd();
92  auto formula_string = formula_vec[pos];
93  auto limits = limits_vec[pos];
94 
95  auto function_plot = new TF1("f1", formula_string.c_str(), limits.first, limits.second);
96  function_plot->SetTitle((functType[T] + " " + formula_string).c_str());
97  function_plot->GetXaxis()->SetTitle("GeV");
98  function_plot->Draw("");
99 
101  canvas.SaveAs(fileName.c_str());
102 
103  return true;
104  }
Log< level::Error, false > LogError
def canvas(sub, attr)
Definition: svgfig.py:482
long double T
static std::map< PerformanceResult::ResultType, std::string > functType
std::shared_ptr< PerformancePayloadFromTFormula > fetchPayload(const cond::Hash &payloadHash)