Commit f96a3299 authored by William Axel Leight's avatar William Axel Leight Committed by Vakhtang Tsulaia
Browse files

Remove cached vector of ROTs in MuonSegments since it's superfluous, clients...

Remove cached vector of ROTs in MuonSegments since it's superfluous, clients can use the numberOfContainedROTs and rioOnTrack methods instead.
parent b63971bf
......@@ -330,19 +330,15 @@ namespace MuonCalib {
Identifier MuonSegmentToCalibSegment::getChId( const Muon::MuonSegment& seg ) const
{
const std::vector<const Trk::RIO_OnTrack*>& rots = seg.containedROTs();
if( rots.empty() ) {
if( seg.numberOfContainedROTs()==0 ) {
ATH_MSG_DEBUG( " Oops, segment without hits!!! " );
return Identifier();
}
std::vector<const Trk::RIO_OnTrack*>::const_iterator rit = rots.begin();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rit_end = rots.end();
for( ; rit!=rit_end;++rit ){
for(unsigned int irot=0;irot<seg.numberOfContainedROTs();irot++){
// use pointer to rot
const Trk::RIO_OnTrack* rot = *rit;
const Trk::RIO_OnTrack* rot = seg.rioOnTrack(irot);
if( m_idHelperSvc->mdtIdHelper().is_mdt( rot->identify() ) ){
return rot->identify();
......@@ -352,7 +348,7 @@ namespace MuonCalib {
}
// if we get here the segment did not contain any csc or mdt hits, in which case we return the identifier of the first rot
return rots.front()->identify();
return seg.rioOnTrack(0)->identify();
}
Amg::Transform3D MuonSegmentToCalibSegment::getGlobalToStation( const Identifier& id, const MuonGM::MuonDetectorManager* MuonDetMgr ) const
......
......@@ -431,7 +431,8 @@ StatusCode Muon::MuonTGMeasAssocAlg::storeSegments() {
if (detVols->size() ) detVol = detVols->front();
if (!detVols->size() ) {
ATH_MSG_ERROR( "missing station?" << segment->globalPosition() );
std::vector<const Trk::RIO_OnTrack*> rots = segment->containedROTs();
std::vector<const Trk::RIO_OnTrack*> rots;
for(unsigned int irot=0;irot<segment->numberOfContainedROTs();irot++) rots.push_back(segment->rioOnTrack(irot));
if ( rots.size() > 0 ) {
Identifier id = rots[0]->identify();
Amg::Vector3D pos(0., 0., 0.);
......@@ -475,10 +476,7 @@ StatusCode Muon::MuonTGMeasAssocAlg::storeSegments() {
// new std::vector<const Trk::RIO_OnTrack*>(segment->containedROTs()),
// new Trk::FitQuality( *(segment->fitQuality())) );
DataVector<const Trk::MeasurementBase>* meas= new DataVector<const Trk::MeasurementBase>;
if (segment->containedROTs().size()) {
const std::vector<const Trk::RIO_OnTrack*> rots=segment->containedROTs();
for (unsigned int im=0;im<rots.size();im++) meas->push_back(rots[im]);
}
for(unsigned int irot=0;irot<segment->numberOfContainedROTs();irot++) meas->push_back(segment->rioOnTrack(irot));
Trk::LocalDirection dir;
plane->globalToLocalDirection(layPar->momentum(),dir);
......
......@@ -104,11 +104,6 @@ namespace Muon {
/** number of RIO_OnTracks */
unsigned int numberOfContainedROTs() const;
/** returns the vector of Trk::RIO_OnTrack objects
- specific for this TrackSegment: Trk::RIO_OnTrack (generic)
*/
const std::vector<const Trk::RIO_OnTrack*>& containedROTs() const;
/** returns the RIO_OnTrack (also known as ROT) objects depending on the integer*/
const Trk::RIO_OnTrack* rioOnTrack(unsigned int) const;
......@@ -132,21 +127,11 @@ namespace Muon {
Trk::LocalDirection m_localDirection;
/** The plane surface to which the segment parameters are expressed to */
mutable const Trk::PlaneSurface* m_associatedSurface;
/** The cached vector of contained (generic) Trk::RIO_OnTrack objects.
The pointers are not deleted, since the actual objects belong to the base class */
mutable std::vector<const Trk::RIO_OnTrack*>* m_cachedRots;
/** private method to clear the Trk::RIO_OnTrack vector */
void clearRotVector();
const Trk::PlaneSurface* m_associatedSurface;
/** private method to clear the Trk::MeasurementBase vector */
void clearMeasVector();
/** private method to copy all Trk::RIO_OnTrack pointers in m_cachedRots to m_containedMeasurements */
void copyMeasurementsToROTs() const;
protected:
/**returns some information about this RIO_OnTrack/TrackSegment.
It should be overloaded by any child classes*/
......@@ -180,23 +165,17 @@ namespace Muon {
return new MuonSegment(*this);
}
inline const std::vector<const Trk::RIO_OnTrack*>& MuonSegment::containedROTs() const
{
if (0==m_cachedRots) copyMeasurementsToROTs();
return (*m_cachedRots);
}
inline const Trk::RIO_OnTrack* MuonSegment::rioOnTrack(unsigned int indx) const
{
if (0==m_cachedRots) copyMeasurementsToROTs();
if (indx<numberOfContainedROTs())
return (*m_cachedRots)[indx];
return 0;
if (indx<containedMeasurements().size()){
const Trk::RIO_OnTrack* rot=dynamic_cast<const Trk::RIO_OnTrack*>(containedMeasurements()[indx]);
return rot;
}
else return 0;
}
inline unsigned int MuonSegment::numberOfContainedROTs() const {
if (0==m_cachedRots) copyMeasurementsToROTs();
return m_cachedRots->size();
return containedMeasurements().size();
}
inline void MuonSegment::setT0Error(float t0, float t0Error){
......
......@@ -26,8 +26,7 @@ SpaceTimePointBase(kNoValue,kNoValue,1.),
m_globalPosition( ),
m_globalDirection( ),
m_localDirection( ),
m_associatedSurface( 0 ),
m_cachedRots( 0 )
m_associatedSurface( 0 )
{}
MuonSegment::MuonSegment(const MuonSegment& seg)
......@@ -37,14 +36,10 @@ SpaceTimePointBase(seg),
m_globalPosition( seg.m_globalPosition ),
m_globalDirection( seg.m_globalDirection ),
m_localDirection ( seg.m_localDirection ),
m_associatedSurface( 0 ),
m_cachedRots( 0 )
m_associatedSurface( 0 )
{
m_associatedSurface = (seg.m_associatedSurface->associatedDetectorElement()) ?
seg.m_associatedSurface : seg.m_associatedSurface->clone();
// create vector of contained Rots and fill it
copyMeasurementsToROTs();
}
MuonSegment& MuonSegment::operator=(const MuonSegment& seg)
......@@ -60,9 +55,6 @@ MuonSegment& MuonSegment::operator=(const MuonSegment& seg)
if (0!=m_associatedSurface && 0==m_associatedSurface->associatedDetectorElement()) delete m_associatedSurface;
m_associatedSurface = (seg.m_associatedSurface->associatedDetectorElement()) ?
seg.m_associatedSurface : seg.m_associatedSurface->clone();
// clear rots
clearRotVector();
copyMeasurementsToROTs();
}
return (*this);
}
......@@ -79,12 +71,10 @@ MuonSegment::MuonSegment( const Trk::LocalParameters& locpars,
m_globalPosition(),
m_globalDirection(),
m_localDirection(),
m_associatedSurface( psf ),
m_cachedRots(0)
m_associatedSurface( psf )
{
recalculateCache();
psf->globalToLocalDirection(m_globalDirection,m_localDirection);
copyMeasurementsToROTs();
}
......@@ -101,8 +91,7 @@ MuonSegment::MuonSegment( const Amg::Vector2D& locSegPos,
m_globalPosition( ),
m_globalDirection(),
m_localDirection(locSegDir),
m_associatedSurface( psf ),
m_cachedRots( 0 )
m_associatedSurface( psf )
{
psf->localToGlobalDirection(locSegDir,m_globalDirection);
......@@ -117,20 +106,13 @@ MuonSegment::MuonSegment( const Amg::Vector2D& locSegPos,
pars.push_back( Trk::DefinedParameter( phi, Trk::phi) );
pars.push_back( Trk::DefinedParameter( theta, Trk::theta) );
m_localParams = Trk::LocalParameters( pars );
copyMeasurementsToROTs();
}
MuonSegment::~MuonSegment()
{
if ( 0!=m_associatedSurface && !m_associatedSurface->associatedDetectorElement()) delete m_associatedSurface;
clearRotVector();
}
void MuonSegment::clearRotVector()
{
delete m_cachedRots;
}
void MuonSegment::recalculateCache(){
CxxUtils::sincos scphi(m_localParams[Trk::phi]);
......@@ -147,20 +129,6 @@ void MuonSegment::recalculateCache(){
m_associatedSurface->localToGlobal(lpos, m_globalPosition, m_globalPosition);
}
void MuonSegment::copyMeasurementsToROTs() const
{
if (! hasContainedMeasurements() ) return;
// std::cout<<"copyMeasurementsToROTs :"<<this<<" with measurements: "<<containedMeasurements().size()<<std::endl;
m_cachedRots = new std::vector<const Trk::RIO_OnTrack*>;
m_cachedRots->reserve(containedMeasurements().size());
for (const Trk::MeasurementBase* m : containedMeasurements()) {
// cast to RIO_OnTrack
const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(m);
if( rot ) m_cachedRots->push_back(rot);
}
//std::cout<<"copyMeasurementsToROTs :"<<this<<" with rots: "<<m_cachedRots->size()<<std::endl;
}
MsgStream& MuonSegment::dump( MsgStream& out ) const
{
out << "Muon::MuonSegment " << std::endl;
......@@ -177,10 +145,10 @@ MsgStream& MuonSegment::dump( MsgStream& out ) const
out << " - t0 (error) : "<<time()<<"("<<errorTime()<<")"<<std::endl;
out << " - it contains : " << numberOfContainedROTs() << " RIO_OnTrack object" << std::endl;
unsigned int numRoT=1;
std::vector<const Trk::RIO_OnTrack*>::const_iterator rotIter = m_cachedRots->begin();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rotEnd = m_cachedRots->end();
for (; rotIter!=rotEnd; ++rotIter)
out << "RoT "<<numRoT++<<std::endl<<**rotIter<<std::endl;
for (const Trk::MeasurementBase* m : containedMeasurements()) {
const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(m);
out << "RoT "<<numRoT++<<std::endl<<*rot<<std::endl;
}
return out;
}
......@@ -200,10 +168,10 @@ std::ostream& MuonSegment::dump( std::ostream& out ) const
out << " - t0 (error) : "<<time()<<"("<<errorTime()<<")"<<std::endl;
out << " - it contains : " << numberOfContainedROTs() << " RIO_OnTrack object" << std::endl;
unsigned int numRoT=1;
std::vector<const Trk::RIO_OnTrack*>::const_iterator rotIter = m_cachedRots->begin();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rotEnd = m_cachedRots->end();
for (; rotIter!=rotEnd; ++rotIter)
out << "RoT "<<numRoT++<<std::endl<<**rotIter<<std::endl;
for (const Trk::MeasurementBase* m : containedMeasurements()) {
const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(m);
out << "RoT "<<numRoT++<<std::endl<<*rot<<std::endl;
}
return out;
}
......
......@@ -1032,7 +1032,8 @@ build_segment(const ICscSegmentFinder::Segment& seg, bool measphi, Identifier ch
// Loop over collections in the container.
ICscSegmentFinder::MbaseList* prios_new = new ICscSegmentFinder::MbaseList;
ICscSegmentFinder::TrkClusters fitclus;
const ICscSegmentFinder::RioList& oldrios = pseg_ref->containedROTs();
ICscSegmentFinder::RioList oldrios;
for(unsigned int irot=0;irot<pseg_ref->numberOfContainedROTs();irot++) oldrios.push_back(pseg_ref->rioOnTrack(irot));
int cnt =0;
for ( ICscSegmentFinder::RioList::size_type irio=0; irio<prios->size(); ++irio ) {
......@@ -1848,8 +1849,8 @@ get4dMuonSegmentCombination( const MuonSegmentCombination* insegs ) const {
const MuonSegment& rsg = **irsg;
unsigned int nMinRIOs=3;
if(insegs->use2LayerSegments(1)) nMinRIOs=2;
if ( rsg.containedROTs().size()<nMinRIOs){
ATH_MSG_DEBUG("only "<<rsg.containedROTs().size()<<", RIO's, insufficient to build the 4d segment from a single eta segment");
if ( rsg.numberOfContainedROTs()<nMinRIOs){
ATH_MSG_DEBUG("only "<<rsg.numberOfContainedROTs()<<", RIO's, insufficient to build the 4d segment from a single eta segment");
continue;
}
std::unique_ptr<MuonSegment> pseg(new MuonSegment(rsg));
......@@ -1862,8 +1863,8 @@ get4dMuonSegmentCombination( const MuonSegmentCombination* insegs ) const {
const MuonSegment& psg = **ipsg;
unsigned int nMinRIOs=3;
if(insegs->use2LayerSegments(0)) nMinRIOs=2;
if ( psg.containedROTs().size()<nMinRIOs){
ATH_MSG_DEBUG("only "<<psg.containedROTs().size()<<", RIO's, insufficient to build the 4d segment from a single phi segment");
if ( psg.numberOfContainedROTs()<nMinRIOs){
ATH_MSG_DEBUG("only "<<psg.numberOfContainedROTs()<<", RIO's, insufficient to build the 4d segment from a single phi segment");
continue;
}
std::unique_ptr<MuonSegment> pseg(new MuonSegment(psg));
......@@ -1920,7 +1921,8 @@ make_4dMuonSegment(const MuonSegment& rsg, const MuonSegment& psg, bool use2LayS
const Amg::MatrixX& rcov = rsg.localCovariance();
const Trk::PlaneSurface& etasrf = rsg.associatedSurface();
const ICscSegmentFinder::RioList& etarios = rsg.containedROTs();
ICscSegmentFinder::RioList etarios;
for(unsigned int irot=0;irot<rsg.numberOfContainedROTs();irot++) etarios.push_back(rsg.rioOnTrack(irot));
const Trk::FitQuality& rfq = *rsg.fitQuality();
const Trk::FitQuality& phifq = *psg.fitQuality();
......@@ -1928,7 +1930,8 @@ make_4dMuonSegment(const MuonSegment& rsg, const MuonSegment& psg, bool use2LayS
double phidir = psg.localDirection().angleXZ();
const Amg::MatrixX& phicov = psg.localCovariance();
const Trk::PlaneSurface& phisrf = psg.associatedSurface();
const ICscSegmentFinder::RioList& phirios = psg.containedROTs();
ICscSegmentFinder::RioList phirios;
for(unsigned int irot=0;irot<psg.numberOfContainedROTs();irot++) phirios.push_back(psg.rioOnTrack(irot));
// Fit quality.
double chsq = rfq.chiSquared() + phifq.chiSquared();
......@@ -2371,8 +2374,10 @@ double CscSegmentUtilTool::
matchLikelihood(const MuonSegment& rsg, const MuonSegment& psg) const {
// Loop over eta and phi segments.
const ICscSegmentFinder::RioList& etarios = rsg.containedROTs();
const ICscSegmentFinder::RioList& phirios = psg.containedROTs();
ICscSegmentFinder::RioList etarios;
for(unsigned int irot=0;irot<rsg.numberOfContainedROTs();irot++) etarios.push_back(rsg.rioOnTrack(irot));
ICscSegmentFinder::RioList phirios;
for(unsigned int irot=0;irot<psg.numberOfContainedROTs();irot++) etarios.push_back(psg.rioOnTrack(irot));
int maxeta = etarios.size();
int maxphi = phirios.size();
......
......@@ -327,7 +327,7 @@ namespace Muon {
double phi = seeds[i].second.phi();
double theta = (*sit)->globalDirection().theta();
double qoverp=0;
Trk::PerigeeSurface persurf((*sit)->containedROTs().front()->globalPosition());
Trk::PerigeeSurface persurf((*sit)->rioOnTrack(0)->globalPosition());
startpar = new Trk::Perigee(0,0,phi,theta,qoverp,persurf);
seed3D = seeds[i];
}
......@@ -358,13 +358,12 @@ namespace Muon {
//interleave the phi hits
std::vector<const Trk::MeasurementBase*> vec2;
const std::vector<const Trk::RIO_OnTrack*> etaHits = (*sit)->containedROTs();
unsigned int netas = (*sit)->numberOfContainedROTs();
bool useEtaHitsRedone = false;
if(etaHitsRedone.size()>etaHits.size()) {
ATH_MSG_VERBOSE(" Found additional eta hits " << etaHitsRedone.size() - etaHits.size());
if(etaHitsRedone.size()>netas) {
ATH_MSG_VERBOSE(" Found additional eta hits " << etaHitsRedone.size() - netas);
useEtaHitsRedone = true;
}
unsigned int netas = etaHits.size();
if(useEtaHitsRedone) netas = etaHitsRedone.size();
if(m_ipConstraint) vec2.reserve(phiHits.size()+netas+1);
else vec2.reserve(phiHits.size()+netas);
......@@ -382,18 +381,18 @@ namespace Muon {
}
unsigned int iEta(0),iPhi(0);
ATH_MSG_VERBOSE( "There are " << etaHits.size() << " & " << phiHits.size() << " eta and phi hits" );
ATH_MSG_VERBOSE( "There are " << (*sit)->numberOfContainedROTs() << " & " << phiHits.size() << " eta and phi hits" );
while(true) {
float phiZ(999999.),etaZ(999999.);
if(iPhi < phiHits.size()) phiZ = fabs(phiHits[iPhi]->globalPosition().z());
if(iEta < etaHits.size()) etaZ = fabs(etaHits[iEta]->globalPosition().z());
if(iEta < (*sit)->numberOfContainedROTs()) etaZ = fabs((*sit)->rioOnTrack(iEta)->globalPosition().z());
if( phiZ < etaZ ) {
vec2.push_back(phiHits[iPhi]);
iPhi++;
}
else {
if(!useEtaHitsRedone) {
vec2.push_back(etaHits[iEta]);
vec2.push_back((*sit)->rioOnTrack(iEta));
} else {
vec2.push_back(etaHitsRedone[iEta]);
}
......
......@@ -501,7 +501,7 @@ namespace Muon {
for (;ipsg!=ipsg_end;++ipsg){
MuonSegment* seg=(*ipsg).get();
if( seg->containedROTs().size() > 3 ) {
if( seg->numberOfContainedROTs() > 3 ) {
summary.stationsGood.insert(stIndex);
}
......
......@@ -580,15 +580,12 @@ Amg::Vector3D DetailedMuonPatternTruthBuilder::getPRDTruthPosition(const Muon::M
std::map< const Trk::TrkDetElementBase*, std::pair< std::list<const Trk::PrepRawData*>,std::list<const Trk::PrepRawData*> > > clustersPerDetEl;
// Loop over containedROTs in segment
const std::vector<const Trk::RIO_OnTrack*>& cROTv = segment.containedROTs();
for(unsigned int i_cROTv = 0; i_cROTv < cROTv.size(); i_cROTv++) {
if(cROTv.size() == 0) {
ATH_MSG_WARNING("Error, cROTv size is zero");
continue;
}
for(unsigned int i_cROTv = 0; i_cROTv < segment.numberOfContainedROTs(); i_cROTv++) {
const Trk::RIO_OnTrack* rot=segment.rioOnTrack(i_cROTv);
// get the PrepRawData from the ROT
const Trk::PrepRawData* prd = cROTv.at(i_cROTv)->prepRawData();
const Trk::PrepRawData* prd = rot->prepRawData();
Identifier id = prd->identify();
......@@ -1092,12 +1089,11 @@ void DetailedMuonPatternTruthBuilder::addDetailedTrackTruthFromSegment(std::vect
std::set<Muon::MuonStationIndex::ChIndex> chIndices;
// Loop over containedROTs in segment
const std::vector<const Trk::RIO_OnTrack*>& cROTv = segment.containedROTs();
for(unsigned int i_cROTv = 0; i_cROTv < cROTv.size(); i_cROTv++) {
if(cROTv.size() == 0) continue;
for(unsigned int i_cROTv = 0; i_cROTv < segment.numberOfContainedROTs(); i_cROTv++) {
const Trk::RIO_OnTrack* rot=segment.rioOnTrack(i_cROTv);
// get the PrepRawData from the ROT
const Trk::PrepRawData* prd = cROTv.at(i_cROTv)->prepRawData();
const Trk::PrepRawData* prd = rot->prepRawData();
Identifier id = prd->identify();
chIndices.insert(m_idHelperSvc->chamberIndex(id));
......
......@@ -1186,7 +1186,7 @@ StatusCode MdtRawDataMonAlg::handleEvent_effCalc(const Trk::SegmentCollection* s
ATH_MSG_DEBUG("no pointer to segment!!!");
break;
}
if(segment->containedROTs().size() < m_nb_hits || segment->containedROTs().size() <= 0 || segment->fitQuality()->chiSquared() / segment->fitQuality()->doubleNumberDoF() > m_chi2_cut) {
if(segment->numberOfContainedROTs() < m_nb_hits || segment->numberOfContainedROTs() <= 0 || segment->fitQuality()->chiSquared() / segment->fitQuality()->doubleNumberDoF() > m_chi2_cut) {
continue;
}
......@@ -1198,11 +1198,8 @@ StatusCode MdtRawDataMonAlg::handleEvent_effCalc(const Trk::SegmentCollection* s
std::vector<float> ROTs_DR;
std::vector<float> ROTs_DRerr;
std::vector<float> ROTs_DT;
const std::vector<const Trk::RIO_OnTrack*>& rots = segment->containedROTs();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rit = rots.begin();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rit_end = rots.end();
for( ; rit!=rit_end;++rit ) {
const Trk::RIO_OnTrack* rot = *rit;
for(unsigned int irot=0;irot<segment->numberOfContainedROTs();irot++){
const Trk::RIO_OnTrack* rot = segment->rioOnTrack(irot);
const Muon::MdtDriftCircleOnTrack* mrot = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(rot);
if(mrot) {
......
......@@ -2037,7 +2037,7 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s
ATH_MSG_DEBUG("no pointer to segment!!!");
break;
}
if(segment->containedROTs().size() < m_nb_hits || segment->containedROTs().size() <= 0 || segment->fitQuality()->chiSquared() / segment->fitQuality()->doubleNumberDoF() > m_chi2_cut) {
if(segment->numberOfContainedROTs() < m_nb_hits || segment->numberOfContainedROTs() <= 0 || segment->fitQuality()->chiSquared() / segment->fitQuality()->doubleNumberDoF() > m_chi2_cut) {
continue;
}
......@@ -2049,11 +2049,8 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s
std::vector<float> ROTs_DR;
std::vector<float> ROTs_DRerr;
std::vector<float> ROTs_DT;
const std::vector<const Trk::RIO_OnTrack*>& rots = segment->containedROTs();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rit = rots.begin();
std::vector<const Trk::RIO_OnTrack*>::const_iterator rit_end = rots.end();
for( ; rit!=rit_end;++rit ) {
const Trk::RIO_OnTrack* rot = *rit;
for(unsigned int irot=0;irot<segment->numberOfContainedROTs();irot++){
const Trk::RIO_OnTrack* rot = segment->rioOnTrack(irot);
const Muon::MdtDriftCircleOnTrack* mrot = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(rot);
if(mrot) {
......
......@@ -62,6 +62,7 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment,
for(unsigned int i=0;i<segm->numberOfContainedROTs();++i){
// Get station information
const Trk::RIO_OnTrack* rio = segm->rioOnTrack(i);
if(!rio) continue;
Identifier id = rio->identify();
stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id));
// Flag Segments with ROTs in the MDT & Endcap
......
......@@ -108,6 +108,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(vector<const Muon::MuonSegment*> (&so
// Loop through contained ROTs and identify used stations
for(unsigned int iROT=0; iROT<segm0->numberOfContainedROTs(); ++iROT) {
const Trk::RIO_OnTrack* rio = segm0->rioOnTrack(iROT);
if(!rio) continue;
Identifier id = rio->identify();
stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id));
......@@ -160,6 +161,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(vector<const Muon::MuonSegment*> (&so
// Loop through contained ROTs and identify used stations
for(unsigned int iROT=0; iROT<segm1->numberOfContainedROTs(); ++iROT){
const Trk::RIO_OnTrack* rio = segm1->rioOnTrack(iROT);
if(!rio) continue;
Identifier id = rio->identify();
stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id));
bool isStrip = m_muonIdHelperTool->tgcIdHelper().isStrip(id);
......
......@@ -81,6 +81,10 @@ MdtVsTgcRawDataValAlg::DQCheckMDTSegments(vector<const Muon::MuonSegment*> (&sor
// Loop through contained ROTs and identify used stations
for(unsigned int iROT=0; iROT<segm->numberOfContainedROTs(); ++iROT) {
const Trk::RIO_OnTrack* rio = segm->rioOnTrack(iROT);
if(!rio){
ATH_MSG_DEBUG("no RIO");
continue;
}
Identifier id = rio->identify();
stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id));
int isStrip = m_muonIdHelperTool->tgcIdHelper().isStrip(id);
......
......@@ -57,6 +57,10 @@ MdtVsTgcRawDataValAlg::SortMDTSegments(const xAOD::MuonSegmentContainer *newsegm
// Loop through contained ROTs and identify used stations
for(unsigned int iROT=0; iROT<segm->numberOfContainedROTs(); ++iROT){
const Trk::RIO_OnTrack* rio = segm->rioOnTrack(iROT);
if(!rio){
ATH_MSG_DEBUG("No RIO");
continue;
}
Identifier id = rio->identify();
// Identify MDT Endcap Segments
......
......@@ -77,11 +77,10 @@ void MuonSegmentT0FillerTool::MuonboyT0CSCSegment(const Muon::MuonSegment* pMuon
float Alternative_t0 = 0. ;
float Alternative_t0sqr = 0. ;
float Alternative_t0Error = 0. ;
const std::vector<const Trk::RIO_OnTrack*> pRIOSet = pMuonSegment->containedROTs();
std::vector<const Trk::RIO_OnTrack*>::const_iterator pRIO_OnTrackIter = pRIOSet.begin();
for (; pRIO_OnTrackIter!=pRIOSet.end(); ++pRIO_OnTrackIter){
if ( (*pRIO_OnTrackIter) ){
const Trk::PrepRawData* pPrepRawData =(*pRIO_OnTrackIter)->prepRawData () ;
for(unsigned int irot=0;irot<pMuonSegment->numberOfContainedROTs();irot++){
const Trk::RIO_OnTrack* pRIO_OnTrack=pMuonSegment->rioOnTrack(irot);
if ( (pRIO_OnTrack) ){
const Trk::PrepRawData* pPrepRawData =(pRIO_OnTrack)->prepRawData () ;
if ( pPrepRawData ){
const Muon::CscPrepData* pPrepData = dynamic_cast<const Muon::CscPrepData*>(pPrepRawData);
if ( pPrepData ){
......
......@@ -193,8 +193,13 @@ bool MuTagMatchingTool::match( const Trk::TrackParameters* atSurface,
std::string MuTagMatchingTool::segmentStationString( const Muon::MuonSegment* segment ) const {
std::string station;
for( unsigned int i = 0; i<segment->numberOfContainedROTs(); ++i ){
const Trk::RIO_OnTrack* rot=segment->rioOnTrack(i);
if(!rot){
ATH_MSG_DEBUG("no ROT");
continue;
}
Identifier segID = segment->rioOnTrack(i)->identify();