CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PixelTripletLowPtGenerator Class Reference

#include <PixelTripletLowPtGenerator.h>

Inheritance diagram for PixelTripletLowPtGenerator:
HitTripletGeneratorFromPairAndLayers

Public Member Functions

void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayerSet &pairLayers, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers) override
 
void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &result, const edm::EventSetup &es, const HitDoublets &doublets, const RecHitsSortedInPhi **thirdHitMap, const std::vector< const DetLayer *> &thirdLayerDetLayer, const int nThirdLayers) override
 
 PixelTripletLowPtGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
 ~PixelTripletLowPtGenerator () override
 
- Public Member Functions inherited from HitTripletGeneratorFromPairAndLayers
 HitTripletGeneratorFromPairAndLayers (unsigned int maxElement=0)
 
 HitTripletGeneratorFromPairAndLayers (const edm::ParameterSet &pset)
 
void init (std::unique_ptr< HitPairGeneratorFromLayerPair > &&pairs, LayerCacheType *layerCache)
 
const HitPairGeneratorFromLayerPairpairGenerator () const
 
virtual ~HitTripletGeneratorFromPairAndLayers ()
 

Private Member Functions

GlobalPoint getGlobalPosition (const TrackingRecHit *recHit)
 
void getTracker (const edm::EventSetup &es)
 

Private Attributes

bool checkClusterShape
 
bool checkMultipleScattering
 
edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecordm_clusterFilterToken
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordm_geomToken
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordm_magfieldToken
 
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecordm_msmakerToken
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdm_topoToken
 
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordm_ttrhBuilderToken
 
double maxAngleRatio
 
double nSigMultipleScattering
 
double rzTolerance
 
edm::EDGetTokenT< SiPixelClusterShapeCachetheClusterShapeCacheToken
 
std::unique_ptr< TripletFiltertheFilter
 
const TrackerGeometrytheTracker
 

Additional Inherited Members

- Public Types inherited from HitTripletGeneratorFromPairAndLayers
typedef LayerHitMapCache LayerCacheType
 
- Static Public Member Functions inherited from HitTripletGeneratorFromPairAndLayers
static void fillDescriptions (edm::ParameterSetDescription &desc)
 
- Protected Attributes inherited from HitTripletGeneratorFromPairAndLayers
LayerCacheTypetheLayerCache
 
const unsigned int theMaxElement
 
std::unique_ptr< HitPairGeneratorFromLayerPairthePairGenerator
 

Detailed Description

Definition at line 35 of file PixelTripletLowPtGenerator.h.

Constructor & Destructor Documentation

◆ PixelTripletLowPtGenerator()

PixelTripletLowPtGenerator::PixelTripletLowPtGenerator ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 25 of file PixelTripletLowPtGenerator.cc.

References looper::cfg, checkClusterShape, checkMultipleScattering, maxAngleRatio, nSigMultipleScattering, and rzTolerance.

