CMS 3D CMS Logo

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

#include <TOBLayer.h>

Inheritance diagram for TOBLayer:
RodBarrelLayer GeometricSearchDetWithGroups BarrelDetLayer GeometricSearchDet DetLayer GeometricSearchDet

Public Types

typedef PeriodicBinFinderInPhi
< double > 
BinFinderType
 
- 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
 
- Public Types inherited from GeometricSearchDetWithGroups
typedef
GeometricSearchDet::DetWithState 
DetWithState
 

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 Returns basic components, if any. More...
 
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
virtual SubDetector subDetector () const
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 TOBLayer (std::vector< const TOBRod * > &innerRods, std::vector< const TOBRod * > &outerRods)
 
 ~TOBLayer ()
 
- 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
 
bool contains (const Local3DPoint &p) const
 
virtual Location location () const
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const
 Extension of the interface. More...
 
virtual const BoundSurfacesurface () const
 GeometricSearchDet interface. More...
 
virtual ~BarrelDetLayer ()
 
- Public Member Functions inherited from DetLayer
std::vector< const DetLayer * > compatibleLayers (NavigationDirection direction) const
 
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
 
std::vector< const DetLayer * > compatibleLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const
 
 DetLayer ()
 
NavigableLayernavigableLayer () const
 Return the NavigableLayer associated with this DetLayer. More...
 
virtual std::vector< const
DetLayer * > 
nextLayers (NavigationDirection direction) const
 
