ATLAS Offline Software
Loading...
Searching...
No Matches
ThinInDetClustersAlg Class Referencefinal

#include <ThinInDetClustersAlg.h>

Inheritance diagram for ThinInDetClustersAlg:
Collaboration diagram for ThinInDetClustersAlg:

Public Member Functions

 ThinInDetClustersAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters:
virtual ~ThinInDetClustersAlg ()=default
 Destructor:
virtual StatusCode initialize () override
 Athena algorithm's initalize hook.
virtual StatusCode execute (const EventContext &ctx) const override
 Athena algorithm's execute hook.
virtual StatusCode finalize () override
 Athena algorithm's finalize hook.
StatusCode initializeParser (const ExpressionParsing::SelectionArg< 1 > &selection_string)
StatusCode finalizeParser ()
virtual bool updateDataNeeds (const std::vector< const DataObjID * > &input_data_in, const std::vector< const DataObjID * > &output_data_in, std::vector< Gaudi::DataHandle * > &new_input_handles, std::vector< Gaudi::DataHandle * > &new_output_handles) override
 Inform a dynamic data consumer about all consumed or produced data.
virtual bool renounceInput (const DataObjID &output_data_id) override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

StatusCode _initializeParser (const ExpressionParsing::SelectionArg< 1 > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc)
StatusCode _initializeParser (const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc)
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

ExpressionParsing::SGxAODProxyLoaderm_xAODProxyLoader
 The expression parser.
std::unique_ptr< ExpressionParsing::IProxyLoaderm_proxyLoaders
std::conditional< 1==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, 1 > >::type m_parser
std::vector< std::string > m_renounce

Private Types

enum  MeasurementType {
  TrkState_unidentified = 0 , TrkState_Pixel = 1 , TrkState_SCT = 2 , TrkState_TRT = 3 ,
  TrkState_Pseudo = 8 , TrkState_Vertex = 9 , TrkState_SpacePoint = 11 , TrkState_NumberOfMeasurementTypes =16
}
 Track state types Subset of enum MeasurementType from Athena: Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/TrackStateDefs.h. More...
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

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.
StatusCode filterTrackHits (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 > &npass_states, std::atomic< unsigned int > &npass_measurements, const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::atomic< unsigned int > m_ntot {}
 Counters and keys for xAOD::TrackParticle container.
std::atomic< unsigned int > m_npass {}
BooleanProperty m_thinPixelHitsOnTrack { this, "ThinPixelHitsOnTrack", false, ""}
 Thinning logic.
BooleanProperty m_thinSCTHitsOnTrack { this, "ThinSCTHitsOnTrack", false, ""}
BooleanProperty m_thinTRTHitsOnTrack { this, "ThinTRTHitsOnTrack", false, ""}
StringProperty m_streamName { this, "StreamName", "", "Name of the stream being thinned" }
 Stream for object thinning selections.
StringProperty m_selectionString { this, "SelectionString", "InDetTrackParticles.pt>10*GeV", "Selection string for each TrackParticle container" }
 Expressions for object thinning selections Default InDetTrackParticles (also accomplished through flag.Tracking.thinPixelClustersSelectionStrings defaults).
SG::ThinningHandleKey< xAOD::TrackParticleContainerm_inDetSGKey { this, "InDetTrackParticlesKey", "InDetTrackParticles", "" }
 SGKey for TrackParticleContainer.
std::atomic< unsigned int > m_ntot_pix_states {}
 Counters and keys for xAOD::TrackStateValidation and xAOD::TrackMeasurementValidation containers.
std::atomic< unsigned int > m_npass_pix_states {}
SG::ThinningHandleKey< xAOD::TrackStateValidationContainerm_statesPixSGKey { this, "InDetTrackStatesPixKey", "PixelMSOSs", "" }
std::atomic< unsigned int > m_ntot_pix_measurements {}
std::atomic< unsigned int > m_npass_pix_measurements {}
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainerm_measurementsPixSGKey { this, "InDetTrackMeasurementsPixKey", "PixelClusters", "" }
std::atomic< unsigned int > m_ntot_sct_states {}
std::atomic< unsigned int > m_npass_sct_states {}
SG::ThinningHandleKey< xAOD::TrackStateValidationContainerm_statesSctSGKey { this, "InDetTrackStatesSctKey", "SCT_MSOSs", "" }
std::atomic< unsigned int > m_ntot_sct_measurements {}
std::atomic< unsigned int > m_npass_sct_measurements {}
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainerm_measurementsSctSGKey { this, "InDetTrackMeasurementsSctKey", "SCT_Clusters", "" }
std::atomic< unsigned int > m_ntot_trt_states {}
std::atomic< unsigned int > m_npass_trt_states {}
SG::ThinningHandleKey< xAOD::TrackStateValidationContainerm_statesTrtSGKey { this, "InDetTrackStatesTrtKey", "TRT_MSOSs", "" }
std::atomic< unsigned int > m_ntot_trt_measurements {}
std::atomic< unsigned int > m_npass_trt_measurements {}
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainerm_measurementsTrtSGKey { this, "InDetTrackMeasurementsTrtKey", "TRT_DriftCircles", "" }
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}
 For P->T converter of SCT_Clusters.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 32 of file ThinInDetClustersAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ MeasurementType

