#include <RecoMuon/DetLayers/interface/MuRingForwardDoubleLayer.h>
Public Member Functions | |
const MuRingForwardLayer * | backLayer () const |
virtual const std::vector < const GeomDet * > & | basicComponents () const |
virtual std::pair< bool, TrajectoryStateOnSurface > | compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const |
tests the geometrical compatibility of the Det with the predicted state. | |
virtual std::vector< DetWithState > | compatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const |
Returns all Dets compatible with a trajectory state according to the estimator est. | |
virtual const std::vector < const GeometricSearchDet * > & | components () const |
Returns basic components, if any. | |
const MuRingForwardLayer * | frontLayer () const |
virtual std::vector< DetGroup > | groupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const |
Similar to compatibleDets(), but the compatible Dets are grouped in one or more groups. | |
virtual bool | hasGroups () const |
bool | isCrack (const GlobalPoint &gp) const |
bool | isInsideOut (const TrajectoryStateOnSurface &tsos) const |
MuRingForwardDoubleLayer (const std::vector< const ForwardDetRing * > &frontRings, const std::vector< const ForwardDetRing * > &backRings) | |
Constructor, takes ownership of pointers. | |
virtual const std::vector < const ForwardDetRing * > & | rings () const |
Return the vector of rings. | |
void | selfTest () const |
virtual SubDetector | subDetector () const |
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap). | |
virtual | ~MuRingForwardDoubleLayer () |
Protected Member Functions | |
virtual BoundDisk * | computeSurface () |
Private Attributes | |
MuRingForwardLayer | theBackLayer |
std::vector< const GeomDet * > | theBasicComponents |
std::vector< const GeometricSearchDet * > | theComponents |
MuRingForwardLayer | theFrontLayer |
std::vector< const ForwardDetRing * > | theRings |
Represents forward muon CSC stations.
Definition at line 21 of file MuRingForwardDoubleLayer.h.
MuRingForwardDoubleLayer::MuRingForwardDoubleLayer | ( | const std::vector< const ForwardDetRing * > & | frontRings, | |
const std::vector< const ForwardDetRing * > & | backRings | |||
) |
Constructor, takes ownership of pointers.
virtual MuRingForwardDoubleLayer::~MuRingForwardDoubleLayer | ( | ) | [inline, virtual] |
const MuRingForwardLayer* MuRingForwardDoubleLayer::backLayer | ( | ) | const [inline] |
Definition at line 71 of file MuRingForwardDoubleLayer.h.
References theBackLayer.
00071 {return &theBackLayer;}
virtual const std::vector<const GeomDet*>& MuRingForwardDoubleLayer::basicComponents | ( | ) | const [inline, virtual] |
Implements GeometricSearchDet.
Definition at line 34 of file MuRingForwardDoubleLayer.h.
References theBasicComponents.
00034 {return theBasicComponents;}
std::pair< bool, TrajectoryStateOnSurface > MuRingForwardDoubleLayer::compatible | ( | const TrajectoryStateOnSurface & | ts, | |
const Propagator & | , | |||
const MeasurementEstimator & | ||||
) | const [virtual] |
tests the geometrical compatibility of the Det with the predicted state.
The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.
Reimplemented from ForwardDetLayer.
Definition at line 90 of file MuRingForwardDoubleLayer.cc.
References BoundSurface::bounds(), deltaR(), err, TrajectoryStateOnSurface::hasError(), SimpleDiskBounds::inside(), insideOut, isInsideOut(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogTrace, HLT_VtxMuL3::nSigma, LocalTrajectoryError::positionError(), Propagator::propagate(), ForwardDetLayer::rmax(), ForwardDetLayer::rmin(), ForwardDetLayer::specificSurface(), funct::sqrt(), ForwardDetLayer::surface(), funct::tan(), theBackLayer, theFrontLayer, PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), tmp, LocalError::xx(), LocalError::yy(), ForwardDetLayer::zmax(), and ForwardDetLayer::zmin().
Referenced by compatibleDets().
00092 { 00093 // mostly copied from ForwardDetLayer, except propagates to closest surface, 00094 // not to center 00095 const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer"; 00096 00097 bool insideOut = isInsideOut(startingState); 00098 const MuRingForwardLayer & closerLayer = (insideOut) ? theFrontLayer : theBackLayer; 00099 LogTrace("Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer") 00100 << "MuRingForwardDoubleLayer::compatible is assuming inside-out direction: "<< insideOut; 00101 00102 00103 //std::pair<bool, TrajectoryStateOnSurface> result 00104 // = closerLayer.compatible(startingState, prop, est); 00105 //if(!result.first) 00106 // { 00107 // result = furtherLayer.compatible(startingState, prop, est); 00108 //} 00109 00110 00111 TrajectoryStateOnSurface myState = prop.propagate( startingState, closerLayer.specificSurface()); 00112 if ( !myState.isValid()) return make_pair( false, myState); 00113 00114 // take into account the thickness of the layer 00115 float deltaR = surface().bounds().thickness()/2. * 00116 fabs( tan( myState.localDirection().theta())); 00117 00118 // take into account the error on the predicted state 00119 const float nSigma = 3.; 00120 if (myState.hasError()) { 00121 LocalError err = myState.localError().positionError(); 00122 // ignore correlation for the moment... 00123 deltaR += nSigma * sqrt(err.xx() + err.yy()); 00124 } 00125 00126 float zPos = (zmax()+zmin())/2.; 00127 SimpleDiskBounds tmp( rmin()-deltaR, rmax()+deltaR, 00128 zmin()-zPos, zmax()-zPos); 00129 00130 return make_pair( tmp.inside(myState.localPosition()), myState); 00131 }
vector< GeometricSearchDet::DetWithState > MuRingForwardDoubleLayer::compatibleDets | ( | const TrajectoryStateOnSurface & | startingState, | |
const Propagator & | prop, | |||
const MeasurementEstimator & | est | |||
) | const [virtual] |
Returns all Dets compatible with a trajectory state according to the estimator est.
The startingState should be propagated to the surface of each compatible Det using the Propagator passed as an argument. The default implementation should be overridden in dets with specific surface types to avoid propagation to a generic Surface
Reimplemented from GeometricSearchDet.
Definition at line 135 of file MuRingForwardDoubleLayer.cc.
References compatible(), groupedCompatibleDets(), LogTrace, and HLT_VtxMuL3::result.
00137 { 00138 vector<DetWithState> result; 00139 const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer"; 00140 pair<bool, TrajectoryStateOnSurface> compat = 00141 compatible(startingState, prop, est); 00142 00143 if (!compat.first) { 00144 00145 LogTrace(metname) << " MuRingForwardDoubleLayer::compatibleDets: not compatible" 00146 << " (should not have been selected!)"; 00147 return result; 00148 } 00149 00150 00151 TrajectoryStateOnSurface& tsos = compat.second; 00152 00153 // standard implementation of compatibleDets() for class which have 00154 // groupedCompatibleDets implemented. 00155 // This code should be moved in a common place intead of being 00156 // copied many times. 00157 vector<DetGroup> vectorGroups = groupedCompatibleDets(tsos,prop,est); 00158 for(vector<DetGroup>::const_iterator itDG=vectorGroups.begin(); 00159 itDG!=vectorGroups.end();itDG++){ 00160 for(vector<DetGroupElement>::const_iterator itDGE=itDG->begin(); 00161 itDGE!=itDG->end();itDGE++){ 00162 result.push_back(DetWithState(itDGE->det(),itDGE->trajectoryState())); 00163 } 00164 } 00165 return result; 00166 }
virtual const std::vector<const GeometricSearchDet*>& MuRingForwardDoubleLayer::components | ( | ) | const [inline, virtual] |
Returns basic components, if any.
Returns direct components, if any
Implements GeometricSearchDet.
Definition at line 36 of file MuRingForwardDoubleLayer.h.
References theComponents.
00036 {return theComponents;}
BoundDisk * MuRingForwardDoubleLayer::computeSurface | ( | ) | [protected, virtual] |
Reimplemented from ForwardDetLayer.
Definition at line 59 of file MuRingForwardDoubleLayer.cc.
References BoundSurface::bounds(), BoundDisk::innerRadius(), max, min, BoundDisk::outerRadius(), GloballyPositioned< T >::position(), ForwardDetLayer::rmax(), ForwardDetLayer::rmin(), rot, ForwardDetLayer::specificSurface(), theBackLayer, theFrontLayer, Bounds::thickness(), PV3DBase< T, PVType, FrameType >::z(), ForwardDetLayer::zmax(), and ForwardDetLayer::zmin().
00060 { 00061 const BoundDisk & frontDisk = theFrontLayer.specificSurface(); 00062 const BoundDisk & backDisk = theBackLayer.specificSurface(); 00063 00064 float rmin = min( frontDisk.innerRadius(), backDisk.innerRadius() ); 00065 float rmax = max( frontDisk.outerRadius(), backDisk.outerRadius() ); 00066 float zmin = frontDisk.position().z(); 00067 float halfThickness = frontDisk.bounds().thickness()/2.; 00068 zmin = (zmin > 0) ? zmin-halfThickness : zmin+halfThickness; 00069 float zmax = backDisk.position().z(); 00070 halfThickness = backDisk.bounds().thickness()/2.; 00071 zmax = (zmax > 0) ? zmax+halfThickness : zmax-halfThickness; 00072 float zPos = (zmax+zmin)/2.; 00073 PositionType pos(0.,0.,zPos); 00074 RotationType rot; 00075 00076 return new BoundDisk( pos, rot, 00077 SimpleDiskBounds( rmin, rmax, 00078 zmin-zPos, zmax-zPos)); 00079 }
const MuRingForwardLayer* MuRingForwardDoubleLayer::frontLayer | ( | ) | const [inline] |
Definition at line 70 of file MuRingForwardDoubleLayer.h.
References theFrontLayer.
00070 {return &theFrontLayer;}
vector< DetGroup > MuRingForwardDoubleLayer::groupedCompatibleDets | ( | const TrajectoryStateOnSurface & | startingState, | |
const Propagator & | prop, | |||
const MeasurementEstimator & | est | |||
) | const [virtual] |
Similar to compatibleDets(), but the compatible Dets are grouped in one or more groups.
Dets are put in the same group if they are mutually exclusive for track crossing, i.e. a reconstructible track cannot cross more than one Det from a group. Pathological tracks (spirals etc.) can of course violate this rule.
The DetGroups are sorted in the sequence of crossing by a track. In order to define the direction of crossing the Propagator used in this method should have a defined direction() : either "alongMomentum" or "oppositeToMomentum" but not "anyDirection".
The three signatures of this method differ by the input trajectory state arguments: the starting state can be a TrajectoryStateOnSurface or a FreeTrajectoryState, and the state on this CompositeDet may be already known or not. The last two arguments are as for the method compatibleDets().
First signature: The first argument is a TrajectoryStateOnSurface, usually not on the surface of this CompositeDet.
Reimplemented from GeometricSearchDet.
Definition at line 170 of file MuRingForwardDoubleLayer.cc.
References MuRingForwardLayer::compatibleDets(), LogTrace, HLT_VtxMuL3::result, theBackLayer, and theFrontLayer.
Referenced by compatibleDets().
00172 { 00173 00174 const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer"; 00175 vector<GeometricSearchDet::DetWithState> detWithStates1, detWithStates2; 00176 00177 LogTrace(metname) << "groupedCompatibleDets are currently given always in inside-out order"; 00178 // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or 00179 // RecoMuon/DetLayers/MuRingForwardDoubleLayer 00180 // and removed the reverse operation in StandAloneMuonFilter::findBestMeasurements 00181 00182 detWithStates1 = theFrontLayer.compatibleDets(startingState, prop, est); 00183 detWithStates2 = theBackLayer.compatibleDets(startingState, prop, est); 00184 00185 vector<DetGroup> result; 00186 if(!detWithStates1.empty()) result.push_back( DetGroup(detWithStates1) ); 00187 if(!detWithStates2.empty()) result.push_back( DetGroup(detWithStates2) ); 00188 LogTrace(metname) << "DoubleLayer Compatible dets: " << result.size(); 00189 return result; 00190 }
virtual bool MuRingForwardDoubleLayer::hasGroups | ( | ) | const [inline, virtual] |
bool MuRingForwardDoubleLayer::isCrack | ( | const GlobalPoint & | gp | ) | const |
Definition at line 193 of file MuRingForwardDoubleLayer.cc.
References BoundDisk::innerRadius(), LogTrace, BoundDisk::outerRadius(), PV3DBase< T, PVType, FrameType >::perp(), r, HLT_VtxMuL3::result, MuRingForwardLayer::rings(), ForwardDetRing::specificSurface(), and theBackLayer.
00194 { 00195 const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer"; 00196 // approximate 00197 bool result = false; 00198 double r = gp.perp(); 00199 const std::vector<const ForwardDetRing*>& backRings = theBackLayer.rings(); 00200 if(backRings.size() > 1) 00201 { 00202 const MuDetRing * innerRing = dynamic_cast<const MuDetRing *>(backRings[0]); 00203 const MuDetRing * outerRing = dynamic_cast<const MuDetRing *>(backRings[1]); 00204 assert(innerRing && outerRing); 00205 float crackInner = innerRing->specificSurface().outerRadius(); 00206 float crackOuter = outerRing->specificSurface().innerRadius(); 00207 LogTrace(metname) << "In a crack:" << crackInner << " " << r << " " << crackOuter; 00208 if(r > crackInner && r < crackOuter) return true; 00209 } 00210 // non-overlapping rings 00211 //double phi = gp.phi().degrees(); 00212 return result; 00213 }
bool MuRingForwardDoubleLayer::isInsideOut | ( | const TrajectoryStateOnSurface & | tsos | ) | const |
Definition at line 82 of file MuRingForwardDoubleLayer.cc.
References PV3DBase< T, PVType, FrameType >::basicVector(), TrajectoryStateOnSurface::globalMomentum(), and TrajectoryStateOnSurface::globalPosition().
Referenced by compatible().
00083 { 00084 return tsos.globalPosition().basicVector().dot(tsos.globalMomentum().basicVector()) > 0; 00085 }
virtual const std::vector<const ForwardDetRing*>& MuRingForwardDoubleLayer::rings | ( | ) | const [inline, virtual] |
Return the vector of rings.
Definition at line 66 of file MuRingForwardDoubleLayer.h.
References theRings.
00066 {return theRings;}
void MuRingForwardDoubleLayer::selfTest | ( | ) | const |
Definition at line 216 of file MuRingForwardDoubleLayer.cc.
References MuRingForwardLayer::basicComponents(), theBackLayer, and theFrontLayer.
00217 { 00218 const std::vector<const GeomDet*>& frontDets = theFrontLayer.basicComponents(); 00219 const std::vector<const GeomDet*>& backDets = theBackLayer.basicComponents(); 00220 00221 std::vector<const GeomDet*>::const_iterator frontItr = frontDets.begin(), 00222 lastFront = frontDets.end(), 00223 backItr = backDets.begin(), 00224 lastBack = backDets.end(); 00225 00226 // test that each front z is less than each back z 00227 for( ; frontItr != lastFront; ++frontItr) 00228 { 00229 float frontz = fabs( (**frontItr).surface().position().z() ); 00230 for( ; backItr != lastBack; ++backItr) 00231 { 00232 float backz = fabs( (**backItr).surface().position().z() ); 00233 assert(frontz < backz); 00234 } 00235 } 00236 }
virtual SubDetector MuRingForwardDoubleLayer::subDetector | ( | ) | const [inline, virtual] |
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap).
Implements DetLayer.
Definition at line 60 of file MuRingForwardDoubleLayer.h.
References MuRingForwardLayer::subDetector(), and theBackLayer.
00060 {return theBackLayer.subDetector();}
Definition at line 78 of file MuRingForwardDoubleLayer.h.
Referenced by backLayer(), compatible(), computeSurface(), groupedCompatibleDets(), isCrack(), selfTest(), and subDetector().
std::vector<const GeomDet*> MuRingForwardDoubleLayer::theBasicComponents [private] |
std::vector<const GeometricSearchDet*> MuRingForwardDoubleLayer::theComponents [private] |
Definition at line 77 of file MuRingForwardDoubleLayer.h.
Referenced by compatible(), computeSurface(), frontLayer(), groupedCompatibleDets(), and selfTest().
std::vector<const ForwardDetRing*> MuRingForwardDoubleLayer::theRings [private] |