55 Ntracks_(0), fitNLumi_(0), ALARM_ON_(
false), BeamSpotStatus_(0), BeamSpotFromDB_(0){
96 string coord[nvar_] = {
"BeamSpotStatus"};
100 for (
int i = 0;
i < 1;
i++) {
102 for (
int ic=0; ic<nvar_; ++ic) {
103 TString histName(coord[ic]);
104 TString histTitle(coord[ic]);
105 string ytitle(
"Problem (-1) / OK (1)");
108 bool createHisto =
true;
113 xtitle =
"Lumisection";
116 hs[histName] =
dbe_->
book1D(histName,histTitle,40,0.5,40.5);
117 hs[histName]->setAxisTitle(xtitle,1);
118 hs[histName]->setAxisTitle(ytitle,2);
122 hs[histName] =
dbe_->
book1D(histName,histTitle,40,0.5,40.5);
123 hs[histName]->getTH1()->SetBit(TH1::kCanRebin);
124 hs[histName]->setAxisTitle(xtitle,1);
125 hs[histName]->setAxisTitle(ytitle,2);
148 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"TimeOffset = ";
163 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"beginLuminosityBlock:: Next Lumi to Fit: " <<
nextlumi_ << endl;
169 edm::LogInfo(
"BeamSpotProblemMonitor") <<
" beginLuminosityBlock:: Next Lumi to Fit: " <<
nextlumi_ << endl;
173 edm::LogInfo(
"BeamSpotProblemMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
186 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
190 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
199 iEvent.
getByLabel(
"scalersRawToDigi", dcsStatus);
201 for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin();
202 dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
212 for (
int i=0;
i<5;
i++)
225 for ( reco::TrackCollection::const_iterator track = tracks->begin();track != tracks->end();++track )
240 bool fallBackToDB=
false;
244 if (handleScaler->size()!=0)
246 spotOnline = * ( handleScaler->begin() );
249 if ( spotOnline.
x() == 0. &&
250 spotOnline.
y() == 0. &&
251 spotOnline.
z() == 0. &&
284 int currentlumi = nextlumi;
285 lastlumi = currentlumi;
306 const int countLS_bs =
hs[
"BeamSpotStatus_lumi"]->getTH1()->GetEntries();
307 int LSgap_bs = currentlumi/
fitNLumi_ - countLS_bs;
308 if (currentlumi%
fitNLumi_ == 0)LSgap_bs--;
312 for (
int ig = 0; ig < LSgap_bs; ig++) {
313 hs[
"BeamSpotStatus_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
322 hs[
"BeamSpotStatus_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
351 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
360 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)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
#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
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")
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
LuminosityBlockNumber_t luminosityBlock() const
T const * product() const
MonitorElement * BeamSpotError
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 &)