ATLAS Offline Software
Loading...
Searching...
No Matches
D3PD::PerigeeBLPredictionFillerTool Class Reference

Fill expectHitInBLayer from a Perigee. More...

#include <PerigeeBLPredictionFillerTool.h>

Inheritance diagram for D3PD::PerigeeBLPredictionFillerTool:
Collaboration diagram for D3PD::PerigeeBLPredictionFillerTool:

Public Member Functions

 PerigeeBLPredictionFillerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual StatusCode initialize () override
 Standard Gaudi initialize method.
virtual StatusCode book () final
 Book variables for this block.
virtual StatusCode fill (const Trk::Perigee &p) override
 Fill one block — type-safe version.
 BlockFillerToolImpl (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual StatusCode configureD3PD (IAddVariable *tree, const std::type_info &ti)
 Configure during initialization: type-check.
StatusCode configureD3PD (IAddVariable *tree)
 Configure the parent tree.
virtual StatusCode fillUntyped (const void *p, bool again=false)
 Fill one block.
virtual StatusCode fillAgain (const Trk::Perigee &p)
 Fill one block, after AGAIN has been returned (type-safe).
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple.
StatusCode addVariable (const std::string &name, Trk::Perigee *&ptr, const std::string &docstring="")
 Make the template implementation from IAddVariable visible.
StatusCode addVariable (const std::string &name, Trk::Perigee *&ptr, const std::string &docstring, const U &defval)
 Make the template implementation from IAddVariable visible.
virtual StatusCode addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple.
StatusCode addDimensionedVariable (const std::string &name, Trk::Perigee *&ptr, const std::string &dim, const std::string &docstring="")
 Add a variable to the tuple.
StatusCode addDimensionedVariable (const std::string &name, Trk::Perigee *&ptr, const std::string &dim, const std::string &docstring, const U &defval)
 Add a variable to the tuple.

Protected Member Functions

StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::type_info &fill_ti)
 Configure during initialization: type-check.
StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::vector< const std::type_info * > &tis, size_t &which)
 Configure during initialization: type-check.
StatusCode convert (void const *&p) const
 Do type conversion.

Protected Attributes

ObjectMetadata m_metadata
 Metadata about the variables created by this object.

Private Member Functions

void clearData ()

Private Attributes

ToolHandle< InDet::IInDetTestPixelLayerToolm_inDetTestPixelLayerTool { this, "InDetTestPixelLayerTool", "", "Tool to test if the track crosses a dead module on the B-Layer." }
 Parameter: Tool to test if the track crosses a dead module on the B-Layer.
const PixelIDm_pixId
std::vector< float > * m_x
 Variables:
std::vector< float > * m_y
std::vector< float > * m_z
std::vector< float > * m_locX
std::vector< float > * m_locY
std::vector< float > * m_err_locX
std::vector< float > * m_err_locY
std::vector< float > * m_etaDistToEdge
std::vector< float > * m_phiDistToEdge
std::vector< Identifier32::value_type > * m_detElementId
std::vector< int > * m_row
std::vector< int > * m_col
std::vector< int > * m_type
std::string m_prefix
 Property: the variable prefix for this block.
std::string m_suffix
 Property: the variable prefix for this block.
std::string m_blockName
 Property: the name of this block.
TypeConverter m_converter
 Helper to do type conversions.
IAddVariablem_tree
 Reference to the block name.

Static Private Attributes

static const std::string s_emptyString
 Used to provide a default value for blockName.

Detailed Description

Fill expectHitInBLayer from a Perigee.

Definition at line 27 of file PerigeeBLPredictionFillerTool.h.

Constructor & Destructor Documentation

◆ PerigeeBLPredictionFillerTool()

D3PD::PerigeeBLPredictionFillerTool::PerigeeBLPredictionFillerTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 26 of file PerigeeBLPredictionFillerTool.cxx.

30 : BlockFillerTool<Trk::Perigee> (type, name, parent)
31{
32 book().ignore(); // Avoid coverity warnings.
33}
virtual StatusCode book() final
Book variables for this block.

Member Function Documentation

◆ addDimensionedVariable() [1/3]

StatusCode D3PD::AddVariable::addDimensionedVariable ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & dim,
const std::string & docstring = "",
const void * defval = 0 )
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Definition at line 119 of file AddVariable.cxx.

129{
130 if (!m_tree) {
131 // Called from constructor --- just initialize pointer.
132 ptr = 0;
133 return StatusCode::SUCCESS;
134 }
135
137 ti, ptr, dim,
138 docstring, defval ) );
140 ti, ptr, dim,
142}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addDimensionedVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Type-safe wrapper for block filler tools.

◆ addDimensionedVariable() [2/3]

StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string & name,
Trk::Perigee *& ptr,
const std::string & dim,
const std::string & docstring,
const U & defval )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [3/3]

StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string & name,
Trk::Perigee *& ptr,
const std::string & dim,
const std::string & docstring = "" )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [1/3]

StatusCode D3PD::AddVariable::addVariable ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & docstring = "",
const void * defval = 0 )
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Definition at line 93 of file AddVariable.cxx.

90{
91 if (!m_tree) {
92 // Called from constructor --- just initialize pointer.
93 ptr = 0;
95 }
96
98 ti, ptr, docstring, defval ) );
101}
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.

◆ addVariable() [2/3]

StatusCode D3PD::IAddVariable::addVariable ( const std::string & name,
Trk::Perigee *& ptr,
const std::string & docstring,
const U & defval )
inherited

Make the template implementation from IAddVariable visible.

◆ addVariable() [3/3]

StatusCode D3PD::IAddVariable::addVariable ( const std::string & name,
Trk::Perigee *& ptr,
const std::string & docstring = "" )
inherited

Make the template implementation from IAddVariable visible.

◆ BlockFillerToolImpl()

( const std::string & type,
const std::string & name,
const IInterface * parent )
inherited

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

◆ book()

StatusCode D3PD::PerigeeBLPredictionFillerTool::book ( )
finalvirtual

Book variables for this block.

Implements D3PD::BlockFillerTool< Trk::Perigee >.

Definition at line 52 of file PerigeeBLPredictionFillerTool.cxx.

53{
54
55 CHECK( addVariable ("x", m_x, "predicted x global position in the B-layer" ) );
56 CHECK( addVariable ("y", m_y, "predicted y global position in the B-layer" ) );
57 CHECK( addVariable ("z", m_z, "predicted z global position in the B-layer" ) );
58 CHECK( addVariable ("locX", m_locX, "predicted x local position in the B-layer" ) );
59 CHECK( addVariable ("locY", m_locY, "predicted y local position in the B-layer" ) );
60 CHECK( addVariable ("err_locX", m_err_locX, "error on local x prediction in the B-layer" ) );
61 CHECK( addVariable ("err_locY", m_err_locY, "error on local y prediction in the B-layer" ) );
62 CHECK( addVariable ("etaDistToEdge", m_etaDistToEdge, "distance of B-layer prediction to module edge along eta") );
63 CHECK( addVariable ("phiDistToEdge", m_phiDistToEdge, "distance of B-layer prediction to module edge along phi") );
64 CHECK( addVariable ("detElementId", m_detElementId, "detector element identifier of B-layer prediction" ) );
65 CHECK( addVariable ("row", m_row, "" ) );
66 CHECK( addVariable ("col", m_col, "" ) );
67 CHECK( addVariable ("type", m_type, "" ) );
68
69 return StatusCode::SUCCESS;
70}
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
std::vector< Identifier32::value_type > * m_detElementId

◆ clearData()

void D3PD::PerigeeBLPredictionFillerTool::clearData ( )
private

Definition at line 130 of file PerigeeBLPredictionFillerTool.cxx.

130 {
131
132 m_x->clear();
133 m_y->clear();
134 m_z->clear();
135 m_locX->clear();
136 m_locY->clear();
137 m_err_locX->clear();
138 m_err_locY->clear();
139 m_etaDistToEdge->clear();
140 m_phiDistToEdge->clear();
141 m_detElementId->clear();
142 m_row->clear();
143 m_col->clear();
144 m_type->clear();
145}

◆ configureD3PD() [1/2]

StatusCode D3PD::AddVariable::configureD3PD ( IAddVariable * tree)
inherited

Configure the parent tree.

Parameters
treeThe parent IAddVariable instance.

Definition at line 69 of file AddVariable.cxx.

62{
63 m_tree = tree;
64 m_metadata.clear();
66}

◆ configureD3PD() [2/2]

virtual StatusCode D3PD::BlockFillerTool< Trk::Perigee >::configureD3PD ( IAddVariable * tree,
const std::type_info & ti )
virtualinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.

configureD3PD should check that the type of the object coming as input is compatible with what it expects, and raise an error otherwise.

◆ configureImpl() [1/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable * tree,
const std::type_info & ti,
const std::type_info & fill_ti )
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
fill_tiis the type of object that the user code will expect.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

Definition at line 70 of file BlockFillerToolImpl.cxx.

58{
60 CHECK( m_converter.init (ti, fill_ti) );
61
63}

◆ configureImpl() [2/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable * tree,
const std::type_info & ti,
const std::vector< const std::type_info * > & tis,
size_t & which )
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
tisList of possible input types that we can accept.
[out]whichIndex of the accepted type.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

This version allows for one of a set of types to match. If successful, WHICH is set to the index (0-based) of the matching type.

