CMS 3D CMS Logo

PixelInactiveAreaFinder.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_PixelInactiveAreaFinder_H
2 #define RecoTracker_TkTrackingRegions_PixelInactiveAreaFinder_H
3 
6 
8 
12 
14 
15 class SiPixelQuality;
16 class TrackerGeometry;
17 class TrackerTopology;
18 
19 // Adapted from a summer student project of Niko Leskinen (HIP, Finland)
20 
22 public:
26 
27  struct DetGroupSpan {
28  int subdetId;
29  std::pair<float, float> phiSpan;
30  std::pair<float, float> zSpan;
31  std::pair<float, float> rSpan;
32  unsigned int layer;
33  unsigned int disk;
34  DetGroupSpan() : subdetId(0), phiSpan(0, 0), zSpan(0, 0), rSpan(0, 0), layer(0), disk(0) {}
35  };
36  using DetGroupSpanContainer = std::vector<DetGroupSpan>;
37 
38  class InactiveAreas {
39  public:
40  InactiveAreas(const std::vector<SeedingLayerId>* inactiveLayers,
41  std::vector<DetGroupSpanContainer>&& inactiveSpans,
42  const std::vector<std::pair<unsigned short, unsigned short> >* inactiveLayerPairIndices,
43  const std::vector<std::vector<LayerSetIndex> >* layerSetIndexInactiveToActive)
44  : inactiveLayers_(inactiveLayers),
45  inactiveSpans_(std::move(inactiveSpans)),
46  inactiveLayerPairIndices_(inactiveLayerPairIndices),
47  layerSetIndexInactiveToActive_(layerSetIndexInactiveToActive) {}
48 
49  template <typename T>
50  using VecArray2 = edm::VecArray<
51  T,
52  2>; // 2 inactive layers (using VecArray for possible extension to 1 inactive layer, i.e. triplet mitigation)
53  std::vector<std::pair<VecArray2<Area>, std::vector<LayerSetIndex> > > areasAndLayerSets(const GlobalPoint& point,
54  float zwidth) const;
55  std::vector<std::pair<VecArray2<DetGroupSpan>, std::vector<LayerSetIndex> > > spansAndLayerSets(
56  const GlobalPoint& point, float zwidth) const;
57 
58  private:
59  const std::vector<SeedingLayerId>* inactiveLayers_; // pointer to PixelInactiveAreaFinder::layers_
60  std::vector<DetGroupSpanContainer> inactiveSpans_; // inactive areas for each layer, indexing corresponds to layers_
61  const std::vector<std::pair<unsigned short, unsigned short> >*
62  inactiveLayerPairIndices_; // indices to the layer pair within the input SeedingLayerSetsHits for pairs of layers to check for correlated inactive regions
63  const std::vector<std::vector<LayerSetIndex> >*
64  layerSetIndexInactiveToActive_; // mapping from index in "inactive" seeding layers to "active" seeding layers
65  };
66 
68  const std::vector<SeedingLayerId>& seedingLayers,
69  const SeedingLayerSetsLooper& seedingLayerSetsLooper,
71  ~PixelInactiveAreaFinder() = default;
72 
74 
76 
77 private:
78  // Configuration
79  const bool debug_;
82 
83  std::vector<SeedingLayerId> inactiveLayers_; // layers to check for inactive regions
84  std::vector<std::pair<unsigned short, unsigned short> > inactiveLayerSetIndices_; // indices within inactiveLayers_
85  std::vector<std::vector<LayerSetIndex> >
86  layerSetIndexInactiveToActive_; // mapping from index in inactiveLayers_ to constructor seedingLayers+seedingLayerSetsLooper
87 
88  std::vector<edm::EDGetTokenT<DetIdCollection> > inactivePixelDetectorTokens_;
89  std::vector<edm::EDGetTokenT<PixelFEDChannelCollection> > badPixelFEDChannelsTokens_;
90 
91  // Output type aliases
92  using DetGroupSpanContainerPair = std::pair<DetGroupSpanContainer, DetGroupSpanContainer>;
93  using OverlapSpans = std::vector<DetGroupSpan>;
94  using OverlapSpansContainer = std::vector<OverlapSpans>;
95  // static data members; TODO see if these could be obtained from the geometry
96  std::array<unsigned short, 4> nBPixLadders;
97  unsigned short nModulesPerLadder;
98  // type aliases
99  using det_t = uint32_t;
100  using DetContainer = std::vector<uint32_t>;
101  using DetGroup = std::vector<uint32_t>;
102  using DetGroupContainer = std::vector<DetGroup>;
103  using DetectorSet = std::set<uint32_t>;
104  using Stream = std::stringstream;
105  // data handles and containers;
107 
108  const SiPixelQuality* pixelQuality_ = nullptr;
111 
116  // functions for fetching date from handles
117  void updatePixelDets(const edm::EventSetup& iSetup);
118  void getBadPixelDets(const edm::Event& iEvent, const edm::EventSetup& iSetup);
119  // Printing functions
120  void detInfo(const det_t& det, Stream& ss);
121  void printPixelDets();
122  void printBadPixelDets();
123  void printBadDetGroups();
124  void printBadDetGroupSpans();
125  void createPlottingFiles();
126  // Functions for finding bad detGroups
127  bool detWorks(det_t det);
130  DetGroup reachableDetGroup(const det_t& initDet, DetectorSet& foundDets);
133  // Functions for finding ranges that detGroups cover
134  void getPhiSpanBarrel(const DetGroup& detGroup, DetGroupSpan& cspan);
135  void getPhiSpanEndcap(const DetGroup& detGroup, DetGroupSpan& cspan);
136  void getZSpan(const DetGroup& detGroup, DetGroupSpan& cspan);
137  void getRSpan(const DetGroup& detGroup, DetGroupSpan& cspan);
138  void getSpan(const DetGroup& detGroup, DetGroupSpan& cspan);
140 };
141 
142 #endif
PixelInactiveAreaFinder::DetGroupSpan::DetGroupSpan
DetGroupSpan()
Definition: PixelInactiveAreaFinder.h:34
PixelInactiveAreaFinder::~PixelInactiveAreaFinder
~PixelInactiveAreaFinder()=default
PixelInactiveAreaFinder::detGroupSpans
DetGroupSpanContainerPair detGroupSpans()
Definition: PixelInactiveAreaFinder.cc:1141
PixelInactiveAreaFinder::badAdjecentDetsEndcap
DetGroup badAdjecentDetsEndcap(const det_t &det)
Definition: PixelInactiveAreaFinder.cc:924
HLT_FULL_cff.seedingLayers
seedingLayers
Definition: HLT_FULL_cff.py:9855
PixelInactiveAreaFinder::InactiveAreas::inactiveLayers_
const std::vector< SeedingLayerId > * inactiveLayers_
Definition: PixelInactiveAreaFinder.h:59
edm::ESWatcher< TrackerDigiGeometryRecord >
PixelInactiveAreaFinder::badDetGroupsEndcap
DetGroupContainer badDetGroupsEndcap()
Definition: PixelInactiveAreaFinder.cc:988
PixelInactiveAreaFinder::detWorks
bool detWorks(det_t det)
Definition: PixelInactiveAreaFinder.cc:894
TrackerTopology
Definition: TrackerTopology.h:16
PixelFEDChannel.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PixelInactiveAreaFinder::OverlapSpans
std::vector< DetGroupSpan > OverlapSpans
Definition: PixelInactiveAreaFinder.h:93
PixelInactiveAreaFinder::DetGroupSpan::phiSpan
std::pair< float, float > phiSpan
Definition: PixelInactiveAreaFinder.h:29
PixelInactiveAreaFinder::DetectorSet
std::set< uint32_t > DetectorSet
Definition: PixelInactiveAreaFinder.h:103
PixelInactiveAreaFinder::InactiveAreas::VecArray2
edm::VecArray< T, 2 > VecArray2
Definition: PixelInactiveAreaFinder.h:52
PixelInactiveAreaFinder::DetGroupSpan::layer
unsigned int layer
Definition: PixelInactiveAreaFinder.h:32
PixelInactiveAreaFinder::createPlottingFiles
void createPlottingFiles()
Definition: PixelInactiveAreaFinder.cc:852
SeedingLayerSetsHits::LayerSetIndex
unsigned short LayerSetIndex
Definition: SeedingLayerSetsHits.h:28
PixelInactiveAreaFinder::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: PixelInactiveAreaFinder.h:109
PixelInactiveAreaFinder::DetGroupSpan::rSpan
std::pair< float, float > rSpan
Definition: PixelInactiveAreaFinder.h:31
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
PixelInactiveAreaFinder
Definition: PixelInactiveAreaFinder.h:21
PixelInactiveAreaFinder::badPixelDetsEndcap_
DetContainer badPixelDetsEndcap_
Definition: PixelInactiveAreaFinder.h:115
PixelInactiveAreaFinder::badPixelFEDChannelsTokens_
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > badPixelFEDChannelsTokens_
Definition: PixelInactiveAreaFinder.h:89
PixelInactiveAreaFinder::det_t
uint32_t det_t
Definition: PixelInactiveAreaFinder.h:99
AreaSeededTrackingRegionsBuilder.h
PixelInactiveAreaFinder::Stream
std::stringstream Stream
Definition: PixelInactiveAreaFinder.h:104
PixelInactiveAreaFinder::badDetGroupsBarrel
DetGroupContainer badDetGroupsBarrel()
Definition: PixelInactiveAreaFinder.cc:978
PixelInactiveAreaFinder::OverlapSpansContainer
std::vector< OverlapSpans > OverlapSpansContainer
Definition: PixelInactiveAreaFinder.h:94
PixelInactiveAreaFinder::inactiveAreas
InactiveAreas inactiveAreas(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: PixelInactiveAreaFinder.cc:554
PixelInactiveAreaFinder::ignoreSingleFPixPanelModules_
const bool ignoreSingleFPixPanelModules_
Definition: PixelInactiveAreaFinder.h:81
SeedingLayerSetsBuilder.h
PixelInactiveAreaFinder::trackerTopology_
const TrackerTopology * trackerTopology_
Definition: PixelInactiveAreaFinder.h:110
PixelInactiveAreaFinder::InactiveAreas::inactiveLayerPairIndices_
const std::vector< std::pair< unsigned short, unsigned short > > * inactiveLayerPairIndices_
Definition: PixelInactiveAreaFinder.h:62
PixelInactiveAreaFinder::updatePixelDets
void updatePixelDets(const edm::EventSetup &iSetup)
Definition: PixelInactiveAreaFinder.cc:612
PixelInactiveAreaFinder::printPixelDets
void printPixelDets()
Definition: PixelInactiveAreaFinder.cc:775
SeedingLayerSetsBuilder::SeedingLayerId
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
Definition: SeedingLayerSetsBuilder.h:33
PixelInactiveAreaFinder::InactiveAreas::areasAndLayerSets
std::vector< std::pair< VecArray2< Area >, std::vector< LayerSetIndex > > > areasAndLayerSets(const GlobalPoint &point, float zwidth) const
Definition: PixelInactiveAreaFinder.cc:373
PixelInactiveAreaFinder::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &desc)
Definition: PixelInactiveAreaFinder.cc:541
Point3DBase< float, GlobalTag >
PixelInactiveAreaFinder::debug_
const bool debug_
Definition: PixelInactiveAreaFinder.h:79
ParameterSetDescription.h
PixelInactiveAreaFinder::pixelQuality_
const SiPixelQuality * pixelQuality_
Definition: PixelInactiveAreaFinder.h:108
PixelInactiveAreaFinder::DetGroupSpan::subdetId
int subdetId
Definition: PixelInactiveAreaFinder.h:28
PixelInactiveAreaFinder::nModulesPerLadder
unsigned short nModulesPerLadder
Definition: PixelInactiveAreaFinder.h:97
PixelInactiveAreaFinder::printBadDetGroupSpans
void printBadDetGroupSpans()
Definition: PixelInactiveAreaFinder.cc:839
TrackerDigiGeometryRecord.h
edm::VecArray
Definition: VecArray.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
SiPixelQuality
Definition: SiPixelQuality.h:27
PixelInactiveAreaFinder::InactiveAreas::inactiveSpans_
std::vector< DetGroupSpanContainer > inactiveSpans_
Definition: PixelInactiveAreaFinder.h:60
PixelInactiveAreaFinder::getSpan
void getSpan(const DetGroup &detGroup, DetGroupSpan &cspan)
Definition: PixelInactiveAreaFinder.cc:1124
PixelInactiveAreaFinder::getPhiSpanBarrel
void getPhiSpanBarrel(const DetGroup &detGroup, DetGroupSpan &cspan)
Definition: PixelInactiveAreaFinder.cc:1006
PixelInactiveAreaFinder::getRSpan
void getRSpan(const DetGroup &detGroup, DetGroupSpan &cspan)
Definition: PixelInactiveAreaFinder.cc:1114
PixelInactiveAreaFinder::pixelDetsBarrel_
DetContainer pixelDetsBarrel_
Definition: PixelInactiveAreaFinder.h:112
PixelInactiveAreaFinder::reachableDetGroup
DetGroup reachableDetGroup(const det_t &initDet, DetectorSet &foundDets)
Definition: PixelInactiveAreaFinder.cc:949
PixelInactiveAreaFinder::inactiveLayerSetIndices_
std::vector< std::pair< unsigned short, unsigned short > > inactiveLayerSetIndices_
Definition: PixelInactiveAreaFinder.h:84
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
PixelInactiveAreaFinder::DetGroupSpan
Definition: PixelInactiveAreaFinder.h:27
SeedingLayerSetsLooper
Definition: SeedingLayerSetsLooper.h:10
edm::EventSetup
Definition: EventSetup.h:57
PixelInactiveAreaFinder::DetGroupSpanContainerPair
std::pair< DetGroupSpanContainer, DetGroupSpanContainer > DetGroupSpanContainerPair
Definition: PixelInactiveAreaFinder.h:92
PixelInactiveAreaFinder::InactiveAreas::spansAndLayerSets
std::vector< std::pair< VecArray2< DetGroupSpan >, std::vector< LayerSetIndex > > > spansAndLayerSets(const GlobalPoint &point, float zwidth) const
Definition: PixelInactiveAreaFinder.cc:402
PixelInactiveAreaFinder::getPhiSpanEndcap
void getPhiSpanEndcap(const DetGroup &detGroup, DetGroupSpan &cspan)
Definition: PixelInactiveAreaFinder.cc:1046
PixelInactiveAreaFinder::layerSetIndexInactiveToActive_
std::vector< std::vector< LayerSetIndex > > layerSetIndexInactiveToActive_
Definition: PixelInactiveAreaFinder.h:86
PixelInactiveAreaFinder::createPlottingFiles_
const bool createPlottingFiles_
Definition: PixelInactiveAreaFinder.h:80
PixelInactiveAreaFinder::InactiveAreas
Definition: PixelInactiveAreaFinder.h:38
PixelInactiveAreaFinder::LayerSetIndex
SeedingLayerSetsHits::LayerSetIndex LayerSetIndex
Definition: PixelInactiveAreaFinder.h:25
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
PixelInactiveAreaFinder::detInfo
void detInfo(const det_t &det, Stream &ss)
Definition: PixelInactiveAreaFinder.cc:738
PixelInactiveAreaFinder::printBadDetGroups
void printBadDetGroups()
Definition: PixelInactiveAreaFinder.cc:805
PixelInactiveAreaFinder::DetGroupContainer
std::vector< DetGroup > DetGroupContainer
Definition: PixelInactiveAreaFinder.h:102
T
long double T
Definition: Basic3DVectorLD.h:48
PixelInactiveAreaFinder::badAdjecentDetsBarrel
DetGroup badAdjecentDetsBarrel(const det_t &det)
Definition: PixelInactiveAreaFinder.cc:898
PixelInactiveAreaFinder::PixelInactiveAreaFinder
PixelInactiveAreaFinder(const edm::ParameterSet &iConfig, const std::vector< SeedingLayerId > &seedingLayers, const SeedingLayerSetsLooper &seedingLayerSetsLooper, edm::ConsumesCollector &&iC)
Definition: PixelInactiveAreaFinder.cc:462
PixelInactiveAreaFinder::badPixelDetsBarrel_
DetContainer badPixelDetsBarrel_
Definition: PixelInactiveAreaFinder.h:114
PixelInactiveAreaFinder::inactiveLayers_
std::vector< SeedingLayerId > inactiveLayers_
Definition: PixelInactiveAreaFinder.h:83
PixelInactiveAreaFinder::getZSpan
void getZSpan(const DetGroup &detGroup, DetGroupSpan &cspan)
Definition: PixelInactiveAreaFinder.cc:1104
VecArray.h
PixelInactiveAreaFinder::geometryWatcher_
edm::ESWatcher< TrackerDigiGeometryRecord > geometryWatcher_
Definition: PixelInactiveAreaFinder.h:106
PixelInactiveAreaFinder::DetGroupSpan::zSpan
std::pair< float, float > zSpan
Definition: PixelInactiveAreaFinder.h:30
PixelInactiveAreaFinder::getBadPixelDets
void getBadPixelDets(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: PixelInactiveAreaFinder.cc:691
PixelInactiveAreaFinder::InactiveAreas::layerSetIndexInactiveToActive_
const std::vector< std::vector< LayerSetIndex > > * layerSetIndexInactiveToActive_
Definition: PixelInactiveAreaFinder.h:64
DetGroup
Definition: DetGroup.h:41
PixelInactiveAreaFinder::InactiveAreas::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)
Definition: PixelInactiveAreaFinder.h:40
PixelInactiveAreaFinder::printBadPixelDets
void printBadPixelDets()
Definition: PixelInactiveAreaFinder.cc:790
PixelInactiveAreaFinder::DetContainer
std::vector< uint32_t > DetContainer
Definition: PixelInactiveAreaFinder.h:100
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
edm::Event
Definition: Event.h:73
PixelInactiveAreaFinder::SeedingLayerId
SeedingLayerSetsBuilder::SeedingLayerId SeedingLayerId
Definition: PixelInactiveAreaFinder.h:24
PixelInactiveAreaFinder::DetGroupSpanContainer
std::vector< DetGroupSpan > DetGroupSpanContainer
Definition: PixelInactiveAreaFinder.h:36
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
AreaSeededTrackingRegionsBuilder::Area
Definition: AreaSeededTrackingRegionsBuilder.h:21
DetIdCollection.h
PixelInactiveAreaFinder::pixelDetsEndcap_
DetContainer pixelDetsEndcap_
Definition: PixelInactiveAreaFinder.h:113
PixelInactiveAreaFinder::DetGroupSpan::disk
unsigned int disk
Definition: PixelInactiveAreaFinder.h:33
PixelInactiveAreaFinder::inactivePixelDetectorTokens_
std::vector< edm::EDGetTokenT< DetIdCollection > > inactivePixelDetectorTokens_
Definition: PixelInactiveAreaFinder.h:88
TrackerGeometry
Definition: TrackerGeometry.h:14
PixelInactiveAreaFinder::nBPixLadders
std::array< unsigned short, 4 > nBPixLadders
Definition: PixelInactiveAreaFinder.h:96