ATLAS Offline Software
|
L2 tracks. More...
#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. More... | |
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 () | |
virtual TrackSelector * | clone () override |
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 |
bool | selectTrack (const TrigInDetTrack *track, const TrigInDetTrackTruthMap *truthMap=0) |
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. More... | |
void | selectTracks (const TrigInDetTrackCollection *trigtracks, const TrigInDetTrackTruthMap *truthMap=0) |
bool | selectTrack (const Rec::TrackParticle *track) |
void | selectTracks (const Rec::TrackParticleContainer *trigtracks) |
void | selectTracks (const TruthParticleContainer *truthtracks) |
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 More... | |
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 More... | |
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. More... | |
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. More... | |
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. More... | |
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 More... | |
L2 tracks.
TruthMap offline and EF MC truth FrameWork includes #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/IPartPropSvc.h" absolutely pathetic!! write my own class TrigInDetAnalysis classes
Definition at line 58 of file TrigTrackSelector.h.
typedef std::vector< ElementLink< xAOD::TrackParticleContainer > > TrigTrackSelector::TrackParticleLinks_t |
Definition at line 62 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 70 of file TrigTrackSelector.h.
|
inline |
Definition at line 72 of file TrigTrackSelector.h.
|
inline |
Definition at line 74 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 79 of file TrigTrackSelector.h.
|
inline |
Definition at line 84 of file TrigTrackSelector.h.
|
inline |
Definition at line 90 of file TrigTrackSelector.h.
|
inlinevirtualinherited |
Definition at line 35 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlinevirtualinherited |
|
inlineprotectedvirtualinherited |
Definition at line 77 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineoverridevirtual |
Reimplemented from TrackSelector.
Definition at line 102 of file TrigTrackSelector.h.
|
inlineoverridevirtual |
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 1276 of file TrigTrackSelector.cxx.
|
inline |
Definition at line 100 of file TrigTrackSelector.h.
|
inlinestatic |
Definition at line 188 of file TrigTrackSelector.h.
|
inlineinherited |
Definition at line 69 of file Trigger/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 96 of file TrigTrackSelector.h.
|
inline |
Definition at line 97 of file TrigTrackSelector.h.
|
inline |
Definition at line 98 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
static HepPDT::ParticleDataTable* m_pdt = new ParticleDataTable();
// Get the Particle Properties Service if ( m_pdt==0 ) {
ServiceHandle<IPartPropSvc> partPropSvc("PartPropSvc", "TrigTestMonToolAC"); // , name()); if ( !partPropSvc.retrieve().isSuccess() ) { m_pdt = partPropSvc->PDT(); } else { std::cerr << " Could not initialize Particle Properties Service" << std::endl; return; // StatusCode::FAILURE; } }
how about storing barcode/status/pidg info?
this isn't good!! but it will do for testing
probably won't work either // FIXME barode-based
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 700 of file TrigTrackSelector.cxx.
TIDA::Track * TrigTrackSelector::makeTrack | ( | HepMC::ConstGenParticlePtr | track | ) |
Definition at line 688 of file TrigTrackSelector.cxx.
bool TrigTrackSelector::selectTrack | ( | const Rec::TrackParticle * | track | ) |
temporarily remove interaction mean z position
<< check this <<–
check this !!!
now some ridiculous code to get the author of the TrackParticle (offline) tracks
Definition at line 200 of file TrigTrackSelector.cxx.
bool TrigTrackSelector::selectTrack | ( | const TrigInDetTrack * | track, |
const TrigInDetTrackTruthMap * | truthMap = 0 |
||
) |
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
not definied ofr TrigInDetTracks
Definition at line 116 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 863 of file TrigTrackSelector.cxx.
bool TrigTrackSelector::selectTrack | ( | const TruthParticle & | track | ) |
Definition at line 522 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 1059 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 544 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 500 of file TrigTrackSelector.cxx.
void TrigTrackSelector::selectTracks | ( | const Rec::TrackParticleContainer * | trigtracks | ) |
Definition at line 340 of file TrigTrackSelector.cxx.
void TrigTrackSelector::selectTracks | ( | const TrackCollection * | trigtracks | ) |
Definition at line 1043 of file TrigTrackSelector.cxx.
void TrigTrackSelector::selectTracks | ( | const TrackParticleLinks_t & | tracks | ) |
Definition at line 1268 of file TrigTrackSelector.cxx.
void TrigTrackSelector::selectTracks | ( | const TrigInDetTrackCollection * | trigtracks, |
const TrigInDetTrackTruthMap * | truthMap = 0 |
||
) |
Definition at line 188 of file TrigTrackSelector.cxx.
void TrigTrackSelector::selectTracks | ( | const TruthParticleContainer * | truthtracks | ) |
Definition at line 360 of file TrigTrackSelector.cxx.
void TrigTrackSelector::selectTracks | ( | const xAOD::TrackParticleContainer * | tracks, |
void * | = 0 |
||
) |
Definition at line 1244 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 455 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 1256 of file TrigTrackSelector.cxx.
|
inline |
|
inlineinherited |
Definition at line 63 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineinherited |
Definition at line 53 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
inlineinherited |
Definition at line 55 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
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 381 of file TrigTrackSelector.cxx.
|
private |
Definition at line 198 of file TrigTrackSelector.h.
|
private |
Definition at line 192 of file TrigTrackSelector.h.
|
private |
Definition at line 200 of file TrigTrackSelector.h.
|
protectedinherited |
Definition at line 85 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
private |
Definition at line 203 of file TrigTrackSelector.h.
|
private |
Definition at line 202 of file TrigTrackSelector.h.
|
protectedinherited |
Definition at line 82 of file Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h.
|
private |
Definition at line 194 of file TrigTrackSelector.h.
|
private |
Definition at line 195 of file TrigTrackSelector.h.
|
private |
Definition at line 196 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 205 of file TrigTrackSelector.h.