Algorithm Development Pt. 2
Last updated
Last updated
Let's look at some tracks. In our execute()
function, we'll use the selectedTracks()
function (a member function belonging to our mother class xTRT::Algorithm
). We're using it to retrieve, you guessed it, some selected tracks. What this function does is create a new container of xAOD::TrackParticle
objects, where all of the tracks in the container passed the Tracks.
selection that you define in your config file. You can go to the section for more detailed info, but here I'll just mention some track specific options. The default config we're using have options of the form: (the numbers might not be the same, but you can change them!)
Alright, so how would we get tracks that pass this selection? In just four lines, here's grabbing the selected tracks, looping over them, and grabbing the track occupancy (don't add this code yet, we'll add it in a sec.):
Let's make a tree that stores a few track properties and fills for every track as well as also some histograms. Go back to the header and define a few new private member variables:
And in our source:
Now go recompile, run the code, and find your new histograms and new tree + branches!
The code block below shows the process.
At that point, you have access to the xTRT::MSOS
(a typedef
to xAOD::MeasurementOnSurface
) object (we're calling our variable msos
) and the xTRT::DriftCircle
(a typedef
to xAOD::TrackMeasurementValidation
) object (we're calling our variable driftCircle
).*
* We define these typedef
's because it's more intuitive to use MSOS and DriftCircle. The actual classes are used throughout the inner detector software, that's why they have a generic name.
trackOccupancy(...)
is a helper function that is part of the TRTFramework
library. You can find technical details in the doxygen API documentation . You can find a list of helper functions that take either xAOD::TrackParticle
, xAOD::Electron
, or xAOD::Muon
objects specifically .
To analyze using hits, we need to access them. While looping over a track, we can grab the track measurement container like so:
1. create some pointers for the measurement on surface (msos
) and the drift circle (driftCircle
)
2. Use a predefined auxiliary accessor (xTRT::Acc::msosLink
, which is an SG::AuxElement::ConstAccessor
for the link to the measurement on surface) to check if the container of measurements is there, then loop over them. To read more about aux data go to .
3. for each track measurement, set the msos
and driftCircle
variables after making sure that their links are valid (also make sure we only have TRT hits).
You can use the xTRT::getHitSummary(...)
function to fill a struct with hit properties (instead of manually grabbing the aux data). See all the properties in the xTRT::HitSummary
struct . To learn more details about aux data, go to .