|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/EventIDRange.h"
22 #include "GaudiKernel/MsgStream.h"
29 #include "Identifier/Identifier.h"
65 return StatusCode::SUCCESS;
84 return StatusCode::SUCCESS;
91 if (not trtDetEleHandle.
isValid() or elements==
nullptr) {
93 return StatusCode::FAILURE;
102 if (
mapping.retrieve().isFailure() ) {
103 msg(MSG::ERROR) <<
" Can't get TRT CablingSvc " <<
endmsg;
104 return StatusCode::FAILURE;
109 const TRT_ID* idHelper =
nullptr;
112 return StatusCode::FAILURE;
115 EventIDRange id_range;
117 if( !trtDetEleHandle.
range( id_range ) ) {
118 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << trtDetEleHandle.
key());
119 return StatusCode::FAILURE;
130 std::unique_ptr<RegSelSiLUT> rd = std::make_unique<RegSelSiLUT>(
RegSelSiLUT::TRT);
132 constexpr
double twoPi=2.*
M_PI;
133 constexpr
double InnerRadiusOfStraw = 2.;
138 int idBarrelEndcap = idHelper->
barrel_ec(
id);
139 int idSide = (idBarrelEndcap > 0);
146 double phiMin,phiMax,rz;
150 int Nstraws = Belement->
nStraws();
151 const int theLastStraw=Nstraws-1;
157 double r0 = sqrt(x0*x0 + y0*y0);
159 phiMin = std::atan2(y0,x0) - std::atan2(InnerRadiusOfStraw,
r0);
160 while (phiMin >
M_PI) phiMin -= twoPi;
161 while (phiMin < -
M_PI) phiMin += twoPi;
162 phiMax = std::atan2(
y1,
x1) + std::atan2(InnerRadiusOfStraw,r1);
163 while (phiMax >
M_PI) phiMax -= twoPi;
164 while (phiMax < -
M_PI) phiMax += twoPi;
165 double zmin = Belement->
strawZPos(theLastStraw) - Length*0.5;
166 double zmax = Belement->
strawZPos(theLastStraw) + Length*0.5;
167 double rmin = (
r0<r1 ?
r0 : r1 ) - InnerRadiusOfStraw;
168 double rmax = ( r1>
r0 ? r1 :
r0 ) + InnerRadiusOfStraw;
169 std::vector<uint32_t> vrob =
mapping->getRobID(idelement);
170 for (
unsigned int ii=0 ; ii < vrob.size(); ++ii) {
171 RegSelModule smod(
zmin,
zmax, rmin, rmax, phiMin, phiMax, idLayerWheel, idSide, vrob[ii], idHash);
184 double dphi = std::atan2(InnerRadiusOfStraw,
radius );
185 phiMin =
phi0 - dphi;
186 while (phiMin >
M_PI) phiMin -= twoPi;
187 while (phiMin < -
M_PI) phiMin += twoPi;
188 phiMax =
phi0 + pitch * (Nstraws-1) + dphi;
189 while (phiMax >
M_PI) phiMax -= twoPi;
190 while (phiMax < -
M_PI) phiMax += twoPi;
196 double zmin = rz-InnerRadiusOfStraw;
197 double zmax = rz+InnerRadiusOfStraw;
200 std::vector<uint32_t> vrob =
mapping->getRobID(idelement);
201 for (
unsigned int ii=0 ; ii < vrob.size(); ++ii) {
202 RegSelModule smod(
zmin,
zmax, rmin, rmax, phiMin, phiMax, idLayerWheel, idSide+2, vrob[ii], idHash);
225 if( lutCondData.
record( id_range, rcd ).isFailure() ) {
227 <<
" " << lutCondData.
key()
228 <<
" with range " << id_range );
229 return StatusCode::FAILURE;
235 return StatusCode::FAILURE;
241 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
double strawXPos(unsigned int i) const
Get X Position: DEPRECATED.
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
double & innerRadius()
The inner radius:
TRT_RegSelCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class to hold different TRT detector elements structures.
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleContKey
size_type straw_layer_hash_max(void) const
unsigned int nStraws() const
Number of straws in the element.
emacs: this is -*- c++ -*-
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
emacs: this is -*- c++ -*-
unsigned int & nStraws()
The number of straws in a module:
bool range(EventIDRange &r)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
void write(std::ostream &s=std::cout) const
const DataObjID & fullKey() const
virtual StatusCode execute(const EventContext &ctx) const override
virtual const double & strawLength() const override final
Get the length of the straws (active length):
::StatusCode StatusCode
StatusCode definition for legacy code.
const TRT_EndcapDescriptor * getDescriptor() const
Returns a pointer to a descriptor, giving common information on module construction.
const double r0
electron radius{cm}
virtual Identifier identify() const override final
identifier of this detector element:
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
double & startPhi()
The starting phi (angular!!)
const TRT_BarrelElement * getBarrelDetElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
const std::string & key() const
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
int phi_module(const Identifier &id) const
void addModule(RegSelModule &module)
double & strawPitch()
The straw pitch (angular!!)
bool is_barrel(const Identifier &id) const
Test for barrel.
double strawZPos(unsigned int i) const
Get Z Position: (active center) DEPRECATED.
SG::WriteCondHandleKey< IRegSelLUTCondData > m_tableKey
Output conditions object.
virtual StatusCode initialize() override
const std::string & key() const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const TRT_EndcapElement * getEndcapDetElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
double strawYPos(unsigned int i) const
Get Y Position: DEPRECATED.
RegSelCondData< IRegSelLUT > IRegSelLUTCondData
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.