 |
ATLAS Offline Software
|
Go to the documentation of this file.
31 declareInterface<IMuonSegmentCleaner>(
this);
46 return StatusCode::SUCCESS;
63 std::vector<const Trk::MeasurementBase*>::const_iterator mit = meas.begin();
64 std::vector<const Trk::MeasurementBase*>::const_iterator mit_end = meas.end();
74 std::vector<const Trk::RIO_OnTrack*> rots;
75 std::vector<const Trk::CompetingRIOsOnTrack*> crots;
76 rots.reserve(2*meas.size());
77 crots.reserve(2*meas.size());
79 for( ; mit!=mit_end;++mit ){
86 crots.push_back(
nullptr);
98 crots.push_back(crio);
104 unsigned int nMeas = rots.size();
105 unsigned int nphi = 0;
108 std::vector <const Trk::RIO_OnTrack*> rots_phi(nMeas);
109 std::vector <const Trk::CompetingRIOsOnTrack*> crots_phi(nMeas);
110 std::vector <const Trk::MeasurementBase*> meas_phi(nMeas);
111 std::vector <double> dis_phi(nMeas);
112 std::vector <int> chambercode_phi(nMeas);
113 std::vector <int> stripcode_phi(nMeas);
114 std::vector <int> ok_phi(nMeas);
115 std::vector <int> det_phi(nMeas);
116 std::vector <Identifier> id_phi(nMeas);
118 if (
m_debug) std::cout <<
" MuonSegmentAmbiCleanerTool nMeas " << nMeas <<
" competing rios: " << crots.size() << std::endl;
120 for (
unsigned int i=0;
i<rots.size();
i++){
126 meas_keep.push_back(rot->
clone());
131 meas_keep.push_back(rot->
clone());
137 meas_keep.push_back(rot->
clone());
142 meas_keep.push_back(rot->
clone());
153 rots_phi[nphi] = rot;
154 crots_phi[nphi] = crots[
i];
155 chambercode_phi[nphi] = 0;
156 stripcode_phi[nphi] = 0;
159 dis_phi[nphi] = 10000000;
164 chambercode_phi[nphi] =
code;
165 stripcode_phi[nphi] =
m_idHelperSvc->rpcIdHelper().strip(
id);
178 double disRPC = lSegmentPos.z() - lHitPos.z() + lSegmentDir.z()*(lHitPos.y()-lSegmentPos.y())/lSegmentDir.y();
180 std::cout <<
" ghit pos x " << gHitPos.x() <<
" y " << gHitPos.y() <<
" z " << gHitPos.z() << std::endl;
181 std::cout <<
" dis RPC " << disRPC << std::endl;
183 dis_phi[nphi] = disRPC;
188 chambercode_phi[nphi] =
code;
189 stripcode_phi[nphi] =
m_idHelperSvc->tgcIdHelper().channel(
id);
202 double disTGC = lSegmentPos.y() - lHitPos.y() + lSegmentDir.y()*(lHitPos.z()-lSegmentPos.z())/lSegmentDir.z();
204 std::cout <<
" ghit pos x " << gHitPos.x() <<
" y " << gHitPos.y() <<
" z " << gHitPos.z() << std::endl;
205 std::cout <<
" dis TGC " << disTGC << std::endl;
207 dis_phi[nphi] = disTGC;
211 if (
m_debug) std::cout <<
" Distance to segment " << dis_phi[nphi] << std::endl;
212 if (ok_phi[nphi] == 1 ) nphi++;
216 bool changeSegment =
false;
220 for(
unsigned int i = 0;
i < nphi-1 ; ++
i ) {
221 if (ok_phi[
i] == 0)
continue;
222 for(
unsigned int j =
i+1 ; j < nphi ; ++j ) {
223 if (ok_phi[j] == 0)
continue;
225 if ( stripcode_phi[
i] == stripcode_phi[j] && chambercode_phi[
i] == chambercode_phi[j] ) ambi =
true;
229 if (det_phi[
i] == 1 && det_phi[j] == 1 &&
m_debug) {
233 if (det_phi[
i] == 2 && det_phi[j] == 2 &&
m_debug) {
238 if (
m_debug) {
ATH_MSG_DEBUG(
" Ambiguous " <<
" Distance1 " << dis_phi[
i] <<
" Distance1 " << dis_phi[j]); }
239 if (dis_phi[
i]!= 0.&& dis_phi[j]!=0) {
240 if ( fabs(dis_phi[
i]) < fabs(dis_phi[j]) ) {
249 ATH_MSG_DEBUG(
" index " <<
i <<
" strip " << stripcode_phi [
i] <<
" chambercode " << chambercode_phi[
i] <<
" selected " << ok_phi[
i] <<
" segment distance " << dis_phi[
i]);
250 ATH_MSG_DEBUG(
" index " << j <<
" strip " << stripcode_phi [j] <<
" chambercode " << chambercode_phi[j] <<
" selected " << ok_phi[j] <<
" segment distance " << dis_phi[j]);
258 for(
unsigned int i = 0;
i < nphi ;
i++ ) {
261 for(
unsigned int j = 0; j < nphi ; j++ ) {
262 if (crots_phi[j] == crots_phi[
i] && j!=
i)
264 crots_phi[j]=
nullptr;
267 crots_phi[
i]=
nullptr;
274 std::set <const Trk::CompetingRIOsOnTrack*> selected_crots;
276 for (
unsigned int i=0;
i<nphi;++
i){
277 if (ok_phi[
i] == 1) {
280 if (det_phi[
i] == 1) nphirpcn++;
281 if (det_phi[
i] == 2) nphitgcn++;
282 meas_keep.push_back(rots_phi[
i]->
clone());
284 else if (selected_crots.count(crots_phi[
i]) == 0)
286 meas_keep.push_back(crots_phi[
i]->
clone());
287 selected_crots.insert(crots_phi[
i]);
288 if (det_phi[
i] == 1) nphirpcn++;
289 if (det_phi[
i] == 2) nphitgcn++;
291 }
if (ok_phi[
i] == 0 && (det_phi[
i] == 1||det_phi[
i] == 2)) {
292 changeSegment =
true;
298 std::cout <<
" Summary MuonSegmentAmbiCleaner (not accurate with competing rios!)" << std::endl;
299 std::cout <<
" Input Segment with " << netamdt <<
" MDT hits " << netacsc <<
" eta CSC hits " << netatgc <<
" eta TGC Hits " << netarpc <<
" eta RPC hits " << std::endl;
300 std::cout <<
" and " << nphicsc <<
" phi CSC hits " << nphitgc <<
" phi TGC Hits " << nphirpc <<
" phi RPC hits " << std::endl;
301 std::cout <<
" Output after Ambiguity removal " << nphitgcn <<
" phi TGC Hits " << nphirpcn <<
" phi RPC hits " << std::endl;
314 Amg::Vector2D locSegmentPos(lSegmentPos.x(),lSegmentPos.y());
320 std::move(meas_keep),
MuonSegmentAmbiCleaner(const std::string &, const std::string &, const IInterface *)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
virtual StatusCode initialize()
virtual RIO_OnTrack * clone() const override=0
Pseudo-constructor, needed to avoid excessive RTTI.
Eigen::Matrix< double, 2, 1 > Vector2D
virtual const Amg::Vector3D & globalPosition() const override
Returns the global position.
Class to represent calibrated clusters formed from TGC strips.
virtual FitQuality * clone() const
Virtual constructor.
Class to represent calibrated clusters formed from RPC strips.
#define ATH_MSG_VERBOSE(x)
MuonSegment_v1 MuonSegment
Reference the current persistent version:
virtual const TgcPrepData * prepRawData() const
Returns the TgcPrepData - is a TRT_DriftCircle in this scope.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
Class to represent RPC measurements.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const Trk::LocalDirection & localDirection() const
local direction
Eigen::Affine3d Transform3D
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
represents the three-dimensional global direction with respect to a planar surface frame.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
virtual const RpcPrepData * prepRawData() const override final
Returns the RpcPrepData - is a TRT_DriftCircle in this scope.
Identifier identify() const
return the identifier
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
FitQualityOnSurface fitQuality(const MultiComponentState &, const MeasurementBase &)
Method for determining the chi2 of the multi-component state and the number of degrees of freedom.
#define ATH_MSG_WARNING(x)
Identifier identify() const
return the identifier -extends MeasurementBase
Class to represent TGC measurements.
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
virtual const Amg::Vector3D & globalPosition() const override final
global position
bool m_summary
flag to print out a summary of what comes in and what comes out
const FitQuality * fitQuality() const
return the FitQuality object, returns NULL if no FitQuality is defined
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Polygon globalToLocal(const Polygon &pol, float z, const Trk::PlaneSurface &surf)
virtual const Muon::MuonSegment * resolve(const Muon::MuonSegment *segment) const
For one segment solve ambiguous RPC and TGC hits: different eta but same phi using the MDT extrapolat...
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
bool m_debug
flag to print out debugging information
const Amg::Vector3D & globalDirection() const
global direction