|
ATLAS Offline Software
|
#include <TgcSensitiveDetector.h>
Definition at line 17 of file TgcSensitiveDetector.h.
◆ TgcSensitiveDetector()
Constructor.
- Parameters
-
name | Name of the Sensitive detctor / AthMessaging module |
output_key | Key under which the sim hits are written into store gate |
trf_storeKey | Location of the DetctorAlignmentStore holding the transformations per event |
detMgr | Pointer to the run-4 detector manager |
Definition at line 29 of file TgcSensitiveDetector.cxx.
33 G4VSensitiveDetector{
name},
◆ ~TgcSensitiveDetector()
MuonG4R4::TgcSensitiveDetector::~TgcSensitiveDetector |
( |
| ) |
|
|
default |
◆ getIdentifier()
◆ getReadoutElement()
Retrieves the matching readout element to a G4 hit.
The third volume encodes the information of the Tgc detector
We should have a string which kind of looks like av_319_impr_1_MuonR4::LogVolMuonStation_pv_190_T3E_Station2_-2_46 Of interest are only the T1E part and the last 2 numbers
Definition at line 137 of file TgcSensitiveDetector.cxx.
139 const std::string stationVolume = touchHist->GetVolume(2)->GetName();
144 const size_t nTokens{volumeTokens.size()};
146 const std::string
stationName{volumeTokens[nTokens-4].substr(0,3)};
154 return m_detMgr->getTgcReadoutElement(stationId);
◆ Initialize()
void MuonG4R4::TgcSensitiveDetector::Initialize |
( |
G4HCofThisEvent * |
HCE | ) |
|
|
finaloverride |
member functions
Definition at line 41 of file TgcSensitiveDetector.cxx.
46 if (!
m_writeHandle.recordNonConst(std::make_unique<xAOD::MuonSimHitContainer>(),
47 std::make_unique<xAOD::MuonSimHitAuxContainer>()).isSuccess()) {
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ ProcessHits()
G4bool MuonG4R4::TgcSensitiveDetector::ProcessHits |
( |
G4Step * |
aStep, |
|
|
G4TouchableHistory * |
ROhist |
|
) |
| |
|
finaloverride |
Reject secondary particles
The x-axis of the gas gap coordinate system points to the outer big wheel -> extrapolate into the plane X = 0.
Final check that the hit is located at zero
At the very last clear the cache of the readout element
Definition at line 53 of file TgcSensitiveDetector.cxx.
55 G4Track* currentTrack = aStep->GetTrack();
58 if (currentTrack->GetDefinition()->GetPDGCharge() == 0.0) {
59 if (currentTrack->GetDefinition()!= G4Geantino::GeantinoDefinition())
return true;
60 else if (currentTrack->GetDefinition()==G4ChargedGeantino::ChargedGeantinoDefinition())
return true;
65 if (currentTrack->GetVelocity() < velCutOff)
return true;
67 const G4TouchableHistory* touchHist =
static_cast<const G4TouchableHistory*
>(currentTrack->GetTouchable());
76 if (!trfStoreHandle.isValid()) {
80 gctx.setStore(std::make_unique<DetectorAlignStore>(*trfStoreHandle));
84 <<currentTrack->GetTouchable()->GetHistory()->GetTopVolume()->GetName()
92 std::optional<double> travelDist = Amg::intersect<3>(locPos,
locDir, Amg::Vector3D::UnitX(), 0);
102 if (!etaHitID.is_valid()) {
107 const double globalTime = currentTrack->GetGlobalTime() + (*travelDist) / currentTrack->GetVelocity();
113 if (std::abs(locHitPos.z()) >
tolerance) {
115 throw std::runtime_error(
"Picked wrong gas gap");
129 hit->
setMass(currentTrack->GetDefinition()->GetPDGMass());
131 hit->
setPdgId(currentTrack->GetDefinition()->GetPDGEncoding());
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_detMgr
◆ m_gctx
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_trfCacheKey
◆ m_writeHandle
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
constexpr uint8_t stationPhi
station Phi 1 to 8
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the underlying detector manager.
void setIdentifier(const Identifier &id)
Sets the global ATLAS identifier.
SG::WriteHandle< xAOD::MuonSimHitContainer > m_writeHandle
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
void setPdgId(int id)
Sets the pdgID of the traversing particle.
Amg::Transform3D getTransform(const G4VTouchable *history, unsigned int level)
Extracts the local -> global transformation from a TouchableHistory at a given level.
float round(const float toRound, const unsigned int decimals)
SG::ReadHandleKey< ActsTrk::DetectorAlignStore > m_trfCacheKey
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...
virtual std::string toStringDetEl(const Identifier &id) const =0
print all fields up to detector element to string
void setLocalPosition(MeasVector< 3 > vec)
Sets the local position of the traversing particle.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
#define ATH_MSG_VERBOSE(x)
void setGenParticleLink(const HepMcParticleLink &link)
Sets the link to the HepMC particle producing this hit.
#define THROW_EXCEPTION(MSG)
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
void setMass(const float m)
set the rest-mass of the traversing particle
Amg::Vector3D Hep3VectorToEigen(const CLHEP::Hep3Vector &CLHEPvector)
Converts a CLHEP-based CLHEP::Hep3Vector into an Eigen-based Amg::Vector3D.
void setKineticEnergy(const float energy)
Sets the kinetic energy of the traversing particle.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Class to provide easy MsgStream access and capabilities.
double gasGapPitch() const
Returns the thickness of the gasGap.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
MsgStream & msg() const
The standard message stream.
Include the GeoPrimitives which need to be put first.
void setEnergyDeposit(const float deposit)
Sets the energy deposited by the traversing particle inside the gas volume.
Identifier getIdentifier(const ActsGeometryContext &gctx, const MuonGMR4::TgcReadoutElement *readOutEle, const Amg::Vector3D &hitAtGapPlane, bool phiGap) const
void setLocalDirection(MeasVector< 3 > vec)
Sets the local direction of the traversing particle.
Identifier identify() const override final
Return the athena identifier.
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const TgcIdHelper & tgcIdHelper() const =0
access to TgcIdHelper
virtual std::string toString(const Identifier &id) const =0
print all fields to string
void releaseUnAlignedTrfs() const
Releases all cached transforms that are not connected with alignment.
std::string m_nm
Message source name.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
void initMessaging() const
Initialize our message level and MessageSvc.
constexpr uint8_t stationEta
1 to 3
const MuonGMR4::TgcReadoutElement * getReadoutElement(const G4TouchableHistory *touchHist) const
Retrieves the matching readout element to a G4 hit.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Polygon globalToLocal(const Polygon &pol, float z, const Trk::PlaneSurface &surf)
void setGlobalTime(const float time)
Sets the time of the traversing particle.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.