45 constexpr
int CEST(+2);
55 localTime = localtime(¤tTime);
56 int year = localTime->tm_year + 1900;
64 if (year >= 70 && year <= 137)
68 edm::LogError(
"BadTimeStamp") <<
"year reported is " << year <<
" !!" << std::endl;
73 "%4d-%02d-%02d %02d:%02d:%02d",
77 (ptm->tm_hour + CEST) % 24,
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]);
286 TString histTitle(coord[ic]);
290 bool createHisto =
true;
293 histName +=
"0_time";
294 xtitle =
"Time [UTC]";
296 histTitle +=
" coordinate of beam spot vs time (Fit)";
298 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs time (Fit)";
303 histName.Insert(0,
"PV");
305 histTitle.Insert(0,
"Avg. ");
306 histTitle +=
" position of primary vtx vs lumi";
307 xtitle =
"Lumisection";
308 ytitle.insert(0,
"PV");
309 ytitle +=
" #pm #sigma_{PV";
318 histName.Insert(0,
"PV");
320 histTitle.Insert(0,
"Avg. ");
321 histTitle +=
" position of primary vtx vs time";
322 xtitle =
"Time [UTC]";
323 ytitle.insert(0,
"PV");
324 ytitle +=
" #pm #sigma_{PV";
331 histName +=
"0_lumi";
332 xtitle =
"Lumisection";
334 histTitle +=
" coordinate of beam spot vs lumi (Fit)";
336 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs lumi (Fit)";
340 edm::LogInfo(
"BeamMonitor") <<
"hitsName = " << histName <<
"; histTitle = " << histTitle << std::endl;
341 auto tmpHs = iBooker.
book1D(histName, histTitle, 40, 0.5, 40.5);
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);
355 tmpHs = iBooker.
book1D(histName, histTitle, 40, 0.5, 40.5);
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;
671 if (beamMode == BSTRecord::BeamMode::STABLE)
676 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
680 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
690 refBS = *recoBeamSpotHandle;
695 auto tmphisto =
static_cast<TH1F*
>(
theBeamFitter->getCutFlow());
697 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
700 for (
int n = 0;
n < tmphisto->GetNbinsX();
n++)
710 for (reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end(); ++
track) {
717 bool JetTrigPass =
false;
720 for (
unsigned int i = 0;
i < triggerResults->size();
i++) {
731 size_t found = trigName.find(string_search);
733 if (found != string::npos) {
735 if (triggerResults->accept(thisTrigger_))
749 for (reco::VertexCollection::const_iterator
pv = PVCollection->begin();
pv != PVCollection->end(); ++
pv) {
751 if (
pv->isFake() ||
pv->tracksSize() == 0)
791 map<int, std::vector<float> >::iterator itpvx =
mapPVx.begin();
792 map<int, std::vector<float> >::iterator itpvy =
mapPVy.begin();
793 map<int, std::vector<float> >::iterator itpvz =
mapPVz.begin();
795 map<int, std::vector<int> >::iterator itbspvinfo =
mapNPV.begin();
812 edm::LogInfo(
"BeamMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi
818 const std::time_t fendtime = fendtimestamp >> 32;
837 int currentlumi = nextlumi;
838 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
839 lastlumi = currentlumi;
848 size_t SizeToRemovePV = rmLSPVi->second;
849 for (std::map<int, std::size_t>::iterator rmLSPVe =
mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
850 rmLSPVi->second -= SizeToRemovePV;
858 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of thePVvector After removing the PVs = "
862 bool resetHistoFlag_ =
false;
868 resetHistoFlag_ =
true;
872 int countEvtLastNLS_ = 0;
875 std::map<int, std::vector<int> >::iterator mnpv =
mapNPV.begin();
876 std::map<int, std::vector<float> >::iterator mpv2 =
mapPVy.begin();
877 std::map<int, std::vector<float> >::iterator mpv3 =
mapPVz.begin();
879 for (std::map<
int, std::vector<float> >::iterator mpv1 =
mapPVx.begin(); mpv1 !=
mapPVx.end();
880 ++mpv1, ++mpv2, ++mpv3, ++mnpv) {
881 std::vector<float>::iterator mpvs2 = (mpv2->second).
begin();
882 std::vector<float>::iterator mpvs3 = (mpv3->second).
begin();
883 for (std::vector<float>::iterator mpvs1 = (mpv1->second).begin(); mpvs1 != (mpv1->second).
end();
884 ++mpvs1, ++mpvs2, ++mpvs3) {
885 if (resetHistoFlag_) {
893 for (std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).
end(); ++mnpvs) {
894 if ((*mnpvs > 0) && (resetHistoFlag_))
897 countTotPV_ += (*mnpvs);
898 if ((*mnpvs) > MaxPVs)
904 char tmpTitlePV[100];
908 std::vector<float> DipPVInfo_;
911 if (countTotPV_ != 0) {
912 DipPVInfo_.push_back((
float)countEvtLastNLS_);
917 DipPVInfo_.push_back((
float)MaxPVs);
918 DipPVInfo_.push_back((
float)countTotPV_);
921 for (
size_t i = 0;
i < 7;
i++) {
923 DipPVInfo_.push_back(0.);
925 DipPVInfo_.push_back((
float)countEvtLastNLS_);
930 countEvtLastNLS_ = 0;
934 const int countLS_bs =
hs[k_x0_lumi]->getTH1()->GetEntries();
935 const int countLS_pv =
hs[k_PVx_lumi]->getTH1()->GetEntries();
936 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: countLS_bs = " << countLS_bs <<
" ; countLS_pv = " << countLS_pv
938 int LSgap_bs = currentlumi /
fitNLumi_ - countLS_bs;
939 int LSgap_pv = currentlumi /
fitPVNLumi_ - countLS_pv;
944 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: LSgap_bs = " << LSgap_bs <<
" ; LSgap_pv = " << LSgap_pv << std::endl;
946 for (
int ig = 0; ig < LSgap_bs; ig++) {
950 hs[k_sigmaX0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
951 hs[k_sigmaY0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
952 hs[k_sigmaZ0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
955 for (
int ig = 0; ig < LSgap_pv; ig++) {
961 for (
int i = 1;
i < (currentlumi - previousLS);
980 bool doPVFit =
false;
1002 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1003 double mean, width, meanErr, widthErr;
1004 fgaus->SetLineColor(4);
1006 mean = fgaus->GetParameter(1);
1007 width = fgaus->GetParameter(2);
1008 meanErr = fgaus->GetParError(1);
1009 widthErr = fgaus->GetParError(2);
1012 hs[k_PVx_lumi_all]->setBinContent(currentlumi, mean);
1013 hs[k_PVx_lumi_all]->setBinError(currentlumi, width);
1016 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Event time outside current range of time histograms!"
1019 hs[k_PVx_time]->setBinContent(nthBin, mean);
1020 hs[k_PVx_time]->setBinError(nthBin, width);
1024 hs[k_PVx_time_all]->setBinContent(jthBin, mean);
1025 hs[k_PVx_time_all]->setBinError(jthBin, width);
1036 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1043 mean = fgaus->GetParameter(1);
1044 width = fgaus->GetParameter(2);
1045 meanErr = fgaus->GetParError(1);
1046 widthErr = fgaus->GetParError(2);
1048 hs[k_PVy_lumi_all]->setBinContent(currentlumi, mean);
1049 hs[k_PVy_lumi_all]->setBinError(currentlumi, width);
1051 hs[k_PVy_time]->setBinContent(nthBin, mean);
1052 hs[k_PVy_time]->setBinError(nthBin, width);
1055 hs[k_PVy_time_all]->setBinContent(jthBin, mean);
1056 hs[k_PVy_time_all]->setBinError(jthBin, width);
1066 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1073 mean = fgaus->GetParameter(1);
1074 width = fgaus->GetParameter(2);
1075 meanErr = fgaus->GetParError(1);
1076 widthErr = fgaus->GetParError(2);
1078 hs[k_PVz_lumi_all]->setBinContent(currentlumi, mean);
1079 hs[k_PVz_lumi_all]->setBinError(currentlumi, width);
1081 hs[k_PVz_time]->setBinContent(nthBin, mean);
1082 hs[k_PVz_time]->setBinError(nthBin, width);
1085 hs[k_PVz_time_all]->setBinContent(jthBin, mean);
1086 hs[k_PVz_time_all]->setBinError(jthBin, width);
1096 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1110 vector<BSTrkParameters> theBSvector1 =
theBeamFitter->getBSvector();
1112 size_t PreviousRecords = 0;
1115 size_t SizeToRemove = 0;
1116 std::map<int, std::size_t>::iterator rmls =
mapLSBSTrkSize.begin();
1117 SizeToRemove = rmls->second;
1119 edm::LogInfo(
"BeamMonitor") <<
" The size to remove is = " << SizeToRemove << endl;
1120 int changedAfterThis = 0;
1122 ++rmLS, ++changedAfterThis) {
1123 if (changedAfterThis > 0) {
1124 (rmLS->second) = (rmLS->second) - SizeToRemove;
1126 PreviousRecords = (rmLS->second);
1135 std::pair<int, int> checkfitLS =
theBeamFitter->getFitLSRange();
1136 std::pair<time_t, time_t> checkfitTime =
theBeamFitter->getRefTime();
1142 vector<BSTrkParameters> theBSvector =
theBeamFitter->getBSvector();
1146 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1148 bool countFitting =
false;
1149 if (theBSvector.size() >= PreviousRecords && theBSvector.size() >=
min_Ntrks_) {
1150 countFitting =
true;
1156 const TH1F& cutFlowToSubtract =
mapLSCF.begin()->second;
1158 std::map<int, TH1F>::iterator cf =
mapLSCF.begin();
1160 for (; cf !=
mapLSCF.end(); ++cf) {
1161 cf->second.Add(&cutFlowToSubtract, -1);
1182 unsigned int itrk = 0;
1183 for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin(); BSTrk != theBSvector.end();
1187 double vx = BSTrk->vx();
1188 double vy = BSTrk->vy();
1189 double z0 = BSTrk->z0();
1221 <<
"; address = " << &
refBStime[0] << std::endl;
1223 <<
"; address = " << &
refBStime[1] << std::endl;
1232 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first <<
" to "
1233 << fitLS.second << std::endl;
1243 edm::LogInfo(
"BeamMonitor") <<
"\n RESULTS OF DEFAULT FIT:" << endl;
1245 edm::LogInfo(
"BeamMonitor") <<
"[BeamFitter] fitting done \n" << endl;
1253 hs[k_x0_lumi_all]->setBinContent(currentlumi, bs.
x0());
1254 hs[k_x0_lumi_all]->setBinError(currentlumi, bs.
x0Error());
1255 hs[k_y0_lumi_all]->setBinContent(currentlumi, bs.
y0());
1256 hs[k_y0_lumi_all]->setBinError(currentlumi, bs.
y0Error());
1257 hs[k_z0_lumi_all]->setBinContent(currentlumi, bs.
z0());
1258 hs[k_z0_lumi_all]->setBinError(currentlumi, bs.
z0Error());
1259 hs[k_sigmaX0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthX());
1261 hs[k_sigmaY0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthY());
1263 hs[k_sigmaZ0_lumi_all]->setBinContent(currentlumi, bs.
sigmaZ());
1264 hs[k_sigmaZ0_lumi_all]->setBinError(currentlumi, bs.
sigmaZ0Error());
1268 hs[k_x0_time]->setBinContent(nthBin, bs.
x0());
1269 hs[k_y0_time]->setBinContent(nthBin, bs.
y0());
1270 hs[k_z0_time]->setBinContent(nthBin, bs.
z0());
1271 hs[k_sigmaX0_time]->setBinContent(nthBin, bs.
BeamWidthX());
1272 hs[k_sigmaY0_time]->setBinContent(nthBin, bs.
BeamWidthY());
1273 hs[k_sigmaZ0_time]->setBinContent(nthBin, bs.
sigmaZ());
1274 hs[k_x0_time]->setBinError(nthBin, bs.
x0Error());
1275 hs[k_y0_time]->setBinError(nthBin, bs.
y0Error());
1276 hs[k_z0_time]->setBinError(nthBin, bs.
z0Error());
1284 hs[k_x0_time_all]->setBinContent(jthBin, bs.
x0());
1285 hs[k_y0_time_all]->setBinContent(jthBin, bs.
y0());
1286 hs[k_z0_time_all]->setBinContent(jthBin, bs.
z0());
1287 hs[k_sigmaX0_time_all]->setBinContent(jthBin, bs.
BeamWidthX());
1288 hs[k_sigmaY0_time_all]->setBinContent(jthBin, bs.
BeamWidthY());
1289 hs[k_sigmaZ0_time_all]->setBinContent(jthBin, bs.
sigmaZ());
1290 hs[k_x0_time_all]->setBinError(jthBin, bs.
x0Error());
1291 hs[k_y0_time_all]->setBinError(jthBin, bs.
y0Error());
1292 hs[k_z0_time_all]->setBinError(jthBin, bs.
z0Error());
1301 if (bs.
type() > 0) {
1309 double alpha = std::atan2(bs.
y0(), bs.
x0());
1310 std::unique_ptr<TF1>
f1{
new TF1(
"f1",
"[0]*sin(x-[1])", -3.14, 3.14)};
1311 f1->SetParameters(amp, alpha);
1312 f1->SetParLimits(0, amp - 0.1, amp + 0.1);
1313 f1->SetParLimits(1, alpha - 0.577, alpha + 0.577);
1314 f1->SetLineColor(4);
1318 double width = bs.
sigmaZ();
1319 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1320 fgaus->SetParameters(mean, width);
1321 fgaus->SetLineColor(4);
1322 h_trk_z0->
getTH1()->Fit(fgaus.get(),
"QLRM",
"", mean - 3 * width, mean + 3 * width);
1326 std::pair<int, int> LSRange =
theBeamFitter->getFitLSRange();
1328 sprintf(tmpTitle,
"%s %i %s %i",
"Fitted Beam Spot (cm) of LS: ", LSRange.first,
" to ", LSRange.second);
1336 if (bs.
type() > 0) {
1350 if (bs.
type() > 0) {
1386 for (
int i = 0;
i < 7; ++
i) {
1387 for (
int j = 0;
j < 7; ++
j) {
1404 std::pair<time_t, time_t> timeForDIP =
theBeamFitter->getRefTime();
1413 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline object created: \n" << std::endl;
1419 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] onlineDbService available \n" << std::endl;
1424 <<
"BeamMonitor::FitAndFill - [BeamFitter] Do BeamSpot Fit for LS = " << LSRange.first <<
" to "
1427 <<
"BeamMonitor::FitAndFill - [BeamMonitor] Do BeamSpot Fit for LS = " <<
beginLumiOfBSFit_ <<
" to "
1432 <<
"BeamMonitor::FitAndFill - [PayloadCreation] BeamSpotOnline object created:";
1447 <<
"BeamMonitor::FitAndFill - [PayloadCreation] SetCreationTime: " <<
creationTime
1448 <<
" [epoch in microseconds]";
1452 <<
"BeamMonitor::FitAndFill - [PayloadCreation] writeIOVForNextLumisection executed correctly";
1455 <<
" for Run: " <<
frun <<
" - Lumi: " << LSRange.second;
1462 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline payload created \n" << std::endl;
1467 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1468 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1494 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1495 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1537 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: The flag is ON for running average Beam Spot fit" << endl;
1551 <<
" RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" << endl;
1588 edm::LogInfo(
"BeamMonitor") <<
"dqmEndRun:: Clearing all the Maps " << endl;
1608 char offsetTime[64];
1610 TDatime
da(offsetTime);
1613 double valErr = h->GetBinError(
lastNZbin);
1615 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1617 h->SetBinContent(bin, val);
1618 h->SetBinError(bin, valErr);
1621 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1628 bool scroll_ =
false;
1631 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Reset Time Offset" << std::endl;
1634 if (
hs[k_x0_time]->getBinContent(
bin) > 0) {
1641 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Time difference too large since last readout" << std::endl;
1645 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Offset to last record" << std::endl;
LuminosityBlockID id() const
void setBeamWidthYError(double val)
set beam width Y error
BeamMonitor(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
double z0() const
z coordinate
std::unique_ptr< BeamFitter > theBeamFitter
T getUntrackedParameter(std::string const &, T const &) const
unsigned int minNrVertices_
void setCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
double sigmaZ0Error() const
error on sigma z
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
const BSTRecord & getBST() const
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_
void setLastAnalyzedLumi(int val)
Setters Methods.
void setEmittanceY(double val)
set emittance
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * cutFlowTable
double dydzError() const
error on dydz
MonitorElement * h_PVz[2]
bool testScroll(std::time_t &, std::time_t &)
virtual void setOption(const char *option)
#define DEFINE_FWK_MODULE(type)
std::map< int, std::vector< float > > mapPVx
void analyze(const edm::Event &e, const edm::EventSetup &c) override
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)
unsigned int triggerIndex(std::string_view name) const
edm::TimeValue_t ftimestamp
edm::LuminosityBlockNumber_t luminosityBlock() const
std::string to_string(const V &value)
void setEndTimeStamp(cond::Time_t val)
auto const & tracks
cannot be loose
std::vector< MonitorElement * > hs
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
Timestamp const & beginTime() const
MonitorElement * h_sigmaZ0
MonitorElement * h_nTrk_lumi
std::map< int, std::size_t > mapLSBSTrkSize
Log< level::Error, false > LogError
uint16_t const getBeamMode() 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)
double emittanceX() const
additional information
std::map< int, std::vector< float > > mapPVz
std::map< int, std::time_t > mapBeginPVTime
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
std::map< int, std::vector< int > > mapNPV
LuminosityBlockNumber_t luminosityBlock() 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)
float meanErrorPV() const
std::map< int, std::time_t > mapBeginBSTime
double dydz() const
dydz slope
void setLastAnalyzedRun(int val)
void setEmittanceX(double val)
set emittance
void setMeanPV(float val)
cond::Time_t startTimeStamp() const
double emittanceY() const
EchoedLogStream< edm::LogError > logError()
void setLastAnalyzedFill(int val)
double dxdzError() const
error on dxdz
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.
std::string startTime() const
Timestamp const & endTime() const
void formatFitTime(char *, const std::time_t &)
void setdydz(double val)
set dydz slope, crossing angle in XZ
MonitorElement * pvResults
MonitorElement * h_nVtx_lumi
bool get(ProductID const &oid, Handle< PROD > &result) const
double BeamWidthX() const
beam width X
cond::Time_t endTimeStamp() const
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
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)
double BeamWidthXError() const
error on beam width X, assume error in X = Y
double z0Error() const
error on z
unsigned long long TimeValue_t
virtual TProfile * getTProfile()
void setdxdz(double val)
set dxdz slope, crossing angle
double dxdz() const
dxdz slope
std::map< int, TH1F > mapLSCF
double x0Error() const
error on x
double y0Error() const
error on y
MonitorElement * h_nVtx_lumi_all
Log< level::Info, false > LogInfo
static const char *const trigNames[]
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Float_t summaryContent_[3]
MonitorElement * h_sigmaX0
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
MonitorElement * h_nVtx_st
T const * product() const
MonitorElement * h_PVy[2]
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
std::string const & triggerName(unsigned int index) const
void setBeamWidthXError(double val)
set beam width X error
virtual double getMeanError(int axis=1) const
MonitorElement * reportSummaryContents[3]
void setSigmaZ(double val)
set sigma Z, RMS bunch length
double sigmaZ() const
sigma z
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
T getParameter(std::string const &) const
double BeamWidthY() const
beam width Y
void setLumiRange(std::string val)
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * h_trk_z0
std::map< int, int > mapBeginBSLS
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
Timestamp const & beginTime() const
double covariance(int i, int j) const
(i,j)-th element of error matrix
virtual double getRMSError(int axis=1) const
get RMS uncertainty 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
double y0() const
y coordinate
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.
void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override
MonitorElement * h_PVx[2]
std::map< int, int > mapBeginPVLS
std::string endTime() const
TimeValue_t value() 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)
BeamType type() const
return beam type
MonitorElement * reportSummaryMap
double x0() const
x coordinate
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)
Run const & getRun() const