ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::ISFEnvelopeDefSvc Class Reference

#include <ISFEnvelopeDefSvc.h>

Inheritance diagram for ISF::ISFEnvelopeDefSvc:
Collaboration diagram for ISF::ISFEnvelopeDefSvc:

Public Member Functions

 ISFEnvelopeDefSvc (const std::string &name, ISvcLocator *svc)
 public AthService constructor
 ~ISFEnvelopeDefSvc ()
 Destructor.
StatusCode initialize ()
 AthService initialize method.
StatusCode finalize ()
 AthService finalize method.
const RZPairVectorgetRZBoundary (AtlasDetDescr::AtlasRegion region) const
 return a vector of (r,z) pairs, defining the respective envelope
const RZPairVectorgetRPositiveZBoundary (AtlasDetDescr::AtlasRegion region) const
 return a vector of (r,z) pairs, defining the envelope on the z>0 region

Private Attributes

ServiceHandle< IEnvelopeDefSvcm_atlasEnvDefSvc
 ServiceHandle to the common ATLAS envelope definition service.
RZPairVector m_rzBeamPipe
 internal (r,z) representation for BeamPipe and InnerDetector volumes
RZPairVector m_rzInDet
RZPairVector m_rposzBeamPipe
 internal (r,z) representation for the positive z-side only, one RZPairVector for BeamPipe and InnerDetector each
RZPairVector m_rposzInDet

Detailed Description

Definition at line 24 of file ISFEnvelopeDefSvc.h.

Constructor & Destructor Documentation

◆ ISFEnvelopeDefSvc()

ISF::ISFEnvelopeDefSvc::ISFEnvelopeDefSvc ( const std::string & name,
ISvcLocator * svc )

public AthService constructor

Constructor.

Definition at line 16 of file ISFEnvelopeDefSvc.cxx.

16 :
17 base_class(name,svc),
18 m_atlasEnvDefSvc("AtlasGeometry_EnvelopeDefSvc", name),
20 m_rzInDet(),
23{
24 declareProperty("ATLASEnvelopeDefSvc" , m_atlasEnvDefSvc );
25}
ServiceHandle< IEnvelopeDefSvc > m_atlasEnvDefSvc
ServiceHandle to the common ATLAS envelope definition service.
RZPairVector m_rposzBeamPipe
internal (r,z) representation for the positive z-side only, one RZPairVector for BeamPipe and InnerDe...
RZPairVector m_rzBeamPipe
internal (r,z) representation for BeamPipe and InnerDetector volumes

◆ ~ISFEnvelopeDefSvc()

ISF::ISFEnvelopeDefSvc::~ISFEnvelopeDefSvc ( )

Destructor.

Definition at line 28 of file ISFEnvelopeDefSvc.cxx.

29{
30 // free memory
31 // TODO :)
32}

Member Function Documentation

◆ finalize()

StatusCode ISF::ISFEnvelopeDefSvc::finalize ( )

AthService finalize method.

Athena AthService finalize hook.

Definition at line 124 of file ISFEnvelopeDefSvc.cxx.

125{
126 return StatusCode::SUCCESS;
127}

◆ getRPositiveZBoundary()

const RZPairVector & ISF::ISFEnvelopeDefSvc::getRPositiveZBoundary ( AtlasDetDescr::AtlasRegion region) const

return a vector of (r,z) pairs, defining the envelope on the z>0 region

Definition at line 142 of file ISFEnvelopeDefSvc.cxx.

142 {
143
144 // treat Forward/BeamPipe and InnerDetector regions separately
145 if ( region == AtlasDetDescr::fAtlasForward ) return m_rposzBeamPipe;
146 else if ( region == AtlasDetDescr::fAtlasID ) return m_rposzInDet;
147 else return m_atlasEnvDefSvc->getRPositiveZBoundary( region );
148}

◆ getRZBoundary()

const RZPairVector & ISF::ISFEnvelopeDefSvc::getRZBoundary ( AtlasDetDescr::AtlasRegion region) const

return a vector of (r,z) pairs, defining the respective envelope

Definition at line 131 of file ISFEnvelopeDefSvc.cxx.

131 {
132
133 // treat Forward/BeamPipe and InnerDetector regions separately
134 if ( region == AtlasDetDescr::fAtlasForward ) return m_rzBeamPipe;
135 else if ( region == AtlasDetDescr::fAtlasID ) return m_rzInDet;
136 else return m_atlasEnvDefSvc->getRZBoundary( region );
137
138}

◆ initialize()

StatusCode ISF::ISFEnvelopeDefSvc::initialize ( )

AthService initialize method.

Athena AthService initialize hook.

Definition at line 36 of file ISFEnvelopeDefSvc.cxx.

