CMS 3D CMS Logo

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

#include <PixelForwardLayer.h>

Inheritance diagram for PixelForwardLayer:
ForwardDetLayer GeometricSearchDetWithGroups DetLayer GeometricSearchDet GeometricSearchDet

Classes

struct  SubTurbineCrossings
 

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
 
 PixelForwardLayer (std::vector< const PixelBlade * > &blades)
 
virtual SubDetector subDetector () const
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 ~PixelForwardLayer ()
 
- Public Member Functions inherited from ForwardDetLayer
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer ()
 
virtual Location location () const
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const
 
virtual const BoundSurfacesurface () const
 The surface of the GeometricSearchDet. More...
 
virtual ~ForwardDetLayer ()
 
- 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 Types

typedef PeriodicBinFinderInPhi
< double > 
BinFinderType
 

Private Member Functions

SubTurbineCrossings computeCrossings (const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const
 
int computeHelicity (const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result) const
 

Private Attributes

std::vector< const GeomDet * > theBasicComps
 
BinFinderType theBinFinder
 
std::vector< const
GeometricSearchDet * > 
theComps
 

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
 
- Public Types inherited from GeometricSearchDetWithGroups
typedef
GeometricSearchDet::DetWithState 
DetWithState
 
- Protected Member Functions inherited from ForwardDetLayer
virtual BoundDiskcomputeSurface ()
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 
- Protected Attributes inherited from GeometricSearchDet
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A concrete implementation for PixelForward layer built out of ForwardPixelBlade

Definition at line 15 of file PixelForwardLayer.h.

Member Typedef Documentation

Definition at line 66 of file PixelForwardLayer.h.

Constructor & Destructor Documentation

PixelForwardLayer::PixelForwardLayer ( std::vector< const PixelBlade * > &  blades)

Definition at line 23 of file PixelForwardLayer.cc.

References ForwardDetLayer::computeSurface(), BoundDisk::innerRadius(), LogDebug, BoundDisk::outerRadius(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), ForwardDetLayer::setSurface(), ForwardDetLayer::specificSurface(), ForwardDetLayer::surface(), theBasicComps, theBinFinder, theComps, and PV3DBase< T, PVType, FrameType >::z().

23  :
24  theComps(blades.begin(),blades.end())
25 {
26  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
27  it!=theComps.end();it++){
28  theBasicComps.insert(theBasicComps.end(),
29  (**it).basicComponents().begin(),
30  (**it).basicComponents().end());
31  }
32 
33  //They should be already phi-ordered. TO BE CHECKED!!
34  //sort( theBlades.begin(), theBlades.end(), PhiLess());
36 
37  //Is a "periodic" binFinderInPhi enough?. TO BE CHECKED!!
38  theBinFinder = BinFinderType( theComps.front()->surface().position().phi(),
39  theComps.size());
40 
41  //--------- DEBUG INFO --------------
42  LogDebug("TkDetLayers") << "DEBUG INFO for PixelForwardLayer" << "\n"
43  << "PixelForwardLayer.surfcace.phi(): "
44  << this->surface().position().phi() << "\n"
45  << "PixelForwardLayer.surfcace.z(): "
46  << this->surface().position().z() << "\n"
47  << "PixelForwardLayer.surfcace.innerR(): "
48  << this->specificSurface().innerRadius() << "\n"
49  << "PixelForwardLayer.surfcace.outerR(): "
50  << this->specificSurface().outerRadius() ;
51 
52  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
53  it!=theComps.end(); it++){
54  LogDebug("TkDetLayers") << "blades phi,z,r: "
55  << (*it)->surface().position().phi() << " , "
56  << (*it)->surface().position().z() << " , "
57  << (*it)->surface().position().perp();
58  }
59  //-----------------------------------
60 
61 
62 }
#define LogDebug(id)
virtual BoundDisk * computeSurface()
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
void setSurface(BoundDisk *cp)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
T z() const
Definition: PV3DBase.h:63
virtual const BoundDisk & specificSurface() const
std::vector< const GeometricSearchDet * > theComps
PeriodicBinFinderInPhi< double > BinFinderType
float outerRadius() const
The outer radius of the disk.
Definition: BoundDisk.h:75
float innerRadius() const
The inner radius of the disk.
Definition: BoundDisk.h:72
BinFinderType theBinFinder
const PositionType & position() const
std::vector< const GeomDet * > theBasicComps
PixelForwardLayer::~PixelForwardLayer ( )

Definition at line 64 of file PixelForwardLayer.cc.

References i, and theComps.

64  {
65  vector<const GeometricSearchDet*>::const_iterator i;
66  for (i=theComps.begin(); i!=theComps.end(); i++) {
67  delete *i;
68  }
69 }
int i
Definition: DBlmapReader.cc:9
std::vector< const GeometricSearchDet * > theComps

Member Function Documentation

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

Implements GeometricSearchDet.

Definition at line 22 of file PixelForwardLayer.h.

References theBasicComps.

