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),
228 edm::LogInfo(
"BeamMonitor") <<
"TimeOffset = " << eventTime << std::endl;
229 TDatime
da(eventTime);
234 auto daTime = da.Convert(kTRUE);
241 h_nTrk_lumi = iBooker.
book1D(
"nTrk_lumi",
"Num. of selected tracks vs lumi (Fit)", 20, 0.5, 20.5);
246 h_nVtx_lumi = iBooker.
book1D(
"nVtx_lumi",
"Num. of selected Vtx vs lumi (Fit)", 20, 0.5, 20.5);
250 h_nVtx_lumi_all = iBooker.
book1D(
"nVtx_lumi_all",
"Num. of selected Vtx vs lumi (Fit) all", 20, 0.5, 20.5);
268 TDatime* da =
new TDatime();
269 gStyle->SetTimeOffset(da->Convert(kTRUE));
273 string coord[nvar_] = {
"x",
"y",
"z",
"sigmaX",
"sigmaY",
"sigmaZ"};
274 string label[nvar_] = {
275 "x_{0} (cm)",
"y_{0} (cm)",
"z_{0} (cm)",
"#sigma_{X_{0}} (cm)",
"#sigma_{Y_{0}} (cm)",
"#sigma_{Z_{0}} (cm)"};
277 hs.reserve(kNumHists);
278 for (
int i = 0;
i < 4;
i++) {
280 for (
int ic = 0; ic < nvar_; ++ic) {
281 TString histName(coord[ic]);
282 TString histTitle(coord[ic]);
283 string ytitle(label[ic]);
286 bool createHisto =
true;
289 histName +=
"0_time";
290 xtitle =
"Time [UTC]";
292 histTitle +=
" coordinate of beam spot vs time (Fit)";
294 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs time (Fit)";
299 histName.Insert(0,
"PV");
301 histTitle.Insert(0,
"Avg. ");
302 histTitle +=
" position of primary vtx vs lumi";
303 xtitle =
"Lumisection";
304 ytitle.insert(0,
"PV");
305 ytitle +=
" #pm #sigma_{PV";
314 histName.Insert(0,
"PV");
316 histTitle.Insert(0,
"Avg. ");
317 histTitle +=
" position of primary vtx vs time";
318 xtitle =
"Time [UTC]";
319 ytitle.insert(0,
"PV");
320 ytitle +=
" #pm #sigma_{PV";
327 histName +=
"0_lumi";
328 xtitle =
"Lumisection";
330 histTitle +=
" coordinate of beam spot vs lumi (Fit)";
332 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs lumi (Fit)";
336 edm::LogInfo(
"BeamMonitor") <<
"hitsName = " << histName <<
"; histTitle = " << histTitle << std::endl;
337 auto tmpHs = iBooker.
book1D(histName, histTitle, 40, 0.5, 40.5);
339 tmpHs->setAxisTitle(xtitle, 1);
340 tmpHs->setAxisTitle(ytitle, 2);
341 tmpHs->getTH1()->SetOption(
"E1");
342 if (histName.Contains(
"time")) {
345 tmpHs->setAxisTimeDisplay(1);
346 tmpHs->setAxisTimeFormat(
"%H:%M:%S", 1);
347 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
351 tmpHs = iBooker.
book1D(histName, histTitle, 40, 0.5, 40.5);
353 tmpHs->getTH1()->SetCanExtend(TH1::kAllAxes);
354 tmpHs->setAxisTitle(xtitle, 1);
355 tmpHs->setAxisTitle(ytitle, 2);
356 tmpHs->getTH1()->SetOption(
"E1");
357 if (histName.Contains(
"time")) {
360 tmpHs->setAxisTimeDisplay(1);
361 tmpHs->setAxisTimeFormat(
"%H:%M:%S", 1);
362 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
368 assert(0 == strcmp(
hs[k_sigmaY0_time]->getTH1()->GetName(),
"sigmaY0_time"));
369 assert(0 == strcmp(
hs[k_PVz_lumi_all]->getTH1()->GetName(),
"PVz_lumi_all"));
386 h_x0 = iBooker.
book1D(
"BeamMonitorFeedBack_x0",
"x coordinate of beam spot (Fit)", 100, -0.01, 0.01);
390 h_y0 = iBooker.
book1D(
"BeamMonitorFeedBack_y0",
"y coordinate of beam spot (Fit)", 100, -0.01, 0.01);
398 h_sigmaX0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaX0",
"sigma x0 of beam spot (Fit)", 100, 0, 0.05);
402 h_sigmaY0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaY0",
"sigma y0 of beam spot (Fit)", 100, 0, 0.05);
406 h_sigmaZ0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaZ0",
"sigma z0 of beam spot (Fit)", 100, 0, 10);
411 h_trkPt = iBooker.
book1D(
"trkPt",
"p_{T} of all reco'd tracks (no selection)", 200, 0., 50.);
417 cutFlowTable = iBooker.
book1D(
"cutFlowTable",
"Cut flow table of track selection", 9, 0, 9);
420 fitResults = iBooker.
book2D(
"fitResults",
"Results of previous good beam fit", 2, 0, 2, 8, 0, 8);
437 h_nVtx = iBooker.
book1D(
"vtxNbr",
"Reconstructed Vertices(non-fake) in all Event", 60, -0.5, 59.5);
441 h_nVtx_st = iBooker.
book1D(
"vtxNbr_SelectedTriggers",
"Reconstructed Vertices(non-fake) in Events", 60, -0.5, 59.5);
445 h_PVx[0] = iBooker.
book1D(
"PVX",
"x coordinate of Primary Vtx", 50, -0.01, 0.01);
449 h_PVy[0] = iBooker.
book1D(
"PVY",
"y coordinate of Primary Vtx", 50, -0.01, 0.01);
456 h_PVx[1] = iBooker.
book1D(
"PVXFit",
"x coordinate of Primary Vtx (Last Fit)", 50, -0.01, 0.01);
460 h_PVy[1] = iBooker.
book1D(
"PVYFit",
"y coordinate of Primary Vtx (Last Fit)", 50, -0.01, 0.01);
476 pvResults = iBooker.
book2D(
"pvResults",
"Results of fitting Primary Vertices", 2, 0, 2, 6, 0, 6);
500 sprintf(histo,
"x0_status");
503 sprintf(histo,
"y0_status");
506 sprintf(histo,
"z0_status");
544 const std::time_t ftmptime = fbegintimestamp >> 32;
588 map<int, std::time_t>::iterator itbstime =
mapBeginBSTime.begin();
589 map<int, std::time_t>::iterator itpvtime =
mapBeginPVTime.begin();
659 edm::LogInfo(
"BeamMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
666 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
670 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
680 refBS = *recoBeamSpotHandle;
685 auto tmphisto =
static_cast<TH1F*
>(
theBeamFitter->getCutFlow());
687 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
690 for (
int n = 0;
n < tmphisto->GetNbinsX();
n++)
700 for (reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end(); ++
track) {
707 bool JetTrigPass =
false;
710 for (
unsigned int i = 0;
i < triggerResults->size();
i++) {
721 size_t found = trigName.find(string_search);
723 if (found != string::npos) {
725 if (triggerResults->accept(thisTrigger_))
739 for (reco::VertexCollection::const_iterator
pv = PVCollection->begin();
pv != PVCollection->end(); ++
pv) {
741 if (
pv->isFake() ||
pv->tracksSize() == 0)
781 map<int, std::vector<float> >::iterator itpvx =
mapPVx.begin();
782 map<int, std::vector<float> >::iterator itpvy =
mapPVy.begin();
783 map<int, std::vector<float> >::iterator itpvz =
mapPVz.begin();
785 map<int, std::vector<int> >::iterator itbspvinfo =
mapNPV.begin();
802 edm::LogInfo(
"BeamMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi
808 const std::time_t fendtime = fendtimestamp >> 32;
827 int currentlumi = nextlumi;
828 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
829 lastlumi = currentlumi;
838 size_t SizeToRemovePV = rmLSPVi->second;
839 for (std::map<int, std::size_t>::iterator rmLSPVe =
mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
840 rmLSPVi->second -= SizeToRemovePV;
848 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of thePVvector After removing the PVs = "
852 bool resetHistoFlag_ =
false;
858 resetHistoFlag_ =
true;
862 int countEvtLastNLS_ = 0;
865 std::map<int, std::vector<int> >::iterator mnpv =
mapNPV.begin();
866 std::map<int, std::vector<float> >::iterator mpv2 =
mapPVy.begin();
867 std::map<int, std::vector<float> >::iterator mpv3 =
mapPVz.begin();
869 for (std::map<
int, std::vector<float> >::iterator mpv1 =
mapPVx.begin(); mpv1 !=
mapPVx.end();
870 ++mpv1, ++mpv2, ++mpv3, ++mnpv) {
871 std::vector<float>::iterator mpvs2 = (mpv2->second).
begin();
872 std::vector<float>::iterator mpvs3 = (mpv3->second).
begin();
873 for (std::vector<float>::iterator mpvs1 = (mpv1->second).begin(); mpvs1 != (mpv1->second).
end();
874 ++mpvs1, ++mpvs2, ++mpvs3) {
875 if (resetHistoFlag_) {
883 for (std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).
end(); ++mnpvs) {
884 if ((*mnpvs > 0) && (resetHistoFlag_))
887 countTotPV_ += (*mnpvs);
888 if ((*mnpvs) > MaxPVs)
894 char tmpTitlePV[100];
898 std::vector<float> DipPVInfo_;
901 if (countTotPV_ != 0) {
902 DipPVInfo_.push_back((
float)countEvtLastNLS_);
907 DipPVInfo_.push_back((
float)MaxPVs);
908 DipPVInfo_.push_back((
float)countTotPV_);
911 for (
size_t i = 0;
i < 7;
i++) {
913 DipPVInfo_.push_back(0.);
915 DipPVInfo_.push_back((
float)countEvtLastNLS_);
920 countEvtLastNLS_ = 0;
924 const int countLS_bs =
hs[k_x0_lumi]->getTH1()->GetEntries();
925 const int countLS_pv =
hs[k_PVx_lumi]->getTH1()->GetEntries();
926 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: countLS_bs = " << countLS_bs <<
" ; countLS_pv = " << countLS_pv
928 int LSgap_bs = currentlumi /
fitNLumi_ - countLS_bs;
929 int LSgap_pv = currentlumi /
fitPVNLumi_ - countLS_pv;
934 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: LSgap_bs = " << LSgap_bs <<
" ; LSgap_pv = " << LSgap_pv << std::endl;
936 for (
int ig = 0; ig < LSgap_bs; ig++) {
940 hs[k_sigmaX0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
941 hs[k_sigmaY0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
942 hs[k_sigmaZ0_lumi]->ShiftFillLast(0., 0.,
fitNLumi_);
945 for (
int ig = 0; ig < LSgap_pv; ig++) {
951 for (
int i = 1;
i < (currentlumi - previousLS);
970 bool doPVFit =
false;
992 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
993 double mean, width, meanErr, widthErr;
994 fgaus->SetLineColor(4);
996 mean = fgaus->GetParameter(1);
997 width = fgaus->GetParameter(2);
998 meanErr = fgaus->GetParError(1);
999 widthErr = fgaus->GetParError(2);
1002 hs[k_PVx_lumi_all]->setBinContent(currentlumi, mean);
1003 hs[k_PVx_lumi_all]->setBinError(currentlumi, width);
1006 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Event time outside current range of time histograms!"
1009 hs[k_PVx_time]->setBinContent(nthBin, mean);
1010 hs[k_PVx_time]->setBinError(nthBin, width);
1014 hs[k_PVx_time_all]->setBinContent(jthBin, mean);
1015 hs[k_PVx_time_all]->setBinError(jthBin, width);
1026 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1033 mean = fgaus->GetParameter(1);
1034 width = fgaus->GetParameter(2);
1035 meanErr = fgaus->GetParError(1);
1036 widthErr = fgaus->GetParError(2);
1038 hs[k_PVy_lumi_all]->setBinContent(currentlumi, mean);
1039 hs[k_PVy_lumi_all]->setBinError(currentlumi, width);
1041 hs[k_PVy_time]->setBinContent(nthBin, mean);
1042 hs[k_PVy_time]->setBinError(nthBin, width);
1045 hs[k_PVy_time_all]->setBinContent(jthBin, mean);
1046 hs[k_PVy_time_all]->setBinError(jthBin, width);
1056 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1063 mean = fgaus->GetParameter(1);
1064 width = fgaus->GetParameter(2);
1065 meanErr = fgaus->GetParError(1);
1066 widthErr = fgaus->GetParError(2);
1068 hs[k_PVz_lumi_all]->setBinContent(currentlumi, mean);
1069 hs[k_PVz_lumi_all]->setBinError(currentlumi, width);
1071 hs[k_PVz_time]->setBinContent(nthBin, mean);
1072 hs[k_PVz_time]->setBinError(nthBin, width);
1075 hs[k_PVz_time_all]->setBinContent(jthBin, mean);
1076 hs[k_PVz_time_all]->setBinError(jthBin, width);
1086 tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
1100 vector<BSTrkParameters> theBSvector1 =
theBeamFitter->getBSvector();
1102 size_t PreviousRecords = 0;
1105 size_t SizeToRemove = 0;
1106 std::map<int, std::size_t>::iterator rmls =
mapLSBSTrkSize.begin();
1107 SizeToRemove = rmls->second;
1109 edm::LogInfo(
"BeamMonitor") <<
" The size to remove is = " << SizeToRemove << endl;
1110 int changedAfterThis = 0;
1112 ++rmLS, ++changedAfterThis) {
1113 if (changedAfterThis > 0) {
1114 (rmLS->second) = (rmLS->second) - SizeToRemove;
1116 PreviousRecords = (rmLS->second);
1125 std::pair<int, int> checkfitLS =
theBeamFitter->getFitLSRange();
1126 std::pair<time_t, time_t> checkfitTime =
theBeamFitter->getRefTime();
1132 vector<BSTrkParameters> theBSvector =
theBeamFitter->getBSvector();
1136 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1138 bool countFitting =
false;
1139 if (theBSvector.size() >= PreviousRecords && theBSvector.size() >=
min_Ntrks_) {
1140 countFitting =
true;
1146 const TH1F& cutFlowToSubtract =
mapLSCF.begin()->second;
1148 std::map<int, TH1F>::iterator cf =
mapLSCF.begin();
1150 for (; cf !=
mapLSCF.end(); ++cf) {
1151 cf->second.Add(&cutFlowToSubtract, -1);
1172 unsigned int itrk = 0;
1173 for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin(); BSTrk != theBSvector.end();
1177 double vx = BSTrk->vx();
1178 double vy = BSTrk->vy();
1179 double z0 = BSTrk->z0();
1211 <<
"; address = " << &
refBStime[0] << std::endl;
1213 <<
"; address = " << &
refBStime[1] << std::endl;
1222 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first <<
" to "
1223 << fitLS.second << std::endl;
1233 edm::LogInfo(
"BeamMonitor") <<
"\n RESULTS OF DEFAULT FIT:" << endl;
1235 edm::LogInfo(
"BeamMonitor") <<
"[BeamFitter] fitting done \n" << endl;
1243 hs[k_x0_lumi_all]->setBinContent(currentlumi, bs.
x0());
1244 hs[k_x0_lumi_all]->setBinError(currentlumi, bs.
x0Error());
1245 hs[k_y0_lumi_all]->setBinContent(currentlumi, bs.
y0());
1246 hs[k_y0_lumi_all]->setBinError(currentlumi, bs.
y0Error());
1247 hs[k_z0_lumi_all]->setBinContent(currentlumi, bs.
z0());
1248 hs[k_z0_lumi_all]->setBinError(currentlumi, bs.
z0Error());
1249 hs[k_sigmaX0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthX());
1251 hs[k_sigmaY0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthY());
1253 hs[k_sigmaZ0_lumi_all]->setBinContent(currentlumi, bs.
sigmaZ());
1254 hs[k_sigmaZ0_lumi_all]->setBinError(currentlumi, bs.
sigmaZ0Error());
1258 hs[k_x0_time]->setBinContent(nthBin, bs.
x0());
1259 hs[k_y0_time]->setBinContent(nthBin, bs.
y0());
1260 hs[k_z0_time]->setBinContent(nthBin, bs.
z0());
1261 hs[k_sigmaX0_time]->setBinContent(nthBin, bs.
BeamWidthX());
1262 hs[k_sigmaY0_time]->setBinContent(nthBin, bs.
BeamWidthY());
1263 hs[k_sigmaZ0_time]->setBinContent(nthBin, bs.
sigmaZ());
1264 hs[k_x0_time]->setBinError(nthBin, bs.
x0Error());
1265 hs[k_y0_time]->setBinError(nthBin, bs.
y0Error());
1266 hs[k_z0_time]->setBinError(nthBin, bs.
z0Error());
1274 hs[k_x0_time_all]->setBinContent(jthBin, bs.
x0());
1275 hs[k_y0_time_all]->setBinContent(jthBin, bs.
y0());
1276 hs[k_z0_time_all]->setBinContent(jthBin, bs.
z0());
1277 hs[k_sigmaX0_time_all]->setBinContent(jthBin, bs.
BeamWidthX());
1278 hs[k_sigmaY0_time_all]->setBinContent(jthBin, bs.
BeamWidthY());
1279 hs[k_sigmaZ0_time_all]->setBinContent(jthBin, bs.
sigmaZ());
1280 hs[k_x0_time_all]->setBinError(jthBin, bs.
x0Error());
1281 hs[k_y0_time_all]->setBinError(jthBin, bs.
y0Error());
1282 hs[k_z0_time_all]->setBinError(jthBin, bs.
z0Error());
1291 if (bs.
type() > 0) {
1299 double alpha = std::atan2(bs.
y0(), bs.
x0());
1300 std::unique_ptr<TF1>
f1{
new TF1(
"f1",
"[0]*sin(x-[1])", -3.14, 3.14)};
1301 f1->SetParameters(amp, alpha);
1302 f1->SetParLimits(0, amp - 0.1, amp + 0.1);
1303 f1->SetParLimits(1, alpha - 0.577, alpha + 0.577);
1304 f1->SetLineColor(4);
1308 double width = bs.
sigmaZ();
1309 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus")};
1310 fgaus->SetParameters(mean, width);
1311 fgaus->SetLineColor(4);
1312 h_trk_z0->
getTH1()->Fit(fgaus.get(),
"QLRM",
"", mean - 3 * width, mean + 3 * width);
1316 std::pair<int, int> LSRange =
theBeamFitter->getFitLSRange();
1318 sprintf(tmpTitle,
"%s %i %s %i",
"Fitted Beam Spot (cm) of LS: ", LSRange.first,
" to ", LSRange.second);
1326 if (bs.
type() > 0) {
1340 if (bs.
type() > 0) {
1376 for (
int i = 0;
i < 7; ++
i) {
1377 for (
int j = 0;
j < 7; ++
j) {
1394 std::pair<time_t, time_t> timeForDIP =
theBeamFitter->getRefTime();
1400 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline object created: \n" << std::endl;
1405 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] onlineDbService available \n" << std::endl;
1410 <<
"BeamMonitor::FitAndFill - [BeamFitter] Do BeamSpot Fit for LS = " << LSRange.first <<
" to "
1413 <<
"BeamMonitor::FitAndFill - [BeamMonitor] Do BeamSpot Fit for LS = " <<
beginLumiOfBSFit_ <<
" to "
1418 <<
"BeamMonitor::FitAndFill - [PayloadCreation] BeamSpotOnline object created:";
1433 <<
"BeamMonitor::FitAndFill - [PayloadCreation] SetCreationTime: " <<
creationTime
1434 <<
" [epoch in microseconds]";
1438 <<
"BeamMonitor::FitAndFill - [PayloadCreation] writeIOVForNextLumisection executed correctly";
1441 <<
" for Run: " <<
frun <<
" - Lumi: " << LSRange.second;
1448 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill::[PayloadCreation] BeamSpotOnline payload created \n" << std::endl;
1453 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1454 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1480 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1481 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1523 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: The flag is ON for running average Beam Spot fit" << endl;
1537 <<
" RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" << endl;
1574 edm::LogInfo(
"BeamMonitor") <<
"dqmEndRun:: Clearing all the Maps " << endl;
1594 char offsetTime[64];
1596 TDatime
da(offsetTime);
1599 double valErr = h->GetBinError(
lastNZbin);
1601 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1603 h->SetBinContent(bin, val);
1604 h->SetBinError(bin, valErr);
1607 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1614 bool scroll_ =
false;
1617 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Reset Time Offset" << std::endl;
1620 if (
hs[k_x0_time]->getBinContent(
bin) > 0) {
1627 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Time difference too large since last readout" << std::endl;
1631 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Offset to last record" << std::endl;
LuminosityBlockID id() const
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_
double sigmaZ0Error() const
error on sigma z
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
std::string GetStartTime() const
MonitorElement * reportSummary
void bookHistograms(DQMStore::IBooker &i, const edm::Run &r, const edm::EventSetup &c) override
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void SetLastAnalyzedLumi(int val)
Setters Methods.
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 SetNumTracks(int val)
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
void SetSigmaZ(double val)
set sigma Z, RMS bunch length
std::vector< Track > TrackCollection
collection of Tracks
unsigned int triggerIndex(std::string_view name) const
edm::TimeValue_t ftimestamp
edm::LuminosityBlockNumber_t luminosityBlock() const
cond::Time_t GetStartTimeStamp() const
void SetUsedEvents(int val)
auto const & tracks
cannot be loose
std::vector< MonitorElement * > hs
void SetEndTime(std::string val)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
void SetCovariance(int i, int j, double val)
set i,j element of the full covariance matrix 7x7
Timestamp const & beginTime() const
MonitorElement * h_sigmaZ0
MonitorElement * h_nTrk_lumi
std::map< int, std::size_t > mapLSBSTrkSize
Log< level::Error, false > LogError
void Setdydz(double val)
set dydz slope, crossing angle in XZ
MonitorElement * fitResults
std::vector< std::string > jetTrigger_
std::string GetEndTime() const
MonitorElement * h_sigmaY0
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
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
double dydz() const
dydz slope
void SetRmsErrorPV(float val)
float GetMeanErrorPV() const
void SetStartTimeStamp(cond::Time_t val)
double emittanceY() const
EchoedLogStream< edm::LogError > logError()
double dxdzError() const
error on dxdz
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
int GetUsedEvents() const
void SetEmittanceX(double val)
set emittance
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.
Timestamp const & endTime() const
void formatFitTime(char *, const std::time_t &)
MonitorElement * pvResults
MonitorElement * h_nVtx_lumi
double BeamWidthX() const
beam width X
void Setdxdz(double val)
set dxdz slope, crossing angle
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
static constexpr int buffTime
void SetStartTime(std::string val)
void SetMeanPV(float val)
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
void SetMeanErrorPV(float val)
virtual TProfile * getTProfile()
double dxdz() const
dxdz slope
std::map< int, TH1F > mapLSCF
void SetBeamWidthXError(double val)
set beam width X error
double x0Error() const
error on x
double y0Error() const
error on y
MonitorElement * h_nVtx_lumi_all
void SetBetaStar(double val)
set beta star
Log< level::Info, false > LogInfo
static const char *const trigNames[]
void SetType(int type)
set beam type
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
virtual double getMeanError(int axis=1) const
MonitorElement * reportSummaryContents[3]
void SetEmittanceY(double val)
set emittance
double sigmaZ() const
sigma z
float GetRmsErrorPV() const
bool writeIOVForNextLumisection(const PayloadType &payload, const std::string &recordName)
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
void SetBeamWidthX(double val)
set average transverse beam width X
std::map< int, int > mapBeginBSLS
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
void SetBeamWidthY(double val)
set average transverse beam width Y
Timestamp const & beginTime() const
double covariance(int i, int j) const
(i,j)-th element of error matrix
void SetLastAnalyzedRun(int val)
void SetBeamWidthYError(double val)
set beam width Y error
virtual double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
void SetEndTimeStamp(cond::Time_t val)
double y0() const
y coordinate
void SetLastAnalyzedFill(int 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
TimeValue_t value() const
std::map< int, std::vector< float > > mapPVy
MonitorElement * h_d0_phi0
cond::Time_t GetEndTimeStamp() const
void scrollTH1(TH1 *, std::time_t)
BeamType type() const
return beam type
MonitorElement * reportSummaryMap
void SetCreationTime(cond::Time_t val)
void SetPosition(double x, double y, double z)
set XYZ position
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