Commit eabe135a authored by Elmar Ritsch's avatar Elmar Ritsch Committed by Graeme Stewart
Browse files

bugfix in IEnvelopeDefSvc::mirrorRZ(..) method (ATLASSIM-1601, Coverity...

bugfix in IEnvelopeDefSvc::mirrorRZ(..) method (ATLASSIM-1601, Coverity #17631) (SubDetectorEnvelopes-00-03-01)

	* IEnvelopeDefSvc.h: bugfix in mirrorRZ(..) method
	(ATLASSIM-1601, Coverity #17631)
	* tagging SubDetectorEnvelopes-00-03-01

2014-10-21  Elmar Ritsch  < Elmar.Ritsch -at- cern.ch >
	* IEnvelopeDefSvc.h: updated interface regarding the mirrorRZ(..) method
	(ATLASSIM-1601, Coverity #17631)
	* tagging SubDetectorEnvelopes-00-03-00

2014-10-15  Elmar Ritsch  < Elmar.Ritsch -at- cern.ch >
	* DetDescrDBEnvelopeSvc.cxx: change WARNING messages into INFO when using
	Python-based envelope definitions
	* tagging SubDetectorEnvelopes-00-02-03
parent 733b3d84
......@@ -61,34 +61,34 @@ class IEnvelopeDefSvc : virtual public IInterface {
RZPairVector &getCavernRZValues( unsigned short = 0) const { return const_cast<RZPairVector&>( getRZBoundary(AtlasDetDescr::fAtlasCavern) ); }
protected:
/** mirror the given RZPairs in the XY-plane to describe all corner points
in (r,z) space */
inline RZPairVector *mirrorRZ( RZPairVector &rposz ) const ;
/** mirror the given srcRZ RZPairVector in the XY-plane to describe all corner points
in (r,z) space in the dstRZ RZPairVector */
inline void mirrorRZ( const RZPairVector &srcRZ, RZPairVector &dstRZ ) const ;
};
/** mirror the given RZPairs in the XY-plane to describe all corner points in (r,z) space */
inline RZPairVector *IEnvelopeDefSvc::mirrorRZ( RZPairVector &rposz ) const
inline void IEnvelopeDefSvc::mirrorRZ( const RZPairVector &srcRZ, RZPairVector &dstRZ ) const
{
int numPosPairs = rposz.size();
// the mirrored envelope will have exactly twice as many entries as the given rposz
RZPairVector *completeRZ = new RZPairVector(2*numPosPairs);
int numPosPairs = srcRZ.size();
// the mirrored envelope will have exactly twice as many entries as the given srcRZ
dstRZ.resize(2*numPosPairs);
// loop over all positive (r,z) pairs
for ( int curNum = 0; curNum<numPosPairs; curNum++) {
double curR = rposz[curNum].first;
double curZ = rposz[curNum].second;
double curR = srcRZ[curNum].first;
double curZ = srcRZ[curNum].second;
// debugging output:
//std::cout << "Envelope: pos=" << curNum << " r=" << curR << " z="<< curZ << std::endl;
// fill in the z<0 side
(*completeRZ)[numPosPairs-curNum-1] = RZPair(curR, -curZ);
dstRZ[numPosPairs-curNum-1] = RZPair(curR, -curZ);
// fill in the z>0 side
(*completeRZ)[numPosPairs+curNum] = RZPair(curR, curZ);
dstRZ[numPosPairs+curNum] = RZPair(curR, curZ);
}
return completeRZ;
return;
}
#endif // IENVELOPEDEFSVC_H
......
......@@ -148,7 +148,7 @@ StatusCode DetDescrDBEnvelopeSvc::initialize()
// in (r,z) space for each envelope volume
for ( int region = AtlasDetDescr::fFirstAtlasRegion; region < AtlasDetDescr::fNumAtlasRegions; region++) {
ATH_MSG_VERBOSE( "Envelope: positive-z region=" << region);
m_rz[region] = *mirrorRZ( m_rposz[region] );
mirrorRZ( m_rposz[region], m_rz[region] );
}
// debugging output:
......@@ -185,13 +185,17 @@ RZPairVector *DetDescrDBEnvelopeSvc::retrieveRZBoundaryOptionalFallback(
// try the DB approach to retrieve the (r,z) values
RZPairVector *rz = retrieveRZBoundary(dbNode);
// if 0 return value -> something went wrong
// if 0 return value -> unsuccessfully read DDDB
if (!rz) {
ATH_MSG_WARNING("Problems retrieving the envelope volume definition from DDDB node '"
<< dbNode << "'.");
ATH_MSG_DEBUG("Will try reading Python-based envelope definition for '" << dbNode << "'.");
// try fallback approach
rz = enableFallback() ? fallbackRZBoundary(r, z) : 0;
if (rz) ATH_MSG_INFO("Fallback envelope volume definition created for " << dbNode);
if (rz) {
ATH_MSG_INFO("Sucessfully read Python-based envelope definition for '" << dbNode << "'.");
} else {
ATH_MSG_WARNING("Could not create envelope volume for '" << dbNode << "'.");
}
}
return rz;
......@@ -232,7 +236,7 @@ RZPairVector *DetDescrDBEnvelopeSvc::retrieveRZBoundary( std::string &node)
// entries in the database table
size_t numEntries = envelopeRec ? envelopeRec->size() : 0;
if ( !numEntries) {
ATH_MSG_WARNING("No entries for table '" << node << "' in Detector Description DB. Will skip this envelope volume.");
ATH_MSG_INFO("No entries for table '" << node << "' in Detector Description Database (DDDB). Maybe you are using Python-based envelope definitions...");
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment