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 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 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 32 of file TrackingRecHitStripGSPlugin.cc.

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

36  :
37  TrackingRecHitAlgorithm(name,config,consumesCollector),
38  _resolutionX(0.001),
40  _resolutionY(-1),
42 
43  {
44  if (config.exists("resolutionX"))
45  {
46  _resolutionX = config.getParameter<double>("resolutionX");
48  }
49  if (config.exists("resolutionY"))
50  {
51  _resolutionY = config.getParameter<double>("resolutionY");
52  _resolutionY2=_resolutionY*_resolutionY;
53  }
54  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
TrackingRecHitAlgorithm(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)

Member Function Documentation

TrackingRecHitProductPtr TrackingRecHitStripGSPlugin::process ( TrackingRecHitProductPtr  product) const
inlineoverridevirtual

Reimplemented from TrackingRecHitAlgorithm.

Definition at line 56 of file TrackingRecHitStripGSPlugin.cc.

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

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

57  {
58  for (const std::pair<unsigned int,const PSimHit*>& simHitIdPair: product->getSimHitIdPairs())
59  {
60  const PSimHit* simHit = simHitIdPair.second;
61  const Local3DPoint& simHitPosition = simHit->localPosition();
62 
63  const GeomDet* geomDet = this->getTrackerGeometry().idToDetUnit(product->getDetId());
64  const Plane& plane = geomDet->surface();
65  const Bounds& bounds = plane.bounds();
66  const double boundY = bounds.length();
67 
68  Local3DPoint recHitPosition;
69 
70  unsigned int retry = 0;
71  do
72  {
73  recHitPosition = Local3DPoint(
74  simHitPosition.x()+this->getRandomEngine().gaussShoot(0.0,_resolutionX),
75  0.0, 0.0 //fix y & z coordinates to center of module
76  );
77 
78  // If we tried to generate thePosition, and it's out of the bounds
79  // for 10 times, then take and return the simHit's location.
80  ++retry;
81  if (retry>10)
82  {
83  recHitPosition = Local3DPoint(
84  simHitPosition.x(),
85  0.0, 0.0 //fix y & z coordinates to center of module
86  );
87  break;
88  }
89  }
90  while (not bounds.inside(recHitPosition));
91 
93  //xx (variance)
95  //xy (covariance)
96  0.0,
97  //take here the provided y resolution or (lenght/sqrt(12))^2
98  _resolutionY<0.0 ? boundY*boundY*INV12 : _resolutionY2
99  );
100 
102  recHitPosition,
103  error,
104  *geomDet,
106  );
107  product->addRecHit(recHit,{simHitIdPair});
108  }
109  return product;
110  }
virtual float length() const =0
const TrackerGeometry & getTrackerGeometry() const
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
Definition: Plane.h:17
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.
Local3DPoint localPosition() const
Definition: PSimHit.h:44
const RandomEngineAndDistribution & getRandomEngine() const
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
double gaussShoot(double mean=0.0, double sigma=1.0) const
Definition: Bounds.h:22
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

double TrackingRecHitStripGSPlugin::_resolutionX
private

Definition at line 23 of file TrackingRecHitStripGSPlugin.cc.

Referenced by TrackingRecHitStripGSPlugin().

double TrackingRecHitStripGSPlugin::_resolutionX2
private

Definition at line 24 of file TrackingRecHitStripGSPlugin.cc.

double TrackingRecHitStripGSPlugin::_resolutionY
private

Definition at line 26 of file TrackingRecHitStripGSPlugin.cc.

Referenced by TrackingRecHitStripGSPlugin().

double TrackingRecHitStripGSPlugin::_resolutionY2
private

Definition at line 27 of file TrackingRecHitStripGSPlugin.cc.

double TrackingRecHitStripGSPlugin::INV12 = 1.0/12.0
staticprivate

Definition at line 29 of file TrackingRecHitStripGSPlugin.cc.