Track state types Subset of enum MeasurementType from Athena: Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/TrackStateDefs.h.

Enumerator
TrkState_unidentified 
TrkState_Pixel 
TrkState_SCT 
TrkState_TRT 
TrkState_Pseudo 
TrkState_Vertex 
TrkState_SpacePoint 
TrkState_NumberOfMeasurementTypes 

Definition at line 112 of file ThinInDetClustersAlg.h.

Constructor & Destructor Documentation

◆ ThinInDetClustersAlg()

ThinInDetClustersAlg::ThinInDetClustersAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor with parameters:

Definition at line 32 of file ThinInDetClustersAlg.cxx.

◆ ~ThinInDetClustersAlg()

virtual ThinInDetClustersAlg::~ThinInDetClustersAlg ( )
virtualdefault

Destructor:

Member Function Documentation

◆ _initializeParser() [1/2]

◆ _initializeParser() [2/2]

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode ThinInDetClustersAlg::execute ( const EventContext & ctx) const
overridevirtual

Athena algorithm's execute hook.

Definition at line 116 of file ThinInDetClustersAlg.cxx.

117{
118
119 // Retrieve main TrackParticle collection
120 SG::ThinningHandle<xAOD::TrackParticleContainer> importedTrackParticles(m_inDetSGKey, ctx);
121 ATH_CHECK( importedTrackParticles.isValid() );
122
125 SG::ReadHandle<xAOD::TrackMeasurementValidationContainer> importedMeasurements(m_measurementsPixSGKey, ctx);
126 ATH_CHECK( importedMeasurements.isValid() );
127 unsigned int size_measurements = importedMeasurements->size();
128 m_ntot_pix_measurements += size_measurements;
129 }
131 SG::ReadHandle<xAOD::TrackMeasurementValidationContainer> importedMeasurements(m_measurementsSctSGKey, ctx);
132 ATH_CHECK( importedMeasurements.isValid() );
133 unsigned int size_measurements = importedMeasurements->size();
134 m_ntot_sct_measurements += size_measurements;
135 }
137 SG::ReadHandle<xAOD::TrackMeasurementValidationContainer> importedMeasurements(m_measurementsTrtSGKey, ctx);
138 ATH_CHECK( importedMeasurements.isValid() );
139 unsigned int size_measurements = importedMeasurements->size();
140 m_ntot_trt_measurements += size_measurements;
141 }
143
144 // Check the event contains tracks
145 unsigned int nTracks = importedTrackParticles->size();
146 if (nTracks==0) return StatusCode::SUCCESS;
147
148 // Set up a mask with the same entries as the full TrackParticle collection
149 std::vector<bool> mask;
150 mask.assign(nTracks,false); // default: don't keep any tracks
151 m_ntot += nTracks;
152
153 // Execute the text parser and update the mask
154 if (m_parser) {
155 std::vector<int> entries = m_parser->evaluateAsVector();
156 unsigned int nEntries = entries.size();
157 // check the sizes are compatible
158 if (nTracks != nEntries ) {
159 ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string used ID TrackParticles?");
160 return StatusCode::FAILURE;
161 }
162 // set mask
163 for (unsigned int i=0; i<nTracks; ++i) {
164 if (entries[i]==1) {
165 mask[i]=true; // Set track mask
166 m_npass += 1; // Count passing tracks.
167 }
168 }
169 }
170
174 *importedTrackParticles,
175 mask,
181 ctx) );
182 }
186 *importedTrackParticles,
187 mask,
193 ctx) );
194 }
198 *importedTrackParticles,
199 mask,
205 ctx) );
206 }
207
208 return StatusCode::SUCCESS;
209}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
std::atomic< unsigned int > m_ntot_sct_states
std::atomic< unsigned int > m_npass_pix_states
std::atomic< unsigned int > m_npass_sct_measurements
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsPixSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesSctSGKey
BooleanProperty m_thinPixelHitsOnTrack
Thinning logic.
BooleanProperty m_thinTRTHitsOnTrack
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesTrtSGKey
std::atomic< unsigned int > m_npass_trt_measurements
std::atomic< unsigned int > m_npass
std::atomic< unsigned int > m_ntot_sct_measurements
std::atomic< unsigned int > m_ntot_pix_states
Counters and keys for xAOD::TrackStateValidation and xAOD::TrackMeasurementValidation containers.
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
SGKey for TrackParticleContainer.
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsTrtSGKey
std::atomic< unsigned int > m_npass_sct_states
std::atomic< unsigned int > m_ntot_pix_measurements
std::atomic< unsigned int > m_npass_pix_measurements
std::atomic< unsigned int > m_ntot_trt_states
std::atomic< unsigned int > m_npass_trt_states
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesPixSGKey
std::atomic< unsigned int > m_ntot_trt_measurements
StatusCode filterTrackHits(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 > &npass_states, std::atomic< unsigned int > &npass_measurements, const EventContext &ctx) const
BooleanProperty m_thinSCTHitsOnTrack
std::atomic< unsigned int > m_ntot
Counters and keys for xAOD::TrackParticle container.
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsSctSGKey
double entries
Definition listroot.cxx:49

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ filterTrackHits()

