7#include "CLHEP/Units/SystemOfUnits.h"
12#include "Identifier/Identifier.h"
50 msg(MSG::INFO) <<
"initialize()" <<
endmsg;
55 return StatusCode::FAILURE;
57 msg(MSG::DEBUG) <<
"Manager found" <<
endmsg;
61 msg(MSG::FATAL) <<
"Could not get TRT ID helper" <<
endmsg;
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++){
149 for(
unsigned int iPhi = 0; iPhi != nEndcapPhi; iPhi++){
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;
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;
231 int idBarrelEndcap = idHelper->
barrel_ec(
id);
232 int idSide = (idBarrelEndcap > 0);
246 element =
m_manager->getBarrelElement(idSide, idLayerWheel, idPhiModule, idStrawLayer);
248 element =
m_manager->getEndcapElement(idSide, idLayerWheel, idStrawLayer, idPhiModule);
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;
315 double z = (element->
transform() * origin).z();
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;
381 double z = (element->
transform() * origin).z();
387 cout <<
"Straw Positions DIFFER !!!!!" << endl;
396 for (
int i = 0; i < 3; i++) {
397 double diff = std::abs(p1[i] - p2[i]);
399 if (
diff > err)
return false;
Scalar phi() const
phi method
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
This is an Identifier helper class for the TRT subdetector.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
void show(Identifier id, const IdContext *context=0, char sep='.') const
Short print out of any identifier (optionally provide separation character - default is '.
This is a "hash" representation of an Identifier.
Extended TRT_BaseElement to describe a TRT readout element, this is a planar layer with n ( order of ...
double strawXPos(unsigned int i) const
Get X Position: DEPRECATED.
double strawZPos(unsigned int i) const
Get Z Position: (active center) DEPRECATED.
virtual const double & strawLength() const override final
Get the length of the straws (active length):
double strawYPos(unsigned int i) const
Get Y Position: DEPRECATED.
Virtual base class of TRT readout elements.
virtual const double & strawLength() const =0
Active straw length.
unsigned int nStraws() const
Number of straws in the element.
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
double & strawPitch()
The straw pitch (angular!
double & startPhi()
The starting phi (angular!
unsigned int & nStraws()
The number of straws in a module:
double & innerRadius()
The inner radius:
Extended class of a TRT_BaseElement to describe a readout elment in the endcap.
const TRT_EndcapDescriptor * getDescriptor() const
Returns a pointer to a descriptor, giving common information on module construction.
Helper class to organize the straw elements on TRT readout elements.
unsigned int getNEndcapWheels() const
unsigned int getNEndcapPhi() const
unsigned int getNBarrelPhi() const
unsigned int getNBarrelRings() const
unsigned int getNBarrelLayers(unsigned int iMod) const
unsigned int getNEndcapLayers(unsigned int iWheel) const
void printStraw(const InDetDD::TRT_BaseElement *element, const unsigned int strawNum)
void printBarrelStraw(const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum)
ReadTRT_DetectorElements(const std::string &name, ISvcLocator *pSvcLocator)
Default Algorithm constructor with parameters.
void compareEndcapStraw(const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum)
const InDetDD::TRT_DetectorManager * m_manager
bool comparePos(const Amg::Vector3D &p1, const Amg::Vector3D &p2, const double err)
void compareBarrelStraw(const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum)
std::string m_managerName
void printEndcapStraw(const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum)
const TRT_ID * m_idHelper
This is an Identifier helper class for the TRT subdetector.
int phi_module(const Identifier &id) const
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
size_type straw_layer_hash_max() const
bool is_barrel(const Identifier &id) const
Test for barrel.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
int layer_or_wheel(const Identifier &id) const
int straw_layer(const Identifier &id) const
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D