61 class BeamSpotOnlineParameters :
public DisplayParameters<BeamSpotOnlineObjects> {
63 std::shared_ptr<TH2F> fillTheExtraHistogram()
const override {
64 gStyle->SetHistMinimumZero();
67 edm::LogInfo(
"BeamSpotOnlineParameters") <<
"the span is" << span;
69 auto h2_ExtraBSParameters =
70 std::make_shared<TH2F>(
"ExtraParameters",
"", 1, 0.0, 1.0, span, 0,
static_cast<float>(span));
71 h2_ExtraBSParameters->SetStats(
false);
74 std::function<int(parameters)> myIntFunctor = [
this](
parameters my_param) {
78 return this->m_payload->lastAnalyzedLumi();
80 return this->m_payload->lastAnalyzedRun();
82 return this->m_payload->lastAnalyzedFill();
84 return this->m_payload->numTracks();
86 return this->m_payload->numPVs();
88 return this->m_payload->usedEvents();
90 return this->m_payload->maxPVs();
97 std::function<float(parameters)> myFloatFunctor = [
this](
parameters my_param) {
101 return this->m_payload->meanPV();
103 return this->m_payload->meanErrorPV();
105 return this->m_payload->rmsPV();
107 return this->m_payload->rmsErrorPV();
118 return this->m_payload->startTime();
120 return this->m_payload->endTime();
122 return this->m_payload->lumiRange();
129 std::function<cond::Time_t(parameters)> myTimeFunctor = [
this](
parameters my_param) {
133 return this->m_payload->creationTime();
135 return this->m_payload->startTimeStamp();
137 return this->m_payload->endTimeStamp();
143 unsigned int yBin = span;
147 h2_ExtraBSParameters->GetYaxis()->SetBinLabel(
yBin, theLabel.c_str());
150 const auto output = try_<int, std::out_of_range>(std::bind(myIntFunctor, param),
print_error);
151 edm::LogInfo(
"BeamSpotOnline_PayloadInspector") << theLabel.c_str() <<
" : " <<
output << std::endl;
152 h2_ExtraBSParameters->SetBinContent(1,
yBin,
output);
154 const auto output = try_<float, std::out_of_range>(std::bind(myFloatFunctor, param),
print_error);
155 edm::LogInfo(
"BeamSpotOnline_PayloadInspector") << theLabel.c_str() <<
" : " <<
output << std::endl;
156 h2_ExtraBSParameters->SetBinContent(1,
yBin,
output);
158 const auto output = try_<cond::Time_t, std::out_of_range>(std::bind(myTimeFunctor, param),
print_error);
159 edm::LogInfo(
"BeamSpotOnline_PayloadInspector") << theLabel.c_str() <<
" : " <<
output << std::endl;
160 h2_ExtraBSParameters->SetBinContent(1,
yBin,
output);
169 h2_ExtraBSParameters->GetYaxis()->SetLabelSize(0.05);
170 h2_ExtraBSParameters->GetXaxis()->SetLabelSize(0.05);
171 h2_ExtraBSParameters->GetXaxis()->SetBinLabel(1,
"Value");
172 h2_ExtraBSParameters->SetMarkerSize(2.);
174 return h2_ExtraBSParameters;
188 return "#sigma_{X} [cm]";
190 return "#sigma_{Y} [cm]";
192 return "#sigma_{Z} [cm]";
194 return "#frac{dX}{dZ} [rad]";
196 return "#frac{dY}{dZ} [rad]";
212 return "#LT # PV #GT";
214 return "#LT # PV #GT error";
218 return "RMS(# PV) error";
220 return "creation time";
222 return "start timestamp";
224 return "end timestamp";
232 return "should never be here";
240 template <
typename T,
class Except,
class Func,
class Response>
241 T try_(Func
f, Response r)
const {
243 LogDebug(
"BeamSpotOnlineParameters") <<
"I have tried" << std::endl;
245 }
catch (Except&
e) {
246 LogDebug(
"BeamSpotOnlineParameters") <<
"I have caught!" << std::endl;
248 return static_cast<T>(-999);
258 BeamSpotOnlineParametersDiffSingleTag;
260 BeamSpotOnlineParametersDiffTwoTags;
ret
prodAgent to be discontinued
const std::string getStringFromTypeEnum(const types &type)
Log< level::Error, false > LogError
std::function< std::string(BSparameters, BeamSpotOnlineObjects)> myStringFunctor
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
unsigned long long Time_t
T try_(Func f, Response r)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
Log< level::Info, false > LogInfo
static void print_error(const std::exception &e)