StatusCode ThinInDetClustersAlg::filterTrackHits ( 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 > & npass_states,
std::atomic< unsigned int > & npass_measurements,
const EventContext & ctx ) const
private

Definition at line 211 of file ThinInDetClustersAlg.cxx.

221{
222 std::vector<bool> maskStates;
223 std::vector<bool> maskMeasurements;
224
225 selectTrackHits (inputTrackParticles, inputMask, detTypeToSelect,
226 maskStates, maskMeasurements);
227
228 auto count = [] (const std::vector<bool>& m)
229 { return std::count (m.begin(), m.end(), true); };
230 npass_states += count (maskStates);
231 npass_measurements += count (maskMeasurements);
232
233 if (!statesKey.empty()) {
234 SG::ThinningHandle<xAOD::TrackStateValidationContainer> importedStates(statesKey, ctx);
235 ATH_CHECK( importedStates.isValid() );
236 unsigned int size_states = importedStates->size();
237 if (size_states == 0) {
238 ATH_MSG_WARNING("States container is empty: " << statesKey.key());
239 }
240 else {
241 ntot_states += size_states;
242 if (maskStates.size() > size_states) {
243 ATH_MSG_ERROR("States mask size mismatch: mask size (" << maskStates.size() << ") > number of states (" << size_states << ").");
244 return StatusCode::FAILURE;
245 }
246 maskStates.resize (size_states);
247 importedStates.keep (maskStates);
248 }
249 }
250
251 if (!measurementsKey.empty()) {
252 SG::ThinningHandle<xAOD::TrackMeasurementValidationContainer> importedMeasurements(measurementsKey, ctx);
253 ATH_CHECK( importedMeasurements.isValid() );
254 unsigned int size_measurements = importedMeasurements->size();
255 if (size_measurements == 0) {
256 ATH_MSG_WARNING("Measurements container is empty: " << measurementsKey.key());
257 }
258 else {
259 if (maskMeasurements.size() > size_measurements) {
260 ATH_MSG_ERROR("Measurements mask size mismatch: mask size (" << maskMeasurements.size() << ") > number of measurements (" << size_measurements << ").");
261 return StatusCode::FAILURE;
262 }
263 maskMeasurements.resize (size_measurements);
264 importedMeasurements.keep (maskMeasurements);
265 }
266 }
267
268 return StatusCode::SUCCESS;
269}
#define ATH_MSG_WARNING(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
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...
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148

