![]() |
ATLAS Offline Software
|
#include <TrigTrackSelector.h>
Public Types | |
| typedef std::vector< ElementLink< xAOD::TrackParticleContainer > > | TrackParticleLinks_t |
Public Member Functions | |
| TrigTrackSelector (TrackFilter *selector) | |
| use a radius of 47 mm corresponding to the Run 1 pixel inner radius For the IBL it should be 32 mm, but this was kept as 47 mm for consistency of the definition. | |
| TrigTrackSelector (TrackFilter *selector, double radius) | |
| TrigTrackSelector (TrackFilter *selector, int selectPdgId, int selectParentPdgId) | |
| TrigTrackSelector (TrackFilter *selector, double radius, int selectPdgId, int selectParentPdgId) | |
| template<typename T> | |
| TrigTrackSelector (T &tm, TrackFilter *selector, double radius=default_radius(), int selectPdgId=0, int selectParentPdgId=0) | |
| template<typename T> | |
| TrigTrackSelector (T tbegin, T tend, TrackFilter *selector, double radius=default_radius(), int selectPdgId=0, int selectParentPdgId=0) | |
| ~TrigTrackSelector () | |
| void | setBeamline (double x, double y, double z=0) |
| double | getBeamX () const |
| double | getBeamY () const |
| double | getBeamZ () const |
| void | correctTracks (bool b=true) |
| virtual void | clear () override |
| void | selectTracks (const TruthParticleContainer *truthtracks) |
| neater code to make use of vector function also for a single ancestor pdgid, instead of the full code duplication, but less efficienct as it then needs to create a single element vector for each particle, to avoid the code duplication. | |
| void | selectTracks (const xAOD::TruthParticleContainer *truthtracks) |
| void | truthBeamline (const xAOD::TruthParticleContainer *truthtracks, double &x0, double &y0) |
| extract all the tracks from a xAOD::TruthParticle collection and histogram the x and y production coordinates to determine the event "beamline" position | |
| bool | selectTrack (HepMC::ConstGenParticlePtr track) |
| bool | selectTrack (const TruthParticle &track) |
| bool | selectTrack (const TruthParticle *track) |
| bool | selectTrack (const xAOD::TruthParticle *track, double x0=0, double y0=0) |
| TIDA::Track * | makeTrack (HepMC::ConstGenParticlePtr track) |
| TIDA::Track * | makeTrack (const TruthParticle *track, unsigned long tid=0) |
| bool | selectTrack (const Trk::Track *track) |
| void | selectTracks (const TrackCollection *trigtracks) |
| bool | selectTrack (const xAOD::TrackParticle *track, void *=0) |
| legacy run 2 selector access | |
| void | selectTracks (const xAOD::TrackParticleContainer *tracks, void *=0) |
| void | selectTracks (xAOD::TrackParticleContainer::const_iterator trackitr, xAOD::TrackParticleContainer::const_iterator trackend, void *=0) |
| MT selector access. | |
| void | selectTracks (const TrackParticleLinks_t &tracks) |
| void | correctToBeamline (double &z0, double &dz0, double &d0, double &dd0, double theta, double phi) |
| virtual bool | addTrack (TIDA::Track *t, bool(*f)(const TIDA::Track *)=0) |
| virtual void | addTracks (std::vector< TIDA::Track * > &t, bool(*f)(const TIDA::Track *)=0) |
| const std::vector< TIDA::Track * > & | tracks () const |
| std::vector< TIDA::Track * > | tracks (TrackFilter *selector) const |
| unsigned | size () const |
| void | delete_track (TIDA::Track *t) |
Static Public Member Functions | |
| static double | default_radius () |
Protected Member Functions | |
| const xAOD::TruthParticle * | fromAncestor (const int pdg_id, const xAOD::TruthParticle *p) const |
| recursive functions to identify whether a particle comes from some particle of a specific PDG ID, or some numb er of specified PDG IDs. | |
| const xAOD::TruthParticle * | fromAncestor (const std::vector< int > &ids, const xAOD::TruthParticle *p) const |
| recursive function to identify whether a particle comes from some other number of ancestor particles, with the pdgids passed in as a vector. | |
| virtual void | cleanup (TIDA::Track *) |
Protected Attributes | |
| std::vector< TIDA::Track * > | m_tracks |
| TrackFilter * | m_selector |
Private Attributes | |
| unsigned long | m_id |
| double | m_xBeam |
| double | m_yBeam |
| double | m_zBeam |
| bool | m_correctTrkTracks |
| double | m_radius |
| int | m_selectPdgId |
| int | m_selectParentPdgId |
Static Private Attributes | |
| static const double | s_default_radius = 47 |
| NB: This was 47 for Run 2, but with the addition of the IBL it should be 32 It was kept at 47 for all Run 2 and migration to MT, but for Run 3 we really want it changed to be 32. | |
MC truth.
FrameWork includes #include "GaudiKernel/ServiceHandle.h" absolutely pathetic!! write my own class TrigInDetAnalysis classes
Definition at line 48 of file TrigTrackSelector.h.
| typedef std::vector< ElementLink< xAOD::TrackParticleContainer > > TrigTrackSelector::TrackParticleLinks_t |
Definition at line 52 of file TrigTrackSelector.h.
|
inline |
use a radius of 47 mm corresponding to the Run 1 pixel inner radius For the IBL it should be 32 mm, but this was kept as 47 mm for consistency of the definition.
this should be changed to 32 mm for Run 3
Definition at line 60 of file TrigTrackSelector.h.
|
inline |
Definition at line 62 of file TrigTrackSelector.h.
|
inline |
Definition at line 64 of file TrigTrackSelector.h.
| TrigTrackSelector::TrigTrackSelector | ( | TrackFilter * | selector, |
| double | radius, | ||
| int | selectPdgId, | ||
| int | selectParentPdgId ) |
Definition at line 24 of file TrigTrackSelector.cxx.
|
inline |
Definition at line 69 of file TrigTrackSelector.h.
|
inline |
Definition at line 74 of file TrigTrackSelector.h.
|
inline |
Definition at line 80 of file TrigTrackSelector.h.
|
inlinevirtualinherited |
Definition at line 34 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlinevirtualinherited |
Definition at line 47 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineprotectedvirtualinherited |
Definition at line 76 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineoverridevirtual |
Reimplemented from TrackSelector.
Definition at line 91 of file TrigTrackSelector.h.
| void TrigTrackSelector::correctToBeamline | ( | double & | z0, |
| double & | dz0, | ||
| double & | d0, | ||
| double & | dd0, | ||
| double | theta, | ||
| double | phi ) |
make sure that users have set the beamline parameters
error estimates
Definition at line 1007 of file TrigTrackSelector.cxx.
|
inline |
Definition at line 89 of file TrigTrackSelector.h.
|
inlinestatic |
Definition at line 162 of file TrigTrackSelector.h.
|
inlineinherited |
Definition at line 68 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
protected |
recursive functions to identify whether a particle comes from some particle of a specific PDG ID, or some numb er of specified PDG IDs.
recursive function to identify whether a particle comes from some other ancestor particle at any point in its history - checks its parents and then function calls itself to check their parents etc., until it either finds the pdgid it is looking for, or it has no more ancestors if it finds an appropriate ancestor it returns the pointer to it, otherwise it returns a nullptr
finds an appropriate ancestor and returns the pointer to it, otherwise it just returns a nullptr
Definition at line 39 of file TrigTrackSelector.cxx.
|
protected |
recursive function to identify whether a particle comes from some other number of ancestor particles, with the pdgids passed in as a vector.
Any such ancestors at point in it's history will do - checks it's parents and then calls the function calls itself to check the parent's parents etc, until it either finds one of the pdgids it is looking for, or it has no more ancestors if it finds an appropriate ancestor it returns the pointer to it, otherwise it returns a nullptr
Definition at line 73 of file TrigTrackSelector.cxx.
|
inline |
Definition at line 85 of file TrigTrackSelector.h.
|
inline |
Definition at line 86 of file TrigTrackSelector.h.
|
inline |
Definition at line 87 of file TrigTrackSelector.h.
| TIDA::Track * TrigTrackSelector::makeTrack | ( | const TruthParticle * | track, |
| unsigned long | tid = 0 ) |
check for final state
the is our new "final state" requirement the inner and outer radii are in some sense arbitrary - these correspond to an envelope around the pixel detector, so the track must pass through the entire pixel detector NB: In order to ensure you don't miss any tracks they really need to be the same ie if a track brems in your "volume" then you will miss that track, and also the resulting track, even if it is a high et track
keep anything over 10 GeV with the old requirement
avoid default (unset) TruthParticle charge
only use charged tracks
what a faff - refuse to mess about with the classes to swim tracks etc - why can't they just encode this sort of information in the class!! It's not as if it doesn't actually have members for anything else useless!! Classes should be designed for ease of use !!!!
is there a sign issue here ?
correct back to the beamline
how about storing uniqueID/status/pidg info?
this isn't good!! but it will do for testing
probably won't work either
get the production vertex for the z0 and d0 but should we store the z0 of the production vertex? or swim the track to the perigee point with respect to 0,0 and use the parameters there?
what to do with these???
Definition at line 445 of file TrigTrackSelector.cxx.
| TIDA::Track * TrigTrackSelector::makeTrack | ( | HepMC::ConstGenParticlePtr | track | ) |
Definition at line 437 of file TrigTrackSelector.cxx.
| bool TrigTrackSelector::selectTrack | ( | const Trk::Track * | track | ) |
a covariance!
check this <<–
now some ridiculous code to get the author of the TrackParticle (offline) tracks
Definition at line 594 of file TrigTrackSelector.cxx.
| bool TrigTrackSelector::selectTrack | ( | const TruthParticle & | track | ) |
Definition at line 271 of file TrigTrackSelector.cxx.
| bool TrigTrackSelector::selectTrack | ( | const TruthParticle * | track | ) |
| bool TrigTrackSelector::selectTrack | ( | const xAOD::TrackParticle * | track, |
| void * | = 0 ) |
legacy run 2 selector access
lazy just to avoid a find-replace of measPer to track
Grrrrr remove interaction mean z position!!!
protect against spurious qOverP = 0 BUT !!! this should NEVER happen !!! so shouldn't really have this failing silently, but not allowed to put in std::cerr output leave the original code in as this is mostly for a test
a covariance not an error
don't correct xaod tracks to the beamline
??? <<– check this
holes
cheat !! pack the holes into the hits so that eg int pixelholes() { return npix/1000; } int pixelhits() { return npix%1000; }
get the total number of holes as well
fit quality
Definition at line 790 of file TrigTrackSelector.cxx.
| bool TrigTrackSelector::selectTrack | ( | const xAOD::TruthParticle * | track, |
| double | x0 = 0, | ||
| double | y0 = 0 ) |
lazy just to avoid a find-replace of measPer to track
avoid default (unset) TruthParticle charge
only use charged tracks
need to calculate the origin, and the beamline, and the d0 and z0 with respect to the beamline leave this in until we have checked whether everything is implemented correctly
need to calculate d0 and z0 correctly.
these are the d0 and z at the point of closest approach to x0, y0, the event "beamline", which is the best that we can do for the moment
the is our new "final state" requirement the inner and outer radii are in some sense arbitrary - these correspond to an envelope around the pixel detector, so the track must pass through the entire pixel detector NB: In order to ensure you don't miss any tracks they really need to be the same ie if a track brems in your "volume" then you will miss that track, and also the resulting track, even if it is a high et track
was hardcoded as 47 - now is set from the constructor
get the total number of holes as well
useful debug info - leave in
Definition at line 293 of file TrigTrackSelector.cxx.
| bool TrigTrackSelector::selectTrack | ( | HepMC::ConstGenParticlePtr | track | ) |
not a "final state" particle
set this so can use it as the identifier - don't forget to reset!!
Definition at line 253 of file TrigTrackSelector.cxx.
| void TrigTrackSelector::selectTracks | ( | const TrackCollection * | trigtracks | ) |
Definition at line 774 of file TrigTrackSelector.cxx.
| void TrigTrackSelector::selectTracks | ( | const TrackParticleLinks_t & | tracks | ) |
Definition at line 999 of file TrigTrackSelector.cxx.
| void TrigTrackSelector::selectTracks | ( | const TruthParticleContainer * | truthtracks | ) |
neater code to make use of vector function also for a single ancestor pdgid, instead of the full code duplication, but less efficienct as it then needs to create a single element vector for each particle, to avoid the code duplication.
Perhaps something can be done for the compiler optimisation to realise this and somehow
reduce the opverhead of creating the single int vector - need to investiogate this more thoroghly before including this, as it would be a much neater solution
Definition at line 113 of file TrigTrackSelector.cxx.
| void TrigTrackSelector::selectTracks | ( | const xAOD::TrackParticleContainer * | tracks, |
| void * | = 0 ) |
Definition at line 975 of file TrigTrackSelector.cxx.
| void TrigTrackSelector::selectTracks | ( | const xAOD::TruthParticleContainer * | truthtracks | ) |
get truth beamline
fix default (unset) TruthParticle charge
not just yet - save for later ... else ( gotPdgId && m_selectParentPdgIds.size()!=0 ) gotParentPdgId = fromAncestor(m_selectParentPdgIds, (*trackitr))!=nullptr;
Definition at line 208 of file TrigTrackSelector.cxx.
| void TrigTrackSelector::selectTracks | ( | xAOD::TrackParticleContainer::const_iterator | trackitr, |
| xAOD::TrackParticleContainer::const_iterator | trackend, | ||
| void * | = 0 ) |
MT selector access.
will need this printout during debugging, so leave commented until all the feature access has been properly debugged
Definition at line 987 of file TrigTrackSelector.cxx.
|
inline |
|
inlineinherited |
Definition at line 62 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineinherited |
Definition at line 52 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineinherited |
| void TrigTrackSelector::truthBeamline | ( | const xAOD::TruthParticleContainer * | truthtracks, |
| double & | x0, | ||
| double & | y0 ) |
extract all the tracks from a xAOD::TruthParticle collection and histogram the x and y production coordinates to determine the event "beamline" position
histograms and book keeoing
positions
numbers of tracks
fill histograms ...
get track production vertex
add to the correct bins
calculate the most populous bin in x and y
require more than 1 particle for it to be classed a "vertex" therefore, for single particle Monte Carlo, this will not be updated and (0,0) will still be correctly used
Definition at line 134 of file TrigTrackSelector.cxx.
|
private |
Definition at line 172 of file TrigTrackSelector.h.
|
private |
Definition at line 166 of file TrigTrackSelector.h.
|
private |
Definition at line 174 of file TrigTrackSelector.h.
|
protectedinherited |
Definition at line 84 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
private |
Definition at line 177 of file TrigTrackSelector.h.
|
private |
Definition at line 176 of file TrigTrackSelector.h.
|
protectedinherited |
Definition at line 81 of file TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
private |
Definition at line 168 of file TrigTrackSelector.h.
|
private |
Definition at line 169 of file TrigTrackSelector.h.
|
private |
Definition at line 170 of file TrigTrackSelector.h.
|
staticprivate |
NB: This was 47 for Run 2, but with the addition of the IBL it should be 32 It was kept at 47 for all Run 2 and migration to MT, but for Run 3 we really want it changed to be 32.
Definition at line 179 of file TrigTrackSelector.h.