Skip to content

Commit

Permalink
Revert constness on arguments passed by value
Browse files Browse the repository at this point in the history
  • Loading branch information
VourMa committed Jul 28, 2024
1 parent e076050 commit 96aa7c0
Show file tree
Hide file tree
Showing 23 changed files with 519 additions and 520 deletions.
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/interface/EndcapGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace lst {

void load(std::string const&);
void fillGeoMapArraysExplicit();
float getdxdy_slope(const unsigned int detid) const;
float getdxdy_slope(unsigned int detid) const;
};
} // namespace lst

Expand Down
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace lst {
Buf<TDev, float> geoMapPhi_buf;
EndcapGeometryDev data_;

EndcapGeometryBuffer(TDev const& dev, const unsigned int nEndCapMap)
EndcapGeometryBuffer(TDev const& dev, unsigned int nEndCapMap)
: geoMapDetId_buf(allocBufWrapper<unsigned int>(dev, nEndCapMap)),
geoMapPhi_buf(allocBufWrapper<float>(dev, nEndCapMap)) {
data_.setData(*this);
Expand All @@ -43,7 +43,7 @@ namespace lst {
}

template <typename TQueue, typename TDevSrc>
EndcapGeometryBuffer(TQueue queue, EndcapGeometryBuffer<TDevSrc> const& src, const unsigned int nEndCapMap)
EndcapGeometryBuffer(TQueue queue, EndcapGeometryBuffer<TDevSrc> const& src, unsigned int nEndCapMap)
: EndcapGeometryBuffer(alpaka::getDev(queue), nEndCapMap) {
copyFromSrc(queue, src);
}
Expand Down
18 changes: 9 additions & 9 deletions RecoTracker/LSTCore/interface/LST.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace lst {

template <typename TQueue>
void run(TQueue& queue,
const bool verbose,
bool verbose,
LSTESData<alpaka::Dev<TAcc>> const* deviceESData,
std::vector<float> const& see_px,
std::vector<float> const& see_py,
Expand All @@ -43,12 +43,12 @@ namespace lst {
std::vector<float> const& ph2_x,
std::vector<float> const& ph2_y,
std::vector<float> const& ph2_z,
const bool no_pls_dupclean,
const bool tc_pls_triplets);
const std::vector<std::vector<unsigned int>>& hits() const { return out_tc_hitIdxs_; }
const std::vector<unsigned int>& len() const { return out_tc_len_; }
const std::vector<int>& seedIdx() const { return out_tc_seedIdx_; }
const std::vector<short>& trackCandidateType() const { return out_tc_trackCandidateType_; }
bool no_pls_dupclean,
bool tc_pls_triplets);
std::vector<std::vector<unsigned int>> const& hits() const { return out_tc_hitIdxs_; }
std::vector<unsigned int> const& len() const { return out_tc_len_; }
std::vector<int> const& seedIdx() const { return out_tc_seedIdx_; }
std::vector<short> const& trackCandidateType() const { return out_tc_trackCandidateType_; }

private:
void prepareInput(std::vector<float> const& see_px,
Expand All @@ -72,8 +72,8 @@ namespace lst {
std::vector<float> const& ph2_z);

void getOutput(lst::Event<TAcc>& event);
std::vector<unsigned int> getHitIdxs(const short trackCandidateType,
const unsigned int TCIdx,
std::vector<unsigned int> getHitIdxs(short trackCandidateType,
unsigned int TCIdx,
unsigned int const* TCHitIndices,
unsigned int const* hitIndices);

Expand Down
12 changes: 6 additions & 6 deletions RecoTracker/LSTCore/interface/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace lst {
const int* sdlLayers;
const unsigned int* connectedPixels;

static bool parseIsInverted(const short subdet, const short side, const short module, const short layer) {
static bool parseIsInverted(short subdet, short side, short module, short layer) {
if (subdet == Endcap) {
if (side == NegZ) {
return module % 2 == 1;
Expand Down Expand Up @@ -74,11 +74,11 @@ namespace lst {
}
};

static bool parseIsLower(const bool isInvertedx, const unsigned int detId) {
static bool parseIsLower(bool isInvertedx, unsigned int detId) {
return (isInvertedx) ? !(detId & 1) : (detId & 1);
};

static unsigned int parsePartnerModuleId(const unsigned int detId, const bool isLowerx, const bool isInvertedx) {
static unsigned int parsePartnerModuleId(unsigned int detId, bool isLowerx, bool isInvertedx) {
return isLowerx ? (isInvertedx ? detId - 1 : detId + 1) : (isInvertedx ? detId + 1 : detId - 1);
};

Expand Down Expand Up @@ -144,7 +144,7 @@ namespace lst {

Modules data_;

ModulesBuffer(TDev const& dev, const unsigned int nMod, const unsigned int nPixs)
ModulesBuffer(TDev const& dev, unsigned int nMod, unsigned int nPixs)
: detIds_buf(allocBufWrapper<unsigned int>(dev, nMod)),
moduleMap_buf(allocBufWrapper<uint16_t>(dev, nMod * max_connected_modules)),
mapdetId_buf(allocBufWrapper<unsigned int>(dev, nMod)),
Expand Down Expand Up @@ -175,7 +175,7 @@ namespace lst {
}

template <typename TQueue, typename TDevSrc>
inline void copyFromSrc(TQueue queue, ModulesBuffer<TDevSrc> const& src, const bool isFull = true) {
inline void copyFromSrc(TQueue queue, ModulesBuffer<TDevSrc> const& src, bool isFull = true) {
alpaka::memcpy(queue, detIds_buf, src.detIds_buf);
if (isFull) {
alpaka::memcpy(queue, moduleMap_buf, src.moduleMap_buf);
Expand Down Expand Up @@ -216,7 +216,7 @@ namespace lst {
}

template <typename TQueue, typename TDevSrc>
ModulesBuffer(TQueue queue, ModulesBuffer<TDevSrc> const& src, const unsigned int nMod, const unsigned int nPixs)
ModulesBuffer(TQueue queue, ModulesBuffer<TDevSrc> const& src, unsigned int nMod, unsigned int nPixs)
: ModulesBuffer(alpaka::getDev(queue), nMod, nPixs) {
copyFromSrc(queue, src);
}
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/interface/ModuleConnectionMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace lst {
void add(std::string const&);
void print();

const std::vector<unsigned int>& getConnectedModuleDetIds(const unsigned int detid) const;
const std::vector<unsigned int>& getConnectedModuleDetIds(unsigned int detid) const;
int size() const;
};

Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/interface/PixelMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace lst {

int* pixelType;

PixelMap(const unsigned int sizef = size_superbins)
PixelMap(unsigned int sizef = size_superbins)
: pixelModuleIndex(0),
connectedPixelsIndex(sizef),
connectedPixelsSizes(sizef),
Expand Down
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/TiltedGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace lst {

void load(std::string const&);

float getDrDz(const unsigned int detid) const;
float getDxDy(const unsigned int detid) const;
float getDrDz(unsigned int detid) const;
float getDxDy(unsigned int detid) const;
};

} // namespace lst
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/EndcapGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void lst::EndcapGeometry::fillGeoMapArraysExplicit() {
}
}

float lst::EndcapGeometry::getdxdy_slope(const unsigned int detid) const {
float lst::EndcapGeometry::getdxdy_slope(unsigned int detid) const {
if (dxdy_slope_.find(detid) != dxdy_slope_.end()) {
return dxdy_slope_.at(detid);
} else {
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/ModuleConnectionMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void lst::ModuleConnectionMap::print() {
}
}

const std::vector<unsigned int>& lst::ModuleConnectionMap::getConnectedModuleDetIds(const unsigned int detid) const {
const std::vector<unsigned int>& lst::ModuleConnectionMap::getConnectedModuleDetIds(unsigned int detid) const {
static const std::vector<unsigned int> dummy;
auto const mList = moduleConnections_.find(detid);
return mList != moduleConnections_.end() ? mList->second : dummy;
Expand Down
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/src/TiltedGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ void lst::TiltedGeometry::load(std::string const& filename) {
}
}

float lst::TiltedGeometry::getDrDz(const unsigned int detid) const {
float lst::TiltedGeometry::getDrDz(unsigned int detid) const {
if (drdzs_.find(detid) != drdzs_.end()) {
return drdzs_.at(detid);
} else {
return 0;
}
}

float lst::TiltedGeometry::getDxDy(const unsigned int detid) const {
float lst::TiltedGeometry::getDxDy(unsigned int detid) const {
if (dxdys_.find(detid) != dxdys_.end()) {
return dxdys_.at(detid);
} else {
Expand Down
36 changes: 18 additions & 18 deletions RecoTracker/LSTCore/src/alpaka/Event.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using namespace ALPAKA_ACCELERATOR_NAMESPACE;

void lst::Event<Acc3D>::init(const bool verbose) {
void lst::Event<Acc3D>::init(bool verbose) {
addObjects = verbose;
hitsInGPU = nullptr;
mdsInGPU = nullptr;
Expand Down Expand Up @@ -622,7 +622,7 @@ void lst::Event<Acc3D>::createTriplets() {
}
}

void lst::Event<Acc3D>::createTrackCandidates(const bool no_pls_dupclean, const bool tc_pls_triplets) {
void lst::Event<Acc3D>::createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets) {
if (trackCandidatesInGPU == nullptr) {
trackCandidatesInGPU = new lst::TrackCandidates();
trackCandidatesBuffers = new lst::TrackCandidatesBuffer<Device>(
Expand Down Expand Up @@ -1278,18 +1278,18 @@ unsigned int lst::Event<Acc3D>::getNumberOfHits() {
return hits;
}

unsigned int lst::Event<Acc3D>::getNumberOfHitsByLayer(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfHitsByLayer(unsigned int layer) {
if (layer == 6)
return n_hits_by_layer_barrel_[layer];
else
return n_hits_by_layer_barrel_[layer] + n_hits_by_layer_endcap_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfHitsByLayerBarrel(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfHitsByLayerBarrel(unsigned int layer) {
return n_hits_by_layer_barrel_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfHitsByLayerEndcap(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfHitsByLayerEndcap(unsigned int layer) {
return n_hits_by_layer_endcap_[layer];
}

Expand All @@ -1305,18 +1305,18 @@ unsigned int lst::Event<Acc3D>::getNumberOfMiniDoublets() {
return miniDoublets;
}

unsigned int lst::Event<Acc3D>::getNumberOfMiniDoubletsByLayer(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfMiniDoubletsByLayer(unsigned int layer) {
if (layer == 6)
return n_minidoublets_by_layer_barrel_[layer];
else
return n_minidoublets_by_layer_barrel_[layer] + n_minidoublets_by_layer_endcap_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfMiniDoubletsByLayerBarrel(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfMiniDoubletsByLayerBarrel(unsigned int layer) {
return n_minidoublets_by_layer_barrel_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfMiniDoubletsByLayerEndcap(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfMiniDoubletsByLayerEndcap(unsigned int layer) {
return n_minidoublets_by_layer_endcap_[layer];
}

Expand All @@ -1332,18 +1332,18 @@ unsigned int lst::Event<Acc3D>::getNumberOfSegments() {
return segments;
}

unsigned int lst::Event<Acc3D>::getNumberOfSegmentsByLayer(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfSegmentsByLayer(unsigned int layer) {
if (layer == 6)
return n_segments_by_layer_barrel_[layer];
else
return n_segments_by_layer_barrel_[layer] + n_segments_by_layer_endcap_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfSegmentsByLayerBarrel(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfSegmentsByLayerBarrel(unsigned int layer) {
return n_segments_by_layer_barrel_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfSegmentsByLayerEndcap(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfSegmentsByLayerEndcap(unsigned int layer) {
return n_segments_by_layer_endcap_[layer];
}

Expand All @@ -1359,18 +1359,18 @@ unsigned int lst::Event<Acc3D>::getNumberOfTriplets() {
return triplets;
}

unsigned int lst::Event<Acc3D>::getNumberOfTripletsByLayer(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfTripletsByLayer(unsigned int layer) {
if (layer == 6)
return n_triplets_by_layer_barrel_[layer];
else
return n_triplets_by_layer_barrel_[layer] + n_triplets_by_layer_endcap_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfTripletsByLayerBarrel(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfTripletsByLayerBarrel(unsigned int layer) {
return n_triplets_by_layer_barrel_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfTripletsByLayerEndcap(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfTripletsByLayerEndcap(unsigned int layer) {
return n_triplets_by_layer_endcap_[layer];
}

Expand Down Expand Up @@ -1408,18 +1408,18 @@ unsigned int lst::Event<Acc3D>::getNumberOfQuintuplets() {
return quintuplets;
}

unsigned int lst::Event<Acc3D>::getNumberOfQuintupletsByLayer(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfQuintupletsByLayer(unsigned int layer) {
if (layer == 6)
return n_quintuplets_by_layer_barrel_[layer];
else
return n_quintuplets_by_layer_barrel_[layer] + n_quintuplets_by_layer_endcap_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfQuintupletsByLayerBarrel(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfQuintupletsByLayerBarrel(unsigned int layer) {
return n_quintuplets_by_layer_barrel_[layer];
}

unsigned int lst::Event<Acc3D>::getNumberOfQuintupletsByLayerEndcap(const unsigned int layer) {
unsigned int lst::Event<Acc3D>::getNumberOfQuintupletsByLayerEndcap(unsigned int layer) {
return n_quintuplets_by_layer_endcap_[layer];
}

Expand Down Expand Up @@ -1818,7 +1818,7 @@ lst::TrackCandidatesBuffer<DevHost>* lst::Event<Acc3D>::getTrackCandidatesInCMSS
return trackCandidatesInCPU;
}

lst::ModulesBuffer<DevHost>* lst::Event<Acc3D>::getModules(const bool isFull) {
lst::ModulesBuffer<DevHost>* lst::Event<Acc3D>::getModules(bool isFull) {
if (modulesInCPU == nullptr) {
// The last input here is just a small placeholder for the allocation.
modulesInCPU = new lst::ModulesBuffer<DevHost>(devHost, nModules_, nPixels_);
Expand Down
36 changes: 18 additions & 18 deletions RecoTracker/LSTCore/src/alpaka/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,32 @@ namespace lst {
void createTriplets();
void createPixelTracklets();
void createPixelTrackletsWithMap();
void createTrackCandidates(const bool no_pls_dupclean, const bool tc_pls_triplets);
void createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets);
void createExtendedTracks();
void createQuintuplets();
void createPixelTriplets();
void createPixelQuintuplets();
void pixelLineSegmentCleaning(const bool no_pls_dupclean);
void pixelLineSegmentCleaning(bool no_pls_dupclean);

unsigned int getNumberOfHits();
unsigned int getNumberOfHitsByLayer(const unsigned int layer);
unsigned int getNumberOfHitsByLayerBarrel(const unsigned int layer);
unsigned int getNumberOfHitsByLayerEndcap(const unsigned int layer);
unsigned int getNumberOfHitsByLayer(unsigned int layer);
unsigned int getNumberOfHitsByLayerBarrel(unsigned int layer);
unsigned int getNumberOfHitsByLayerEndcap(unsigned int layer);

unsigned int getNumberOfMiniDoublets();
unsigned int getNumberOfMiniDoubletsByLayer(const unsigned int layer);
unsigned int getNumberOfMiniDoubletsByLayerBarrel(const unsigned int layer);
unsigned int getNumberOfMiniDoubletsByLayerEndcap(const unsigned int layer);
unsigned int getNumberOfMiniDoubletsByLayer(unsigned int layer);
unsigned int getNumberOfMiniDoubletsByLayerBarrel(unsigned int layer);
unsigned int getNumberOfMiniDoubletsByLayerEndcap(unsigned int layer);

unsigned int getNumberOfSegments();
unsigned int getNumberOfSegmentsByLayer(const unsigned int layer);
unsigned int getNumberOfSegmentsByLayerBarrel(const unsigned int layer);
unsigned int getNumberOfSegmentsByLayerEndcap(const unsigned int layer);
unsigned int getNumberOfSegmentsByLayer(unsigned int layer);
unsigned int getNumberOfSegmentsByLayerBarrel(unsigned int layer);
unsigned int getNumberOfSegmentsByLayerEndcap(unsigned int layer);

unsigned int getNumberOfTriplets();
unsigned int getNumberOfTripletsByLayer(const unsigned int layer);
unsigned int getNumberOfTripletsByLayerBarrel(const unsigned int layer);
unsigned int getNumberOfTripletsByLayerEndcap(const unsigned int layer);
unsigned int getNumberOfTripletsByLayer(unsigned int layer);
unsigned int getNumberOfTripletsByLayerBarrel(unsigned int layer);
unsigned int getNumberOfTripletsByLayerEndcap(unsigned int layer);

int getNumberOfTrackCandidates();
int getNumberOfPixelTrackCandidates();
Expand All @@ -180,9 +180,9 @@ namespace lst {
int getNumberOfPLSTrackCandidates();

unsigned int getNumberOfQuintuplets();
unsigned int getNumberOfQuintupletsByLayer(const unsigned int layer);
unsigned int getNumberOfQuintupletsByLayerBarrel(const unsigned int layer);
unsigned int getNumberOfQuintupletsByLayerEndcap(const unsigned int layer);
unsigned int getNumberOfQuintupletsByLayer(unsigned int layer);
unsigned int getNumberOfQuintupletsByLayerBarrel(unsigned int layer);
unsigned int getNumberOfQuintupletsByLayerEndcap(unsigned int layer);

int getNumberOfPixelTriplets();
int getNumberOfPixelQuintuplets();
Expand All @@ -198,7 +198,7 @@ namespace lst {
TrackCandidatesBuffer<DevHost>* getTrackCandidatesInCMSSW();
PixelTripletsBuffer<DevHost>* getPixelTriplets();
PixelQuintupletsBuffer<DevHost>* getPixelQuintuplets();
ModulesBuffer<DevHost>* getModules(const bool isFull = false);
ModulesBuffer<DevHost>* getModules(bool isFull = false);
};

} // namespace lst
Expand Down
Loading

0 comments on commit 96aa7c0

Please sign in to comment.