◆ finalize()

StatusCode ThinInDetClustersAlg::finalize ( )
overridevirtual

Athena algorithm's finalize hook.

Definition at line 84 of file ThinInDetClustersAlg.cxx.

85{
86 ATH_MSG_VERBOSE("finalize() ...");
87 ATH_MSG_INFO("Processed "<< m_ntot <<" tracks, "<< m_npass<< " had their hits retained ");
89 ATH_MSG_INFO("Pixel state objects thinning, Total / Passed (Efficiency): "
91 << " (" << (m_ntot_pix_states == 0 ? 0 : static_cast<float>(m_npass_pix_states) / m_ntot_pix_states) << ")");
92 ATH_MSG_INFO("Total pixel measurements objects from *all* track collections:: " << m_ntot_pix_measurements);
93 ATH_MSG_INFO("Pixel measurements objects from this track collection passing selection: " << m_npass_pix_measurements);
94 }
96 ATH_MSG_INFO("SCT state objects thinning, Total / Passed (Efficiency): "
98 << " (" << (m_ntot_sct_states == 0 ? 0 : static_cast<float>(m_npass_sct_states) / m_ntot_sct_states) << ")");
99 ATH_MSG_INFO("Total SCT measurements objects from *all* track collections:: " << m_ntot_sct_measurements);
100 ATH_MSG_INFO("SCT measurements objects from this track collection passing selection: " << m_npass_sct_measurements);
101 }
103 ATH_MSG_INFO("TRT state objects thinning, Total / Passed (Efficiency): "
105 << " (" << (m_ntot_trt_states == 0 ? 0 : static_cast<float>(m_npass_trt_states) / m_ntot_trt_states) << ")");
106 ATH_MSG_INFO("Total TRT measurements objects from *all* track collections:: " << m_ntot_trt_measurements);
107 ATH_MSG_INFO("TRT measurements objects from this track collection passing selection: " << m_npass_trt_measurements);
108 }
109
111
112 return StatusCode::SUCCESS;
113}
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)

◆ finalizeParser()

StatusCode ExpressionParserUserBase< ::AthReentrantAlgorithm, 1 >::finalizeParser ( )
inherited

◆ initialize()

StatusCode ThinInDetClustersAlg::initialize ( )
overridevirtual

Athena algorithm's initalize hook.

Definition at line 42 of file ThinInDetClustersAlg.cxx.