virtual std::vector< const
DetLayer * > 
nextLayers (const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
 
virtual void setNavigableLayer (NavigableLayer *nlp)
 Set the NavigableLayer associated with this DetLayer. More...
 
virtual ~DetLayer ()
 
- Public Member Functions inherited from GeometricSearchDet
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
 GeometricSearchDet ()
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 
- Public Member Functions inherited from GeometricSearchDetWithGroups
void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
bool hasGroups () const
 

Private Member Functions

bool addClosest (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
 
double calculatePhiWindow (double Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state) const
 
SubLayerCrossings computeCrossings (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
 
BoundCylindercylinder (const std::vector< const GeometricSearchDet * > &rods) const
 
bool overlap (const GlobalPoint &gpos, const GeometricSearchDet &rod, float phiWin) const
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
 
const std::vector< const
GeometricSearchDet * > & 
subLayer (int ind) const
 

Private Attributes

std::vector< const GeomDet * > theBasicComps
 
std::vector< const
GeometricSearchDet * > 
theComps
 
BinFinderType theInnerBinFinder
 
std::vector< const
GeometricSearchDet * > 
theInnerComps
 
ReferenceCountingPointer
< BoundCylinder
theInnerCylinder
 
BinFinderType theOuterBinFinder
 
std::vector< const
GeometricSearchDet * > 
theOuterComps
 
ReferenceCountingPointer
< BoundCylinder
theOuterCylinder
 

Additional Inherited Members

- 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 concrete implementation for TOB layer built out of TOBRods

Definition at line 14 of file TOBLayer.h.

Member Typedef Documentation

Definition at line 16 of file TOBLayer.h.

Constructor & Destructor Documentation

TOBLayer::TOBLayer ( std::vector< const TOBRod * > &  innerRods,
std::vector< const TOBRod * > &  outerRods 
)

Definition at line 20 of file TOBLayer.cc.

References BoundSurface::bounds(), cylinder(), i, BarrelDetLayer::initialize(), Bounds::length(), LogDebug, Cylinder::radius(), BarrelDetLayer::specificSurface(), theBasicComps, theComps, theInnerBinFinder, theInnerComps, theInnerCylinder, theOuterBinFinder, theOuterComps, theOuterCylinder, and Bounds::thickness().

21  :
22  theInnerComps(innerRods.begin(),innerRods.end()),
23  theOuterComps(outerRods.begin(),outerRods.end())
24 {
25  theComps.assign(theInnerComps.begin(),theInnerComps.end());
26  theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
27 
28  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
29  it!=theComps.end();it++){
30  theBasicComps.insert(theBasicComps.end(),
31  (**it).basicComponents().begin(),
32  (**it).basicComponents().end());
33  }
34 
37 
38  if (theInnerComps.size())
39  theInnerBinFinder = BinFinderType(theInnerComps.front()->position().phi(),
40  theInnerComps.size());
41 
42  if (theOuterComps.size())
43  theOuterBinFinder = BinFinderType(theOuterComps.front()->position().phi(),
44  theOuterComps.size());
45 
47 
48  //--------- DEBUG INFO --------------
49  LogDebug("TkDetLayers") << "==== DEBUG TOBLayer =====" ;
50  LogDebug("TkDetLayers") << "innerCyl radius, thickness, lenght: "
51  << theInnerCylinder->radius() << " , "
52  << theInnerCylinder->bounds().thickness() << " , "
53  << theInnerCylinder->bounds().length() ;
54 
55  LogDebug("TkDetLayers") << "outerCyl radius, thickness, lenght: "
56  << theOuterCylinder->radius() << " , "
57  << theOuterCylinder->bounds().thickness() << " , "
58  << theOuterCylinder->bounds().length() ;
59 
60  LogDebug("TkDetLayers") << "Cyl radius, thickness, lenght: "
61  << specificSurface().radius() << " , "
62  << specificSurface().bounds().thickness() << " , "
63  << specificSurface().bounds().length() ;
64 
65  for (vector<const GeometricSearchDet*>::const_iterator i=theInnerComps.begin();
66  i != theInnerComps.end(); i++){
67  LogDebug("TkDetLayers") << "inner TOBRod pos z,perp,eta,phi: "
68  << (**i).position().z() << " , "
69  << (**i).position().perp() << " , "
70  << (**i).position().eta() << " , "
71  << (**i).position().phi() ;
72  }
73 
74  for (vector<const GeometricSearchDet*>::const_iterator i=theOuterComps.begin();
75  i != theOuterComps.end(); i++){
76  LogDebug("TkDetLayers") << "outer TOBRod pos z,perp,eta,phi: "
77  << (**i).position().z() << " , "
78  << (**i).position().perp() << " , "
79  << (**i).position().eta() << " , "
80  << (**i).position().phi() ;
81  }
82  LogDebug("TkDetLayers") << "==== end DEBUG TOBLayer =====" ;
83 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TOBLayer.h:78
virtual float length() const =0
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TOBLayer.h:84
virtual void initialize()
PeriodicBinFinderInPhi< double > BinFinderType
Definition: TOBLayer.h:16
virtual float thickness() const =0
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TOBLayer.h:85
std::vector< const GeomDet * > theBasicComps
Definition: TOBLayer.h:79
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TOBLayer.h:77
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rods) const
Definition: TOBLayer.cc:278
const Bounds & bounds() const
Definition: BoundSurface.h:89
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
std::vector< const GeometricSearchDet * > theComps
Definition: TOBLayer.h:76
BinFinderType theOuterBinFinder
Definition: TOBLayer.h:82
BinFinderType theInnerBinFinder
Definition: TOBLayer.h:81
TOBLayer::~TOBLayer ( )

Definition at line 86 of file TOBLayer.cc.

References i, and theComps.

86  {
87  vector<const GeometricSearchDet*>::const_iterator i;
88  for (i=theComps.begin(); i!=theComps.end(); i++) {
89  delete *i;
90  }
91 }
int i
Definition: DBlmapReader.cc:9
std::vector< const GeometricSearchDet * > theComps
Definition: TOBLayer.h:76

Member Function Documentation

bool TOBLayer::addClosest ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
std::vector< DetGroup > &  result 
) const
private

Definition at line 170 of file TOBLayer.cc.

References CompatibleDetToGroupAdder::add(), SubLayerCrossing::closestDetIndex(), subLayer(), and SubLayerCrossing::subLayerIndex().

Referenced by groupedCompatibleDetsV().

175 {
176  const vector<const GeometricSearchDet*>& sub( subLayer( crossing.subLayerIndex()));
177  const GeometricSearchDet* det(sub[crossing.closestDetIndex()]);
178  return CompatibleDetToGroupAdder::add( *det, tsos, prop, est, result);
179 }
int closestDetIndex() const
int subLayerIndex() const
tuple result
Definition: query.py:137
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result)
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TOBLayer.h:69
virtual const std::vector<const GeomDet*>& TOBLayer::basicComponents ( ) const
inlinevirtual

Implements GeometricSearchDet.

Definition at line 25 of file TOBLayer.h.

References theBasicComps.

25 {return theBasicComps;}
std::vector< const GeomDet * > theBasicComps
Definition: TOBLayer.h:79
double TOBLayer::calculatePhiWindow ( double  Xmax,
const GeomDet det,
const TrajectoryStateOnSurface state 
) const
private

Definition at line 191 of file TOBLayer.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::localPosition(), min, edm::shift, GeomDet::surface(), and Surface::toGlobal().