26  : HitTripletGeneratorFromPairAndLayers(), // no theMaxElement used in this class
30  m_ttrhBuilderToken(iC.esConsumes(edm::ESInputTag("", cfg.getParameter<string>("TTRHBuilder")))),
32  m_clusterFilterToken(iC.esConsumes(edm::ESInputTag("", "ClusterShapeHitFilter"))),
33  theTracker(nullptr),
35  iC.consumes<SiPixelClusterShapeCache>(cfg.getParameter<edm::InputTag>("clusterShapeCacheSrc"))) {
36  checkMultipleScattering = cfg.getParameter<bool>("checkMultipleScattering");
37  nSigMultipleScattering = cfg.getParameter<double>("nSigMultipleScattering");
38  checkClusterShape = cfg.getParameter<bool>("checkClusterShape");
39  rzTolerance = cfg.getParameter<double>("rzTolerance");
40  maxAngleRatio = cfg.getParameter<double>("maxAngleRatio");
41 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_geomToken
edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > m_clusterFilterToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magfieldToken
edm::EDGetTokenT< SiPixelClusterShapeCache > theClusterShapeCacheToken
const TrackerGeometry * theTracker
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > m_msmakerToken
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoToken
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > m_ttrhBuilderToken

◆ ~PixelTripletLowPtGenerator()

PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator ( )
override

Definition at line 44 of file PixelTripletLowPtGenerator.cc.

44 {}

Member Function Documentation

◆ getGlobalPosition()

GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition ( const TrackingRecHit recHit)
private

Definition at line 61 of file PixelTripletLowPtGenerator.cc.

References TrackerGeometry::idToDet(), rpcPointValidation_cfi::recHit, theTracker, and GeomDet::toGlobal().

Referenced by hitTriplets().

61  {
62  DetId detId = recHit->geographicalId();
63 
64  return theTracker->idToDet(detId)->toGlobal(recHit->localPosition());
65 }
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
Definition: DetId.h:17
const TrackerGeometry * theTracker

◆ getTracker()

void PixelTripletLowPtGenerator::getTracker ( const edm::EventSetup es)
private

Definition at line 49 of file PixelTripletLowPtGenerator.cc.

References edm::EventSetup::getData(), m_clusterFilterToken, m_geomToken, theFilter, and theTracker.

Referenced by hitTriplets().

49  {
50  if (theTracker == nullptr) {
51  // Get tracker geometry
53  }
54 
55  if (!theFilter) {
56  theFilter = std::make_unique<TripletFilter>(&es.getData(m_clusterFilterToken));
57  }
58 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_geomToken
edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > m_clusterFilterToken
std::unique_ptr< TripletFilter > theFilter
const TrackerGeometry * theTracker

◆ hitTriplets() [1/2]

void PixelTripletLowPtGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets trs,
const edm::Event ev,
const edm::EventSetup es,
const SeedingLayerSetsHits::SeedingLayerSet pairLayers,
const std::vector< SeedingLayerSetsHits::SeedingLayer > &  thirdLayers 
)
overridevirtual

Implements HitTripletGeneratorFromPairAndLayers.

Definition at line 68 of file PixelTripletLowPtGenerator.cc.

References DMR_cfg::cerr, checkClusterShape, checkMultipleScattering, SiPixelPhase1OnlineDQM_cff::clusterShapeCache, makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), getGlobalPosition(), HitInfo::getInfo(), ThirdHitPrediction::getRanges(), getTracker(), RecHitsSortedInPhi::hits(), mps_fire::i, ThirdHitPrediction::isCompatibleWithMultipleScattering(), pixelTopology::layer, m_magfieldToken, m_msmakerToken, m_topoToken, m_ttrhBuilderToken, volumeBasedMagneticField_160812_cfi::magfield, PixelRecoRange< T >::max(), maxAngleRatio, PixelRecoRange< T >::min(), nSigMultipleScattering, phi, hiPixelPairStep_cff::points, FastTrackerRecHitMaskProducer_cfi::recHits, HLT_2022v15_cff::region, mps_fire::result, rzTolerance, findQualityFiles::size, theClusterShapeCacheToken, theFilter, HitTripletGeneratorFromPairAndLayers::theLayerCache, and HitTripletGeneratorFromPairAndLayers::thePairGenerator.

73  {
74  //Retrieve tracker topology from geometry
75  const TrackerTopology* tTopo = &es.getData(m_topoToken);
76  const auto& magfield = es.getData(m_magfieldToken);
77  const auto& ttrhBuilder = es.getData(m_ttrhBuilderToken);
78  const auto& msmaker = es.getData(m_msmakerToken);
79 
82 
83  // Generate pairs
84  OrderedHitPairs pairs;
85  pairs.reserve(30000);
86  thePairGenerator->hitPairs(region, pairs, ev, es, pairLayers);
87 
88  if (pairs.empty())
89  return;
90 
91  int size = thirdLayers.size();
92 
93  // Set aliases
94  const RecHitsSortedInPhi** thirdHitMap = new const RecHitsSortedInPhi*[size];
95  for (int il = 0; il < size; il++)
96  thirdHitMap[il] = &(*theLayerCache)(thirdLayers[il], region);
97 
98  // Get tracker
99  getTracker(es);
100 
101  // Look at all generated pairs
102  for (OrderedHitPairs::const_iterator ip = pairs.begin(); ip != pairs.end(); ip++) {
103  // Fill rechits and points
104  vector<const TrackingRecHit*> recHits(3);
105  vector<GlobalPoint> points(3);
106 
107  recHits[0] = (*ip).inner()->hit();
108  recHits[1] = (*ip).outer()->hit();
109 
110 #ifdef Debug
111  cerr << " RecHits " + HitInfo::getInfo(*recHits[0]) + HitInfo::getInfo(*recHits[1]) << endl;
112 #endif
113 
114  for (int i = 0; i < 2; i++)
116 
117  // Initialize helix prediction
118  ThirdHitPrediction thePrediction(
120 
121  // Look at all layers
122  for (int il = 0; il < size; il++) {
123  const DetLayer* layer = thirdLayers[il].detLayer();
124 
125 #ifdef Debug
126  cerr << " check layer " << layer->subDetector() << " " << layer->location() << endl;
127 #endif
128 
129  // Get ranges for the third hit
130  float phi[2], rz[2];
131  thePrediction.getRanges(layer, phi, rz);
132 
133  PixelRecoRange<float> phiRange(phi[0], phi[1]);
134  PixelRecoRange<float> rzRange(rz[0] - rzTolerance, rz[1] + rzTolerance);
135 
136  // Get third hit candidates from cache
138  vector<Hit> thirdHits = thirdHitMap[il]->hits(phiRange.min(), phiRange.max());
139  typedef vector<Hit>::const_iterator IH;
140 
141  for (IH th = thirdHits.begin(), eh = thirdHits.end(); th < eh; ++th) {
142  // Fill rechit and point
143  recHits[2] = (*th)->hit();
145 
146 #ifdef Debug
147  cerr << " third hit " + HitInfo::getInfo(*recHits[2]) << endl;
148 #endif
149 
150  // Check if third hit is compatible with multiple scattering
151  vector<GlobalVector> globalDirs;
152  if (thePrediction.isCompatibleWithMultipleScattering(points[2], recHits, globalDirs, msmaker) == false) {
153 #ifdef Debug
154  cerr << " not compatible: multiple scattering" << endl;
155 #endif
157  continue;
158  }
159 
160  // Convert to localDirs
161  /*
162  vector<LocalVector> localDirs;
163  vector<GlobalVector>::const_iterator globalDir = globalDirs.begin();
164  for(vector<const TrackingRecHit *>::const_iterator
165  recHit = recHits.begin();
166  recHit != recHits.end(); recHit++)
167  {
168  localDirs.push_back(theTracker->idToDet(
169  (*recHit)->geographicalId())->toLocal(*globalDir));
170  globalDir++;
171  }
172 */
173 
174  // Check if the cluster shapes are compatible with thrusts
175  if (checkClusterShape) {
176  if (!theFilter->checkTrack(recHits, globalDirs, tTopo, *clusterShapeCache)) {
177 #ifdef Debug
178  cerr << " not compatible: cluster shape" << endl;
179 #endif
180  continue;
181  }
182  }
183 
184  // All checks passed, put triplet back
185  result.push_back(OrderedHitTriplet((*ip).inner(), (*ip).outer(), *th));
186  }
187  }
188  }
189  delete[] thirdHitMap;
190 
191  return;
192 }
size
Write out results.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void getTracker(const edm::EventSetup &es)
std::unique_ptr< TripletFilter > theFilter
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magfieldToken
std::vector< Hit > hits(float phiMin, float phiMax) const
edm::EDGetTokenT< SiPixelClusterShapeCache > theClusterShapeCacheToken
SeedingHitSet::ConstRecHitPointer Hit
BaseTrackerRecHit const * Hit
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
GlobalPoint getGlobalPosition(const TrackingRecHit *recHit)
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
Definition: HitInfo.cc:19
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > m_msmakerToken
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoToken
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > m_ttrhBuilderToken

◆ hitTriplets() [2/2]

void PixelTripletLowPtGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets result,
const edm::EventSetup es,
const HitDoublets doublets,
const RecHitsSortedInPhi **  thirdHitMap,
const std::vector< const DetLayer *> &  thirdLayerDetLayer,
const int  nThirdLayers 
)
overridevirtual

