ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_Fatras
ISF_FatrasToolsID
src
SimHitCreatorID.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// class header
6
#include "
SimHitCreatorID.h
"
7
8
// iFatras && ISF
9
#include "
ISF_Event/ISFParticle.h
"
10
// Tracking
11
#include "
TrkDetElementBase/TrkDetElementBase.h
"
12
#include "
TrkEventPrimitives/FitQualityOnSurface.h
"
13
#include "
TrkEventPrimitives/FitQuality.h
"
14
#include "
TrkTrack/TrackStateOnSurface.h
"
15
#include "
TrkTrack/Track.h
"
16
#include "
TrkTrack/TrackInfo.h
"
17
#include "
TrkMeasurementBase/MeasurementBase.h
"
18
#include "
TrkRIO_OnTrack/RIO_OnTrack.h
"
19
//CLHEP
20
#include "CLHEP/Units/SystemOfUnits.h"
21
#include "CLHEP/Random/RandFlat.h"
22
#include "CLHEP/Random/RandGauss.h"
23
// Core
24
#include "
StoreGate/StoreGateSvc.h
"
25
#include "
AtlasDetDescr/AtlasDetectorID.h
"
26
#include "
IdDictDetDescr/IdDictManager.h
"
27
// STL
28
#include <iomanip>
29
#include <sstream>
30
#include <iostream>
31
#include <math.h>
32
33
/*=========================================================================
34
* DESCRIPTION OF FUNCTION:
35
* ==> see headerfile
36
*=======================================================================*/
37
iFatras::SimHitCreatorID::SimHitCreatorID
(
const
std::string& t,
const
std::string& n,
const
IInterface* p)
38
: base_class(t,n,p)
39
{
40
}
41
42
/*=========================================================================
43
* DESCRIPTION OF FUNCTION:
44
* ==> see headerfile
45
*=======================================================================*/
46
iFatras::SimHitCreatorID::~SimHitCreatorID
()
47
{}
48
49
/*=========================================================================
50
* DESCRIPTION OF FUNCTION:
51
* ==> see headerfile
52
*=======================================================================*/
53
StatusCode
iFatras::SimHitCreatorID::initialize
()
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
61
ATH_CHECK
( detStore()->retrieve(
m_idHelper
,
m_idHelperName
) );
62
return
StatusCode::SUCCESS;
63
}
64
65
//================ SimHit Creation Interface =====================================
66
void
iFatras::SimHitCreatorID::createHits
(
const
ISF::ISFParticle
& isp,
const
std::vector<Trk::HitInfo>&
hitVector
)
const
{
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
}
105
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
hitVector
std::vector< FPGATrackSimHit > hitVector
Definition
FPGATrackSimCluster.h:22
FitQualityOnSurface.h
FitQuality.h
ISFParticle.h
IdDictManager.h
MeasurementBase.h
nHits
static const uint32_t nHits
Definition
PixelByteStreamModuleMask.h:55
RIO_OnTrack.h
SimHitCreatorID.h
StoreGateSvc.h
TrackStateOnSurface.h
TrackInfo.h
Track.h
TrkDetElementBase.h
ISF::ISFParticle
The generic ISF particle definition,.
Definition
ISFParticle.h:42
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
Trk::TrkDetElementBase
This is the base class for all tracking detector elements with read-out relevant information.
Definition
TrkDetElementBase.h:52
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
iFatras::SimHitCreatorID::initialize
StatusCode initialize()
AlgTool initailize method.
Definition
SimHitCreatorID.cxx:53
iFatras::SimHitCreatorID::SimHitCreatorID
SimHitCreatorID(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition
SimHitCreatorID.cxx:37
iFatras::SimHitCreatorID::~SimHitCreatorID
~SimHitCreatorID()
Destructor.
Definition
SimHitCreatorID.cxx:46
iFatras::SimHitCreatorID::createHits
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.
Definition
SimHitCreatorID.cxx:66
iFatras::SimHitCreatorID::m_idHelperName
std::string m_idHelperName
Used to find out the sub-det from.
Definition
SimHitCreatorID.h:60
iFatras::SimHitCreatorID::m_pixelHitCreator
PublicToolHandle< iFatras::IHitCreator > m_pixelHitCreator
Cluster creator AlgTool.
Definition
SimHitCreatorID.h:56
iFatras::SimHitCreatorID::m_idHelper
const AtlasDetectorID * m_idHelper
Definition
SimHitCreatorID.h:61
iFatras::SimHitCreatorID::m_sctHitCreator
PublicToolHandle< iFatras::IHitCreator > m_sctHitCreator
Definition
SimHitCreatorID.h:57
iFatras::SimHitCreatorID::m_trtHitCreator
PublicToolHandle< iFatras::IHitCreator > m_trtHitCreator
Definition
SimHitCreatorID.h:58
Identifier
Definition
IdentifierFieldParser.cxx:14
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
Generated on
for ATLAS Offline Software by
1.17.0