ATLAS Offline Software
Loading...
Searching...
No Matches
Rec::MuidMaterialEffectsOnTrackProvider Class Reference

#include <MuidMaterialEffectsOnTrackProvider.h>

Inheritance diagram for Rec::MuidMaterialEffectsOnTrackProvider:
Collaboration diagram for Rec::MuidMaterialEffectsOnTrackProvider:

Public Member Functions

 MuidMaterialEffectsOnTrackProvider (const std::string &, const std::string &, const IInterface *)
 AlgTool like constructor.
virtual ~MuidMaterialEffectsOnTrackProvider ()
 Virtual destructor.
StatusCode initialize ()
 AlgTool initailize method.
StatusCode finalize ()
 AlgTool finalize method.
std::vector< Trk::MaterialEffectsOnTrackextrapolationSurfacesAndEffects (const Trk::TrackingVolume &, const Trk::IPropagator &, const Trk::TrackParameters &, const Trk::Surface &, Trk::PropDirection, Trk::ParticleHypothesis) const
 return all MaterialLayers associated to this track
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 sysInitialize () override
 Perform system initialization for an algorithm.
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
 DeclareInterfaceID (IMaterialEffectsOnTrackProvider, 1, 0)
 Creates the InterfaceID and interfaceID() method.
virtual void validationAction () const

Protected Member Functions

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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< Rec::IMuidCaloTrackStateOnSurfacem_calotsos
ToolHandle< Rec::IMuidCaloTrackStateOnSurfacem_calotsosparam
ToolHandle< Trk::IMultipleScatteringUpdatorm_scattool
bool m_cosmics
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 30 of file MuidMaterialEffectsOnTrackProvider.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuidMaterialEffectsOnTrackProvider()

MuidMaterialEffectsOnTrackProvider::MuidMaterialEffectsOnTrackProvider ( const std::string & t,
const std::string & n,
const IInterface * p )

AlgTool like constructor.

Definition at line 27 of file MuidMaterialEffectsOnTrackProvider.cxx.

28 :
29 AthAlgTool(t, n, p) {
30 m_cosmics = false;
31 declareProperty("Cosmics", m_cosmics);
32 declareInterface<IMaterialEffectsOnTrackProvider>(this);
33}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~MuidMaterialEffectsOnTrackProvider()

MuidMaterialEffectsOnTrackProvider::~MuidMaterialEffectsOnTrackProvider ( )
virtual

Virtual destructor.

Definition at line 36 of file MuidMaterialEffectsOnTrackProvider.cxx.

36{}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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 }

◆ DeclareInterfaceID()

Trk::IMaterialEffectsOnTrackProvider::DeclareInterfaceID ( IMaterialEffectsOnTrackProvider ,
1 ,
0  )
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ extrapolationSurfacesAndEffects()

std::vector< Trk::MaterialEffectsOnTrack > MuidMaterialEffectsOnTrackProvider::extrapolationSurfacesAndEffects ( const Trk::TrackingVolume & ,
const Trk::IPropagator & ,
const Trk::TrackParameters & parm,
const Trk::Surface & ,
Trk::PropDirection ,
Trk::ParticleHypothesis  ) const
virtual

return all MaterialLayers associated to this track

Explanatation for these initial values?

Implements Trk::IMaterialEffectsOnTrackProvider.

Definition at line 61 of file MuidMaterialEffectsOnTrackProvider.cxx.

