Skip to content
Snippets Groups Projects
Commit 2a842b55 authored by Stefano Rosati's avatar Stefano Rosati
Browse files

updating MM RIO on traack creator for stereo clusters

parent 3b62af9d
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!39435SWEEP of Fixes in NSW segment finding and in treatment of MM stereo clusters (Sweep of MR !38871, !39241 and !39423)
...@@ -27,64 +27,67 @@ StatusCode Muon::MMClusterOnTrackCreator::initialize() { ...@@ -27,64 +27,67 @@ StatusCode Muon::MMClusterOnTrackCreator::initialize() {
const Muon::MuonClusterOnTrack* Muon::MMClusterOnTrackCreator::createRIO_OnTrack(const Trk::PrepRawData& RIO, const Muon::MuonClusterOnTrack* Muon::MMClusterOnTrackCreator::createRIO_OnTrack(const Trk::PrepRawData& RIO,
const Amg::Vector3D& GP) const { const Amg::Vector3D& GP) const {
MuonClusterOnTrack* MClT = nullptr;
MuonClusterOnTrack* MClT = nullptr;
// check whether PrepRawData has detector element, if not there print warning
const Trk::TrkDetElementBase* EL = RIO.detectorElement(); if ( !m_idHelperSvc->isMM(RIO.identify()) ) {
if ( !EL ) { ATH_MSG_ERROR("MMClusterOnTrackCreator called with an non MM identifier");
ATH_MSG_WARNING("RIO does not have associated detectorElement!, cannot produce ROT");
return nullptr;
}
// MuClusterOnTrack production
//
// in RIO_OnTrack the local param and cov should have the same dimension
Trk::LocalParameters locpar(RIO.localPosition());
if (RIO.localCovariance().cols() != RIO.localCovariance().rows()) {
ATH_MSG_FATAL("Rows and colums not equal!");
}
if (RIO.localCovariance().cols() > 1) {
ATH_MSG_VERBOSE("Making 2-dim local parameters: " << m_idHelperSvc->toString(RIO.identify()));
} else {
Trk::DefinedParameter radiusPar(RIO.localPosition().x(), Trk::locX);
locpar = Trk::LocalParameters(radiusPar);
ATH_MSG_VERBOSE("Making 1-dim local parameters: " << m_idHelperSvc->toString(RIO.identify()));
}
Amg::Vector2D lp;
double positionAlongStrip = 0;
if ( !EL->surface(RIO.identify()).globalToLocal(GP, GP, lp) ) {
Amg::Vector3D lpos = RIO.detectorElement()->surface(RIO.identify()).transform().inverse()*GP;
ATH_MSG_WARNING("Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z());
lp[Trk::locX] = lpos.x();
lp[Trk::locY] = lpos.y();
}
positionAlongStrip = lp[Trk::locY];
Amg::MatrixX loce = RIO.localCovariance();
ATH_MSG_DEBUG("All: new err matrix is " << loce);
if ( m_idHelperSvc->isMM(RIO.identify()) ) {
// cast to MMPrepData
const MMPrepData* MClus = dynamic_cast<const MMPrepData*> (&RIO);
if (!MClus) {
ATH_MSG_WARNING("RIO not of type MMPrepData, cannot create ROT");
return nullptr;
}
ATH_MSG_VERBOSE("generating MMClusterOnTrack in MMClusterBuilder");
MClT = new MMClusterOnTrack(MClus, locpar, loce, positionAlongStrip);
} else {
ATH_MSG_WARNING("MMClusterOnTrackCreator called with an non MM identifier");
}
return MClT; return MClT;
}
// check whether PrepRawData has detector element, if not there print warning
const Trk::TrkDetElementBase* EL = RIO.detectorElement();
if ( !EL ) {
ATH_MSG_WARNING("RIO does not have associated detectorElement!, cannot produce ROT");
return nullptr;
}
// MuClusterOnTrack production
//
// in RIO_OnTrack the local param and cov should have the same dimension
Trk::LocalParameters locpar(RIO.localPosition());
if (RIO.localCovariance().cols() != RIO.localCovariance().rows()) {
ATH_MSG_FATAL("Rows and colums not equal!");
}
if (RIO.localCovariance().cols() > 1) {
ATH_MSG_VERBOSE("Making 2-dim local parameters: " << m_idHelperSvc->toString(RIO.identify()));
} else {
Trk::DefinedParameter radiusPar(RIO.localPosition().x(), Trk::locX);
locpar = Trk::LocalParameters(radiusPar);
ATH_MSG_VERBOSE("Making 1-dim local parameters: " << m_idHelperSvc->toString(RIO.identify()));
}
Amg::Vector2D lp;
double positionAlongStrip = 0;
if ( !EL->surface(RIO.identify()).globalToLocal(GP, GP, lp) ) {
Amg::Vector3D lpos = RIO.detectorElement()->surface(RIO.identify()).transform().inverse()*GP;
ATH_MSG_WARNING("Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z());
lp[Trk::locX] = lpos.x();
lp[Trk::locY] = lpos.y();
}
positionAlongStrip = lp[Trk::locY];
/// correct the local position based on the stereo angle
if ( m_idHelperSvc->mmIdHelper().isStereo(RIO.identify())) {
const MuonGM::MMReadoutElement* mmEL = dynamic_cast<const MuonGM::MMReadoutElement*>(EL);
double sAngle = mmEL->getDesign(RIO.identify())->sAngle;
locpar[Trk::locX] = locpar[Trk::locX]+positionAlongStrip*tan(sAngle);
}
Amg::MatrixX loce = RIO.localCovariance();
ATH_MSG_DEBUG("All: new err matrix is " << loce);
// cast to MMPrepData
const MMPrepData* MClus = dynamic_cast<const MMPrepData*> (&RIO);
ATH_MSG_VERBOSE("generating MMClusterOnTrack in MMClusterBuilder");
MClT = new MMClusterOnTrack(MClus, locpar, loce, positionAlongStrip);
return MClT;
} }
......
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