![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include <CLHEP/Random/RandGaussZiggurat.h>
20 #include <GaudiKernel/SystemOfUnits.h>
23 ISvcLocator* pSvcLocator):
36 return StatusCode::SUCCESS;
43 CLHEP::HepRandomEngine* rndEngine)
const {
53 if(channelNumber==-1){
59 const Identifier stripId = id_helper.channelID(hitId,
60 id_helper.multilayer(hitId),
61 id_helper.gasGap(hitId),
62 sTgcIdHelper::sTgcChannelTypes::Strip,
67 <<
" channel " << channelNumber <<
" lHitPos " <<
Amg::toString(lHitPos));
71 errorCalibInput.
stripId= stripId;
73 errorCalibInput.clusterAuthor = 3;
76 double uncert = errorCalibDB->clusterUncertainty(errorCalibInput);
83 const double newLocalX = CLHEP::RandGaussZiggurat::shoot(rndEngine, lHitPos.x(), uncert);
95 CLHEP::HepRandomEngine* rndEngine)
const {
102 sTgcIdHelper::sTgcChannelTypes::Strip, 0)};
105 sTgcIdHelper::sTgcChannelTypes::Wire, 0)};
113 int channelNumber = design.
stripNumber(lHitPos.block<2,1>(0,0));
114 if(channelNumber==-1){
119 const Identifier wireId = id_helper.channelID(hitId,
120 id_helper.multilayer(hitId),
121 id_helper.gasGap(hitId),
122 sTgcIdHelper::sTgcChannelTypes::Wire,
127 <<
" channel " << channelNumber <<
" lHitPos " <<
Amg::toString(lHitPos));
130 const double wireUncert = design.numWiresInGroup(channelNumber) * design.stripPitch() / std::sqrt(12);
131 const double newLocalX = CLHEP::RandGaussZiggurat::shoot(rndEngine, lHitPos.x(), wireUncert);
153 sTgcIdHelper::sTgcChannelTypes::Strip, 0)};
156 sTgcIdHelper::sTgcChannelTypes::Pad, 0)};
181 if (!simHitContainer.isPresent()){
183 return StatusCode::FAILURE;
187 if (!errorCalibDB.isValid()) {
189 return StatusCode::FAILURE;
193 ATH_CHECK(stripContainer.record(std::make_unique<xAOD::sTgcStripContainer>(),
194 std::make_unique<xAOD::sTgcStripAuxContainer>()));
197 ATH_CHECK(wireContainer.record(std::make_unique<xAOD::sTgcWireContainer>(),
198 std::make_unique<xAOD::sTgcWireAuxContainer>()));
201 ATH_CHECK(padContainer.record(std::make_unique<xAOD::sTgcPadContainer>(),
202 std::make_unique<xAOD::sTgcPadAuxContainer>()));
210 if(std::abs(simHit->pdgId())!=13)
continue;
217 return StatusCode::SUCCESS;
223 rngWrapper->
setSeed(rngName, ctx);
def retrieve(aClass, aKey=None)
Gaudi::Property< std::string > m_streamName
void setReadoutElement(const MuonGMR4::sTgcReadoutElement *readoutEle)
set the pointer to the sTgcReadoutElement
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
virtual int stripNumber(const Amg::Vector2D &pos) const
Calculates the number of the strip whose center is closest to the given point.
SG::ReadCondHandleKey< NswErrorCalibData > m_uncertCalibKey
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
SG::WriteHandleKey< xAOD::sTgcWireContainer > m_writeKeyWire
xAODSimHitTosTGCMeasCnvAlg(const std::string &name, ISvcLocator *pSvcLocator)
Eigen::Matrix< double, 2, 1 > Vector2D
const StripDesign & stripDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...
void digitizeWire(const EventContext &ctx, const xAOD::MuonSimHit &simHit, xAOD::sTgcWireContainer &wireContainer, CLHEP::HepRandomEngine *rndEngine) const
void digitizePad(const EventContext &ctx, const xAOD::MuonSimHit &simHit, xAOD::sTgcPadContainer &padContainer) const
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
const MuonGMR4::MuonDetectorManager * m_DetMgr
Access to the new readout geometry.
#define ATH_MSG_VERBOSE(x)
#define AmgSymMatrix(dim)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
StatusCode initialize() override
SG::WriteHandleKey< xAOD::sTgcPadContainer > m_writeKeyPad
const WireGroupDesign & wireDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
Handle class for recording to StoreGate.
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
static IdentifierHash createHash(const unsigned int gasGap, const unsigned int channelType, const unsigned int channel, const unsigned int wireInGrp=0)
Create a measurement hash from the Identifier fields.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< xAOD::MuonSimHitContainer > m_readKey
Eigen::Affine3d Transform3D
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
IdentifierHash identHash() const
Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class...
StatusCode execute(const EventContext &ctx) const override
ServiceHandle< IAthRNGSvc > m_rndmSvc
CLHEP::HepRandomEngine * getRandomEngine(const EventContext &ctx) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
void setChannelNumber(uint16_t channel)
Set the channel number of the measurement.
int stripNumber(const Amg::Vector2D &pos) const override
Calculates the number of the strip whose center is closest to the given point.
SG::WriteHandleKey< xAOD::sTgcStripContainer > m_writeKeyStrip
A wrapper class for event-slot-local random engines.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
void digitizeStrip(const EventContext &ctx, const xAOD::MuonSimHit &simHit, xAOD::sTgcStripContainer &stripContainer, CLHEP::HepRandomEngine *rndEngine) const
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
value_type get_compact(void) const
Get the compact id.
#define ATH_MSG_WARNING(x)
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Eigen::Matrix< float, N, N > MeasMatrix
void setGasGap(uint8_t gap)
Set the associated gas gap of the measurement.
Handle class for reading from StoreGate.