CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
HitPairGeneratorFromLayerPair Class Reference

#include <HitPairGeneratorFromLayerPair.h>

Public Types

typedef SeedingLayerSetsHits::SeedingLayer Layer
 
typedef LayerHitMapCache LayerCacheType
 
typedef SeedingLayerSetsHits::SeedingLayerSet Layers
 

Public Member Functions

HitDoublets doublets (const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es, const Layer &innerLayer, const Layer &outerLayer)
 
HitDoublets doublets (const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es, const Layer &innerLayer, const Layer &outerLayer, LayerCacheType &layerCache)
 
HitDoublets doublets (const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
 
HitDoublets doublets (const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es, Layers layers, LayerCacheType &layerCache)
 
 HitPairGeneratorFromLayerPair (unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int max=0)
 
void hitPairs (const TrackingRegion &reg, OrderedHitPairs &prs, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
 
Layer innerLayer (const Layers &layers) const
 
Layer outerLayer (const Layers &layers) const
 
 ~HitPairGeneratorFromLayerPair ()
 

Static Public Member Functions

static void doublets (const TrackingRegion &region, const DetLayer &innerHitDetLayer, const DetLayer &outerHitDetLayer, const RecHitsSortedInPhi &innerHitsMap, const RecHitsSortedInPhi &outerHitsMap, const edm::EventSetup &iSetup, const unsigned int theMaxElement, HitDoublets &result)
 

Private Attributes

const unsigned int theInnerLayer
 
LayerCacheTypetheLayerCache
 
const unsigned int theMaxElement
 
const unsigned int theOuterLayer
 

Detailed Description

Definition at line 11 of file HitPairGeneratorFromLayerPair.h.

Member Typedef Documentation

◆ Layer

Definition at line 15 of file HitPairGeneratorFromLayerPair.h.

◆ LayerCacheType

Definition at line 13 of file HitPairGeneratorFromLayerPair.h.

◆ Layers

Definition at line 14 of file HitPairGeneratorFromLayerPair.h.

Constructor & Destructor Documentation

◆ HitPairGeneratorFromLayerPair()

HitPairGeneratorFromLayerPair::HitPairGeneratorFromLayerPair ( unsigned int  inner,
unsigned int  outer,
LayerCacheType layerCache,
unsigned int  max = 0 
)

Definition at line 34 of file HitPairGeneratorFromLayerPair.cc.

◆ ~HitPairGeneratorFromLayerPair()

HitPairGeneratorFromLayerPair::~HitPairGeneratorFromLayerPair ( )

Definition at line 40 of file HitPairGeneratorFromLayerPair.cc.

40 {}

Member Function Documentation

◆ doublets() [1/5]

HitDoublets HitPairGeneratorFromLayerPair::doublets ( const TrackingRegion reg,
const edm::Event ev,
const edm::EventSetup es,
const Layer innerLayer,
const Layer outerLayer 
)
inline

Definition at line 28 of file HitPairGeneratorFromLayerPair.h.

32  {
34  return doublets(reg, ev, es, innerLayer, outerLayer, *theLayerCache);
35  }

References cms::cuda::assert(), doublets(), ev, innerLayer(), outerLayer(), and theLayerCache.

◆ doublets() [2/5]

HitDoublets HitPairGeneratorFromLayerPair::doublets ( const TrackingRegion reg,
const edm::Event ev,
const edm::EventSetup es,
const Layer innerLayer,
const Layer outerLayer,
LayerCacheType layerCache 
)

Definition at line 87 of file HitPairGeneratorFromLayerPair.cc.

92  {
93  const RecHitsSortedInPhi& innerHitsMap = layerCache(innerLayer, region, iSetup);
94  if (innerHitsMap.empty())
95  return HitDoublets(innerHitsMap, innerHitsMap);
96 
97  const RecHitsSortedInPhi& outerHitsMap = layerCache(outerLayer, region, iSetup);
98  if (outerHitsMap.empty())
99  return HitDoublets(innerHitsMap, outerHitsMap);
100  HitDoublets result(innerHitsMap, outerHitsMap);
101  result.reserve(std::max(innerHitsMap.size(), outerHitsMap.size()));
102  doublets(
103  region, *innerLayer.detLayer(), *outerLayer.detLayer(), innerHitsMap, outerHitsMap, iSetup, theMaxElement, result);
104 
105  return result;
106 }

References SeedingLayerSetsHits::SeedingLayer::detLayer(), doublets(), RecHitsSortedInPhi::empty(), innerLayer(), SiStripPI::max, outerLayer(), HLT_2018_cff::region, mps_fire::result, RecHitsSortedInPhi::size(), and theMaxElement.

◆ doublets() [3/5]

HitDoublets HitPairGeneratorFromLayerPair::doublets ( const TrackingRegion reg,
const edm::Event ev,
const edm::EventSetup es,
Layers  layers 
)
inline

Definition at line 24 of file HitPairGeneratorFromLayerPair.h.

24  {
26  return doublets(reg, ev, es, layers, *theLayerCache);
27  }

References cms::cuda::assert(), ev, hgcalTopologyTester_cfi::layers, and theLayerCache.

Referenced by doublets(), hitPairs(), and SeedFinderSelector::pass().

◆ doublets() [4/5]

HitDoublets HitPairGeneratorFromLayerPair::doublets ( const TrackingRegion reg,
const edm::Event ev,
const edm::EventSetup es,
Layers  layers,
LayerCacheType layerCache 
)
inline

Definition at line 36 of file HitPairGeneratorFromLayerPair.h.

40  {
41  Layer innerLayerObj = innerLayer(layers);
42  Layer outerLayerObj = outerLayer(layers);
43  return doublets(reg, ev, es, innerLayerObj, outerLayerObj, layerCache);
44  }

References doublets(), ev, innerLayer(), hgcalTopologyTester_cfi::layers, and outerLayer().

◆ doublets() [5/5]

void HitPairGeneratorFromLayerPair::doublets ( const TrackingRegion region,
const DetLayer innerHitDetLayer,
const DetLayer outerHitDetLayer,
const RecHitsSortedInPhi innerHitsMap,
const RecHitsSortedInPhi outerHitsMap,
const edm::EventSetup iSetup,
const unsigned int  theMaxElement,
HitDoublets result 
)
static

Definition at line 108 of file HitPairGeneratorFromLayerPair.cc.

115  {
116  // HitDoublets result(innerHitsMap,outerHitsMap); result.reserve(std::max(innerHitsMap.size(),outerHitsMap.size()));
118  InnerDeltaPhi deltaPhi(outerHitDetLayer, innerHitDetLayer, region, iSetup);
119 
120  // std::cout << "layers " << theInnerLayer.detLayer()->seqNum() << " " << outerLayer.detLayer()->seqNum() << std::endl;
121 
122  // constexpr float nSigmaRZ = std::sqrt(12.f);
123  constexpr float nSigmaPhi = 3.f;
124  for (int io = 0; io != int(outerHitsMap.theHits.size()); ++io) {
125  if (!deltaPhi.prefilter(outerHitsMap.x[io], outerHitsMap.y[io]))
126  continue;
127  Hit const& ohit = outerHitsMap.theHits[io].hit();
128  PixelRecoRange<float> phiRange =
129  deltaPhi(outerHitsMap.x[io], outerHitsMap.y[io], outerHitsMap.z[io], nSigmaPhi * outerHitsMap.drphi[io]);
130 
131  if (phiRange.empty())
132  continue;
133 
134  std::unique_ptr<const HitRZCompatibility> checkRZ =
135  region.checkRZ(&innerHitDetLayer,
136  ohit,
137  iSetup,
138  &outerHitDetLayer,
139  outerHitsMap.rv(io),
140  outerHitsMap.z[io],
141  outerHitsMap.isBarrel ? outerHitsMap.du[io] : outerHitsMap.dv[io],
142  outerHitsMap.isBarrel ? outerHitsMap.dv[io] : outerHitsMap.du[io]);
143  if (!checkRZ)
144  continue;
145 
146  Kernels<HitZCheck, HitRCheck, HitEtaCheck> kernels;
147 
148  auto innerRange = innerHitsMap.doubleRange(phiRange.min(), phiRange.max());
149  LogDebug("HitPairGeneratorFromLayerPair")
150  << "preparing for combination of: " << innerRange[1] - innerRange[0] + innerRange[3] - innerRange[2]
151  << " inner and: " << outerHitsMap.theHits.size() << " outter";
152  for (int j = 0; j < 3; j += 2) {
153  auto b = innerRange[j];
154  auto e = innerRange[j + 1];
155  if (e == b)
156  continue;
157  bool ok[e - b];
158  switch (checkRZ->algo()) {
160  std::get<0>(kernels).set(checkRZ.get());
161  std::get<0>(kernels)(b, e, innerHitsMap, ok);
162  break;
164  std::get<1>(kernels).set(checkRZ.get());
165  std::get<1>(kernels)(b, e, innerHitsMap, ok);
166  break;
168  std::get<2>(kernels).set(checkRZ.get());
169  std::get<2>(kernels)(b, e, innerHitsMap, ok);
170  break;
171  }
172  for (int i = 0; i != e - b; ++i) {
173  if (!ok[i])
174  continue;
175  if (theMaxElement != 0 && result.size() >= theMaxElement) {
176  result.clear();
177  edm::LogError("TooManyPairs") << "number of pairs exceed maximum, no pairs produced";
178  return;
179  }
180  result.add(b + i, io);
181  }
182  }
183  }
184  LogDebug("HitPairGeneratorFromLayerPair") << " total number of pairs provided back: " << result.size();
185  result.shrink_to_fit();
186 }

References b, SiPixelRawToDigiRegional_cfi::deltaPhi, RecHitsSortedInPhi::doubleRange(), RecHitsSortedInPhi::drphi, RecHitsSortedInPhi::du, RecHitsSortedInPhi::dv, MillePedeFileConverter_cfg::e, PixelRecoRange< T >::empty(), HitRZCompatibility::etaAlgo, mps_fire::i, createfilelist::int, RecHitsSortedInPhi::isBarrel, dqmiolumiharvest::j, LogDebug, PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), nSigmaPhi, convertSQLiteXML::ok, HitRZCompatibility::rAlgo, HLT_2018_cff::region, mps_fire::result, RecHitsSortedInPhi::rv(), RecHitsSortedInPhi::theHits, theMaxElement, RecHitsSortedInPhi::x, RecHitsSortedInPhi::y, RecHitsSortedInPhi::z, and HitRZCompatibility::zAlgo.

◆ hitPairs()

void HitPairGeneratorFromLayerPair::hitPairs ( const TrackingRegion reg,
OrderedHitPairs prs,
const edm::Event ev,
const edm::EventSetup es,
Layers  layers 
)

Definition at line 72 of file HitPairGeneratorFromLayerPair.cc.

76  {
77  auto const& ds = doublets(region, iEvent, iSetup, layers);
78  for (std::size_t i = 0; i != ds.size(); ++i) {
79  result.push_back(OrderedHitPair(ds.hit(i, HitDoublets::inner), ds.hit(i, HitDoublets::outer)));
80  }
81  if (theMaxElement != 0 && result.size() >= theMaxElement) {
82  result.clear();
83  edm::LogError("TooManyPairs") << "number of pairs exceed maximum, no pairs produced";
84  }
85 }

References doublets(), mps_fire::i, iEvent, HitDoublets::inner, hgcalTopologyTester_cfi::layers, HitDoublets::outer, HLT_2018_cff::region, mps_fire::result, and theMaxElement.

◆ innerLayer()

Layer HitPairGeneratorFromLayerPair::innerLayer ( const Layers layers) const
inline

Definition at line 63 of file HitPairGeneratorFromLayerPair.h.

63 { return layers[theInnerLayer]; }

References hgcalTopologyTester_cfi::layers, and theInnerLayer.

Referenced by doublets().

◆ outerLayer()

Layer HitPairGeneratorFromLayerPair::outerLayer ( const Layers layers) const
inline

Definition at line 64 of file HitPairGeneratorFromLayerPair.h.

64 { return layers[theOuterLayer]; }

References hgcalTopologyTester_cfi::layers, and theOuterLayer.

Referenced by doublets().

Member Data Documentation

◆ theInnerLayer

const unsigned int HitPairGeneratorFromLayerPair::theInnerLayer
private

Definition at line 69 of file HitPairGeneratorFromLayerPair.h.

Referenced by innerLayer().

◆ theLayerCache

LayerCacheType* HitPairGeneratorFromLayerPair::theLayerCache
private

Definition at line 67 of file HitPairGeneratorFromLayerPair.h.

Referenced by doublets().

◆ theMaxElement

const unsigned int HitPairGeneratorFromLayerPair::theMaxElement
private

Definition at line 70 of file HitPairGeneratorFromLayerPair.h.

Referenced by doublets(), and hitPairs().

◆ theOuterLayer

const unsigned int HitPairGeneratorFromLayerPair::theOuterLayer
private

Definition at line 68 of file HitPairGeneratorFromLayerPair.h.

Referenced by outerLayer().

Hit
Definition: SiPixelLorentzAngle.h:57
nSigmaPhi
constexpr float nSigmaPhi
Definition: PixelTripletLargeTipGenerator.cc:44
mps_fire.i
i
Definition: mps_fire.py:355
HitPairGeneratorFromLayerPair::innerLayer
Layer innerLayer(const Layers &layers) const
Definition: HitPairGeneratorFromLayerPair.h:63
HitDoublets::outer
Definition: RecHitsSortedInPhi.h:126
HitPairGeneratorFromLayerPair::outerLayer
Layer outerLayer(const Layers &layers) const
Definition: HitPairGeneratorFromLayerPair.h:64
InnerDeltaPhi
Definition: InnerDeltaPhi.h:19
SeedingLayerSetsHits::SeedingLayer::detLayer
const DetLayer * detLayer() const
Definition: SeedingLayerSetsHits.h:50
HitPairGeneratorFromLayerPair::theOuterLayer
const unsigned int theOuterLayer
Definition: HitPairGeneratorFromLayerPair.h:68
RecHitsSortedInPhi::size
std::size_t size() const
Definition: RecHitsSortedInPhi.h:46
cms::cuda::assert
assert(be >=bs)
RecHitsSortedInPhi::doubleRange
DoubleRange doubleRange(float phiMin, float phiMax) const
Definition: RecHitsSortedInPhi.cc:52
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
PixelRecoRange::empty
bool empty() const
Definition: PixelRecoRange.h:29
PixelRecoRange::min
T min() const
Definition: PixelRecoRange.h:25
RecHitsSortedInPhi::z
std::vector< float > z
Definition: RecHitsSortedInPhi.h:102
HitPairGeneratorFromLayerPair::Layer
SeedingLayerSetsHits::SeedingLayer Layer
Definition: HitPairGeneratorFromLayerPair.h:15
HitRZCompatibility::zAlgo
Definition: HitRZCompatibility.h:11
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
SurfaceOrientation::inner
Definition: Surface.h:19
PixelRecoRange::max
T max() const
Definition: PixelRecoRange.h:26
RecHitsSortedInPhi::Hit
BaseTrackerRecHit const * Hit
Definition: RecHitsSortedInPhi.h:19
b
double b
Definition: hdecay.h:118
RecHitsSortedInPhi::rv
float rv(int i) const
Definition: RecHitsSortedInPhi.h:89
HitPairGeneratorFromLayerPair::theLayerCache
LayerCacheType * theLayerCache
Definition: HitPairGeneratorFromLayerPair.h:67
RecHitsSortedInPhi
Definition: RecHitsSortedInPhi.h:17
RecHitsSortedInPhi::x
std::vector< float > x
Definition: RecHitsSortedInPhi.h:100
PixelRecoRange< float >
RecHitsSortedInPhi::theHits
std::vector< HitWithPhi > theHits
Definition: RecHitsSortedInPhi.h:95
HitDoublets
Definition: RecHitsSortedInPhi.h:124
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
RecHitsSortedInPhi::dv
std::vector< float > dv
Definition: RecHitsSortedInPhi.h:109
RecHitsSortedInPhi::empty
bool empty() const
Definition: RecHitsSortedInPhi.h:45
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
RecHitsSortedInPhi::drphi
std::vector< float > drphi
Definition: RecHitsSortedInPhi.h:103
HitPairGeneratorFromLayerPair::theInnerLayer
const unsigned int theInnerLayer
Definition: HitPairGeneratorFromLayerPair.h:69
RecHitsSortedInPhi::isBarrel
bool isBarrel
Definition: RecHitsSortedInPhi.h:98
RecHitsSortedInPhi::du
std::vector< float > du
Definition: RecHitsSortedInPhi.h:108
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
HitDoublets::inner
Definition: RecHitsSortedInPhi.h:126
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
HitPairGeneratorFromLayerPair::theMaxElement
const unsigned int theMaxElement
Definition: HitPairGeneratorFromLayerPair.h:70
HitPairGeneratorFromLayerPair::doublets
HitDoublets doublets(const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
Definition: HitPairGeneratorFromLayerPair.h:24
mps_fire.result
result
Definition: mps_fire.py:303
SurfaceOrientation::outer
Definition: Surface.h:19
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HitRZCompatibility::etaAlgo
Definition: HitRZCompatibility.h:11
OrderedHitPair
Definition: OrderedHitPair.h:6
HitRZCompatibility::rAlgo
Definition: HitRZCompatibility.h:11
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
Hit
SeedingHitSet::ConstRecHitPointer Hit
Definition: SeedGeneratorFromProtoTracksEDProducer.cc:34
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
RecHitsSortedInPhi::y
std::vector< float > y
Definition: RecHitsSortedInPhi.h:101