|
ATLAS Offline Software
|
Go to the documentation of this file.
18 if (!mmContainer.isValid()) {
23 if (!MuonDetMgr) {
return false; }
24 unsigned int n_hits{0};
27 if (!mmContainer->size())
ATH_MSG_DEBUG(
"MM Sim container is empty");
28 for (
const MMSimHit& hit : *mmContainer) {
29 int simId = hit.MMId();
31 if(hit.depositEnergy()==0.)
continue;
34 int barcode = hit.particleLink().barcode();
56 ATH_MSG_ERROR(
"MicroMegas validation: unexpected phi range " << stphi);
61 side == 1 ? steta+1 : -steta-1,
62 (stphi-1)/2+1,multilayer,
layer,1 );
80 int isSmall = stname[2] ==
'S';
81 ATH_MSG_DEBUG(
"MicroMegas geometry, retrieving detector element for: isSmall " << isSmall <<
" eta " <<
idHelperSvc()->mmIdHelper().stationEta(offId)
82 <<
" phi " <<
idHelperSvc()->mmIdHelper().stationPhi(offId) <<
" ml " <<
idHelperSvc()->mmIdHelper().multilayer(offId) );
86 ATH_MSG_ERROR(
"MMSimHitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "<<
idHelperSvc()->mmIdHelper().print_to_string(offId).c_str());
94 Amg::Vector3D hpos(hit.globalPosition().x(),hit.globalPosition().y(),hit.globalPosition().z());
100 Amg::Vector2D posOnSurfUnProjected(rSurface_pos.x(),rSurface_pos.y());
104 ldir = surf.
transform().inverse().linear()*
Amg::Vector3D(hit.globalDirection().x(), hit.globalDirection().y(), hit.globalDirection().z());
106 double scale, scaletop;
109 scale = -rSurface_pos.z()/ldir.z();
110 scaletop = (gasgap+rSurface_pos.z())/ldir.z();
113 Amg::Vector3D hitOnTopSurface = rSurface_pos + scaletop*ldir;
114 Amg::Vector2D posOnSurf (hitOnSurface.x(), hitOnSurface.y());
115 Amg::Vector2D posOnTopSurf (hitOnTopSurface.x(),hitOnTopSurface.y());
118 int stripNumber = detEl->
stripNumber(posOnSurf,offId);
123 if( stripNumber == -1 ){
124 ATH_MSG_WARNING(
"MicroMegas validation: failed to obtain strip number " <<
idHelperSvc()->mmIdHelper().print_to_string(offId) );
132 ATH_MSG_WARNING(
"MicroMegas validation: MM id has bad layer field(2)! " << std::endl <<
" " <<
idHelperSvc()->mmIdHelper().print_to_string(offId) << std::endl
133 <<
" " <<
idHelperSvc()->mmIdHelper().print_to_string(oldId) <<
" stripN " << stripNumber );
138 ATH_MSG_WARNING(
"MicroMegas validation: failed to obtain local position for identifier " <<
idHelperSvc()->mmIdHelper().print_to_string(offId) );
142 ATH_MSG_DEBUG(
"Global hit : r " << hit.globalPosition().perp() <<
", phi " << hit.globalPosition().phi() <<
", z " << hit.globalPosition().z()
143 <<
"; detEl: r " << detpos.perp() <<
", phi " << detpos.phi() <<
", z " << detpos.z()
144 <<
"; surf z " << surf.
center().z() <<
", ml " << multilayer <<
", l " <<
layer );
145 ATH_MSG_DEBUG(
" detEl: x " << dSurface_pos.x() <<
" y " << dSurface_pos.y() <<
" z " << dSurface_pos.z());
146 ATH_MSG_DEBUG(
"MM Fast digit: x " << fastDigitPos.x() <<
" y " << fastDigitPos.y()
147 <<
", gToL: x " << rSurface_pos.x() <<
" y " << rSurface_pos.y() <<
" z " << rSurface_pos.z() );
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position – local or global If the strip number is outside the range of valid strips,...
int GetSide(const int &hid) const
std::string GetStationName(const int &hid) const
int GetMultiLayer(const int &hid) const
const Amg::Transform3D & absTransform() const
ThreeVectorBranch m_NSWMM_hitGlobalPosition
bool insideActiveBounds(const Identifier &id, const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const
boundary check Wrapper Trk::PlaneSurface::insideBounds() taking into account the passivated width
ThreeVectorBranch m_NSWMM_detector_globalPosition
ScalarBranch< unsigned int > & m_NSWMM_nSimHits
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Eigen::Matrix< double, 2, 1 > Vector2D
VectorBranch< float > & m_NSWMM_FastDigitRsurfacePositionX
MMSimHitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
VectorBranch< float > & m_NSWMM_globalTime
bool declare_keys() override final
void push_back(const Identifier &id) override final
int GetZSector(const int &hid) const
int GetLayer(const int &hid) const
const Amg::Vector3D & center() const
Returns the center position of the Surface.
virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper
VectorBranch< int > & m_NSWMM_particleEncoding
ThreeVectorBranch m_NSWMM_hitToRsurfacePosition
VectorBranch< float > & m_NSWMM_kineticEnergy
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
ThreeVectorBranch m_NSWMM_hitToDsurfacePosition
Eigen::Affine3d Transform3D
MmIdentifierBranch m_NSWMM_Id
VectorBranch< float > & m_NSWMM_FastDigitRsurfacePositionY
const Amg::Vector3D globalPosition() const
void push_back(const T &value)
Adds a new element at the end of the vector.
VectorBranch< int > & m_NSWMM_trackId
int GetPhiSector(const int &hid) const
VectorBranch< bool > & m_NSWMM_isInsideBounds
ThreeVectorBranch m_NSWMM_hitGlobalDirection
Eigen::Matrix< double, 3, 1 > Vector3D
static const MicromegasHitIdHelper * GetHelper()
SG::ReadHandleKey< MMSimHitCollection > m_key
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
virtual int stripNumber(const Amg::Vector2D &pos, const Identifier &id) const override final
strip number corresponding to local position.
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const Muon::IMuonIdHelperSvc * idHelperSvc() const
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
VectorBranch< float > & m_NSWMM_depositEnergy