CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( const std::string &  name,
const edm::ParameterSet config,
edm::ConsumesCollector consumesCollector 
)
inline

Definition at line 30 of file TrackingRecHitStripGSPlugin.cc.

References _resolutionX, _resolutionX2, _resolutionY, _resolutionY2, edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

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");
46  _resolutionY2 = _resolutionY * _resolutionY;
47  }
48  }
bool exists(std::string const &parameterName) const
checks if a parameter exists
TrackingRecHitAlgorithm(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

TrackingRecHitProductPtr TrackingRecHitStripGSPlugin::process ( TrackingRecHitProductPtr  product) const
inlineoverridevirtual

Reimplemented from TrackingRecHitAlgorithm.

Definition at line 50 of file TrackingRecHitStripGSPlugin.cc.

References _resolutionX, _resolutionX2, _resolutionY, _resolutionY2, Surface::bounds(), relativeConstraints::error, RandomEngineAndDistribution::gaussShoot(), TrackingRecHitAlgorithm::getRandomEngine(), TrackingRecHitAlgorithm::getTrackerGeometry(), TrackerGeometry::idToDetUnit(), Bounds::inside(), INV12, Bounds::length(), PSimHit::localPosition(), 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 
87  FastSingleTrackerRecHit recHit(recHitPosition, error, *geomDet, fastTrackerRecHitType::siStrip1D);
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.
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
const TrackerGeometry & getTrackerGeometry() const
const Bounds & bounds() const
Definition: Surface.h:87
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: Plane.h:16
Local3DPoint localPosition() const
Definition: PSimHit.h:52
const RandomEngineAndDistribution & getRandomEngine() const
double gaussShoot(double mean=0.0, double sigma=1.0) const
Definition: Bounds.h:18
T x() const
Definition: PV3DBase.h:59
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

Member Data Documentation

double TrackingRecHitStripGSPlugin::_resolutionX
private

Definition at line 21 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

double TrackingRecHitStripGSPlugin::_resolutionX2
private

Definition at line 22 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

double TrackingRecHitStripGSPlugin::_resolutionY
private

Definition at line 24 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

double TrackingRecHitStripGSPlugin::_resolutionY2
private

Definition at line 25 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process(), and TrackingRecHitStripGSPlugin().

constexpr double TrackingRecHitStripGSPlugin::INV12 = 1.0 / 12.0
staticprivate

Definition at line 27 of file TrackingRecHitStripGSPlugin.cc.

Referenced by process().