Referenced by computeWindowSize().

193 {
194 
195  LocalPoint startPoint = state.localPosition();
196  LocalVector shift( Xmax , 0. , 0.);
197  LocalPoint shift1 = startPoint + shift;
198  LocalPoint shift2 = startPoint + (-shift);
199  //LocalPoint shift2( startPoint); //original code;
200  //shift2 -= shift;
201 
202  double phi1 = det.surface().toGlobal(shift1).barePhi();
203  double phi2 = det.surface().toGlobal(shift2).barePhi();
204  double phiStart = state.globalPosition().barePhi();
205  double phiWin = min(fabs(phiStart-phi1),fabs(phiStart-phi2));
206 
207  return phiWin;
208 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
GlobalPoint globalPosition() const
#define min(a, b)
Definition: mlp_lapack.h:161
T barePhi() const
Definition: PV3DBase.h:62
static unsigned int const shift
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
virtual const std::vector<const GeometricSearchDet*>& TOBLayer::components ( ) const
inlinevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 27 of file TOBLayer.h.

References theComps.

27 {return theComps;}
std::vector< const GeometricSearchDet * > theComps
Definition: TOBLayer.h:76
SubLayerCrossings TOBLayer::computeCrossings ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const
private

Definition at line 131 of file TOBLayer.cc.

References PeriodicBinFinderInPhi< T >::binIndex(), PeriodicBinFinderInPhi< T >::binPosition(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixBarrelCylinderCrossing::hasSolution(), Geom::pi(), HelixBarrelCylinderCrossing::position(), rho, theInnerBinFinder, theInnerCylinder, theOuterBinFinder, theOuterCylinder, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

133 {
134  GlobalPoint startPos( startingState.globalPosition());
135  GlobalVector startDir( startingState.globalMomentum());
136  double rho( startingState.transverseCurvature());
137 
138  HelixBarrelCylinderCrossing innerCrossing( startPos, startDir, rho,
139  propDir,*theInnerCylinder);
140  if (!innerCrossing.hasSolution()) return SubLayerCrossings();
141 
142  GlobalPoint gInnerPoint( innerCrossing.position());
143  int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.phi());
144  float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.phi();
145  SubLayerCrossing innerSLC( 0, innerIndex, gInnerPoint);
146 
147  HelixBarrelCylinderCrossing outerCrossing( startPos, startDir, rho,
148  propDir,*theOuterCylinder);
149  if (!outerCrossing.hasSolution()) return SubLayerCrossings();
150 
151  GlobalPoint gOuterPoint( outerCrossing.position());
152  int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.phi());
153  float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.phi() ;
154  SubLayerCrossing outerSLC( 1, outerIndex, gOuterPoint);
155 
156  innerDist *= PhiLess()( theInnerBinFinder.binPosition(innerIndex),gInnerPoint.phi()) ? -1. : 1.;
157  outerDist *= PhiLess()( theOuterBinFinder.binPosition(outerIndex),gOuterPoint.phi()) ? -1. : 1.;
158  if (innerDist < 0.) { innerDist += 2.*Geom::pi();}
159  if (outerDist < 0.) { outerDist += 2.*Geom::pi();}
160 
161 
162  if (innerDist < outerDist) {
163  return SubLayerCrossings( innerSLC, outerSLC, 0);
164  }
165  else {
166  return SubLayerCrossings( outerSLC, innerSLC, 1);
167  }
168 }
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TOBLayer.h:84
Definition: DDAxes.h:10
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TOBLayer.h:85
virtual T binPosition(int ind) const
the middle of the bin in radians
double pi()
Definition: Pi.h:31
BinFinderType theOuterBinFinder
Definition: TOBLayer.h:82
BinFinderType theInnerBinFinder
Definition: TOBLayer.h:81
float TOBLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 181 of file TOBLayer.cc.

References calculatePhiWindow(), MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), and ExpressReco_HICollisions_FallBack::x.

Referenced by groupedCompatibleDetsV().

184 {
185  double xmax =
186  est.maximalLocalDisplacement(tsos, det->surface()).x();
187  return calculatePhiWindow( xmax, *det, tsos);
188 }
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
double calculatePhiWindow(double Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state) const
Definition: TOBLayer.cc:191
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
BoundCylinder * TOBLayer::cylinder ( const std::vector< const GeometricSearchDet * > &  rods) const
private

Definition at line 278 of file TOBLayer.cc.

References tmp.

Referenced by TOBLayer().

