ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 More...
 
 ~ISFEnvelopeDefSvc ()
 Destructor. More...
 
StatusCode initialize ()
 AthService initialize method. More...
 
StatusCode finalize ()
 AthService finalize method. More...
 
const RZPairVectorgetRZBoundary (AtlasDetDescr::AtlasRegion region) const
 return a vector of (r,z) pairs, defining the respective envelope More...
 
const RZPairVectorgetRPositiveZBoundary (AtlasDetDescr::AtlasRegion region) const
 return a vector of (r,z) pairs, defining the envelope on the z>0 region More...
 

Private Attributes

ServiceHandle< IEnvelopeDefSvcm_atlasEnvDefSvc
 ServiceHandle to the common ATLAS envelope definition service. More...
 
RZPairVector m_rzBeamPipe
 internal (r,z) representation for BeamPipe and InnerDetector volumes More...
 
RZPairVector m_rzInDet
 
RZPairVector m_rposzBeamPipe
 internal (r,z) representation for the positive z-side only, one RZPairVector for BeamPipe and InnerDetector each More...
 
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),
19  m_rzBeamPipe(),
20  m_rzInDet(),
22  m_rposzInDet()
23 {
24  declareProperty("ATLASEnvelopeDefSvc" , m_atlasEnvDefSvc );
25 }

◆ ~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 }

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:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
max
#define max(a, b)
Definition: cfImp.cxx:41
AtlasDetDescr::fAtlasForward
@ fAtlasForward
Definition: AtlasRegion.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ISF::ISFEnvelopeDefSvc::m_rposzBeamPipe
RZPairVector m_rposzBeamPipe
internal (r,z) representation for the positive z-side only, one RZPairVector for BeamPipe and InnerDe...
Definition: ISFEnvelopeDefSvc.h:53
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::ISFEnvelopeDefSvc::m_rzBeamPipe
RZPairVector m_rzBeamPipe
internal (r,z) representation for BeamPipe and InnerDetector volumes
Definition: ISFEnvelopeDefSvc.h:49
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::ISFEnvelopeDefSvc::m_rposzInDet
RZPairVector m_rposzInDet
Definition: ISFEnvelopeDefSvc.h:54
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AtlasDetDescr::fAtlasID
@ fAtlasID
Definition: AtlasRegion.h:33
ISF::ISFEnvelopeDefSvc::m_atlasEnvDefSvc
ServiceHandle< IEnvelopeDefSvc > m_atlasEnvDefSvc
ServiceHandle to the common ATLAS envelope definition service.
Definition: ISFEnvelopeDefSvc.h:46
DeMoScan.first
bool first
Definition: DeMoScan.py:536
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
ISF::ISFEnvelopeDefSvc::m_rzInDet
RZPairVector m_rzInDet
Definition: ISFEnvelopeDefSvc.h:50