63 {
64 const EventContext& ctx = Gaudi::Hive::currentContext();
65 std::vector<Trk::MaterialEffectsOnTrack> meots;
66 if (m_cosmics) {
67 static const Trk::CylinderSurface outersurf(3700, 5000);
68 static const Trk::CylinderSurface innersurf(2000, 5000);
69 static const Trk::CylinderSurface middlesurf(2850, 5000);
70
71 Amg::Vector3D position(0, -3700, 0);
72 double X0outer{60}, X0inner{60};
73
75 std::pair<double, double> energy{-3000, 500};
76 ATH_MSG_DEBUG("first x0: " << X0inner << " second x0: " << X0outer << " eloss: " << energy.first << " sigma: " << energy.second);
77
78 Trk::MaterialProperties matprop(X0outer, 1., 0., 0., 0., 0.);
79 double sigmascat = std::sqrt(m_scattool->sigmaSquare(matprop, std::abs(1. / parm.parameters()[Trk::qOverP]), 1., Trk::muon));
80
81 Trk::ScatteringAngles newsa {0, 0, sigmascat / std::sin(parm.parameters()[Trk::theta]), sigmascat};
82 Trk::ScatteringAngles newsa2 {0, 0, sigmascat / std::sin(parm.parameters()[Trk::theta]), sigmascat};
83
84 meots.emplace_back(X0inner, newsa, innersurf);
85 meots.emplace_back(
86 0,
87 std::make_unique<Trk::EnergyLoss>(energy.first, energy.second),
88 middlesurf,
90 meots.emplace_back(X0outer, newsa2, outersurf);
91
92 } else {
93 std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> tsosvec = m_calotsos->caloTSOS(ctx, parm);
94 if (tsosvec.size() != 3 && !m_calotsosparam.empty()) { tsosvec = m_calotsosparam->caloTSOS(ctx, parm); }
95 for (const std::unique_ptr<const Trk::TrackStateOnSurface>& c_tsos : tsosvec) {
96 const Trk::MaterialEffectsOnTrack* meot = dynamic_cast<const Trk::MaterialEffectsOnTrack*>(c_tsos->materialEffectsOnTrack());
97 if (!meot) continue;
98 double sintheta = std::sin(c_tsos->trackParameters()->parameters()[Trk::theta]);
99 double qoverp = c_tsos->trackParameters()->parameters()[Trk::qOverP];
100 const CaloEnergy* eloss = meot ? dynamic_cast<const CaloEnergy*>(meot->energyLoss()) : nullptr;
101
102 std::unique_ptr<Trk::EnergyLoss> neweloss = nullptr;
103 std::optional<Trk::ScatteringAngles> newsa = std::nullopt;
104 if (eloss)
105 neweloss = std::make_unique<CaloEnergy>(*eloss);
106 else {
107 Trk::MaterialProperties matprop(meot->thicknessInX0(), 1., 0., 0., 0., 0.);
108 double sigmascat = std::sqrt(m_scattool->sigmaSquare(matprop, std::abs(1. / qoverp), 1., Trk::muon));
109 newsa = Trk::ScatteringAngles(0, 0, sigmascat / sintheta, sigmascat);
110 }
111 meots.emplace_back(meot->thicknessInX0(), newsa, std::move(neweloss), c_tsos->trackParameters()->associatedSurface());
112 }
113 }
114 if (meots.size() < 3) meots.clear();
115 return meots;
116}
#define ATH_MSG_DEBUG(x)
ToolHandle< Rec::IMuidCaloTrackStateOnSurface > m_calotsos
ToolHandle< Trk::IMultipleScatteringUpdator > m_scattool
ToolHandle< Rec::IMuidCaloTrackStateOnSurface > m_calotsosparam
@ EnergyLossEffects
contains energy loss corrections
double thicknessInX0() const
returns the actually traversed material .
const EnergyLoss * energyLoss() const
returns the energy loss object.
Eigen::Matrix< double, 3, 1 > Vector3D
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67

◆ finalize()

StatusCode MuidMaterialEffectsOnTrackProvider::finalize ( )

AlgTool finalize method.

Definition at line 56 of file MuidMaterialEffectsOnTrackProvider.cxx.

56 {
57 ATH_MSG_DEBUG(name() << " finalize() successful");
58 return StatusCode::SUCCESS;
59}

◆ initialize()

StatusCode MuidMaterialEffectsOnTrackProvider::initialize ( )

AlgTool initailize method.

Definition at line 40 of file MuidMaterialEffectsOnTrackProvider.cxx.

40 {
41 if (!m_cosmics) {
42 ATH_CHECK(m_calotsos.retrieve());
43 ATH_MSG_INFO("Retrieved tool " << m_calotsos.name());
44
45 if (!m_calotsosparam.empty()) {
46 ATH_CHECK(m_calotsosparam.retrieve());
47 ATH_MSG_INFO("Retrieved tool " << m_calotsosparam.name());
48 }
49
50 ATH_CHECK(m_scattool.retrieve());
51 }
52 return StatusCode::SUCCESS;
53}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ validationAction()

virtual void Trk::IMaterialEffectsOnTrackProvider::validationAction ( ) const
inlinevirtualinherited

Definition at line 61 of file IMaterialEffectsOnTrackProvider.h.

61{}

Member Data Documentation

◆ m_calotsos

ToolHandle<Rec::IMuidCaloTrackStateOnSurface> Rec::MuidMaterialEffectsOnTrackProvider::m_calotsos
private
Initial value:
{
this,
"TSOSTool",
"Rec::MuidCaloTrackStateOnSurface/MuidCaloTrackStateOnSurface",
}

Definition at line 51 of file MuidMaterialEffectsOnTrackProvider.h.

51 {
52 this,
53 "TSOSTool",
54 "Rec::MuidCaloTrackStateOnSurface/MuidCaloTrackStateOnSurface",
55 };

◆ m_calotsosparam

ToolHandle<Rec::IMuidCaloTrackStateOnSurface> Rec::MuidMaterialEffectsOnTrackProvider::m_calotsosparam
private
Initial value:
{
this,
"TSOSToolParam",
"",
}

Definition at line 56 of file MuidMaterialEffectsOnTrackProvider.h.

56 {
57 this,
58 "TSOSToolParam",
59 "",
60 };

◆ m_cosmics

bool Rec::MuidMaterialEffectsOnTrackProvider::m_cosmics
private

Definition at line 67 of file MuidMaterialEffectsOnTrackProvider.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_scattool

ToolHandle<Trk::IMultipleScatteringUpdator> Rec::MuidMaterialEffectsOnTrackProvider::m_scattool
private
Initial value:
{
this,
"MultipleScatteringTool",
"Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator",
}

Definition at line 61 of file MuidMaterialEffectsOnTrackProvider.h.

61 {
62 this,
63 "MultipleScatteringTool",
64 "Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator",
65 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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