49 Ntracks_(0), fitNLumi_(0), ALARM_ON_(
false), BeamSpotStatus_(0), BeamSpotFromDB_(0){
56 scalertag_ = consumes<BeamSpotOnlineCollection>(
58 trkSrc_ = consumes<reco::TrackCollection>(
94 string coord[nvar_] = {
"BeamSpotStatus"};
98 for (
int i = 0;
i < 1;
i++) {
100 for (
int ic=0; ic<nvar_; ++ic) {
101 TString histName(coord[ic]);
102 TString histTitle(coord[ic]);
103 string ytitle(
"Problem (-1) / OK (1)");
106 bool createHisto =
true;
111 xtitle =
"Lumisection";
114 hs[histName] =
dbe_->book1D(histName,histTitle,40,0.5,40.5);
115 hs[histName]->setAxisTitle(xtitle,1);
116 hs[histName]->setAxisTitle(ytitle,2);
120 hs[histName] =
dbe_->book1D(histName,histTitle,40,0.5,40.5);
121 hs[histName]->getTH1()->SetCanExtend(TH1::kAllAxes);
122 hs[histName]->setAxisTitle(xtitle,1);
123 hs[histName]->setAxisTitle(ytitle,2);
130 BeamSpotError =
dbe_->book1D(
"BeamSpotError",
"ERROR: Beamspot missing from scalars",20,0.5,20.5);
146 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"TimeOffset = ";
161 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"beginLuminosityBlock:: Next Lumi to Fit: " <<
nextlumi_ << endl;
167 edm::LogInfo(
"BeamSpotProblemMonitor") <<
" beginLuminosityBlock:: Next Lumi to Fit: " <<
nextlumi_ << endl;
171 edm::LogInfo(
"BeamSpotProblemMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
184 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
188 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
199 for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
200 dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
210 for (
int i=0;
i<5;
i++)
223 for ( reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end();++
track )
238 bool fallBackToDB=
false;
242 if (!handleScaler->empty())
244 spotOnline = * ( handleScaler->begin() );
247 if ( spotOnline.
x() == 0. &&
248 spotOnline.
y() == 0. &&
249 spotOnline.
z() == 0. &&
282 int currentlumi = nextlumi;
283 lastlumi = currentlumi;
304 const int countLS_bs =
hs[
"BeamSpotStatus_lumi"]->getTH1()->GetEntries();
305 int LSgap_bs = currentlumi/
fitNLumi_ - countLS_bs;
306 if (currentlumi%
fitNLumi_ == 0)LSgap_bs--;
310 for (
int ig = 0; ig < LSgap_bs; ig++) {
311 hs[
"BeamSpotStatus_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
320 hs[
"BeamSpotStatus_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
348 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
357 if(
debug_)
edm::LogInfo(
"BeamSpotProblemMonitor") <<
"endRun:: Clearing all the Maps "<<endl;
LuminosityBlockID id() const
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
T getUntrackedParameter(std::string const &, T const &) const
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
edm::LuminosityBlockNumber_t luminosityBlock() const
std::map< TString, MonitorElement * > hs
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
edm::ParameterSet parameters_
LuminosityBlockNumber_t luminosityBlock() const
edm::EDGetTokenT< BeamSpotOnlineCollection > scalertag_
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeamSpotProblemMonitor(const edm::ParameterSet &)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
void endRun(const edm::Run &r, const edm::EventSetup &c) override
void Reset()
reset ME (ie. contents, errors, etc)
~BeamSpotProblemMonitor() override
T const * product() const
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * BeamSpotError
edm::EDGetTokenT< reco::TrackCollection > trkSrc_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void FillPlots(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)