279 {
280  vector<const GeomDet*> tmp;
281  for (vector<const GeometricSearchDet*>::const_iterator it=rods.begin(); it!=rods.end(); it++) {
282  tmp.insert(tmp.end(),(*it)->basicComponents().begin(),(*it)->basicComponents().end());
283  }
284  return CylinderBuilderFromDet()( tmp.begin(), tmp.end());
285 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void TOBLayer::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
virtual

Reimplemented from GeometricSearchDet.

Definition at line 96 of file TOBLayer.cc.

References addClosest(), LayerCrossingSide::barrelSide(), SubLayerCrossings::closest(), SubLayerCrossings::closestIndex(), computeCrossings(), computeWindowSize(), SubLayerCrossings::isValid(), DetGroupMerger::orderAndMergeTwoLevels(), SubLayerCrossings::other(), Propagator::propagationDirection(), query::result, searchNeighbors(), and svgfig::window().

100 {
101  SubLayerCrossings crossings;
102  crossings = computeCrossings( tsos, prop.propagationDirection());
103  if(! crossings.isValid()) return;
104 
105  vector<DetGroup> closestResult;
106  addClosest( tsos, prop, est, crossings.closest(), closestResult);
107  if (closestResult.empty()){
108  addClosest( tsos, prop, est, crossings.other(), result);
109  return;
110  }
111 
112  DetGroupElement closestGel( closestResult.front().front());
113  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
114 
115  searchNeighbors( tsos, prop, est, crossings.closest(), window,
116  closestResult, false);
117 
118  vector<DetGroup> nextResult;
119  searchNeighbors( tsos, prop, est, crossings.other(), window,
120  nextResult, true);
121 
122  int crossingSide = LayerCrossingSide().barrelSide( closestGel.trajectoryState(), prop);
123  DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result,
124  crossings.closestIndex(), crossingSide);
125 }
static void orderAndMergeTwoLevels(const std::vector< DetGroup > &one, const std::vector< DetGroup > &two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
def window
Definition: svgfig.py:642
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
int closestIndex() const
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
Definition: TOBLayer.cc:170
tuple result
Definition: query.py:137
const SubLayerCrossing & other() const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
Definition: TOBLayer.cc:181
int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
returns 0 if barrel layer crossed from inside, 1 if from outside
const SubLayerCrossing & closest() const
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
Definition: TOBLayer.cc:131
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
Definition: TOBLayer.cc:211
bool TOBLayer::overlap ( const GlobalPoint gpos,
const GeometricSearchDet rod,
float  phiWin 
) const
private

Definition at line 254 of file TOBLayer.cc.

References PV3DBase< T, PVType, FrameType >::phi(), BoundSurface::phiSpan(), rangesIntersect(), and GeometricSearchDet::surface().

Referenced by searchNeighbors().

255 {
256  GlobalPoint crossPoint(gpos);
257 
258  // introduce offset (extrapolated point and true propagated point differ by 0.0003 - 0.00033,
259  // due to thickness of Rod of 1 cm)
260  const float phiOffset = 0.00034; //...TOBE CHECKED LATER...
261  phiWin += phiOffset;
262 
263  // detector phi range
264  std::pair<float,float> phiRange(crossPoint.phi()-phiWin, crossPoint.phi()+phiWin);
265 
266  // // debug
267  // edm::LogInfo(TkDetLayers) ;
268  // edm::LogInfo(TkDetLayers) << " overlapInPhi: position, det phi range "
269  // << "("<< rod.position().perp() << ", " << rod.position().phi() << ") "
270  // << rodRange.phiRange().first << " " << rodRange.phiRange().second ;
271  // edm::LogInfo(TkDetLayers) << " overlapInPhi: cross point phi, window " << crossPoint.phi() << " " << phiWin ;
272  // edm::LogInfo(TkDetLayers) << " overlapInPhi: search window: " << crossPoint.phi()-phiWin << " " << crossPoint.phi()+phiWin ;
273 
274  return rangesIntersect(phiRange, gsdet.surface().phiSpan(), PhiLess());
275 }
bool rangesIntersect(const Range &a, const Range &b)
void TOBLayer::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
float  window,
std::vector< DetGroup > &  result,
bool  checkClosest 
) const
private

Definition at line 211 of file TOBLayer.cc.

References Clusterizer1DCommons::add(), PeriodicBinFinderInPhi< T >::binIndex(), SubLayerCrossing::closestDetIndex(), overlap(), PV3DBase< T, PVType, FrameType >::phi(), SubLayerCrossing::position(), subLayer(), SubLayerCrossing::subLayerIndex(), theInnerBinFinder, and theOuterBinFinder.

