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 &result, const edm::EventSetup &es, const HitDoublets &doublets, const RecHitsSortedInPhi **thirdHitMap, const std::vector< const DetLayer * > &thirdLayerDetLayer, const int nThirdLayers) override
 
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
 
 PixelTripletLowPtGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
 ~PixelTripletLowPtGenerator () override
 
- Public Member Functions inherited from HitTripletGeneratorFromPairAndLayers
 HitTripletGeneratorFromPairAndLayers (const edm::ParameterSet &pset)
 
 HitTripletGeneratorFromPairAndLayers (unsigned int maxElement=0)
 
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

std::string builderName
 
bool checkClusterShape
 
bool checkMultipleScattering
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordm_geomToken
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdm_topoToken
 
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 28 of file PixelTripletLowPtGenerator.h.

Constructor & Destructor Documentation

◆ PixelTripletLowPtGenerator()

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

Definition at line 20 of file PixelTripletLowPtGenerator.cc.

21  : HitTripletGeneratorFromPairAndLayers(), // no theMaxElement used in this class
24  theTracker(nullptr),
26  iC.consumes<SiPixelClusterShapeCache>(cfg.getParameter<edm::InputTag>("clusterShapeCacheSrc"))) {
27  checkMultipleScattering = cfg.getParameter<bool>("checkMultipleScattering");
28  nSigMultipleScattering = cfg.getParameter<double>("nSigMultipleScattering");
29  checkClusterShape = cfg.getParameter<bool>("checkClusterShape");
30  rzTolerance = cfg.getParameter<double>("rzTolerance");
31  maxAngleRatio = cfg.getParameter<double>("maxAngleRatio");
32  builderName = cfg.getParameter<string>("TTRHBuilder");
33 }

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

◆ ~PixelTripletLowPtGenerator()

PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator ( )
override

Definition at line 36 of file PixelTripletLowPtGenerator.cc.

36 {}

Member Function Documentation

◆ getGlobalPosition()

GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition ( const TrackingRecHit recHit)
private

Definition at line 53 of file PixelTripletLowPtGenerator.cc.

53  {
54  DetId detId = recHit->geographicalId();
55 
56  return theTracker->idToDet(detId)->toGlobal(recHit->localPosition());
57 }

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

Referenced by hitTriplets().

◆ getTracker()

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

Definition at line 41 of file PixelTripletLowPtGenerator.cc.

41  {
42  if (theTracker == nullptr) {
43  // Get tracker geometry
45  }
46 
47  if (!theFilter) {
48  theFilter = std::make_unique<TripletFilter>(es);
49  }
50 }

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

Referenced by hitTriplets().

