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

Remove constructors taking CSCDMBStatusDigi from CSCDMBHeader and CSCDMBTrailer #26552

Merged
merged 2 commits into from Apr 29, 2019
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
9 changes: 2 additions & 7 deletions EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h
Expand Up @@ -4,10 +4,10 @@
#include <cassert>
#include <iosfwd>
#include <cstring> // bzero
#include <memory>
#include "FWCore/Utilities/interface/Exception.h"
#include "DataFormats/CSCDigi/interface/CSCDMBStatusDigi.h"
#include "EventFilter/CSCRawToDigi/interface/CSCVDMBHeaderFormat.h"
#include <boost/shared_ptr.hpp>

struct CSCDMBHeader2005;
struct CSCDMBHeader2013;
Expand All @@ -19,11 +19,6 @@ class CSCDMBHeader {

CSCDMBHeader(const uint16_t * buf, uint16_t firmware_version = 2005);

CSCDMBHeader(const CSCDMBStatusDigi & digi)
{
memcpy(this, digi.header(), sizeInWords()*2);
}



bool cfebAvailable(unsigned icfeb) {
Expand Down Expand Up @@ -73,7 +68,7 @@ class CSCDMBHeader {

private:

boost::shared_ptr<CSCVDMBHeaderFormat> theHeaderFormat;
std::shared_ptr<CSCVDMBHeaderFormat> theHeaderFormat;
int theFirmwareVersion;


Expand Down
9 changes: 2 additions & 7 deletions EventFilter/CSCRawToDigi/interface/CSCDMBTrailer.h
Expand Up @@ -4,11 +4,11 @@
#include <cassert>
#include <iosfwd>
#include <cstring> // bzero
#include <memory>
#include "FWCore/Utilities/interface/Exception.h"
#include "DataFormats/CSCDigi/interface/CSCDMBStatusDigi.h"
#include "EventFilter/CSCRawToDigi/interface/CSCVDMBTrailerFormat.h"
#include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h"
#include <boost/shared_ptr.hpp>


// class CSCDMBHeader;
Expand All @@ -21,11 +21,6 @@ class CSCDMBTrailer {
CSCDMBTrailer(uint16_t firmware_version = 2005);

CSCDMBTrailer(const uint16_t * buf, uint16_t firmware_version = 2005);

CSCDMBTrailer(const CSCDMBStatusDigi & digi)
{
memcpy(this, digi.trailer(), sizeInWords()*2);
}


///@@ NEEDS TO BE DONE
Expand Down Expand Up @@ -78,7 +73,7 @@ class CSCDMBTrailer {

private:

boost::shared_ptr<CSCVDMBTrailerFormat> theTrailerFormat;
std::shared_ptr<CSCVDMBTrailerFormat> theTrailerFormat;
int theFirmwareVersion;

};
Expand Down
12 changes: 6 additions & 6 deletions EventFilter/CSCRawToDigi/src/CSCDMBHeader.cc
Expand Up @@ -10,9 +10,9 @@ CSCDMBHeader::CSCDMBHeader(uint16_t firmware_version)
{

if (theFirmwareVersion == 2013) {
theHeaderFormat = boost::shared_ptr<CSCVDMBHeaderFormat>(new CSCDMBHeader2013());
theHeaderFormat = std::make_shared<CSCDMBHeader2013>();
} else {
theHeaderFormat = boost::shared_ptr<CSCVDMBHeaderFormat>(new CSCDMBHeader2005());
theHeaderFormat = std::make_shared<CSCDMBHeader2005>();
}

}
Expand All @@ -21,14 +21,14 @@ CSCDMBHeader::CSCDMBHeader(const uint16_t * buf, uint16_t firmware_version)
: theHeaderFormat(), theFirmwareVersion(firmware_version)
{
if (theFirmwareVersion == 2013) {
theHeaderFormat = boost::shared_ptr<CSCVDMBHeaderFormat>(new CSCDMBHeader2013(buf));
theHeaderFormat = std::make_shared<CSCDMBHeader2013>(buf);
} else {
theHeaderFormat = boost::shared_ptr<CSCVDMBHeaderFormat>(new CSCDMBHeader2005(buf));
theHeaderFormat = std::make_shared<CSCDMBHeader2005>(buf);
}
}

CSCDMBHeader2005 CSCDMBHeader::dmbHeader2005() const {
CSCDMBHeader2005 * result = dynamic_cast<CSCDMBHeader2005 *>(theHeaderFormat.get());
const CSCDMBHeader2005 * result = dynamic_cast<const CSCDMBHeader2005 *>(theHeaderFormat.get());
if(result == nullptr)
{
throw cms::Exception("Could not get 2005 DMB header format");
Expand All @@ -38,7 +38,7 @@ CSCDMBHeader2005 CSCDMBHeader::dmbHeader2005() const {


CSCDMBHeader2013 CSCDMBHeader::dmbHeader2013() const {
CSCDMBHeader2013 * result = dynamic_cast<CSCDMBHeader2013 *>(theHeaderFormat.get());
const CSCDMBHeader2013 * result = dynamic_cast<const CSCDMBHeader2013 *>(theHeaderFormat.get());
if(result == nullptr)
{
throw cms::Exception("Could not get 2013 DMB header format");
Expand Down
12 changes: 6 additions & 6 deletions EventFilter/CSCRawToDigi/src/CSCDMBTrailer.cc
Expand Up @@ -10,9 +10,9 @@ CSCDMBTrailer::CSCDMBTrailer(uint16_t firmware_version)
{

if (theFirmwareVersion == 2013) {
theTrailerFormat = boost::shared_ptr<CSCVDMBTrailerFormat>(new CSCDMBTrailer2013());
theTrailerFormat = std::make_shared<CSCDMBTrailer2013>();
} else {
theTrailerFormat = boost::shared_ptr<CSCVDMBTrailerFormat>(new CSCDMBTrailer2005());
theTrailerFormat = std::make_shared<CSCDMBTrailer2005>();
}

}
Expand All @@ -21,14 +21,14 @@ CSCDMBTrailer::CSCDMBTrailer(const uint16_t * buf, uint16_t firmware_version)
: theTrailerFormat(), theFirmwareVersion(firmware_version)
{
if (theFirmwareVersion == 2013) {
theTrailerFormat = boost::shared_ptr<CSCVDMBTrailerFormat>(new CSCDMBTrailer2013(buf));
theTrailerFormat = std::make_shared<CSCDMBTrailer2013>(buf);
} else {
theTrailerFormat = boost::shared_ptr<CSCVDMBTrailerFormat>(new CSCDMBTrailer2005(buf));
theTrailerFormat = std::make_shared<CSCDMBTrailer2005>(buf);
}
}

CSCDMBTrailer2005 CSCDMBTrailer::dmbTrailer2005() const {
CSCDMBTrailer2005 * result = dynamic_cast<CSCDMBTrailer2005 *>(theTrailerFormat.get());
const CSCDMBTrailer2005 * result = dynamic_cast<const CSCDMBTrailer2005 *>(theTrailerFormat.get());
if(result == nullptr)
{
throw cms::Exception("Could not get 2005 DMB trailer format");
Expand All @@ -38,7 +38,7 @@ CSCDMBTrailer2005 CSCDMBTrailer::dmbTrailer2005() const {


CSCDMBTrailer2013 CSCDMBTrailer::dmbTrailer2013() const {
CSCDMBTrailer2013 * result = dynamic_cast<CSCDMBTrailer2013 *>(theTrailerFormat.get());
const CSCDMBTrailer2013 * result = dynamic_cast<const CSCDMBTrailer2013 *>(theTrailerFormat.get());
if(result == nullptr)
{
throw cms::Exception("Could not get 2013 DMB trailer format");
Expand Down