|
ATLAS Offline Software
|
#include <TrackParticleThinning.h>
|
void | selectTrackHits (const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, MeasurementType detTypeToSelect, std::vector< bool > &outputStatesMask, std::vector< bool > &outputMeasurementsMask) const |
| Select TrackStateValidation and TrackMeasurementValidation objects that are used in the (thinned) track container. More...
|
|
void | filterTrackHits (const EventContext &ctx, MeasurementType detTypeToSelect, const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, const SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > &statesKey, const SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > &measurementsKey, std::atomic< unsigned int > &ntot_states, std::atomic< unsigned int > &ntot_measurements, std::atomic< unsigned int > &npass_states, std::atomic< unsigned int > &npass_measurements) const |
|
|
std::string | m_selectionString |
|
std::atomic< unsigned int > | m_ntot |
|
std::atomic< unsigned int > | m_npass |
|
StringProperty | m_streamName { this, "StreamName", "", "Name of the stream being thinned" } |
|
SG::ThinningHandleKey< xAOD::TrackParticleContainer > | m_inDetSGKey { this, "InDetTrackParticlesKey", "InDetTrackParticles", "" } |
|
std::atomic< unsigned int > | m_ntot_pix_states |
|
std::atomic< unsigned int > | m_npass_pix_states |
|
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > | m_statesPixSGKey { this, "InDetTrackStatesPixKey", "PixelMSOSs", "" } |
|
std::atomic< unsigned int > | m_ntot_pix_measurements |
|
std::atomic< unsigned int > | m_npass_pix_measurements |
|
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > | m_measurementsPixSGKey { this, "InDetTrackMeasurementsPixKey", "PixelClusters", "" } |
|
std::atomic< unsigned int > | m_ntot_sct_states |
|
std::atomic< unsigned int > | m_npass_sct_states |
|
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > | m_statesSctSGKey { this, "InDetTrackStatesSctKey", "SCT_MSOSs", "" } |
|
std::atomic< unsigned int > | m_ntot_sct_measurements |
|
std::atomic< unsigned int > | m_npass_sct_measurements |
|
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > | m_measurementsSctSGKey { this, "InDetTrackMeasurementsSctKey", "SCT_Clusters", "" } |
|
std::atomic< unsigned int > | m_ntot_trt_states |
|
std::atomic< unsigned int > | m_npass_trt_states |
|
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > | m_statesTrtSGKey { this, "InDetTrackStatesTrtKey", "TRT_MSOSs", "" } |
|
std::atomic< unsigned int > | m_ntot_trt_measurements |
|
std::atomic< unsigned int > | m_npass_trt_measurements |
|
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > | m_measurementsTrtSGKey { this, "InDetTrackMeasurementsTrtKey", "TRT_DriftCircles", "" } |
|
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > | m_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"} |
|
bool | m_thinHitsOnTrack |
|
Definition at line 32 of file TrackParticleThinning.h.
◆ MeasurementType
Enumerator |
---|
TrkState_unidentified | |
TrkState_Pixel | |
TrkState_SCT | |
TrkState_TRT | |
TrkState_Pseudo | |
TrkState_Vertex | |
TrkState_SpacePoint | |
TrkState_NumberOfMeasurementTypes | |
Definition at line 79 of file TrackParticleThinning.h.
◆ TrackParticleThinning()
DerivationFramework::TrackParticleThinning::TrackParticleThinning |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TrackParticleThinning()
DerivationFramework::TrackParticleThinning::~TrackParticleThinning |
( |
| ) |
|
|
virtualdefault |
◆ doThinning()
StatusCode DerivationFramework::TrackParticleThinning::doThinning |
( |
| ) |
const |
|
overridevirtual |
Definition at line 119 of file TrackParticleThinning.cxx.
121 const EventContext& ctx = Gaudi::Hive::currentContext();
128 unsigned int nTracks = importedTrackParticles->size();
129 if (nTracks==0)
return StatusCode::SUCCESS;
132 std::vector<bool>
mask;
133 mask.assign(nTracks,
false);
138 std::vector<int>
entries = m_parser->evaluateAsVector();
142 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used ID TrackParticles?");
143 return StatusCode::FAILURE;
153 importedTrackParticles.keep (
mask);
159 *importedTrackParticles,
169 *importedTrackParticles,
179 *importedTrackParticles,
189 return StatusCode::SUCCESS;
◆ filterTrackHits()
Definition at line 193 of file TrackParticleThinning.cxx.
205 std::vector<bool> maskStates;
206 std::vector<bool> maskMeasurements;
209 maskStates, maskMeasurements);
211 auto count = [] (
const std::vector<bool>&
m)
213 npass_states +=
count (maskStates);
214 npass_measurements +=
count (maskMeasurements);
216 if (!statesKey.
empty()) {
219 unsigned int size_states = importedStates->size();
220 if (size_states == 0) {
224 ntot_states += size_states;
225 if (maskStates.size() > size_states) {
226 ATH_MSG_ERROR(
"States mask size mismatch " << maskStates.size() <<
227 " > " << size_states);
229 maskStates.resize (size_states);
230 importedStates.keep (maskStates);
234 if (!measurementsKey.
empty()) {
236 (measurementsKey, ctx);
237 unsigned int size_measurements = importedMeasurements->size();
238 if (size_measurements == 0) {
242 ntot_measurements += size_measurements;
243 if (maskMeasurements.size() > size_measurements) {
244 ATH_MSG_ERROR(
"Measurements mask size mismatch " << maskMeasurements.size() <<
245 " > " << size_measurements);
247 maskMeasurements.resize (size_measurements);
248 importedMeasurements.keep (maskMeasurements);
◆ finalize()
StatusCode DerivationFramework::TrackParticleThinning::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 90 of file TrackParticleThinning.cxx.
95 ATH_MSG_INFO(
"Pixel state objects thinning, Total / Passed (Efficiency): "
98 ATH_MSG_INFO(
"Pixel measurements objects thinning, Total / Passed (Efficiency): "
101 ATH_MSG_INFO(
"SCT state objects thinning, Total / Passed (Efficiency): "
104 ATH_MSG_INFO(
"SCT measurements objects thinning, Total / Passed (Efficiency): "
107 ATH_MSG_INFO(
"TRT state objects thinning, Total / Passed (Efficiency): "
110 ATH_MSG_INFO(
"TRT measurements objects thinning, Total / Passed (Efficiency): "
115 return StatusCode::SUCCESS;
◆ initialize()
StatusCode DerivationFramework::TrackParticleThinning::initialize |
( |
| ) |
|
|
overridevirtual |
◆ selectTrackHits()
void DerivationFramework::TrackParticleThinning::selectTrackHits |
( |
const xAOD::TrackParticleContainer & |
inputTrackParticles, |
|
|
const std::vector< bool > & |
inputMask, |
|
|
MeasurementType |
detTypeToSelect, |
|
|
std::vector< bool > & |
outputStatesMask, |
|
|
std::vector< bool > & |
outputMeasurementsMask |
|
) |
| const |
|
private |
Select TrackStateValidation and TrackMeasurementValidation objects that are used in the (thinned) track container.
Definition at line 254 of file TrackParticleThinning.cxx.
263 if (not inputMask[trkIndex])
continue;
266 using StatesOnTrack = std::vector<ElementLink<xAOD::TrackStateValidationContainer>>;
268 if( ! msosLinkAcc.isAvailable(*trkIt) ) {
269 ATH_MSG_DEBUG(
"Cannot find TrackState link from xAOD::TrackParticle. Skipping track.");
272 const StatesOnTrack& measurementsOnTrack = msosLinkAcc(*trkIt);
274 if (not trkState_el.isValid()) {
275 ATH_MSG_DEBUG(
"Cannot find a valid link to TrackStateValidation object for track index: " << trkIndex);
278 if ((*trkState_el)->detType() != detTypeToSelect) {
279 ATH_MSG_VERBOSE(
"Discarding TrackState as not of correct type " << detTypeToSelect);
282 if (trkState_el.index() >= outputStatesMask.size()) {
283 outputStatesMask.resize (trkState_el.index()+1);
285 outputStatesMask[trkState_el.index()] =
true;
289 if (not trkMeasurement_el.
isValid()) {
290 ATH_MSG_VERBOSE(
"Cannot find a valid link to TrackMeasurementValidation object from track state for track index: " << trkIndex
291 <<
", trackState index: " << trkState_el.index());
294 if (*trkMeasurement_el ==
nullptr) {
295 ATH_MSG_VERBOSE(
"Invalid pointer to TrackMeasurementValidation object from track state for track index: " << trkIndex
296 <<
", trackState index: " << trkState_el.index());
299 if (trkMeasurement_el.
index() >= outputMeasurementsMask.size()) {
300 outputMeasurementsMask.resize (trkMeasurement_el.
index()+1);
302 outputMeasurementsMask[trkMeasurement_el.
index()] =
true;
◆ m_inDetSGKey
◆ m_measurementsPixSGKey
◆ m_measurementsSctSGKey
◆ m_measurementsTrtSGKey
◆ m_npass
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass |
|
private |
◆ m_npass_pix_measurements
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass_pix_measurements |
|
private |
◆ m_npass_pix_states
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass_pix_states |
|
private |
◆ m_npass_sct_measurements
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass_sct_measurements |
|
private |
◆ m_npass_sct_states
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass_sct_states |
|
private |
◆ m_npass_trt_measurements
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass_trt_measurements |
|
private |
◆ m_npass_trt_states
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_npass_trt_states |
|
private |
◆ m_ntot
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot |
|
mutableprivate |
◆ m_ntot_pix_measurements
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot_pix_measurements |
|
mutableprivate |
◆ m_ntot_pix_states
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot_pix_states |
|
mutableprivate |
◆ m_ntot_sct_measurements
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot_sct_measurements |
|
mutableprivate |
◆ m_ntot_sct_states
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot_sct_states |
|
mutableprivate |
◆ m_ntot_trt_measurements
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot_trt_measurements |
|
mutableprivate |
◆ m_ntot_trt_states
std::atomic<unsigned int> DerivationFramework::TrackParticleThinning::m_ntot_trt_states |
|
mutableprivate |
◆ m_SCTDetEleCollKey
◆ m_selectionString
std::string DerivationFramework::TrackParticleThinning::m_selectionString |
|
private |
◆ m_statesPixSGKey
◆ m_statesSctSGKey
◆ m_statesTrtSGKey
◆ m_streamName
StringProperty DerivationFramework::TrackParticleThinning::m_streamName { this, "StreamName", "", "Name of the stream being thinned" } |
|
private |
◆ m_thinHitsOnTrack
bool DerivationFramework::TrackParticleThinning::m_thinHitsOnTrack |
|
private |
The documentation for this class was generated from the following files:
std::atomic< unsigned int > m_npass_trt_measurements
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsPixSGKey
std::atomic< unsigned int > m_npass_pix_states
std::atomic< unsigned int > m_ntot_trt_measurements
void filterTrackHits(const EventContext &ctx, MeasurementType detTypeToSelect, const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, const SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > &statesKey, const SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > &measurementsKey, std::atomic< unsigned int > &ntot_states, std::atomic< unsigned int > &ntot_measurements, std::atomic< unsigned int > &npass_states, std::atomic< unsigned int > &npass_measurements) const
std::atomic< unsigned int > m_ntot_sct_measurements
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
bool isValid() const
Test to see if the link can be dereferenced.
Handle for requesting thinning for a data object.
std::atomic< unsigned int > m_npass_sct_measurements
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesSctSGKey
std::atomic< unsigned int > m_npass_pix_measurements
std::atomic< unsigned int > m_npass_sct_states
void selectTrackHits(const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, MeasurementType detTypeToSelect, std::vector< bool > &outputStatesMask, std::vector< bool > &outputMeasurementsMask) const
Select TrackStateValidation and TrackMeasurementValidation objects that are used in the (thinned) tra...
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
std::atomic< unsigned int > m_ntot_trt_states
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesTrtSGKey
@ TrkState_NumberOfMeasurementTypes
std::string m_selectionString
std::atomic< unsigned int > m_ntot_pix_measurements
std::atomic< unsigned int > m_npass
StringProperty m_streamName
ElementLink implementation for ROOT usage.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
std::atomic< unsigned int > m_npass_trt_states
std::atomic< unsigned int > m_ntot_sct_states
StatusCode initialize(bool used=true)
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsSctSGKey
#define ATH_MSG_WARNING(x)
index_type index() const
Get the index of the element inside of its container.
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesPixSGKey
std::atomic< unsigned int > m_ntot_pix_states
Class describing a TrackParticle.
std::atomic< unsigned int > m_ntot
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsTrtSGKey