FastSimulation
TrackingRecHitProducer
plugins
TrackingRecHitNoSmearingPlugin.cc
Go to the documentation of this file.
1
#include "
FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithm.h
"
2
#include "
FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitAlgorithmFactory.h
"
3
#include "
FastSimulation/TrackingRecHitProducer/interface/TrackingRecHitProduct.h
"
4
5
#include "
DataFormats/DetId/interface/DetId.h
"
6
#include "
SimDataFormats/TrackingHit/interface/PSimHit.h
"
7
#include "
DataFormats/TrackerRecHit2D/interface/FastSingleTrackerRecHit.h
"
8
9
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
10
11
#include <string>
12
#include <iostream>
13
14
class
TrackingRecHitNoSmearingPlugin
:
public
TrackingRecHitAlgorithm
{
15
private
:
16
double
_errorXX
;
17
double
_errorXY
;
18
double
_errorYY
;
19
20
public
:
21
TrackingRecHitNoSmearingPlugin
(
const
std::string
&
name
,
22
const
edm::ParameterSet
&
config
,
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
41
TrackingRecHitProductPtr
process
(
TrackingRecHitProductPtr
product)
const override
{
42
for
(
const
std::pair<unsigned int, const PSimHit*>& simHitIdPair : product->getSimHitIdPairs()) {
43
const
PSimHit
*
simHit
= simHitIdPair.second;
44
const
Local3DPoint
&
position
=
simHit
->localPosition();
45
LocalError
error
(
_errorXX
,
_errorXY
,
_errorYY
);
46
const
GeomDet
* geomDet =
getTrackerGeometry
().
idToDetUnit
(product->getDetId());
47
48
//TODO: this is only a minimal example
49
FastSingleTrackerRecHit
recHit
(
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
63
DEFINE_EDM_PLUGIN
(
TrackingRecHitAlgorithmFactory
,
TrackingRecHitNoSmearingPlugin
,
"TrackingRecHitNoSmearingPlugin"
);
GeomDet
Definition:
GeomDet.h:27
fastTrackerRecHitType::siPixel
Definition:
FastTrackerRecHit.h:17
TrackingRecHitNoSmearingPlugin::_errorYY
double _errorYY
Definition:
TrackingRecHitNoSmearingPlugin.cc:18
TrackingRecHitProduct.h
TrackingRecHitNoSmearingPlugin
Definition:
TrackingRecHitNoSmearingPlugin.cc:14
fastTrackerRecHitType
Definition:
FastTrackerRecHit.h:15
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
rpcPointValidation_cfi.recHit
recHit
Definition:
rpcPointValidation_cfi.py:7
TrackingRecHitNoSmearingPlugin::process
TrackingRecHitProductPtr process(TrackingRecHitProductPtr product) const override
Definition:
TrackingRecHitNoSmearingPlugin.cc:41
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition:
TrackerGeometry.cc:183
config
Definition:
config.py:1
PSimHit.h
TrackingRecHitNoSmearingPlugin::_errorXX
double _errorXX
Definition:
TrackingRecHitNoSmearingPlugin.cc:16
TrackingRecHitProductPtr
std::shared_ptr< TrackingRecHitProduct > TrackingRecHitProductPtr
Definition:
TrackingRecHitProduct.h:47
rpcPointValidation_cfi.simHit
simHit
Definition:
rpcPointValidation_cfi.py:24
TrackingRecHitNoSmearingPlugin::_errorXY
double _errorXY
Definition:
TrackingRecHitNoSmearingPlugin.cc:17
Point3DBase< float, LocalTag >
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
TrackingRecHitAlgorithm::getTrackerGeometry
const TrackerGeometry & getTrackerGeometry() const
Definition:
TrackingRecHitAlgorithm.cc:42
edm::ParameterSet
Definition:
ParameterSet.h:47
LocalError
Definition:
LocalError.h:12
FastSingleTrackerRecHit.h
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
FastSingleTrackerRecHit
Definition:
FastSingleTrackerRecHit.h:7
position
static int position[264][3]
Definition:
ReadPGInfo.cc:289
TrackingRecHitNoSmearingPlugin::TrackingRecHitNoSmearingPlugin
TrackingRecHitNoSmearingPlugin(const std::string &name, const edm::ParameterSet &config, edm::ConsumesCollector &consumesCollector)
Definition:
TrackingRecHitNoSmearingPlugin.cc:21
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
TrackingRecHitAlgorithmFactory.h
TrackingRecHitAlgorithm.h
DetId.h
TrackingRecHitAlgorithm
Definition:
TrackingRecHitAlgorithm.h:26
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
ParameterSet.h
PSimHit
Definition:
PSimHit.h:15
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.16