Skip to content
Snippets Groups Projects
Commit 8d16261a authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'isfgeo' into 'main'

AtlasDetDescr: replace validAtlasRegion macro by function

See merge request atlas/athena!77035
parents bdfa1c5b 099b40f9
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -9,12 +9,6 @@
#ifndef ATLASDETDESCR_ATLASREGION_H
#define ATLASDETDESCR_ATLASREGION_H 1
#include <assert.h>
// use these macros to check a given AtlasRegion for its validity
#define validAtlasRegion(region) ( (region<AtlasDetDescr::fNumAtlasRegions) && (region>=AtlasDetDescr::fFirstAtlasRegion) )
#define assertAtlasRegion(region) ( assert(validAtlasRegion(region)) )
namespace AtlasDetDescr {
/** @enum AtlasRegion
......@@ -41,4 +35,10 @@ namespace AtlasDetDescr {
} // end of namespace
/// Check a given AtlasRegion for its validity
inline bool validAtlasRegion(AtlasDetDescr::AtlasRegion region) {
return (region<AtlasDetDescr::fNumAtlasRegions) && (region>=AtlasDetDescr::fFirstAtlasRegion);
}
#endif // ATLASDETDESCR_ATLASREGION
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
// class header include
......@@ -276,7 +276,7 @@ std::unique_ptr<ISF::RZPairList> ISF::GeoIDSvc::prepareRZPairs( AtlasDetDescr::A
std::unique_ptr<RZPairList> negativeZ = std::make_unique<RZPairList>();
// ensure a proper numeric value for geoID
assertAtlasRegion(geoID);
assert(validAtlasRegion(geoID));
ATH_MSG_INFO( "Building envelope volume for '" << AtlasDetDescr::AtlasRegionHelper::getName(geoID)
<< "' (GeoID="<< geoID << ").");
......
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
// class header
......@@ -274,7 +274,7 @@ StatusCode ISF::ParticleBrokerDynamicOnReadIn::initializeEvent(ISFParticleContai
// identify the geoID of the particle
m_geoIDSvcQuick->identifyAndRegNextGeoID(particle);
// the geoID at this point better makes sense :)
assertAtlasRegion( particle.nextGeoID() );
assert(validAtlasRegion( particle.nextGeoID() ));
// update all registered selectors (in all geoIDs) with this particle
updateAllSelectors(particle);
......
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
// class header include
......@@ -113,7 +113,7 @@ AtlasDetDescr::AtlasRegion ISF::G4PolyconeGeoIDSvc::identifyNextGeoID(const Amg:
// if position inside a volume -> return that volume as the next geoID
AtlasDetDescr::AtlasRegion geoID = identifyGeoID(pos);
if validAtlasRegion(geoID)
if (validAtlasRegion(geoID))
{
return geoID;
}
......@@ -121,7 +121,7 @@ AtlasDetDescr::AtlasRegion ISF::G4PolyconeGeoIDSvc::identifyNextGeoID(const Amg:
const Amg::Vector3D &dirUnit = dir.unit();
const Amg::Vector3D &posStep = pos+dirUnit;
AtlasDetDescr::AtlasRegion closestGeoID = identifyGeoID(posStep);
if validAtlasRegion(closestGeoID)
if (validAtlasRegion(closestGeoID))
{
return closestGeoID;
}
......@@ -133,7 +133,7 @@ StatusCode ISF::G4PolyconeGeoIDSvc::createVolume(AtlasDetDescr::AtlasRegion geoI
{
// ensure a proper numeric value for geoID
assertAtlasRegion( geoID);
assert(validAtlasRegion(geoID));
ATH_MSG_INFO( "Building envelope volume for '" << AtlasDetDescr::AtlasRegionHelper::getName(geoID)
<< "' (GeoID="<< geoID << ").");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment