Skip to content

Commit

Permalink
Merge pull request #40950 from mmusich/fixSiPixelPayloadInspectorHelp…
Browse files Browse the repository at this point in the history
…erWarningDBGX

`SiPixelPayloadInspectorHelper`: fix warning: '<anonymous>' may be used uninitialized
  • Loading branch information
cmsbuild authored Mar 4, 2023
2 parents 9b708c1 + 696792d commit 9a06c7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace SiPixelPI {

enum phase { zero = 0, one = 1, two = 2 };
enum phase { zero = 0, one = 1, two = 2, undefined = 999 };

// size of the phase-0 pixel detID list
static const unsigned int phase0size = 1440;
Expand Down Expand Up @@ -664,7 +664,7 @@ namespace SiPixelPI {
int m_side;
int m_ring;
bool m_isInternal;
SiPixelPI::phase* m_Phase;
SiPixelPI::phase m_Phase;

public:
void init();
Expand All @@ -687,6 +687,7 @@ namespace SiPixelPI {
inline void topolInfo::init()
/*--------------------------------------------------------------------*/
{
m_Phase = SiPixelPI::undefined;
m_rawid = 0;
m_subdetid = -1;
m_layer = -1;
Expand All @@ -710,7 +711,7 @@ namespace SiPixelPI {
/*--------------------------------------------------------------------*/
{
// set the phase
m_Phase = const_cast<SiPixelPI::phase*>(&ph);
m_Phase = ph;
unsigned int subdetId = static_cast<unsigned int>(detId.subdetId());

m_rawid = detId.rawId();
Expand All @@ -733,7 +734,7 @@ namespace SiPixelPI {
{
SiPixelPI::regions ret = SiPixelPI::NUM_OF_REGIONS;

if (m_Phase == nullptr) {
if (m_Phase == SiPixelPI::undefined) {
throw cms::Exception("LogicError") << "Cannot call filterThePartition BEFORE filling the geometry info!";
}

Expand Down Expand Up @@ -769,7 +770,7 @@ namespace SiPixelPI {
m_side > 1 ? ret = SiPixelPI::FPixpL3 : ret = SiPixelPI::FPixmL3;
break;
default:
if (*m_Phase < SiPixelPI::phase::two) {
if (m_Phase < SiPixelPI::phase::two) {
// warning message only if the phase2 is < 2
edm::LogWarning("LogicError") << "Unknow FPix disk: " << m_layer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ namespace {
case SiPixelPI::phase::two:
inputFile = "Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml";
break;
default:
throw cms::Exception("SiPixelDynamicInefficiency_PayloadInspector") << "checkPhase: unrecongnized phase!";
}

// create the standalone tracker topology
Expand Down

0 comments on commit 9a06c7c

Please sign in to comment.