45 constexpr
int CEST(+2);
55 localTime = localtime(¤tTime);
56 int year = localTime->tm_year + 1900;
68 edm::LogError(
"BadTimeStamp") <<
"year reported is " <<
year <<
" !!" << std::endl;
73 "%4d-%02d-%02d %02d:%02d:%02d",
81 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE 82 unsigned int b = strlen(ts);
83 while (ts[--
b] ==
' ') {
93 std::strftime(buff,
sizeof(buff),
"%Y.%m.%d %H:%M:%S GMT", gmtime(&timeToConvert));
102 : dxBin_(ps.getParameter<
int>(
"dxBin")),
103 dxMin_(ps.getParameter<double>(
"dxMin")),
104 dxMax_(ps.getParameter<double>(
"dxMax")),
106 vxBin_(ps.getParameter<
int>(
"vxBin")),
107 vxMin_(ps.getParameter<double>(
"vxMin")),
108 vxMax_(ps.getParameter<double>(
"vxMax")),
110 phiBin_(ps.getParameter<
int>(
"phiBin")),
111 phiMin_(ps.getParameter<double>(
"phiMin")),
112 phiMax_(ps.getParameter<double>(
"phiMax")),
114 dzBin_(ps.getParameter<
int>(
"dzBin")),
115 dzMin_(ps.getParameter<double>(
"dzMin")),
116 dzMax_(ps.getParameter<double>(
"dzMax")),
123 StartAverage_(
false),
127 loggerActive_(
false) {
232 edm::LogInfo(
"BeamMonitor") <<
"TimeOffset = " << eventTime << std::endl;
233 TDatime
da(eventTime);
238 auto daTime =
da.Convert(kTRUE);
245 h_nTrk_lumi = iBooker.
book1D(
"nTrk_lumi",
"Num. of selected tracks vs lumi (Fit)", 20, 0.5, 20.5);
250 h_nVtx_lumi = iBooker.
book1D(
"nVtx_lumi",
"Num. of selected Vtx vs lumi (Fit)", 20, 0.5, 20.5);
254 h_nVtx_lumi_all = iBooker.
book1D(
"nVtx_lumi_all",
"Num. of selected Vtx vs lumi (Fit) all", 20, 0.5, 20.5);
272 TDatime*
da =
new TDatime();
273 gStyle->SetTimeOffset(
da->Convert(kTRUE));
277 string coord[nvar_] = {
"x",
"y",
"z",
"sigmaX",
"sigmaY",
"sigmaZ"};
278 string label[nvar_] = {
279 "x_{0} (cm)",
"y_{0} (cm)",
"z_{0} (cm)",
"#sigma_{X_{0}} (cm)",
"#sigma_{Y_{0}} (cm)",
"#sigma_{Z_{0}} (cm)"};
281 hs.reserve(kNumHists);
282 for (
int i = 0;
i < 4;
i++) {
284 for (
int ic = 0; ic < nvar_; ++ic) {
285 TString histName(coord[ic]);
290 bool createHisto =
true;
293 histName +=
"0_time";
296 histTitle +=
" coordinate of beam spot vs time (Fit)";
303 histName.Insert(0,
"PV");
306 histTitle +=
" position of primary vtx vs lumi";
309 ytitle +=
" #pm #sigma_{PV";
318 histName.Insert(0,
"PV");
321 histTitle +=
" position of primary vtx vs time";
324 ytitle +=
" #pm #sigma_{PV";
331 histName +=
"0_lumi";
334 histTitle +=
" coordinate of beam spot vs lumi (Fit)";
340 edm::LogInfo(
"BeamMonitor") <<
"hitsName = " << histName <<
"; histTitle = " <<
histTitle << std::endl;
343 tmpHs->setAxisTitle(
xtitle, 1);
344 tmpHs->setAxisTitle(
ytitle, 2);
345 tmpHs->getTH1()->SetOption(
"E1");
346 if (histName.Contains(
"time")) {
349 tmpHs->setAxisTimeDisplay(1);
350 tmpHs->setAxisTimeFormat(
"%H:%M:%S", 1);
351 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
357 tmpHs->getTH1()->SetCanExtend(TH1::kAllAxes);
358 tmpHs->setAxisTitle(
xtitle, 1);
359 tmpHs->setAxisTitle(
ytitle, 2);
360 tmpHs->getTH1()->SetOption(
"E1");
361 if (histName.Contains(
"time")) {
364 tmpHs->setAxisTimeDisplay(1);
365 tmpHs->setAxisTimeFormat(
"%H:%M:%S", 1);
366 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
372 assert(0 == strcmp(
hs[k_sigmaY0_time]->getTH1()->GetName(),
"sigmaY0_time"));
373 assert(0 == strcmp(
hs[k_PVz_lumi_all]->getTH1()->GetName(),
"PVz_lumi_all"));
390 h_x0 = iBooker.
book1D(
"BeamMonitorFeedBack_x0",
"x coordinate of beam spot (Fit)", 100, -0.01, 0.01);
394 h_y0 = iBooker.
book1D(
"BeamMonitorFeedBack_y0",
"y coordinate of beam spot (Fit)", 100, -0.01, 0.01);
402 h_sigmaX0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaX0",
"sigma x0 of beam spot (Fit)", 100, 0, 0.05);
406 h_sigmaY0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaY0",
"sigma y0 of beam spot (Fit)", 100, 0, 0.05);
410 h_sigmaZ0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaZ0",
"sigma z0 of beam spot (Fit)", 100, 0, 10);
415 h_trkPt = iBooker.
book1D(
"trkPt",
"p_{T} of all reco'd tracks (no selection)", 200, 0., 50.);
421 cutFlowTable = iBooker.
book1D(
"cutFlowTable",
"Cut flow table of track selection", 9, 0, 9);
424 fitResults = iBooker.
book2D(
"fitResults",
"Results of previous good beam fit", 2, 0, 2, 8, 0, 8);
441 h_nVtx = iBooker.
book1D(
"vtxNbr",
"Reconstructed Vertices(non-fake) in all Event", 60, -0.5, 59.5);
445 h_nVtx_st = iBooker.
book1D(
"vtxNbr_SelectedTriggers",
"Reconstructed Vertices(non-fake) in Events", 60, -0.5, 59.5);
449 h_PVx[0] = iBooker.
book1D(
"PVX",
"x coordinate of Primary Vtx", 50, -0.01, 0.01);
453 h_PVy[0] = iBooker.
book1D(
"PVY",
"y coordinate of Primary Vtx", 50, -0.01, 0.01);
460 h_PVx[1] = iBooker.
book1D(
"PVXFit",
"x coordinate of Primary Vtx (Last Fit)", 50, -0.01, 0.01);
464 h_PVy[1] = iBooker.
book1D(
"PVYFit",
"y coordinate of Primary Vtx (Last Fit)", 50, -0.01, 0.01);
480 pvResults = iBooker.
book2D(
"pvResults",
"Results of fitting Primary Vertices", 2, 0, 2, 6, 0, 6);
504 sprintf(
histo,
"x0_status");
507 sprintf(
histo,
"y0_status");
510 sprintf(
histo,
"z0_status");
549 const std::time_t ftmptime = fbegintimestamp >> 32;
593 map<int, std::time_t>::iterator itbstime =
mapBeginBSTime.begin();
594 map<int, std::time_t>::iterator itpvtime =
mapBeginPVTime.begin();
664 edm::LogInfo(
"BeamMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
673 if (
beamMode == BSTRecord::BeamMode::NOMODE)
674 edm::LogError(
"BeamMonitor") <<
"No BeamMode identified from BSTRecord!" 675 "Please check that the event content has the raw data from TCDS FEDs (1024,1025)!";
678 if (
beamMode == BSTRecord::BeamMode::STABLE)
681 const int nthlumi =
iEvent.luminosityBlock();
683 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
687 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
697 refBS = *recoBeamSpotHandle;
702 auto tmphisto =
static_cast<TH1F*
>(
theBeamFitter->getCutFlow());
704 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
707 for (
int n = 0;
n < tmphisto->GetNbinsX();
n++)
724 bool JetTrigPass =
false;
740 if (
found != string::npos) {
758 if (
pv->isFake() ||
pv->tracksSize() == 0)
798 map<int, std::vector<float> >::iterator itpvx =
mapPVx.begin();
799 map<int, std::vector<float> >::iterator itpvy =
mapPVy.begin();
800 map<int, std::vector<float> >::iterator itpvz =
mapPVz.begin();
802 map<int, std::vector<int> >::iterator itbspvinfo =
mapNPV.begin();
819 edm::LogInfo(
"BeamMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi
825 const std::time_t fendtime = fendtimestamp >> 32;
844 int currentlumi = nextlumi;
845 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
846 lastlumi = currentlumi;
855 size_t SizeToRemovePV = rmLSPVi->second;
856 for (std::map<int, std::size_t>::iterator rmLSPVe =
mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
857 rmLSPVi->second -= SizeToRemovePV;
865 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of thePVvector After removing the PVs = " 869 bool resetHistoFlag_ =
false;
875 resetHistoFlag_ =
true;
879 int countEvtLastNLS_ = 0;
882 std::map<int, std::vector<int> >::iterator mnpv =
mapNPV.begin();
883 std::map<int, std::vector<float> >::iterator mpv2 =
mapPVy.begin();
884 std::map<int, std::vector<float> >::iterator mpv3 =
mapPVz.begin();
887 ++mpv1, ++mpv2, ++mpv3, ++mnpv) {
888 std::vector<float>::iterator mpvs2 = (mpv2->second).begin();
889 std::vector<float>::iterator mpvs3 = (mpv3->second).begin();
890 for (std::vector<float>::iterator mpvs1 = (mpv1->second).begin(); mpvs1 != (mpv1->second).
end();
891 ++mpvs1, ++mpvs2, ++mpvs3) {
892 if (resetHistoFlag_) {
900 for (std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).
end(); ++mnpvs) {
901 if ((*mnpvs > 0) && (resetHistoFlag_))
904 countTotPV_ += (*mnpvs);
905 if ((*mnpvs) > MaxPVs)
911 char tmpTitlePV[100];
915 std::vector<float> DipPVInfo_;
918 if (countTotPV_ != 0) {
919 DipPVInfo_.push_back((
float)countEvtLastNLS_);
924 DipPVInfo_.push_back((
float)MaxPVs);
925 DipPVInfo_.push_back((
float)countTotPV_);
928 for (
size_t i = 0;
i < 7;
i++) {
930 DipPVInfo_.push_back(0.);
932 DipPVInfo_.push_back((
float)countEvtLastNLS_);
937 countEvtLastNLS_ = 0;
941 const int countLS_bs =
hs[k_x0_lumi]->getTH1()->GetEntries();
942 const int countLS_pv =
hs[k_PVx_lumi]->getTH1()->GetEntries();
943 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: countLS_bs = " << countLS_bs <<
" ; countLS_pv = " << countLS_pv
945 int LSgap_bs = currentlumi /
fitNLumi_ - countLS_bs;
946 int LSgap_pv = currentlumi /
fitPVNLumi_ - countLS_pv;
951 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: LSgap_bs = " << LSgap_bs <<
" ; LSgap_pv = " << LSgap_pv << std::endl;
953 for (
int ig = 0; ig < LSgap_bs; ig++) {
957 hs[k_sigmaX0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
958 hs[k_sigmaY0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
959 hs[k_sigmaZ0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
962 for (
int ig = 0; ig < LSgap_pv; ig++) {
968 for (
int i = 1;
i < (currentlumi - previousLS);
987 bool doPVFit =
false;
1009 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1011 fgaus->SetLineColor(4);
1013 mean = fgaus->GetParameter(1);
1014 width = fgaus->GetParameter(2);
1015 meanErr = fgaus->GetParError(1);
1016 widthErr = fgaus->GetParError(2);
1019 hs[k_PVx_lumi_all]->setBinContent(currentlumi,
mean);
1020 hs[k_PVx_lumi_all]->setBinError(currentlumi,
width);
1023 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Event time outside current range of time histograms!" 1026 hs[k_PVx_time]->setBinContent(nthBin,
mean);
1027 hs[k_PVx_time]->setBinError(nthBin,
width);
1031 hs[k_PVx_time_all]->setBinContent(jthBin,
mean);
1032 hs[k_PVx_time_all]->setBinError(jthBin,
width);
1043 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1050 mean = fgaus->GetParameter(1);
1051 width = fgaus->GetParameter(2);
1052 meanErr = fgaus->GetParError(1);
1053 widthErr = fgaus->GetParError(2);
1055 hs[k_PVy_lumi_all]->setBinContent(currentlumi,
mean);
1056 hs[k_PVy_lumi_all]->setBinError(currentlumi,
width);
1058 hs[k_PVy_time]->setBinContent(nthBin,
mean);
1059 hs[k_PVy_time]->setBinError(nthBin,
width);
1062 hs[k_PVy_time_all]->setBinContent(jthBin,
mean);
1063 hs[k_PVy_time_all]->setBinError(jthBin,
width);
1073 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1080 mean = fgaus->GetParameter(1);
1081 width = fgaus->GetParameter(2);
1082 meanErr = fgaus->GetParError(1);
1083 widthErr = fgaus->GetParError(2);
1085 hs[k_PVz_lumi_all]->setBinContent(currentlumi,
mean);
1086 hs[k_PVz_lumi_all]->setBinError(currentlumi,
width);
1088 hs[k_PVz_time]->setBinContent(nthBin,
mean);
1089 hs[k_PVz_time]->setBinError(nthBin,
width);
1092 hs[k_PVz_time_all]->setBinContent(jthBin,
mean);
1093 hs[k_PVz_time_all]->setBinError(jthBin,
width);
1103 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1117 vector<BSTrkParameters> theBSvector1 =
theBeamFitter->getBSvector();
1119 size_t PreviousRecords = 0;
1122 size_t SizeToRemove = 0;
1123 std::map<int, std::size_t>::iterator rmls =
mapLSBSTrkSize.begin();
1124 SizeToRemove = rmls->second;
1126 edm::LogInfo(
"BeamMonitor") <<
" The size to remove is = " << SizeToRemove << endl;
1127 int changedAfterThis = 0;
1129 ++rmLS, ++changedAfterThis) {
1130 if (changedAfterThis > 0) {
1131 (rmLS->second) = (rmLS->second) - SizeToRemove;
1133 PreviousRecords = (rmLS->second);
1142 std::pair<int, int> checkfitLS =
theBeamFitter->getFitLSRange();
1143 std::pair<time_t, time_t> checkfitTime =
theBeamFitter->getRefTime();
1149 vector<BSTrkParameters> theBSvector =
theBeamFitter->getBSvector();
1153 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1155 bool countFitting =
false;
1156 if (theBSvector.size() >= PreviousRecords && theBSvector.size() >=
min_Ntrks_) {
1157 countFitting =
true;
1163 const TH1F& cutFlowToSubtract =
mapLSCF.begin()->second;
1165 std::map<int, TH1F>::iterator cf =
mapLSCF.begin();
1167 for (; cf !=
mapLSCF.end(); ++cf) {
1168 cf->second.Add(&cutFlowToSubtract, -1);
1189 unsigned int itrk = 0;
1190 for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin(); BSTrk != theBSvector.end();
1194 double vx = BSTrk->vx();
1195 double vy = BSTrk->vy();
1196 double z0 = BSTrk->z0();
1228 <<
"; address = " << &
refBStime[0] << std::endl;
1230 <<
"; address = " << &
refBStime[1] << std::endl;
1239 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first <<
" to " 1240 << fitLS.second << std::endl;
1250 edm::LogInfo(
"BeamMonitor") <<
"\n RESULTS OF DEFAULT FIT:" << endl;
1252 edm::LogInfo(
"BeamMonitor") <<
"[BeamFitter] fitting done \n" << endl;
1257 hs[k_sigmaX0_lumi]->ShiftFillLast(
bs.BeamWidthX(),
bs.BeamWidthXError(),
fitNLumi_);
1258 hs[k_sigmaY0_lumi]->ShiftFillLast(
bs.BeamWidthY(),
bs.BeamWidthYError(),
fitNLumi_);
1259 hs[k_sigmaZ0_lumi]->ShiftFillLast(
bs.sigmaZ(),
bs.sigmaZ0Error(),
fitNLumi_);
1260 hs[k_x0_lumi_all]->setBinContent(currentlumi,
bs.x0());
1261 hs[k_x0_lumi_all]->setBinError(currentlumi,
bs.x0Error());
1262 hs[k_y0_lumi_all]->setBinContent(currentlumi,
bs.y0());
1263 hs[k_y0_lumi_all]->setBinError(currentlumi,
bs.y0Error());
1264 hs[k_z0_lumi_all]->setBinContent(currentlumi,
bs.z0());
1265 hs[k_z0_lumi_all]->setBinError(currentlumi,
bs.z0Error());
1266 hs[k_sigmaX0_lumi_all]->setBinContent(currentlumi,
bs.BeamWidthX());
1267 hs[k_sigmaX0_lumi_all]->setBinError(currentlumi,
bs.BeamWidthXError());
1268 hs[k_sigmaY0_lumi_all]->setBinContent(currentlumi,
bs.BeamWidthY());
1269 hs[k_sigmaY0_lumi_all]->setBinError(currentlumi,
bs.BeamWidthYError());
1270 hs[k_sigmaZ0_lumi_all]->setBinContent(currentlumi,
bs.sigmaZ());
1271 hs[k_sigmaZ0_lumi_all]->setBinError(currentlumi,
bs.sigmaZ0Error());
1275 hs[k_x0_time]->setBinContent(nthBin,
bs.x0());
1276 hs[k_y0_time]->setBinContent(nthBin,
bs.y0());
1277 hs[k_z0_time]->setBinContent(nthBin,
bs.z0());
1278 hs[k_sigmaX0_time]->setBinContent(nthBin,
bs.BeamWidthX());
1279 hs[k_sigmaY0_time]->setBinContent(nthBin,
bs.BeamWidthY());
1280 hs[k_sigmaZ0_time]->setBinContent(nthBin,
bs.sigmaZ());
1281 hs[k_x0_time]->setBinError(nthBin,
bs.x0Error());
1282 hs[k_y0_time]->setBinError(nthBin,
bs.y0Error());
1283 hs[k_z0_time]->setBinError(nthBin,
bs.z0Error());
1284 hs[k_sigmaX0_time]->setBinError(nthBin,
bs.BeamWidthXError());
1285 hs[k_sigmaY0_time]->setBinError(nthBin,
bs.BeamWidthYError());
1286 hs[k_sigmaZ0_time]->setBinError(nthBin,
bs.sigmaZ0Error());
1291 hs[k_x0_time_all]->setBinContent(jthBin,
bs.x0());
1292 hs[k_y0_time_all]->setBinContent(jthBin,
bs.y0());
1293 hs[k_z0_time_all]->setBinContent(jthBin,
bs.z0());
1294 hs[k_sigmaX0_time_all]->setBinContent(jthBin,
bs.BeamWidthX());
1295 hs[k_sigmaY0_time_all]->setBinContent(jthBin,
bs.BeamWidthY());
1296 hs[k_sigmaZ0_time_all]->setBinContent(jthBin,
bs.sigmaZ());
1297 hs[k_x0_time_all]->setBinError(jthBin,
bs.x0Error());
1298 hs[k_y0_time_all]->setBinError(jthBin,
bs.y0Error());
1299 hs[k_z0_time_all]->setBinError(jthBin,
bs.z0Error());
1300 hs[k_sigmaX0_time_all]->setBinError(jthBin,
bs.BeamWidthXError());
1301 hs[k_sigmaY0_time_all]->setBinError(jthBin,
bs.BeamWidthYError());
1302 hs[k_sigmaZ0_time_all]->setBinError(jthBin,
bs.sigmaZ0Error());
1308 if (
bs.type() > 0) {
1316 double alpha = std::atan2(
bs.y0(),
bs.x0());
1317 std::unique_ptr<TF1>
f1{
new TF1(
"f1",
"[0]*sin(x-[1])", -3.14, 3.14)};
1318 f1->SetParameters(amp,
alpha);
1319 f1->SetParLimits(0, amp - 0.1, amp + 0.1);
1321 f1->SetLineColor(4);
1326 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1328 fgaus->SetLineColor(4);
1333 std::pair<int, int> LSRange =
theBeamFitter->getFitLSRange();
1335 sprintf(tmpTitle,
"%s %i %s %i",
"Fitted Beam Spot (cm) of LS: ", LSRange.first,
" to ", LSRange.second);
1343 if (
bs.type() > 0) {
1357 if (
bs.type() > 0) {
1393 for (
int i = 0;
i < 7; ++
i) {
1394 for (
int j = 0;
j < 7; ++
j) {
1411 std::pair<time_t, time_t> timeForDIP =
theBeamFitter->getRefTime();
1420 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline object created: \n" << std::endl;
1426 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] onlineDbService available \n" << std::endl;
1431 <<
"BeamMonitor::FitAndFill - [BeamFitter] Do BeamSpot Fit for LS = " << LSRange.first <<
" to " 1434 <<
"BeamMonitor::FitAndFill - [BeamMonitor] Do BeamSpot Fit for LS = " <<
beginLumiOfBSFit_ <<
" to " 1439 <<
"BeamMonitor::FitAndFill - [PayloadCreation] BeamSpotOnline object created:";
1454 <<
"BeamMonitor::FitAndFill - [PayloadCreation] SetCreationTime: " <<
creationTime 1455 <<
" [epoch in microseconds]";
1459 <<
"BeamMonitor::FitAndFill - [PayloadCreation] writeIOVForNextLumisection executed correctly";
1462 <<
" for Run: " <<
frun <<
" - Lumi: " << LSRange.second;
1469 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline payload created \n" << std::endl;
1474 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1475 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1485 hs[k_sigmaX0_lumi]->ShiftFillLast(
bs.BeamWidthX(),
bs.BeamWidthXError(),
fitNLumi_);
1486 hs[k_sigmaY0_lumi]->ShiftFillLast(
bs.BeamWidthY(),
bs.BeamWidthYError(),
fitNLumi_);
1487 hs[k_sigmaZ0_lumi]->ShiftFillLast(
bs.sigmaZ(),
bs.sigmaZ0Error(),
fitNLumi_);
1501 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1502 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1512 hs[k_sigmaX0_lumi]->ShiftFillLast(
bs.BeamWidthX(),
bs.BeamWidthXError(),
fitNLumi_);
1513 hs[k_sigmaY0_lumi]->ShiftFillLast(
bs.BeamWidthY(),
bs.BeamWidthYError(),
fitNLumi_);
1514 hs[k_sigmaZ0_lumi]->ShiftFillLast(
bs.sigmaZ(),
bs.sigmaZ0Error(),
fitNLumi_);
1544 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: The flag is ON for running average Beam Spot fit" << endl;
1558 <<
" RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" << endl;
1595 edm::LogInfo(
"BeamMonitor") <<
"dqmEndRun:: Clearing all the Maps " << endl;
1615 char offsetTime[64];
1617 TDatime
da(offsetTime);
1622 h->GetXaxis()->SetTimeOffset(
da.Convert(kTRUE));
1625 h->SetBinError(
bin, valErr);
1628 h->GetXaxis()->SetTimeOffset(
da.Convert(kTRUE));
1635 bool scroll_ =
false;
1638 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Reset Time Offset" << std::endl;
1641 if (
hs[k_x0_time]->getBinContent(
bin) > 0) {
1648 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Time difference too large since last readout" << std::endl;
1652 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Offset to last record" << std::endl;
double BeamWidthX() const
beam width X
void setBeamWidthYError(double val)
set beam width Y error
BeamMonitor(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
std::unique_ptr< BeamFitter > theBeamFitter
LuminosityBlockNumber_t luminosityBlock() const
unsigned int minNrVertices_
T getParameter(std::string const &) const
void setCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
void setStartTimeStamp(cond::Time_t val)
MonitorElement * reportSummary
void bookHistograms(DQMStore::IBooker &i, const edm::Run &r, const edm::EventSetup &c) override
edm::EDGetTokenT< TCDSRecord > tcdsToken_
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
void setLastAnalyzedLumi(int val)
Setters Methods.
void setEmittanceY(double val)
set emittance
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * cutFlowTable
MonitorElement * h_PVz[2]
bool testScroll(std::time_t &, std::time_t &)
Run const & getRun() const
virtual void setOption(const char *option)
std::map< int, std::vector< float > > mapPVx
void analyze(const edm::Event &e, const edm::EventSetup &c) override
virtual double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
void setMeanErrorPV(float val)
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
void setBetaStar(double val)
set beta star
std::vector< Track > TrackCollection
collection of Tracks
void setUsedEvents(int val)
edm::TimeValue_t ftimestamp
std::string to_string(const V &value)
std::string endTime() const
void setEndTimeStamp(cond::Time_t val)
std::vector< MonitorElement * > hs
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
MonitorElement * h_sigmaZ0
MonitorElement * h_nTrk_lumi
std::map< int, std::size_t > mapLSBSTrkSize
Log< level::Error, false > LogError
std::string startTime() const
MonitorElement * fitResults
std::vector< std::string > jetTrigger_
MonitorElement * h_sigmaY0
void setType(int type)
set beam type
Class to contain information from TCDS FED.
void setEndTime(std::string val)
std::map< int, std::vector< float > > mapPVz
std::map< int, std::time_t > mapBeginPVTime
std::map< int, std::vector< int > > mapNPV
T getUntrackedParameter(std::string const &, T const &) const
void setNumTracks(int val)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
DQM_DEPRECATED void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
std::map< int, std::time_t > mapBeginBSTime
void setLastAnalyzedRun(int val)
void setEmittanceX(double val)
set emittance
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
float meanErrorPV() const
void setMeanPV(float val)
EchoedLogStream< edm::LogError > logError()
void setLastAnalyzedFill(int val)
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
std::string getGMTstring(const std::time_t &)
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())
cond::persistency::Logger & logger()
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void formatFitTime(char *, const std::time_t &)
void setdydz(double val)
set dydz slope, crossing angle in XZ
MonitorElement * pvResults
cond::Time_t endTimeStamp() const
MonitorElement * h_nVtx_lumi
double BeamWidthY() const
beam width Y
#define DEFINE_FWK_MODULE(type)
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static std::string const triggerResults
void setRmsErrorPV(float val)
static constexpr int buffTime
cond::Time_t writeIOVForNextLumisection(const PayloadType &payload, const std::string &recordName)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
unsigned long long TimeValue_t
virtual TProfile * getTProfile()
void setdxdz(double val)
set dxdz slope, crossing angle
std::map< int, TH1F > mapLSCF
const BSTRecord & getBST() const
MonitorElement * h_nVtx_lumi_all
double BeamWidthXError() const
error on beam width X, assume error in X = Y
uint16_t const getBeamMode() const
Log< level::Info, false > LogInfo
static const char *const trigNames[]
cond::Time_t startTimeStamp() const
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Float_t summaryContent_[3]
MonitorElement * h_sigmaX0
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
MonitorElement * h_nVtx_st
MonitorElement * h_PVy[2]
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
LuminosityBlockID id() const
TimeValue_t value() const
Timestamp const & beginTime() const
void setBeamWidthXError(double val)
set beam width X error
Timestamp const & endTime() const
MonitorElement * reportSummaryContents[3]
void setSigmaZ(double val)
set sigma Z, RMS bunch length
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void setLumiRange(std::string val)
MonitorElement * h_trk_z0
std::map< int, int > mapBeginBSLS
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
Timestamp const & beginTime() const
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void setStartTime(std::string val)
void setPosition(double x, double y, double z)
set XYZ position
void setBeamWidthX(double val)
set average transverse beam width X
void setCreationTime(cond::Time_t val)
edm::Service< cond::service::OnlineDBOutputService > onlineDbService_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
EchoedLogStream< edm::LogInfo > logInfo()
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
LuminosityBlockNumber_t luminosityBlock() const
void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override
MonitorElement * h_PVx[2]
std::map< int, int > mapBeginPVLS
virtual double getMeanError(int axis=1) const
std::map< int, std::vector< float > > mapPVy
MonitorElement * h_d0_phi0
void setBeamWidthY(double val)
set average transverse beam width Y
void scrollTH1(TH1 *, std::time_t)
MonitorElement * reportSummaryMap
std::map< int, size_t > mapLSPVStoreSize
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)