#include <DQMSourceExample.h>
* DQM Test Client
Definition at line 23 of file DQMSourceExample.h.
DQMSourceExample::DQMSourceExample | ( | const edm::ParameterSet & | ps | ) |
Definition at line 25 of file DQMSourceExample.cc.
{ parameters_ = ps; initialize(); }
DQMSourceExample::~DQMSourceExample | ( | ) |
Definition at line 30 of file DQMSourceExample.cc.
{ }
void DQMSourceExample::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 163 of file DQMSourceExample.cc.
References gather_cfg::cout, validate-o2o-wbm::f1, i, funct::log(), p1, p2, x, detailsBasic3DVector::y, and z.
{ counterEvt_++; if (prescaleEvt_<1) return; if (prescaleEvt_ > 0 && counterEvt_%prescaleEvt_!=0) return; // cout << " processing conterEvt_: " << counterEvt_ <<endl; // fill integer and float // number exceeding 32 bits i1->Fill(400000000000000LL); // FIXME use double f1->Fill(-3.14); //---------------------------------------- // Filling the histograms with random data //---------------------------------------- srand( 0 ); // fill summ histo if(counterEvt_%1000 == 0) { cout << " # of events = " << counterEvt_ << endl; summ->Fill(counterEvt_/1000., counterEvt_); } // fill summ histo if(counterEvt_%100 == 0) { h1hist->ShiftFillLast(gRandom->Gaus(12,1.),1.,5); } float z = gRandom->Uniform(XMAX); xTrue->Fill( z, 1./log(z+1.) ); xFalse->Fill( z+(XMAX/2.), z ); yTrue->Fill( z, 1./log(z+1.) ); yFalse->Fill( z, z ); meanTrue->Fill( gRandom->Gaus(10, 2), 1.); meanFalse->Fill( gRandom->Gaus(12, 3), 1.); wExpTrue->Fill( gRandom->Gaus(12, 1), gRandom->Gaus(12, 1), 1.); wExpFalse->Fill( gRandom->Gaus(20, 2), gRandom->Gaus(20, 2), 1.); deadTrue->Fill( gRandom->Gaus(20, 10), 2.); deadFalse->Fill( gRandom->Gaus(20, 4), 1.); h2->Fill( gRandom->Gaus(20, 4), 1.); // h3->Fill( XMIN, 0xffff00000000LL); // h4->Fill( XMIN, XMIN, 0xffff00000000LL); //h1hist->Print(); //h1hist->Print(); for ( int i = 0; i != 10; ++i ) { float w = gRandom->Uniform(XMAX); noisyTrue->Fill( w, 1.); noisyFalse->Fill( z, 1.); float x = gRandom->Gaus(12, 1); float y = gRandom->Gaus(20, 2); p1->Fill(x, y); p2->Fill(x, y, (x+y)/2.); h1->Fill(y, 1.); } // usleep(100); }
void DQMSourceExample::beginJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 63 of file DQMSourceExample.cc.
References DQMStore::book1D(), DQMStore::book1S(), DQMStore::book2D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), dbe_, validate-o2o-wbm::f1, i, NBINS, cmsCodeRules::cppFunctionSkipper::operator, p1, p2, DQMStore::setCurrentFolder(), DQMStore::showDirStructure(), DQMStore::tag(), DQMStore::tagContents(), and cond::rpcobtemp::temp.
{ dbe_ = Service<DQMStore>().operator->(); dbe_->setCurrentFolder(monitorName_+"DQMsource/Summary"); summ = dbe_->book1D("summary", "Run Summary", 100, 0, 100); //------------------------------------- // testing of Quality Tests //------------------------------------- dbe_->setCurrentFolder(monitorName_+"DQMsource/QTests"); NBINS = 40 ; XMIN = 0.; XMAX = 40.; xTrue = dbe_->book1D("XTrue", "X Range QTest", NBINS, XMIN, XMAX); xFalse = dbe_->book1D("XFalse", "X Range QTest", NBINS, XMIN, XMAX); yTrue = dbe_->book1D("YTrue", "Y Range QTest", NBINS, XMIN, XMAX); yFalse = dbe_->book1D("YFalse", "Y Range QTest", NBINS, XMIN, XMAX); wExpTrue = dbe_->book2D("WExpTrue", "Contents Within Expected QTest", NBINS, XMIN, XMAX, NBINS, XMIN, XMAX); wExpFalse = dbe_->book2D("WExpFalse", "Contents Within Expected QTest", NBINS, XMIN, XMAX, NBINS, XMIN, XMAX); meanTrue = dbe_->book1D("MeanTrue", "Mean Within Expected QTest", NBINS, XMIN, XMAX); meanFalse = dbe_->book1D("MeanFalse", "Mean Within Expected QTest", NBINS, XMIN, XMAX); deadTrue = dbe_->book1D("DeadTrue", "Dead Channel QTest", NBINS, XMIN, XMAX); deadFalse = dbe_->book1D("DeadFalse", "Dead Channel QTest", NBINS, XMIN, XMAX); noisyTrue = dbe_->book1D("NoisyTrue", "Noisy Channel QTest", NBINS, XMIN, XMAX); noisyFalse = dbe_->book1D("NoisyFalse", "Noisy Channel QTest", NBINS, XMIN, XMAX); //------------------------------------- // book several ME more //------------------------------------- dbe_->setCurrentFolder(monitorName_+"DQMsource/C1"); const int NBINS2 = 10; i1 = dbe_->bookInt("int1"); f1 = dbe_->bookFloat("float1"); s1 = dbe_->bookString("s1", "My string"); h1 = dbe_->book1D("h1f", "Example TH1F 1D histogram.", NBINS2, XMIN, XMAX); h2 = dbe_->book1S("h1s", "Example TH1S histogram.", NBINS, XMIN, XMAX); // h3 = dbe_->book1DD("h1d", "Example TH1D histogram.", NBINS, XMIN, XMAX); // h4 = dbe_->book2DD("h2d", "Example TH2D histogram.", NBINS, XMIN, XMAX,NBINS, XMIN, XMAX); p1 = dbe_->bookProfile( "prof1", "My profile 1D", NBINS,XMIN,XMAX,NBINS,XMIN,XMAX,""); p2 = dbe_->bookProfile2D("prof2", "My profile 2D", NBINS,XMIN,XMAX,NBINS,XMIN,XMAX,NBINS,XMIN,XMAX,""); h1hist = dbe_->book1D("history 1D","Example 1 1D history plot", 30, 0.,30.); // set labels for h1 char temp[1024]; for(int i = 1; i <= NBINS2; ++i) { sprintf(temp, " bin no. %d", i); h1->setBinLabel(i, temp); } // assign tag to MEs h1 const unsigned int detector_id = 17; dbe_->tag(h1, detector_id); // tag full directory dbe_->tagContents(monitorName_+"DQMsource/C1", detector_id); /* // contents of h5 & h6 will be reset at end of monitoring cycle h5->setResetMe(true); h6->setResetMe(true); dbe_->showDirStructure(); std::vector<std::string> tags; dbe_->getAllTags(tags); for (size_t i = 0, e = tags.size(); i < e; ++i) std::cout << "TAGS [" << i << "] = " << tags[i] << std::endl; */ dbe_->showDirStructure (); }
void DQMSourceExample::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | context | ||
) | [protected, virtual] |
void DQMSourceExample::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
void DQMSourceExample::endJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 240 of file DQMSourceExample.cc.
References gather_cfg::cout.
{ std::cout << "DQMSourceExample::endJob()" << std::endl; }
void DQMSourceExample::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
void DQMSourceExample::endRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
void DQMSourceExample::initialize | ( | ) | [private] |
Definition at line 36 of file DQMSourceExample.cc.
References gather_cfg::cout, dbe_, and cmsCodeRules::cppFunctionSkipper::operator.
{ counterEvt_ = 0; counterLS_ = 0; dbe_ = Service<DQMStore>().operator->(); monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","YourSubsystemName"); cout << "DQMSourceExample: Monitor name = " << monitorName_ << endl; if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ; prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1); cout << "DQMSourceExample: DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl; prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1); cout << "DQMSourceExample: DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl; // read in files (use DQMStore.collateHistograms = True for summing // dbe_->load("ref.root"); // dbe_->load("ref.root"); }
int DQMSourceExample::counterEvt_ [private] |
Definition at line 61 of file DQMSourceExample.h.
int DQMSourceExample::counterLS_ [private] |
Definition at line 62 of file DQMSourceExample.h.
DQMStore* DQMSourceExample::dbe_ [private] |
Definition at line 58 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::deadFalse [private] |
Definition at line 84 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::deadTrue [private] |
Definition at line 83 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::f1 [private] |
Definition at line 90 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::h1 [private] |
Definition at line 94 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::h1hist [private] |
Definition at line 95 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::h2 [private] |
Definition at line 96 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::h3 [private] |
Definition at line 97 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::h4 [private] |
Definition at line 98 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::i1 [private] |
Definition at line 89 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::meanFalse [private] |
Definition at line 81 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::meanTrue [private] |
Definition at line 80 of file DQMSourceExample.h.
std::string DQMSourceExample::monitorName_ [private] |
Definition at line 59 of file DQMSourceExample.h.
int DQMSourceExample::NBINS [private] |
Definition at line 69 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::noisyFalse [private] |
Definition at line 86 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::noisyTrue [private] |
Definition at line 85 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::p1 [private] |
Definition at line 92 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::p2 [private] |
Definition at line 93 of file DQMSourceExample.h.
Definition at line 56 of file DQMSourceExample.h.
int DQMSourceExample::prescaleEvt_ [private] |
Definition at line 64 of file DQMSourceExample.h.
int DQMSourceExample::prescaleLS_ [private] |
Definition at line 65 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::s1 [private] |
Definition at line 91 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::summ [private] |
Definition at line 99 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::wExpFalse [private] |
Definition at line 79 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::wExpTrue [private] |
Definition at line 78 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::xFalse [private] |
Definition at line 74 of file DQMSourceExample.h.
float DQMSourceExample::XMAX [private] |
Definition at line 70 of file DQMSourceExample.h.
float DQMSourceExample::XMIN [private] |
Definition at line 70 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::xTrue [private] |
Definition at line 73 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::yFalse [private] |
Definition at line 76 of file DQMSourceExample.h.
MonitorElement* DQMSourceExample::yTrue [private] |
Definition at line 75 of file DQMSourceExample.h.