43{
44
45 // Set up the text-parsing machinery for thinning the tracks directly according to user cuts
46 if (m_selectionString.empty()) {
47 ATH_MSG_FATAL("No inner detector track selection strings provided!");
48 return StatusCode::FAILURE;
49 }
50 ATH_MSG_INFO("Track thinning selection string: " << m_selectionString);
52
53 ATH_CHECK( m_inDetSGKey.initialize (m_streamName) );
54 ATH_MSG_INFO("Using " << m_inDetSGKey << "as the source collection for inner detector track particles");
55
57 ATH_MSG_INFO("Pixel states collection as source for thinning: " << m_statesPixSGKey.key());
58 ATH_MSG_INFO("Pixel measurements collection as source for thinning: " << m_measurementsPixSGKey.key());
59 }
61 ATH_MSG_INFO("SCT states collection as source for thinning: " << m_statesSctSGKey.key());
62 ATH_MSG_INFO("SCT measurements collection as source for thinning: " << m_measurementsSctSGKey.key());
63 }
65 ATH_MSG_INFO("TRT states collection as source for thinning: " << m_statesTrtSGKey.key());
66 ATH_MSG_INFO("TRT measurements collection as source for thinning: " << m_measurementsTrtSGKey.key());
67 }
68
69 ATH_MSG_DEBUG("Initializing measurement ThinningHandleKeys.");
73
74 ATH_MSG_DEBUG("Initializing MSOS ThinningHandleKeyArrays.");
78
79 ATH_CHECK(m_SCTDetEleCollKey.initialize( !m_SCTDetEleCollKey.key().empty() ));
80
81 return StatusCode::SUCCESS;
82}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
StatusCode initializeParser(const ExpressionParsing::SelectionArg< 1 > &selection_string)
StringProperty m_selectionString
Expressions for object thinning selections Default InDetTrackParticles (also accomplished through fla...
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
For P->T converter of SCT_Clusters.
StringProperty m_streamName
Stream for object thinning selections.

◆ initializeParser()

StatusCode ExpressionParserUser< ::AthReentrantAlgorithm, 1 >::initializeParser ( const ExpressionParsing::SelectionArg< 1 > & selection_string)
inherited

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ renounceInput()

virtual bool ExpressionParserUserBase< ::AthReentrantAlgorithm, 1 >::renounceInput ( const DataObjID & output_data_id)
overridevirtualinherited

◆ selectTrackHits()

void ThinInDetClustersAlg::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 271 of file ThinInDetClustersAlg.cxx.

275{
276 using StatesOnTrack = std::vector<ElementLink<xAOD::TrackStateValidationContainer>>;
277
278 // loop over track particles, consider only the ones pre-selected by the mask
279 int trkIndex=-1;
280 for (const xAOD::TrackParticle* trkIt : inputTrackParticles) {
281 trkIndex++;
282
283 if (not inputMask[trkIndex]) continue;
284
285 // loop over the TrackStateValidation objects, and add them to the outputStatesMask
286 static const SG::AuxElement::ConstAccessor< StatesOnTrack > trackStateAcc("Reco_msosLink");
287 if( ! trackStateAcc.isAvailable( *trkIt ) ) {
288 ATH_MSG_INFO("Cannot find TrackState link from xAOD::TrackParticle. Skipping track.");
289 continue;
290 }
291 const StatesOnTrack& measurementsOnTrack = trackStateAcc(*trkIt);
292
293 for( const ElementLink<xAOD::TrackStateValidationContainer>& trkState_el : measurementsOnTrack) {
294 if (not trkState_el.isValid()) {
295 ATH_MSG_INFO("Cannot find a valid link to TrackStateValidation object for track index: " << trkIndex);
296 continue; //not a valid link
297 }
298 if ((*trkState_el)->detType() != detTypeToSelect) {
299 ATH_MSG_VERBOSE("Discarding TrackState as not of correct type " << detTypeToSelect);
300 continue;
301 }
302 if (trkState_el.index() >= outputStatesMask.size()) {
303 outputStatesMask.resize (trkState_el.index()+1);
304 }
305 outputStatesMask[trkState_el.index()] = true;
306
307 // get the corresponding TrackMeasurementValidation object, if any, and add it to the outputMeasurementsMask
308 const ElementLink<xAOD::TrackMeasurementValidationContainer> trkMeasurement_el = (*trkState_el)->trackMeasurementValidationLink();
309 if (not trkMeasurement_el.isValid()) {
310 ATH_MSG_VERBOSE("Cannot find a valid link to TrackMeasurementValidation object from track state for track index: " << trkIndex
311 << ", trackState index: " << trkState_el.index());
312 continue; //not a valid link
313 }
314 if (*trkMeasurement_el == nullptr) {
315 ATH_MSG_VERBOSE("Invalid pointer to TrackMeasurementValidation object from track state for track index: " << trkIndex
316 << ", trackState index: " << trkState_el.index());
317 continue; //not linking to a valid object -- is it necessary?
318 }
319 if (trkMeasurement_el.index() >= outputMeasurementsMask.size()) {
320 outputMeasurementsMask.resize (trkMeasurement_el.index()+1);
321 }
322 outputMeasurementsMask[trkMeasurement_el.index()] = true;
323 }
324 } // end loop over xAOD::TrackParticle container
325}
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateDataNeeds()

virtual bool ExpressionParserUserBase< ::AthReentrantAlgorithm, 1 >::updateDataNeeds ( const std::vector< const DataObjID * > & input_data_in,
const std::vector< const DataObjID * > & output_data_in,
std::vector< Gaudi::DataHandle * > & new_input_handles,
std::vector< Gaudi::DataHandle * > & new_output_handles )
overridevirtualinherited

Inform a dynamic data consumer about all consumed or produced data.

Parameters
input_data_inthe input data object IDs of all algorithms and tools
output_data_inthe output data object IDs of all algorithms and tools
new_input_handlesthe new input data handles added by this call
new_output_handlesthe new output data handles added by this call
Returns
true if the consumer did update its handles, false otherwise

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_inDetSGKey

SG::ThinningHandleKey<xAOD::TrackParticleContainer> ThinInDetClustersAlg::m_inDetSGKey { this, "InDetTrackParticlesKey", "InDetTrackParticles", "" }
private

SGKey for TrackParticleContainer.

Definition at line 73 of file ThinInDetClustersAlg.h.

74{ this, "InDetTrackParticlesKey", "InDetTrackParticles", "" };

◆ m_measurementsPixSGKey

SG::ThinningHandleKey<xAOD::TrackMeasurementValidationContainer> ThinInDetClustersAlg::m_measurementsPixSGKey { this, "InDetTrackMeasurementsPixKey", "PixelClusters", "" }
private

Definition at line 84 of file ThinInDetClustersAlg.h.

85{ this, "InDetTrackMeasurementsPixKey", "PixelClusters", "" };

◆ m_measurementsSctSGKey

SG::ThinningHandleKey<xAOD::TrackMeasurementValidationContainer> ThinInDetClustersAlg::m_measurementsSctSGKey { this, "InDetTrackMeasurementsSctKey", "SCT_Clusters", "" }
private

Definition at line 94 of file ThinInDetClustersAlg.h.

95{ this, "InDetTrackMeasurementsSctKey", "SCT_Clusters", "" };

◆ m_measurementsTrtSGKey

SG::ThinningHandleKey<xAOD::TrackMeasurementValidationContainer> ThinInDetClustersAlg::m_measurementsTrtSGKey { this, "InDetTrackMeasurementsTrtKey", "TRT_DriftCircles", "" }
private

Definition at line 104 of file ThinInDetClustersAlg.h.

105{ this, "InDetTrackMeasurementsTrtKey", "TRT_DriftCircles", "" };

◆ m_npass

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass {}
mutableprivate

Definition at line 53 of file ThinInDetClustersAlg.h.

53{};

◆ m_npass_pix_measurements

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass_pix_measurements {}
mutableprivate

Definition at line 83 of file ThinInDetClustersAlg.h.

83{};

◆ m_npass_pix_states

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass_pix_states {}
mutableprivate

Definition at line 78 of file ThinInDetClustersAlg.h.

78{};

◆ m_npass_sct_measurements

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass_sct_measurements {}
mutableprivate

Definition at line 93 of file ThinInDetClustersAlg.h.

93{};

◆ m_npass_sct_states

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass_sct_states {}
mutableprivate

Definition at line 88 of file ThinInDetClustersAlg.h.

88{};

◆ m_npass_trt_measurements

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass_trt_measurements {}
mutableprivate

Definition at line 103 of file ThinInDetClustersAlg.h.

103{};

◆ m_npass_trt_states

std::atomic<unsigned int> ThinInDetClustersAlg::m_npass_trt_states {}
mutableprivate

Definition at line 98 of file ThinInDetClustersAlg.h.

98{};

◆ m_ntot

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot {}
mutableprivate

Counters and keys for xAOD::TrackParticle container.

Definition at line 52 of file ThinInDetClustersAlg.h.

52{};

◆ m_ntot_pix_measurements

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot_pix_measurements {}
mutableprivate

Definition at line 82 of file ThinInDetClustersAlg.h.

82{};

◆ m_ntot_pix_states

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot_pix_states {}
mutableprivate

Counters and keys for xAOD::TrackStateValidation and xAOD::TrackMeasurementValidation containers.

Definition at line 77 of file ThinInDetClustersAlg.h.

77{};

◆ m_ntot_sct_measurements

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot_sct_measurements {}
mutableprivate

Definition at line 92 of file ThinInDetClustersAlg.h.

92{};

◆ m_ntot_sct_states

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot_sct_states {}
mutableprivate

Definition at line 87 of file ThinInDetClustersAlg.h.

87{};

◆ m_ntot_trt_measurements

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot_trt_measurements {}
mutableprivate

Definition at line 102 of file ThinInDetClustersAlg.h.

102{};

◆ m_ntot_trt_states

std::atomic<unsigned int> ThinInDetClustersAlg::m_ntot_trt_states {}
mutableprivate

Definition at line 97 of file ThinInDetClustersAlg.h.

97{};

◆ m_parser

std::conditional<1==1,std::unique_ptr<ExpressionParsing::ExpressionParser>,std::array<std::unique_ptr<ExpressionParsing::ExpressionParser>,1>>::type ExpressionParserUserBase< ::AthReentrantAlgorithm, 1 >::m_parser
protectedinherited

Definition at line 100 of file ExpressionParserUser.h.

◆ m_proxyLoaders

std::unique_ptr<ExpressionParsing::IProxyLoader> ExpressionParserUserBase< ::AthReentrantAlgorithm, 1 >::m_proxyLoaders
protectedinherited

Definition at line 97 of file ExpressionParserUser.h.

◆ m_renounce

std::vector<std::string> ExpressionParserUserBase< ::AthReentrantAlgorithm, 1 >::m_renounce
protectedinherited

Definition at line 102 of file ExpressionParserUser.h.

◆ m_SCTDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> ThinInDetClustersAlg::m_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}
private

