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()->SetBit(TH1::kCanRebin);
122 hs[histName]->setAxisTitle(xtitle,1);
123 hs[histName]->setAxisTitle(ytitle,2);
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->size()!=0)
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_ );
349 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
358 if(
debug_)
edm::LogInfo(
"BeamSpotProblemMonitor") <<
"endRun:: Clearing all the Maps "<<endl;
LuminosityBlockID id() const
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)
void analyze(const edm::Event &e, const edm::EventSetup &c)
edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
std::vector< Track > TrackCollection
collection of Tracks
edm::LuminosityBlockNumber_t luminosityBlock() const
std::map< TString, MonitorElement * > hs
edm::ParameterSet parameters_
void endRun(const edm::Run &r, const edm::EventSetup &c)
const std::string & getMessage(void) const
get message attached to test
LuminosityBlockNumber_t luminosityBlock() const
edm::EDGetTokenT< BeamSpotOnlineCollection > scalertag_
BeamSpotProblemMonitor(const edm::ParameterSet &)
~BeamSpotProblemMonitor()
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
LuminosityBlockNumber_t luminosityBlock() const
T const * product() const
MonitorElement * BeamSpotError
volatile std::atomic< bool > shutdown_flag false
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 Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
void FillPlots(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)