◆ hitTriplets() [1/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 182 of file PixelTripletLowPtGenerator.cc.

188  {
189  throw cms::Exception("Error") << "PixelTripletLowPtGenerator::hitTriplets is not implemented \n";
190 }

References Exception.

◆ hitTriplets() [2/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 60 of file PixelTripletLowPtGenerator.cc.

65  {
66  //Retrieve tracker topology from geometry
67  const TrackerTopology* tTopo = &es.getData(m_topoToken);
68 
71 
72  // Generate pairs
73  OrderedHitPairs pairs;
74  pairs.reserve(30000);
75  thePairGenerator->hitPairs(region, pairs, ev, es, pairLayers);
76 
77  if (pairs.empty())
78  return;
79 
80  int size = thirdLayers.size();
81 
82  // Set aliases
83  const RecHitsSortedInPhi** thirdHitMap = new const RecHitsSortedInPhi*[size];
84  for (int il = 0; il < size; il++)
85  thirdHitMap[il] = &(*theLayerCache)(thirdLayers[il], region, es);
86 
87  // Get tracker
88  getTracker(es);
89 
90  // Look at all generated pairs
91  for (OrderedHitPairs::const_iterator ip = pairs.begin(); ip != pairs.end(); ip++) {
92  // Fill rechits and points
93  vector<const TrackingRecHit*> recHits(3);
94  vector<GlobalPoint> points(3);
95 
96  recHits[0] = (*ip).inner()->hit();
97  recHits[1] = (*ip).outer()->hit();
98 
99 #ifdef Debug
100  cerr << " RecHits " + HitInfo::getInfo(*recHits[0]) + HitInfo::getInfo(*recHits[1]) << endl;
101 #endif
102 
103  for (int i = 0; i < 2; i++)
105 
106  // Initialize helix prediction
107  ThirdHitPrediction thePrediction(
109 
110  // Look at all layers
111  for (int il = 0; il < size; il++) {
112  const DetLayer* layer = thirdLayers[il].detLayer();
113 
114 #ifdef Debug
115  cerr << " check layer " << layer->subDetector() << " " << layer->location() << endl;
116 #endif
117 
118  // Get ranges for the third hit
119  float phi[2], rz[2];
120  thePrediction.getRanges(layer, phi, rz);
121 
122  PixelRecoRange<float> phiRange(phi[0], phi[1]);
123  PixelRecoRange<float> rzRange(rz[0] - rzTolerance, rz[1] + rzTolerance);
124 
125  // Get third hit candidates from cache
127  vector<Hit> thirdHits = thirdHitMap[il]->hits(phiRange.min(), phiRange.max());
128  typedef vector<Hit>::const_iterator IH;
129 
130  for (IH th = thirdHits.begin(), eh = thirdHits.end(); th < eh; ++th) {
131  // Fill rechit and point
132  recHits[2] = (*th)->hit();
134 
135 #ifdef Debug
136  cerr << " third hit " + HitInfo::getInfo(*recHits[2]) << endl;
137 #endif
138 
139  // Check if third hit is compatible with multiple scattering
140  vector<GlobalVector> globalDirs;
141  if (thePrediction.isCompatibleWithMultipleScattering(points[2], recHits, globalDirs, es) == false) {
142 #ifdef Debug
143  cerr << " not compatible: multiple scattering" << endl;
144 #endif
146  continue;
147  }
148 
149  // Convert to localDirs
150  /*
151  vector<LocalVector> localDirs;
152  vector<GlobalVector>::const_iterator globalDir = globalDirs.begin();
153  for(vector<const TrackingRecHit *>::const_iterator
154  recHit = recHits.begin();
155  recHit != recHits.end(); recHit++)
156  {
157  localDirs.push_back(theTracker->idToDet(
158  (*recHit)->geographicalId())->toLocal(*globalDir));
159  globalDir++;
160  }
161 */
162 
163  // Check if the cluster shapes are compatible with thrusts
164  if (checkClusterShape) {
165  if (!theFilter->checkTrack(recHits, globalDirs, tTopo, *clusterShapeCache)) {
166 #ifdef Debug
167  cerr << " not compatible: cluster shape" << endl;
168 #endif
169  continue;
170  }
171  }
172 
173  // All checks passed, put triplet back
174  result.push_back(OrderedHitTriplet((*ip).inner(), (*ip).outer(), *th));
175  }
176  }
177  }
178  delete[] thirdHitMap;
179 
180  return;
181 }

References builderName, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, checkClusterShape, checkMultipleScattering, SiPixelPhase1OnlineDQM_cff::clusterShapeCache, ev, edm::EventSetup::getData(), getGlobalPosition(), HitInfo::getInfo(), ThirdHitPrediction::getRanges(), getTracker(), RecHitsSortedInPhi::hits(), mps_fire::i, ThirdHitPrediction::isCompatibleWithMultipleScattering(), phase1PixelTopology::layer, m_topoToken, PixelRecoRange< T >::max(), maxAngleRatio, PixelRecoRange< T >::min(), nSigMultipleScattering, phi, HLT_FULL_cff::points, FastTrackerRecHitMaskProducer_cfi::recHits, HLT_FULL_cff::region, mps_fire::result, rzTolerance, findQualityFiles::size, theClusterShapeCacheToken, theFilter, HitTripletGeneratorFromPairAndLayers::theLayerCache, and HitTripletGeneratorFromPairAndLayers::thePairGenerator.

Member Data Documentation

◆ builderName

std::string PixelTripletLowPtGenerator::builderName
private

Definition at line 63 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ checkClusterShape

bool PixelTripletLowPtGenerator::checkClusterShape
private

Definition at line 65 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ checkMultipleScattering

bool PixelTripletLowPtGenerator::checkMultipleScattering
private

Definition at line 64 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ m_geomToken

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

Definition at line 49 of file PixelTripletLowPtGenerator.h.

Referenced by getTracker().

◆ m_topoToken

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

Definition at line 50 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ maxAngleRatio

double PixelTripletLowPtGenerator::maxAngleRatio
private

Definition at line 61 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ nSigMultipleScattering

double PixelTripletLowPtGenerator::nSigMultipleScattering
private

Definition at line 59 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ rzTolerance

double PixelTripletLowPtGenerator::rzTolerance
private

Definition at line 60 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ theClusterShapeCacheToken

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

Definition at line 58 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ theFilter

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

Definition at line 56 of file PixelTripletLowPtGenerator.h.

Referenced by getTracker(), and hitTriplets().

◆ theTracker

const TrackerGeometry* PixelTripletLowPtGenerator::theTracker
private

Definition at line 55 of file PixelTripletLowPtGenerator.h.

Referenced by getGlobalPosition(), and getTracker().

SiPixelPhase1OnlineDQM_cff.clusterShapeCache
clusterShapeCache
Definition: SiPixelPhase1OnlineDQM_cff.py:120
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
OrderedHitPairs
Definition: OrderedHitPairs.h:8
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelClusterShapeCache
Definition: SiPixelClusterShapeCache.h:43
DetLayer
Definition: DetLayer.h:21
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21449
TrackerTopology
Definition: TrackerTopology.h:16
PixelTripletLowPtGenerator::theFilter
std::unique_ptr< TripletFilter > theFilter
Definition: PixelTripletLowPtGenerator.h:56
PixelTripletLowPtGenerator::checkMultipleScattering
bool checkMultipleScattering
Definition: PixelTripletLowPtGenerator.h:64
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::Handle< SiPixelClusterShapeCache >
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
DetId
Definition: DetId.h:17
PixelTripletLowPtGenerator::checkClusterShape
bool checkClusterShape
Definition: PixelTripletLowPtGenerator.h:65
PixelTripletLowPtGenerator::m_topoToken
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoToken
Definition: PixelTripletLowPtGenerator.h:50
HitTripletGeneratorFromPairAndLayers::thePairGenerator
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
Definition: HitTripletGeneratorFromPairAndLayers.h:55
PixelTripletLowPtGenerator::nSigMultipleScattering
double nSigMultipleScattering
Definition: PixelTripletLowPtGenerator.h:59
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
PixelTripletLowPtGenerator::builderName
std::string builderName
Definition: PixelTripletLowPtGenerator.h:63
RecHitsSortedInPhi::Hit
BaseTrackerRecHit const * Hit
Definition: RecHitsSortedInPhi.h:19
PixelTripletLowPtGenerator::rzTolerance
double rzTolerance
Definition: PixelTripletLowPtGenerator.h:60
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
RecHitsSortedInPhi
Definition: RecHitsSortedInPhi.h:17
PixelRecoRange< float >
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
PixelTripletLowPtGenerator::theClusterShapeCacheToken
edm::EDGetTokenT< SiPixelClusterShapeCache > theClusterShapeCacheToken
Definition: PixelTripletLowPtGenerator.h:58
PixelTripletLowPtGenerator::getTracker
void getTracker(const edm::EventSetup &es)
Definition: PixelTripletLowPtGenerator.cc:41
HitTripletGeneratorFromPairAndLayers::HitTripletGeneratorFromPairAndLayers
HitTripletGeneratorFromPairAndLayers(unsigned int maxElement=0)
Definition: HitTripletGeneratorFromPairAndLayers.cc:6
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88267
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
looper.cfg
cfg
Definition: looper.py:297
DDAxes::phi
HitTripletGeneratorFromPairAndLayers::theLayerCache
LayerCacheType * theLayerCache
Definition: HitTripletGeneratorFromPairAndLayers.h:56
RecHitsSortedInPhi::hits
std::vector< Hit > hits(float phiMin, float phiMax) const
Definition: RecHitsSortedInPhi.cc:93
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:245
PixelTripletLowPtGenerator::theTracker
const TrackerGeometry * theTracker
Definition: PixelTripletLowPtGenerator.h:55
OrderedHitTriplet
Definition: OrderedHitTriplet.h:11
PixelTripletLowPtGenerator::m_geomToken
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_geomToken
Definition: PixelTripletLowPtGenerator.h:49
mps_fire.result
result
Definition: mps_fire.py:311
PixelTripletLowPtGenerator::maxAngleRatio
double maxAngleRatio
Definition: PixelTripletLowPtGenerator.h:61
ThirdHitPrediction
Definition: ThirdHitPrediction.h:33
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
edm::InputTag
Definition: InputTag.h:15
Hit
SeedingHitSet::ConstRecHitPointer Hit
Definition: SeedGeneratorFromProtoTracksEDProducer.cc:34
PixelTripletLowPtGenerator::getGlobalPosition
GlobalPoint getGlobalPosition(const TrackingRecHit *recHit)
Definition: PixelTripletLowPtGenerator.cc:53
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HitInfo::getInfo
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
Definition: HitInfo.cc:19
TrackerGeometry
Definition: TrackerGeometry.h:14