|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "CLHEP/Units/SystemOfUnits.h"
12 #include "Identifier/Identifier.h"
50 msg(MSG::INFO) <<
"initialize()" <<
endmsg;
55 return StatusCode::FAILURE;
62 return StatusCode::FAILURE;
65 return StatusCode::SUCCESS;
77 return StatusCode::SUCCESS;
91 cout <<
"======================================" <<endl;
92 cout <<
" BARREL ELEMENTS - access via index" << endl;
93 cout <<
"======================================" <<endl;
101 for (
int iSide = 0; iSide < 2; iSide++) {
102 for (
unsigned int iLayer = 0; iLayer != nBarrelRings; iLayer++) {
104 for (
unsigned int iPhiModule = 0; iPhiModule != nBarrelPhi; iPhiModule++) {
105 for (
unsigned int iStrawLayer = 0; iStrawLayer !=nBarrelLayers; iStrawLayer++) {
106 cout <<
"Barrel element " << iSide <<
", " << iLayer <<
", " << iPhiModule <<
", "<< iStrawLayer << endl;
109 Identifier newId = idHelper->
layer_id((iSide ? 1:-1), iPhiModule, iLayer, iStrawLayer);
110 idHelper->
show(newId);
112 cout <<
"idHash = " << idHash << endl;
115 cout <<
" center = " << center << endl;
117 cout <<
" number of straws = " << element->
nStraws() << endl;
119 if ((iPhiModule == 0) || (iPhiModule == 1) || (iPhiModule == 7) || (iPhiModule == 31)) {
120 for (
unsigned int istraw = 0; istraw < 15; istraw++) {
126 for (
unsigned int istraw = 0; istraw < element->
nStraws(); istraw++) {
130 cout <<
"No Element found " << endl;
139 cout <<
"======================================" <<endl;
140 cout <<
" ENDCAP ELEMENTS - access via index" << endl;
141 cout <<
"======================================" <<endl;
145 for (
int iSide = 0; iSide < 2; iSide++) {
146 for (
unsigned int iWheel = 0; iWheel !=nWheels ; iWheel++) {
148 for (
unsigned int iStrawLayer = 0; iStrawLayer != nEndcapLayers; iStrawLayer++){
150 cout <<
"Endcap element " << iSide <<
", "<< iWheel <<
", "<< iStrawLayer <<
", "<<
iPhi << endl;
155 idHelper->
show(newId);
157 cout <<
"idHash = " << idHash << endl;
161 cout <<
" center = " << center << endl;
162 cout <<
" number of straws = " << element->
nStraws() << endl;
164 int iPhiModule =
iPhi;
165 if ((iPhiModule == 0) || (iPhiModule == 1) || (iPhiModule == 7) || (iPhiModule == 31)) {
166 for (
unsigned int istraw = 0; istraw < 15; istraw++) {
172 for (
unsigned int istraw = 0; istraw < element->
nStraws(); istraw++) {
176 cout <<
"No Element found " << endl;
192 cout <<
"======================================" <<endl;
193 cout <<
" ALL ELEMENTS - access via hash" << endl;
194 cout <<
"======================================" <<endl;
197 cout <<
" maxHash = " << maxHash << endl;
201 IdentifierHash idHash =
index;
212 cout <<
" center = " << center << endl;
214 cout <<
"No Element with id hash = " << idHash << endl;
219 cout <<
"======================================" <<endl;
220 cout <<
" ALL ELEMENTS - access via index from hash" << endl;
221 cout <<
" (no printout) " << endl;
222 cout <<
"======================================" <<endl;
225 IdentifierHash idHash =
index;
231 int idBarrelEndcap = idHelper->
barrel_ec(
id);
232 int idSide = (idBarrelEndcap > 0);
256 cout <<
"No Element with id hash = " << idHash << endl;
262 cout <<
"Max diff = " <<
m_maxdiff << endl;
271 msg(MSG::INFO) <<
"finalize()" <<
endmsg;
272 return StatusCode::SUCCESS;
279 if (strawNum >= element->
nStraws()) {
280 cout <<
"Straw number out of range:" << strawNum <<
" >= " << element->
nStraws() << endl;
287 double r = sqrt(
x*
x+
y*
y);
288 double phi = atan2(
y,
x);
289 cout <<
"strawNum = " << strawNum <<
", "
290 <<
"x = " <<
x <<
", "
291 <<
"y = " <<
y <<
", "
292 <<
"z = " <<
z <<
", "
293 <<
"r = " <<
r <<
", "
294 <<
"phi = " <<
phi <<
", "
306 if (strawNum >= element->
nStraws()) {
307 cout <<
"Straw number out of range:" << strawNum <<
" >= " << element->
nStraws() << endl;
313 double phi = phiStart + strawNum*pitch;
316 cout <<
"strawNum = " << strawNum <<
", "
317 <<
"phiStart = " << phiStart <<
", "
318 <<
"pitch = " << pitch <<
", "
319 <<
"z = " <<
z <<
", "
321 <<
"phi = " <<
phi <<
", "
332 if (strawNum >= element->
nStraws()) {
333 cout <<
"Straw number out of range:" << strawNum <<
" >= " << element->
nStraws() << endl;
339 cout <<
"strawNum = " << strawNum <<
", "
340 <<
"x = " << strawCenter.x() <<
", "
341 <<
"y = " << strawCenter.y() <<
", "
342 <<
"z = " << strawCenter.z() <<
", "
343 <<
"r = " << strawCenter.perp() <<
", "
344 <<
"phi = " << strawCenter.phi() <<
", "
352 if (strawNum >= element->
nStraws()) {
353 cout <<
"Straw number out of range:" << strawNum <<
" >= " << element->
nStraws() << endl;
365 cout <<
"Straw Positions DIFFER !!!!!" << endl;
374 cout <<
"Straw number out of range:" << strawNum <<
" >= " << element->
getDescriptor()->
nStraws() << endl;
379 double phi = phiStart + strawNum*pitch;
387 cout <<
"Straw Positions DIFFER !!!!!" << endl;
396 for (
int i = 0;
i < 3;
i++) {
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.
virtual const double & strawLength() const =0
Active straw length.
Scalar phi() const
phi method
double & innerRadius()
The inner radius:
bool comparePos(const Amg::Vector3D &p1, const Amg::Vector3D &p2, const double err)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
size_type straw_layer_hash_max(void) const
unsigned int nStraws() const
Number of straws in the element.
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
const InDetDD::TRT_DetectorManager * m_manager
unsigned int & nStraws()
The number of straws in a module:
ReadTRT_DetectorElements(const std::string &name, ISvcLocator *pSvcLocator)
Default Algorithm constructor with parameters.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
unsigned int getNEndcapWheels() const
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
void compareBarrelStraw(const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum)
virtual const double & strawLength() const override final
Get the length of the straws (active length):
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_managerName
const TRT_EndcapDescriptor * getDescriptor() const
Returns a pointer to a descriptor, giving common information on module construction.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
unsigned int getNBarrelPhi() const
unsigned int getNBarrelLayers(unsigned int iMod) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
void printStraw(const InDetDD::TRT_BaseElement *element, const unsigned int strawNum)
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
void printEndcapStraw(const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum)
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
double & startPhi()
The starting phi (angular!!)
void printBarrelStraw(const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum)
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
void show(Identifier id, const IdContext *context=0, char sep='.') const
Short print out of any identifier (optionally provide separation character - default is '.
Eigen::Matrix< double, 3, 1 > Vector3D
int phi_module(const Identifier &id) const
double & strawPitch()
The straw pitch (angular!!)
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
bool is_barrel(const Identifier &id) const
Test for barrel.
double strawZPos(unsigned int i) const
Get Z Position: (active center) DEPRECATED.
void compareEndcapStraw(const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum)
unsigned int getNEndcapPhi() const
unsigned int getNEndcapLayers(unsigned int iWheel) const
unsigned int getNBarrelRings() const
double strawYPos(unsigned int i) const
Get Y Position: DEPRECATED.
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.
const TRT_ID * m_idHelper