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 38 of file PixelInactiveAreaFinder.h.

Member Typedef Documentation

Definition at line 52 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 40 of file PixelInactiveAreaFinder.h.

44  : inactiveLayers_(inactiveLayers),
45  inactiveSpans_(std::move(inactiveSpans)),
46  inactiveLayerPairIndices_(inactiveLayerPairIndices),
47  layerSetIndexInactiveToActive_(layerSetIndexInactiveToActive) {}
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:511

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 373 of file PixelInactiveAreaFinder.cc.

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

Referenced by PixelInactiveAreaTrackingRegionsSeedingLayersProducer::produce().

373  {
374  auto spansLayerSets = spansAndLayerSets(point, zwidth);
375 
376  // TODO: try to remove this conversion...
377  std::vector<std::pair<VecArray2<Area>, std::vector<LayerSetIndex>>> ret;
378  for (auto& item : spansLayerSets) {
379  auto& innerSpan = item.first[0];
380  auto& outerSpan = item.first[1];
381  VecArray2<Area> areas;
382  areas.emplace_back(innerSpan.rSpan.first,
383  innerSpan.rSpan.second,
384  innerSpan.phiSpan.first,
385  innerSpan.phiSpan.second,
386  innerSpan.zSpan.first,
387  innerSpan.zSpan.second);
388  areas.emplace_back(outerSpan.rSpan.first,
389  outerSpan.rSpan.second,
390  outerSpan.phiSpan.first,
391  outerSpan.phiSpan.second,
392  outerSpan.zSpan.first,
393  outerSpan.zSpan.second);
394  ret.emplace_back(std::move(areas), std::move(item.second));
395  }
396 
397  return ret;
398 }
ret
prodAgent to be discontinued
def move(src, dest)
Definition: eostools.py:511
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 402 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, FastTimerService_cff::range, runTheMatrix::ret, contentValuesCheck::ss, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

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

402  {
403  // TODO: in the future use 2D-r for the origin for the phi overlap check
404  const float zmin = point.z() - zwidth;
405  const float zmax = point.z() + zwidth;
406 
407  std::vector<std::pair<VecArray2<DetGroupSpan>, std::vector<LayerSetIndex>>> ret;
408 
409  LogDebug("PixelInactiveAreaFinder") << "Origin at " << point.x() << "," << point.y() << "," << point.z()
410  << " z half width " << zwidth;
411 
412  for (LayerSetIndex i = 0, end = inactiveLayerPairIndices_->size(); i < end; ++i) {
413  const auto& layerIdxPair = (*inactiveLayerPairIndices_)[i];
414  const auto& innerSpans = inactiveSpans_[layerIdxPair.first];
415  const auto& outerSpans = inactiveSpans_[layerIdxPair.second];
416 
417  for (const auto& innerSpan : innerSpans) {
418  for (const auto& outerSpan : outerSpans) {
419  if (phiRangesOverlap(innerSpan.phiSpan, outerSpan.phiSpan)) {
420  std::pair<float, float> range(0, 0);
421 
422  bool zOverlap = false;
423  const auto innerDet = std::get<0>((*inactiveLayers_)[layerIdxPair.first]);
424  const auto outerDet = std::get<0>((*inactiveLayers_)[layerIdxPair.second]);
425  if (innerDet == GeomDetEnumerators::PixelBarrel) {
426  if (outerDet == GeomDetEnumerators::PixelBarrel)
427  zOverlap = getZAxisOverlapRangeBarrel(innerSpan, outerSpan, range);
428  else
429  zOverlap = getZAxisOverlapRangeBarrelEndcap(innerSpan, outerSpan, range);
430  } else {
431  if (outerDet == GeomDetEnumerators::PixelEndcap)
432  zOverlap = getZAxisOverlapRangeEndcap(innerSpan, outerSpan, range);
433  else
434  throw cms::Exception("LogicError") << "Forward->barrel transition is not supported";
435  }
436 
437  if (zOverlap && zmin <= range.second && range.first <= zmax) {
438 #ifdef EDM_ML_DEBUG
439  Stream ss;
440  for (auto ind : (*layerSetIndexInactiveToActive_)[i]) {
441  ss << ind << ",";
442  }
443  ss << "\n ";
444  detGroupSpanInfo(innerSpan, ss);
445  ss << "\n ";
446  detGroupSpanInfo(outerSpan, ss);
447  LogTrace("PixelInactiveAreaFinder") << " adding areas for active layer sets " << ss.str();
448 #endif
449  VecArray2<DetGroupSpan> vec;
450  vec.emplace_back(innerSpan);
451  vec.emplace_back(outerSpan);
452  ret.emplace_back(std::move(vec), (*layerSetIndexInactiveToActive_)[i]);
453  }
454  }
455  }
456  }
457  }
458 
459  return ret;
460 }
#define LogDebug(id)
const std::vector< std::pair< unsigned short, unsigned short > > * inactiveLayerPairIndices_
const std::vector< std::vector< LayerSetIndex > > * layerSetIndexInactiveToActive_
ret
prodAgent to be discontinued
T y() const
Definition: PV3DBase.h:60
T z() const
Definition: PV3DBase.h:61
std::vector< DetGroupSpanContainer > inactiveSpans_
#define end
Definition: vmac.h:39
#define LogTrace(id)
T x() const
Definition: PV3DBase.h:59
def move(src, dest)
Definition: eostools.py:511
SeedingLayerSetsHits::LayerSetIndex LayerSetIndex

Member Data Documentation

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

Definition at line 62 of file PixelInactiveAreaFinder.h.

Referenced by spansAndLayerSets().

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

Definition at line 59 of file PixelInactiveAreaFinder.h.

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

Definition at line 60 of file PixelInactiveAreaFinder.h.

Referenced by spansAndLayerSets().

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

Definition at line 64 of file PixelInactiveAreaFinder.h.

Referenced by spansAndLayerSets().