 |
ATLAS Offline Software
|
Go to the documentation of this file.
17 ISvcLocator *pSvcLocator) :
62 return StatusCode::SUCCESS;
81 measToTruth = measToTruthHandle.
cptr();
87 ATH_CHECK(xaod.
record(std::make_unique<xAOD::TrackMeasurementValidationContainer>(),
88 std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>()));
113 std::vector<bool> keepClusterCollection {};
119 if (not keepClusterCollection[
i])
continue;
125 measurements->
back()->index() );
128 decorator_measurement_link(*cluster) = std::move(mlink);
135 ATH_MSG_FATAL(
"Invalid pixel detector element for hash " << hashId );
136 return StatusCode::FAILURE;
139 const std::vector<Identifier> rdoList = cluster->
rdoList();
140 std::vector< std::uint64_t > rdoIdentifierList;
141 rdoIdentifierList.reserve(rdoList.size());
146 for(
const Identifier& hitIdentifier : rdoList ){
147 rdoIdentifierList.push_back( hitIdentifier.get_compact() );
161 return StatusCode::FAILURE;
188 decor_detectorElementID(*measurement) = hashId;
189 decor_waferID(*measurement) = waferId.
get_compact();
197 decor_omegax(*measurement) = omegax;
198 decor_omegay(*measurement) = omegay;
200 decor_centroid_xphi(*measurement) =
centroid.xPhi();
201 decor_centroid_xeta(*measurement) =
centroid.xEta();
202 decor_side(*measurement) = 0;
203 decor_tots(*measurement) = cluster->
totList();
213 std::size_t measurementIndex = 0;
215 if (not keepClusterCollection[
i])
continue;
222 return StatusCode::FAILURE;
227 if (cluster->
index() >= measToTruth->size()) {
228 ATH_MSG_ERROR(
"PRD index "<< cluster->
index() <<
" not present in the measurement to truth vector with size " << measToTruth->size() );
229 return StatusCode::FAILURE;
232 auto tps = measToTruth->at(cluster->
index());
234 std::vector<unsigned int> tp_indices;
235 std::vector<unsigned int> tp_barcodes;
236 for (
const auto&
tp : tps) {
237 tp_indices.push_back(
tp->index());
242 decor_truth_indices(*measurement) = std::move(tp_indices);
243 decor_truth_barcode(*measurement) = std::move(tp_barcodes);
248 ATH_MSG_DEBUG(
" recorded PixelPrepData objects: size " << measurements->
size() );
249 return StatusCode::SUCCESS;
254 std::vector<bool>&
labels)
const
259 return StatusCode::SUCCESS;
277 std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track = *trackLink;
278 if ( not optional_track.has_value() ) {
279 ATH_MSG_ERROR(
"Invalid track link for particle " << trackParticle->index());
280 return StatusCode::FAILURE;
282 ActsTrk::TrackContainer::ConstTrackProxy
track = optional_track.value();
285 track.container().trackStateContainer()
286 .visitBackwards(
track.tipIndex(),
288 (
const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state)
290 auto flags = state.typeFlags();
291 if (not flags.test(Acts::TrackStateFlag::MeasurementFlag) and
292 not flags.test(Acts::TrackStateFlag::OutlierFlag)) return;
294 auto sl = state.getUncalibratedSourceLink().template get<ATLASUncalibSourceLink>();
295 if (sl == nullptr) return;
297 const xAOD::UncalibratedMeasurement &cluster = getUncalibratedMeasurement(sl);
298 if (cluster.type() != xAOD::UncalibMeasType::PixelClusterType) return;
299 labels.at(cluster.index()) = true;
304 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
const PixelID * m_PixelHelper
PixelClusterTruthDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
long unsigned int DetectorIdentType
int phi_index(const Identifier &id) const
Gaudi::Property< bool > m_keepOnlyOnTrackMeasurements
const_pointer_type cptr()
Dereference the pointer.
SG::WriteDecorHandleKey< xAOD::PixelClusterContainer > m_trackMeasurement_link
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_centroid_xphi
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_centroid_xeta
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_phi_module
value_type get_compact() const
Get the compact id.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_layer
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_clustercontainer_key
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_bec
Helper class to provide constant type-safe access to aux data.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_LorentzShift
void setRdoIdentifierList(const std::vector< uint64_t > &rdoIdentifierList)
Sets the list of RDO identifiers.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_sizeZ
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_eta_module
bool isValid() const
Test to see if the link can be dereferenced.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::pair< float, float > computeOmegas(const xAOD::PixelCluster &cluster, const PixelID &pixelID)
Class describing a TrackMeasurementValidation.
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociation > m_associationMap_key
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_truth_barcodes
void setLocalPosition(float localX, float localY)
Sets the local position.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_omegay
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_tots
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_side
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_truth_indices
int eta_index(const Identifier &id) const
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
void setIdentifier(uint64_t identifier)
Sets the identifier.
virtual StatusCode execute(const EventContext &ctx) const override
size_t index() const
Return the index of this element within its container.
const T * back() const
Access the last element in the collection as an rvalue.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_waferID
Gaudi::Property< bool > m_useTruthInfo
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_write_xaod_key
ElementLink implementation for ROOT usage.
int layer_disk(const Identifier &id) const
int eta_module(const Identifier &id) const
void setGlobalPosition(float globalX, float globalY, float globalZ)
Sets the global position.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
unsigned int DetectorIDHashType
@ detector ID element hash
void setLocalPositionError(float localXError, float localYError, float localXYCorrelation)
Sets the local position error.
uint64_t identifier() const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
const std::vector< int > & totList() const
Returns the list of ToT of the channels building the cluster.
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_sizePhi
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_detectorElementID
StatusCode labelMeasurementToKeep(const EventContext &ctx, const xAOD::PixelClusterContainer &clusters, std::vector< bool > &labels) const
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual StatusCode initialize() override
Handle class for reading a decoration on an object.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
int channelsInEta() const
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_omegax
int phi_module(const Identifier &id) const
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_SiWidth
size_type size() const noexcept
Returns the number of elements in the collection.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Vertex centroid(const Polygon &p)
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions,...
const_pointer_type cptr()
SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > m_trackParticlesKey