Definition at line 91 of file BlockFillerToolImpl.cxx.

87{
89 CHECK( m_converter.init (ti, tis, which) );
91}

◆ convert()

StatusCode D3PD::BlockFillerToolImpl::convert ( void const *& p) const
protectedinherited

Do type conversion.

Parameters
p[in,out]Pointer to convert.

On entry, p is a pointer to an object of the type that was passed into configureImpl as ti. Convert the pointer to point to an object of the type that was given as fill_ti. If the conversion fails, the pointer is set to 0 (and FAILURE is returned).

Definition at line 107 of file BlockFillerToolImpl.cxx.

106{
107 p = m_converter.convertUntyped (p);
108 if (!p) {
110 << "Pointer conversion from " << m_converter.srcName() << " to "
111 << m_converter.dstName() << "failed.";
112 return StatusCode::FAILURE;
113 }
114 return StatusCode::SUCCESS;
115}
#define REPORT_MESSAGE(LVL)
Report a message.

◆ fill()

StatusCode D3PD::PerigeeBLPredictionFillerTool::fill ( const Trk::Perigee & p)
overridevirtual

Fill one block — type-safe version.

Parameters
pThe input object.

This is called once per object. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

Implements D3PD::BlockFillerTool< Trk::Perigee >.

Definition at line 82 of file PerigeeBLPredictionFillerTool.cxx.

82 {
83
84 this->clearData();
85
86 std::vector<InDet::TrackStateOnPixelLayerInfo> trackStateBlayer;
87 if(!m_inDetTestPixelLayerTool->getTrackStateOnInnermostPixelLayerInfo(&p, trackStateBlayer)){
88 return StatusCode::SUCCESS;
89 }
90
91 std::vector<InDet::TrackStateOnPixelLayerInfo>::const_iterator itr = trackStateBlayer.begin();
92 std::vector<InDet::TrackStateOnPixelLayerInfo>::const_iterator end = trackStateBlayer.end();
93 for (; itr!=end; ++itr){
94 Identifier id = itr->moduleId();
95
96 if(id.is_valid()){
97 m_detElementId->push_back(id.get_identifier32().get_compact());
98 }else{
99 m_detElementId->push_back(0);
100 }
101
102 m_type->push_back((int)itr->type());
103
104 m_etaDistToEdge->push_back(itr->distToModuleEdgeEta());
105 m_phiDistToEdge->push_back(itr->distToModuleEdgePhi());
106
107 Identifier holeId_c = itr->pixelId();
108 if(holeId_c.is_valid()){
109 m_col->push_back(m_pixId->eta_index(holeId_c));
110 m_row->push_back(m_pixId->phi_index(holeId_c));
111 }else{
112 m_col->push_back(-1);
113 m_row->push_back(-1);
114 }
115
116 m_x->push_back(itr->globalPosition().x());
117 m_y->push_back(itr->globalPosition().y());
118 m_z->push_back(itr->globalPosition().z());
119
120 m_locX->push_back(itr->localX());
121 m_locY->push_back(itr->localY());
122
123 m_err_locX->push_back(itr->errLocalX());
124 m_err_locY->push_back(itr->errLocalY());
125 }
126
127 return StatusCode::SUCCESS;
128}
ToolHandle< InDet::IInDetTestPixelLayerTool > m_inDetTestPixelLayerTool
Parameter: Tool to test if the track crosses a dead module on the B-Layer.
bool is_valid() const
Check if id is in a valid state.

◆ fillAgain()

virtual StatusCode D3PD::BlockFillerTool< Trk::Perigee >::fillAgain ( const Trk::Perigee & p)
virtualinherited

Fill one block, after AGAIN has been returned (type-safe).

Parameters
pThe input object.

Once fill returns AGAIN, the parent should call fillAgain with the same arguments. This continues until fillAgain returns something other than AGAIN.

By default, this just calls fill().

◆ fillUntyped()

virtual StatusCode D3PD::BlockFillerTool< Trk::Perigee >::fillUntyped ( const void * p,
bool again = false )
virtualinherited

Fill one block.

Parameters
pThe input object.
againSet if this is a subsequent call requested by an AGAIN return

This is called once per object. The type of the object at which p points is given by the ti argument to configureD3PD. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

If the return status is the special code AGAIN (defined above), then this filler tool wants to make multiple entries. The parent should set up to capture a new ‘row’ and run through the list of block filler tools again, but for this tool call fillAgainUntyped instead of fillUntyped. This should be repeated as long as fillAgainUntyped returns AGAIN.

Once fillUntyped returns AGAIN, the parent should call fillUntyped with the same p argument and again set to true. This continues until fillUntyped returns something other than AGAIN.

