Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:39

0001 //
0002 // Original Author:  Dorian Kcira
0003 //         Created:  Thu Feb 23 18:50:29 CET 2006
0004 //
0005 //
0006 // test HistId classes of SiStrip
0007 
0008 // system include files
0009 #include <memory>
0010 #include <iostream>
0011 
0012 // user include files
0013 #include "DQM/SiStripCommon/interface/SiStripHistoId.h"
0014 #include "FWCore/Framework/interface/Frameworkfwd.h"
0015 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0017 
0018 class testSiStripHistId : public edm::global::EDAnalyzer<> {
0019 public:
0020   explicit testSiStripHistId(const edm::ParameterSet&);
0021   ~testSiStripHistId() = default;
0022 
0023 private:
0024   void analyze(edm::StreamID, edm::Event const& iEvent, edm::EventSetup const& iSetup) const override;
0025 };
0026 
0027 testSiStripHistId::testSiStripHistId(const edm::ParameterSet& iConfig) {}
0028 
0029 void testSiStripHistId::analyze(edm::StreamID, edm::Event const& iEvent, edm::EventSetup const& iSetup) const {
0030   // use SistripHistoId for producing histogram id (and title)
0031   SiStripHistoId hidmanager;
0032   edm::LogPrint("testSiStripHistId") << "------------------------------------";
0033   std::string hid1 = hidmanager.createHistoId("Cluster Distribution", "det", 2345698);
0034   edm::LogPrint("testSiStripHistId") << "created hid1: >>" << hid1 << "<<";
0035   std::string hid2 = hidmanager.createHistoId("Cluster Distribution", "fec", 1234);
0036   edm::LogPrint("testSiStripHistId") << "created hid2: >>" << hid2 << "<<";
0037   std::string hid3 = hidmanager.createHistoId("Cluster Distribution", "fed", 5678);
0038   edm::LogPrint("testSiStripHistId") << "created hid3: >>" << hid3 << "<<";
0039   edm::LogPrint("testSiStripHistId") << "------------------------------------";
0040   edm::LogPrint("testSiStripHistId") << "hid1 component id / component type: " << hidmanager.getComponentId(hid1)
0041                                      << " / " << hidmanager.getComponentType(hid1);
0042   edm::LogPrint("testSiStripHistId") << "hid2 component id / component type: " << hidmanager.getComponentId(hid2)
0043                                      << " / " << hidmanager.getComponentType(hid2);
0044   edm::LogPrint("testSiStripHistId") << "hid3 component id / component type: " << hidmanager.getComponentId(hid3)
0045                                      << " / " << hidmanager.getComponentType(hid3);
0046   edm::LogPrint("testSiStripHistId") << "------------------------------------";
0047   std::string hid4 = "just for_testing% _#31";
0048   edm::LogPrint("testSiStripHistId") << "hid4=" << hid4;
0049   edm::LogPrint("testSiStripHistId") << "hid4 component id / component type: " << hidmanager.getComponentId(hid4)
0050                                      << " / " << hidmanager.getComponentType(hid4);
0051   edm::LogPrint("testSiStripHistId") << "------------------------------------";
0052 }
0053 
0054 //define this as a plug-in
0055 #include "FWCore/Framework/interface/MakerMacros.h"
0056 DEFINE_FWK_MODULE(testSiStripHistId);