CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/DPGAnalysis/SiStripTools/plugins/L1ABCDebugger.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    SiStripTools
00004 // Class:      L1ABCDebugger
00005 // 
00013 //
00014 // Original Author:  Andrea Venturi
00015 //         Created:  Tue Jul 19 11:56:00 CEST 2009
00016 //
00017 //
00018 
00019 
00020 // system include files
00021 #include <memory>
00022 
00023 // user include files
00024 #include "TH1F.h"
00025 #include "TProfile.h"
00026 #include <vector>
00027 #include <string>
00028 
00029 #include "FWCore/Framework/interface/Frameworkfwd.h"
00030 #include "FWCore/Framework/interface/EDAnalyzer.h"
00031 
00032 #include "FWCore/Framework/interface/Event.h"
00033 #include "FWCore/Framework/interface/Run.h"
00034 #include "FWCore/Framework/interface/MakerMacros.h"
00035 
00036 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00037 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00038 
00039 #include "FWCore/Utilities/interface/InputTag.h"
00040 
00041 #include "DataFormats/Scalers/interface/L1AcceptBunchCrossing.h"
00042 //
00043 // class decleration
00044 //
00045 
00046 class L1ABCDebugger : public edm::EDAnalyzer {
00047  public:
00048     explicit L1ABCDebugger(const edm::ParameterSet&);
00049     ~L1ABCDebugger();
00050 
00051 
00052    private:
00053       virtual void beginJob() ;
00054       virtual void beginRun(const edm::Run&, const edm::EventSetup&) ;
00055       virtual void endRun(const edm::Run&, const edm::EventSetup&) ;
00056       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00057       virtual void endJob() ;
00058 
00059       // ----------member data ---------------------------
00060 
00061   edm::InputTag _l1abccollection;
00062 };
00063 
00064 //
00065 // constants, enums and typedefs
00066 //
00067 
00068 //
00069 // static data member definitions
00070 //
00071 
00072 //
00073 // constructors and destructor
00074 //
00075 L1ABCDebugger::L1ABCDebugger(const edm::ParameterSet& iConfig):
00076   _l1abccollection(iConfig.getParameter<edm::InputTag>("l1ABCCollection"))
00077 {
00078    //now do what ever initialization is needed
00079 
00080 }
00081 
00082 
00083 L1ABCDebugger::~L1ABCDebugger()
00084 {
00085  
00086    // do anything here that needs to be done at desctruction time
00087    // (e.g. close files, deallocate resources etc.)
00088 
00089 }
00090 
00091 
00092 //
00093 // member functions
00094 //
00095 
00096 // ------------ method called to for each event  ------------
00097 void
00098 L1ABCDebugger::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00099 {
00100    using namespace edm;
00101 
00102    Handle<L1AcceptBunchCrossingCollection > pIn;
00103    iEvent.getByLabel(_l1abccollection,pIn);
00104 
00105    // offset computation
00106 
00107    edm::LogInfo("L1ABCDebug") << "Dump of L1AcceptBunchCrossing Collection";
00108 
00109    for(L1AcceptBunchCrossingCollection::const_iterator l1abc=pIn->begin();l1abc!=pIn->end();++l1abc) {
00110      edm::LogVerbatim("L1ABCDebug") << *l1abc;
00111    }
00112 
00113 }
00114 
00115 void 
00116 L1ABCDebugger::beginRun(const edm::Run& iRun, const edm::EventSetup&)
00117 {}
00118 
00119 void 
00120 L1ABCDebugger::endRun(const edm::Run& iRun, const edm::EventSetup&)
00121 {
00122 }
00123 
00124 
00125 // ------------ method called once each job just before starting event loop  ------------
00126 void 
00127 L1ABCDebugger::beginJob()
00128 {
00129 
00130 }
00131 
00132 // ------------ method called once each job just after ending the event loop  ------------
00133 void 
00134 L1ABCDebugger::endJob() 
00135 {
00136 }
00137 
00138 
00139 //define this as a plug-in
00140 DEFINE_FWK_MODULE(L1ABCDebugger);