#include <RecoMuon/DetLayers/interface/MuRodBarrelLayer.h>
Public Member Functions | |
virtual const std::vector < const GeomDet * > & | basicComponents () const |
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. | |
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 |
MuRodBarrelLayer (std::vector< const DetRod * > &rods) | |
Constructor, takes ownership of pointers. | |
virtual const std::vector < const DetRod * > & | rods () const |
Return the vector of rods. | |
virtual SubDetector | subDetector () const |
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap). | |
virtual | ~MuRodBarrelLayer () |
Private Member Functions | |
float | xError (const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const |
Private Attributes | |
bool | isOverlapping |
std::vector< const GeomDet * > | theBasicComps |
BaseBinFinder< double > * | theBinFinder |
std::vector< const GeometricSearchDet * > | theComponents |
std::vector< const DetRod * > | theRods |
Represents barrel muon DT/RPC stations.
Definition at line 19 of file MuRodBarrelLayer.h.
MuRodBarrelLayer::MuRodBarrelLayer | ( | std::vector< const DetRod * > & | rods | ) |
Constructor, takes ownership of pointers.
MuRodBarrelLayer::~MuRodBarrelLayer | ( | ) | [virtual] |
Definition at line 71 of file MuRodBarrelLayer.cc.
References i, theBinFinder, and theRods.
00071 { 00072 delete theBinFinder; 00073 for (vector <const DetRod*>::iterator i = theRods.begin(); 00074 i<theRods.end(); i++) {delete *i;} 00075 }
virtual const std::vector<const GeomDet*>& MuRodBarrelLayer::basicComponents | ( | ) | const [inline, virtual] |
Implements GeometricSearchDet.
Definition at line 29 of file MuRodBarrelLayer.h.
References theBasicComps.
00029 {return theBasicComps;}
vector< GeometricSearchDet::DetWithState > MuRodBarrelLayer::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 79 of file MuRodBarrelLayer.cc.
References BaseBinFinder< T >::binIndex(), BoundSurface::bounds(), BarrelDetLayer::compatible(), GeometricSearchDet::compatibleDets(), dist(), false, TrajectoryStateOnSurface::globalPosition(), int, isOverlapping, TrajectoryStateOnSurface::localPosition(), LogTrace, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), Cylinder::radius(), HLT_VtxMuL3::result, BarrelDetLayer::specificSurface(), DetRod::surface(), theBinFinder, theRods, Bounds::width(), PV3DBase< T, PVType, FrameType >::x(), and xError().
00081 { 00082 00083 const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRodBarrelLayer"; 00084 vector<DetWithState> result; 00085 00086 00087 LogTrace(metname) << "MuRodBarrelLayer::compatibleDets, Cyl R: " 00088 << specificSurface().radius() 00089 << " TSOS at R= " << startingState.globalPosition().perp() 00090 << " phi= " << startingState.globalPosition().phi(); 00091 00092 pair<bool, TrajectoryStateOnSurface> compat = 00093 compatible(startingState, prop, est); 00094 if (!compat.first) { 00095 LogTrace(metname) << " MuRodBarrelLayer::compatibleDets: not compatible" 00096 << " (should not have been selected!)"; 00097 return vector<DetWithState>(); 00098 } 00099 00100 TrajectoryStateOnSurface& tsos = compat.second; 00101 00102 LogTrace(metname) << " MuRodBarrelLayer::compatibleDets, reached layer at: " 00103 << tsos.globalPosition() 00104 << " R = " << tsos.globalPosition().perp() 00105 << " phi = " << tsos.globalPosition().phi(); 00106 00107 int closest = theBinFinder->binIndex(tsos.globalPosition().phi()); 00108 const DetRod* closestRod = theRods[closest]; 00109 00110 // Check the closest rod 00111 LogTrace(metname) << " MuRodBarrelLayer::compatibleDets, closestRod: " << closest 00112 << " phi : " << closestRod->surface().position().phi() 00113 << " FTS phi: " << tsos.globalPosition().phi(); 00114 00115 result = closestRod->compatibleDets(tsos, prop, est); 00116 00117 int nclosest = result.size(); // Debug counter 00118 00119 bool checknext = false ; 00120 double dist; 00121 00122 if (!result.empty()) { 00123 // Check if the track go outside closest rod, then look for closest. 00124 TrajectoryStateOnSurface& predictedState = result.front().second; 00125 float xErr = xError(predictedState, est); 00126 float halfWid = closestRod->surface().bounds().width()/2.; 00127 dist = predictedState.localPosition().x(); 00128 00129 // If the layer is overlapping, additionally reduce halfWid by 10% 00130 // to account for overlap. 00131 // FIXME: should we account for the real amount of overlap? 00132 if (isOverlapping) halfWid *= 0.9; 00133 00134 if (fabs(dist) + xErr > halfWid) { 00135 checknext = true; 00136 } 00137 } else { // Rod is not compatible 00138 //FIXME: Usually next cannot be either. Implement proper logic. 00139 // (in general at least one rod should be when this method is called by 00140 // compatibleDets() which calls compatible()) 00141 checknext = true; 00142 00143 // Look for the next-to closest in phi. 00144 // Note Geom::Phi, subtraction is pi-border-safe 00145 if ( tsos.globalPosition().phi()-closestRod->surface().position().phi()>0.) 00146 { 00147 dist = -1.; 00148 } else { 00149 dist = +1.; 00150 } 00151 00152 00153 LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets, none on closest rod!"; 00154 } 00155 00156 if (checknext) { 00157 int next; 00158 if (dist<0.) next = closest+1; 00159 else next = closest-1; 00160 00161 next = theBinFinder->binIndex(next); // Bin Periodicity 00162 const DetRod* nextRod = theRods[next]; 00163 00164 00165 LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets, next-to closest" 00166 << " rod: " << next << " dist " << dist 00167 << " phi : " << nextRod->surface().position().phi() 00168 << " FTS phi: " << tsos.globalPosition().phi(); 00169 00170 vector<DetWithState> nextRodDets = 00171 nextRod->compatibleDets(tsos, prop, est); 00172 result.insert(result.end(), 00173 nextRodDets.begin(), nextRodDets.end()); 00174 } 00175 00176 00177 LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets: found: " 00178 << result.size() 00179 << " on closest: " << nclosest 00180 << " # checked rods: " << 1 + int(checknext); 00181 00182 return result; 00183 }
const vector< const GeometricSearchDet * > & MuRodBarrelLayer::components | ( | ) | const [virtual] |
Returns basic components, if any.
Returns direct components, if any
Implements GeometricSearchDet.
Definition at line 207 of file MuRodBarrelLayer.cc.
References theComponents.
00207 { 00208 return theComponents; 00209 }
vector< DetGroup > MuRodBarrelLayer::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 187 of file MuRodBarrelLayer.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00189 { 00190 // FIXME should return only 1 group 00191 cout << "dummy implementation of MuRodBarrelLayer::groupedCompatibleDets()" << endl; 00192 return vector<DetGroup>(); 00193 }
bool MuRodBarrelLayer::hasGroups | ( | ) | const [virtual] |
virtual const std::vector<const DetRod*>& MuRodBarrelLayer::rods | ( | ) | const [inline, virtual] |
Return the vector of rods.
Definition at line 53 of file MuRodBarrelLayer.h.
References theRods.
00053 {return theRods;}
GeomDetEnumerators::SubDetector MuRodBarrelLayer::subDetector | ( | ) | const [virtual] |
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap).
Implements DetLayer.
Definition at line 202 of file MuRodBarrelLayer.cc.
References theBasicComps.
00202 { 00203 return theBasicComps.front()->subDetector(); 00204 }
float MuRodBarrelLayer::xError | ( | const TrajectoryStateOnSurface & | tsos, | |
const MeasurementEstimator & | est | |||
) | const [private] |
Definition at line 211 of file MuRodBarrelLayer.cc.
References TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LocalTrajectoryError::positionError(), funct::sqrt(), and LocalError::xx().
Referenced by compatibleDets().
00212 { 00213 const float nSigmas = 3.f; 00214 if (tsos.hasError()) { 00215 return nSigmas * sqrt(tsos.localError().positionError().xx()); 00216 } 00217 else return nSigmas * 0.5; 00218 }
bool MuRodBarrelLayer::isOverlapping [private] |
std::vector<const GeomDet*> MuRodBarrelLayer::theBasicComps [private] |
Definition at line 63 of file MuRodBarrelLayer.h.
Referenced by basicComponents(), and subDetector().
BaseBinFinder<double>* MuRodBarrelLayer::theBinFinder [private] |
Definition at line 64 of file MuRodBarrelLayer.h.
Referenced by compatibleDets(), and ~MuRodBarrelLayer().
std::vector<const GeometricSearchDet*> MuRodBarrelLayer::theComponents [private] |
std::vector<const DetRod*> MuRodBarrelLayer::theRods [private] |
Definition at line 61 of file MuRodBarrelLayer.h.
Referenced by compatibleDets(), rods(), and ~MuRodBarrelLayer().