CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackingRecHitNoSmearingPlugin.cc
Go to the documentation of this file.
4 
8 
10 
11 #include <string>
12 #include <iostream>
13 
15 private:
16  double _errorXX;
17  double _errorXY;
18  double _errorYY;
19 
20 public:
23  edm::ConsumesCollector& consumesCollector)
24  : TrackingRecHitAlgorithm(name, config, consumesCollector),
25  _errorXX(0.001 * 0.001),
26  _errorXY(0.0),
27  _errorYY(0.001 * 0.001) {
28  if (config.exists("errorXX")) {
29  _errorXX = config.getParameter<double>("errorXX");
30  }
31 
32  if (config.exists("errorXY")) {
33  _errorXY = config.getParameter<double>("errorXY");
34  }
35 
36  if (config.exists("errorYY")) {
37  _errorYY = config.getParameter<double>("errorYY");
38  }
39  }
40 
42  for (const std::pair<unsigned int, const PSimHit*>& simHitIdPair : product->getSimHitIdPairs()) {
43  const PSimHit* simHit = simHitIdPair.second;
44  const Local3DPoint& position = simHit->localPosition();
46  const GeomDet* geomDet = getTrackerGeometry().idToDetUnit(product->getDetId());
47 
48  //TODO: this is only a minimal example
50  position, //const LocalPoint &
51  error, //const LocalError &
52  *geomDet, //GeomDet const &idet
53  fastTrackerRecHitType::
54  siPixel // since this is a dummy class anyway: pretend all hits are pixel hits (only effect: hits are defined in 2D (?))
55  );
56  product->addRecHit(recHit, {simHitIdPair});
57  }
58 
59  return product;
60  }
61 };
62 
const TrackerGeomDet * idToDetUnit(DetId) const override
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
Local3DPoint localPosition() const
Definition: PSimHit.h:52
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tuple config
parse the configuration file
static int position[264][3]
Definition: ReadPGInfo.cc:289
#define DEFINE_EDM_PLUGIN(factory, type, name)
TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const override
TrackingRecHitNoSmearingPlugin(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)