CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackingRecHitAlgorithm.cc
Go to the documentation of this file.
2 
10 
13 
15 
17 
20 
22 
23 
24 
26  const std::string& name,
28  edm::ConsumesCollector& consumesCollector
29 ):
30  _name(name),
31  _selectionString(config.getParameter<std::string>("select")),
32  _trackerTopology(nullptr),
33  _trackerGeometry(nullptr),
34  _misalignedTrackerGeometry(nullptr),
35  _randomEngine(nullptr)
36 {
37 }
38 
40 {
41  if (!_trackerTopology)
42  {
43  throw cms::Exception("TrackingRecHitAlgorithm ") << _name <<": TrackerTopology not defined";
44  }
45  return *_trackerTopology;
46 }
47 
49 {
50  if (!_trackerGeometry)
51  {
52  throw cms::Exception("TrackingRecHitAlgorithm ") << _name <<": TrackerGeometry not defined";
53  }
54  return *_trackerGeometry;
55 }
56 
58 {
60  {
61  throw cms::Exception("TrackingRecHitAlgorithm ") << _name <<": MisalignedGeometry not defined";
62  }
64 }
65 
67 {
68  if (!_randomEngine)
69  {
70  throw cms::Exception("TrackingRecHitAlgorithm ") << _name <<": RandomEngineAndDistribution not defined";
71  }
72  return *_randomEngine;
73 }
74 
76 {
77  _randomEngine = std::make_shared<RandomEngineAndDistribution>(id);
78 }
79 
81 {
82  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
83  edm::ESHandle<TrackerGeometry> trackerGeometryHandle;
84  edm::ESHandle<TrackerGeometry> misalignedGeometryHandle;
85 
86  eventSetup.get<TrackerTopologyRcd>().get(trackerTopologyHandle);
87  eventSetup.get<TrackerDigiGeometryRecord>().get(trackerGeometryHandle);
88  eventSetup.get<TrackerDigiGeometryRecord>().get("MisAligned",misalignedGeometryHandle);
89 
90  _trackerTopology = trackerTopologyHandle.product();
91  _trackerGeometry = trackerGeometryHandle.product();
92  _misalignedTrackerGeometry = misalignedGeometryHandle.product();
93 }
94 
96 {
97  return product;
98 }
99 
101 {
102  //set these to 0 -> ensures that beginEvent needs to be executed before accessing these pointers again
103  _trackerGeometry=nullptr;
104  _trackerTopology=nullptr;
106 }
107 
109 {
110  _randomEngine.reset();
111 }
112 
114 {
115 }
const TrackerGeometry & getTrackerGeometry() const
const TrackerGeometry * _trackerGeometry
#define nullptr
virtual void beginEvent(edm::Event &event, const edm::EventSetup &eventSetup)
TrackingRecHitAlgorithm(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
const TrackerGeometry * _misalignedTrackerGeometry
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const RandomEngineAndDistribution & getRandomEngine() const
const TrackerTopology & getTrackerTopology() const
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
const TrackerTopology * _trackerTopology
virtual TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::shared_ptr< RandomEngineAndDistribution > _randomEngine
const TrackerGeometry & getMisalignedGeometry() const
virtual void beginStream(const edm::StreamID &id)
virtual void endEvent(edm::Event &event, const edm::EventSetup &eventSetup)