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
 
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 23 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.

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

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

◆ ~PixelTripletLowPtGenerator()

PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator ( )
override

Definition at line 39 of file PixelTripletLowPtGenerator.cc.

39 {}

Member Function Documentation

◆ getGlobalPosition()

GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition ( const TrackingRecHit recHit)
private

Definition at line 59 of file PixelTripletLowPtGenerator.cc.

59  {
60  DetId detId = recHit->geographicalId();
61 
62  return theTracker->idToDet(detId)->toGlobal(recHit->localPosition());
63 }

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 44 of file PixelTripletLowPtGenerator.cc.

44  {
45  if (theTracker == nullptr) {
46  // Get tracker geometry
49 
50  theTracker = tracker.product();
51  }
52 
53  if (!theFilter) {
54  theFilter = std::make_unique<TripletFilter>(es);
55  }
56 }

References edm::EventSetup::get(), get, theFilter, theTracker, and PbPb_ZMuSkimMuonDPG_cff::tracker.

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 190 of file PixelTripletLowPtGenerator.cc.

196  {
197  throw cms::Exception("Error") << "PixelTripletLowPtGenerator::hitTriplets is not implemented \n";
198 }

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 66 of file PixelTripletLowPtGenerator.cc.

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

References builderName, beam_dqm_sourceclient-live_cfg::cerr, checkClusterShape, checkMultipleScattering, SiPixelPhase1OnlineDQM_cff::clusterShapeCache, ev, edm::EventSetup::get(), get, getGlobalPosition(), HitInfo::getInfo(), ThirdHitPrediction::getRanges(), getTracker(), RecHitsSortedInPhi::hits(), mps_fire::i, ThirdHitPrediction::isCompatibleWithMultipleScattering(), DetLayer::location(), PixelRecoRange< T >::max(), maxAngleRatio, PixelRecoRange< T >::min(), nSigMultipleScattering, phi, HLT_2018_cff::points, edm::ESHandle< T >::product(), FastTrackerRecHitMaskProducer_cfi::recHits, HLT_2018_cff::region, mps_fire::result, rzTolerance, findQualityFiles::size, DetLayer::subDetector(), theClusterShapeCacheToken, theFilter, HitTripletGeneratorFromPairAndLayers::theLayerCache, and HitTripletGeneratorFromPairAndLayers::thePairGenerator.

Member Data Documentation

◆ builderName

std::string PixelTripletLowPtGenerator::builderName
private

Definition at line 55 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ checkClusterShape

bool PixelTripletLowPtGenerator::checkClusterShape
private

Definition at line 57 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ checkMultipleScattering

bool PixelTripletLowPtGenerator::checkMultipleScattering
private

Definition at line 56 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ maxAngleRatio

double PixelTripletLowPtGenerator::maxAngleRatio
private

Definition at line 53 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ nSigMultipleScattering

double PixelTripletLowPtGenerator::nSigMultipleScattering
private

Definition at line 51 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ rzTolerance

double PixelTripletLowPtGenerator::rzTolerance
private

Definition at line 52 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets(), and PixelTripletLowPtGenerator().

◆ theClusterShapeCacheToken

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

Definition at line 50 of file PixelTripletLowPtGenerator.h.

Referenced by hitTriplets().

◆ theFilter

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

Definition at line 48 of file PixelTripletLowPtGenerator.h.

Referenced by getTracker(), and hitTriplets().

◆ theTracker

const TrackerGeometry* PixelTripletLowPtGenerator::theTracker
private

Definition at line 47 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
HLT_2018_cff.points
points
Definition: HLT_2018_cff.py:20125
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
OrderedHitPairs
Definition: OrderedHitPairs.h:8
mps_fire.i
i
Definition: mps_fire.py:355
SiPixelClusterShapeCache
Definition: SiPixelClusterShapeCache.h:43
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
DetLayer
Definition: DetLayer.h:21
TrackerTopology
Definition: TrackerTopology.h:16
PixelTripletLowPtGenerator::theFilter
std::unique_ptr< TripletFilter > theFilter
Definition: PixelTripletLowPtGenerator.h:48
PixelTripletLowPtGenerator::checkMultipleScattering
bool checkMultipleScattering
Definition: PixelTripletLowPtGenerator.h:56
edm::Handle< SiPixelClusterShapeCache >
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
DetId
Definition: DetId.h:17
DetLayer::location
virtual Location location() const =0
Which part of the detector (barrel, endcap)
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
PixelTripletLowPtGenerator::checkClusterShape
bool checkClusterShape
Definition: PixelTripletLowPtGenerator.h:57
HitTripletGeneratorFromPairAndLayers::thePairGenerator
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
Definition: HitTripletGeneratorFromPairAndLayers.h:55
PixelTripletLowPtGenerator::nSigMultipleScattering
double nSigMultipleScattering
Definition: PixelTripletLowPtGenerator.h:51
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
PixelTripletLowPtGenerator::builderName
std::string builderName
Definition: PixelTripletLowPtGenerator.h:55
RecHitsSortedInPhi::Hit
BaseTrackerRecHit const * Hit
Definition: RecHitsSortedInPhi.h:19
PixelTripletLowPtGenerator::rzTolerance
double rzTolerance
Definition: PixelTripletLowPtGenerator.h:52
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
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:50
PixelTripletLowPtGenerator::getTracker
void getTracker(const edm::EventSetup &es)
Definition: PixelTripletLowPtGenerator.cc:44
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
HitTripletGeneratorFromPairAndLayers::HitTripletGeneratorFromPairAndLayers
HitTripletGeneratorFromPairAndLayers(unsigned int maxElement=0)
Definition: HitTripletGeneratorFromPairAndLayers.cc:6
get
#define get
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:246
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
PixelTripletLowPtGenerator::theTracker
const TrackerGeometry * theTracker
Definition: PixelTripletLowPtGenerator.h:47
OrderedHitTriplet
Definition: OrderedHitTriplet.h:11
mps_fire.result
result
Definition: mps_fire.py:303
PixelTripletLowPtGenerator::maxAngleRatio
double maxAngleRatio
Definition: PixelTripletLowPtGenerator.h:53
ThirdHitPrediction
Definition: ThirdHitPrediction.h:33
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
edm::InputTag
Definition: InputTag.h:15
Hit
SeedingHitSet::ConstRecHitPointer Hit
Definition: SeedGeneratorFromProtoTracksEDProducer.cc:34
PixelTripletLowPtGenerator::getGlobalPosition
GlobalPoint getGlobalPosition(const TrackingRecHit *recHit)
Definition: PixelTripletLowPtGenerator.cc:59
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