CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
PixelInactiveAreaFinder.cc File Reference
#include "PixelInactiveAreaFinder.h"
#include "FWCore/Utilities/interface/VecArray.h"
#include "FWCore/Utilities/interface/transform.h"
#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h"
#include "DataFormats/Math/interface/deltaPhi.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsLooper.h"
#include <fstream>
#include <queue>
#include <algorithm>

Go to the source code of this file.

Functions

 badPixelFEDChannelsTokens_ (edm::vector_transform(iConfig.getParameter< std::vector< edm::InputTag >>("badPixelFEDChannelCollectionLabels"), [&](const auto &tag){return iC.consumes< PixelFEDChannelCollection >(tag);}))
 
std::ostream & operator<< (std::ostream &os, SeedingLayerSetsBuilder::SeedingLayerId layer)
 
 pixelQualityToken_ (iC.esConsumes())
 
 trackerGeometryToken_ (iC.esConsumes())
 
 trackerTopologyToken_ (iC.esConsumes())
 

Function Documentation

badPixelFEDChannelsTokens_ ( edm::  vector_transformiConfig.getParameter< std::vector< edm::InputTag >>("badPixelFEDChannelCollectionLabels"),[&](const auto &tag){return iC.consumes< PixelFEDChannelCollection >(tag);})
std::ostream& operator<< ( std::ostream &  os,
SeedingLayerSetsBuilder::SeedingLayerId  layer 
)

Definition at line 16 of file PixelInactiveAreaFinder.cc.

References phase1PixelTopology::layer, NegEndcap, GeomDetEnumerators::PixelBarrel, and PosEndcap.

16  {
17  if (std::get<0>(layer) == GeomDetEnumerators::PixelBarrel) {
18  os << "BPix";
19  } else {
20  os << "FPix";
21  }
22  os << std::get<2>(layer);
23  if (std::get<1>(layer) == TrackerDetSide::PosEndcap) {
24  os << "_pos";
25  } else if (std::get<1>(layer) == TrackerDetSide::NegEndcap) {
26  os << "_neg";
27  }
28  return os;
29 }
constexpr std::array< uint8_t, layerIndexSize > layer
pixelQualityToken_ ( iC.  esConsumes())

Definition at line 475 of file PixelInactiveAreaFinder.cc.

References cms::cuda::assert(), HLT_FULL_cff::distance, Exception, spr::find(), newFWLiteAna::found, mps_fire::i, phase1PixelTopology::layer, LogDebug, LogTrace, runTheMatrix::ret, and HLT_FULL_cff::seedingLayers.

Referenced by MeasurementTrackerESProducer::MeasurementTrackerESProducer(), and MeasurementTrackerESProducer::produce().

475  {
476 #ifdef EDM_ML_DEBUG
477  for (const auto& layer : seedingLayers) {
478  LogTrace("PixelInactiveAreaFinder") << "Input layer subdet " << std::get<0>(layer) << " side "
479  << static_cast<unsigned int>(std::get<1>(layer)) << " layer "
480  << std::get<2>(layer);
481  }
482 #endif
483 
484  auto findOrAdd = [&](SeedingLayerId layer) -> unsigned short {
485  auto found = std::find(inactiveLayers_.cbegin(), inactiveLayers_.cend(), layer);
486  if (found == inactiveLayers_.cend()) {
487  auto ret = inactiveLayers_.size();
488  inactiveLayers_.push_back(layer);
489  return ret;
490  }
491  return std::distance(inactiveLayers_.cbegin(), found);
492  };
493 
494  // mapping from active layer pairs to inactive layer pairs
495  const auto activeToInactiveMap = createActiveToInactiveMap();
496 
497  // convert input layer pairs (that are for active layers) to layer
498  // pairs to look for inactive areas
499  LayerSetIndex i = 0;
500  for (const auto& layerSet : seedingLayerSetsLooper.makeRange(seedingLayers)) {
501  assert(layerSet.size() == 2);
502  auto found = activeToInactiveMap.find(std::make_pair(layerSet[0], layerSet[1]));
503  if (found == activeToInactiveMap.end()) {
504  throw cms::Exception("Configuration")
505  << "Encountered layer pair " << layerSet[0] << "+" << layerSet[1]
506  << " not found from the internal 'active layer pairs' to 'inactive layer pairs' mapping; either fix the "
507  "input or the mapping (in PixelInactiveAreaFinder.cc)";
508  }
509 
510  LogTrace("PixelInactiveAreaFinder") << "Input layer set " << layerSet[0] << "+" << layerSet[1];
511  for (const auto& inactiveLayerSet : found->second) {
512  auto innerInd = findOrAdd(inactiveLayerSet.first);
513  auto outerInd = findOrAdd(inactiveLayerSet.second);
514 
515  auto found = std::find(
516  inactiveLayerSetIndices_.cbegin(), inactiveLayerSetIndices_.cend(), std::make_pair(innerInd, outerInd));
517  if (found == inactiveLayerSetIndices_.end()) {
518  inactiveLayerSetIndices_.emplace_back(innerInd, outerInd);
519  layerSetIndexInactiveToActive_.push_back(std::vector<LayerSetIndex>{i});
520  } else {
521  layerSetIndexInactiveToActive_.at(std::distance(inactiveLayerSetIndices_.cbegin(), found))
522  .push_back(i); // TODO: move to operator[] once finished
523  }
524 
525  LogTrace("PixelInactiveAreaFinder")
526  << " inactive layer set " << inactiveLayerSet.first << "+" << inactiveLayerSet.second;
527  }
528 
529  ++i;
530  }
531 
532 #ifdef EDM_ML_DEBUG
533  LogDebug("PixelInactiveAreaFinder") << "All inactive layer sets";
534  for (const auto& idxPair : inactiveLayerSetIndices_) {
535  LogTrace("PixelInactiveAreaFinder") << " " << inactiveLayers_[idxPair.first] << "+"
536  << inactiveLayers_[idxPair.second];
537  }
538 #endif
539 }
tuple ret
prodAgent to be discontinued
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
assert(be >=bs)
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize > layer
#define LogDebug(id)
trackerGeometryToken_ ( iC.  esConsumes())
trackerTopologyToken_ ( iC.  esConsumes())