CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
TrackingRecHitStripGSPlugin Class Reference
Inheritance diagram for TrackingRecHitStripGSPlugin:
TrackingRecHitAlgorithm

Public Member Functions

TrackingRecHitProductPtr process (TrackingRecHitProductPtr product) const override
 
 TrackingRecHitStripGSPlugin (const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
 
- Public Member Functions inherited from TrackingRecHitAlgorithm
virtual void beginEvent (edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual void beginRun (edm::Run const &run, const edm::EventSetup &eventSetup, const SiPixelTemplateDBObject *pixelTemplateDBObjectPtr, std::vector< SiPixelTemplateStore > &tempStoreRef)
 
virtual void beginStream (const edm::StreamID &id)
 
virtual void endEvent (edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual void endStream ()
 
const TrackerGeometrygetMisalignedGeometry () const
 
const std::string & getName () const
 
const RandomEngineAndDistributiongetRandomEngine () const
 
const std::string & getSelectionString () const
 
const TrackerGeometrygetTrackerGeometry () const
 
const TrackerTopologygetTrackerTopology () const
 
 TrackingRecHitAlgorithm (const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
 
virtual ~TrackingRecHitAlgorithm ()
 

Private Attributes

double _resolutionX
 
double _resolutionX2
 
double _resolutionY
 
double _resolutionY2
 

Static Private Attributes

static constexpr double INV12 = 1.0 / 12.0
 

Detailed Description

Definition at line 19 of file TrackingRecHitStripGSPlugin.cc.

Constructor & Destructor Documentation

◆ TrackingRecHitStripGSPlugin()

TrackingRecHitStripGSPlugin::TrackingRecHitStripGSPlugin ( const std::string &  name,
const edm::ParameterSet config,
edm::ConsumesCollector consumesCollector 
)
inline

Definition at line 30 of file TrackingRecHitStripGSPlugin.cc.

References _resolutionX, _resolutionX2, _resolutionY, and _resolutionY2.

33  : TrackingRecHitAlgorithm(name, config, consumesCollector),
34  _resolutionX(0.001),
36  _resolutionY(-1),
38 
39  {
40  if (config.exists("resolutionX")) {
41  _resolutionX = config.getParameter<double>("resolutionX");
43  }
44  if (config.exists("resolutionY")) {
45  _resolutionY = config.getParameter<double>("resolutionY");
47  }
48  }
Definition: config.py:1
TrackingRecHitAlgorithm(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)

Member Function Documentation

◆ process()

TrackingRecHitProductPtr TrackingRecHitStripGSPlugin::process ( TrackingRecHitProductPtr  product) const
inlineoverridevirtual

Reimplemented from TrackingRecHitAlgorithm.

Definition at line 50 of file TrackingRecHitStripGSPlugin.cc.

References _resolutionX2, _resolutionY, _resolutionY2, Surface::bounds(), relativeConstraints::error, RandomEngineAndDistribution::gaussShoot(), TrackingRecHitAlgorithm::getRandomEngine(), TrackingRecHitAlgorithm::getTrackerGeometry(), TrackerGeometry::idToDetUnit(), INV12, Bounds::length(), rpcPointValidation_cfi::recHit, rpcPointValidation_cfi::simHit, fastTrackerRecHitType::siStrip1D, GeomDet::surface(), and PV3DBase< T, PVType, FrameType >::x().

50  {
51  for (const std::pair<unsigned int, const PSimHit*>& simHitIdPair : product->getSimHitIdPairs()) {
52  const PSimHit* simHit = simHitIdPair.second;
53  const Local3DPoint& simHitPosition = simHit->localPosition();
54 
55  const GeomDet* geomDet = this->getTrackerGeometry().idToDetUnit(product->getDetId());
56  const Plane& plane = geomDet->surface();
57  const Bounds& bounds = plane.bounds();
58  const double boundY = bounds.length();
59 
60  Local3DPoint recHitPosition;
61 
62  unsigned int retry = 0;
63  do {
64  recHitPosition = Local3DPoint(simHitPosition.x() + this->getRandomEngine().gaussShoot(0.0, _resolutionX),
65  0.0,
66  0.0 //fix y & z coordinates to center of module
67  );
68 
69  // If we tried to generate thePosition, and it's out of the bounds
70  // for 10 times, then take and return the simHit's location.
71  ++retry;
72  if (retry > 10) {
73  recHitPosition = Local3DPoint(simHitPosition.x(), 0.0, 0.0 //fix y & z coordinates to center of module
74  );
75  break;
76  }
77  } while (not bounds.inside(recHitPosition));
78 
80  //xx (variance)
82  //xy (covariance)
83  0.0,
84  //take here the provided y resolution or (lenght/sqrt(12))^2
85  _resolutionY < 0.0 ? boundY * boundY * INV12 : _resolutionY2);
86 
88  product->addRecHit(recHit, {simHitIdPair});
89  }
90  return product;
91  }
virtual float length() const =0
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: Plane.h:16
const RandomEngineAndDistribution & getRandomEngine() const
T x() const
Definition: PV3DBase.h:59
double gaussShoot(double mean=0.0, double sigma=1.0) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const TrackerGeometry & getTrackerGeometry() const
Definition: Bounds.h:18
const Bounds & bounds() const
Definition: Surface.h:87
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

Member Data Documentation

◆ _resolutionX

double TrackingRecHitStripGSPlugin::_resolutionX
private

Definition at line 21 of file TrackingRecHitStripGSPlugin.cc.

Referenced by TrackingRecHitStripGSPlugin().

◆ _resolutionX2

double TrackingRecHitStripGSPlugin::_resolutionX2
private

Definition at line 22 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

◆ _resolutionY

double TrackingRecHitStripGSPlugin::_resolutionY
private

Definition at line 24 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

◆ _resolutionY2

double TrackingRecHitStripGSPlugin::_resolutionY2
private

Definition at line 25 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

◆ INV12

constexpr double TrackingRecHitStripGSPlugin::INV12 = 1.0 / 12.0
staticprivate

Definition at line 27 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process().