Implements HitTripletGeneratorFromPairAndLayers.

Definition at line 193 of file PixelTripletLowPtGenerator.cc.

References Exception.

199  {
200  throw cms::Exception("Error") << "PixelTripletLowPtGenerator::hitTriplets is not implemented \n";
201 }

Member Data Documentation

◆ checkClusterShape

bool PixelTripletLowPtGenerator::checkClusterShape
private

Definition at line 75 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ checkMultipleScattering

bool PixelTripletLowPtGenerator::checkMultipleScattering
private

Definition at line 74 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ m_clusterFilterToken

edm::ESGetToken<ClusterShapeHitFilter, CkfComponentsRecord> PixelTripletLowPtGenerator::m_clusterFilterToken
private

Definition at line 61 of file PixelTripletLowPtGenerator.h.

Referenced by getTracker().

◆ m_geomToken

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> PixelTripletLowPtGenerator::m_geomToken
private

Definition at line 56 of file PixelTripletLowPtGenerator.h.

Referenced by getTracker().

◆ m_magfieldToken

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PixelTripletLowPtGenerator::m_magfieldToken
private

Definition at line 58 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ m_msmakerToken

edm::ESGetToken<MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord> PixelTripletLowPtGenerator::m_msmakerToken
private

Definition at line 60 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ m_topoToken

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> PixelTripletLowPtGenerator::m_topoToken
private

Definition at line 57 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ m_ttrhBuilderToken

edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> PixelTripletLowPtGenerator::m_ttrhBuilderToken
private

Definition at line 59 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ maxAngleRatio

double PixelTripletLowPtGenerator::maxAngleRatio
private

Definition at line 72 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ nSigMultipleScattering

double PixelTripletLowPtGenerator::nSigMultipleScattering
private

Definition at line 70 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ rzTolerance

double PixelTripletLowPtGenerator::rzTolerance
private

Definition at line 71 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ theClusterShapeCacheToken

edm::EDGetTokenT<SiPixelClusterShapeCache> PixelTripletLowPtGenerator::theClusterShapeCacheToken
private

Definition at line 69 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ theFilter

std::unique_ptr<TripletFilter> PixelTripletLowPtGenerator::theFilter
private

Definition at line 67 of file PixelTripletLowPtGenerator.h.

Referenced by getTracker(), and hitTriplets().

◆ theTracker

const TrackerGeometry* PixelTripletLowPtGenerator::theTracker
private

Definition at line 66 of file PixelTripletLowPtGenerator.h.

Referenced by getGlobalPosition(), and getTracker().