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::NoCache> 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  processedLumis_.push_back(iLumi.id().luminosityBlock());
180  //Read BeamSpot from DB
182  ESHandle<BeamSpotOnlineObjects> bsLegacyHandle;
183  ESHandle<BeamSpotObjects> bsTransientHandle;
184  //int lastLumiHLT_ = 0;
185  //int lastLumiLegacy_ = 0;
186  std::string startTimeStamp_ = "0";
187  std::string startTimeStampHLT_ = "0";
188  std::string startTimeStampLegacy_ = "0";
189  std::string stopTimeStamp_ = "0";
190  std::string stopTimeStampHLT_ = "0";
191  std::string stopTimeStampLegacy_ = "0";
192  std::string lumiRange_ = "0 - 0";
193  std::string lumiRangeHLT_ = "0 - 0";
194  std::string lumiRangeLegacy_ = "0 - 0";
195 
196  if (auto bsHLTHandle = iSetup.getHandle(bsHLTToken_)) {
197  auto const& spotDB = *bsHLTHandle;
198 
199  //lastLumiHLT_ = spotDB.lastAnalyzedLumi();
200  startTimeStampHLT_ =
201  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::startTime, spotDB), print_error);
202  stopTimeStampHLT_ =
203  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::endTime, spotDB), print_error);
204  lumiRangeHLT_ =
205  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::lumiRange, spotDB), print_error);
206 
207  // translate from BeamSpotObjects to reco::BeamSpot
208  BeamSpot::Point apoint(spotDB.x(), spotDB.y(), spotDB.z());
209 
211  for (int i = 0; i < 7; ++i) {
212  for (int j = 0; j < 7; ++j) {
213  matrix(i, j) = spotDB.covariance(i, j);
214  }
215  }
216 
217  beamSpotsMap_["HLT"] = BeamSpot(apoint, spotDB.sigmaZ(), spotDB.dxdz(), spotDB.dydz(), spotDB.beamWidthX(), matrix);
218 
219  BeamSpot* aSpot = &(beamSpotsMap_["HLT"]);
220 
221  aSpot->setBeamWidthY(spotDB.beamWidthY());
222  aSpot->setEmittanceX(spotDB.emittanceX());
223  aSpot->setEmittanceY(spotDB.emittanceY());
224  aSpot->setbetaStar(spotDB.betaStar());
225 
226  if (spotDB.beamType() == 2) {
227  aSpot->setType(reco::BeamSpot::Tracker);
228  } else {
229  aSpot->setType(reco::BeamSpot::Fake);
230  }
231  //LogInfo("OnlineBeamMonitor")
232  // << *aSpot << std::endl;
233  } else {
234  LogInfo("OnlineBeamMonitor") << "Database BeamSpot is not valid at lumi: " << iLumi.id().luminosityBlock();
235  }
236  if (auto bsLegacyHandle = iSetup.getHandle(bsLegacyToken_)) {
237  auto const& spotDB = *bsLegacyHandle;
238 
239  // translate from BeamSpotObjects to reco::BeamSpot
240  BeamSpot::Point apoint(spotDB.x(), spotDB.y(), spotDB.z());
241 
242  //lastLumiLegacy_ = spotDB.lastAnalyzedLumi();
243  startTimeStampLegacy_ =
244  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::startTime, spotDB), print_error);
245  stopTimeStampLegacy_ =
246  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::endTime, spotDB), print_error);
247  lumiRangeLegacy_ =
248  try_<std::string, std::out_of_range>(std::bind(myStringFunctor, BSparameters::lumiRange, spotDB), print_error);
249 
251  for (int i = 0; i < 7; ++i) {
252  for (int j = 0; j < 7; ++j) {
253  matrix(i, j) = spotDB.covariance(i, j);
254  }
255  }
256 
257  beamSpotsMap_["Legacy"] =
258  BeamSpot(apoint, spotDB.sigmaZ(), spotDB.dxdz(), spotDB.dydz(), spotDB.beamWidthX(), matrix);
259 
260  BeamSpot* aSpot = &(beamSpotsMap_["Legacy"]);
261 
262  aSpot->setBeamWidthY(spotDB.beamWidthY());
263  aSpot->setEmittanceX(spotDB.emittanceX());
264  aSpot->setEmittanceY(spotDB.emittanceY());
265  aSpot->setbetaStar(spotDB.betaStar());
266 
267  if (spotDB.beamType() == 2) {
268  aSpot->setType(reco::BeamSpot::Tracker);
269  } else {
270  aSpot->setType(reco::BeamSpot::Fake);
271  }
272  //LogInfo("OnlineBeamMonitor")
273  // << *aSpot << std::endl;
274  } else {
275  LogInfo("OnlineBeamMonitor") << "Database BeamSpot is not valid at lumi: " << iLumi.id().luminosityBlock();
276  }
277  if (auto bsTransientHandle = iSetup.getHandle(bsTransientToken_)) {
278  auto const& spotDB = *bsTransientHandle;
279  //std::cout << " from the DB " << spotDB << std::endl;
280 
281  // translate from BeamSpotObjects to reco::BeamSpot
282  BeamSpot::Point apoint(spotDB.x(), spotDB.y(), spotDB.z());
283 
285  for (int i = 0; i < 7; ++i) {
286  for (int j = 0; j < 7; ++j) {
287  matrix(i, j) = spotDB.covariance(i, j);
288  }
289  }
290 
291  beamSpotsMap_["Transient"] =
292  BeamSpot(apoint, spotDB.sigmaZ(), spotDB.dxdz(), spotDB.dydz(), spotDB.beamWidthX(), matrix);
293 
294  BeamSpot* aSpot = &(beamSpotsMap_["Transient"]);
295 
296  aSpot->setBeamWidthY(spotDB.beamWidthY());
297  aSpot->setEmittanceX(spotDB.emittanceX());
298  aSpot->setEmittanceY(spotDB.emittanceY());
299  aSpot->setbetaStar(spotDB.betaStar());
300  if (spotDB.beamType() == 2) {
301  aSpot->setType(reco::BeamSpot::Tracker);
302  } else {
303  aSpot->setType(reco::BeamSpot::Fake);
304  }
305 
306  if (writeDIPTxt_) {
307  std::ofstream outFile;
308 
309  std::string tmpname = outputDIPTxt_;
310  int frun = iLumi.getRun().run();
311 
312  char index[15];
313  if (appendRunTxt_ && writeDIPTxt_) {
314  sprintf(index, "%s%i", "_Run", frun);
315  tmpname.insert(outputDIPTxt_.length() - 4, index);
316  }
317  //int lastLumiAnalyzed_ = iLumi.id().luminosityBlock();
318 
319  if (beamSpotsMap_.find("Transient") != beamSpotsMap_.end()) {
320  if (beamSpotsMap_.find("HLT") != beamSpotsMap_.end() &&
321  beamSpotsMap_["Transient"].x0() == beamSpotsMap_["HLT"].x0()) {
322  // lastLumiAnalyzed_ = lastLumiHLT_;
323  startTimeStamp_ = startTimeStampHLT_;
324  stopTimeStamp_ = stopTimeStampHLT_;
325  lumiRange_ = lumiRangeHLT_;
326 
327  } else if (beamSpotsMap_.find("Legacy") != beamSpotsMap_.end() &&
328  beamSpotsMap_["Transient"].x0() == beamSpotsMap_["Legacy"].x0()) {
329  //lastLumiAnalyzed_ = lastLumiLegacy_;
330  startTimeStamp_ = startTimeStampLegacy_;
331  stopTimeStamp_ = stopTimeStampLegacy_;
332  lumiRange_ = lumiRangeLegacy_;
333  }
334  }
335 
336  outFile.open(tmpname.c_str());
337 
338  outFile << "Runnumber " << frun << " bx " << 0 << std::endl;
339  outFile << "BeginTimeOfFit " << startTimeStamp_ << " " << 0 << std::endl;
340  outFile << "EndTimeOfFit " << stopTimeStamp_ << " " << 0 << std::endl;
341  //outFile << "LumiRange " << lumiRange_ << " - " << lastLumiAnalyzed_ << std::endl;
342  outFile << "LumiRange " << lumiRange_ << std::endl;
343  outFile << "Type " << aSpot->type() << std::endl;
344  outFile << "X0 " << aSpot->x0() << std::endl;
345  outFile << "Y0 " << aSpot->y0() << std::endl;
346  outFile << "Z0 " << aSpot->z0() << std::endl;
347  outFile << "sigmaZ0 " << aSpot->sigmaZ() << std::endl;
348  outFile << "dxdz " << aSpot->dxdz() << std::endl;
349  outFile << "dydz " << aSpot->dydz() << std::endl;
350  outFile << "BeamWidthX " << aSpot->BeamWidthX() << std::endl;
351  outFile << "BeamWidthY " << aSpot->BeamWidthY() << std::endl;
352  for (int i = 0; i < 6; ++i) {
353  outFile << "Cov(" << i << ",j) ";
354  for (int j = 0; j < 7; ++j) {
355  outFile << aSpot->covariance(i, j) << " ";
356  }
357  outFile << std::endl;
358  }
359  outFile << "Cov(6,j) 0 0 0 0 0 0 " << aSpot->covariance(6, 6) << std::endl;
360  outFile << "EmittanceX " << aSpot->emittanceX() << std::endl;
361  outFile << "EmittanceY " << aSpot->emittanceY() << std::endl;
362  outFile << "BetaStar " << aSpot->betaStar() << std::endl;
363 
364  outFile.close();
365  }
366  //LogInfo("OnlineBeamMonitor")
367  // << *aSpot << std::endl;
368  } else {
369  LogInfo("OnlineBeamMonitor") << "Database BeamSpot is not valid at lumi: " << iLumi.id().luminosityBlock();
370  }
371  return nullptr;
372 }
373 
374 //----------------------------------------------------------------------------------------------------------------------
376  //Setting up the choice
377  if (beamSpotsMap_.find("Transient") != beamSpotsMap_.end()) {
378  if (beamSpotsMap_.find("HLT") != beamSpotsMap_.end() &&
379  beamSpotsMap_["Transient"].x0() == beamSpotsMap_["HLT"].x0()) {
380  bsChoice_->Fill(iLumi.id().luminosityBlock(), 1);
381  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
382  } else if (beamSpotsMap_.find("Legacy") != beamSpotsMap_.end() &&
383  beamSpotsMap_["Transient"].x0() == beamSpotsMap_["Legacy"].x0()) {
384  bsChoice_->Fill(iLumi.id().luminosityBlock(), -1);
385  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
386  } else {
387  bsChoice_->Fill(iLumi.id().luminosityBlock(), -10);
388  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
389  }
390  } else {
391  bsChoice_->Fill(iLumi.id().luminosityBlock(), 0);
392  bsChoice_->setBinError(iLumi.id().luminosityBlock(), 0.05);
393  }
394 
395  // "PV,BF..." Value,Error
396  map<std::string, pair<double, double> > resultsMap;
397  vector<pair<double, double> > vertexResults;
398  MonitorElement* histo = nullptr;
399  for (const auto& itV : varNamesV_) {
400  resultsMap.clear();
401  for (const auto& itBS : beamSpotsMap_) {
402  if (itBS.second.type() == BeamSpot::Tracker) {
403  if (itV == "x") {
404  resultsMap[itBS.first] = pair<double, double>(itBS.second.x0(), itBS.second.x0Error());
405  } else if (itV == "y") {
406  resultsMap[itBS.first] = pair<double, double>(itBS.second.y0(), itBS.second.y0Error());
407  } else if (itV == "z") {
408  resultsMap[itBS.first] = pair<double, double>(itBS.second.z0(), itBS.second.z0Error());
409  } else if (itV == "sigmaX") {
410  resultsMap[itBS.first] = pair<double, double>(itBS.second.BeamWidthX(), itBS.second.BeamWidthXError());
411  } else if (itV == "sigmaY") {
412  resultsMap[itBS.first] = pair<double, double>(itBS.second.BeamWidthY(), itBS.second.BeamWidthYError());
413  } else if (itV == "sigmaZ") {
414  resultsMap[itBS.first] = pair<double, double>(itBS.second.sigmaZ(), itBS.second.sigmaZ0Error());
415  } else {
416  LogInfo("OnlineBeamMonitor") << "The histosMap_ has been built with the name " << itV
417  << " that I can't recognize!";
418  }
419  }
420  }
421 
422  for (const auto& itM : histoByCategoryNames_) {
423  if ((histo = histosMap_[itV][itM.first][itM.second]) == nullptr)
424  continue;
425  if (itM.second == "Lumibased BeamSpotHLT") {
426  if (resultsMap.find("HLT") != resultsMap.end()) {
427  histo->setBinContent(iLumi.id().luminosityBlock(), resultsMap["HLT"].first);
428  histo->setBinError(iLumi.id().luminosityBlock(), resultsMap["HLT"].second);
429  }
430  } else if (itM.second == "Lumibased BeamSpotLegacy") {
431  if (resultsMap.find("Legacy") != resultsMap.end()) {
432  histo->setBinContent(iLumi.id().luminosityBlock(), resultsMap["Legacy"].first);
433  histo->setBinError(iLumi.id().luminosityBlock(), resultsMap["Legacy"].second);
434  }
435  } else if (itM.second == "Lumibased BeamSpotTransient") {
436  if (resultsMap.find("Transient") != resultsMap.end()) {
437  histo->setBinContent(iLumi.id().luminosityBlock(), resultsMap["Transient"].first);
438  histo->setBinError(iLumi.id().luminosityBlock(), resultsMap["Transient"].second);
439  }
440  } else {
441  LogInfo("OnlineBeamMonitor") << "The histosMap_ have a histogram named " << itM.second
442  << " that I can't recognize in this loop!";
443  }
444  }
445  }
446 }
447 
449  if (processedLumis_.empty()) {
450  return;
451  }
452 
453  const double bigNumber = 1000000.;
454  std::sort(processedLumis_.begin(), processedLumis_.end());
455  int firstLumi = *processedLumis_.begin();
456  int lastLumi = *(--processedLumis_.end());
457  bsChoice_->getTH1()->GetXaxis()->SetRangeUser(firstLumi - 0.5, lastLumi + 0.5);
458  for (auto& itH : histosMap_) {
459  for (auto& itHH : itH.second) {
460  double min = bigNumber;
461  double max = -bigNumber;
462  if (itHH.first != "run") {
463  for (auto& itHHH : itHH.second) {
464  if (itHHH.second != nullptr) {
465  for (int bin = 1; bin <= itHHH.second->getTH1()->GetNbinsX(); bin++) {
466  if (itHHH.second->getTH1()->GetBinError(bin) != 0 || itHHH.second->getTH1()->GetBinContent(bin) != 0) {
467  if (itHHH.first == "Lumibased BeamSpotHLT" || itHHH.first == "Lumibased BeamSpotLegacy" ||
468  itHHH.first == "Lumibased BeamSpotTransient") {
469  if (min > itHHH.second->getTH1()->GetBinContent(bin)) {
470  min = itHHH.second->getTH1()->GetBinContent(bin);
471  }
472  if (max < itHHH.second->getTH1()->GetBinContent(bin)) {
473  max = itHHH.second->getTH1()->GetBinContent(bin);
474  }
475  } else {
476  LogInfo("OnlineBeamMonitorClient") << "The histosMap_ have a histogram named " << itHHH.first
477  << " that I can't recognize in this loop!";
478  }
479  }
480  }
481  }
482  }
483  for (auto& itHHH : itHH.second) {
484  if (itHHH.second != nullptr) {
485  if (itHHH.first == "Lumibased BeamSpotHLT" || itHHH.first == "Lumibased BeamSpotLegacy" ||
486  itHHH.first == "Lumibased BeamSpotTransient") {
487  if ((max == -bigNumber && min == bigNumber) || max - min == 0) {
488  itHHH.second->getTH1()->SetMinimum(itHHH.second->getTH1()->GetMinimum() - 0.01);
489  itHHH.second->getTH1()->SetMaximum(itHHH.second->getTH1()->GetMaximum() + 0.01);
490  } else {
491  itHHH.second->getTH1()->SetMinimum(min - 0.1 * (max - min));
492  itHHH.second->getTH1()->SetMaximum(max + 0.1 * (max - min));
493  }
494  } else {
495  LogInfo("OnlineBeamMonitorClient")
496  << "The histosMap_ have a histogram named " << itHHH.first << " that I can't recognize in this loop!";
497  }
498  itHHH.second->getTH1()->GetXaxis()->SetRangeUser(firstLumi - 0.5, lastLumi + 0.5);
499  }
500  }
501  }
502  }
503  }
504 }
505 
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
BeamSpotContainer beamSpotsMap_
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
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_
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
std::shared_ptr< onlinebeammonitor::NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &iSetup) const override
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)