CMS 3D CMS Logo

OnlineBeamMonitor.cc
Go to the documentation of this file.
1 /*
2  * \file OnlineBeamMonitor.cc
3  * \author Lorenzo Uplegger/FNAL
4  * modified by Simone Gennai INFN/Bicocca
5  */
6 
20 #include <memory>
21 
22 #include <numeric>
23 
24 using namespace std;
25 using namespace edm;
26 using namespace reco;
27 
28 //----------------------------------------------------------------------------------------------------------------------
30  : monitorName_(ps.getUntrackedParameter<string>("MonitorName")),
31  bsTransientToken_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
33  bsLegacyToken_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
34  numberOfValuesToSave_(0),
35  appendRunTxt_(ps.getUntrackedParameter<bool>("AppendRunToFileName")),
36  writeDIPTxt_(ps.getUntrackedParameter<bool>("WriteDIPAscii")),
37  outputDIPTxt_(ps.getUntrackedParameter<std::string>("DIPFileName")) {
38  if (!monitorName_.empty())
39  monitorName_ = monitorName_ + "/";
40 
41  processedLumis_.clear();
42 
43  varNamesV_.push_back("x");
44  varNamesV_.push_back("y");
45  varNamesV_.push_back("z");
46  varNamesV_.push_back("sigmaX");
47  varNamesV_.push_back("sigmaY");
48  varNamesV_.push_back("sigmaZ");
49 
50  //histoByCategoryNames_.insert(pair<string, string>("run", "Coordinate"));
51  //histoByCategoryNames_.insert(pair<string, string>("run", "PrimaryVertex fit-DataBase"));
52  //histoByCategoryNames_.insert(pair<string, string>("run", "PrimaryVertex fit-BeamFit"));
53  //histoByCategoryNames_.insert(pair<string, string>("run", "PrimaryVertex fit-Scalers"));
54  //histoByCategoryNames_.insert(pair<string, string>("run", "PrimaryVertex-DataBase"));
55  //histoByCategoryNames_.insert(pair<string, string>("run", "PrimaryVertex-BeamFit"));
56  //histoByCategoryNames_.insert(pair<string, string>("run", "PrimaryVertex-Scalers"));
57 
58  histoByCategoryNames_.insert(pair<string, string>("lumi", "Lumibased BeamSpotHLT"));
59  histoByCategoryNames_.insert(pair<string, string>("lumi", "Lumibased BeamSpotLegacy"));
60  histoByCategoryNames_.insert(pair<string, string>("lumi", "Lumibased BeamSpotTransient"));
61 
62  for (const auto& itV : varNamesV_) {
63  for (const auto& itM : histoByCategoryNames_) {
64  histosMap_[itV][itM.first][itM.second] = nullptr;
65  }
66  }
67 }
68 
71  ps.addUntracked<std::string>("MonitorName", "YourSubsystemName");
72  ps.addUntracked<bool>("AppendRunToFileName", false);
73  ps.addUntracked<bool>("WriteDIPAscii", true);
74  ps.addUntracked<std::string>("DIPFileName", "BeamFitResultsForDIP.txt");
75 
76  iDesc.addWithDefaultLabel(ps);
77 }
78 
79 //----------------------------------------------------------------------------------------------------------------------
81  edm::Run const& iRun,
82  edm::EventSetup const& iSetup) {
83  string name;
84  string title;
85  int firstLumi = 1;
86  int lastLumi = 3000;
87  for (auto& itM : histosMap_) {
88  //Making histos per Lumi
89  // x,y,z,sigmaX,sigmaY,sigmaZ
90  for (auto& itMM : itM.second) {
91  if (itMM.first != "run") {
92  for (auto& itMMM : itMM.second) {
93  name = string("h") + itM.first + itMMM.first;
94  title = itM.first + "_{0} " + itMMM.first;
95  if (itMM.first == "lumi") {
96  ibooker.setCurrentFolder(monitorName_ + "Debug");
97  itMMM.second = ibooker.book1D(name, title, lastLumi - firstLumi + 1, firstLumi - 0.5, lastLumi + 0.5);
98  itMMM.second->setEfficiencyFlag();
99  } else {
100  LogInfo("OnlineBeamMonitorClient") << "Unrecognized category " << itMM.first;
101  }
102  if (itMMM.second != nullptr) {
103  if (itMMM.first.find('-') != string::npos) {
104  itMMM.second->setAxisTitle(string("#Delta ") + itM.first + "_{0} (cm)", 2);
105  } else {
106  itMMM.second->setAxisTitle(itM.first + "_{0} (cm)", 2);
107  }
108  itMMM.second->setAxisTitle("Lumisection", 1);
109  }
110  }
111  }
112  }
113  }
114 
115  // create and cd into new folder
116  ibooker.setCurrentFolder(monitorName_ + "Validation");
117  //Book histograms
118  bsChoice_ = ibooker.bookProfile("bsChoice",
119  "BS Choice (+1): HLT - (-1): Legacy - (-10): Fake BS - (0): No Transient ",
120  lastLumi - firstLumi + 1,
121  firstLumi - 0.5,
122  lastLumi + 0.5,
123  100,
124  -10,
125  1,
126  "");
127  bsChoice_->setAxisTitle("Lumisection", 1);
128  bsChoice_->setAxisTitle("Choice", 2);
129 }
130 
131 //----------------------------------------------------------------------------------------------------------------------
132 // Handle exceptions for the schema evolution of the BeamSpotOnline CondFormat
133 
134 // Slightly better error handler
135 static void print_error(const std::exception& e) { edm::LogError("BeamSpotOnlineParameters") << e.what() << '\n'; }
136 
137 // Method to catch exceptions
138 template <typename T, class Except, class Func, class Response>
139 T try_(Func f, Response r) {
140  try {
141  LogDebug("BeamSpotOnlineParameters") << "I have tried" << std::endl;
142  return f();
143  } catch (Except& e) {
144  LogDebug("BeamSpotOnlineParameters") << "I have caught!" << std::endl;
145  r(e);
146  return static_cast<T>("-999");
147  }
148 }
149 
150 // Enum the BS string parameters
152  startTime = 0, // 0 additional std::string parameters
153  endTime = 1, // 1
154  lumiRange = 2, // 2
156 };
157 
158 // Functor
159 std::function<std::string(BSparameters, BeamSpotOnlineObjects)> myStringFunctor = [](BSparameters my_param,
160  BeamSpotOnlineObjects m_payload) {
161  std::string ret("");
162  switch (my_param) {
163  case startTime:
164  return m_payload.startTime();
165  case endTime:
166  return m_payload.endTime();
167  case lumiRange:
168  return m_payload.lumiRange();
169  default:
170  return ret;
171  }
172 };
173 
174 //----------------------------------------------------------------------------------------------------------------------
175 std::shared_ptr<onlinebeammonitor::BeamSpotInfo> OnlineBeamMonitor::globalBeginLuminosityBlock(
176  const LuminosityBlock& iLumi, const EventSetup& iSetup) const {
177  // Always create a beamspot group for each lumi weather we have results or not! Each Beamspot will be of unknown type!
178 
179  auto beamSpotInfo = std::make_shared<onlinebeammonitor::BeamSpotInfo>();
180 
181  //Read BeamSpot from DB
183  ESHandle<BeamSpotOnlineObjects> bsLegacyHandle;
184  ESHandle<BeamSpotObjects> bsTransientHandle;
185  //int lastLumiHLT_ = 0;
186  //int lastLumiLegacy_ = 0;
187  std::string startTimeStamp_ = "0";
188  std::string startTimeStampHLT_ = "0";
189  std::string startTimeStampLegacy_ = "0";
190  std::string stopTimeStamp_ = "0";
191  std::string stopTimeStampHLT_ = "0";
192  std::string stopTimeStampLegacy_ = "0";
193  std::string lumiRange_ = "0 - 0";
194  std::string lumiRangeHLT_ = "0 - 0";
195  std::string lumiRangeLegacy_ = "0 - 0";
196 
197  if (auto bsHLTHandle = iSetup.getHandle(bsHLTToken_)) {
198  auto const& spotDB = *bsHLTHandle;
199 
200  //lastLumiHLT_ = spotDB.lastAnalyzedLumi();
201  startTimeStampHLT_ =
202  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::startTime, spotDB), print_error);
203  stopTimeStampHLT_ =
204  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::endTime, spotDB), print_error);
205  lumiRangeHLT_ =
206  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::lumiRange, spotDB), print_error);
207 
208  // translate from BeamSpotObjects to reco::BeamSpot
209  BeamSpot::Point apoint(spotDB.x(), spotDB.y(), spotDB.z());
210 
212  for (int i = 0; i < 7; ++i) {
213  for (int j = 0; j < 7; ++j) {
214  matrix(i, j) = spotDB.covariance(i, j);
215  }
216  }
217 
218  beamSpotInfo->beamSpotsMap_["HLT"] =
219  BeamSpot(apoint, spotDB.sigmaZ(), spotDB.dxdz(), spotDB.dydz(), spotDB.beamWidthX(), matrix);
220 
221  BeamSpot* aSpot = &(beamSpotInfo->beamSpotsMap_["HLT"]);
222 
223  aSpot->setBeamWidthY(spotDB.beamWidthY());
224  aSpot->setEmittanceX(spotDB.emittanceX());
225  aSpot->setEmittanceY(spotDB.emittanceY());
226  aSpot->setbetaStar(spotDB.betaStar());
227 
228  if (spotDB.beamType() == 2) {
229  aSpot->setType(reco::BeamSpot::Tracker);
230  } else {
231  aSpot->setType(reco::BeamSpot::Fake);
232  }
233  //LogInfo("OnlineBeamMonitor")
234  // << *aSpot << std::endl;
235  } else {
236  LogInfo("OnlineBeamMonitor") << "Database BeamSpot is not valid at lumi: " << iLumi.id().luminosityBlock();
237  }
238  if (auto bsLegacyHandle = iSetup.getHandle(bsLegacyToken_)) {
239  auto const& spotDB = *bsLegacyHandle;
240 
241  // translate from BeamSpotObjects to reco::BeamSpot
242  BeamSpot::Point apoint(spotDB.x(), spotDB.y(), spotDB.z());
243 
244  //lastLumiLegacy_ = spotDB.lastAnalyzedLumi();
245  startTimeStampLegacy_ =
246  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::startTime, spotDB), print_error);
247  stopTimeStampLegacy_ =
248  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::endTime, spotDB), print_error);
249  lumiRangeLegacy_ =
250  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::lumiRange, spotDB), print_error);
251 
253  for (int i = 0; i < 7; ++i) {
254  for (int j = 0; j < 7; ++j) {
255  matrix(i, j) = spotDB.covariance(i, j);
256  }
257  }
258 
259  beamSpotInfo->beamSpotsMap_["Legacy"] =
260  BeamSpot(apoint, spotDB.sigmaZ(), spotDB.dxdz(), spotDB.dydz(), spotDB.beamWidthX(), matrix);
261 
262  BeamSpot* aSpot = &(beamSpotInfo->beamSpotsMap_["Legacy"]);
263 
264  aSpot->setBeamWidthY(spotDB.beamWidthY());
265  aSpot->setEmittanceX(spotDB.emittanceX());
266  aSpot->setEmittanceY(spotDB.emittanceY());
267  aSpot->setbetaStar(spotDB.betaStar());
268 
269  if (spotDB.beamType() == 2) {
270  aSpot->setType(reco::BeamSpot::Tracker);
271  } else {
272  aSpot->setType(reco::BeamSpot::Fake);
273  }
274  //LogInfo("OnlineBeamMonitor")
275  // << *aSpot << std::endl;
276  } else {
277  LogInfo("OnlineBeamMonitor") << "Database BeamSpot is not valid at lumi: " << iLumi.id().luminosityBlock();
278  }
279  if (auto bsTransientHandle = iSetup.getHandle(bsTransientToken_)) {
280  auto const& spotDB = *bsTransientHandle;
281  //std::cout << " from the DB " << spotDB << std::endl;
282 
283  // translate from BeamSpotObjects to reco::BeamSpot
284  BeamSpot::Point apoint(spotDB.x(), spotDB.y(), spotDB.z());
285 
287  for (int i = 0; i < 7; ++i) {
288  for (int j = 0; j < 7; ++j) {
289  matrix(i, j) = spotDB.covariance(i, j);
290  }
291  }
292 
293  beamSpotInfo->beamSpotsMap_["Transient"] =
294  BeamSpot(apoint, spotDB.sigmaZ(), spotDB.dxdz(), spotDB.dydz(), spotDB.beamWidthX(), matrix);
295 
296  BeamSpot* aSpot = &(beamSpotInfo->beamSpotsMap_["Transient"]);
297 
298  aSpot->setBeamWidthY(spotDB.beamWidthY());
299  aSpot->setEmittanceX(spotDB.emittanceX());
300  aSpot->setEmittanceY(spotDB.emittanceY());
301  aSpot->setbetaStar(spotDB.betaStar());
302  if (spotDB.beamType() == 2) {
303  aSpot->setType(reco::BeamSpot::Tracker);
304  } else {
305  aSpot->setType(reco::BeamSpot::Fake);
306  }
307 
308  if (writeDIPTxt_) {
309  std::ofstream outFile;
310 
311  std::string tmpname = outputDIPTxt_;
312  int frun = iLumi.getRun().run();
313 
314  char index[15];
315  if (appendRunTxt_ && writeDIPTxt_) {
316  sprintf(index, "%s%i", "_Run", frun);
317  tmpname.insert(outputDIPTxt_.length() - 4, index);
318  }
319  //int lastLumiAnalyzed_ = iLumi.id().luminosityBlock();
320 
321  if (beamSpotInfo->beamSpotsMap_.find("Transient") != beamSpotInfo->beamSpotsMap_.end()) {
322  if (beamSpotInfo->beamSpotsMap_.find("HLT") != beamSpotInfo->beamSpotsMap_.end() &&
323  beamSpotInfo->beamSpotsMap_["Transient"].x0() == beamSpotInfo->beamSpotsMap_["HLT"].x0()) {
324  // lastLumiAnalyzed_ = lastLumiHLT_;
325  startTimeStamp_ = startTimeStampHLT_;
326  stopTimeStamp_ = stopTimeStampHLT_;
327  lumiRange_ = lumiRangeHLT_;
328 
329  } else if (beamSpotInfo->beamSpotsMap_.find("Legacy") != beamSpotInfo->beamSpotsMap_.end() &&
330  beamSpotInfo->beamSpotsMap_["Transient"].x0() == beamSpotInfo->beamSpotsMap_["Legacy"].x0()) {
331  //lastLumiAnalyzed_ = lastLumiLegacy_;
332  startTimeStamp_ = startTimeStampLegacy_;
333  stopTimeStamp_ = stopTimeStampLegacy_;
334  lumiRange_ = lumiRangeLegacy_;
335  }
336  }
337 
338  outFile.open(tmpname.c_str());
339 
340  outFile << "Runnumber " << frun << " bx " << 0 << std::endl;
341  outFile << "BeginTimeOfFit " << startTimeStamp_ << " " << 0 << std::endl;
342  outFile << "EndTimeOfFit " << stopTimeStamp_ << " " << 0 << std::endl;
343  //outFile << "LumiRange " << lumiRange_ << " - " << lastLumiAnalyzed_ << std::endl;
344  outFile << "LumiRange " << lumiRange_ << std::endl;
345  outFile << "Type " << aSpot->type() << std::endl;
346  outFile << "X0 " << aSpot->x0() << std::endl;
347  outFile << "Y0 " << aSpot->y0() << std::endl;
348  outFile << "Z0 " << aSpot->z0() << std::endl;
349  outFile << "sigmaZ0 " << aSpot->sigmaZ() << std::endl;
350  outFile << "dxdz " << aSpot->dxdz() << std::endl;
351  outFile << "dydz " << aSpot->dydz() << std::endl;
352  outFile << "BeamWidthX " << aSpot->BeamWidthX() << std::endl;
353  outFile << "BeamWidthY " << aSpot->BeamWidthY() << std::endl;
354  for (int i = 0; i < 6; ++i) {
355  outFile << "Cov(" << i << ",j) ";
356  for (int j = 0; j < 7; ++j) {
357  outFile << aSpot->covariance(i, j) << " ";
358  }
359  outFile << std::endl;
360  }
361  outFile << "Cov(6,j) 0 0 0 0 0 0 " << aSpot->covariance(6, 6) << std::endl;
362  outFile << "EmittanceX " << aSpot->emittanceX() << std::endl;
363  outFile << "EmittanceY " << aSpot->emittanceY() << std::endl;
364  outFile << "BetaStar " << aSpot->betaStar() << std::endl;
365 
366  outFile.close();
367  }
368  //LogInfo("OnlineBeamMonitor")
369  // << *aSpot << std::endl;
370  } else {
371  LogInfo("OnlineBeamMonitor") << "Database BeamSpot is not valid at lumi: " << iLumi.id().luminosityBlock();
372  }
373  return beamSpotInfo;
374 }
375 
376 //----------------------------------------------------------------------------------------------------------------------
378  processedLumis_.push_back(iLumi.id().luminosityBlock());
379  auto beamSpotInfo = luminosityBlockCache(iLumi.index());
380 
381  //Setting up the choice
382  if (beamSpotInfo->beamSpotsMap_.find("Transient") != beamSpotInfo->beamSpotsMap_.end()) {
383  if (beamSpotInfo->beamSpotsMap_.find("HLT") != beamSpotInfo->beamSpotsMap_.end() &&
384  beamSpotInfo->beamSpotsMap_["Transient"].x0() == beamSpotInfo->beamSpotsMap_["HLT"].x0()) {
385  bsChoice_->Fill(iLumi.id().luminosityBlock(), 1);
386  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
387  } else if (beamSpotInfo->beamSpotsMap_.find("Legacy") != beamSpotInfo->beamSpotsMap_.end() &&
388  beamSpotInfo->beamSpotsMap_["Transient"].x0() == beamSpotInfo->beamSpotsMap_["Legacy"].x0()) {
389  bsChoice_->Fill(iLumi.id().luminosityBlock(), -1);
390  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
391  } else {
392  bsChoice_->Fill(iLumi.id().luminosityBlock(), -10);
393  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
394  }
395  } else {
396  bsChoice_->Fill(iLumi.id().luminosityBlock(), 0);
397  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
398  }
399 
400  // "PV,BF..." Value,Error
401  map<std::string, pair<double, double> > resultsMap;
402  vector<pair<double, double> > vertexResults;
403  MonitorElement* histo = nullptr;
404  for (const auto& itV : varNamesV_) {
405  resultsMap.clear();
406  for (const auto& itBS : beamSpotInfo->beamSpotsMap_) {
407  if (itBS.second.type() == BeamSpot::Tracker) {
408  if (itV == "x") {
409  resultsMap[itBS.first] = pair<double, double>(itBS.second.x0(), itBS.second.x0Error());
410  } else if (itV == "y") {
411  resultsMap[itBS.first] = pair<double, double>(itBS.second.y0(), itBS.second.y0Error());
412  } else if (itV == "z") {
413  resultsMap[itBS.first] = pair<double, double>(itBS.second.z0(), itBS.second.z0Error());
414  } else if (itV == "sigmaX") {
415  resultsMap[itBS.first] = pair<double, double>(itBS.second.BeamWidthX(), itBS.second.BeamWidthXError());
416  } else if (itV == "sigmaY") {
417  resultsMap[itBS.first] = pair<double, double>(itBS.second.BeamWidthY(), itBS.second.BeamWidthYError());
418  } else if (itV == "sigmaZ") {
419  resultsMap[itBS.first] = pair<double, double>(itBS.second.sigmaZ(), itBS.second.sigmaZ0Error());
420  } else {
421  LogInfo("OnlineBeamMonitor") << "The histosMap_ has been built with the name " << itV
422  << " that I can't recognize!";
423  }
424  }
425  }
426 
427  for (const auto& itM : histoByCategoryNames_) {
428  if ((histo = histosMap_[itV][itM.first][itM.second]) == nullptr)
429  continue;
430  if (itM.second == "Lumibased BeamSpotHLT") {
431  if (resultsMap.find("HLT") != resultsMap.end()) {
432  histo->setBinContent(iLumi.id().luminosityBlock(), resultsMap["HLT"].first);
433  histo->setBinError(iLumi.id().luminosityBlock(), resultsMap["HLT"].second);
434  }
435  } else if (itM.second == "Lumibased BeamSpotLegacy") {
436  if (resultsMap.find("Legacy") != resultsMap.end()) {
437  histo->setBinContent(iLumi.id().luminosityBlock(), resultsMap["Legacy"].first);
438  histo->setBinError(iLumi.id().luminosityBlock(), resultsMap["Legacy"].second);
439  }
440  } else if (itM.second == "Lumibased BeamSpotTransient") {
441  if (resultsMap.find("Transient") != resultsMap.end()) {
442  histo->setBinContent(iLumi.id().luminosityBlock(), resultsMap["Transient"].first);
443  histo->setBinError(iLumi.id().luminosityBlock(), resultsMap["Transient"].second);
444  }
445  } else {
446  LogInfo("OnlineBeamMonitor") << "The histosMap_ have a histogram named " << itM.second
447  << " that I can't recognize in this loop!";
448  }
449  }
450  }
451 }
452 
454  if (processedLumis_.empty()) {
455  return;
456  }
457 
458  const double bigNumber = 1000000.;
459  std::sort(processedLumis_.begin(), processedLumis_.end());
460  int firstLumi = *processedLumis_.begin();
461  int lastLumi = *(--processedLumis_.end());
462  bsChoice_->getTH1()->GetXaxis()->SetRangeUser(firstLumi - 0.5, lastLumi + 0.5);
463  for (auto& itH : histosMap_) {
464  for (auto& itHH : itH.second) {
465  double min = bigNumber;
466  double max = -bigNumber;
467  if (itHH.first != "run") {
468  for (auto& itHHH : itHH.second) {
469  if (itHHH.second != nullptr) {
470  for (int bin = 1; bin <= itHHH.second->getTH1()->GetNbinsX(); bin++) {
471  if (itHHH.second->getTH1()->GetBinError(bin) != 0 || itHHH.second->getTH1()->GetBinContent(bin) != 0) {
472  if (itHHH.first == "Lumibased BeamSpotHLT" || itHHH.first == "Lumibased BeamSpotLegacy" ||
473  itHHH.first == "Lumibased BeamSpotTransient") {
474  if (min > itHHH.second->getTH1()->GetBinContent(bin)) {
475  min = itHHH.second->getTH1()->GetBinContent(bin);
476  }
477  if (max < itHHH.second->getTH1()->GetBinContent(bin)) {
478  max = itHHH.second->getTH1()->GetBinContent(bin);
479  }
480  } else {
481  LogInfo("OnlineBeamMonitorClient") << "The histosMap_ have a histogram named " << itHHH.first
482  << " that I can't recognize in this loop!";
483  }
484  }
485  }
486  }
487  }
488  for (auto& itHHH : itHH.second) {
489  if (itHHH.second != nullptr) {
490  if (itHHH.first == "Lumibased BeamSpotHLT" || itHHH.first == "Lumibased BeamSpotLegacy" ||
491  itHHH.first == "Lumibased BeamSpotTransient") {
492  if ((max == -bigNumber && min == bigNumber) || max - min == 0) {
493  itHHH.second->getTH1()->SetMinimum(itHHH.second->getTH1()->GetMinimum() - 0.01);
494  itHHH.second->getTH1()->SetMaximum(itHHH.second->getTH1()->GetMaximum() + 0.01);
495  } else {
496  itHHH.second->getTH1()->SetMinimum(min - 0.1 * (max - min));
497  itHHH.second->getTH1()->SetMaximum(max + 0.1 * (max - min));
498  }
499  } else {
500  LogInfo("OnlineBeamMonitorClient")
501  << "The histosMap_ have a histogram named " << itHHH.first << " that I can't recognize in this loop!";
502  }
503  itHHH.second->getTH1()->GetXaxis()->SetRangeUser(firstLumi - 0.5, lastLumi + 0.5);
504  }
505  }
506  }
507  }
508  }
509 }
510 
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
LuminosityBlockNumber_t luminosityBlock() const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::multimap< std::string, std::string > histoByCategoryNames_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Run const & getRun() const
ret
prodAgent to be discontinued
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineLegacyObjectsRcd > bsLegacyToken_
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
Log< level::Error, false > LogError
std::function< std::string(BSparameters, BeamSpotOnlineObjects)> myStringFunctor
void Fill(long long x)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::string outputDIPTxt_
std::vector< std::string > varNamesV_
RunNumber_t run() const
Definition: RunBase.h:40
void setBeamWidthY(double v)
Definition: BeamSpot.h:105
T try_(Func f, Response r)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
OnlineBeamMonitor(const edm::ParameterSet &)
Transition
Definition: Transition.h:12
double f[11][100]
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BSparameters
void globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) override
std::shared_ptr< onlinebeammonitor::BeamSpotInfo > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) const override
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
std::vector< int > processedLumis_
Log< level::Info, false > LogInfo
std::string monitorName_
LuminosityBlockID id() const
static void print_error(const std::exception &e)
MonitorElement * bsChoice_
LuminosityBlockIndex index() const
edm::ESGetToken< BeamSpotOnlineObjects, BeamSpotOnlineHLTObjectsRcd > bsHLTToken_
fixed size matrix
HLT enums.
static void fillDescriptions(edm::ConfigurationDescriptions &)
HistosContainer histosMap_
edm::ESGetToken< BeamSpotObjects, BeamSpotTransientObjectsRcd > bsTransientToken_
virtual void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
long double T
Definition: Run.h:45
#define LogDebug(id)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)