For P->T converter of SCT_Clusters.

Definition at line 108 of file ThinInDetClustersAlg.h.

108{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};

◆ m_selectionString

StringProperty ThinInDetClustersAlg::m_selectionString { this, "SelectionString", "InDetTrackParticles.pt>10*GeV", "Selection string for each TrackParticle container" }
private

Expressions for object thinning selections Default InDetTrackParticles (also accomplished through flag.Tracking.thinPixelClustersSelectionStrings defaults).

Definition at line 69 of file ThinInDetClustersAlg.h.

70{ this, "SelectionString", "InDetTrackParticles.pt>10*GeV", "Selection string for each TrackParticle container" };

◆ m_statesPixSGKey

SG::ThinningHandleKey<xAOD::TrackStateValidationContainer> ThinInDetClustersAlg::m_statesPixSGKey { this, "InDetTrackStatesPixKey", "PixelMSOSs", "" }
private

Definition at line 79 of file ThinInDetClustersAlg.h.

80{ this, "InDetTrackStatesPixKey", "PixelMSOSs", "" }; // original

◆ m_statesSctSGKey

SG::ThinningHandleKey<xAOD::TrackStateValidationContainer> ThinInDetClustersAlg::m_statesSctSGKey { this, "InDetTrackStatesSctKey", "SCT_MSOSs", "" }
private

