Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3-gex138A Replace access by label with access using token in CalibCalorimetry/EcalPedestalOffsets #39186

Merged
merged 1 commit into from Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 8 additions & 9 deletions CalibCalorimetry/EcalPedestalOffsets/interface/testChannel.h
Expand Up @@ -58,18 +58,17 @@ class testChannel : public edm::one::EDAnalyzer<> {
private:
int getHeaderSMId(const int headerId);

std::string m_digiCollection; //! secondary name given to collection of digis
std::string m_digiProducer; //! name of module/plugin/producer making digis
std::string m_headerProducer; //! name of module/plugin/producer making headers
const edm::EDGetTokenT<EBDigiCollection> m_digiProducerToken; //! Token to access digis
const edm::EDGetTokenT<EcalRawDataCollection> m_headerProducerToken; //! Token to access headers

std::string m_xmlFile; //! name of the xml file to be saved
const std::string m_xmlFile; //! name of the xml file to be saved

int m_DACmin;
int m_DACmax;
double m_RMSmax;
int m_bestPed;
const int m_DACmin;
const int m_DACmax;
const double m_RMSmax;
const int m_bestPed;

int m_xtal;
const int m_xtal;

TH2F m_pedVSDAC;
TH2F m_singlePedVSDAC_1;
Expand Down
17 changes: 8 additions & 9 deletions CalibCalorimetry/EcalPedestalOffsets/src/testChannel.cc
Expand Up @@ -15,9 +15,10 @@

//! ctor
testChannel::testChannel(const edm::ParameterSet &paramSet)
: m_digiCollection(paramSet.getParameter<std::string>("digiCollection")),
m_digiProducer(paramSet.getParameter<std::string>("digiProducer")),
m_headerProducer(paramSet.getParameter<std::string>("headerProducer")),
: m_digiProducerToken(
consumes<EBDigiCollection>(edm::InputTag(paramSet.getParameter<std::string>("digiProducer")))),
m_headerProducerToken(
consumes<EcalRawDataCollection>(edm::InputTag(paramSet.getParameter<std::string>("headerProducer")))),
m_xmlFile(paramSet.getParameter<std::string>("xmlFile")),
m_DACmin(paramSet.getParameter<int>("DACmin")),
m_DACmax(paramSet.getParameter<int>("DACmax")),
Expand Down Expand Up @@ -66,10 +67,9 @@ void testChannel::analyze(edm::Event const &event, edm::EventSetup const &eventS

// get the headers
// (one header for each supermodule)
edm::Handle<EcalRawDataCollection> DCCHeaders;
event.getByLabel(m_headerProducer, DCCHeaders);
const edm::Handle<EcalRawDataCollection> &DCCHeaders = event.getHandle(m_headerProducerToken);
if (!DCCHeaders.isValid()) {
edm::LogError("testChannel") << "Error! can't get the product " << m_headerProducer.c_str();
edm::LogError("testChannel") << "Error! can't get the product for EcalRawDataCollection";
}

std::map<int, int> DACvalues;
Expand All @@ -85,10 +85,9 @@ void testChannel::analyze(edm::Event const &event, edm::EventSetup const &eventS

// get the digis
// (one digi for each crystal)
edm::Handle<EBDigiCollection> pDigis;
event.getByLabel(m_digiProducer, pDigis);
const edm::Handle<EBDigiCollection> &pDigis = event.getHandle(m_digiProducerToken);
if (!pDigis.isValid()) {
edm::LogError("testChannel") << "Error! can't get the product " << m_digiCollection.c_str();
edm::LogError("testChannel") << "Error! can't get the product for EBDigiCollection";
}

// loop over the digis
Expand Down