CMS 3D CMS Logo

TrackingRecHitAlgorithm.cc
Go to the documentation of this file.
2 
10 
13 
15 
17 
20 
22 
24 
27  edm::ConsumesCollector& consumesCollector)
28  : _name(name),
29  _selectionString(config.getParameter<std::string>("select")),
30  _trackerTopology(nullptr),
31  _trackerGeometry(nullptr),
32  _misalignedTrackerGeometry(nullptr),
33  _randomEngine(nullptr) {}
34 
36  if (!_trackerTopology) {
37  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": TrackerTopology not defined";
38  }
39  return *_trackerTopology;
40 }
41 
43  if (!_trackerGeometry) {
44  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": TrackerGeometry not defined";
45  }
46  return *_trackerGeometry;
47 }
48 
51  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": MisalignedGeometry not defined";
52  }
54 }
55 
57  if (!_randomEngine) {
58  throw cms::Exception("TrackingRecHitAlgorithm ") << _name << ": RandomEngineAndDistribution not defined";
59  }
60  return *_randomEngine;
61 }
62 
64  _randomEngine = std::make_shared<RandomEngineAndDistribution>(id);
65 }
66 
68  const edm::EventSetup& eventSetup,
69  const SiPixelTemplateDBObject* pixelTemplateDBObjectPtr,
70  std::vector<SiPixelTemplateStore>& tempStoreRef) {
71  // The default is to do nothing.
72 }
73 
75  edm::ESHandle<TrackerTopology> trackerTopologyHandle;
76  edm::ESHandle<TrackerGeometry> trackerGeometryHandle;
77  edm::ESHandle<TrackerGeometry> misalignedGeometryHandle;
78 
79  eventSetup.get<TrackerTopologyRcd>().get(trackerTopologyHandle);
80  eventSetup.get<TrackerDigiGeometryRecord>().get(trackerGeometryHandle);
81  eventSetup.get<TrackerDigiGeometryRecord>().get("MisAligned", misalignedGeometryHandle);
82 
83  _trackerTopology = trackerTopologyHandle.product();
84  _trackerGeometry = trackerGeometryHandle.product();
85  _misalignedTrackerGeometry = misalignedGeometryHandle.product();
86 }
87 
89 
91  //set these to 0 -> ensures that beginEvent needs to be executed before accessing these pointers again
92  _trackerGeometry = nullptr;
93  _trackerTopology = nullptr;
95 }
96 
98 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::StreamID
Definition: StreamID.h:30
TrackingRecHitAlgorithm::beginStream
virtual void beginStream(const edm::StreamID &id)
Definition: TrackingRecHitAlgorithm.cc:63
MessageLogger.h
TrackingRecHitAlgorithm::getTrackerTopology
const TrackerTopology & getTrackerTopology() const
Definition: TrackingRecHitAlgorithm.cc:35
ESHandle.h
TrackingRecHitAlgorithm::getRandomEngine
const RandomEngineAndDistribution & getRandomEngine() const
Definition: TrackingRecHitAlgorithm.cc:56
edm::Run
Definition: Run.h:45
RandomNumberGenerator.h
TrackerTopology
Definition: TrackerTopology.h:16
TrackingRecHitProduct.h
TrackingRecHitAlgorithm::_name
const std::string _name
Definition: TrackingRecHitAlgorithm.h:28
config
Definition: config.py:1
TrackingRecHitAlgorithm::TrackingRecHitAlgorithm
TrackingRecHitAlgorithm(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
Definition: TrackingRecHitAlgorithm.cc:25
TrackingRecHitAlgorithm::_misalignedTrackerGeometry
const TrackerGeometry * _misalignedTrackerGeometry
Definition: TrackingRecHitAlgorithm.h:32
PSimHit.h
TrackerTopologyRcd.h
TrackingRecHitProductPtr
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
Definition: TrackingRecHitProduct.h:47
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackingRecHitAlgorithm::_trackerTopology
const TrackerTopology * _trackerTopology
Definition: TrackingRecHitAlgorithm.h:30
Service.h
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
TrackingRecHitAlgorithm::process
virtual TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const
Definition: TrackingRecHitAlgorithm.cc:88
edm::ESHandle< TrackerTopology >
TrackingRecHitAlgorithm::_randomEngine
std::shared_ptr< RandomEngineAndDistribution > _randomEngine
Definition: TrackingRecHitAlgorithm.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackingRecHitAlgorithm::getTrackerGeometry
const TrackerGeometry & getTrackerGeometry() const
Definition: TrackingRecHitAlgorithm.cc:42
TrackingRecHitAlgorithm::_trackerGeometry
const TrackerGeometry * _trackerGeometry
Definition: TrackingRecHitAlgorithm.h:31
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
FastSingleTrackerRecHit.h
SiPixelTemplateDBObject
Definition: SiPixelTemplateDBObject.h:16
edm::EventSetup
Definition: EventSetup.h:57
TrackingRecHitAlgorithm::beginEvent
virtual void beginEvent(edm::Event &event, const edm::EventSetup &eventSetup)
Definition: TrackingRecHitAlgorithm.cc:74
get
#define get
TrackingRecHitAlgorithm::endEvent
virtual void endEvent(edm::Event &event, const edm::EventSetup &eventSetup)
Definition: TrackingRecHitAlgorithm.cc:90
TrackingRecHitAlgorithm::getMisalignedGeometry
const TrackerGeometry & getMisalignedGeometry() const
Definition: TrackingRecHitAlgorithm.cc:49
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
TrackingRecHitAlgorithm.h
TrackingRecHitAlgorithm::beginRun
virtual void beginRun(edm::Run const &run, const edm::EventSetup &eventSetup, const SiPixelTemplateDBObject *pixelTemplateDBObjectPtr, std::vector< SiPixelTemplateStore > &tempStoreRef)
Definition: TrackingRecHitAlgorithm.cc:67
DetId.h
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
Exception.h
ConsumesCollector.h
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
ParameterSet.h
TrackingRecHitAlgorithm::endStream
virtual void endStream()
Definition: TrackingRecHitAlgorithm.cc:97
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
TrackingRecHitAlgorithm::~TrackingRecHitAlgorithm
virtual ~TrackingRecHitAlgorithm()
Definition: TrackingRecHitAlgorithm.cc:99
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
TrackerGeometry
Definition: TrackerGeometry.h:14
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18