|
ATLAS Offline Software
|
For every electron find jets in a cone and store lifetime, signed IP, and PTRel of relation.
More...
#include <ElectronJetDRAssociator.h>
|
| ElectronJetDRAssociator (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard Gaudi tool constructor. More...
|
|
virtual StatusCode | initialize () override |
| Standard Gaudi initialize method. More...
|
|
virtual StatusCode | configureD3PD (IAddVariable *tree, const std::type_info &ti) override |
| Configure during initialization: type-check. More...
|
|
virtual StatusCode | reset (const xAOD::Electron &eg) override |
| Start the iteration for a new association. More...
|
|
virtual const xAOD::Jet * | next () override |
| Return a pointer to the next element in the association. More...
|
|
virtual StatusCode | book () final |
| Create any needed tuple variables. More...
|
|
virtual const std::type_info & | fromTypeinfo () const |
| Return the std::type_info for the source of the association. More...
|
|
virtual const std::type_info & | fromTypeinfo () const =0 |
| Return the std::type_info for the source of the association. More...
|
|
virtual StatusCode | resetUntyped (const void *p) |
| Start the iteration for a new association. More...
|
|
virtual const std::type_info & | elementTypeinfo () const |
| Return the element type for the target of the association. More...
|
|
virtual const void * | nextUntyped () |
| Return a pointer to the next element in the association. More...
|
|
virtual void | releaseElementUntyped (const void *p) |
| Release an object retrieved from the association. More...
|
|
virtual void | releaseElement (const xAOD::Jet *p) |
| Release an object retrieved from the association. More...
|
|
StatusCode | configureD3PD (IAddVariable *tree) |
| Configure the parent tree. More...
|
|
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. More...
|
|
template<class T > |
StatusCode | addVariable (const std::string &name, T *&ptr, const std::string &docstring="") |
| Make the template implementation from IAddVariable visible. More...
|
|
template<class T , class U > |
StatusCode | addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval) |
| Make the template implementation from IAddVariable visible. More...
|
|
virtual StatusCode | addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)=0 |
| Make the template implementation from IAddVariable visible. More...
|
|
template<class T > |
StatusCode | addVariable (const std::string &name, T *&ptr, const std::string &docstring="") |
| Add a variable to the tuple. More...
|
|
template<class T , class U > |
StatusCode | addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval) |
| Add a variable to the tuple. More...
|
|
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. More...
|
|
template<class T > |
StatusCode | addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="") |
| Add a variable to the tuple. More...
|
|
template<class T , class U > |
StatusCode | addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring, const U &defval) |
| Add a variable to the tuple. More...
|
|
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)=0 |
| Add a variable to the tuple. More...
|
|
template<class T > |
StatusCode | addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="") |
| Add a variable to the tuple. More...
|
|
template<class T , class U > |
StatusCode | addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring, const U &defval) |
| Add a variable to the tuple. More...
|
|
For every electron find jets in a cone and store lifetime, signed IP, and PTRel of relation.
Definition at line 42 of file ElectronJetDRAssociator.h.
◆ Base
◆ ElectronJetDRAssociator()
D3PD::ElectronJetDRAssociator::ElectronJetDRAssociator |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Standard Gaudi tool constructor.
- Parameters
-
type | The name of the tool type. |
name | The tool name. |
parent | The tool's Gaudi parent. |
Definition at line 36 of file ElectronJetDRAssociator.cxx.
44 "Target label for the getter for the jets to which"
47 declareProperty (
"VertexContainerName",
49 "Primary vertex container name");
51 declareProperty (
"DRCut",
m_drcut = 0.7,
52 "DR cut between electrons and jets");
54 declareProperty (
"CollectionGetterRegistry",
m_registry,
55 "The ICollectionGetterRegistryTool instance.");
◆ addDimensionedVariable() [1/6]
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
-
name | The name of the variable. |
type | The type of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer 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
.
Implements D3PD::IAddVariable.
Definition at line 123 of file AddVariable.cxx.
133 return StatusCode::SUCCESS;
138 docstring, defval ) );
◆ addDimensionedVariable() [2/6]
virtual StatusCode D3PD::IAddVariable::addDimensionedVariable |
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
type | The type of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer 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
.
◆ addDimensionedVariable() [3/6]
template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable |
( |
class T |
, |
|
|
class U |
|
|
) |
| |
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer 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() [4/6]
template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable |
( |
const std::string & |
name, |
|
|
T *& |
ptr, |
|
|
const std::string & |
dim, |
|
|
const std::string & |
docstring, |
|
|
const U & |
defval |
|
) |
| |
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer 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() [5/6]
template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable |
( |
class T |
| ) |
|
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
◆ addDimensionedVariable() [6/6]
template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable |
( |
const std::string & |
name, |
|
|
T *& |
ptr, |
|
|
const std::string & |
dim, |
|
|
const std::string & |
docstring = "" |
|
) |
| |
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
◆ addVariable() [1/6]
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
-
name | The name of the variable. |
type | The type of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
defval | Pointer 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
.
Implements D3PD::IAddVariable.
Definition at line 85 of file AddVariable.cxx.
94 return StatusCode::SUCCESS;
98 ti,
ptr, docstring, defval ) );
100 ti,
ptr, docstring, defval);
◆ addVariable() [2/6]
virtual StatusCode D3PD::IAddVariable::addVariable |
|
inherited |
◆ addVariable() [3/6]
template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable |
( |
class T |
, |
|
|
class U |
|
|
) |
| |
|
inherited |
◆ addVariable() [4/6]
template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable |
( |
const std::string & |
name, |
|
|
T *& |
ptr, |
|
|
const std::string & |
docstring, |
|
|
const U & |
defval |
|
) |
| |
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
defval | Pointer 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
.
◆ addVariable() [5/6]
template<class T >
StatusCode D3PD::IAddVariable::addVariable |
( |
class T |
| ) |
|
|
inherited |
◆ addVariable() [6/6]
template<class T >
StatusCode D3PD::IAddVariable::addVariable |
( |
const std::string & |
name, |
|
|
T *& |
ptr, |
|
|
const std::string & |
docstring = "" |
|
) |
| |
|
inherited |
Add a variable to the tuple.
- Parameters
-
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
◆ book()
StatusCode D3PD::ElectronJetDRAssociator::book |
( |
| ) |
|
|
finalvirtual |
Create any needed tuple variables.
This is called at the start of the first event.
Reimplemented from D3PD::MultiAssociationToolImpl.
Definition at line 158 of file ElectronJetDRAssociator.cxx.
161 "DR between electron and associated jet.") );
163 "Signed impact parameter between electron and jet.") );
165 "Relative Pt between electron and jet.") );
167 "Number of jet constituents.") );
169 "Jet Pt with electron removed.") );
171 return StatusCode::SUCCESS;
◆ configureD3PD() [1/2]
StatusCode D3PD::AddVariable::configureD3PD |
( |
IAddVariable * |
tree | ) |
|
|
inherited |
Configure the parent tree.
- Parameters
-
Definition at line 61 of file AddVariable.cxx.
65 return StatusCode::SUCCESS;
◆ configureD3PD() [2/2]
StatusCode D3PD::ElectronJetDRAssociator::configureD3PD |
( |
IAddVariable * |
tree, |
|
|
const std::type_info & |
ti |
|
) |
| |
|
overridevirtual |
Configure during initialization: type-check.
- Parameters
-
tree | Our parent for tuple making. |
ti | Gives the type of the object being passed to resetUntyped . |
configureD3PD
should check that the type of the object coming as input (to getUntyped
) is compatible with what it expects, and raise an error otherwise.
Reimplemented from D3PD::MultiAssociationToolImpl.
Definition at line 81 of file ElectronJetDRAssociator.cxx.
87 return StatusCode::SUCCESS;
◆ configureMulti()
StatusCode D3PD::MultiAssociationToolImpl::configureMulti |
( |
D3PD::IAddVariable * |
tree, |
|
|
const std::type_info & |
ti, |
|
|
const std::vector< const std::type_info * > & |
tis, |
|
|
size_t & |
which |
|
) |
| |
|
protectedinherited |
Configure during initialization: type-check.
Alternate implementation for the case where we have to choose among multiple possible input types.
- Parameters
-
| tree | Our parent for tuple making. |
| ti | Gives the type of the object being passed to getUntyped . |
| tis | List of possible input types that we can accept. |
[out] | which | Index of the accepted type. |
configureMulti
should check that the type of the object coming as input (to getUntyped
) is compatible with what it expects, and raise an error otherwise.
Definition at line 74 of file MultiAssociationToolImpl.cxx.
81 return StatusCode::SUCCESS;
◆ doConversion()
const void * D3PD::MultiAssociationToolImpl::doConversion |
( |
const void * |
p | ) |
|
|
protectedinherited |
Helper to convert pointers to source objects.
- Parameters
-
p | Source object, as a pointer to the type passed to configureD3PD . return Source object, as a pointer to the type given by fromTypeinfo . |
Definition at line 104 of file MultiAssociationToolImpl.cxx.
◆ elementTypeinfo()
Return the element type for the target of the association.
I.e., nextUntyped
returns a pointer to this type.
◆ findReducedPt()
Find the pT of the jet with electron removed.
- Parameters
-
| eg | The egamma object to analyze. |
| j | The jet under consideration. |
[out] | reducedPt | Jet Pt calculated after subtraction of electron momentum. |
| eg | The egamma object to analyze. |
| j | The jet under consideration. @reducedPt[out] Jet Pt calculated after subtraction of electron momentum. |
Definition at line 181 of file ElectronJetDRAssociator.cxx.
188 return StatusCode::SUCCESS;
193 return StatusCode::SUCCESS;
198 reducedPt = hypot (
px,
py);
200 return StatusCode::SUCCESS;
◆ findSignedIPAndPTRelEleJetPair()
Find the signed impact parameter and PTRel of EG's track relative to the beamspot.
Find the impact parameter of EG's track relative to the beamspot.
- Parameters
-
eg | The egamma object to analyze. |
signedIP[out] | Transverse impact parameter wrt the beamspot. |
PTRel[out] | Longitudinal impact parameter wrt the beamspot. |
eg | The egamma object to analyze. |
d0beam[out] | Transverse impact parameter wrt the beamspot. |
z0beam[out] | Longitudinal impact parameter wrt the beamspot. |
Definition at line 211 of file ElectronJetDRAssociator.cxx.
220 return StatusCode::SUCCESS;
225 return StatusCode::SUCCESS;
228 PTRel=
track->p4().Perp (j0->
p4().Vect());
230 CLHEP::Hep3Vector jetDirection( (j0)->
px(), (j0)->
py(), (j0)->
pz());
231 CLHEP::Hep3Vector
unit = jetDirection.unit();
234 return StatusCode::SUCCESS;
242 <<
" not found in StoreGate!";
243 else if (!vxcontainer->
empty())
244 vx = vxcontainer->
front();
249 <<
"No vertex found.";
250 return StatusCode::SUCCESS;
256 return StatusCode::SUCCESS;
◆ fromTypeinfo() [1/2]
Return the std::type_info
for the source of the association.
◆ fromTypeinfo() [2/2]
virtual const std::type_info& D3PD::MultiAssociationToolImpl::fromTypeinfo |
( |
| ) |
const |
|
pure virtualinherited |
◆ initialize()
StatusCode D3PD::ElectronJetDRAssociator::initialize |
( |
| ) |
|
|
overridevirtual |
◆ next()
Return a pointer to the next element in the association.
Return 0 when the association has been exhausted.
Implements D3PD::MultiAssociationToolTo< xAOD::Jet >.
Definition at line 109 of file ElectronJetDRAssociator.cxx.
121 float dr = hypot (clus->
p4().DeltaPhi(myjet->p4()),
122 myjet->eta() - clus->
etaBE(2));
125 float signedIP=-9999.9;
127 float reducedPt=-9999.9;
130 signedIP, PTRel ).isFailure() )
◆ nextUntyped()
Return a pointer to the next element in the association.
Return 0 when the association has been exhausted.
◆ releaseElement()
Release an object retrieved from the association.
- Parameters
-
Call this when you are done with the object returned by next()
. The default implementation is a no-op, but if the association dynamically allocated the object which it returned, this gives it a chance to free it.
◆ releaseElementUntyped()
Release an object retrieved from the association.
- Parameters
-
Call this when you are done with the object returned by nextUntyped()
. The default implementation is a no-op, but if the association dynamically allocated the object which it returned, this gives it a chance to free it.
◆ reset()
◆ resetUntyped()
Start the iteration for a new association.
- Parameters
-
p | The object from which to associate. |
◆ m_blockName
std::string D3PD::MultiAssociationToolImpl::m_blockName |
|
privateinherited |
◆ m_dr
float* D3PD::ElectronJetDRAssociator::m_dr |
|
private |
◆ m_drcut
double D3PD::ElectronJetDRAssociator::m_drcut |
|
private |
◆ m_eg
◆ m_inputConverter
◆ m_jetSize
unsigned int* D3PD::ElectronJetDRAssociator::m_jetSize |
|
private |
◆ m_metadata
Metadata about the variables created by this object.
Definition at line 129 of file AddVariable.h.
◆ m_prefix
std::string D3PD::MultiAssociationToolImpl::m_prefix |
|
privateinherited |
◆ m_ptrel
float* D3PD::ElectronJetDRAssociator::m_ptrel |
|
private |
◆ m_reducedPt
float* D3PD::ElectronJetDRAssociator::m_reducedPt |
|
private |
◆ m_registry
◆ m_signedIP
float* D3PD::ElectronJetDRAssociator::m_signedIP |
|
private |
◆ m_suffix
const std::string& D3PD::AddVariable::m_suffix |
|
privateinherited |
◆ m_target
◆ m_targetLabel
std::string D3PD::ElectronJetDRAssociator::m_targetLabel |
|
private |
◆ m_trackToVertexIPEstimator
◆ m_tree
◆ m_vertexContainerName
std::string D3PD::ElectronJetDRAssociator::m_vertexContainerName |
|
private |
◆ 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:
def retrieve(aClass, aKey=None)
float * m_reducedPt
Variable: Jet pT with electron removed.
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
Property: Tool for the estimation of the IPs to the vertex.
float * m_ptrel
Variable: Relative Pt between electron and jet.
std::string dstName() const
Return the name of the destination type, or an empty string.
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
const std::string & m_suffix
Reference to the variable suffix.
float * m_signedIP
Variable: Signed impact parameter between electron and jet.
std::string m_targetLabel
Property: Target label for the getter for the jets to which to associate.
const std::string & m_prefix
Reference to the variable prefix.
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.
ToolHandle< ICollectionGetterRegistryTool > m_registry
Property: The ICollectionGetterRegistryTool instance.
StatusCode findReducedPt(const xAOD::Electron *eg, const xAOD::Jet *j, float &reducedPt)
Find the pT of the jet with electron removed.
IAddVariable * m_tree
Reference to the block name.
StatusCode init(const std::type_info &src_ti, const std::type_info &dst_ti)
Initialize the converter.
unsigned int * m_jetSize
Variable: Number of jet constituents.
std::string srcName() const
Return the name of the source type, or an empty string.
const xAOD::Electron * m_eg
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
ObjectMetadata m_metadata
Metadata about the variables created by this object.
Description of a calorimeter cluster.
const void * convertUntyped(const void *p) const
Convert pointer.
double m_drcut
Property: DR cut between electrons and jets.
virtual StatusCode book() final
Create any needed tuple variables.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
const T * front() const
Access the first element in the collection as an rvalue.
MultiAssociationTool< xAOD::Electron, xAOD::Jet > Base
#define CHECK(...)
Evaluate an expression and check for errors.
float py() const
The y-component of the jet's momentum.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
std::string m_vertexContainerName
Property: Vertex container name.
ICollectionGetterTool * m_target
Getter defining the collection within which to index.
float px() const
The x-component of the jet's momentum.
#define REPORT_MESSAGE(LVL)
Report a message.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
StatusCode findSignedIPAndPTRelEleJetPair(const xAOD::Electron *eg, const xAOD::Jet *j0, float &signedIP, float &PTRel)
Find the signed impact parameter and PTRel of EG's track relative to the beamspot.
StatusCode addDimensionedVariable(const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
Add a variable to the tuple.
Class describing a TrackParticle.
float * m_dr
Variable: DR between electron and jet.
bool empty() const noexcept
Returns true if the collection is empty.