36 counterEvt_ = 0; counterLS_ = 0;
42 monitorName_ = parameters_.getUntrackedParameter<
string>(
"monitorName",
"YourSubsystemName");
43 cout <<
"DQMSourceExample: Monitor name = " << monitorName_ << endl;
44 if (!monitorName_.empty() ) monitorName_ = monitorName_+
"/" ;
47 prescaleLS_ = parameters_.getUntrackedParameter<
int>(
"prescaleLS", -1);
48 cout <<
"DQMSourceExample: DQM lumi section prescale = " << prescaleLS_ <<
" lumi section(s)"<< endl;
49 prescaleEvt_ = parameters_.getUntrackedParameter<
int>(
"prescaleEvt", -1);
50 cout <<
"DQMSourceExample: DQM event prescale = " << prescaleEvt_ <<
" events(s)"<< endl;
65 dbe_->setCurrentFolder(monitorName_+
"DQMsource/Summary");
66 summ =
dbe_->book1D(
"summary",
"Run Summary", 100, 0, 100);
73 dbe_->setCurrentFolder(monitorName_+
"DQMsource/QTests");
76 NBINS = 40 ; XMIN = 0.; XMAX = 40.;
81 xTrue =
dbe_->book1D(
"XTrue",
"X Range QTest",
NBINS, XMIN, XMAX);
82 xFalse =
dbe_->book1D(
"XFalse",
"X Range QTest",
NBINS, XMIN, XMAX);
83 yTrue =
dbe_->book1D(
"YTrue",
"Y Range QTest",
NBINS, XMIN, XMAX);
84 yFalse =
dbe_->book1D(
"YFalse",
"Y Range QTest",
NBINS, XMIN, XMAX);
85 wExpTrue =
dbe_->book2D(
"WExpTrue",
"Contents Within Expected QTest",
NBINS, XMIN, XMAX,
NBINS, XMIN, XMAX);
86 wExpFalse =
dbe_->book2D(
"WExpFalse",
"Contents Within Expected QTest",
NBINS, XMIN, XMAX,
NBINS, XMIN, XMAX);
87 meanTrue =
dbe_->book1D(
"MeanTrue",
"Mean Within Expected QTest",
NBINS, XMIN, XMAX);
88 meanFalse =
dbe_->book1D(
"MeanFalse",
"Mean Within Expected QTest",
NBINS, XMIN, XMAX);
89 deadTrue =
dbe_->book1D(
"DeadTrue",
"Dead Channel QTest",
NBINS, XMIN, XMAX);
90 deadFalse =
dbe_->book1D(
"DeadFalse",
"Dead Channel QTest",
NBINS, XMIN, XMAX);
91 noisyTrue =
dbe_->book1D(
"NoisyTrue",
"Noisy Channel QTest",
NBINS, XMIN, XMAX);
92 noisyFalse =
dbe_->book1D(
"NoisyFalse",
"Noisy Channel QTest",
NBINS, XMIN, XMAX);
100 dbe_->setCurrentFolder(monitorName_+
"DQMsource/C1");
101 const int NBINS2 = 10;
103 i1 =
dbe_->bookInt(
"int1");
104 f1 =
dbe_->bookFloat(
"float1");
105 s1 =
dbe_->bookString(
"s1",
"My string");
106 h1 =
dbe_->book1D(
"h1f",
"Example TH1F 1D histogram.", NBINS2, XMIN, XMAX);
107 h2 =
dbe_->book1S(
"h1s",
"Example TH1S histogram.",
NBINS, XMIN, XMAX);
110 p1 =
dbe_->bookProfile(
"prof1",
"My profile 1D",
NBINS,XMIN,XMAX,
NBINS,XMIN,XMAX,
"");
111 p2 =
dbe_->bookProfile2D(
"prof2",
"My profile 2D",
NBINS,XMIN,XMAX,
NBINS,XMIN,XMAX,
NBINS,XMIN,XMAX,
"");
112 h1hist =
dbe_->book1D(
"history 1D",
"Example 1 1D history plot", 30, 0.,30.);
116 for(
int i = 1;
i <= NBINS2; ++
i) {
117 sprintf(temp,
" bin no. %d",
i);
118 h1->setBinLabel(
i, temp);
122 const unsigned int detector_id = 17;
123 dbe_->tag(h1, detector_id);
126 dbe_->tagContents(monitorName_+
"DQMsource/C1", detector_id);
138 dbe_->showDirStructure ();
152 if (prescaleEvt_<1)
return;
153 if (prescaleEvt_ > 0 && counterEvt_%prescaleEvt_!=0)
return;
158 i1->Fill(400000000000000LL);
167 if(counterEvt_%1000 == 0) {
168 cout <<
" # of events = " << counterEvt_ << endl;
169 summ->Fill(counterEvt_/1000., counterEvt_);
172 if(counterEvt_%100 == 0) {
173 h1hist->ShiftFillLast(gRandom->Gaus(12,1.),1.,5);
176 float z = gRandom->Uniform(XMAX);
177 xTrue->Fill( z, 1./
log(z+1.) );
178 xFalse->Fill( z+(XMAX/2.), z );
179 yTrue->Fill( z, 1./
log(z+1.) );
180 yFalse->Fill( z, z );
181 meanTrue->Fill( gRandom->Gaus(10, 2), 1.);
182 meanFalse->Fill( gRandom->Gaus(12, 3), 1.);
183 wExpTrue->Fill( gRandom->Gaus(12, 1), gRandom->Gaus(12, 1), 1.);
184 wExpFalse->Fill( gRandom->Gaus(20, 2), gRandom->Gaus(20, 2), 1.);
185 deadTrue->Fill( gRandom->Gaus(20, 10), 2.);
186 deadFalse->Fill( gRandom->Gaus(20, 4), 1.);
187 h2->Fill( gRandom->Gaus(20, 4), 1.);
194 for (
int i = 0;
i != 10; ++
i ) {
195 float w = gRandom->Uniform(XMAX);
196 noisyTrue->Fill( w, 1.);
197 noisyFalse->Fill( z, 1.);
198 float x = gRandom->Gaus(12, 1);
199 float y = gRandom->Gaus(20, 2);
201 p2->Fill(x, y, (x+y)/2.);
220 std::cout <<
"DQMSourceExample::endJob()" << std::endl;
static AlgebraicMatrix initialize()
~DQMSourceExample() override
DQMSourceExample(const edm::ParameterSet &)
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
void endRun(const edm::Run &r, const edm::EventSetup &c) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override