37{
38 ATH_MSG_INFO("Initializing ...");
39
40 // retrieve ATLAS common envelope definition service
41 if ( m_atlasEnvDefSvc.retrieve().isFailure() ){
42 ATH_MSG_FATAL( "Could not retrieve EnvelopeDefinition service ('" << m_atlasEnvDefSvc.typeAndName() << "'). Abort.");
43 return StatusCode::FAILURE;
44 }
45
46 // change InnerDetector boundaries according to ISF conventions
47 // ie. remove the beampipe from inside the ID volume and move the
48 // ID volume all the way down to r==0.
49 //
50 m_rposzInDet = m_atlasEnvDefSvc->getRPositiveZBoundary( AtlasDetDescr::fAtlasID );
51 // will store the lowest radius of the ID volume
52 double rMin = std::numeric_limits<double>::max();
53 double zAtRMin = 0.;
54 {
55 unsigned int rMinPos = 0;
56
57 // find the smallest radius of the ID volume
58 for ( unsigned int curPos=0; curPos<m_rposzInDet.size(); curPos++ ) {
59 double curR = m_rposzInDet[curPos].first;
60 double curZ = m_rposzInDet[curPos].second;
61
62 if (curR < rMin) {
63 rMin = curR;
64 zAtRMin = curZ;
65 rMinPos = curPos;
66 }
67 }
68
69 // set the lowest radius of the ID volume to ZERO
70 ATH_MSG_DEBUG("Will shift ID boundary (r,|z|)=("<<rMin<<","<<zAtRMin<<") to (r,|z|)=("<<0.<<","<<zAtRMin<<")");
71 m_rposzInDet[rMinPos].first = 0.;
72 }
73
74 // change BeamPipe/Forward boundaries according to ISF conventions
75 //
76 bool foundShiftPoint = false;
78 {
79 for ( unsigned int curPos=0; curPos<m_rposzBeamPipe.size(); curPos++ ) {
80 double curR = m_rposzBeamPipe[curPos].first;
81 double curZ = m_rposzBeamPipe[curPos].second;
82
83 // if the current radius and z-coordinate are the same as the identified lowest ID radius
84 // set this radius to ZERO too
85 if ( (fabs(curR-rMin) < 1e-4) && (fabs(curZ-zAtRMin)<1e-4) ) {
86 ATH_MSG_VERBOSE("Found boundary point in BeamPipe volume. Shifting (r,|z|)=("<<curR<<","<<curZ<<") to (r,|z|)=("<<0.<<","<<curZ<<")");
87 foundShiftPoint = true;
88 m_rposzBeamPipe[curPos].first = 0.;
89 }
90 }
91 }
92
93 // if we have shifted an (r,z) point in the ID envelope, but not in the BeamPipe envelope
94 // -> something is wrong, better throw an error!
95 if ( !foundShiftPoint) {
96 ATH_MSG_ERROR("Could not find InDet envelope point (r,z)=("<<rMin<<","<<zAtRMin<<") in the BeamPipe/Forward envelope -> Unable to shift it down to r=0.");
97 return StatusCode::FAILURE;
98 }
99
100 // mirror the RZPairs provided in m_rposz to describe all corner points
101 // in (r,z) space for the BeamPipe/Forward and the InnerDetector envelopes
102 mirrorRZ( m_rposzBeamPipe, m_rzBeamPipe );
103 mirrorRZ( m_rposzInDet , m_rzInDet );
104
105 // debugging output:
106 if (msgLvl(MSG::VERBOSE)) {
107 ATH_MSG_VERBOSE( "Envelope: complete region=" << AtlasDetDescr::fAtlasForward);
108 for ( unsigned int num = 0; num<m_rzBeamPipe.size(); num++) {
109 ATH_MSG_VERBOSE(" pos=" << num << " r=" << m_rzBeamPipe[num].first << " z="<< m_rzBeamPipe[num].second);
110 }
111 ATH_MSG_VERBOSE( "Envelope: complete region=" << AtlasDetDescr::fAtlasID);
112 for ( unsigned int num = 0; num<m_rzInDet.size(); num++) {
113 ATH_MSG_VERBOSE(" pos=" << num << " r=" << m_rzInDet[num].first << " z="<< m_rzInDet[num].second);
114 }
115 }
116
117 ATH_MSG_INFO("Initialize successful.");
118
119 return StatusCode::SUCCESS;
120}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)

Member Data Documentation

◆ m_atlasEnvDefSvc

ServiceHandle<IEnvelopeDefSvc> ISF::ISFEnvelopeDefSvc::m_atlasEnvDefSvc
private

ServiceHandle to the common ATLAS envelope definition service.

Definition at line 46 of file ISFEnvelopeDefSvc.h.

◆ m_rposzBeamPipe

RZPairVector ISF::ISFEnvelopeDefSvc::m_rposzBeamPipe
private

internal (r,z) representation for the positive z-side only, one RZPairVector for BeamPipe and InnerDetector each

Definition at line 53 of file ISFEnvelopeDefSvc.h.

◆ m_rposzInDet

RZPairVector ISF::ISFEnvelopeDefSvc::m_rposzInDet
private

Definition at line 54 of file ISFEnvelopeDefSvc.h.

◆ m_rzBeamPipe

RZPairVector ISF::ISFEnvelopeDefSvc::m_rzBeamPipe
private

internal (r,z) representation for BeamPipe and InnerDetector volumes

Definition at line 49 of file ISFEnvelopeDefSvc.h.

◆ m_rzInDet

RZPairVector ISF::ISFEnvelopeDefSvc::m_rzInDet
private

Definition at line 50 of file ISFEnvelopeDefSvc.h.


The documentation for this class was generated from the following files: