CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuRodBarrelLayer Class Reference

#include <MuRodBarrelLayer.h>

Inheritance diagram for MuRodBarrelLayer:
RodBarrelLayer BarrelDetLayer DetLayer GeometricSearchDet

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 Returns basic components, if any. More...
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual bool hasGroups () const
 
 MuRodBarrelLayer (std::vector< const DetRod * > &rods)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector
< const DetRod * > & 
rods () const
 Return the vector of rods. More...
 
virtual SubDetector subDetector () const
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
virtual ~MuRodBarrelLayer ()
 
- Public Member Functions inherited from RodBarrelLayer
 RodBarrelLayer ()
 
virtual ~RodBarrelLayer ()
 
- Public Member Functions inherited from BarrelDetLayer
 BarrelDetLayer ()
 
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const GCC11_FINAL
 
bool contains (const Local3DPoint &p) const
 
virtual Location location () const GCC11_FINAL
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const GCC11_FINAL
 Extension of the interface. More...
 
virtual const BoundSurfacesurface () const GCC11_FINAL
 GeometricSearchDet interface. More...
 
virtual ~BarrelDetLayer ()
 
- Public Member Functions inherited from DetLayer
template<typename... Args>
std::vector< const DetLayer * > compatibleLayers (Args &&...args) const
 Returns all layers compatible. More...
 
 DetLayer (bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
NavigableLayernavigableLayer () const
 Return the NavigableLayer associated with this DetLayer. More...
 
template<typename... Args>
std::vector< const DetLayer * > nextLayers (Args &&...args) const
 
int seqNum () const
 
void setNavigableLayer (NavigableLayer *nlp)
 Set the NavigableLayer associated with this DetLayer. More...
 
void setSeqNum (int sq)
 
virtual ~DetLayer ()
 
- Public Member Functions inherited from GeometricSearchDet
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet ()
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

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
 

Additional Inherited Members

- Public Types inherited from DetLayer
typedef
GeomDetEnumerators::Location 
Location
 
typedef
GeomDetEnumerators::SubDetector 
SubDetector
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const
GeomDet
*, TrajectoryStateOnSurface
DetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Member Functions inherited from BarrelDetLayer
virtual BoundCylindercomputeSurface ()
 
virtual void initialize ()
 
void setSurface (BoundCylinder *cp)
 
- Protected Attributes inherited from GeometricSearchDet
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A cylinder composed of rods. Represents barrel muon DT/RPC stations.

Author
N. Amapane - INFN Torino

Definition at line 17 of file MuRodBarrelLayer.h.

Constructor & Destructor Documentation

MuRodBarrelLayer::MuRodBarrelLayer ( std::vector< const DetRod * > &  rods)

Constructor, takes ownership of pointers.

Definition at line 26 of file MuRodBarrelLayer.cc.

References basicComponents(), filterCSVwithJSON::copy, BarrelDetLayer::initialize(), isOverlapping, PhiBorderFinder::isPhiOverlapping(), PhiBorderFinder::isPhiPeriodic(), LogTrace, metname, precomputed_value_sort(), BarrelDetLayer::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, theBasicComps, theBinFinder, theComponents, and theRods.

26  :
27  theRods(rods),
28  theBinFinder(0),
29  isOverlapping(false)
30 {
31  // Sort rods in phi
33 
34  theComponents.reserve(theRods.size());
35  std::copy(theRods.begin(),theRods.end(),back_inserter(theComponents));
36 
37  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRodBarrelLayer";
38 
39  // Cache chamber pointers (the basic components_)
40  for (vector<const DetRod*>::const_iterator it=rods.begin();
41  it!=rods.end(); it++) {
42  vector<const GeomDet*> tmp2 = (*it)->basicComponents();
43  theBasicComps.insert(theBasicComps.end(),tmp2.begin(),tmp2.end());
44  }
45 
46  // Initialize the binfinder
48  isOverlapping = bf.isPhiOverlapping();
49 
50  if ( bf.isPhiPeriodic() ) {
52  (theRods.front()->position().phi(),theRods.size());
53  } else {
55  }
56 
57  // Compute the layer's surface and bounds (from the components())
59 
60  LogTrace(metname) << "Constructing MuRodBarrelLayer: "
61  << basicComponents().size() << " Dets "
62  << theRods.size() << " Rods "
63  << " R: " << specificSurface().radius()
64  << " Per.: " << bf.isPhiPeriodic()
65  << " Overl.: " << isOverlapping;
66 }
virtual void initialize()
const std::string metname
std::vector< const GeomDet * > theBasicComps
BaseBinFinder< double > * theBinFinder
std::vector< const GeometricSearchDet * > theComponents
std::vector< const DetRod * > theRods
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
virtual const std::vector< const GeomDet * > & basicComponents() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
virtual const std::vector< const DetRod * > & rods() const
Return the vector of rods.
MuRodBarrelLayer::~MuRodBarrelLayer ( )
virtual

Definition at line 69 of file MuRodBarrelLayer.cc.

References i, theBinFinder, and theRods.

69  {
70  delete theBinFinder;
71  for (vector <const DetRod*>::iterator i = theRods.begin();
72  i<theRods.end(); i++) {delete *i;}
73 }
int i
Definition: DBlmapReader.cc:9
BaseBinFinder< double > * theBinFinder
std::vector< const DetRod * > theRods

Member Function Documentation

virtual const std::vector<const GeomDet*>& MuRodBarrelLayer::basicComponents ( ) const
inlinevirtual

Implements GeometricSearchDet.

Definition at line 27 of file MuRodBarrelLayer.h.

References theBasicComps.

Referenced by MuRodBarrelLayer().

27 {return theBasicComps;}
std::vector< const GeomDet * > 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 77 of file MuRodBarrelLayer.cc.

References BaseBinFinder< T >::binIndex(), Surface::bounds(), BarrelDetLayer::compatible(), GeometricSearchDet::compatibleDets(), edm::false, TrajectoryStateOnSurface::globalPosition(), isOverlapping, TrajectoryStateOnSurface::localPosition(), LogTrace, metname, GetRecoTauVFromDQM_MC_cff::next, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), query::result, BarrelDetLayer::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, DetRod::surface(), theBinFinder, theRods, Bounds::width(), PV3DBase< T, PVType, FrameType >::x(), and xError().

79  {
80 
81  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRodBarrelLayer";
82  vector<DetWithState> result;
83 
84 
85  LogTrace(metname) << "MuRodBarrelLayer::compatibleDets, Cyl R: "
86  << specificSurface().radius()
87  << " TSOS at R= " << startingState.globalPosition().perp()
88  << " phi= " << startingState.globalPosition().phi();
89 
90  pair<bool, TrajectoryStateOnSurface> compat =
91  compatible(startingState, prop, est);
92  if (!compat.first) {
93  LogTrace(metname) << " MuRodBarrelLayer::compatibleDets: not compatible"
94  << " (should not have been selected!)";
95  return vector<DetWithState>();
96  }
97 
98  TrajectoryStateOnSurface& tsos = compat.second;
99 
100  LogTrace(metname) << " MuRodBarrelLayer::compatibleDets, reached layer at: "
101  << tsos.globalPosition()
102  << " R = " << tsos.globalPosition().perp()
103  << " phi = " << tsos.globalPosition().phi();
104 
105  int closest = theBinFinder->binIndex(tsos.globalPosition().phi());
106  const DetRod* closestRod = theRods[closest];
107 
108  // Check the closest rod
109  LogTrace(metname) << " MuRodBarrelLayer::compatibleDets, closestRod: " << closest
110  << " phi : " << closestRod->surface().position().phi()
111  << " FTS phi: " << tsos.globalPosition().phi();
112 
113  result = closestRod->compatibleDets(tsos, prop, est);
114 
115  int nclosest = result.size(); // Debug counter
116 
117  bool checknext = false ;
118  double dist;
119 
120  if (!result.empty()) {
121  // Check if the track go outside closest rod, then look for closest.
122  TrajectoryStateOnSurface& predictedState = result.front().second;
123  float xErr = xError(predictedState, est);
124  float halfWid = closestRod->surface().bounds().width()/2.;
125  dist = predictedState.localPosition().x();
126 
127  // If the layer is overlapping, additionally reduce halfWid by 10%
128  // to account for overlap.
129  // FIXME: should we account for the real amount of overlap?
130  if (isOverlapping) halfWid *= 0.9;
131 
132  if (fabs(dist) + xErr > halfWid) {
133  checknext = true;
134  }
135  } else { // Rod is not compatible
136  //FIXME: Usually next cannot be either. Implement proper logic.
137  // (in general at least one rod should be when this method is called by
138  // compatibleDets() which calls compatible())
139  checknext = true;
140 
141  // Look for the next-to closest in phi.
142  // Note Geom::Phi, subtraction is pi-border-safe
143  if ( tsos.globalPosition().phi()-closestRod->surface().position().phi()>0.)
144  {
145  dist = -1.;
146  } else {
147  dist = +1.;
148  }
149 
150 
151  LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets, none on closest rod!";
152  }
153 
154  if (checknext) {
155  int next;
156  if (dist<0.) next = closest+1;
157  else next = closest-1;
158 
159  next = theBinFinder->binIndex(next); // Bin Periodicity
160  const DetRod* nextRod = theRods[next];
161 
162 
163  LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets, next-to closest"
164  << " rod: " << next << " dist " << dist
165  << " phi : " << nextRod->surface().position().phi()
166  << " FTS phi: " << tsos.globalPosition().phi();
167 
168  vector<DetWithState> nextRodDets =
169  nextRod->compatibleDets(tsos, prop, est);
170  result.insert(result.end(),
171  nextRodDets.begin(), nextRodDets.end());
172  }
173 
174 
175  LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets: found: "
176  << result.size()
177  << " on closest: " << nclosest
178  << " # checked rods: " << 1 + int(checknext);
179 
180  return result;
181 }
T perp() const
Definition: PV3DBase.h:72
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
GlobalPoint globalPosition() const
const Bounds & bounds() const
Definition: Surface.h:128
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
BaseBinFinder< double > * theBinFinder
tuple result
Definition: query.py:137
std::vector< const DetRod * > theRods
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
Definition: DetRod.h:19
#define LogTrace(id)
float xError(const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
Definition: DetRod.h:13
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const GCC11_FINAL
volatile std::atomic< bool > shutdown_flag false
T x() const
Definition: PV3DBase.h:62
virtual float width() const =0
const PositionType & position() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
const vector< const GeometricSearchDet * > & MuRodBarrelLayer::components ( ) const
virtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 205 of file MuRodBarrelLayer.cc.

References theComponents.

205  {
206  return theComponents;
207 }
std::vector< const GeometricSearchDet * > theComponents
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 185 of file MuRodBarrelLayer.cc.

References gather_cfg::cout.

187  {
188  // FIXME should return only 1 group
189  cout << "dummy implementation of MuRodBarrelLayer::groupedCompatibleDets()" << endl;
190  return vector<DetGroup>();
191 }
tuple cout
Definition: gather_cfg.py:121
bool MuRodBarrelLayer::hasGroups ( ) const
virtual

Implements GeometricSearchDet.

Definition at line 194 of file MuRodBarrelLayer.cc.

194  {
195  // FIXME : depending on isOverlapping?
196  return false;
197 }
virtual const std::vector<const DetRod*>& MuRodBarrelLayer::rods ( ) const
inlinevirtual

Return the vector of rods.

Definition at line 51 of file MuRodBarrelLayer.h.

References theRods.

51 {return theRods;}
std::vector< const DetRod * > 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 200 of file MuRodBarrelLayer.cc.

References theBasicComps.

200  {
201  return theBasicComps.front()->subDetector();
202 }
std::vector< const GeomDet * > theBasicComps
float MuRodBarrelLayer::xError ( const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 209 of file MuRodBarrelLayer.cc.

References TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LocalTrajectoryError::positionError(), mathSSE::sqrt(), and LocalError::xx().

Referenced by compatibleDets().

210  {
211  const float nSigmas = 3.f;
212  if (tsos.hasError()) {
213  return nSigmas * sqrt(tsos.localError().positionError().xx());
214  }
215  else return nSigmas * 0.5;
216 }
float xx() const
Definition: LocalError.h:24
LocalError positionError() const
T sqrt(T t)
Definition: SSEVec.h:48
const LocalTrajectoryError & localError() const

Member Data Documentation

bool MuRodBarrelLayer::isOverlapping
private

Definition at line 63 of file MuRodBarrelLayer.h.

Referenced by compatibleDets(), and MuRodBarrelLayer().

std::vector<const GeomDet*> MuRodBarrelLayer::theBasicComps
private

Definition at line 61 of file MuRodBarrelLayer.h.

Referenced by basicComponents(), MuRodBarrelLayer(), and subDetector().

BaseBinFinder<double>* MuRodBarrelLayer::theBinFinder
private

Definition at line 62 of file MuRodBarrelLayer.h.

Referenced by compatibleDets(), MuRodBarrelLayer(), and ~MuRodBarrelLayer().

std::vector<const GeometricSearchDet*> MuRodBarrelLayer::theComponents
private

Definition at line 60 of file MuRodBarrelLayer.h.

Referenced by components(), and MuRodBarrelLayer().

std::vector<const DetRod*> MuRodBarrelLayer::theRods
private

Definition at line 59 of file MuRodBarrelLayer.h.

Referenced by compatibleDets(), MuRodBarrelLayer(), rods(), and ~MuRodBarrelLayer().