CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PixelTripletLowPtGenerator Class Reference

#include <PixelTripletLowPtGenerator.h>

Inheritance diagram for PixelTripletLowPtGenerator:
HitTripletGeneratorFromPairAndLayers HitTripletGenerator OrderedHitsGenerator

Public Member Functions

virtual void hitTriplets (const TrackingRegion &region, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es)
 
void init (const HitPairGenerator &pairs, LayerCacheType *layerCache) override
 
const HitPairGeneratorpairGenerator () const
 
 PixelTripletLowPtGenerator (const edm::ParameterSet &cfg)
 
void setSeedingLayers (SeedingLayerSetsHits::SeedingLayerSet pairLayers, std::vector< SeedingLayerSetsHits::SeedingLayer > thirdLayers) override
 
virtual ~PixelTripletLowPtGenerator ()
 
- Public Member Functions inherited from HitTripletGeneratorFromPairAndLayers
virtual ~HitTripletGeneratorFromPairAndLayers ()
 
- Public Member Functions inherited from HitTripletGenerator
virtual void clear ()
 
 HitTripletGenerator (unsigned int size=500)
 
virtual void hitTriplets (const TrackingRegion &reg, OrderedHitTriplets &prs, const edm::EventSetup &es)
 
virtual const OrderedHitTripletsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
virtual ~HitTripletGenerator ()
 
- Public Member Functions inherited from OrderedHitsGenerator
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

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
 
edm::ParameterSet ps
 
double rzTolerance
 
TripletFiltertheFilter
 
LayerCacheTypetheLayerCache
 
std::vector
< SeedingLayerSetsHits::SeedingLayer
theLayers
 
HitPairGeneratorthePairGenerator
 
const TrackerGeometrytheTracker
 

Additional Inherited Members

- Public Types inherited from HitTripletGeneratorFromPairAndLayers
typedef LayerHitMapCache LayerCacheType
 
- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Definition at line 22 of file PixelTripletLowPtGenerator.h.

Constructor & Destructor Documentation

PixelTripletLowPtGenerator::PixelTripletLowPtGenerator ( const edm::ParameterSet cfg)
inline
virtual PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator ( )
inlinevirtual

Definition at line 31 of file PixelTripletLowPtGenerator.h.

References theFilter, and thePairGenerator.

31 { delete thePairGenerator; delete theFilter; }

Member Function Documentation

GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition ( const TrackingRecHit recHit)
private

Definition at line 63 of file PixelTripletLowPtGenerator.cc.

References TrackingRecHit::geographicalId(), and TrackingRecHit::localPosition().

64 {
65  DetId detId = recHit->geographicalId();
66 
67  return
68  theTracker->idToDet(detId)->toGlobal(recHit->localPosition());
69 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
virtual const GeomDet * idToDet(DetId) const
Definition: DetId.h:18
const TrackerGeometry * theTracker
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
void PixelTripletLowPtGenerator::getTracker ( const edm::EventSetup es)
private

Definition at line 44 of file PixelTripletLowPtGenerator.cc.

References edm::EventSetup::get(), edm::ESHandle< class >::product(), and patCandidatesForDimuonsSequences_cff::tracker.

45 {
46  if(theTracker == 0)
47  {
48  // Get tracker geometry
50  es.get<TrackerDigiGeometryRecord>().get(tracker);
51 
52  theTracker = tracker.product();
53  }
54 
55  if(theFilter == 0)
56  {
57  theFilter = new TripletFilter(es);
58  }
59 }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const TrackerGeometry * theTracker
void PixelTripletLowPtGenerator::hitTriplets ( const TrackingRegion region,
OrderedHitTriplets trs,
const edm::Event ev,
const edm::EventSetup es 
)
virtual

Implements HitTripletGenerator.

Definition at line 72 of file PixelTripletLowPtGenerator.cc.

References dtNoiseDBValidation_cfg::cerr, edm::EventSetup::get(), HitInfo::getInfo(), ThirdHitPrediction::getRanges(), RecHitsSortedInPhi::hits(), i, ThirdHitPrediction::isCompatibleWithMultipleScattering(), DetLayer::location(), PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), phi, edm::ESHandle< class >::product(), OrderedHitPairs::size(), findQualityFiles::size, and DetLayer::subDetector().