Not all parents may support this. In that case, returning AGAIN will be treated as an error.

◆ initialize()

StatusCode D3PD::PerigeeBLPredictionFillerTool::initialize ( )
overridevirtual

Standard Gaudi initialize method.

Definition at line 39 of file PerigeeBLPredictionFillerTool.cxx.

40{
41 CHECK( BlockFillerTool<Trk::Perigee>::initialize() );
42 CHECK( m_inDetTestPixelLayerTool.retrieve() );
43 CHECK( detStore()->retrieve(m_pixId, "PixelID") );
44
45 return StatusCode::SUCCESS;
46}
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

Member Data Documentation

◆ m_blockName

std::string D3PD::BlockFillerToolImpl::m_blockName
privateinherited

Property: the name of this block.

Definition at line 118 of file BlockFillerToolImpl.h.

◆ m_col

std::vector<int>* D3PD::PerigeeBLPredictionFillerTool::m_col
private

Definition at line 81 of file PerigeeBLPredictionFillerTool.h.

◆ m_converter

TypeConverter D3PD::BlockFillerToolImpl::m_converter
privateinherited

Helper to do type conversions.

Definition at line 121 of file BlockFillerToolImpl.h.

◆ m_detElementId

std::vector<Identifier32::value_type>* D3PD::PerigeeBLPredictionFillerTool::m_detElementId
private

Definition at line 79 of file PerigeeBLPredictionFillerTool.h.

◆ m_err_locX

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_err_locX
private

Definition at line 75 of file PerigeeBLPredictionFillerTool.h.

◆ m_err_locY

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_err_locY
private

Definition at line 76 of file PerigeeBLPredictionFillerTool.h.

◆ m_etaDistToEdge

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_etaDistToEdge
private

Definition at line 77 of file PerigeeBLPredictionFillerTool.h.

◆ m_inDetTestPixelLayerTool

ToolHandle< InDet::IInDetTestPixelLayerTool > D3PD::PerigeeBLPredictionFillerTool::m_inDetTestPixelLayerTool { this, "InDetTestPixelLayerTool", "", "Tool to test if the track crosses a dead module on the B-Layer." }
private

Parameter: Tool to test if the track crosses a dead module on the B-Layer.

Definition at line 62 of file PerigeeBLPredictionFillerTool.h.

63{ this, "InDetTestPixelLayerTool", "", "Tool to test if the track crosses a dead module on the B-Layer." };

◆ m_locX

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_locX
private

Definition at line 73 of file PerigeeBLPredictionFillerTool.h.

◆ m_locY

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_locY
private

Definition at line 74 of file PerigeeBLPredictionFillerTool.h.

◆ m_metadata

ObjectMetadata D3PD::AddVariable::m_metadata
protectedinherited

Metadata about the variables created by this object.

Definition at line 129 of file AddVariable.h.

◆ m_phiDistToEdge

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_phiDistToEdge
private

Definition at line 78 of file PerigeeBLPredictionFillerTool.h.

◆ m_pixId

const PixelID* D3PD::PerigeeBLPredictionFillerTool::m_pixId
private

Definition at line 65 of file PerigeeBLPredictionFillerTool.h.

◆ m_prefix

std::string D3PD::BlockFillerToolImpl::m_prefix
privateinherited

Property: the variable prefix for this block.

Definition at line 112 of file BlockFillerToolImpl.h.

◆ m_row

std::vector<int>* D3PD::PerigeeBLPredictionFillerTool::m_row
private

Definition at line 80 of file PerigeeBLPredictionFillerTool.h.

◆ m_suffix

std::string D3PD::BlockFillerToolImpl::m_suffix
privateinherited

Property: the variable prefix for this block.

Definition at line 115 of file BlockFillerToolImpl.h.

◆ m_tree

IAddVariable* D3PD::AddVariable::m_tree
privateinherited

Reference to the block name.

The parent IAddVariable instance.

Definition at line 143 of file AddVariable.h.

◆ m_type

std::vector<int>* D3PD::PerigeeBLPredictionFillerTool::m_type
private

Definition at line 82 of file PerigeeBLPredictionFillerTool.h.

◆ m_x

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_x
private

Variables:

Definition at line 70 of file PerigeeBLPredictionFillerTool.h.

◆ m_y

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_y
private

Definition at line 71 of file PerigeeBLPredictionFillerTool.h.

◆ m_z

std::vector<float>* D3PD::PerigeeBLPredictionFillerTool::m_z
private

Definition at line 72 of file PerigeeBLPredictionFillerTool.h.

◆ s_emptyString

const std::string D3PD::AddVariable::s_emptyString
staticprivateinherited

Used to provide a default value for blockName.

Definition at line 41 of file AddVariable.h.


The documentation for this class was generated from the following files: