CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
PixelInactiveAreaFinder::InactiveAreas Class Reference

#include <PixelInactiveAreaFinder.h>

Public Types

template<typename T >
using VecArray2 = edm::VecArray< T, 2 >
 

Public Member Functions

std::vector< std::pair< VecArray2< Area >, std::vector< LayerSetIndex > > > areasAndLayerSets (const GlobalPoint &point, float zwidth) const
 
 InactiveAreas (const std::vector< SeedingLayerId > *inactiveLayers, std::vector< DetGroupSpanContainer > &&inactiveSpans, const std::vector< std::pair< unsigned short, unsigned short > > *inactiveLayerPairIndices, const std::vector< std::vector< LayerSetIndex > > *layerSetIndexInactiveToActive)
 
std::vector< std::pair< VecArray2< DetGroupSpan >, std::vector< LayerSetIndex > > > spansAndLayerSets (const GlobalPoint &point, float zwidth) const
 

Private Attributes

const std::vector< std::pair< unsigned short, unsigned short > > * inactiveLayerPairIndices_
 
const std::vector< SeedingLayerId > * inactiveLayers_
 
std::vector< DetGroupSpanContainerinactiveSpans_
 
const std::vector< std::vector< LayerSetIndex > > * layerSetIndexInactiveToActive_
 

Detailed Description

Definition at line 44 of file PixelInactiveAreaFinder.h.

Member Typedef Documentation

Definition at line 57 of file PixelInactiveAreaFinder.h.

Constructor & Destructor Documentation

PixelInactiveAreaFinder::InactiveAreas::InactiveAreas ( const std::vector< SeedingLayerId > *  inactiveLayers,
std::vector< DetGroupSpanContainer > &&  inactiveSpans,
const std::vector< std::pair< unsigned short, unsigned short > > *  inactiveLayerPairIndices,
const std::vector< std::vector< LayerSetIndex > > *  layerSetIndexInactiveToActive 
)
inline

Definition at line 46 of file PixelInactiveAreaFinder.h.

49  :
50  inactiveLayers_(inactiveLayers),
51  inactiveSpans_(std::move(inactiveSpans)),
52  inactiveLayerPairIndices_(inactiveLayerPairIndices),
53  layerSetIndexInactiveToActive_(layerSetIndexInactiveToActive)
54  {}
const std::vector< std::pair< unsigned short, unsigned short > > * inactiveLayerPairIndices_
const std::vector< std::vector< LayerSetIndex > > * layerSetIndexInactiveToActive_
const std::vector< SeedingLayerId > * inactiveLayers_
std::vector< DetGroupSpanContainer > inactiveSpans_
def move(src, dest)
Definition: eostools.py:510

Member Function Documentation

std::vector< std::pair< edm::VecArray< PixelInactiveAreaFinder::Area, 2 >, std::vector< PixelInactiveAreaFinder::LayerSetIndex > > > PixelInactiveAreaFinder::InactiveAreas::areasAndLayerSets ( const GlobalPoint point,
float  zwidth 
) const

Definition at line 352 of file PixelInactiveAreaFinder.cc.

References edm::VecArray< T, N >::emplace_back(), eostools::move(), and spansAndLayerSets().

Referenced by PixelInactiveAreaTrackingRegionsSeedingLayersProducer::produce().

352  {
353  auto spansLayerSets = spansAndLayerSets(point, zwidth);
354 
355  // TODO: try to remove this conversion...
356  std::vector<std::pair<VecArray2<Area>, std::vector<LayerSetIndex> > > ret;
357  for(auto& item: spansLayerSets) {
358  auto& innerSpan = item.first[0];
359  auto& outerSpan = item.first[1];
360  VecArray2<Area> areas;
361  areas.emplace_back(innerSpan.rSpan.first, innerSpan.rSpan.second,
362  innerSpan.phiSpan.first, innerSpan.phiSpan.second,
363  innerSpan.zSpan.first, innerSpan.zSpan.second);
364  areas.emplace_back(outerSpan.rSpan.first, outerSpan.rSpan.second,
365  outerSpan.phiSpan.first, outerSpan.phiSpan.second,
366  outerSpan.zSpan.first, outerSpan.zSpan.second);
367  ret.emplace_back(std::move(areas), std::move(item.second));
368  }
369 
370  return ret;
371 }
def move(src, dest)
Definition: eostools.py:510
std::vector< std::pair< VecArray2< DetGroupSpan >, std::vector< LayerSetIndex > > > spansAndLayerSets(const GlobalPoint &point, float zwidth) const
std::vector< std::pair< edm::VecArray< PixelInactiveAreaFinder::DetGroupSpan, 2 >, std::vector< PixelInactiveAreaFinder::LayerSetIndex > > > PixelInactiveAreaFinder::InactiveAreas::spansAndLayerSets ( const GlobalPoint point,
float  zwidth 
) const

Definition at line 374 of file PixelInactiveAreaFinder.cc.

References edm::VecArray< T, N >::emplace_back(), end, Exception, mps_fire::i, inactiveLayerPairIndices_, inactiveSpans_, layerSetIndexInactiveToActive_, LogDebug, LogTrace, eostools::move(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by areasAndLayerSets(), and operator<<().

374  {
375  // TODO: in the future use 2D-r for the origin for the phi overlap check
376  const float zmin = point.z()-zwidth;
377  const float zmax = point.z()+zwidth;
378 
379  std::vector<std::pair<VecArray2<DetGroupSpan>, std::vector<LayerSetIndex> > > ret;
380 
381  LogDebug("PixelInactiveAreaFinder") << "Origin at " << point.x() << "," << point.y() << "," << point.z() << " z half width " << zwidth;
382 
383  for(LayerSetIndex i=0, end=inactiveLayerPairIndices_->size(); i<end; ++i) {
384  const auto& layerIdxPair = (*inactiveLayerPairIndices_)[i];
385  const auto& innerSpans = inactiveSpans_[layerIdxPair.first];
386  const auto& outerSpans = inactiveSpans_[layerIdxPair.second];
387 
388  for(const auto& innerSpan: innerSpans) {
389  for(const auto& outerSpan: outerSpans) {
390 
391  if(phiRangesOverlap(innerSpan.phiSpan, outerSpan.phiSpan)) {
392  std::pair<float,float> range(0,0);
393 
394  bool zOverlap = false;
395  const auto innerDet = std::get<0>((*inactiveLayers_)[layerIdxPair.first]);
396  const auto outerDet = std::get<0>((*inactiveLayers_)[layerIdxPair.second]);
397  if(innerDet == GeomDetEnumerators::PixelBarrel) {
398  if(outerDet == GeomDetEnumerators::PixelBarrel)
399  zOverlap = getZAxisOverlapRangeBarrel(innerSpan, outerSpan, range);
400  else
401  zOverlap = getZAxisOverlapRangeBarrelEndcap(innerSpan, outerSpan, range);
402  }
403  else {
404  if(outerDet == GeomDetEnumerators::PixelEndcap)
405  zOverlap = getZAxisOverlapRangeEndcap(innerSpan, outerSpan, range);
406  else
407  throw cms::Exception("LogicError") << "Forward->barrel transition is not supported";
408  }
409 
410  if(zOverlap && zmin <= range.second && range.first <= zmax) {
411 #ifdef EDM_ML_DEBUG
412  Stream ss;
413  for(auto ind: (*layerSetIndexInactiveToActive_)[i]) {
414  ss << ind << ",";
415  }
416  ss << "\n ";
417  detGroupSpanInfo(innerSpan, ss);
418  ss << "\n ";
419  detGroupSpanInfo(outerSpan, ss);
420  LogTrace("PixelInactiveAreaFinder") << " adding areas for active layer sets " << ss.str();
421 #endif
422  VecArray2<DetGroupSpan> vec;
423  vec.emplace_back(innerSpan);
424  vec.emplace_back(outerSpan);
425  ret.emplace_back(std::move(vec), (*layerSetIndexInactiveToActive_)[i]);
426  }
427  }
428  }
429  }
430  }
431 
432  return ret;
433 }
#define LogDebug(id)
const std::vector< std::pair< unsigned short, unsigned short > > * inactiveLayerPairIndices_
const std::vector< std::vector< LayerSetIndex > > * layerSetIndexInactiveToActive_
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
std::vector< DetGroupSpanContainer > inactiveSpans_
#define end
Definition: vmac.h:39
#define LogTrace(id)
T x() const
Definition: PV3DBase.h:62
def move(src, dest)
Definition: eostools.py:510
SeedingLayerSetsHits::LayerSetIndex LayerSetIndex

Member Data Documentation

const std::vector<std::pair<unsigned short, unsigned short> >* PixelInactiveAreaFinder::InactiveAreas::inactiveLayerPairIndices_
private

Definition at line 64 of file PixelInactiveAreaFinder.h.

Referenced by spansAndLayerSets().

const std::vector<SeedingLayerId>* PixelInactiveAreaFinder::InactiveAreas::inactiveLayers_
private

Definition at line 62 of file PixelInactiveAreaFinder.h.

std::vector<DetGroupSpanContainer> PixelInactiveAreaFinder::InactiveAreas::inactiveSpans_
private

Definition at line 63 of file PixelInactiveAreaFinder.h.

Referenced by spansAndLayerSets().

const std::vector<std::vector<LayerSetIndex> >* PixelInactiveAreaFinder::InactiveAreas::layerSetIndexInactiveToActive_
private

Definition at line 65 of file PixelInactiveAreaFinder.h.

Referenced by spansAndLayerSets().