77 {
78 
79  //Retrieve tracker topology from geometry
81  es.get<IdealGeometryRecord>().get(tTopoHand);
82  const TrackerTopology *tTopo=tTopoHand.product();
83 
84  // Generate pairs
85  OrderedHitPairs pairs; pairs.reserve(30000);
86  thePairGenerator->hitPairs(region,pairs,ev,es);
87 
88  if (pairs.size() == 0) return;
89 
90  int size = theLayers.size();
91 
92  // Set aliases
93  const RecHitsSortedInPhi **thirdHitMap = new const RecHitsSortedInPhi*[size];
94  for(int il=0; il<size; il++)
95  thirdHitMap[il] = &(*theLayerCache)(theLayers[il], region, ev, es);
96 
97  // Get tracker
98  getTracker(es);
99 
100  // Look at all generated pairs
101  for(OrderedHitPairs::const_iterator ip = pairs.begin();
102  ip!= pairs.end(); ip++)
103  {
104  // Fill rechits and points
105  vector<const TrackingRecHit*> recHits(3);
106  vector<GlobalPoint> points(3);
107 
108  recHits[0] = (*ip).inner()->hit();
109  recHits[1] = (*ip).outer()->hit();
110 
111 #ifdef Debug
112  cerr << " RecHits " + HitInfo::getInfo(*recHits[0]) +
113  HitInfo::getInfo(*recHits[1]) << endl;
114 #endif
115 
116  for(int i=0; i<2; i++)
117  points[i] = getGlobalPosition(recHits[i]);
118 
119  // Initialize helix prediction
121  thePrediction(region,
122  points[0],points[1], es,
124 
125  // Look at all layers
126  for(int il=0; il<size; il++)
127  {
128  const DetLayer * layer = theLayers[il].detLayer();
129 
130 #ifdef Debug
131  cerr << " check layer " << layer->subDetector()
132  << " " << layer->location() << endl;
133 #endif
134 
135  // Get ranges for the third hit
136  float phi[2],rz[2];
137  thePrediction.getRanges(layer, phi,rz);
138 
139  PixelRecoRange<float> phiRange(phi[0] , phi[1] );
140  PixelRecoRange<float> rzRange( rz[0] - rzTolerance, rz[1] + rzTolerance);
141 
142  // Get third hit candidates from cache
144  vector<Hit> thirdHits = thirdHitMap[il]->hits(phiRange.min(),phiRange.max());
145  typedef vector<Hit>::const_iterator IH;
146 
147  for (IH th=thirdHits.begin(), eh=thirdHits.end(); th < eh; ++th)
148  {
149  // Fill rechit and point
150  recHits[2] = (*th)->hit();
151  points[2] = getGlobalPosition(recHits[2]);
152 
153 #ifdef Debug
154  cerr << " third hit " + HitInfo::getInfo(*recHits[2]) << endl;
155 #endif
156 
157  // Check if third hit is compatible with multiple scattering
158  vector<GlobalVector> globalDirs;
159  if(thePrediction.isCompatibleWithMultipleScattering
160  (points[2], recHits, globalDirs, es) == false)
161  {
162 #ifdef Debug
163  cerr << " not compatible: multiple scattering" << endl;
164 #endif
165  if(checkMultipleScattering) continue;
166  }
167 
168  // Convert to localDirs
169 /*
170  vector<LocalVector> localDirs;
171  vector<GlobalVector>::const_iterator globalDir = globalDirs.begin();
172  for(vector<const TrackingRecHit *>::const_iterator
173  recHit = recHits.begin();
174  recHit != recHits.end(); recHit++)
175  {
176  localDirs.push_back(theTracker->idToDet(
177  (*recHit)->geographicalId())->toLocal(*globalDir));
178  globalDir++;
179  }
180 */
181 
182  // Check if the cluster shapes are compatible with thrusts
184  {
185  if(! theFilter->checkTrack(recHits,globalDirs,tTopo))
186  {
187 #ifdef Debug
188  cerr << " not compatible: cluster shape" << endl;
189 #endif
190  continue;
191  }
192  }
193 
194  // All checks passed, put triplet back
195  result.push_back(OrderedHitTriplet((*ip).inner(),(*ip).outer(),*th));
196  }
197  }
198  }
199  delete [] thirdHitMap;
200 
201  return;
202 }
std::vector< Hit > hits(float phiMin, float phiMax) const
int i
Definition: DBlmapReader.cc:9
void getTracker(const edm::EventSetup &es)
virtual Location location() const =0
Which part of the detector (barrel, endcap)
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
virtual unsigned int size() const
std::vector< SeedingLayerSetsHits::SeedingLayer > theLayers
virtual void hitPairs(const TrackingRegion &reg, OrderedHitPairs &prs, const edm::EventSetup &es)
tuple result
Definition: query.py:137
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
TransientTrackingRecHit::ConstRecHitPointer Hit
bool checkTrack(const std::vector< const TrackingRecHit * > &recHits, const std::vector< LocalVector > &localDirs, const TrackerTopology *tTopo)
GlobalPoint getGlobalPosition(const TrackingRecHit *recHit)
static std::string getInfo(const DetId &id, const TrackerTopology *tTopo)
Definition: HitInfo.cc:23
tuple size
Write out results.
Definition: DDAxes.h:10
void PixelTripletLowPtGenerator::init ( const HitPairGenerator pairs,
LayerCacheType layerCache 
)
overridevirtual

Implements HitTripletGeneratorFromPairAndLayers.

Definition at line 21 of file PixelTripletLowPtGenerator.cc.

References HitPairGenerator::clone().

23 {
24  thePairGenerator = pairs.clone();
25  theLayerCache = layerCache;
26 
27  checkMultipleScattering = ps.getParameter<bool>("checkMultipleScattering");
28  nSigMultipleScattering = ps.getParameter<double>("nSigMultipleScattering");
29  checkClusterShape = ps.getParameter<bool>("checkClusterShape");
30  rzTolerance = ps.getParameter<double>("rzTolerance");
31  maxAngleRatio = ps.getParameter<double>("maxAngleRatio");
32  builderName = ps.getParameter<string>("TTRHBuilder");
33 }
T getParameter(std::string const &) const
virtual HitPairGenerator * clone() const =0
const HitPairGenerator& PixelTripletLowPtGenerator::pairGenerator ( ) const
inline

Definition at line 40 of file PixelTripletLowPtGenerator.h.

References thePairGenerator.

40 { return *thePairGenerator; }
void PixelTripletLowPtGenerator::setSeedingLayers ( SeedingLayerSetsHits::SeedingLayerSet  pairLayers,
std::vector< SeedingLayerSetsHits::SeedingLayer thirdLayers 
)
overridevirtual

Implements HitTripletGeneratorFromPairAndLayers.

Definition at line 36 of file PixelTripletLowPtGenerator.cc.

37  {
39  theLayers = thirdLayers;
40 }
std::vector< SeedingLayerSetsHits::SeedingLayer > theLayers
virtual void setSeedingLayers(SeedingLayerSetsHits::SeedingLayerSet layers)=0

Member Data Documentation

std::string PixelTripletLowPtGenerator::builderName
private

Definition at line 58 of file PixelTripletLowPtGenerator.h.

bool PixelTripletLowPtGenerator::checkClusterShape
private

Definition at line 60 of file PixelTripletLowPtGenerator.h.

bool PixelTripletLowPtGenerator::checkMultipleScattering
private

Definition at line 59 of file PixelTripletLowPtGenerator.h.

double PixelTripletLowPtGenerator::maxAngleRatio
private

Definition at line 56 of file PixelTripletLowPtGenerator.h.

double PixelTripletLowPtGenerator::nSigMultipleScattering
private

Definition at line 54 of file PixelTripletLowPtGenerator.h.

edm::ParameterSet PixelTripletLowPtGenerator::ps
private

Definition at line 49 of file PixelTripletLowPtGenerator.h.

double PixelTripletLowPtGenerator::rzTolerance
private

Definition at line 55 of file PixelTripletLowPtGenerator.h.

TripletFilter* PixelTripletLowPtGenerator::theFilter
private

Definition at line 47 of file PixelTripletLowPtGenerator.h.

Referenced by ~PixelTripletLowPtGenerator().

LayerCacheType* PixelTripletLowPtGenerator::theLayerCache
private

Definition at line 52 of file PixelTripletLowPtGenerator.h.

std::vector<SeedingLayerSetsHits::SeedingLayer> PixelTripletLowPtGenerator::theLayers
private

Definition at line 51 of file PixelTripletLowPtGenerator.h.

HitPairGenerator* PixelTripletLowPtGenerator::thePairGenerator
private

Definition at line 50 of file PixelTripletLowPtGenerator.h.

Referenced by pairGenerator(), and ~PixelTripletLowPtGenerator().

const TrackerGeometry* PixelTripletLowPtGenerator::theTracker
private

Definition at line 46 of file PixelTripletLowPtGenerator.h.