|
ATLAS Offline Software
|
Go to the documentation of this file.
19 "Jet collection that will be used for matching the Hits");
21 "Name of PV collection. Default is PrimaryVertices");
23 "Name of output pixel hit collection. JetAssociatedPixelClusters is default.");
25 "Name of output SCT hit collection. JetAssociatedSCTClusters is default.");
27 "Name of input pixel hit collection. PixelClusters is default");
29 "Name of input SCT hit collection. SCT_Clusters is default");
31 "Hits are saved only if they match to jets with pT > jetPtThreshold [in MeV]");
33 "The radius used for matching hits to jets");
61 return StatusCode::SUCCESS;
68 const EventContext& ctx = Gaudi::Hive::currentContext();
72 if ( !jetReadHandle.
isValid() ) {
74 return StatusCode::FAILURE;
78 std::vector<const xAOD::Jet*>
jets;
79 jets.reserve( jetReadHandle->
size() );
91 if ( !vertexReadHandle.
isValid() ) {
92 ATH_MSG_ERROR(
"Failed to retrieve PrimaryVertices container" );
93 return StatusCode::FAILURE;
107 if ( !pixHitReadHandle.
isValid() ) {
109 return StatusCode::FAILURE;
114 if ( !sctHitReadHandle.
isValid() ) {
116 return StatusCode::FAILURE;
124 return StatusCode::SUCCESS;
132 unsigned long long int &nStoredHits,
133 unsigned long long int &nTotalHits) {
136 auto outputHitCollection = std::make_unique<xAOD::TrackMeasurementValidationContainer>();
137 auto outputHitCollectionAux = std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>();
138 outputHitCollection->setStore(outputHitCollectionAux.get());
148 ATH_MSG_DEBUG(
"JetHitAssociation: PrimaryVertex Z Position = " << PVposition.Z());
153 float x = hit->globalX();
154 float y = hit->globalY();
155 float z = hit->globalZ();
158 TVector3 hitPosition(
x,
y,
z);
161 hitPosition = hitPosition - PVposition;
166 float dR = hitPosition.DeltaR(
jet->p4().Vect());
170 outputHitCollection->push_back(std::make_unique<xAOD::TrackMeasurementValidation>(*hit));
171 *outputHitCollection->back() = *hit;
179 nTotalHits +=
hits->size();
182 if ( ! outputHits.
put( std::move(outputHitCollection), std::move(outputHitCollectionAux) ) ) {
184 return StatusCode::FAILURE;
187 return StatusCode::SUCCESS;
197 return StatusCode::SUCCESS;
virtual StatusCode initialize() override
JetHitAssociation(const std::string &name, ISvcLocator *svcloc)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::ReadHandleKey< xAOD::JetContainer > m_jetCollectionName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_inputSCTHitCollectionName
StatusCode saveHits(const std::vector< const xAOD::Jet * > &jets, const xAOD::Vertex *const vertex, SG::ReadHandle< xAOD::TrackMeasurementValidationContainer > &hits, const SG::WriteHandle< xAOD::TrackMeasurementValidationContainer > &writeHandle, unsigned long long int &nStoredHits, unsigned long long int &nTotalHits)
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_outputPixHitCollectionName
Class describing a TrackMeasurementValidation.
unsigned long long int m_nStoredSCTHits
unsigned long long int m_nTotalPixHits
::StatusCode StatusCode
StatusCode definition for legacy code.
unsigned long long int m_nTotalSCTHits
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexCollectionName
Class describing a Vertex.
virtual StatusCode execute() override
unsigned long long int m_nStoredPixHits
const_pointer_type put(std::unique_ptr< T > data, bool returnExisting=false) const
Record an object to the store.
virtual StatusCode finalize() override
size_type size() const noexcept
Returns the number of elements in the collection.
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_outputSCTHitCollectionName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_inputPixHitCollectionName