Skip to content

Commit

Permalink
Merge pull request #26552 from makortel/fixGccEventFilterCSCRawToDigi
Browse files Browse the repository at this point in the history
Remove constructors taking CSCDMBStatusDigi from CSCDMBHeader and CSCDMBTrailer
  • Loading branch information
cmsbuild committed Apr 29, 2019
2 parents 873d523 + 84e59ea commit d311c79
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
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

0 comments on commit d311c79

Please sign in to comment.