ATLAS Offline Software
Loading...
Searching...
No Matches
iFatras::SimHitCreatorID Class Reference

Standard ATLAS hit creator for the Inner Detector, uses the ID helper to call the appropriate HitCreator. More...

#include <SimHitCreatorID.h>

Inheritance diagram for iFatras::SimHitCreatorID:
Collaboration diagram for iFatras::SimHitCreatorID:

Public Member Functions

 SimHitCreatorID (const std::string &, const std::string &, const IInterface *)
 Constructor.
 ~SimHitCreatorID ()
 Destructor.
StatusCode initialize ()
 AlgTool initailize method.
void createHits (const ISF::ISFParticle &isp, const std::vector< Trk::HitInfo > &hits) const
 Loop over the hits and call the hit creator, provide the ISF::StackParticle to register the hits.

Private Attributes

PublicToolHandle< iFatras::IHitCreatorm_pixelHitCreator {this, "PixelHitCreator", ""}
 Cluster creator AlgTool.
PublicToolHandle< iFatras::IHitCreatorm_sctHitCreator {this, "SctHitCreator", ""}
PublicToolHandle< iFatras::IHitCreatorm_trtHitCreator {this, "TrtHitCreator", ""}
std::string m_idHelperName {"AtlasID"}
 Used to find out the sub-det from.
const AtlasDetectorIDm_idHelper {}

Detailed Description

Standard ATLAS hit creator for the Inner Detector, uses the ID helper to call the appropriate HitCreator.

Author
sarka.nosp@m..tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch

Definition at line 37 of file SimHitCreatorID.h.

Constructor & Destructor Documentation

◆ SimHitCreatorID()

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

Constructor.

Definition at line 37 of file SimHitCreatorID.cxx.

38 : base_class(t,n,p)
39{
40}

◆ ~SimHitCreatorID()

iFatras::SimHitCreatorID::~SimHitCreatorID ( )

Destructor.

Definition at line 46 of file SimHitCreatorID.cxx.

47{}

Member Function Documentation

◆ createHits()

void iFatras::SimHitCreatorID::createHits ( const ISF::ISFParticle & isp,
const std::vector< Trk::HitInfo > & hits ) const

Loop over the hits and call the hit creator, provide the ISF::StackParticle to register the hits.

Definition at line 66 of file SimHitCreatorID.cxx.

66 {
67 // iterate and assign as well the layer
68 std::vector<Trk::HitInfo>::const_iterator plIter = hitVector.begin();
69 std::vector<Trk::HitInfo>::const_iterator plIterEnd = hitVector.end();
70 size_t nHits = 0;
71 for ( ; plIter != plIterEnd; ++plIter ){
72 // decide which HitCreator to take
73 // get the informations from the Simulation
74 const Trk::TrackParameters* hitParameter = (*plIter).trackParms.get();
75 double time = (*plIter).time;
76 // -------------------------------------------------------------------------
77 const Trk::TrkDetElementBase* hitDetElement = hitParameter->associatedSurface().associatedDetectorElement();
78
79 // initialize an unvalid one
80 Identifier hitId = hitDetElement ? hitDetElement->identify() : Identifier();
81 if (m_idHelper->is_pixel(hitId)) {
82 // -----------------------------------------------------------------------
83 // HIT in Pixel Detector
84 // -----------------------------------------------------------------------
85 ATH_MSG_VERBOSE( "[ sim ] Creating Pixel Cluster" );
86 m_pixelHitCreator->createSimHit(isp,*hitParameter,time); ++nHits;
87 }
88 else if (m_idHelper->is_sct(hitId)) {
89 // -----------------------------------------------------------------------
90 // HIT in SCT Detector
91 // -----------------------------------------------------------------------
92 ATH_MSG_VERBOSE( "[ sim ] Creating SCT Cluster" );
93 m_sctHitCreator->createSimHit(isp,*hitParameter,time); ++nHits;
94 }
95 else if (m_idHelper->is_trt(hitId)) {
96 // -----------------------------------------------------------------------
97 // HIT in TRT Detector
98 // -----------------------------------------------------------------------
99 ATH_MSG_VERBOSE( "[ sim ] Creating TRT DriftCircle" );
100 m_trtHitCreator->createSimHit(isp,*hitParameter,time); ++nHits;
101 }
102 }
103 ATH_MSG_VERBOSE( "[ idtrack ] **** done, " << nHits << " hits created from this track." );
104}
#define ATH_MSG_VERBOSE(x)
std::vector< FPGATrackSimHit > hitVector
static const uint32_t nHits
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
virtual Identifier identify() const =0
Identifier.
PublicToolHandle< iFatras::IHitCreator > m_pixelHitCreator
Cluster creator AlgTool.
const AtlasDetectorID * m_idHelper
PublicToolHandle< iFatras::IHitCreator > m_sctHitCreator
PublicToolHandle< iFatras::IHitCreator > m_trtHitCreator
time(flags, cells_name, *args, **kw)
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ initialize()

StatusCode iFatras::SimHitCreatorID::initialize ( )

AlgTool initailize method.

Definition at line 53 of file SimHitCreatorID.cxx.

54{
55 ATH_MSG_VERBOSE( "[ idhit ] initialize()" );
56 // Get Pixel / SCT / TRT hit creator tools
57 ATH_CHECK ( m_pixelHitCreator.retrieve( DisableTool(m_pixelHitCreator.empty()) ) );
58 ATH_CHECK ( m_sctHitCreator.retrieve( DisableTool(m_sctHitCreator.empty()) ) );
59 ATH_CHECK ( m_trtHitCreator.retrieve( DisableTool(m_trtHitCreator.empty()) ) );
60 // Get ID Helper from detector store
62 return StatusCode::SUCCESS;
63}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::string m_idHelperName
Used to find out the sub-det from.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

Member Data Documentation

◆ m_idHelper

const AtlasDetectorID* iFatras::SimHitCreatorID::m_idHelper {}
private

Definition at line 61 of file SimHitCreatorID.h.

61{};

◆ m_idHelperName

std::string iFatras::SimHitCreatorID::m_idHelperName {"AtlasID"}
private

Used to find out the sub-det from.

Definition at line 60 of file SimHitCreatorID.h.

60{"AtlasID"};

◆ m_pixelHitCreator

PublicToolHandle<iFatras::IHitCreator> iFatras::SimHitCreatorID::m_pixelHitCreator {this, "PixelHitCreator", ""}
private

Cluster creator AlgTool.

Definition at line 56 of file SimHitCreatorID.h.

56{this, "PixelHitCreator", ""};

◆ m_sctHitCreator

PublicToolHandle<iFatras::IHitCreator> iFatras::SimHitCreatorID::m_sctHitCreator {this, "SctHitCreator", ""}
private

Definition at line 57 of file SimHitCreatorID.h.

57{this, "SctHitCreator", ""};

◆ m_trtHitCreator

PublicToolHandle<iFatras::IHitCreator> iFatras::SimHitCreatorID::m_trtHitCreator {this, "TrtHitCreator", ""}
private

Definition at line 58 of file SimHitCreatorID.h.

58{this, "TrtHitCreator", ""};

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