ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
iFatras::SimHitCreatorID Class Reference

#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. More...
 
 ~SimHitCreatorID ()
 Destructor. More...
 
StatusCode initialize ()
 AlgTool initailize method. More...
 
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. More...
 

Private Attributes

PublicToolHandle< iFatras::IHitCreatorm_pixelHitCreator {this, "PixelHitCreator", ""}
 Cluster creator AlgTool. More...
 
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. More...
 
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 }

◆ 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 }

Member Data Documentation

◆ m_idHelper

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

Definition at line 61 of file SimHitCreatorID.h.

◆ 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.

◆ m_pixelHitCreator

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

Cluster creator AlgTool.

Definition at line 56 of file SimHitCreatorID.h.

◆ m_sctHitCreator

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

Definition at line 57 of file SimHitCreatorID.h.

◆ m_trtHitCreator

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

Definition at line 58 of file SimHitCreatorID.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
iFatras::SimHitCreatorID::m_pixelHitCreator
PublicToolHandle< iFatras::IHitCreator > m_pixelHitCreator
Cluster creator AlgTool.
Definition: SimHitCreatorID.h:56
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
iFatras::SimHitCreatorID::m_idHelperName
std::string m_idHelperName
Used to find out the sub-det from.
Definition: SimHitCreatorID.h:60
AtlasDetectorID::is_sct
bool is_sct(Identifier id) const
Definition: AtlasDetectorID.h:770
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
iFatras::SimHitCreatorID::m_trtHitCreator
PublicToolHandle< iFatras::IHitCreator > m_trtHitCreator
Definition: SimHitCreatorID.h:58
iFatras::SimHitCreatorID::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: SimHitCreatorID.h:61
hitVector
std::vector< FPGATrackSimHit > hitVector
Definition: FPGATrackSimCluster.h:22
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::ParametersBase
Definition: ParametersBase.h:55
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
iFatras::SimHitCreatorID::m_sctHitCreator
PublicToolHandle< iFatras::IHitCreator > m_sctHitCreator
Definition: SimHitCreatorID.h:57
Identifier
Definition: IdentifierFieldParser.cxx:14