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),
231 edm::LogInfo(
"BeamMonitor") <<
"TimeOffset = " << eventTime << std::endl;
232 TDatime
da(eventTime);
237 auto daTime = da.Convert(kTRUE);
244 h_nTrk_lumi = iBooker.
book1D(
"nTrk_lumi",
"Num. of selected tracks vs lumi (Fit)", 20, 0.5, 20.5);
249 h_nVtx_lumi = iBooker.
book1D(
"nVtx_lumi",
"Num. of selected Vtx vs lumi (Fit)", 20, 0.5, 20.5);
253 h_nVtx_lumi_all = iBooker.
book1D(
"nVtx_lumi_all",
"Num. of selected Vtx vs lumi (Fit) all", 20, 0.5, 20.5);
271 TDatime* da =
new TDatime();
272 gStyle->SetTimeOffset(da->Convert(kTRUE));
276 string coord[nvar_] = {
"x",
"y",
"z",
"sigmaX",
"sigmaY",
"sigmaZ"};
277 string label[nvar_] = {
278 "x_{0} (cm)",
"y_{0} (cm)",
"z_{0} (cm)",
"#sigma_{X_{0}} (cm)",
"#sigma_{Y_{0}} (cm)",
"#sigma_{Z_{0}} (cm)"};
280 hs.reserve(kNumHists);
281 for (
int i = 0;
i < 4;
i++) {
283 for (
int ic = 0; ic < nvar_; ++ic) {
284 TString histName(coord[ic]);
285 TString histTitle(coord[ic]);
289 bool createHisto =
true;
292 histName +=
"0_time";
293 xtitle =
"Time [UTC]";
295 histTitle +=
" coordinate of beam spot vs time (Fit)";
297 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs time (Fit)";
302 histName.Insert(0,
"PV");
304 histTitle.Insert(0,
"Avg. ");
305 histTitle +=
" position of primary vtx vs lumi";
306 xtitle =
"Lumisection";
307 ytitle.insert(0,
"PV");
308 ytitle +=
" #pm #sigma_{PV";
317 histName.Insert(0,
"PV");
319 histTitle.Insert(0,
"Avg. ");
320 histTitle +=
" position of primary vtx vs time";
321 xtitle =
"Time [UTC]";
322 ytitle.insert(0,
"PV");
323 ytitle +=
" #pm #sigma_{PV";
330 histName +=
"0_lumi";
331 xtitle =
"Lumisection";
333 histTitle +=
" coordinate of beam spot vs lumi (Fit)";
335 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs lumi (Fit)";
339 edm::LogInfo(
"BeamMonitor") <<
"hitsName = " << histName <<
"; histTitle = " << histTitle << std::endl;
340 auto tmpHs = iBooker.
book1D(histName, histTitle, 40, 0.5, 40.5);
342 tmpHs->setAxisTitle(xtitle, 1);
343 tmpHs->setAxisTitle(ytitle, 2);
344 tmpHs->getTH1()->SetOption(
"E1");
345 if (histName.Contains(
"time")) {
348 tmpHs->setAxisTimeDisplay(1);
349 tmpHs->setAxisTimeFormat(
"%H:%M:%S", 1);
350 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
354 tmpHs = iBooker.
book1D(histName, histTitle, 40, 0.5, 40.5);
356 tmpHs->getTH1()->SetCanExtend(TH1::kAllAxes);
357 tmpHs->setAxisTitle(xtitle, 1);
358 tmpHs->setAxisTitle(ytitle, 2);
359 tmpHs->getTH1()->SetOption(
"E1");
360 if (histName.Contains(
"time")) {
363 tmpHs->setAxisTimeDisplay(1);
364 tmpHs->setAxisTimeFormat(
"%H:%M:%S", 1);
365 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
371 assert(0 == strcmp(
hs[k_sigmaY0_time]->getTH1()->GetName(),
"sigmaY0_time"));
372 assert(0 == strcmp(
hs[k_PVz_lumi_all]->getTH1()->GetName(),
"PVz_lumi_all"));
389 h_x0 = iBooker.
book1D(
"BeamMonitorFeedBack_x0",
"x coordinate of beam spot (Fit)", 100, -0.01, 0.01);
393 h_y0 = iBooker.
book1D(
"BeamMonitorFeedBack_y0",
"y coordinate of beam spot (Fit)", 100, -0.01, 0.01);
401 h_sigmaX0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaX0",
"sigma x0 of beam spot (Fit)", 100, 0, 0.05);
405 h_sigmaY0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaY0",
"sigma y0 of beam spot (Fit)", 100, 0, 0.05);
409 h_sigmaZ0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaZ0",
"sigma z0 of beam spot (Fit)", 100, 0, 10);
414 h_trkPt = iBooker.
book1D(
"trkPt",
"p_{T} of all reco'd tracks (no selection)", 200, 0., 50.);
420 cutFlowTable = iBooker.
book1D(
"cutFlowTable",
"Cut flow table of track selection", 9, 0, 9);
423 fitResults = iBooker.
book2D(
"fitResults",
"Results of previous good beam fit", 2, 0, 2, 8, 0, 8);
440 h_nVtx = iBooker.
book1D(
"vtxNbr",
"Reconstructed Vertices(non-fake) in all Event", 60, -0.5, 59.5);
444 h_nVtx_st = iBooker.
book1D(
"vtxNbr_SelectedTriggers",
"Reconstructed Vertices(non-fake) in Events", 60, -0.5, 59.5);
448 h_PVx[0] = iBooker.
book1D(
"PVX",
"x coordinate of Primary Vtx", 50, -0.01, 0.01);
452 h_PVy[0] = iBooker.
book1D(
"PVY",
"y coordinate of Primary Vtx", 50, -0.01, 0.01);
459 h_PVx[1] = iBooker.
book1D(
"PVXFit",
"x coordinate of Primary Vtx (Last Fit)", 50, -0.01, 0.01);
463 h_PVy[1] = iBooker.
book1D(
"PVYFit",
"y coordinate of Primary Vtx (Last Fit)", 50, -0.01, 0.01);
479 pvResults = iBooker.
book2D(
"pvResults",
"Results of fitting Primary Vertices", 2, 0, 2, 6, 0, 6);
503 sprintf(histo,
"x0_status");
506 sprintf(histo,
"y0_status");
509 sprintf(histo,
"z0_status");
547 const std::time_t ftmptime = fbegintimestamp >> 32;
591 map<int, std::time_t>::iterator itbstime =
mapBeginBSTime.begin();
592 map<int, std::time_t>::iterator itpvtime =
mapBeginPVTime.begin();
662 edm::LogInfo(
"BeamMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
669 if (beamMode == BSTRecord::BeamMode::STABLE)
674 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
678 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
688 refBS = *recoBeamSpotHandle;
693 auto tmphisto =
static_cast<TH1F*
>(
theBeamFitter->getCutFlow());
695 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
698 for (
int n = 0;
n < tmphisto->GetNbinsX();
n++)
708 for (reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end(); ++
track) {
715 bool JetTrigPass =
false;
718 for (
unsigned int i = 0;
i < triggerResults->size();
i++) {
729 size_t found = trigName.find(string_search);
731 if (found != string::npos) {
733 if (triggerResults->accept(thisTrigger_))
747 for (reco::VertexCollection::const_iterator
pv = PVCollection->begin();
pv != PVCollection->end(); ++
pv) {
749 if (
pv->isFake() ||
pv->tracksSize() == 0)
789 map<int, std::vector<float> >::iterator itpvx =
mapPVx.begin();
790 map<int, std::vector<float> >::iterator itpvy =
mapPVy.begin();
791 map<int, std::vector<float> >::iterator itpvz =
mapPVz.begin();
793 map<int, std::vector<int> >::iterator itbspvinfo =
mapNPV.begin();
810 edm::LogInfo(
"BeamMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi
816 const std::time_t fendtime = fendtimestamp >> 32;
835 int currentlumi = nextlumi;
836 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
837 lastlumi = currentlumi;
846 size_t SizeToRemovePV = rmLSPVi->second;
847 for (std::map<int, std::size_t>::iterator rmLSPVe =
mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
848 rmLSPVi->second -= SizeToRemovePV;
856 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of thePVvector After removing the PVs = "
860 bool resetHistoFlag_ =
false;
866 resetHistoFlag_ =
true;
870 int countEvtLastNLS_ = 0;
873 std::map<int, std::vector<int> >::iterator mnpv =
mapNPV.begin();
874 std::map<int, std::vector<float> >::iterator mpv2 =
mapPVy.begin();
875 std::map<int, std::vector<float> >::iterator mpv3 =
mapPVz.begin();
877 for (std::map<
int, std::vector<float> >::iterator mpv1 =
mapPVx.begin(); mpv1 !=
mapPVx.end();
878 ++mpv1, ++mpv2, ++mpv3, ++mnpv) {
879 std::vector<float>::iterator mpvs2 = (mpv2->second).
begin();
880 std::vector<float>::iterator mpvs3 = (mpv3->second).
begin();
881 for (std::vector<float>::iterator mpvs1 = (mpv1->second).begin(); mpvs1 != (mpv1->second).
end();
882 ++mpvs1, ++mpvs2, ++mpvs3) {
883 if (resetHistoFlag_) {
891 for (std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).
end(); ++mnpvs) {
892 if ((*mnpvs > 0) && (resetHistoFlag_))
895 countTotPV_ += (*mnpvs);
896 if ((*mnpvs) > MaxPVs)
902 char tmpTitlePV[100];
906 std::vector<float> DipPVInfo_;
909 if (countTotPV_ != 0) {
910 DipPVInfo_.push_back((
float)countEvtLastNLS_);
915 DipPVInfo_.push_back((
float)MaxPVs);
916 DipPVInfo_.push_back((
float)countTotPV_);
919 for (
size_t i = 0;
i < 7;
i++) {
921 DipPVInfo_.push_back(0.);
923 DipPVInfo_.push_back((
float)countEvtLastNLS_);
928 countEvtLastNLS_ = 0;
932 const int countLS_bs =
hs[k_x0_lumi]->getTH1()->GetEntries();
933 const int countLS_pv =
hs[k_PVx_lumi]->getTH1()->GetEntries();
934 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: countLS_bs = " << countLS_bs <<
" ; countLS_pv = " << countLS_pv
936 int LSgap_bs = currentlumi /
fitNLumi_ - countLS_bs;
937 int LSgap_pv = currentlumi /
fitPVNLumi_ - countLS_pv;
942 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: LSgap_bs = " << LSgap_bs <<
" ; LSgap_pv = " << LSgap_pv << std::endl;
944 for (
int ig = 0; ig < LSgap_bs; ig++) {
948 hs[k_sigmaX0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
949 hs[k_sigmaY0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
950 hs[k_sigmaZ0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
953 for (
int ig = 0; ig < LSgap_pv; ig++) {
959 for (
int i = 1;
i < (currentlumi - previousLS);
978 bool doPVFit =
false;
1000 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1001 double mean, width, meanErr, widthErr;
1002 fgaus->SetLineColor(4);
1004 mean = fgaus->GetParameter(1);
1005 width = fgaus->GetParameter(2);
1006 meanErr = fgaus->GetParError(1);
1007 widthErr = fgaus->GetParError(2);
1010 hs[k_PVx_lumi_all]->setBinContent(currentlumi, mean);
1011 hs[k_PVx_lumi_all]->setBinError(currentlumi, width);
1014 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Event time outside current range of time histograms!"
1017 hs[k_PVx_time]->setBinContent(nthBin, mean);
1018 hs[k_PVx_time]->setBinError(nthBin, width);
1022 hs[k_PVx_time_all]->setBinContent(jthBin, mean);
1023 hs[k_PVx_time_all]->setBinError(jthBin, width);
1034 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1041 mean = fgaus->GetParameter(1);
1042 width = fgaus->GetParameter(2);
1043 meanErr = fgaus->GetParError(1);
1044 widthErr = fgaus->GetParError(2);
1046 hs[k_PVy_lumi_all]->setBinContent(currentlumi, mean);
1047 hs[k_PVy_lumi_all]->setBinError(currentlumi, width);
1049 hs[k_PVy_time]->setBinContent(nthBin, mean);
1050 hs[k_PVy_time]->setBinError(nthBin, width);
1053 hs[k_PVy_time_all]->setBinContent(jthBin, mean);
1054 hs[k_PVy_time_all]->setBinError(jthBin, width);
1064 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1071 mean = fgaus->GetParameter(1);
1072 width = fgaus->GetParameter(2);
1073 meanErr = fgaus->GetParError(1);
1074 widthErr = fgaus->GetParError(2);
1076 hs[k_PVz_lumi_all]->setBinContent(currentlumi, mean);
1077 hs[k_PVz_lumi_all]->setBinError(currentlumi, width);
1079 hs[k_PVz_time]->setBinContent(nthBin, mean);
1080 hs[k_PVz_time]->setBinError(nthBin, width);
1083 hs[k_PVz_time_all]->setBinContent(jthBin, mean);
1084 hs[k_PVz_time_all]->setBinError(jthBin, width);
1094 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1108 vector<BSTrkParameters> theBSvector1 =
theBeamFitter->getBSvector();
1110 size_t PreviousRecords = 0;
1113 size_t SizeToRemove = 0;
1114 std::map<int, std::size_t>::iterator rmls =
mapLSBSTrkSize.begin();
1115 SizeToRemove = rmls->second;
1117 edm::LogInfo(
"BeamMonitor") <<
" The size to remove is = " << SizeToRemove << endl;
1118 int changedAfterThis = 0;
1120 ++rmLS, ++changedAfterThis) {
1121 if (changedAfterThis > 0) {
1122 (rmLS->second) = (rmLS->second) - SizeToRemove;
1124 PreviousRecords = (rmLS->second);
1133 std::pair<int, int> checkfitLS =
theBeamFitter->getFitLSRange();
1134 std::pair<time_t, time_t> checkfitTime =
theBeamFitter->getRefTime();
1140 vector<BSTrkParameters> theBSvector =
theBeamFitter->getBSvector();
1144 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1146 bool countFitting =
false;
1147 if (theBSvector.size() >= PreviousRecords && theBSvector.size() >=
min_Ntrks_) {
1148 countFitting =
true;
1154 const TH1F& cutFlowToSubtract =
mapLSCF.begin()->second;
1156 std::map<int, TH1F>::iterator cf =
mapLSCF.begin();
1158 for (; cf !=
mapLSCF.end(); ++cf) {
1159 cf->second.Add(&cutFlowToSubtract, -1);
1180 unsigned int itrk = 0;
1181 for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin(); BSTrk != theBSvector.end();
1185 double vx = BSTrk->vx();
1186 double vy = BSTrk->vy();
1187 double z0 = BSTrk->z0();
1219 <<
"; address = " << &
refBStime[0] << std::endl;
1221 <<
"; address = " << &
refBStime[1] << std::endl;
1230 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first <<
" to "
1231 << fitLS.second << std::endl;
1241 edm::LogInfo(
"BeamMonitor") <<
"\n RESULTS OF DEFAULT FIT:" << endl;
1243 edm::LogInfo(
"BeamMonitor") <<
"[BeamFitter] fitting done \n" << endl;
1251 hs[k_x0_lumi_all]->setBinContent(currentlumi, bs.
x0());
1252 hs[k_x0_lumi_all]->setBinError(currentlumi, bs.
x0Error());
1253 hs[k_y0_lumi_all]->setBinContent(currentlumi, bs.
y0());
1254 hs[k_y0_lumi_all]->setBinError(currentlumi, bs.
y0Error());
1255 hs[k_z0_lumi_all]->setBinContent(currentlumi, bs.
z0());
1256 hs[k_z0_lumi_all]->setBinError(currentlumi, bs.
z0Error());
1257 hs[k_sigmaX0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthX());
1259 hs[k_sigmaY0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthY());
1261 hs[k_sigmaZ0_lumi_all]->setBinContent(currentlumi, bs.
sigmaZ());
1262 hs[k_sigmaZ0_lumi_all]->setBinError(currentlumi, bs.
sigmaZ0Error());
1266 hs[k_x0_time]->setBinContent(nthBin, bs.
x0());
1267 hs[k_y0_time]->setBinContent(nthBin, bs.
y0());
1268 hs[k_z0_time]->setBinContent(nthBin, bs.
z0());
1269 hs[k_sigmaX0_time]->setBinContent(nthBin, bs.
BeamWidthX());
1270 hs[k_sigmaY0_time]->setBinContent(nthBin, bs.
BeamWidthY());
1271 hs[k_sigmaZ0_time]->setBinContent(nthBin, bs.
sigmaZ());
1272 hs[k_x0_time]->setBinError(nthBin, bs.
x0Error());
1273 hs[k_y0_time]->setBinError(nthBin, bs.
y0Error());
1274 hs[k_z0_time]->setBinError(nthBin, bs.
z0Error());
1282 hs[k_x0_time_all]->setBinContent(jthBin, bs.
x0());
1283 hs[k_y0_time_all]->setBinContent(jthBin, bs.
y0());
1284 hs[k_z0_time_all]->setBinContent(jthBin, bs.
z0());
1285 hs[k_sigmaX0_time_all]->setBinContent(jthBin, bs.
BeamWidthX());
1286 hs[k_sigmaY0_time_all]->setBinContent(jthBin, bs.
BeamWidthY());
1287 hs[k_sigmaZ0_time_all]->setBinContent(jthBin, bs.
sigmaZ());
1288 hs[k_x0_time_all]->setBinError(jthBin, bs.
x0Error());
1289 hs[k_y0_time_all]->setBinError(jthBin, bs.
y0Error());
1290 hs[k_z0_time_all]->setBinError(jthBin, bs.
z0Error());
1299 if (bs.
type() > 0) {
1307 double alpha = std::atan2(bs.
y0(), bs.
x0());
1308 std::unique_ptr<TF1>
f1{
new TF1(
"f1",
"[0]*sin(x-[1])", -3.14, 3.14)};
1309 f1->SetParameters(amp, alpha);
1310 f1->SetParLimits(0, amp - 0.1, amp + 0.1);
1311 f1->SetParLimits(1, alpha - 0.577, alpha + 0.577);
1312 f1->SetLineColor(4);
1316 double width = bs.
sigmaZ();
1317 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1318 fgaus->SetParameters(mean, width);
1319 fgaus->SetLineColor(4);
1320 h_trk_z0->
getTH1()->Fit(fgaus.get(),
"QLRM",
"", mean - 3 * width, mean + 3 * width);
1324 std::pair<int, int> LSRange =
theBeamFitter->getFitLSRange();
1326 sprintf(tmpTitle,
"%s %i %s %i",
"Fitted Beam Spot (cm) of LS: ", LSRange.first,
" to ", LSRange.second);
1334 if (bs.
type() > 0) {
1348 if (bs.
type() > 0) {
1384 for (
int i = 0;
i < 7; ++
i) {
1385 for (
int j = 0;
j < 7; ++
j) {
1402 std::pair<time_t, time_t> timeForDIP =
theBeamFitter->getRefTime();
1408 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline object created: \n" << std::endl;
1414 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] onlineDbService available \n" << std::endl;
1419 <<
"BeamMonitor::FitAndFill - [BeamFitter] Do BeamSpot Fit for LS = " << LSRange.first <<
" to "
1422 <<
"BeamMonitor::FitAndFill - [BeamMonitor] Do BeamSpot Fit for LS = " <<
beginLumiOfBSFit_ <<
" to "
1427 <<
"BeamMonitor::FitAndFill - [PayloadCreation] BeamSpotOnline object created:";
1442 <<
"BeamMonitor::FitAndFill - [PayloadCreation] SetCreationTime: " <<
creationTime
1443 <<
" [epoch in microseconds]";
1447 <<
"BeamMonitor::FitAndFill - [PayloadCreation] writeIOVForNextLumisection executed correctly";
1450 <<
" for Run: " <<
frun <<
" - Lumi: " << LSRange.second;
1457 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline payload created \n" << std::endl;
1462 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1463 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1489 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1490 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1532 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: The flag is ON for running average Beam Spot fit" << endl;
1546 <<
" RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" << endl;
1583 edm::LogInfo(
"BeamMonitor") <<
"dqmEndRun:: Clearing all the Maps " << endl;
1603 char offsetTime[64];
1605 TDatime
da(offsetTime);
1608 double valErr = h->GetBinError(
lastNZbin);
1610 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1612 h->SetBinContent(bin, val);
1613 h->SetBinError(bin, valErr);
1616 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1623 bool scroll_ =
false;
1626 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Reset Time Offset" << std::endl;
1629 if (
hs[k_x0_time]->getBinContent(
bin) > 0) {
1636 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Time difference too large since last readout" << std::endl;
1640 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
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
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