22 {return theBasicComps;}
std::vector< const GeomDet * > theBasicComps
virtual const std::vector<const GeometricSearchDet*>& PixelForwardLayer::components ( ) const
inlinevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 24 of file PixelForwardLayer.h.

References theComps.

24 {return theComps;}
std::vector< const GeometricSearchDet * > theComps
PixelForwardLayer::SubTurbineCrossings PixelForwardLayer::computeCrossings ( const TrajectoryStateOnSurface startingState,
PropagationDirection  propDir 
) const
private

Definition at line 182 of file PixelForwardLayer.cc.

References PeriodicBinFinderInPhi< T >::binIndex(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixArbitraryPlaneCrossing2Order::pathLength(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), HelixArbitraryPlaneCrossing2Order::position(), rho, ForwardDetLayer::specificSurface(), ForwardDetLayer::surface(), theBinFinder, theComps, GloballyPositioned< T >::toLocal(), TrajectoryStateOnSurface::transverseCurvature(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by groupedCompatibleDetsV().

184 {
186 
187  HelixPlaneCrossing::PositionType startPos( startingState.globalPosition());
188  HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum());
189  float rho( startingState.transverseCurvature());
190 
191  HelixArbitraryPlaneCrossing turbineCrossing( startPos, startDir, rho,
192  propDir);
193 
194  pair<bool,double> thePath = turbineCrossing.pathLength( specificSurface() );
195 
196  if (!thePath.first) {
197  //edm::LogInfo("TkDetLayers") << "ERROR in PixelForwardLayer: disk not crossed by track" ;
198  return SubTurbineCrossings();
199  }
200 
201  HelixPlaneCrossing::PositionType turbinePoint( turbineCrossing.position(thePath.second));
202  HelixPlaneCrossing::DirectionType turbineDir( turbineCrossing.direction(thePath.second));
203  int closestIndex = theBinFinder.binIndex(turbinePoint.phi());
204 
205  const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
206  theComps[closestIndex]->surface()));
207 
208 
209  HelixArbitraryPlaneCrossing2Order theBladeCrossing(turbinePoint, turbineDir, rho);
210 
211  pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
212  LocalPoint closestPos = closestPlane.toLocal(GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
213 
214  float closestDist = closestPos.x(); // use fact that local X perp to global Y
215 
216  //int next = turbinePoint.phi() - closestPlane.position().phi() > 0 ? closest+1 : closest-1;
217  int nextIndex = PhiLess()( closestPlane.position().phi(), turbinePoint.phi()) ?
218  closestIndex+1 : closestIndex-1;
219 
220  const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
221  theComps[ theBinFinder.binIndex(nextIndex)]->surface()));
222 
223  pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
224  LocalPoint nextPos = nextPlane.toLocal(GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
225 
226  float nextDist = nextPos.x();
227 
228  if (fabs(closestDist) < fabs(nextDist)) {
229  return SubTurbineCrossings( closestIndex, nextIndex, nextDist);
230  }
231  else {
232  return SubTurbineCrossings( nextIndex, closestIndex, closestDist);
233  }
234 }
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
Definition: DDAxes.h:10
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint globalPosition() const
Vector2DBase< float, LocalTag > Local2DVector
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
virtual const BoundDisk & specificSurface() const
std::vector< const GeometricSearchDet * > theComps
GlobalVector globalMomentum() const
BinFinderType theBinFinder
T x() const
Definition: PV3DBase.h:61
int PixelForwardLayer::computeHelicity ( const GeometricSearchDet firstBlade,
const GeometricSearchDet secondBlade 
) const
private

Definition at line 175 of file PixelForwardLayer.cc.

References GeometricSearchDet::position(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by groupedCompatibleDetsV(), and searchNeighbors().

176 {
177  if( fabs(firstBlade->position().z()) < fabs(secondBlade->position().z()) ) return 0;
178  return 1;
179 }
T z() const
Definition: PV3DBase.h:63
virtual const Surface::PositionType & position() const
Returns position of the surface.
float PixelForwardLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 237 of file PixelForwardLayer.cc.

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

Referenced by groupedCompatibleDetsV().

240 {
241  return est.maximalLocalDisplacement(tsos, det->surface()).x();
242 }
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
x
Definition: VDTMath.h:216
void PixelForwardLayer::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
virtual

Reimplemented from GeometricSearchDet.

Definition at line 72 of file PixelForwardLayer.cc.

References Clusterizer1DCommons::add(), PeriodicBinFinderInPhi< T >::binIndex(), PixelForwardLayer::SubTurbineCrossings::closestIndex, computeCrossings(), computeHelicity(), computeWindowSize(), LayerCrossingSide::endcapSide(), PixelForwardLayer::SubTurbineCrossings::isValid, PixelForwardLayer::SubTurbineCrossings::nextIndex, DetGroupMerger::orderAndMergeTwoLevels(), Propagator::propagationDirection(), query::result, searchNeighbors(), theBinFinder, theComps, and svgfig::window().

75  {
76  vector<DetGroup> closestResult;
77  SubTurbineCrossings crossings;
78 
79  crossings = computeCrossings( tsos, prop.propagationDirection());
80  if (!crossings.isValid){
81  //edm::LogInfo("TkDetLayers") << "computeCrossings returns invalid in PixelForwardLayer::groupedCompatibleDets:";
82  return;
83  }
84 
85  typedef CompatibleDetToGroupAdder Adder;
86  Adder::add( *theComps[theBinFinder.binIndex(crossings.closestIndex)],
87  tsos, prop, est, closestResult);
88 
89  if(closestResult.empty()){
90  Adder::add( *theComps[theBinFinder.binIndex(crossings.nextIndex)],
91  tsos, prop, est, result);
92  return;
93  }
94 
95  DetGroupElement closestGel( closestResult.front().front());
96  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
97 
98  //float detWidth = closestGel.det()->surface().bounds().width();
99  //if (crossings.nextDistance < detWidth + window) {
100  vector<DetGroup> nextResult;
101  if (Adder::add( *theComps[theBinFinder.binIndex(crossings.nextIndex)],
102  tsos, prop, est, nextResult)) {
103  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
104  int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(crossings.closestIndex)],
105  theComps[theBinFinder.binIndex(crossings.nextIndex)] );
106  DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result,
107  theHelicity, crossingSide);
108  }
109  else {
110  result.swap(closestResult);
111  }
112 
113  /*
114  }
115  else {
116  result.swap(closestResult);
117  }
118  */
119 
120  // --- THIS lines may speed up the reconstruction. But it reduces slightly the efficiency.
121  // only loop over neighbors (other than closest and next) if window is BIG
122  //if (window > 0.5*detWidth) {
123  searchNeighbors( tsos, prop, est, crossings, window, result);
124  //}
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
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
tuple result
Definition: query.py:137
std::vector< const GeometricSearchDet * > theComps
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result) const
BinFinderType theBinFinder
int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
void PixelForwardLayer::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubTurbineCrossings crossings,
float  window,
std::vector< DetGroup > &  result 
) const
private

Definition at line 130 of file PixelForwardLayer.cc.

References Clusterizer1DCommons::add(), PeriodicBinFinderInPhi< T >::binIndex(), PixelForwardLayer::SubTurbineCrossings::closestIndex, computeHelicity(), LayerCrossingSide::endcapSide(), max(), min, PixelForwardLayer::SubTurbineCrossings::nextIndex, theBinFinder, theComps, and tmp.

Referenced by groupedCompatibleDetsV().

136 {
137  typedef CompatibleDetToGroupAdder Adder;
138  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
139  typedef DetGroupMerger Merger;
140 
141  int negStart = min( crossings.closestIndex, crossings.nextIndex) - 1;
142  int posStart = max( crossings.closestIndex, crossings.nextIndex) + 1;
143 
144  int quarter = theComps.size()/4;
145 
146  vector<DetGroup> tmp;
147  vector<DetGroup> newResult;
148  for (int idet=negStart; idet >= negStart - quarter+1; idet--) {
149  tmp.clear();
150  newResult.clear();
151  const GeometricSearchDet* neighbor = theComps[theBinFinder.binIndex(idet)];
152  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
153  // maybe also add shallow crossing angle test here???
154  if (!Adder::add( *neighbor, tsos, prop, est, tmp)) break;
155  int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(idet)],
156  theComps[theBinFinder.binIndex(idet+1)] );
157  Merger::orderAndMergeTwoLevels( tmp, result, newResult, theHelicity, crossingSide);
158  result.swap(newResult);
159  }
160  for (int idet=posStart; idet < posStart + quarter-1; idet++) {
161  tmp.clear();
162  newResult.clear();
163  const GeometricSearchDet* neighbor = theComps[theBinFinder.binIndex(idet)];
164  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
165  // maybe also add shallow crossing angle test here???
166  if (!Adder::add( *neighbor, tsos, prop, est, tmp)) break;
167  int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(idet-1)],
168  theComps[theBinFinder.binIndex(idet)] );
169  Merger::orderAndMergeTwoLevels( result, tmp, newResult, theHelicity, crossingSide);
170  result.swap(newResult);
171  }
172 }
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
#define min(a, b)
Definition: mlp_lapack.h:161
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
const T & max(const T &a, const T &b)
tuple result
Definition: query.py:137
std::vector< const GeometricSearchDet * > theComps
Definition: Merger.h:30
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
BinFinderType theBinFinder
int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
virtual SubDetector PixelForwardLayer::subDetector ( ) const
inlinevirtual

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

Implements DetLayer.

Definition at line 32 of file PixelForwardLayer.h.

References GeomDetEnumerators::PixelEndcap.

Member Data Documentation

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

Definition at line 70 of file PixelForwardLayer.h.

Referenced by basicComponents(), and PixelForwardLayer().

BinFinderType PixelForwardLayer::theBinFinder
private
std::vector<const GeometricSearchDet*> PixelForwardLayer::theComps
private