Skip to content
Snippets Groups Projects
Commit b57e29b6 authored by Maximilian Emanuel Goblirsch-Kolb's avatar Maximilian Emanuel Goblirsch-Kolb
Browse files

add chamber-level coordinates to RPC PRD

parent 7997a647
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ RpcStripAuxContainer_v1::RpcStripAuxContainer_v1()
PRD_AUXVARIABLE(triggerInfo);
PRD_AUXVARIABLE(ambiguityFlag);
PRD_AUXVARIABLE(timeOverThreshold);
PRD_AUXVARIABLE(stripPosInStation);
PRD_AUXVARIABLE(stripNumber);
PRD_AUXVARIABLE(gasGap);
......@@ -33,4 +34,4 @@ RpcStripAuxContainer_v1::RpcStripAuxContainer_v1()
}
} // namespace xAOD
#undef PRD_AUXVARIABLE
\ No newline at end of file
#undef PRD_AUXVARIABLE
......@@ -14,6 +14,7 @@
namespace {
static const std::string preFixStr{"Rpc_"};
static const xAOD::PosAccessor<3> accStripPos{preFixStr + "stripPosInStation"};
}
namespace xAOD {
......@@ -33,6 +34,13 @@ IdentifierHash RpcStrip_v1::measurementHash() const {
doubletPhi(),
measuresPhi());
}
void RpcStrip_v1::setStripPosInStation(const MeasVector<3>& pos){
VectorMap<3> v{accStripPos(*this).data()};
v = pos;
}
ConstVectorMap<3> RpcStrip_v1::stripPosInStation() const {
return ConstVectorMap<3>{accStripPos(*this).data()};
}
} // namespace xAOD
#undef IMPLEMENT_SETTER_GETTER
......
......@@ -30,6 +30,7 @@ class RpcStripAuxContainer_v1 : public AuxContainerBase {
std::vector<uint32_t> triggerInfo{}; // FIXME - how big do we need this to be?
std::vector<uint8_t> ambiguityFlag{};
std::vector<float> timeOverThreshold{};
std::vector<PosAccessor<3>::element_type> stripPosInStation{};
std::vector<uint16_t> stripNumber{};
std::vector<uint8_t> gasGap{};
......
......@@ -76,6 +76,14 @@ class RpcStrip_v1 : public UncalibratedMeasurement_v1 {
Exceptions are thrown if that fails as well */
const MuonGMR4::RpcReadoutElement* readoutElement() const;
/** @brief Returns the local position of the strip within
* the Muon Station (I.e. the center plane between 2 multilayers)
*/
ConstVectorMap<3> stripPosInStation() const;
/** @brief Sets the position of the strip within a muon station*/
void setStripPosInStation(const MeasVector<3>& pos);
private:
#ifdef __CLING__
/// Down cast the memory of the readoutElement cache if the object is stored to disk
......@@ -91,4 +99,4 @@ class RpcStrip_v1 : public UncalibratedMeasurement_v1 {
#include "AthContainers/DataVector.h"
DATAVECTOR_BASE(xAOD::RpcStrip_v1, xAOD::UncalibratedMeasurement_v1);
#endif
\ No newline at end of file
#endif
......@@ -63,7 +63,7 @@ StatusCode xAODSimHitToRpcMeasCnvAlg::execute(const EventContext& ctx) const {
const unsigned int etaStripNum = etaDesign.stripNumber(smearedEtaPos.block<2,1>(0,0));
ATH_MSG_ALWAYS("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at "
ATH_MSG_VERBOSE("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at "
<<Amg::toString(locSimHitPos, 2)<<" eta strip number: "<<etaStripNum
<<" strip position "<<Amg::toString(etaDesign.center(etaStripNum).value_or(Amg::Vector2D::Zero()), 2));
......@@ -93,6 +93,9 @@ StatusCode xAODSimHitToRpcMeasCnvAlg::execute(const EventContext& ctx) const {
prd->setReadoutElement(readOutEle);
prd->setTime(hitTime);
prd->setAmbiguityFlag(0);
Amg::Vector3D strip3D {smearedEtaPos.x(), 0.,0.};
auto globToCenter = m_surfaceProvTool->globalToChambCenter(gctx,etaHitId);
prd->setStripPosInStation(xAOD::toStorage(globToCenter * readOutEle->localToGlobalTrans(gctx,readOutEle->layerHash(prd->measurementHash())) * strip3D));
}
/// Check whether the read out element contains phi strips or not.
if (!readOutEle->nPhiStrips()) {
......@@ -129,6 +132,9 @@ StatusCode xAODSimHitToRpcMeasCnvAlg::execute(const EventContext& ctx) const {
prd->setReadoutElement(readOutEle);
prd->setTime(hitTime);
prd->setAmbiguityFlag(0);
Amg::Vector3D strip3D {smearedPhiPos.x(), 0.,0.};
auto globToCenter = m_surfaceProvTool->globalToChambCenter(gctx,phiHitId);
prd->setStripPosInStation(xAOD::toStorage(globToCenter * readOutEle->localToGlobalTrans(gctx,readOutEle->layerHash(prd->measurementHash())) * strip3D));
}
return StatusCode::SUCCESS;
}
......
......@@ -55,7 +55,7 @@ StatusCode xAODSimHitToTgcMeasCnvAlg::execute(const EventContext& ctx) const {
const Amg::Vector2D smearedEtaPos{CLHEP::RandGaussZiggurat::shoot(rndEngine, locSimHitPos.x(), etaUncert), 0.};
const unsigned int etaStripNum = etaDesign.stripNumber(smearedEtaPos.block<2,1>(0,0));
ATH_MSG_ALWAYS("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at "
ATH_MSG_VERBOSE("Convert simulated hit "<<m_idHelperSvc->toStringGasGap(hitId)<<" located in gas gap at "
<<Amg::toString(locSimHitPos, 2)<<" eta strip number: "<<etaStripNum
<<" strip position "<<Amg::toString(etaDesign.center(etaStripNum).value_or(Amg::Vector2D::Zero()), 2));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment