00001 #include "RecoTracker/TkDetLayers/interface/TkGeomDetCompatibilityChecker.h" 00002 #include "TrackingTools/DetLayers/interface/GeomDetCompatibilityChecker.h" 00003 #include "Geometry/TrackerGeometryBuilder/interface/GluedGeomDet.h" 00004 #include <DataFormats/SiStripDetId/interface/SiStripDetId.h> 00005 00006 using namespace std; 00007 00008 pair<bool, TrajectoryStateOnSurface> 00009 TkGeomDetCompatibilityChecker::isCompatible(const GeomDet* det, 00010 const TrajectoryStateOnSurface& tsos, 00011 const Propagator& prop, 00012 const MeasurementEstimator& est) const 00013 { 00014 GeomDetCompatibilityChecker checker; 00015 SiStripDetId siStripDetId(det->geographicalId()); 00016 if(!siStripDetId.glued()) return checker.isCompatible( det, tsos, prop, est); 00017 else { 00018 const GluedGeomDet* glued = static_cast<const GluedGeomDet*>( det); 00019 pair<bool, TrajectoryStateOnSurface> mono = 00020 checker.isCompatible(glued->monoDet(), tsos, prop, est); 00021 pair<bool, TrajectoryStateOnSurface> stereo = 00022 checker.isCompatible(glued->stereoDet(), tsos, prop, est); 00023 if (mono.first || stereo.first) { 00024 TrajectoryStateOnSurface gluedDetState = prop.propagate( tsos, det->specificSurface()); 00025 if (gluedDetState.isValid()) { 00026 return pair<bool, TrajectoryStateOnSurface>( true, gluedDetState); 00027 } 00028 else { 00029 return pair<bool, TrajectoryStateOnSurface>( false, gluedDetState); 00030 } 00031 } 00032 else { 00033 return pair<bool, TrajectoryStateOnSurface>( false, TrajectoryStateOnSurface()); 00034 } 00035 } 00036 } 00037