Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:49

0001 #include <iostream>
0002 #include <vector>
0003 #include "FWCore/Framework/interface/Event.h"
0004 #include "DataFormats/Common/interface/Handle.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 
0009 #include "OnlineDB/CSCCondDB/interface/CSCAFEBAnalyzer.h"
0010 
0011 CSCAFEBAnalyzer::CSCAFEBAnalyzer(edm::ParameterSet const& conf)
0012     : testname(conf.getParameter<std::string>("TestName")),
0013       CSCSrc_(conf.getParameter<edm::InputTag>("CSCSrc")),
0014       w_token(consumes<CSCWireDigiCollection>(CSCSrc_)) {
0015   /// If your module takes parameters, here is where you would define
0016   /// their names and types, and access them to initialize internal
0017   /// variables. Example as follows:
0018 
0019   if (testname == "AFEBThresholdScan")
0020     analysisthr_.setup(conf.getParameter<std::string>("HistogramFile"));
0021   if (testname == "AFEBConnectivity")
0022     analysiscnt_.setup(conf.getParameter<std::string>("HistogramFile"));
0023 
0024   /// get labels for input tags
0025 }
0026 
0027 void CSCAFEBAnalyzer::analyze(edm::Event const& e, edm::EventSetup const& iSetup) {
0028   /// For CSC unpacker
0029   const edm::Handle<CSCWireDigiCollection>& wire_digis = e.getHandle(w_token);
0030 
0031   if (testname == "AFEBThresholdScan")
0032     analysisthr_.analyze(*wire_digis);
0033   if (testname == "AFEBConnectivity")
0034     analysiscnt_.analyze(*wire_digis);
0035 }
0036 
0037 void CSCAFEBAnalyzer::endJob() {
0038   if (testname == "AFEBThresholdScan")
0039     analysisthr_.done();
0040   if (testname == "AFEBConnectivity")
0041     analysiscnt_.done();
0042 }