Definition at line 89 of file ThinInDetClustersAlg.h.

90{ this, "InDetTrackStatesSctKey", "SCT_MSOSs", "" };

◆ m_statesTrtSGKey

SG::ThinningHandleKey<xAOD::TrackStateValidationContainer> ThinInDetClustersAlg::m_statesTrtSGKey { this, "InDetTrackStatesTrtKey", "TRT_MSOSs", "" }
private

Definition at line 99 of file ThinInDetClustersAlg.h.

100{ this, "InDetTrackStatesTrtKey", "TRT_MSOSs", "" };

◆ m_streamName

StringProperty ThinInDetClustersAlg::m_streamName { this, "StreamName", "", "Name of the stream being thinned" }
private

Stream for object thinning selections.

Definition at line 63 of file ThinInDetClustersAlg.h.

64{ this, "StreamName", "", "Name of the stream being thinned" };

◆ m_thinPixelHitsOnTrack

BooleanProperty ThinInDetClustersAlg::m_thinPixelHitsOnTrack { this, "ThinPixelHitsOnTrack", false, ""}
private

Thinning logic.

Definition at line 55 of file ThinInDetClustersAlg.h.

56{ this, "ThinPixelHitsOnTrack", false, ""};

◆ m_thinSCTHitsOnTrack

BooleanProperty ThinInDetClustersAlg::m_thinSCTHitsOnTrack { this, "ThinSCTHitsOnTrack", false, ""}
private

Definition at line 57 of file ThinInDetClustersAlg.h.

58{ this, "ThinSCTHitsOnTrack", false, ""};

◆ m_thinTRTHitsOnTrack

BooleanProperty ThinInDetClustersAlg::m_thinTRTHitsOnTrack { this, "ThinTRTHitsOnTrack", false, ""}
private

Definition at line 59 of file ThinInDetClustersAlg.h.

60{ this, "ThinTRTHitsOnTrack", false, ""};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_xAODProxyLoader

The expression parser.

Definition at line 96 of file ExpressionParserUser.h.


The documentation for this class was generated from the following files: