CMS 3D CMS Logo

TrackingRecHitNoSmearingPlugin.cc
Go to the documentation of this file.
4 
8 
10 
11 #include <string>
12 #include <iostream>
13 
16 {
17  private:
18  double _errorXX;
19  double _errorXY;
20  double _errorYY;
21  public:
23  const std::string& name,
25  edm::ConsumesCollector& consumesCollector
26  ):
27  TrackingRecHitAlgorithm(name,config,consumesCollector),
28  _errorXX(0.001*0.001),
29  _errorXY(0.0),
30  _errorYY(0.001*0.001)
31  {
32  if (config.exists("errorXX"))
33  {
34  _errorXX = config.getParameter<double>("errorXX");
35  }
36 
37  if (config.exists("errorXY"))
38  {
39  _errorXY = config.getParameter<double>("errorXY");
40  }
41 
42  if (config.exists("errorYY"))
43  {
44  _errorYY = config.getParameter<double>("errorYY");
45  }
46  }
47 
49  {
50  for (const std::pair<unsigned int,const PSimHit*>& simHitIdPair: product->getSimHitIdPairs())
51  {
52  const PSimHit* simHit = simHitIdPair.second;
53  const Local3DPoint& position = simHit->localPosition();
54  LocalError error(_errorXX,_errorXY,_errorYY);
55  const GeomDet* geomDet = getTrackerGeometry().idToDetUnit(product->getDetId());
56 
57  //TODO: this is only a minimal example
59  position, //const LocalPoint &
60  error, //const LocalError &
61  *geomDet, //GeomDet const &idet
62  fastTrackerRecHitType::siPixel // since this is a dummy class anyway: pretend all hits are pixel hits (only effect: hits are defined in 2D (?))
63  );
64  product->addRecHit(recHit,{simHitIdPair});
65  }
66 
67  return product;
68  }
69 };
70 
74  "TrackingRecHitNoSmearingPlugin"
75 );
76 
T getParameter(std::string const &) const
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
bool exists(std::string const &parameterName) const
checks if a parameter exists
const TrackerGeometry & getTrackerGeometry() const
Definition: config.py:1
virtual TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const
Local3DPoint localPosition() const
Definition: PSimHit.h:44
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
static int position[264][3]
Definition: ReadPGInfo.cc:509
#define DEFINE_EDM_PLUGIN(factory, type, name)
TrackingRecHitNoSmearingPlugin(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)