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

Fix narrowing conversions #1207

Merged
merged 2 commits into from
Sep 18, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions DetDescr/include/DetDescr/HcalID.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,37 @@ class HcalID : public HcalAbstractID {
* Get the value of the 'section' field from the ID.
* @return The value of the 'strip' field.
*/
int getSection() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; }
unsigned int getSection() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; }

/*
* Get the value of the 'section' field from the ID.
* @return The value of the 'strip' field.
*/
int section() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; }
unsigned int section() const { return (id_ >> SECTION_SHIFT) & SECTION_MASK; }

/**
* Get the value of the layer field from the ID.
* @return The value of the layer field.
*/
int layer() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; }
unsigned int layer() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; }

/**
* Get the value of the layer field from the ID.
* @return The value of the layer field.
*/
int getLayerID() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; }
unsigned int getLayerID() const { return (id_ >> LAYER_SHIFT) & LAYER_MASK; }

/**
* Get the value of the 'strip' field from the ID.
* @return The value of 'strip' field.
*/
int getStrip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; }
unsigned int getStrip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; }

/**
* Get the value of the 'strip' field from the ID.
* @return The value of 'strip' field.
*/
int strip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; }
unsigned int strip() const { return (id_ >> STRIP_SHIFT) & STRIP_MASK; }

tvami marked this conversation as resolved.
Show resolved Hide resolved
static void createInterpreters();
};
Expand Down
6 changes: 3 additions & 3 deletions DetDescr/src/DetDescr/HcalGeometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ void HcalGeometry::printPositionMap(int section) const {

void HcalGeometry::buildStripPositionMap() {
// We hard-code the number of sections as seen in HcalID
for (int section = 0; section < num_sections_; section++) {
for (int layer = 1; layer <= num_layers_[section]; layer++) {
for (int strip = 0; strip < getNumStrips(section, layer); strip++) {
for (unsigned int section = 0; section < num_sections_; section++) {
for (unsigned int layer = 1; layer <= num_layers_[section]; layer++) {
for (unsigned int strip = 0; strip < getNumStrips(section, layer); strip++) {
// initialize values
double x{-99999}, y{-99999}, z{-99999};

Expand Down
4 changes: 2 additions & 2 deletions Tools/src/Tools/HgcrocEmulator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ std::vector<ldmx::HgcrocDigiCollection::Sample> HgcrocEmulator::noiseDigi(
std::vector<ldmx::HgcrocDigiCollection::Sample> noise_digi;
for (int iADC{0}; iADC<nADCs_; iADC++) {
// gen noise for ADC samples
int adc_tm1{pedestal};
int adc_tm1{static_cast<int>(pedestal)};
if (iADC > 0)
adc_tm1 = noise_digi.at(iADC-1).adc_t();
else
adc_tm1 += noise(channel)/gain;
int adc_t{pedestal + noise(channel)/gain};
int adc_t{static_cast<int>(pedestal + noise(channel)/gain)};

if (iADC == iSOI_)
adc_t += soi_amplitude/gain;
Expand Down
Loading