|
ATLAS Offline Software
|
Algorithm to demonstrate access to TRT detector elements, printing out parameters of specific straws.
More...
#include <ReadTRT_DetectorElements.h>
|
| ReadTRT_DetectorElements (const std::string &name, ISvcLocator *pSvcLocator) |
| Default Algorithm constructor with parameters. More...
|
|
StatusCode | initialize () |
|
StatusCode | execute () |
|
StatusCode | finalize () |
|
void | printAllElements () |
|
void | printBarrelStraw (const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum) |
|
void | printEndcapStraw (const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum) |
|
void | printStraw (const InDetDD::TRT_BaseElement *element, const unsigned int strawNum) |
|
void | compareBarrelStraw (const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum) |
|
void | compareEndcapStraw (const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum) |
|
bool | comparePos (const Amg::Vector3D &p1, const Amg::Vector3D &p2, const double err) |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Algorithm to demonstrate access to TRT detector elements, printing out parameters of specific straws.
Definition at line 39 of file ReadTRT_DetectorElements.h.
◆ StoreGateSvc_t
◆ ReadTRT_DetectorElements()
ReadTRT_DetectorElements::ReadTRT_DetectorElements |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ compareBarrelStraw()
Definition at line 351 of file ReadTRT_DetectorElements.cxx.
352 if (strawNum >= element->
nStraws()) {
353 cout <<
"Straw number out of range:" << strawNum <<
" >= " << element->
nStraws() << endl;
365 cout <<
"Straw Positions DIFFER !!!!!" << endl;
◆ compareEndcapStraw()
◆ comparePos()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode ReadTRT_DetectorElements::execute |
( |
| ) |
|
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode ReadTRT_DetectorElements::finalize |
( |
| ) |
|
◆ initialize()
StatusCode ReadTRT_DetectorElements::initialize |
( |
| ) |
|
Definition at line 49 of file ReadTRT_DetectorElements.cxx.
50 msg(MSG::INFO) <<
"initialize()" <<
endmsg;
55 return StatusCode::FAILURE;
62 return StatusCode::FAILURE;
65 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ printAllElements()
void ReadTRT_DetectorElements::printAllElements |
( |
| ) |
|
Definition at line 80 of file ReadTRT_DetectorElements.cxx.
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;
◆ printBarrelStraw()
Definition at line 277 of file ReadTRT_DetectorElements.cxx.
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 <<
", "
◆ printEndcapStraw()
Definition at line 302 of file ReadTRT_DetectorElements.cxx.
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 <<
", "
◆ printStraw()
Definition at line 330 of file ReadTRT_DetectorElements.cxx.
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() <<
", "
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_doExec
bool ReadTRT_DetectorElements::m_doExec |
|
private |
◆ m_doInit
bool ReadTRT_DetectorElements::m_doInit |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_first
bool ReadTRT_DetectorElements::m_first |
|
private |
◆ m_idHelper
◆ m_manager
◆ m_managerName
std::string ReadTRT_DetectorElements::m_managerName |
|
private |
◆ m_maxdiff
double ReadTRT_DetectorElements::m_maxdiff |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
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.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const InDetDD::TRT_DetectorManager * m_manager
unsigned int & nStraws()
The number of straws in a module:
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
unsigned int getNEndcapWheels() const
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
virtual StatusCode sysInitialize() override
Override sysInitialize.
void compareBarrelStraw(const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
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
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
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)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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
DataObjIDColl m_extendedExtraObjects
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.
#define ATH_MSG_WARNING(x)
double strawZPos(unsigned int i) const
Get Z Position: (active center) DEPRECATED.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void compareEndcapStraw(const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum)
unsigned int getNEndcapPhi() const
AthAlgorithm()
Default constructor:
unsigned int getNEndcapLayers(unsigned int iWheel) const
unsigned int getNBarrelRings() const
double strawYPos(unsigned int i) const
Get Y Position: DEPRECATED.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
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