58 localTime = localtime( ¤tTime );
59 int year = localTime->tm_year + 1900;
65 if (year <= 37) year += 2000;
66 if (year >= 70 && year <= 137) year += 1900;
69 edm::LogError(
"BadTimeStamp") <<
"year reported is " << year <<
" !!"<<std::endl;
73 sprintf( ts,
"%4d-%02d-%02d %02d:%02d:%02d", year,ptm->tm_mon+1,ptm->tm_mday,(ptm->tm_hour+CEST)%24, ptm->tm_min, ptm->tm_sec);
75 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE 76 unsigned int b = strlen(ts);
77 while (ts[--b] ==
' ') {ts[
b] = 0;}
87 dxBin_( ps.getParameter<
int>(
"dxBin") ),
88 dxMin_( ps.getParameter<double>(
"dxMin") ),
89 dxMax_( ps.getParameter<double>(
"dxMax") ),
91 vxBin_(ps.getParameter<
int>(
"vxBin")),
92 vxMin_(ps.getParameter<double>(
"vxMin")),
93 vxMax_(ps.getParameter<double>(
"vxMax")),
95 phiBin_(ps.getParameter<
int>(
"phiBin")),
96 phiMin_(ps.getParameter<double>(
"phiMin")),
97 phiMax_(ps.getParameter<double>(
"phiMax")),
99 dzBin_(ps.getParameter<
int>(
"dzBin")),
100 dzMin_(ps.getParameter<double>(
"dzMin")),
101 dzMax_(ps.getParameter<double>(
"dzMax")),
103 countEvt_(0),countLumi_(0),nthBSTrk_(0),nFitElements_(3),resetHistos_(
false),StartAverage_(
false),firstAverageFit_(0),countGapLumi_(0) {
106 bsSrc_ = consumes<reco::BeamSpot>(
110 .getUntrackedParameter<InputTag>(
"TrackCollection"));
111 pvSrc_ = consumes<reco::VertexCollection>(
113 hltSrc_ = consumes<TriggerResults>(
133 theBeamFitter = std::make_unique<BeamFitter>(ps, consumesCollector());
139 if (fitNLumi_ <= 0) fitNLumi_ = 1;
206 edm::LogInfo(
"BeamMonitor") <<
"TimeOffset = " << eventTime << std::endl;
207 TDatime
da(eventTime);
212 auto daTime = da.Convert(kTRUE);
220 h_nTrk_lumi=iBooker.
book1D(
"nTrk_lumi",
"Num. of selected tracks vs lumi (Fit)",20,0.5,20.5);
225 h_nVtx_lumi=iBooker.
book1D(
"nVtx_lumi",
"Num. of selected Vtx vs lumi (Fit)",20,0.5,20.5);
229 h_nVtx_lumi_all=iBooker.
book1D(
"nVtx_lumi_all",
"Num. of selected Vtx vs lumi (Fit) all",20,0.5,20.5);
245 TDatime *da =
new TDatime();
246 gStyle->SetTimeOffset(da->Convert(kTRUE));
250 string coord[nvar_] = {
"x",
"y",
"z",
"sigmaX",
"sigmaY",
"sigmaZ"};
251 string label[nvar_] = {
"x_{0} (cm)",
"y_{0} (cm)",
"z_{0} (cm)",
252 "#sigma_{X_{0}} (cm)",
"#sigma_{Y_{0}} (cm)",
"#sigma_{Z_{0}} (cm)"};
254 hs.reserve(kNumHists);
255 for (
int i = 0;
i < 4;
i++) {
257 for (
int ic=0; ic<nvar_; ++ic) {
258 TString histName(coord[ic]);
259 TString histTitle(coord[ic]);
263 bool createHisto =
true;
266 histName +=
"0_time";
267 xtitle =
"Time [UTC]";
269 histTitle +=
" coordinate of beam spot vs time (Fit)";
271 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs time (Fit)";
276 histName.Insert(0,
"PV");
278 histTitle.Insert(0,
"Avg. ");
279 histTitle +=
" position of primary vtx vs lumi";
280 xtitle =
"Lumisection";
281 ytitle.insert(0,
"PV");
282 ytitle +=
" #pm #sigma_{PV";
286 else createHisto =
false;
291 histName.Insert(0,
"PV");
293 histTitle.Insert(0,
"Avg. ");
294 histTitle +=
" position of primary vtx vs time";
295 xtitle =
"Time [UTC]";
296 ytitle.insert(0,
"PV");
297 ytitle +=
" #pm #sigma_{PV";
301 else createHisto =
false;
304 histName +=
"0_lumi";
305 xtitle =
"Lumisection";
307 histTitle +=
" coordinate of beam spot vs lumi (Fit)";
309 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs lumi (Fit)";
313 edm::LogInfo(
"BeamMonitor") <<
"hitsName = " << histName <<
"; histTitle = " << histTitle << std::endl;
314 auto tmpHs = iBooker.
book1D(histName,histTitle,40,0.5,40.5);
316 tmpHs->setAxisTitle(xtitle,1);
317 tmpHs->setAxisTitle(ytitle,2);
318 tmpHs->getTH1()->SetOption(
"E1");
319 if (histName.Contains(
"time")) {
322 tmpHs->setAxisTimeDisplay(1);
323 tmpHs->setAxisTimeFormat(
"%H:%M:%S",1);
324 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
328 tmpHs = iBooker.
book1D(histName,histTitle,40,0.5,40.5);
330 tmpHs->getTH1()->SetCanExtend(TH1::kAllAxes);
331 tmpHs->setAxisTitle(xtitle,1);
332 tmpHs->setAxisTitle(ytitle,2);
333 tmpHs->getTH1()->SetOption(
"E1");
334 if (histName.Contains(
"time")) {
337 tmpHs->setAxisTimeDisplay(1);
338 tmpHs->setAxisTimeFormat(
"%H:%M:%S",1);
339 tmpHs->getTH1()->GetXaxis()->SetTimeOffset(daTime);
344 assert(
hs.size() == kNumHists);
345 assert(0==strcmp(
hs[k_sigmaY0_time]->getTH1()->GetName(),
"sigmaY0_time"));
346 assert(0 == strcmp(
hs[k_PVz_lumi_all]->getTH1()->GetName(),
"PVz_lumi_all"));
361 h_x0 = iBooker.
book1D(
"BeamMonitorFeedBack_x0",
"x coordinate of beam spot (Fit)",100,-0.01,0.01);
365 h_y0 = iBooker.
book1D(
"BeamMonitorFeedBack_y0",
"y coordinate of beam spot (Fit)",100,-0.01,0.01);
373 h_sigmaX0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaX0",
"sigma x0 of beam spot (Fit)",100,0,0.05);
377 h_sigmaY0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaY0",
"sigma y0 of beam spot (Fit)",100,0,0.05);
381 h_sigmaZ0 = iBooker.
book1D(
"BeamMonitorFeedBack_sigmaZ0",
"sigma z0 of beam spot (Fit)",100,0,10);
386 h_trkPt=iBooker.
book1D(
"trkPt",
"p_{T} of all reco'd tracks (no selection)",200,0.,50.);
392 cutFlowTable = iBooker.
book1D(
"cutFlowTable",
"Cut flow table of track selection", 9, 0, 9 );
395 fitResults=iBooker.
book2D(
"fitResults",
"Results of previous good beam fit",2,0,2,8,0,8);
412 h_nVtx = iBooker.
book1D(
"vtxNbr",
"Reconstructed Vertices(non-fake) in all Event",60,-0.5,59.5);
416 h_nVtx_st = iBooker.
book1D(
"vtxNbr_SelectedTriggers",
"Reconstructed Vertices(non-fake) in Events",60,-0.5,59.5);
420 h_PVx[0] = iBooker.
book1D(
"PVX",
"x coordinate of Primary Vtx",50,-0.01,0.01);
424 h_PVy[0] = iBooker.
book1D(
"PVY",
"y coordinate of Primary Vtx",50,-0.01,0.01);
431 h_PVx[1] = iBooker.
book1D(
"PVXFit",
"x coordinate of Primary Vtx (Last Fit)",50,-0.01,0.01);
435 h_PVy[1] = iBooker.
book1D(
"PVYFit",
"y coordinate of Primary Vtx (Last Fit)",50,-0.01,0.01);
451 pvResults=iBooker.
book2D(
"pvResults",
"Results of fitting Primary Vertices",2,0,2,6,0,6);
473 case 0 : sprintf(histo,
"x0_status");
break;
474 case 1 : sprintf(histo,
"y0_status");
break;
475 case 2 : sprintf(histo,
"z0_status");
break;
505 const std::time_t ftmptime = fbegintimestamp >> 32;
608 edm::LogInfo(
"BeamMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
616 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
620 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
629 refBS = *recoBeamSpotHandle;
634 auto tmphisto =
static_cast<TH1F*
>(
theBeamFitter->getCutFlow());
636 tmphisto->GetNbinsX(),
637 tmphisto->GetXaxis()->GetXmin(),
638 tmphisto->GetXaxis()->GetXmax());
641 for(
int n=0;
n < tmphisto->GetNbinsX();
n++)
651 for ( reco::TrackCollection::const_iterator
track = tracks->begin();
659 bool JetTrigPass=
false;
662 for (
unsigned int i=0;
i< triggerResults->
size();
i++){
665 if(JetTrigPass)
continue;
669 if(JetTrigPass)
continue;
672 size_t found = trigName.find(string_search);
674 if(found != string::npos){
676 if(triggerResults->
accept(thisTrigger_))JetTrigPass =
true;
689 for (reco::VertexCollection::const_iterator
pv = PVCollection->begin();
pv != PVCollection->end(); ++
pv) {
691 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
694 if(JetTrigPass)nPVcount_ST++;
728 map<int, std::vector<float> >::iterator itpvx=
mapPVx.begin();
729 map<int, std::vector<float> >::iterator itpvy=
mapPVy.begin();
730 map<int, std::vector<float> >::iterator itpvz=
mapPVz.begin();
732 map<int, std::vector<int> >::iterator itbspvinfo=
mapNPV.begin();
751 edm::LogInfo(
"BeamMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
755 const std::time_t fendtime = fendtimestamp >> 32;
766 int currentlumi = nextlumi;
767 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
768 lastlumi = currentlumi;
778 size_t SizeToRemovePV= rmLSPVi->second;
779 for(std::map<int, std::size_t>::iterator rmLSPVe =
mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
780 rmLSPVi->second -= SizeToRemovePV;
791 bool resetHistoFlag_=
false;
797 resetHistoFlag_ =
true;
801 int countEvtLastNLS_=0;
804 std::map< int, std::vector<int> >::iterator mnpv=
mapNPV.begin();
805 std::map< int, std::vector<float> >::iterator mpv2=
mapPVy.begin();
806 std::map< int, std::vector<float> >::iterator mpv3=
mapPVz.begin();
808 for(
std::map<
int, std::vector<float> >::iterator mpv1=
mapPVx.begin(); mpv1 !=
mapPVx.end(); ++mpv1, ++mpv2, ++mpv3, ++mnpv) {
809 std::vector<float>::iterator mpvs2 = (mpv2->second).
begin();
810 std::vector<float>::iterator mpvs3 = (mpv3->second).
begin();
811 for(std::vector<float>::iterator mpvs1=(mpv1->second).begin(); mpvs1 !=(mpv1->second).
end(); ++mpvs1, ++mpvs2, ++mpvs3){
820 for(std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).
end(); ++mnpvs){
821 if((*mnpvs > 0) && (resetHistoFlag_) )
h_nVtx_st->
Fill( (*mnpvs)*(1.0) );
823 countTotPV_ += (*mnpvs);
824 if((*mnpvs) > MaxPVs) MaxPVs = (*mnpvs);
829 char tmpTitlePV[100];
833 std::vector<float> DipPVInfo_;
836 if(countTotPV_ != 0 ){
837 DipPVInfo_.push_back((
float)countEvtLastNLS_);
842 DipPVInfo_.push_back((
float)MaxPVs);
843 DipPVInfo_.push_back((
float)countTotPV_);
846 for(
size_t i= 0;
i < 7;
i++){
848 DipPVInfo_.push_back(0.);
850 DipPVInfo_.push_back((
float)countEvtLastNLS_);
861 const int countLS_bs =
hs[k_x0_lumi]->getTH1()->GetEntries();
862 const int countLS_pv =
hs[k_PVx_lumi]->getTH1()->GetEntries();
863 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: countLS_bs = " << countLS_bs <<
" ; countLS_pv = " << countLS_pv << std::endl;
864 int LSgap_bs = currentlumi/
fitNLumi_ - countLS_bs;
865 int LSgap_pv = currentlumi/
fitPVNLumi_ - countLS_pv;
870 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: LSgap_bs = " << LSgap_bs <<
" ; LSgap_pv = " << LSgap_pv << std::endl;
872 for (
int ig = 0; ig < LSgap_bs; ig++) {
876 hs[k_sigmaX0_lumi]->ShiftFillLast( 0., 0.,
fitNLumi_ );
877 hs[k_sigmaY0_lumi]->ShiftFillLast( 0., 0.,
fitNLumi_ );
878 hs[k_sigmaZ0_lumi]->ShiftFillLast( 0., 0.,
fitNLumi_ );
881 for (
int ig = 0; ig < LSgap_pv; ig++) {
887 for (
int i=1;
i < (currentlumi - previousLS);
i++)
905 bool doPVFit =
false;
930 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus") };
932 fgaus->SetLineColor(4);
934 mean = fgaus->GetParameter(1);
935 width = fgaus->GetParameter(2);
936 meanErr = fgaus->GetParError(1);
937 widthErr = fgaus->GetParError(2);
941 hs[k_PVx_lumi_all]->setBinContent(currentlumi,mean);
942 hs[k_PVx_lumi_all]->setBinError(currentlumi,width);
945 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Event time outside current range of time histograms!" << std::endl;
947 hs[k_PVx_time]->setBinContent(nthBin,mean);
948 hs[k_PVx_time]->setBinError(nthBin,width);
952 hs[k_PVx_time_all]->setBinContent(jthBin,mean);
953 hs[k_PVx_time_all]->setBinError(jthBin,width);
963 h_PVx[1]->
getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
970 mean = fgaus->GetParameter(1);
971 width = fgaus->GetParameter(2);
972 meanErr = fgaus->GetParError(1);
973 widthErr = fgaus->GetParError(2);
975 hs[k_PVy_lumi_all]->setBinContent(currentlumi,mean);
976 hs[k_PVy_lumi_all]->setBinError(currentlumi,width);
978 hs[k_PVy_time]->setBinContent(nthBin,mean);
979 hs[k_PVy_time]->setBinError(nthBin,width);
982 hs[k_PVy_time_all]->setBinContent(jthBin,mean);
983 hs[k_PVy_time_all]->setBinError(jthBin,width);
992 h_PVy[1]->
getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
1000 mean = fgaus->GetParameter(1);
1001 width = fgaus->GetParameter(2);
1002 meanErr = fgaus->GetParError(1);
1003 widthErr = fgaus->GetParError(2);
1005 hs[k_PVz_lumi_all]->setBinContent(currentlumi,mean);
1006 hs[k_PVz_lumi_all]->setBinError(currentlumi,width);
1008 hs[k_PVz_time]->setBinContent(nthBin,mean);
1009 hs[k_PVz_time]->setBinError(nthBin,width);
1012 hs[k_PVz_time_all]->setBinContent(jthBin,mean);
1013 hs[k_PVz_time_all]->setBinError(jthBin,width);
1022 h_PVz[1]->
getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
1040 vector<BSTrkParameters> theBSvector1 =
theBeamFitter->getBSvector();
1042 size_t PreviousRecords=0;
1045 size_t SizeToRemove=0;
1046 std::map<int, std::size_t>::iterator rmls=
mapLSBSTrkSize.begin();
1047 SizeToRemove = rmls->second;
1048 if(
debug_)
edm::LogInfo(
"BeamMonitor")<<
" The size to remove is = "<< SizeToRemove << endl;
1049 int changedAfterThis=0;
1051 if(changedAfterThis > 0 ){(rmLS->second) = (rmLS->second)-SizeToRemove;
1052 if((
mapLSBSTrkSize.size()- (size_t)changedAfterThis) == 2 )PreviousRecords = (rmLS->second);
1061 std::pair<int,int> checkfitLS =
theBeamFitter->getFitLSRange();
1062 std::pair<time_t,time_t> checkfitTime =
theBeamFitter->getRefTime();
1068 vector<BSTrkParameters> theBSvector =
theBeamFitter->getBSvector();
1071 if(
debug_)
edm::LogInfo(
"BeamMonitor")<<
"FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1075 bool countFitting =
false;
1076 if (theBSvector.size() >= PreviousRecords && theBSvector.size() >=
min_Ntrks_) {
1077 countFitting =
true;
1084 const TH1F& cutFlowToSubtract =
mapLSCF.begin()->second;
1086 std::map<int, TH1F>::iterator cf =
mapLSCF.begin();
1088 for(; cf !=
mapLSCF.end(); ++cf) {
1089 cf->second.Add(&cutFlowToSubtract, -1);
1109 unsigned int itrk = 0;
1110 for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin();
1111 BSTrk != theBSvector.end(); ++BSTrk, ++itrk){
1114 double vx = BSTrk->vx();
1115 double vy = BSTrk->vy();
1116 double z0 = BSTrk->z0();
1129 if (countFitting)
edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Num of tracks collected = " <<
nthBSTrk_ << endl;
1150 <<
"; address = " << &
refBStime[0] << std::endl;
1152 <<
"; address = " << &
refBStime[1] << std::endl;
1161 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first <<
" to " << fitLS.second << std::endl;
1170 edm::LogInfo(
"BeamMonitor") <<
"\n RESULTS OF DEFAULT FIT:" << endl;
1172 edm::LogInfo(
"BeamMonitor") <<
"[BeamFitter] fitting done \n" << endl;
1180 hs[k_x0_lumi_all]->setBinContent(currentlumi,bs.
x0());
1181 hs[k_x0_lumi_all]->setBinError(currentlumi,bs.
x0Error());
1182 hs[k_y0_lumi_all]->setBinContent(currentlumi,bs.
y0());
1183 hs[k_y0_lumi_all]->setBinError(currentlumi,bs.
y0Error());
1184 hs[k_z0_lumi_all]->setBinContent(currentlumi,bs.
z0());
1185 hs[k_z0_lumi_all]->setBinError(currentlumi,bs.
z0Error());
1186 hs[k_sigmaX0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthX());
1188 hs[k_sigmaY0_lumi_all]->setBinContent(currentlumi, bs.
BeamWidthY());
1190 hs[k_sigmaZ0_lumi_all]->setBinContent(currentlumi, bs.
sigmaZ());
1191 hs[k_sigmaZ0_lumi_all]->setBinError(currentlumi, bs.
sigmaZ0Error());
1195 hs[k_x0_time]->setBinContent(nthBin, bs.
x0());
1196 hs[k_y0_time]->setBinContent(nthBin, bs.
y0());
1197 hs[k_z0_time]->setBinContent(nthBin, bs.
z0());
1198 hs[k_sigmaX0_time]->setBinContent(nthBin, bs.
BeamWidthX());
1199 hs[k_sigmaY0_time]->setBinContent(nthBin, bs.
BeamWidthY());
1200 hs[k_sigmaZ0_time]->setBinContent(nthBin, bs.
sigmaZ());
1201 hs[k_x0_time]->setBinError(nthBin, bs.
x0Error());
1202 hs[k_y0_time]->setBinError(nthBin, bs.
y0Error());
1203 hs[k_z0_time]->setBinError(nthBin, bs.
z0Error());
1211 hs[k_x0_time_all]->setBinContent(jthBin, bs.
x0());
1212 hs[k_y0_time_all]->setBinContent(jthBin, bs.
y0());
1213 hs[k_z0_time_all]->setBinContent(jthBin, bs.
z0());
1214 hs[k_sigmaX0_time_all]->setBinContent(jthBin, bs.
BeamWidthX());
1215 hs[k_sigmaY0_time_all]->setBinContent(jthBin, bs.
BeamWidthY());
1216 hs[k_sigmaZ0_time_all]->setBinContent(jthBin, bs.
sigmaZ());
1217 hs[k_x0_time_all]->setBinError(jthBin, bs.
x0Error());
1218 hs[k_y0_time_all]->setBinError(jthBin, bs.
y0Error());
1219 hs[k_z0_time_all]->setBinError(jthBin, bs.
z0Error());
1228 if (bs.
type() > 0) {
1236 double alpha = std::atan2(bs.
y0(),bs.
x0());
1237 std::unique_ptr<TF1>
f1{
new TF1(
"f1",
"[0]*sin(x-[1])",-3.14,3.14) };
1238 f1->SetParameters(amp,alpha);
1239 f1->SetParLimits(0,amp-0.1,amp+0.1);
1240 f1->SetParLimits(1,alpha-0.577,alpha+0.577);
1241 f1->SetLineColor(4);
1246 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus") };
1247 fgaus->SetParameters(mean,width);
1248 fgaus->SetLineColor(4);
1253 std::pair<int,int> LSRange =
theBeamFitter->getFitLSRange();
1255 sprintf(tmpTitle,
"%s %i %s %i",
"Fitted Beam Spot (cm) of LS: ",LSRange.first,
" to ",LSRange.second);
1263 if (bs.
type() > 0) {
1278 if (bs.
type() > 0) {
1301 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1302 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1321 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1322 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1361 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: The flag is ON for running average Beam Spot fit"<<endl;
1377 if(
debug_)
edm::LogInfo(
"BeamMonitor") <<
" RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" <<endl;
1434 char offsetTime[64];
1436 TDatime
da(offsetTime);
1439 double valErr = h->GetBinError(
lastNZbin);
1441 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1443 h->SetBinContent(bin,val);
1444 h->SetBinError(bin,valErr);
1448 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1455 bool scroll_ =
false;
1458 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Reset Time Offset" << std::endl;
1461 if (
hs[k_x0_time]->getBinContent(
bin) > 0) {
1468 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Time difference too large since last readout" << std::endl;
1473 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Offset to last record" << std::endl;
LuminosityBlockID id() const
TProfile * getTProfile() const
T getParameter(std::string const &) 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_
void setBinContent(int binx, double content)
set content of bin (1-D)
double sigmaZ0Error() const
error on sigma z
MonitorElement * reportSummary
void bookHistograms(DQMStore::IBooker &i, const edm::Run &r, const edm::EventSetup &c) override
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * bookProfile(Args &&...args)
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 &)
#define DEFINE_FWK_MODULE(type)
std::map< int, std::vector< float > > mapPVx
void analyze(const edm::Event &e, const edm::EventSetup &c) override
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
std::vector< Track > TrackCollection
collection of Tracks
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)
edm::TimeValue_t ftimestamp
edm::LuminosityBlockNumber_t luminosityBlock() const
std::vector< MonitorElement * > hs
void endRun(const edm::Run &r, const edm::EventSetup &c) override
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
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * fitResults
std::vector< std::string > jetTrigger_
MonitorElement * h_sigmaY0
double getMeanError(int axis=1) const
std::map< int, std::vector< float > > mapPVz
std::map< int, std::time_t > mapBeginPVTime
std::map< int, std::vector< int > > mapNPV
LuminosityBlockNumber_t luminosityBlock() const
std::map< int, std::time_t > mapBeginBSTime
double dydz() const
dydz slope
void update()
Mark the object updated.
void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
double dxdzError() const
error on dxdz
void setCurrentFolder(std::string const &fullpath)
unsigned int triggerIndex(std::string const &name) const
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
unsigned int size() const
Get number of paths stored.
Timestamp const & endTime() const
void formatFitTime(char *, const std::time_t &)
MonitorElement * pvResults
MonitorElement * book1D(Args &&...args)
MonitorElement * h_nVtx_lumi
double BeamWidthX() const
beam width X
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
static std::string const triggerResults
void Reset()
reset ME (ie. contents, errors, etc)
double BeamWidthXError() const
error on beam width X, assume error in X = Y
double z0Error() const
error on z
unsigned long long TimeValue_t
double dxdz() const
dxdz slope
std::map< int, TH1F > mapLSCF
double x0Error() const
error on x
double y0Error() const
error on y
bin
set the eta bin as selection string.
MonitorElement * h_nVtx_lumi_all
static const char *const trigNames[]
double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
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
T const * product() const
MonitorElement * h_PVy[2]
MonitorElement * book2D(Args &&...args)
std::string const & triggerName(unsigned int index) const
MonitorElement * reportSummaryContents[3]
double sigmaZ() const
sigma z
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 getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double y0() const
y coordinate
MonitorElement * bookFloat(Args &&...args)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * h_PVx[2]
std::map< int, int > mapBeginPVLS
TimeValue_t value() const
std::map< int, std::vector< float > > mapPVy
MonitorElement * h_d0_phi0
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
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