diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.cxx index f111c28f6ce0296a05d4d2b5c7e76711713b5a44..12ce977dda87240bde2a2353352a270d141073fc 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.cxx @@ -37,7 +37,7 @@ void TrigL2MuonSA::AlphaBetaEstimate::setMCFlag(BooleanProperty use_mcLUT, StatusCode TrigL2MuonSA::AlphaBetaEstimate::setAlphaBeta(const LVL1::RecMuonRoI* p_roi, TrigL2MuonSA::TgcFitResult& tgcFitResult, TrigL2MuonSA::TrackPattern& trackPattern, - const TrigL2MuonSA::MuonRoad& /*muonRoad*/) + const TrigL2MuonSA::MuonRoad& /*muonRoad*/) const { const int MAX_STATION = 6; const double PHI_RANGE = 12./(M_PI/8.); @@ -270,7 +270,7 @@ StatusCode TrigL2MuonSA::AlphaBetaEstimate::setAlphaBeta(const LVL1::RecMuonRoI* double TrigL2MuonSA::AlphaBetaEstimate::computeRadius(double InnerSlope, double InnerR, double InnerZ, double MiddleSlope, double MiddleR, double MiddleZ, - double sign) + double sign) const { double cr1 = 0.080/400; double cr2 = cr1; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.h index 35ddd6ddff8c8adf7e728cd748d7e5817e5281e4..d36f725969bb874828ffc038a70a0282d70052d9 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/AlphaBetaEstimate.h @@ -35,13 +35,13 @@ class AlphaBetaEstimate: public AthAlgTool StatusCode setAlphaBeta(const LVL1::RecMuonRoI* p_roi, TrigL2MuonSA::TgcFitResult& tgcFitResult, TrigL2MuonSA::TrackPattern& trackPattern, - const TrigL2MuonSA::MuonRoad& muonRoad); + const TrigL2MuonSA::MuonRoad& muonRoad) const; private: double computeRadius(double InnerSlope, double InnerR, double InnerZ, double MiddleSlope, double MiddleR, double MiddleZ, - double sign); + double sign) const; double computeRadius3Points(double InnerZ, double InnerR, double EEZ, double EER,double MiddleZ, double MiddleR ) const ; double calcDistance(double x1,double y1,double x2,double y2,double x3,double y3) const; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.cxx index 69a49b9b2abc5d63494913678a88b4e32d189081..b4f636f45579e65a9774965782d634fc68f0b4d2 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.cxx @@ -233,7 +233,7 @@ StatusCode TrigL2MuonSA::CscDataPreparator::prepareData(const TrigRoiDescriptor* // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -double TrigL2MuonSA::CscDataPreparator::calc_residual(double aw,double bw,double x,double y) +double TrigL2MuonSA::CscDataPreparator::calc_residual(double aw,double bw,double x,double y) const { const double ZERO_LIMIT = 1e-4; if( fabs(aw) < ZERO_LIMIT ) return y-bw; @@ -245,7 +245,8 @@ double TrigL2MuonSA::CscDataPreparator::calc_residual(double aw,double bw,double } -double TrigL2MuonSA::CscDataPreparator::calc_residual_phi( double aw, double bw, double phiw, double hitphi, double hitz){ +double TrigL2MuonSA::CscDataPreparator::calc_residual_phi( double aw, double bw, double phiw, double hitphi, double hitz) const +{ double roadr = hitz*aw + bw; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.h index bee5ac5d8abdb7a87db55947e3c7628c1ac190a0..23f8bafc3a6fc3d92c252d4a8088c77c387cf36d 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscDataPreparator.h @@ -51,9 +51,9 @@ namespace TrigL2MuonSA { double calc_residual(double aw, double bw, double x, - double y); + double y) const; - double calc_residual_phi(double aw, double bw, double phiw, double hitphi, double hitz); + double calc_residual_phi(double aw, double bw, double phiw, double hitphi, double hitz) const; private: diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.cxx index aea9e4a5b874234da3488a9e24bfd661e760545f..fc56caeecd3d1bcf280e99501ca565a44d90cd73 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.cxx @@ -122,7 +122,7 @@ StatusCode CscRegDict :: initialize(){ } -int CscRegDict :: get_hash(int stationname, int stationeta, int stationphi){ +int CscRegDict :: get_hash(int stationname, int stationeta, int stationphi) const{ int sname, seta, sphi; if (stationname == 50 || stationname == 51) sname = stationname-50; @@ -171,7 +171,7 @@ ReturnCode CscRegDict :: initializeHashDictionary(){ -Amg::Vector3D CscRegDict::nomalVector(int module){ +Amg::Vector3D CscRegDict::nomalVector(int module) const{ double phi=m_reg_dict[module].phiCen; double theta=m_reg_dict[module].idealAtanNormal; @@ -204,7 +204,7 @@ double CscRegDict :: posCorrectionZ(int module, int charge/*0 or 1*/){ -double UtilTools :: calc_phi(double x, double y){ +double UtilTools :: calc_phi(double x, double y) const{ double /*abs_x=fabs(x),*/ abs_y=fabs(y); double abs_sine=abs_y/sqrt(x*x+y*y); @@ -226,8 +226,8 @@ double UtilTools :: calc_phi(double x, double y){ } -double UtilTools :: calc_dphi(double phi1, double phi2){ - +double UtilTools :: calc_dphi(double phi1, double phi2) const +{ double dphi=phi1-phi2; if (dphi > M_PI) { @@ -236,13 +236,12 @@ double UtilTools :: calc_dphi(double phi1, double phi2){ dphi += 2*M_PI; } - return dphi; - + return dphi; } -double UtilTools :: average_phi(double phi1, double phi2){ - +double UtilTools :: average_phi(double phi1, double phi2) const +{ double phi = 0.; if (phi1*phi2<0. && fabs(phi1)>M_PI/2.){ diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.h index dc002d9862b2011eb9ff5cede561c62a3804cfc4..601a5456ce23c6ea1e424b6bcbe081b76acb095b 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscRegUtils.h @@ -27,16 +27,16 @@ class UtilTools{ public: UtilTools(){} - double calc_theta(double eta){ return 2*atan(exp((-1)*eta)); } - double calc_theta(double x, double y, double z){ return acos(z/sqrt(x*x+y*y+z*z)); } // for position not for direction theta in [0,pi] - double calc_eta(double x, double y, double z){return (-1)*log(tan(calc_theta(x,y,z)/2.));} - double calc_phi( double x, double y); - double calc_dphi(double phi1, double phi2); - double calc_sumsq(double x, double y){ return sqrt(x*x+y*y); } - double calc_sumsq(double x, double y, double z){ return sqrt(x*x+y*y+z*z);} - double cotan(double theta){ return tan(M_PI-theta); } - double relative_error(double measured, double reference){return (measured-reference)/reference; } - double average_phi(double phi1, double phi2); + double calc_theta(double eta) const{ return 2*atan(exp((-1)*eta)); } + double calc_theta(double x, double y, double z) const{ return acos(z/sqrt(x*x+y*y+z*z)); } // for position not for direction theta in [0,pi] + double calc_eta(double x, double y, double z) const {return (-1)*log(tan(calc_theta(x,y,z)/2.));} + double calc_phi( double x, double y) const; + double calc_dphi(double phi1, double phi2) const; + double calc_sumsq(double x, double y) const { return sqrt(x*x+y*y); } + double calc_sumsq(double x, double y, double z) const { return sqrt(x*x+y*y+z*z);} + double cotan(double theta) const { return tan(M_PI-theta); } + double relative_error(double measured, double reference) const {return (measured-reference)/reference; } + double average_phi(double phi1, double phi2) const; }; @@ -66,18 +66,18 @@ class CscRegDict: public AthAlgTool{ virtual StatusCode initialize() override; double phiCen(int module){ return m_reg_dict[module].phiCen; } - double phiMod(int module){ return m_reg_dict[module].phiMod; } + double phiMod(int module) const { return m_reg_dict[module].phiMod; } - int get_hash(int stationname, int stationeta, int stationphi); //return a module context hashId. - Amg::Vector3D nomalVector(int module); - double displacement(int module); + int get_hash(int stationname, int stationeta, int stationphi) const; //return a module context hashId. + Amg::Vector3D nomalVector(int module) const; + double displacement(int module) const; double posCorrectionR(int module, int charge); double posCorrectionZ(int module, int charge); - double idealAtanNormal(int module){ return m_reg_dict[module].idealAtanNormal; } - double actualAtanNormal(int module){ return m_reg_dict[module].actualAtanNormal; } - int stationName(int hash); - int stationEta(int hash); - int stationPhi(int hash); + double idealAtanNormal(int module) const { return m_reg_dict[module].idealAtanNormal; } + double actualAtanNormal(int module) const { return m_reg_dict[module].actualAtanNormal; } + int stationName(int hash) const; + int stationEta(int hash) const; + int stationPhi(int hash) const; private: Gaudi::Property< bool > m_isMC { this, "MCFlag", true, "" }; @@ -96,16 +96,19 @@ class CscRegDict: public AthAlgTool{ }; -inline double CscRegDict::displacement(int module){ +inline double CscRegDict::displacement(int module) const +{ return (0<=module && module <32) ? m_reg_dict[module].Displacement : 0.; } -inline int CscRegDict::stationName(int hash){ +inline int CscRegDict::stationName(int hash) const +{ if(hash<0 || hash>31) return 999; else return (hash<16) ? 50 : 51; } -inline int CscRegDict::stationEta(int hash){ +inline int CscRegDict::stationEta(int hash) const +{ if(hash<0 || hash>31) return 999; else{ int secteta=(hash - hash%8)/8;// secteta: 0(Small Cside),1(Small Aside), 2(Large Cside), 3(Large Aside) @@ -113,7 +116,8 @@ inline int CscRegDict::stationEta(int hash){ } } -inline int CscRegDict::stationPhi(int hash){ +inline int CscRegDict::stationPhi(int hash) const +{ if(hash<0 || hash>31) return 999; else return hash%8+1; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx index 9a42898f10b768076d2093bb233938b8dd333793..78bdb86380372a099cb2090d5718112ab9e48265 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.cxx @@ -35,7 +35,7 @@ StatusCode CscSegmentMaker::initialize(){ ReturnCode CscSegmentMaker::FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscHits, std::vector<TrigL2MuonSA::TrackPattern> &v_trackPatterns, const TrigL2MuonSA::TgcFitResult &tgcFitResult, - const TrigL2MuonSA::MuonRoad &muroad) + const TrigL2MuonSA::MuonRoad &muroad) const { ATH_MSG_DEBUG( "FindSuperPointCsc" ); SG::ReadCondHandle<MuonGM::MuonDetectorManager> muDetMgrHandle{m_muDetMgrKey}; @@ -143,7 +143,7 @@ ReturnCode CscSegmentMaker::FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscH ReturnCode CscSegmentMaker::make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, - CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr) + CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr) const { ATH_MSG_DEBUG("################################## make_segment #####################################"); @@ -261,7 +261,7 @@ ReturnCode CscSegmentMaker::make_segment(int mod_hash, TrigL2MuonSA::CscHits cl ReturnCode CscSegmentMaker::make_2dsegment(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4], local2dSegment &seg2d, local2dSegment &seg2d_ipremoved, - int &nhit) + int &nhit) const { int nohit=0; @@ -326,7 +326,7 @@ ReturnCode CscSegmentMaker::make_segment(int mod_hash, TrigL2MuonSA::CscHits cl ReturnCode CscSegmentMaker::make_2dseg4hit(int measphi, const localCscHit &ip_loc, std::vector<localCscHit> hits_loc[4], //removing hits used in fit with 4 hits std::vector<local2dSegment> &seg2d_4hitCollection, - int &nhit) + int &nhit) const { std::vector<localCscHit> hit_fit; @@ -393,7 +393,7 @@ ReturnCode CscSegmentMaker::make_2dseg4hit(int measphi, const localCscHit &ip_lo ReturnCode CscSegmentMaker::make_2dseg3hit(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_3hitCollection, - int &nhit) + int &nhit) const { int empty_lyr=-1; @@ -451,7 +451,7 @@ ReturnCode CscSegmentMaker::make_2dseg3hit(int measphi, const localCscHit &ip_lo } -ReturnCode CscSegmentMaker::fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d){ +ReturnCode CscSegmentMaker::fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d) const{ double S=0.; @@ -534,7 +534,7 @@ ReturnCode CscSegmentMaker::fit_clusters(int measphi, const std::vector<localCsc ReturnCode CscSegmentMaker::make_4dsegment(const local2dSegment &seg2d_eta, const local2dSegment &seg2d_phi, Amg::Vector3D &seg_pos, - Amg::Vector3D &seg_dir) + Amg::Vector3D &seg_dir) const { int nhit_e=seg2d_eta.nhit; @@ -578,7 +578,12 @@ ReturnCode CscSegmentMaker::make_4dsegment(const local2dSegment &seg2d_eta, -ReturnCode CscSegmentMaker::getModuleSP(int mod_hashes[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const MuonRoad &muroad, const int hash_clusters[32]){ +ReturnCode CscSegmentMaker::getModuleSP(int mod_hashes[2], + const TrigL2MuonSA::TgcFitResult &tgcFitResult, + int phibin, + const MuonRoad &muroad, + const int hash_clusters[32]) const +{ ATH_MSG_DEBUG("getModuleSP()"); @@ -623,7 +628,7 @@ ReturnCode CscSegmentMaker::getModuleSP(int mod_hashes[2], const TrigL2MuonSA::T } -CscSegment CscSegmentMaker::segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg){ +CscSegment CscSegmentMaker::segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg) const{ double alpha = m_cscregdict->displacement(mod_hash); @@ -645,9 +650,8 @@ CscSegment CscSegmentMaker::segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscS -ReturnCode CscSegmentMaker::display_hits(const std::vector<localCscHit> localHits[4]){ - - +ReturnCode CscSegmentMaker::display_hits(const std::vector<localCscHit> localHits[4]) const +{ for(unsigned int ilyr=0; ilyr<4; ++ilyr){ for (unsigned int ihit=0; ihit<localHits[ilyr].size(); ++ihit) { const localCscHit &locHit = localHits[ilyr][ihit]; @@ -656,8 +660,7 @@ ReturnCode CscSegmentMaker::display_hits(const std::vector<localCscHit> localHit << " err=" << locHit.error << " res=" << locHit.residual); } } - - + return ReturnCode::SUCCESS; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h index 6fb3b3bba95cd9099f5a469ff515170c3905c7e8..619533b5778dd148f8f0c8028dc1325f4cd1e4c3 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/CscSegmentMaker.h @@ -63,27 +63,29 @@ namespace TrigL2MuonSA{ virtual StatusCode initialize() override; - ReturnCode FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscHits, std::vector<TrigL2MuonSA::TrackPattern> &v_trackPatterns, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MuonRoad &muroad); + ReturnCode FindSuperPointCsc( const TrigL2MuonSA::CscHits &cscHits, + std::vector<TrigL2MuonSA::TrackPattern> &v_trackPatterns, + const TrigL2MuonSA::TgcFitResult &tgcFitResult, + const TrigL2MuonSA::MuonRoad &muroad) const; - ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr); + ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager* muDetMgr) const; - ReturnCode make_2dsegment(int measphi, const localCscHit &ip_loc,const std::vector<localCscHit> hits_loc[4], local2dSegment &seg2d_eta,local2dSegment &local2d_noip, int &nhite); + ReturnCode make_2dsegment(int measphi, const localCscHit &ip_loc,const std::vector<localCscHit> hits_loc[4], local2dSegment &seg2d_eta,local2dSegment &local2d_noip, int &nhite) const; - ReturnCode make_2dseg4hit(int measphi, const localCscHit &ip_loc,std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_4hitCollection, int &nhite); + ReturnCode make_2dseg4hit(int measphi, const localCscHit &ip_loc,std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_4hitCollection, int &nhite) const; - ReturnCode make_2dseg3hit(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_4hitCollection, int &nhit); - - ReturnCode fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d); + ReturnCode make_2dseg3hit(int measphi, const localCscHit &ip_loc, const std::vector<localCscHit> hits_loc[4], std::vector<local2dSegment> &seg2d_4hitCollection, int &nhit) const; + ReturnCode fit_clusters(int measphi, const std::vector<localCscHit> &hits_fit, local2dSegment &seg2d) const; ReturnCode make_4dsegment(const local2dSegment &seg2d_eta, const local2dSegment &seg2d_phi, - Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir); + Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir) const; - ReturnCode getModuleSP(int mod_hash[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const TrigL2MuonSA::MuonRoad &muroad, const int exist_clusters[32]); + ReturnCode getModuleSP(int mod_hash[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const TrigL2MuonSA::MuonRoad &muroad, const int exist_clusters[32]) const; - ReturnCode display_hits(const std::vector<localCscHit> localHits[4]); + ReturnCode display_hits(const std::vector<localCscHit> localHits[4]) const; - CscSegment segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg); + CscSegment segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg) const; private: UtilTools m_util; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx index d7789555e3f7f486b3a044ed53ef0e554fca64dd..f35203989a2987f350f79388c395e651c60d7805 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx @@ -26,7 +26,7 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::initialize() // -------------------------------------------------------------------------------- StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* idtrack, - TrigL2MuonSA::MuonRoad& muonRoad) + TrigL2MuonSA::MuonRoad& muonRoad) const { ATH_MSG_DEBUG("FtfRoadDefiner::defineRoad"); @@ -145,7 +145,8 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* i // -------------------------------------------------------------------------------- // extrapolate a FTF track to MS in order to define FTF Road -std::unique_ptr<const Trk::TrackParameters> TrigL2MuonSA::FtfRoadDefiner::extTrack( const xAOD::TrackParticle* trk, const double R, const double halflength, int& extFlag ) { +std::unique_ptr<const Trk::TrackParameters> TrigL2MuonSA::FtfRoadDefiner::extTrack( const xAOD::TrackParticle* trk, const double R, const double halflength, int& extFlag ) const +{ const bool boundaryCheck = true; bool bCylinder = false; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.h index a814605967a3392065ba2d3e2b8734793d617001..42de958f7605dd18c526faa29f5bc8cc4f8c9783 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.h @@ -30,8 +30,8 @@ namespace TrigL2MuonSA { public: StatusCode defineRoad( const xAOD::TrackParticle* idtrack, - TrigL2MuonSA::MuonRoad& muonRoad); - std::unique_ptr<const Trk::TrackParameters> extTrack( const xAOD::TrackParticle* trk, const double R, const double halflength, int& extFlag ); + TrigL2MuonSA::MuonRoad& muonRoad) const; + std::unique_ptr<const Trk::TrackParameters> extTrack( const xAOD::TrackParticle* trk, const double R, const double halflength, int& extFlag ) const; protected: diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx index 4222d085c8317803d648187e3d687e565db79e6f..fc17297940ede325c619d1214bcb8dd2e849d04c 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.cxx @@ -505,22 +505,22 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm, continue; } - m_mdtReadout = muDetMgr->getMdtRElement_fromIdFields(StationName, StationEta, StationPhi,MultiLayer); - if (!m_mdtReadout) { + const MuonGM::MdtReadoutElement* mdtReadout = muDetMgr->getMdtRElement_fromIdFields(StationName, StationEta, StationPhi,MultiLayer); + if (!mdtReadout) { ++amt; continue; } - m_muonStation = m_mdtReadout->parentMuonStation(); + const MuonGM::MuonStation* muonStation = mdtReadout->parentMuonStation(); - int TubeLayers = m_mdtReadout->getNLayers(); + int TubeLayers = mdtReadout->getNLayers(); int TubeLayer = Layer; if(TubeLayer > TubeLayers) TubeLayer -= TubeLayers; if(MultiLayer==2) - Layer = Layer + m_mdtReadout->getNLayers(); + Layer = Layer + mdtReadout->getNLayers(); - double OrtoRadialPos = m_mdtReadout->getStationS(); - std::string chamberType = m_mdtReadout->getStationType(); + double OrtoRadialPos = mdtReadout->getStationS(); + std::string chamberType = mdtReadout->getStationType(); char st = chamberType[1]; int chamber = 0; @@ -554,18 +554,18 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm, } } } - R = m_mdtReadout->center(TubeLayer, Tube).perp(); - Z = m_mdtReadout->center(TubeLayer, Tube).z(); + R = mdtReadout->center(TubeLayer, Tube).perp(); + Z = mdtReadout->center(TubeLayer, Tube).z(); - Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal()); - if(m_muonStation->endcap()==0){ + Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*muonStation->getNominalAmdbLRSToGlobal()); + if(muonStation->endcap()==0){ cXmid = (trans*Amg::Vector3D(0.,0.,0.)).z(); - double halfRadialThicknessOfMultilayer = m_muonStation->RsizeMdtStation()/2.; + double halfRadialThicknessOfMultilayer = muonStation->RsizeMdtStation()/2.; cYmid = ((trans*Amg::Vector3D(0.,0.,0.)).perp()+halfRadialThicknessOfMultilayer); } else{ cXmid = (trans*Amg::Vector3D(0.,0.,0.)).perp(); - double halfZThicknessOfMultilayer = m_muonStation->ZsizeMdtStation()/2.; + double halfZThicknessOfMultilayer = muonStation->ZsizeMdtStation()/2.; cYmid = (trans*Amg::Vector3D(0.,0.,0.)).z(); if(cYmid>0) cYmid += halfZThicknessOfMultilayer; else cYmid -= halfZThicknessOfMultilayer; @@ -586,11 +586,11 @@ bool TrigL2MuonSA::MdtDataPreparator::decodeMdtCsm(const MdtCsm* csm, } } - if(m_muonStation->endcap()==1) + if(muonStation->endcap()==1) R = sqrt(R*R+R*R*tan(dphi)*tan(dphi)); Amg::Vector3D OrigOfMdtInAmdbFrame = - Amg::Hep3VectorToEigen( m_muonStation->getBlineFixedPointInAmdbLRS() ); + Amg::Hep3VectorToEigen( muonStation->getBlineFixedPointInAmdbLRS() ); double Rmin =(trans*OrigOfMdtInAmdbFrame).perp(); float cInCo = 1./cos(std::abs(atan(OrtoRadialPos/Rmin))); @@ -676,9 +676,10 @@ uint32_t TrigL2MuonSA::MdtDataPreparator::get_system_id (unsigned short int Subs void TrigL2MuonSA::MdtDataPreparator::getMdtIdHashesBarrel(const TrigL2MuonSA::MdtRegion& mdtRegion, std::vector<IdentifierHash>& mdtIdHashes_normal, - std::vector<IdentifierHash>& mdtIdHashes_overlap) + std::vector<IdentifierHash>& mdtIdHashes_overlap) const { std::vector<IdentifierHash> idList; + float etaMinChamber[11],etaMaxChamber[11],phiMinChamber[11],phiMaxChamber[11]; //combine regions of sector and type for(int j_station=0; j_station<6; j_station++) { @@ -746,9 +747,10 @@ void TrigL2MuonSA::MdtDataPreparator::getMdtIdHashesBarrel(const TrigL2MuonSA::M void TrigL2MuonSA::MdtDataPreparator::getMdtIdHashesEndcap(const TrigL2MuonSA::MdtRegion& mdtRegion, std::vector<IdentifierHash>& mdtIdHashes_normal, - std::vector<IdentifierHash>& mdtIdHashes_overlap) + std::vector<IdentifierHash>& mdtIdHashes_overlap) const { std::vector<IdentifierHash> idList; + float etaMinChamber[11],etaMaxChamber[11],phiMinChamber[11],phiMaxChamber[11]; //combine regions of sector and type for(int j_station=0; j_station<6; j_station++) { @@ -819,7 +821,7 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std std::vector<uint32_t>& v_robIds, TrigL2MuonSA::MdtHits& mdtHits, const TrigL2MuonSA::MuonRoad& muonRoad, - const MuonGM::MuonDetectorManager* muDetMgr) + const MuonGM::MuonDetectorManager* muDetMgr) { if(m_doDecoding) { if(m_decodeBS) { @@ -876,14 +878,14 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std mdtHits.reserve( mdtHits.size() + mdtCol->size() ); for( const Muon::MdtPrepData* mdt : *mdtCol ) { - m_mdtReadout = mdt->detectorElement(); - if (!m_mdtReadout) continue; + const MuonGM::MdtReadoutElement* mdtReadout = mdt->detectorElement(); + if (!mdtReadout) continue; - m_muonStation = m_mdtReadout->parentMuonStation(); + const MuonGM::MuonStation* muonStation = mdtReadout->parentMuonStation(); - int StationPhi = m_mdtReadout->getStationPhi(); - int StationEta = m_mdtReadout->getStationEta(); - int MultiLayer = m_mdtReadout->getMultilayer(); + int StationPhi = mdtReadout->getStationPhi(); + int StationEta = mdtReadout->getStationEta(); + int MultiLayer = mdtReadout->getMultilayer(); double cXmid; double cYmid; double cAmid = 0; @@ -893,14 +895,14 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std int adc = mdt->adc(); int drift = mdt->tdc(); - int TubeLayers = m_mdtReadout->getNLayers(); + int TubeLayers = mdtReadout->getNLayers(); int TubeLayer = m_idHelperSvc->mdtIdHelper().tubeLayer(id); if(TubeLayer > TubeLayers) TubeLayer -= TubeLayers; int Layer = (MultiLayer-1)*TubeLayers + TubeLayer; int Tube = m_idHelperSvc->mdtIdHelper().tube(id); - double OrtoRadialPos = m_mdtReadout->getStationS(); - std::string chamberType = m_mdtReadout->getStationType(); + double OrtoRadialPos = mdtReadout->getStationS(); + std::string chamberType = mdtReadout->getStationType(); char st = chamberType[1]; int chamber = 0; @@ -930,18 +932,18 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std } } } - R = m_mdtReadout->center(TubeLayer, Tube).perp(); - Z = m_mdtReadout->center(TubeLayer, Tube).z(); + R = mdtReadout->center(TubeLayer, Tube).perp(); + Z = mdtReadout->center(TubeLayer, Tube).z(); - Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal()); - if(m_muonStation->endcap()==0){ + Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*muonStation->getNominalAmdbLRSToGlobal()); + if(muonStation->endcap()==0){ cXmid = (trans*Amg::Vector3D(0.,0.,0.)).z(); - double halfRadialThicknessOfMultilayer = m_muonStation->RsizeMdtStation()/2.; + double halfRadialThicknessOfMultilayer = muonStation->RsizeMdtStation()/2.; cYmid = ((trans*Amg::Vector3D(0.,0.,0.)).perp()+halfRadialThicknessOfMultilayer); } else{ cXmid = (trans*Amg::Vector3D(0.,0.,0.)).perp(); - double halfZThicknessOfMultilayer = m_muonStation->ZsizeMdtStation()/2.; + double halfZThicknessOfMultilayer = muonStation->ZsizeMdtStation()/2.; cYmid = (trans*Amg::Vector3D(0.,0.,0.)).z(); if(cYmid>0) cYmid += halfZThicknessOfMultilayer; else cYmid -= halfZThicknessOfMultilayer; @@ -963,11 +965,11 @@ StatusCode TrigL2MuonSA::MdtDataPreparator::collectMdtHitsFromPrepData(const std } } - if(m_muonStation->endcap()==1) + if(muonStation->endcap()==1) R = sqrt(R*R+R*R*tan(dphi)*tan(dphi)); Amg::Vector3D OrigOfMdtInAmdbFrame = - Amg::Hep3VectorToEigen( m_muonStation->getBlineFixedPointInAmdbLRS() ); + Amg::Hep3VectorToEigen( muonStation->getBlineFixedPointInAmdbLRS() ); double Rmin =(trans*OrigOfMdtInAmdbFrame).perp(); float cInCo = 1./cos(std::abs(atan(OrtoRadialPos/Rmin))); diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h index 4edb0f5ab823e737130849e60804e986d51b835b..b1fef4d2acf89c7d2e7d046bfcf5b567401da78d 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtDataPreparator.h @@ -77,9 +77,6 @@ namespace TrigL2MuonSA { void setMdtDataCollection(bool use_mdtcsm){m_use_mdtcsm = use_mdtcsm;}; void setRoIBasedDataAccess(bool use_RoIBasedDataAccess){m_use_RoIBasedDataAccess = use_RoIBasedDataAccess;}; - public: - float etaMinChamber[11],etaMaxChamber[11],phiMinChamber[11],phiMaxChamber[11]; - private: StatusCode getMdtHits(const LVL1::RecMuonRoI* p_roi, @@ -91,11 +88,11 @@ namespace TrigL2MuonSA { void getMdtIdHashesBarrel(const TrigL2MuonSA::MdtRegion& mdtRegion, std::vector<IdentifierHash>& mdtIdHashes_normal, - std::vector<IdentifierHash>& mdtIdHashes_overlap); + std::vector<IdentifierHash>& mdtIdHashes_overlap) const; void getMdtIdHashesEndcap(const TrigL2MuonSA::MdtRegion& mdtRegion, std::vector<IdentifierHash>& mdtIdHashes_normal, - std::vector<IdentifierHash>& mdtIdHashes_overlap); + std::vector<IdentifierHash>& mdtIdHashes_overlap) const; StatusCode getMdtCsm(const MdtCsmContainer* pMdtCsmContainer, const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& v_robFragments, @@ -121,8 +118,6 @@ namespace TrigL2MuonSA { // Geometry Services - const MuonGM::MdtReadoutElement* m_mdtReadout {nullptr}; - const MuonGM::MuonStation* m_muonStation {nullptr}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; IdentifierHash m_hash_id; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx index 33e4d6a109747d59d5cdb8b48b70f765534ce538..5222e52a1b527615375ef54feb42394fc423a097 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.cxx @@ -38,7 +38,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::initialize() StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::RpcFitResult& rpcFitResult, TrigL2MuonSA::MuonRoad& muonRoad, - TrigL2MuonSA::MdtRegion& mdtRegion) + TrigL2MuonSA::MdtRegion& mdtRegion) const { constexpr double ZERO_LIMIT = 1e-5; mdtRegion.Clear(); @@ -101,16 +101,17 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1; else if(ty2 == -1) ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1; - m_mdtReadout = muDetMgr->getMdtReadoutElement(id); - m_muonStation = m_mdtReadout->parentMuonStation(); + + const MuonGM::MdtReadoutElement* mdtReadout = muDetMgr->getMdtReadoutElement(id); + const MuonGM::MuonStation* muonStation = mdtReadout->parentMuonStation(); - Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal()); + Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*muonStation->getNominalAmdbLRSToGlobal()); Amg::Vector3D OrigOfMdtInAmdbFrame = - Amg::Hep3VectorToEigen( m_muonStation->getBlineFixedPointInAmdbLRS() ); + Amg::Hep3VectorToEigen( muonStation->getBlineFixedPointInAmdbLRS() ); tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp(); - tmp_rMax = tmp_rMin+m_muonStation->Rsize(); + tmp_rMax = tmp_rMin+muonStation->Rsize(); if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin; if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax; @@ -118,7 +119,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* tmp_zMin = (trans*OrigOfMdtInAmdbFrame).z(); if(tmp_zMin < 0) sign = -1; else if(tmp_zMin > 0) sign = 1; - tmp_zMax = tmp_zMin + sign*m_muonStation->Zsize(); + tmp_zMax = tmp_zMin + sign*muonStation->Zsize(); if(zMin==0 || tmp_zMin < zMin)zMin = tmp_zMin; if(zMax==0 || tmp_zMax > zMax)zMax = tmp_zMax; } @@ -200,7 +201,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::TgcFitResult& tgcFitResult, TrigL2MuonSA::MuonRoad& muonRoad, - TrigL2MuonSA::MdtRegion& mdtRegion) + TrigL2MuonSA::MdtRegion& mdtRegion) const { mdtRegion.Clear(); @@ -267,19 +268,21 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1; else if(ty2 == -1) ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(name)+1; - m_mdtReadout = muDetMgr->getMdtReadoutElement(id); - m_muonStation = m_mdtReadout->parentMuonStation(); + + const MuonGM::MdtReadoutElement* mdtReadout = muDetMgr->getMdtReadoutElement(id); + const MuonGM::MuonStation* muonStation = mdtReadout->parentMuonStation(); + float scale = 10.; - Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*m_muonStation->getNominalAmdbLRSToGlobal()); + Amg::Transform3D trans = Amg::CLHEPTransformToEigen(*muonStation->getNominalAmdbLRSToGlobal()); Amg::Vector3D OrigOfMdtInAmdbFrame = - Amg::Hep3VectorToEigen( m_muonStation->getBlineFixedPointInAmdbLRS() ); + Amg::Hep3VectorToEigen( muonStation->getBlineFixedPointInAmdbLRS() ); tmp_zMin = (trans*OrigOfMdtInAmdbFrame).z(); if(tmp_zMin < 0) sign = -1; else if(tmp_zMin > 0) sign = 1; - tmp_zMax = tmp_zMin + sign*m_muonStation->Zsize(); + tmp_zMax = tmp_zMin + sign*muonStation->Zsize(); if(sta_zMin==0 || tmp_zMin<sta_zMin) sta_zMin = tmp_zMin; if(sta_zMin==0 || tmp_zMax<sta_zMin) sta_zMin = tmp_zMax; @@ -288,14 +291,14 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* if (chamber_this==barrel_inner){//barrel inner tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp()/scale; - tmp_rMax = tmp_rMin+m_muonStation->Rsize()/scale; + tmp_rMax = tmp_rMin+muonStation->Rsize()/scale; if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin; if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax; } if (chamber_this==bee){//BEE tmp_rMin = (trans*OrigOfMdtInAmdbFrame).perp()/scale; - tmp_rMax = tmp_rMin+m_muonStation->Rsize()/scale; + tmp_rMax = tmp_rMin+muonStation->Rsize()/scale; if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin; if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax; } @@ -379,7 +382,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::getMdtRegions(const LVL1::RecMuonRoI* // -------------------------------------------------------------------------------- void TrigL2MuonSA::MdtRegionDefiner::find_station_sector(std::string name, int phi, bool& endcap, - int& chamber, int& sector) + int& chamber, int& sector) const { if(name[0]=='E' || name[0]=='F' || (name[0]=='B' && name[1]=='E')) endcap = true; @@ -419,7 +422,7 @@ void TrigL2MuonSA::MdtRegionDefiner::find_station_sector(std::string name, int p // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max(float phiMiddle, float& phiMin, float& phiMax) +void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max(float phiMiddle, float& phiMin, float& phiMax) const { phiMin = phiMiddle - 0.1; phiMax = phiMiddle + 0.1; @@ -431,7 +434,7 @@ void TrigL2MuonSA::MdtRegionDefiner::find_phi_min_max(float phiMiddle, float& ph // -------------------------------------------------------------------------------- void TrigL2MuonSA::MdtRegionDefiner::find_eta_min_max(float zMin, float rMin, float zMax, float rMax, - float& etaMin, float& etaMax) + float& etaMin, float& etaMax) const { // const bool doEmulateMuFast = true; const bool doEmulateMuFast = false; @@ -477,7 +480,7 @@ void TrigL2MuonSA::MdtRegionDefiner::find_eta_min_max(float zMin, float rMin, fl // -------------------------------------------------------------------------------- void TrigL2MuonSA::MdtRegionDefiner::find_barrel_road_dim(float max_road, float aw, float bw, - float rMin,float rMax,float *zMin,float *zMax) + float rMin,float rMax,float *zMin,float *zMax) const { float ia,iaq,dz,z,points[4]; int i; @@ -513,7 +516,7 @@ void TrigL2MuonSA::MdtRegionDefiner::find_barrel_road_dim(float max_road, float // -------------------------------------------------------------------------------- void TrigL2MuonSA::MdtRegionDefiner::find_endcap_road_dim(float road,float aw, float bw, float zMin, - float zMax,float *rMin,float *rMax) + float zMax,float *rMin,float *rMax) const { float r,points[4]; int i; @@ -590,7 +593,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::prepareTgcPoints(const TrigL2MuonSA:: StatusCode TrigL2MuonSA::MdtRegionDefiner::computePhi(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::RpcFitResult& rpcFitResult, const TrigL2MuonSA::MdtRegion& mdtRegion, - TrigL2MuonSA::MuonRoad& muonRoad) + TrigL2MuonSA::MuonRoad& muonRoad) const { int barrel_inner = xAOD::L2MuonParameters::Chamber::BarrelInner; int barrel_middle = xAOD::L2MuonParameters::Chamber::BarrelMiddle; @@ -661,7 +664,7 @@ StatusCode TrigL2MuonSA::MdtRegionDefiner::computePhi(const LVL1::RecMuonRoI* p_ StatusCode TrigL2MuonSA::MdtRegionDefiner::computePhi(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::TgcFitResult& tgcFitResult, const TrigL2MuonSA::MdtRegion& mdtRegion, - TrigL2MuonSA::MuonRoad& muonRoad) + TrigL2MuonSA::MuonRoad& muonRoad) const { int endcap_inner = xAOD::L2MuonParameters::Chamber::EndcapInner; int endcap_middle = xAOD::L2MuonParameters::Chamber::EndcapMiddle; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h index 4e5e8ac0f4da63bfbba9f811e9fbe76f86721226..8d7cd555ea90da0946ad280a192d3aba90a568c6 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MdtRegionDefiner.h @@ -50,43 +50,40 @@ namespace TrigL2MuonSA { StatusCode getMdtRegions(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::RpcFitResult& rpcFitResult, TrigL2MuonSA::MuonRoad& muonRoad, - TrigL2MuonSA::MdtRegion& mdtRegion); + TrigL2MuonSA::MdtRegion& mdtRegion) const; StatusCode getMdtRegions(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::TgcFitResult& tgcFitResult, TrigL2MuonSA::MuonRoad& muonRoad, - TrigL2MuonSA::MdtRegion& mdtRegion); + TrigL2MuonSA::MdtRegion& mdtRegion) const; private: StatusCode prepareTgcPoints(const TrigL2MuonSA::TgcHits& tgcHits); void find_barrel_road_dim(float max_road, float aw, float bw, - float rMmin,float rMax,float *zMin,float *zMax); + float rMmin,float rMax,float *zMin,float *zMax) const; void find_endcap_road_dim(float road,float aw, float bw, float zMin, - float zMax,float *rMin,float *rMax); + float zMax,float *rMin,float *rMax) const; void find_eta_min_max(float zMin, float rMin, float zMax, float rMax, - float& etaMin, float& etaMax); - void find_phi_min_max(float phiMiddle, float& phiMin, float& phiMax); + float& etaMin, float& etaMax) const; + void find_phi_min_max(float phiMiddle, float& phiMin, float& phiMax) const; - void find_station_sector(std::string name, int phi, bool& endcap, int& chamber, int& sector); + void find_station_sector(std::string name, int phi, bool& endcap, int& chamber, int& sector) const; StatusCode computePhi(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::RpcFitResult& rpcFitResult, const TrigL2MuonSA::MdtRegion& mdtRegion, - TrigL2MuonSA::MuonRoad& muonRoad); + TrigL2MuonSA::MuonRoad& muonRoad) const; StatusCode computePhi(const LVL1::RecMuonRoI* p_roi, const TrigL2MuonSA::TgcFitResult& tgcFitResult, const TrigL2MuonSA::MdtRegion& mdtRegion, - TrigL2MuonSA::MuonRoad& muonRoad); + TrigL2MuonSA::MuonRoad& muonRoad) const; private: ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; - const MuonGM::MdtReadoutElement* m_mdtReadout {nullptr}; - const MuonGM::MuonStation* m_muonStation {nullptr}; - bool m_use_rpc {true}; TrigL2MuonSA::TgcFit::PointArray m_tgcStripMidPoints; // List of TGC strip middle station points. diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx index 743f13929934ad5767b6dc7972d4e50c5eb613a8..9350fa9f89247ba34c5f2c9679c6bf549ef41c5c 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.cxx @@ -32,7 +32,7 @@ StatusCode TrigL2MuonSA::MuFastPatternFinder::initialize() // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -void TrigL2MuonSA::MuFastPatternFinder::doMdtCalibration(TrigL2MuonSA::MdtHitData& mdtHit, double track_phi, double phi0, bool isEndcap) +void TrigL2MuonSA::MuFastPatternFinder::doMdtCalibration(TrigL2MuonSA::MdtHitData& mdtHit, double track_phi, double phi0, bool isEndcap) const { int StationName = mdtHit.name; int StationEta = mdtHit.StationEta; @@ -108,7 +108,7 @@ StatusCode TrigL2MuonSA::MuFastPatternFinder::findPatterns(const TrigL2MuonSA::M TrigL2MuonSA::MdtHits& mdtHits, TrigL2MuonSA::StgcHits& stgcHits, TrigL2MuonSA::MmHits& mmHits, - std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns) + std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns) const { ATH_CHECK( findPatterns(muonRoad, mdtHits, v_trackPatterns) ); ATH_CHECK( m_nswPatternFinder->findPatterns(muonRoad, stgcHits, mmHits, v_trackPatterns.back()) ); @@ -128,7 +128,7 @@ StatusCode TrigL2MuonSA::MuFastPatternFinder::findPatterns(const TrigL2MuonSA::M StatusCode TrigL2MuonSA::MuFastPatternFinder::findPatterns(const TrigL2MuonSA::MuonRoad& muonRoad, TrigL2MuonSA::MdtHits& mdtHits, - std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns) + std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns) const { // find only 1 track pattern @@ -309,7 +309,7 @@ StatusCode TrigL2MuonSA::MuFastPatternFinder::findPatterns(const TrigL2MuonSA::M // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -double TrigL2MuonSA::MuFastPatternFinder::calc_residual(double aw,double bw,double x,double y) +double TrigL2MuonSA::MuFastPatternFinder::calc_residual(double aw,double bw,double x,double y) const { const double ZERO_LIMIT = 1e-4; if( fabs(aw) < ZERO_LIMIT ) return y-bw; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.h index 01f3e4f64210caa5825d003da7b092b2e61521ec..3c4dc37107011cc15e16edd66543b3d2eec3cde5 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastPatternFinder.h @@ -47,20 +47,20 @@ class MuFastPatternFinder: public AthAlgTool private: - double calc_residual(double aw,double bw,double x,double y); - void doMdtCalibration(TrigL2MuonSA::MdtHitData& mdtHit, double track_phi, double phi0, bool isEndcap); + double calc_residual(double aw,double bw,double x,double y) const; + void doMdtCalibration(TrigL2MuonSA::MdtHitData& mdtHit, double track_phi, double phi0, bool isEndcap) const; public: StatusCode findPatterns(const TrigL2MuonSA::MuonRoad& muonRoad, TrigL2MuonSA::MdtHits& mdtHits, - std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns); + std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns) const; StatusCode findPatterns(const TrigL2MuonSA::MuonRoad& muonRoad, TrigL2MuonSA::MdtHits& mdtHits, TrigL2MuonSA::StgcHits& stgcHits, TrigL2MuonSA::MmHits& mmHits, - std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns); + std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns) const; private: ToolHandle<NswPatternFinder> m_nswPatternFinder {this, "NswPatternFinder", "TrigL2MuonSA::NswPatternFinder"}; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.cxx index c1af2468ba6b12cb0c5c19d70d6cb1f59bb74199..918ef9da7781b4c13753101980180e9351ff727d 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.cxx @@ -29,7 +29,7 @@ TrigL2MuonSA::MuFastTrackExtrapolator::MuFastTrackExtrapolator(const std::string // -------------------------------------------------------------------------------- StatusCode TrigL2MuonSA::MuFastTrackExtrapolator::extrapolateTrack(std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns, - double winPt) + double winPt) const { ATH_MSG_DEBUG("in extrapolateTrack"); @@ -110,7 +110,8 @@ void TrigL2MuonSA::MuFastTrackExtrapolator::setMuFastRes(std::vector<double>& ve // Copied from TrigmuComb/muCombUtil.cxx double TrigL2MuonSA::MuFastTrackExtrapolator::getMuFastRes(std::vector<double> vec, const double pt, const int add, - const double eta, const double phi) { + const double eta, const double phi) const +{ if (pt == 0) return 1.0e30; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h index 7e54a8d3006f097313815733b6e870464d9eca39..84d3779d4a6a7600cb747d56df29b34b4c2dfce3 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuFastTrackExtrapolator.h @@ -25,11 +25,11 @@ namespace TrigL2MuonSA { void setExtrapolatorTool(ToolHandle<ITrigMuonBackExtrapolator>* backExtrapolator) {m_backExtrapolatorTool = backExtrapolator;}; StatusCode extrapolateTrack(std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns, - double winPt); + double winPt) const; void setMuFastRes(std::vector<double>& vec, double p1,double p2, double p3,double p4,double p5,double p6); - double getMuFastRes(std::vector<double> vec, const double pt, const int add, const double eta, const double phi); + double getMuFastRes(std::vector<double> vec, const double pt, const int add, const double eta, const double phi) const; private: ToolHandle<ITrigMuonBackExtrapolator>* m_backExtrapolatorTool {nullptr}; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.cxx index fcd5fbbe3ed3301b2c00309f4b02043db029f757..19f159de614692a7b952ceceb9bb6d55c4d808bd 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.cxx @@ -17,7 +17,7 @@ TrigL2MuonSA::NswStationFitter::NswStationFitter(const std::string& type, } StatusCode TrigL2MuonSA::NswStationFitter::superPointFitter(const LVL1::RecMuonRoI* p_roi, - TrigL2MuonSA::TrackPattern& trackPattern) + TrigL2MuonSA::TrackPattern& trackPattern) const { ATH_MSG_DEBUG("NswStationFitter::findSuperPoints() was called."); @@ -34,7 +34,7 @@ StatusCode TrigL2MuonSA::NswStationFitter::superPointFitter(const LVL1::RecMuonR } StatusCode TrigL2MuonSA::NswStationFitter::selectStgcHits(const LVL1::RecMuonRoI* p_roi, - TrigL2MuonSA::StgcHits& stgcHits) + TrigL2MuonSA::StgcHits& stgcHits) const { TrigL2MuonSA::StgcHits selectedStgcHits; @@ -80,7 +80,7 @@ StatusCode TrigL2MuonSA::NswStationFitter::selectStgcHits(const LVL1::RecMuonRoI } StatusCode TrigL2MuonSA::NswStationFitter::selectMmHits(const LVL1::RecMuonRoI* p_roi, - TrigL2MuonSA::MmHits& mmHits) + TrigL2MuonSA::MmHits& mmHits) const { TrigL2MuonSA::MmHits selectedMmHits; @@ -127,7 +127,7 @@ StatusCode TrigL2MuonSA::NswStationFitter::selectMmHits(const LVL1::RecMuonRoI* } -StatusCode TrigL2MuonSA::NswStationFitter::calcWeightedSumHit(TrigL2MuonSA::TrackPattern& trackPattern) +StatusCode TrigL2MuonSA::NswStationFitter::calcWeightedSumHit(TrigL2MuonSA::TrackPattern& trackPattern) const { TrigL2MuonSA::StgcHits stgcHits = trackPattern.stgcSegment; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.h index 13cace4562e86c5336f3d7be13ffcd37f7e79ba4..b04aaa86cc8e543ceac802aa336dc58baa321dd2 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/NswStationFitter.h @@ -28,15 +28,15 @@ namespace TrigL2MuonSA { const IInterface* parent); StatusCode superPointFitter(const LVL1::RecMuonRoI* p_roi, - TrigL2MuonSA::TrackPattern& trackPattern); + TrigL2MuonSA::TrackPattern& trackPattern) const; StatusCode selectStgcHits(const LVL1::RecMuonRoI* p_roi, - TrigL2MuonSA::StgcHits& stgcHits); + TrigL2MuonSA::StgcHits& stgcHits) const; StatusCode selectMmHits(const LVL1::RecMuonRoI* p_roi, - TrigL2MuonSA::MmHits& mmHits); + TrigL2MuonSA::MmHits& mmHits) const; - StatusCode calcWeightedSumHit(TrigL2MuonSA::TrackPattern& trackPattern); + StatusCode calcWeightedSumHit(TrigL2MuonSA::TrackPattern& trackPattern) const; private : diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx index 70bd86d3672f77dd929cd91a6c02eb63283d7c6f..c37eae8c7f1f10ddfbc20bee6daef677d8b610fc 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx @@ -43,7 +43,7 @@ void TrigL2MuonSA::PtFromAlphaBeta::setMCFlag(BooleanProperty use_mcLUT, // -------------------------------------------------------------------------------- StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt(TrigL2MuonSA::TrackPattern& trackPattern, - TrigL2MuonSA::TgcFitResult& tgcFitResult) + TrigL2MuonSA::TgcFitResult& tgcFitResult) const { if (trackPattern.etaBin < -1) diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.h index 2d3afb4aec86d91dd960983d90f6f3923ce95b46..70d72ea182afb4da3d4f30e104b3252c319be7a6 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.h @@ -32,7 +32,7 @@ class PtFromAlphaBeta: public AthAlgTool public: StatusCode setPt(TrigL2MuonSA::TrackPattern& trackPattern, - TrigL2MuonSA::TgcFitResult& tgcFitResult); + TrigL2MuonSA::TgcFitResult& tgcFitResult) const; double compute_radius(double InnerSlope, double InnerR, double InnerZ, double MiddleSlope, double MiddleR, double MiddleZ, diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx index b8a22b7c24dc38941ad670e693c7bf243661e47f..8b0778496fed5f0fcf6a680ba0cddbb82ae9df7c 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx @@ -32,7 +32,7 @@ void TrigL2MuonSA::PtFromRadius::setMCFlag(BooleanProperty use_mcLUT, // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtFromRadius::setPt(TrigL2MuonSA::TrackPattern& trackPattern) +StatusCode TrigL2MuonSA::PtFromRadius::setPt(TrigL2MuonSA::TrackPattern& trackPattern) const { const double ZERO_LIMIT = 1e-5; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.h index 0d51efd779795a43bf4bbb329abebdc54608f2b2..f3d9e9a6ab9ac864c20c5f454d8f98cba886b4fb 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.h @@ -29,7 +29,7 @@ class PtFromRadius: public AthAlgTool public: // For Barrel - StatusCode setPt(TrigL2MuonSA::TrackPattern& trackPattern); + StatusCode setPt(TrigL2MuonSA::TrackPattern& trackPattern) const; private: BooleanProperty m_use_mcLUT{0}; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.h index 091cedda2bd8c7db61789e79efcc8d88e861dbf0..5c031b02f77d37b4893a81284104de208b49d408 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.h @@ -16,13 +16,13 @@ class RecMuonRoIUtils ~RecMuonRoIUtils() {}; public: - bool isBarrel(const LVL1::RecMuonRoI* p_roi){ + bool isBarrel(const LVL1::RecMuonRoI* p_roi) const { return (p_roi->sysID()==0) ? true : false; }; - bool isLowPt(const LVL1::RecMuonRoI* p_roi){ + bool isLowPt(const LVL1::RecMuonRoI* p_roi) const { return (p_roi->getThresholdNumber() <4) ? true : false; }; - bool isHighPt(const LVL1::RecMuonRoI* p_roi){ + bool isHighPt(const LVL1::RecMuonRoI* p_roi) const { return (p_roi->getThresholdNumber()>=4) ? true : false; }; }; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx index 16cc5e662b05b8b763a8eb7b5492e62af1c7ac12..45e271dd9a883bdbf7776a6d4adb180bf24cbfcd 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.cxx @@ -40,7 +40,7 @@ StatusCode TrigL2MuonSA::RpcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* double roiEtaMinLow, double roiEtaMaxLow, double roiEtaMinHigh, - double roiEtaMaxHigh) + double roiEtaMaxHigh) const { const double ZERO_LIMIT = 1e-5; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h index 2d048de141ae9740fe5612126d82d20019d28797..3c21dc00fc7f794ca6581ea2dce04c623299ca73 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcRoadDefiner.h @@ -47,7 +47,7 @@ class RpcRoadDefiner: public AthAlgTool double roiEtaMinLow, double roiEtaMaxLow, double roiEtaMinHigh, - double roiEtaMaxHigh); + double roiEtaMaxHigh) const; void setMdtGeometry(const ServiceHandle<IRegSelSvc>& regionSelector){ m_regionSelector = regionSelector; }; void setRoadWidthForFailure(double rWidth_RPC_Failed){ m_rWidth_RPC_Failed = rWidth_RPC_Failed; }; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.cxx index 6b5088969bba6e70aa9c12254899a7e9d79959b7..7ea260af65bbcca69a55e45781c695aae2d20998 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.cxx @@ -36,7 +36,7 @@ void TrigL2MuonSA::SagittaRadiusEstimate::setMCFlag(BooleanProperty use_mcLUT, StatusCode TrigL2MuonSA::SagittaRadiusEstimate::setSagittaRadius(const LVL1::RecMuonRoI* p_roi, TrigL2MuonSA::RpcFitResult& rpcFitResult, - TrigL2MuonSA::TrackPattern& trackPattern) + TrigL2MuonSA::TrackPattern& trackPattern) const { const int MAX_STATION = 4; const float ZERO_LIMIT = 1e-5; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.h index f0d837cafe548de37046d7922d87fefef4739690..e7cd91234d6eea3dd00d47421a53d721eb68f1a2 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/SagittaRadiusEstimate.h @@ -36,7 +36,7 @@ namespace TrigL2MuonSA { StatusCode setSagittaRadius(const LVL1::RecMuonRoI* p_roi, TrigL2MuonSA::RpcFitResult& rpcFitResult, - TrigL2MuonSA::TrackPattern& trackPattern); + TrigL2MuonSA::TrackPattern& trackPattern) const; private: diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.cxx index f71644cdb8c2f81a1b8c14bc72d26d941e08dc69..8b97200d32aaa467f68344aff28648b2e7f26a38 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.cxx @@ -48,7 +48,7 @@ double TrigL2MuonSA::TgcFit::LinStats::eval(double fX) const // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -void TrigL2MuonSA::TgcFit::SimpleStatistics(TrigL2MuonSA::TgcFit::PointArray& points, TrigL2MuonSA::TgcFit::SimpleStats& stats) +void TrigL2MuonSA::TgcFit::SimpleStatistics(TrigL2MuonSA::TgcFit::PointArray& points, TrigL2MuonSA::TgcFit::SimpleStats& stats) const { double *y = new double[points.size()]; double *w = new double[points.size()]; @@ -104,7 +104,7 @@ void TrigL2MuonSA::TgcFit::SimpleStatistics(TrigL2MuonSA::TgcFit::PointArray& po // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -void TrigL2MuonSA::TgcFit::linReg(TrigL2MuonSA::TgcFit::PointArray& points, TrigL2MuonSA::TgcFit::LinStats& stats) +void TrigL2MuonSA::TgcFit::linReg(TrigL2MuonSA::TgcFit::PointArray& points, TrigL2MuonSA::TgcFit::LinStats& stats) const { double *x = new double[points.size()]; double *y = new double[points.size()]; @@ -179,7 +179,7 @@ void TrigL2MuonSA::TgcFit::linReg(TrigL2MuonSA::TgcFit::PointArray& points, Trig TrigL2MuonSA::TgcFit::Status TrigL2MuonSA::TgcFit::runTgcMiddle(TrigL2MuonSA::TgcFit::PointArray& stripPoints, TrigL2MuonSA::TgcFit::PointArray& wirePoints, - TrigL2MuonSA::TgcFitResult& tgcFitResult) + TrigL2MuonSA::TgcFitResult& tgcFitResult) const { ATH_MSG_DEBUG("TrigL2MuonSA::TgcFit::runTgcMiddle stripPoints=" << stripPoints.size() << " wirePoints=" << wirePoints.size()); @@ -304,7 +304,7 @@ TrigL2MuonSA::TgcFit::Status TrigL2MuonSA::TgcFit::runTgcMiddle(TrigL2MuonSA::Tg TrigL2MuonSA::TgcFit::Status TrigL2MuonSA::TgcFit::runTgcInner(TrigL2MuonSA::TgcFit::PointArray& stripPoints, TrigL2MuonSA::TgcFit::PointArray& wirePoints, - TrigL2MuonSA::TgcFitResult& tgcFitResult) + TrigL2MuonSA::TgcFitResult& tgcFitResult) const { Status status = FIT_NONE; SimpleStats stripStats; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.h index c418c0524773765ac829ff24ea59bc0f6982cd67..d69ad5bea68d3a03ba9dd7189860bc3453dd647b 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcFit.h @@ -176,18 +176,18 @@ class TgcFit: public AthAlgTool * @param points The input list of data points. * @param stats The statistics struct to fill with fit results. */ - void linReg(PointArray& points, LinStats& stats); + void linReg(PointArray& points, LinStats& stats) const; /* * Calculate simple statistics for the Y values of a set of points. * @param points The input list of data points. * @param stats The statistics struct to fill with fit results. */ - void SimpleStatistics(PointArray& points, SimpleStats& stats); + void SimpleStatistics(PointArray& points, SimpleStats& stats) const; /* * Fit data to TGC. Calculate outliers and fit lines to strip and wire points. */ - Status runTgcMiddle(PointArray& stripPoints, PointArray& wirePoints, TgcFitResult& fitResult); - Status runTgcInner(PointArray& stripPoints, PointArray& wirePoints, TgcFitResult& fitResult); + Status runTgcMiddle(PointArray& stripPoints, PointArray& wirePoints, TgcFitResult& fitResult) const; + Status runTgcInner(PointArray& stripPoints, PointArray& wirePoints, TgcFitResult& fitResult) const; protected: PointArray m_superPoints; /**< List of wire (eta) super-points. */ @@ -196,7 +196,7 @@ class TgcFit: public AthAlgTool unsigned m_MIN_WIRE_POINTS { 4 }; /**< Minimum number of wire points for linear fit. */ unsigned m_MIN_STRIP_POINTS { 3 }; /**< Minimum number of strip points for linear fit. */ - void printDebug(const std::string& str){ ATH_MSG_DEBUG(str); }; + void printDebug(const std::string& str) const { ATH_MSG_DEBUG(str); }; }; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx index 462859b0adc50bc55368baec8b99c5b630ba1fff..7511369023e3682798d62c7c3fd66c73747dc78e 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.cxx @@ -47,7 +47,7 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* const bool insideOut, const TrigL2MuonSA::TgcHits& tgcHits, TrigL2MuonSA::MuonRoad& muonRoad, - TrigL2MuonSA::TgcFitResult& tgcFitResult) + TrigL2MuonSA::TgcFitResult& tgcFitResult) const { const int N_STATION = 10; const int N_LAYER = 8; @@ -73,12 +73,17 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* int barrel_inner = xAOD::L2MuonParameters::Chamber::BarrelInner; int csc = xAOD::L2MuonParameters::Chamber::CSC; int bee = xAOD::L2MuonParameters::Chamber::BEE; - + + TrigL2MuonSA::TgcFit::PointArray tgcStripMidPoints; // List of TGC strip middle station points. + TrigL2MuonSA::TgcFit::PointArray tgcWireMidPoints; // List of TGC wire middle station points. + TrigL2MuonSA::TgcFit::PointArray tgcStripInnPoints; // List of TGC strip inner station points. + TrigL2MuonSA::TgcFit::PointArray tgcWireInnPoints; // List of TGC wire inner station points. + if (tgcHits.size()>0) { // TGC data is properly read // Split digits to Strip/Wire points. - if( ! prepareTgcPoints(tgcHits) ) { + if( ! prepareTgcPoints(tgcHits, tgcStripInnPoints, tgcWireInnPoints, tgcStripMidPoints, tgcWireMidPoints) ) { ATH_MSG_ERROR("Preparation of Tgc points failed"); return StatusCode::FAILURE; } @@ -86,7 +91,7 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* // Fit lines to TGC middle station isMiddleFailure = false; - TgcFit::Status status = m_tgcFit->runTgcMiddle(m_tgcStripMidPoints, m_tgcWireMidPoints, tgcFitResult); + TgcFit::Status status = m_tgcFit->runTgcMiddle(tgcStripMidPoints, tgcWireMidPoints, tgcFitResult); if (status == TgcFit::FIT_NONE) { ATH_MSG_WARNING("Fit to TGC middle station points failed"); isMiddleFailure = true; @@ -96,7 +101,7 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* } // Fit lines to TGC inner station - status = m_tgcFit->runTgcInner(m_tgcStripInnPoints, m_tgcWireInnPoints, tgcFitResult); + status = m_tgcFit->runTgcInner(tgcStripInnPoints, tgcWireInnPoints, tgcFitResult); if (status == TgcFit::FIT_NONE) { ATH_MSG_DEBUG("Fit to TGC inner station points failed"); } @@ -402,19 +407,18 @@ StatusCode TrigL2MuonSA::TgcRoadDefiner::defineRoad(const LVL1::RecMuonRoI* // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -bool TrigL2MuonSA::TgcRoadDefiner::prepareTgcPoints(const TrigL2MuonSA::TgcHits& tgcHits) +bool TrigL2MuonSA::TgcRoadDefiner::prepareTgcPoints(const TrigL2MuonSA::TgcHits& tgcHits, + TrigL2MuonSA::TgcFit::PointArray& tgcStripInnPoints, + TrigL2MuonSA::TgcFit::PointArray& tgcWireInnPoints, + TrigL2MuonSA::TgcFit::PointArray& tgcStripMidPoints, + TrigL2MuonSA::TgcFit::PointArray& tgcWireMidPoints) const { const double PHI_BOUNDARY = 0.2; - ATH_MSG_DEBUG(", m_tgcStripMidPoints.size()=" << m_tgcStripMidPoints.size() << - ", m_tgcStripInnPoints.size()=" << m_tgcStripInnPoints.size() << - ", m_tgcWireMidPoints.size()=" << m_tgcWireMidPoints.size() << - ", m_tgcWireInnPoints.size()=" << m_tgcWireInnPoints.size()); - - m_tgcStripMidPoints.clear(); - m_tgcStripInnPoints.clear(); - m_tgcWireMidPoints.clear(); - m_tgcWireInnPoints.clear(); + tgcStripMidPoints.clear(); + tgcStripInnPoints.clear(); + tgcWireMidPoints.clear(); + tgcWireInnPoints.clear(); // loop over TGC digits. unsigned int iHit; @@ -433,15 +437,20 @@ bool TrigL2MuonSA::TgcRoadDefiner::prepareTgcPoints(const TrigL2MuonSA::TgcHits& w *= hit.r * hit.r; double phi = hit.phi; if( phi < 0 && ( (M_PI+phi)<PHI_BOUNDARY) ) phi += M_PI*2; - if ( hit.sta < 3 ) { m_tgcStripMidPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, phi, w)); } - else if ( hit.sta ==3 ) { m_tgcStripInnPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, phi, w)); } + if ( hit.sta < 3 ) { tgcStripMidPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, phi, w)); } + else if ( hit.sta ==3 ) { tgcStripInnPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, phi, w)); } } else { - if ( hit.sta < 3 ) { m_tgcWireMidPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, hit.r, w)); } - else if ( hit.sta ==3 ) { m_tgcWireInnPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, hit.r, w)); } + if ( hit.sta < 3 ) { tgcWireMidPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, hit.r, w)); } + else if ( hit.sta ==3 ) { tgcWireInnPoints.push_back(TgcFit::Point(iHit + 1, hit.sta, hit.z, hit.r, w)); } } } - + + ATH_MSG_DEBUG(", tgcStripMidPoints.size()=" << tgcStripMidPoints.size() << + ", tgcStripInnPoints.size()=" << tgcStripInnPoints.size() << + ", tgcWireMidPoints.size()=" << tgcWireMidPoints.size() << + ", tgcWireInnPoints.size()=" << tgcWireInnPoints.size()); + return true; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h index 0ee78135ca39ca997e13dcd93396c6c19cf6223a..6987ce71bf4d95a295d67d7bc64ba246b93f8d46 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/TgcRoadDefiner.h @@ -40,15 +40,19 @@ class TgcRoadDefiner: public AthAlgTool const bool insideOut, const TrigL2MuonSA::TgcHits& tgcHits, TrigL2MuonSA::MuonRoad& muonRoad, - TrigL2MuonSA::TgcFitResult& tgcFitResult); + TrigL2MuonSA::TgcFitResult& tgcFitResult) const; void setMdtGeometry(const ServiceHandle<IRegSelSvc>& regionSelector) { m_regionSelector = regionSelector; }; void setPtLUT(const TrigL2MuonSA::PtEndcapLUTSvc* ptEndcapLUTSvc) { m_ptEndcapLUT = ptEndcapLUTSvc->ptEndcapLUT(); }; void setRoadWidthForFailure(double rWidth_TGC_Failed) { m_rWidth_TGC_Failed = rWidth_TGC_Failed; }; void setExtrapolatorTool(ToolHandle<ITrigMuonBackExtrapolator>* backExtrapolator) { m_backExtrapolatorTool = backExtrapolator; }; - bool prepareTgcPoints(const TrigL2MuonSA::TgcHits& tgcHits); - + bool prepareTgcPoints(const TrigL2MuonSA::TgcHits& tgcHits, + TrigL2MuonSA::TgcFit::PointArray& tgcStripInnPoints, + TrigL2MuonSA::TgcFit::PointArray& tgcWireInnPoints, + TrigL2MuonSA::TgcFit::PointArray& tgcStripMidPoints, + TrigL2MuonSA::TgcFit::PointArray& tgcWireMidPoints) const; + private: // setted in MuFastSteering::hltInitialize, setExtrapolatorTool ToolHandle<ITrigMuonBackExtrapolator>* m_backExtrapolatorTool {nullptr}; @@ -57,11 +61,6 @@ class TgcRoadDefiner: public AthAlgTool ToolHandle<TgcFit> m_tgcFit {"TrigL2MuonSA::TgcFit"}; - TrigL2MuonSA::TgcFit::PointArray m_tgcStripMidPoints; // List of TGC strip middle station points. - TrigL2MuonSA::TgcFit::PointArray m_tgcWireMidPoints; // List of TGC wire middle station points. - TrigL2MuonSA::TgcFit::PointArray m_tgcStripInnPoints; // List of TGC strip inner station points. - TrigL2MuonSA::TgcFit::PointArray m_tgcWireInnPoints; // List of TGC wire inner station points. - double m_rWidth_TGC_Failed {0}; ServiceHandle<IRegSelSvc> m_regionSelector;