39 counterEvt_ = 0; counterLS_ = 0;
45 monitorName_ = parameters_.getUntrackedParameter<
string>(
"monitorName",
"YourSubsystemName");
46 cout <<
"DQMSourceExample: Monitor name = " << monitorName_ << endl;
47 if (monitorName_ !=
"" ) monitorName_ = monitorName_+
"/" ;
50 prescaleLS_ = parameters_.getUntrackedParameter<
int>(
"prescaleLS", -1);
51 cout <<
"DQMSourceExample: DQM lumi section prescale = " << prescaleLS_ <<
" lumi section(s)"<< endl;
52 prescaleEvt_ = parameters_.getUntrackedParameter<
int>(
"prescaleEvt", -1);
53 cout <<
"DQMSourceExample: DQM event prescale = " << prescaleEvt_ <<
" events(s)"<< endl;
69 summ =
dbe_->
book1D(
"summary",
"Run Summary", 100, 0, 100);
79 NBINS = 40 ; XMIN = 0.; XMAX = 40.;
88 wExpTrue =
dbe_->
book2D(
"WExpTrue",
"Contents Within Expected QTest",
NBINS, XMIN, XMAX,
NBINS, XMIN, XMAX);
89 wExpFalse =
dbe_->
book2D(
"WExpFalse",
"Contents Within Expected QTest",
NBINS, XMIN, XMAX,
NBINS, XMIN, XMAX);
90 meanTrue =
dbe_->
book1D(
"MeanTrue",
"Mean Within Expected QTest",
NBINS, XMIN, XMAX);
91 meanFalse =
dbe_->
book1D(
"MeanFalse",
"Mean Within Expected QTest",
NBINS, XMIN, XMAX);
92 deadTrue =
dbe_->
book1D(
"DeadTrue",
"Dead Channel QTest",
NBINS, XMIN, XMAX);
93 deadFalse =
dbe_->
book1D(
"DeadFalse",
"Dead Channel QTest",
NBINS, XMIN, XMAX);
94 noisyTrue =
dbe_->
book1D(
"NoisyTrue",
"Noisy Channel QTest",
NBINS, XMIN, XMAX);
95 noisyFalse =
dbe_->
book1D(
"NoisyFalse",
"Noisy Channel QTest",
NBINS, XMIN, XMAX);
104 const int NBINS2 = 10;
109 h1 =
dbe_->
book1D(
"h1f",
"Example TH1F 1D histogram.", NBINS2, XMIN, XMAX);
110 h2 =
dbe_->
book1S(
"h1s",
"Example TH1S histogram.",
NBINS, XMIN, XMAX);
114 p2 =
dbe_->
bookProfile2D(
"prof2",
"My profile 2D",
NBINS,XMIN,XMAX,
NBINS,XMIN,XMAX,
NBINS,XMIN,XMAX,
"");
115 h1hist =
dbe_->
book1D(
"history 1D",
"Example 1 1D history plot", 30, 0.,30.);
119 for(
int i = 1;
i <= NBINS2; ++
i) {
120 sprintf(temp,
" bin no. %d",
i);
121 h1->setBinLabel(
i, temp);
125 const unsigned int detector_id = 17;
165 if (prescaleEvt_<1)
return;
166 if (prescaleEvt_ > 0 && counterEvt_%prescaleEvt_!=0)
return;
171 i1->Fill(400000000000000LL);
180 if(counterEvt_%1000 == 0) {
181 cout <<
" # of events = " << counterEvt_ << endl;
182 summ->Fill(counterEvt_/1000., counterEvt_);
185 if(counterEvt_%100 == 0) {
186 h1hist->ShiftFillLast(gRandom->Gaus(12,1.),1.,5);
189 float z = gRandom->Uniform(XMAX);
190 xTrue->Fill( z, 1./
log(z+1.) );
191 xFalse->Fill( z+(XMAX/2.), z );
192 yTrue->Fill( z, 1./
log(z+1.) );
193 yFalse->Fill( z, z );
194 meanTrue->Fill( gRandom->Gaus(10, 2), 1.);
195 meanFalse->Fill( gRandom->Gaus(12, 3), 1.);
196 wExpTrue->Fill( gRandom->Gaus(12, 1), gRandom->Gaus(12, 1), 1.);
197 wExpFalse->Fill( gRandom->Gaus(20, 2), gRandom->Gaus(20, 2), 1.);
198 deadTrue->Fill( gRandom->Gaus(20, 10), 2.);
199 deadFalse->Fill( gRandom->Gaus(20, 4), 1.);
200 h2->Fill( gRandom->Gaus(20, 4), 1.);
207 for (
int i = 0;
i != 10; ++
i ) {
208 float w = gRandom->Uniform(XMAX);
209 noisyTrue->Fill( w, 1.);
210 noisyFalse->Fill( z, 1.);
211 float x = gRandom->Gaus(12, 1);
212 float y = gRandom->Gaus(20, 2);
214 p2->Fill(x, y, (x+y)/2.);
241 std::cout <<
"DQMSourceExample::endJob()" << std::endl;
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
DQMSourceExample(const edm::ParameterSet &)
MonitorElement * bookFloat(const char *name)
Book float.
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * bookString(const char *name, const char *value)
Book string.
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
void endRun(const edm::Run &r, const edm::EventSetup &c)
void showDirStructure(void) const
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void setCurrentFolder(const std::string &fullpath)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")