Referenced by groupedCompatibleDetsV().

218 {
219  GlobalPoint gCrossingPos = crossing.position();
220 
221  const vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.subLayerIndex()));
222 
223  int closestIndex = crossing.closestDetIndex();
224  int negStartIndex = closestIndex-1;
225  int posStartIndex = closestIndex+1;
226 
227  if (checkClosest) { // must decide if the closest is on the neg or pos side
228  if ( PhiLess()( gCrossingPos.phi(), sLayer[closestIndex]->surface().phi())) {
229  posStartIndex = closestIndex;
230  }
231  else {
232  negStartIndex = closestIndex;
233  }
234  }
235 
236  const BinFinderType& binFinder = (crossing.subLayerIndex()==0 ? theInnerBinFinder : theOuterBinFinder);
237 
238  typedef CompatibleDetToGroupAdder Adder;
239  int quarter = sLayer.size()/4;
240  for (int idet=negStartIndex; idet >= negStartIndex - quarter; idet--) {
241  const GeometricSearchDet & neighborRod = *sLayer[binFinder.binIndex(idet)];
242  if (!overlap( gCrossingPos, neighborRod, window)) break;
243  if (!Adder::add( neighborRod, tsos, prop, est, result)) break;
244  // maybe also add shallow crossing angle test here???
245  }
246  for (int idet=posStartIndex; idet < posStartIndex + quarter; idet++) {
247  const GeometricSearchDet & neighborRod = *sLayer[binFinder.binIndex(idet)];
248  if (!overlap( gCrossingPos, neighborRod, window)) break;
249  if (!Adder::add( neighborRod, tsos, prop, est, result)) break;
250  // maybe also add shallow crossing angle test here???
251  }
252 }
def window
Definition: svgfig.py:642
int closestDetIndex() const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
PeriodicBinFinderInPhi< double > BinFinderType
Definition: TOBLayer.h:16
const GlobalPoint & position() const
int subLayerIndex() const
tuple result
Definition: query.py:137
bool overlap(const GlobalPoint &gpos, const GeometricSearchDet &rod, float phiWin) const
Definition: TOBLayer.cc:254
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TOBLayer.h:69
BinFinderType theOuterBinFinder
Definition: TOBLayer.h:82
BinFinderType theInnerBinFinder
Definition: TOBLayer.h:81
virtual SubDetector TOBLayer::subDetector ( ) const
inlinevirtual

The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)

Implements DetLayer.

Definition at line 36 of file TOBLayer.h.

References GeomDetEnumerators::TOB.

const std::vector<const GeometricSearchDet*>& TOBLayer::subLayer ( int  ind) const
inlineprivate

Definition at line 69 of file TOBLayer.h.

References theInnerComps, and theOuterComps.

Referenced by addClosest(), and searchNeighbors().

69  {
70  return (ind==0 ? theInnerComps : theOuterComps);}
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TOBLayer.h:78
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TOBLayer.h:77

Member Data Documentation

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

Definition at line 79 of file TOBLayer.h.

Referenced by basicComponents(), and TOBLayer().

std::vector<const GeometricSearchDet*> TOBLayer::theComps
private

Definition at line 76 of file TOBLayer.h.

Referenced by components(), TOBLayer(), and ~TOBLayer().

BinFinderType TOBLayer::theInnerBinFinder
private

Definition at line 81 of file TOBLayer.h.

Referenced by computeCrossings(), searchNeighbors(), and TOBLayer().

std::vector<const GeometricSearchDet*> TOBLayer::theInnerComps
private

Definition at line 77 of file TOBLayer.h.

Referenced by subLayer(), and TOBLayer().

ReferenceCountingPointer<BoundCylinder> TOBLayer::theInnerCylinder
private

Definition at line 84 of file TOBLayer.h.

Referenced by computeCrossings(), and TOBLayer().

BinFinderType TOBLayer::theOuterBinFinder
private

Definition at line 82 of file TOBLayer.h.

Referenced by computeCrossings(), searchNeighbors(), and TOBLayer().

std::vector<const GeometricSearchDet*> TOBLayer::theOuterComps
private

Definition at line 78 of file TOBLayer.h.

Referenced by subLayer(), and TOBLayer().

ReferenceCountingPointer<BoundCylinder> TOBLayer::theOuterCylinder
private

Definition at line 85 of file TOBLayer.h.

Referenced by computeCrossings(), and TOBLayer().