CMS 3D CMS Logo

TrackingRecHitAlgorithm.cc
Go to the documentation of this file.
2 
9 
12 
14 
16 
18 
20 
23  edm::ConsumesCollector& consumesCollector)
24  : _name(name),
25  _selectionString(config.getParameter<std::string>("select")),
26  _trackerTopology(nullptr),
27  _trackerGeometry(nullptr),
28  _misalignedTrackerGeometry(nullptr),
29  trackerTopologyESToken_(consumesCollector.esConsumes()),
30  trackerGeometryESToken_(consumesCollector.esConsumes()),
31  misalignedTrackerGeometryESToken_(consumesCollector.esConsumes(edm::ESInputTag("", "MisAligned"))),
32  _randomEngine(nullptr) {}
33 
35  if (!_trackerTopology) {
36  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": TrackerTopology not defined";
37  }
38  return *_trackerTopology;
39 }
40 
42  if (!_trackerGeometry) {
43  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": TrackerGeometry not defined";
44  }
45  return *_trackerGeometry;
46 }
47 
50  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": MisalignedGeometry not defined";
51  }
53 }
54 
56  if (!_randomEngine) {
57  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": RandomEngineAndDistribution not defined";
58  }
59  return *_randomEngine;
60 }
61 
63  _randomEngine = std::make_shared<RandomEngineAndDistribution>(id);
64 }
65 
68  const SiPixelTemplateDBObject* pixelTemplateDBObjectPtr,
69  const std::vector<SiPixelTemplateStore>& tempStoreRef) {
70  // The default is to do nothing.
71 }
72 
77 }
78 
80 
82  //set these to 0 -> ensures that beginEvent needs to be executed before accessing these pointers again
83  _trackerGeometry = nullptr;
84  _trackerTopology = nullptr;
86 }
87 
89 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
virtual void beginRun(edm::Run const &run, const edm::EventSetup &eventSetup, const SiPixelTemplateDBObject *pixelTemplateDBObjectPtr, const std::vector< SiPixelTemplateStore > &tempStoreRef)
const TrackerTopology & getTrackerTopology() const
Definition: config.py:1
const TrackerGeometry * _trackerGeometry
virtual TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const
const RandomEngineAndDistribution & getRandomEngine() const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > misalignedTrackerGeometryESToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_
virtual void beginEvent(edm::Event &event, const edm::EventSetup &eventSetup)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryESToken_
TrackingRecHitAlgorithm(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
const TrackerGeometry * _misalignedTrackerGeometry
const TrackerGeometry & getMisalignedGeometry() const
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
const TrackerTopology * _trackerTopology
std::shared_ptr< RandomEngineAndDistribution > _randomEngine
const TrackerGeometry & getTrackerGeometry() const
HLT enums.
virtual void beginStream(const edm::StreamID &id)
virtual void endEvent(edm::Event &event, const edm::EventSetup &eventSetup)
Definition: event.py:1
Definition: Run.h:45