|
ATLAS Offline Software
|
#include <TrackIsolationTool.h>
|
| TrackIsolationTool (const std::string &name) |
| constructor More...
|
|
virtual | ~TrackIsolationTool (void) |
| destructor More...
|
|
virtual StatusCode | initialize () override |
| initialize More...
|
|
virtual bool | trackIsolation (TrackIsolation &result, const IParticle &tp, const std::vector< Iso::IsolationType > &cones, TrackCorrection corrections, const Vertex *vertex=0, const std::set< const TrackParticle * > *exclusionSet=0, const TrackParticleContainer *indetTrackParticles=0) const override |
| ITrackIsolationTool interface: More...
|
|
virtual void | print () const |
| Print the state of the tool. 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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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 |
|
Definition at line 38 of file TrackIsolationTool.h.
◆ StoreGateSvc_t
◆ TPVec
◆ TrackIsolationTool()
xAOD::TrackIsolationTool::TrackIsolationTool |
( |
const std::string & |
name | ) |
|
constructor
Definition at line 27 of file TrackIsolationTool.cxx.
31 declareInterface<ITrackIsolationTool>(
this);
32 #endif // XAOD_ANALYSIS
◆ ~TrackIsolationTool()
xAOD::TrackIsolationTool::~TrackIsolationTool |
( |
void |
| ) |
|
|
virtualdefault |
◆ add()
add track particle to isolation calculation
sum up particle to the different cones
Definition at line 235 of file TrackIsolationTool.cxx.
246 if(
input.particle == &tp2 ||
247 (
input.exclusionSet &&
input.exclusionSet->count(&tp2)) ||
249 ATH_MSG_DEBUG(
"track pointer " << &tp2 <<
", track pt = " << tp2.pt() <<
", input pt = " <<
input.particle->pt()) ;
256 float deta =
input.particle->eta()-tp2.eta();
257 if( fabs(deta) >
input.maxRadius )
return;
261 if( fabs(dphi) >
input.maxRadius )
return;
264 float dr2 = deta*deta + dphi*dphi;
274 for(
unsigned int k=0;
k<
input.coneSizesSquared.size();++
k ){
275 if( dr2 >=
input.coneSizesSquared[
k] )
return;
277 if( dr2 <=
input.ptvarconeRadiusSquared ){
278 result.ptvarcones_10GeVDivPt[
k] += tp2.pt();
◆ binnedIsolation()
using TracksInConeTool
prepare look-up structure
Definition at line 176 of file TrackIsolationTool.cxx.
179 std::vector<const TrackParticle*> tps;
180 #ifndef XAOD_ANALYSIS
183 if( !getparticlesInCone(
input.particle->eta(),
input.particle->phi(),
input.maxRadius,tps) )
return false;
186 for(
const auto&
tp : tps ) {
190 ATH_MSG_DEBUG(
"Encountered a track isolation input with invalid vertex while requiring TTVA. Rejecting, please check your inputs!");
195 ATH_MSG_DEBUG(
"Accept track " <<
tp <<
" pt = " <<
tp->pt() <<
" z+vz = " <<
tp->z0()+
tp->vz() <<
" eta = " <<
tp->eta() <<
" phi = " <<
tp->phi());
◆ 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]
◆ 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
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getReferenceParticle()
get reference particle
Print a warning for the case that no primary track was found. Given that eta/phi/pt are the same for the primary track and the muon track... Do not return a nullptr
Definition at line 88 of file TrackIsolationTool.cxx.
92 if( !
tp )
tp =
muon->primaryTrackParticle();
96 ATH_MSG_WARNING(
" No TrackParticle found for muon with pT: " <<
muon->pt() * 1.e-3 <<
"[GeV], eta: "<<
muon->eta()<<
" phi: "<<
97 muon->phi()<<
" q: "<<
muon->charge()<<
" primaryAuthor: "<<
muon->author()<<
" allAuthors: "<<
muon->allAuthors());
◆ initialize()
StatusCode xAOD::TrackIsolationTool::initialize |
( |
| ) |
|
|
overridevirtual |
initialize
square cone
Reimplemented from asg::AsgTool.
Definition at line 40 of file TrackIsolationTool.cxx.
44 #endif // XAOD_ANALYSIS
48 return StatusCode::FAILURE;
69 return StatusCode::SUCCESS;
◆ initresult()
init result struct
Definition at line 283 of file TrackIsolationTool.cxx.
287 result.corrlist = corrlist;
288 result.coreCorrections.clear();
289 result.ptcones.resize(typesize,0.);
290 result.ptvarcones_10GeVDivPt.resize(typesize,0.);
292 std::vector<float>
vec;
293 vec.resize(typesize,0.);
◆ 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]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ 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.
◆ phiInRange()
float xAOD::TrackIsolationTool::phiInRange |
( |
float |
phi | ) |
const |
|
inlineprivate |
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ renounce()
◆ renounceArray()
◆ retrieveIDBestPrimaryVertex()
retrieve pvx if not given
Definition at line 72 of file TrackIsolationTool.cxx.
80 for (
const auto*
const vtx : *vtxC ) {
◆ simpleIsolation()
simple isolation (loop)
retrieve track particles if not passed into the interface
Definition at line 203 of file TrackIsolationTool.cxx.
208 if( !indetTrackParticles ) {
211 ATH_MSG_ERROR(
"Could not open a TrackParticle container with key "
215 indetTrackParticles = tpH.
ptr();
219 if( !indetTrackParticles )
return false;
222 for(
const auto *
const tp : *indetTrackParticles ) {
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ trackIsolation()
ITrackIsolationTool interface:
prepare input
get track particle
Implements xAOD::ITrackIsolationTool.
Definition at line 104 of file TrackIsolationTool.cxx.
122 ATH_MSG_DEBUG(
"No vertex provided, is required. Use the ID-chosen pvx, z = " <<
vertex->z());
133 TrackIsolationInput
input(
tp, corrbitset,
vertex, exclusionSet );
135 for(
auto isoType : isoTypes ){
138 ATH_MSG_WARNING(
"Unsupported isolation type passed, cannot calculate isolation " << Iso::toCString(isoType));
142 input.coneSizesSquared.push_back(conesize*conesize);
145 for(
size_t i=1;
i<
input.coneSizesSquared.size();
i++){
146 if(
input.coneSizesSquared[
i]>
input.coneSizesSquared[
i-1])
ATH_MSG_ERROR(
"Isolation Cone should be in decreasing order. "<<
i <<
"th variable is " << Iso::toCString(isoTypes[
i]) <<
" is larger than the one before it: " << Iso::toCString(isoTypes[
i-1]));
149 std::sort(
input.coneSizesSquared.begin(),
input.coneSizesSquared.end(),[](
float i,
float j) { return i>j; });
153 input.maxRadius = sqrt(
input.coneSizesSquared[0]);
155 bool success =
false;
166 for(
unsigned int i = 0;
i<
result.ptcones.size();++
i ){
◆ updateVHKA()
◆ m_2PI
constexpr float xAOD::TrackIsolationTool::m_2PI = 2*M_PI |
|
staticconstexprprivate |
◆ m_coreTrackEtaRange
Gaudi::Property<float> xAOD::TrackIsolationTool::m_coreTrackEtaRange |
|
private |
Initial value:{this,
"CoreTrackEtaRange", 0.0, "The maximum eta range to consider something a core track"}
overlap cone size squared
The maximum eta range to consider something a core track
Definition at line 129 of file TrackIsolationTool.h.
◆ m_detStore
◆ m_evtStore
◆ m_indetTrackParticleLocation
Initial value:{this,
"TrackParticleLocation", "InDetTrackParticles"}
track particle location
Definition at line 118 of file TrackIsolationTool.h.
◆ m_overlapCone
Gaudi::Property<float> xAOD::TrackIsolationTool::m_overlapCone {this, "OverlapCone", 0.1} |
|
private |
◆ m_overlapCone2
float xAOD::TrackIsolationTool::m_overlapCone2 = 0.0F |
|
private |
◆ m_simpleIsolation
Gaudi::Property<bool> xAOD::TrackIsolationTool::m_simpleIsolation {this, "SimpleIsolation", false} |
|
private |
◆ m_tracksInConeTool
Initial value:{this,
"TracksInConeTool", "xAOD::TrackParticlesInConeTool/TrackParticlesInConeTool"}
tracks in cone tool
Definition at line 135 of file TrackIsolationTool.h.
◆ m_trkselTool
Initial value:{this,
"TrackSelectionTool", "InDet::InDetTrackSelectionTool/TrackSelectionTool"}
selection of tracks
Definition at line 139 of file TrackIsolationTool.h.
◆ m_ttvaTool
Initial value:{this,
"TTVATool", "", "Optional track to vertex association tool to filter tracks"}
Select tracks associated to the vertex.
Definition at line 143 of file TrackIsolationTool.h.
◆ m_useLooseTrackCore
bool xAOD::TrackIsolationTool::m_useLooseTrackCore {false} |
|
private |
◆ m_useTTVATool
bool xAOD::TrackIsolationTool::m_useTTVATool {false} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vertexLocation
◆ m_vhka
The documentation for this class was generated from the following files:
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
IsolationFlavour
Enumeration for different ways of calculating isolation in xAOD files.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
@ coreTrackPtr
tracks pointer
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
std::vector< size_t > vec
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
virtual void setOwner(IDataHandleHolder *o)=0
@ numIsolationTrackCorrections
unknown
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
@ coreTrackCone
tracks in cone
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual void renounce()=0
IsolationFlavour isolationFlavour(IsolationType type)
convert Isolation Type into Isolation Flavour
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
struct TBPatternUnitContext Muon
const_pointer_type ptr()
Dereference the pointer.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Class describing a TrackParticle.
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>