 |
ATLAS Offline Software
|
Go to the documentation of this file.
70 ATH_MSG_ERROR(
"No decoration prefix name provided for the output of TrackStateOnSurfaceDecorator! Use the variable DecorationPrefix to properly set a prefix.");
71 return StatusCode::FAILURE;
77 ATH_MSG_ERROR(
"No TrackParticle collection provided for TrackStateOnSurfaceDecorator!");
78 return StatusCode::FAILURE;
90 return StatusCode::FAILURE;
95 return StatusCode::FAILURE;
100 return StatusCode::FAILURE;
105 return StatusCode::FAILURE;
124 std::vector<std::string> decor_names{
"TrtPhaseTime"};
125 std::vector<SG::WriteDecorHandleKey<xAOD::EventInfo> > decor_key_out;
130 std::vector<std::string>
names;
152 std::vector<std::string>
names;
174 return StatusCode::SUCCESS;
180 return StatusCode::SUCCESS;
185 const EventContext& ctx = Gaudi::Hive::currentContext();
186 ATH_MSG_DEBUG(
"Adding TSOS decorations the track particles");
194 return StatusCode::FAILURE;
196 size_t nTracks = tracks->
size();
223 return StatusCode::FAILURE;
228 float trtPhase_time=0.;
232 trtPhase_time = trtPhase->
getTime();
235 decorTRTPhase(*eventInfo) = trtPhase_time;
248 if (msosPixel.
record(std::make_unique<xAOD::TrackStateValidationContainer>(),
249 std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
251 return StatusCode::FAILURE;
260 if (msosSCT.
record(std::make_unique<xAOD::TrackStateValidationContainer>(),
261 std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
263 return StatusCode::FAILURE;
272 if (msosTRT.
record(std::make_unique<xAOD::TrackStateValidationContainer>(),
273 std::make_unique<xAOD::TrackStateValidationAuxContainer>()).isFailure()) {
275 return StatusCode::FAILURE;
284 if (!prd_to_track_map.
isValid()) {
287 prd_to_track_map_cptr = prd_to_track_map.
cptr();
291 std::vector<bool>
mask;
292 mask.assign(nTracks,
true);
294 std::vector<int>
entries = m_parser->evaluateAsVector();
298 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used ID TrackParticles?");
299 return StatusCode::FAILURE;
306 std::vector<SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> > trackTRTFloatDecorators;
310 std::vector<SG::WriteDecorHandle<xAOD::TrackParticleContainer,float> >
313 unsigned i_track = 0;
314 for (
const auto *
const track : *tracks) {
324 if( !
track->trackLink().isValid() ||
track->track() ==
nullptr ) {
334 std::vector< ElementLink< xAOD::TrackStateValidationContainer > > msosLink;
354 bool allExtrapolationsSucceded =
true;
359 ATH_MSG_VERBOSE(
"Start radius for extrapolating to layers: "<<startRadius);
362 std::unique_ptr<const Trk::TrackParameters> outputParamsIBL
374 std::unique_ptr<const Trk::TrackParameters> outputParamsBL
386 std::unique_ptr<const Trk::TrackParameters> outputParamsL1
398 std::unique_ptr<const Trk::TrackParameters> outputParamsL2
407 if (outputParamsIBL.get()) {
413 allExtrapolationsSucceded =
false;
420 if (outputParamsBL.get()) {
426 allExtrapolationsSucceded =
false;
433 if (outputParamsL1.get()) {
439 allExtrapolationsSucceded =
false;
446 if (outputParamsL2.get()) {
452 allExtrapolationsSucceded =
false;
458 if(!allExtrapolationsSucceded)
ATH_MSG_WARNING(
"At least one extrapolation to a Pixel layer failed!");
461 ATH_MSG_WARNING(
"No perigee TrackParameters found - filling positions on layers to (0,0,0)!");
479 std::vector<const Trk::TrackStateOnSurface*> tsoss;
484 tsoss.push_back(trackState);
487 std::unique_ptr<const Trk::TrackStates>
holes;
491 tsoss.push_back(
hole);
495 stable_sort( tsoss.begin(), tsoss.end(), CompFunc );
502 for (
const auto& trackState: tsoss){
520 if(!trackState->surface().associatedDetectorElement()){
525 Identifier surfaceID = trackState->surface().associatedDetectorElement()->identify();
550 if( !isPixel && !isSCT && !isTRT ){
566 msosLink.push_back(elink);
576 msosLink.push_back(elink);
586 msosLink.push_back(elink);
611 double lTheta=-1000., lPhi=-1000.;
615 errDCAcc(*msos) = -1 ;
625 HitZAcc(*msos)=-3000;
627 rTrkWireAcc(*msos)=-1;
631 HitZAcc(*msos)=-3000;
633 rTrkWireAcc(*msos)=-1;
638 HitZAcc(*msos)=gp.z();
639 HitRAcc(*msos)=gp.perp();
640 rTrkWireAcc(*msos)= fabs(trackState->trackParameters()->parameters()[
Trk::driftRadius]);
641 lTheta = trackState->trackParameters()->parameters()[
Trk::theta];
642 lPhi = trackState->trackParameters()->parameters()[
Trk::phi];
647 rTrkWireAcc(*msos)=0;
654 if (prd_to_track_map_cptr) {
659 isSharedAcc(*msos) = isShared;
665 std::unique_ptr<const Trk::TrackParameters> extrap(
m_extrapolator->extrapolateTrack(ctx,*trkTrack,trackState->surface()) );
672 ATH_MSG_DEBUG(
" Original position " <<
tp->parameters()[0] <<
" " <<
tp->parameters()[1]);
673 ATH_MSG_DEBUG(
"Extrapolated position " << extrap->parameters()[0] <<
" " << extrap->parameters()[1]);
689 if (
side && (isSCT || isPixel)) {
695 float trketacomp = mytrack.dot(myetaax);
696 float trkphicomp = mytrack.dot(myphiax);
697 float trknormcomp = mytrack.dot(mynormal);
699 ATH_MSG_DEBUG(
" Original incident angle " << trketacomp <<
" " << trkphicomp <<
" " << trknormcomp);
702 float trketacompX = metrack.dot(myetaax);
703 float trkphicompX = metrack.dot(myphiax);
704 float trknormcompX = metrack.dot(mynormal);
705 ATH_MSG_DEBUG(
"Extrapolated incident angle " << trketacompX <<
" " << trkphicompX <<
" " << trknormcompX);
707 msos->
setLocalAngles( atan2(trketacomp,trknormcomp), atan2(trkphicomp,trknormcomp) );
712 float trketacompX = metrack.dot(myetaax);
713 float trkphicompX = metrack.dot(myphiax);
714 float trknormcompX = metrack.dot(mynormal);
715 msos->
setLocalAngles( atan2(trketacompX,trknormcompX), atan2(trkphicompX,trknormcompX) );
720 if(!measurement) {
continue; }
722 if (isTRT && !trtDCOffsets.
isValid() && !trtDCs.
isValid()) {
continue; }
723 if (isSCT && !sctClusterOffsets.
isValid() && !sctClusters.
isValid()) {
continue; }
724 if (isPixel && !pixelClusterOffsets.
isValid() && !pixelClusters.
isValid()) {
continue; }
758 SiWidthAcc(*msos) = SiWidthAcc(*sctCluster);
759 firstStripAcc(*msos) = (rdoStripAcc(*sctCluster)).at(0);
761 SiWidthAcc(*msos) = -1;
762 firstStripAcc(*msos) = -1;
772 driftTimeAcc(*msos) = rtr->
drifttime(fabs(
tp->parameters()[0]));
776 driftTimeAcc(*msos) = rtr->
drifttime(fabs(extrap->parameters()[0]));
786 std::optional<Trk::ResidualPull> biased;
787 std::optional<Trk::ResidualPull> unbiased;
794 if(unbiasedTp.get()) {
833 dectsos_msosLink( *
track ) = msosLink;
840 return StatusCode::SUCCESS;
845 const std::vector<unsigned int>* offsets,
850 if( contIndex.
collHash() >= offsets->size() ){
855 unsigned int xaodIndex = offsets->at( contIndex.
collHash() ) + contIndex.
objIndex();
def retrieve(aClass, aKey=None)
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
bool is_pixel(Identifier id) const
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
virtual StatusCode addBranches() const
SG::ReadHandleKey< std::vector< unsigned int > > m_pixelMapName
void setUnbiasedResidual(float unbiasedResidualX, float unbiasedResidualY)
Sets the unbiased residual.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)
@ kTRTdEdx_noHT_divByLDecor
const_pointer_type cptr()
Dereference the pointer.
void setDetType(char detType)
Sets the detector type.
bool is_sct(Identifier id) const
const Amg::Vector3D & position() const
Access method for the position.
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
SG::ReadHandleKey< ComTime > m_trtPhaseKey
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
SG::ReadHandleKey< std::vector< unsigned int > > m_trtMapName
TrackStateValidation_v1 TrackStateValidation
Reference the current persistent version:
@ Unbiased
RP with track state that has measurement not included.
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
Gaudi::Property< bool > m_storeOutliers
Gaudi::Property< bool > m_storeHoles
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Class describing a TrackStateValidation.
value_type get_compact() const
Get the compact id.
Identifiable container index to a contained object.
MaterialUpdateMode
This is a steering enum to force the material update it can be: (1) addNoise (-1) removeNoise Second ...
ToolHandle< ITRT_CalDbTool > m_trtcaldbTool
ElementLink< xAOD::TrackMeasurementValidationContainer > trackMeasurementValidationLink() const
void setUnbiasedPull(float unbiasedPullX, float unbiasedPullY)
Sets the unbiased pull.
Gaudi::Property< bool > m_addPulls
ToolHandle< Trk::IExtrapolator > m_extrapolator
bool is_trt(Identifier id) const
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_sctClustersName
ElementLink< xAOD::TrackMeasurementValidationContainer > buildElementLink(const Trk::PrepRawData *, const std::vector< unsigned int > *, const xAOD::TrackMeasurementValidationContainer *) const
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
bool is_valid() const
Check if id is in a valid state.
SG::ReadHandleKey< std::vector< unsigned int > > m_sctMapName
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
const AtlasDetectorID * m_idHelper
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_sctMsosName
virtual const S & associatedSurface() const override final
Access to the Surface method.
Class describing a TrackMeasurementValidation.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
Class providing comparison function, or relational definition, for sorting MeasurementBase objects.
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
@ kTRTusedHits_noHT_divByLDecor
Gaudi::Property< bool > m_storeTRT
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
@ Hole
A hole on the track - this is defined in the following way.
virtual float drifttime(float radius) const =0
drifttime for given radius
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
virtual const Surface & surface() const =0
Return surface associated with this detector element.
Gaudi::Property< bool > m_storePixel
Gaudi::Property< std::vector< float > > m_pixelLayerRadii
ToolHandle< ITRT_ToT_dEdx > m_TRTdEdxTool
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_trackTRTFloatDecorKeys
ToolHandle< Trk::IUpdator > m_updator
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
ElementLink implementation for ROOT usage.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trackTSOSMOSLinkDecorKey
unsigned short objIndex() const
object index in collection
const Perigee * perigeeParameters() const
return Perigee.
void setBiasedPull(float biasedPullX, float biasedPullY)
Sets the biased pull.
void setBiasedResidual(float biasedResidualX, float biasedResidualY)
Sets the biased residual.
Helper class to provide type-safe access to aux data.
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
bool isValid() const
check that both fields are set
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const IdentContIndex & getHashAndIndex() const
Gaudi::Property< bool > m_addExtraEventInfo
void setLocalAngles(float localTheta, float localPhi)
Sets the local angles.
void setLocalPosition(float localX, float localY)
Sets the local position.
Gaudi::Property< std::string > m_sgName
const Amg::Vector3D & momentum() const
Access method for the momentum.
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_trtMsosName
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
@ Biased
RP with track state including the hit.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Gaudi::Property< bool > m_addPRD
Gaudi::Property< bool > m_storeSCT
#define ATH_MSG_WARNING(x)
void setDetElementId(uint64_t detElementId)
Sets the detector element identifier.
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_trackPixFloatDecorKeys
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_pixelMsosName
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_pixelClustersName
Handle class for reading a decoration on an object.
bool toPersistent()
Dummy function provinding the offline interface.
void setType(int type)
Sets the type (measurement, outlier, hole)
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_trtPhaseDecorKey
void setTrackMeasurementValidationLink(ElementLink< xAOD::TrackMeasurementValidationContainer > trackMeasurementValidationLink)
sets the link to the TrackMeasurementValidationContainer
Helper class to provide constant type-safe access to aux data.
Handle class for reading from StoreGate.
virtual const Amg::Vector3D & globalPosition() const override final
return the global position of this RIO_OnTrack
StringProperty m_selectionString
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_trtDCName
size_type size() const noexcept
Returns the number of elements in the collection.
unsigned short collHash() const
Accessor to hash, obj index and combined index.
bool isShared(const PrepRawData &prd) const
does this PRD belong to more than one track?
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_containerName
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
ParticleHypothesis particleHypothesis() const
Returns the particle hypothesis used for Track fitting.