SimMuon
MCTruth
interface
MuonAssociatorByHits.h
Go to the documentation of this file.
1
#ifndef MuonAssociatorByHits_h
2
#define MuonAssociatorByHits_h
3
4
#include "
DataFormats/Common/interface/Ref.h
"
5
#include "
DataFormats/TrackReco/interface/Track.h
"
6
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
7
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
FWCore/Framework/interface/EventSetup.h
"
10
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
11
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
12
#include "
SimDataFormats/Track/interface/SimTrackContainer.h
"
13
#include "
SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h
"
14
#include "
SimDataFormats/Vertex/interface/SimVertexContainer.h
"
15
16
#include "
SimMuon/MCTruth/interface/MuonAssociatorByHitsHelper.h
"
17
#include "
SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h
"
18
19
#include <memory>
20
21
namespace
muonAssociatorByHitsDiagnostics
{
22
class
InputDumper
;
23
}
24
25
class
MuonAssociatorByHits
{
26
public
:
27
MuonAssociatorByHits
(
const
edm::ParameterSet
&conf,
edm::ConsumesCollector
&&iC);
28
virtual
~MuonAssociatorByHits
();
29
30
// Originally from TrackAssociatorBase from where this class used to inherit
31
// from
32
reco::RecoToSimCollection
associateRecoToSim
(
edm::Handle
<
edm::View<reco::Track>
> &tCH,
33
edm::Handle<TrackingParticleCollection>
&tPCH,
34
const
edm::Event
*
event
,
35
const
edm::EventSetup
*
setup
)
const
{
36
edm::RefToBaseVector<reco::Track>
tc;
37
for
(
unsigned
int
j
= 0;
j
< tCH->size();
j
++)
38
tc.
push_back
(tCH->refAt(
j
));
39
40
edm::RefVector<TrackingParticleCollection>
tpc(tPCH.
id
());
41
for
(
unsigned
int
j
= 0;
j
< tPCH->size();
j
++)
42
tpc.
push_back
(
edm::Ref<TrackingParticleCollection>
(tPCH,
j
));
43
44
return
associateRecoToSim
(tc, tpc,
event
,
setup
);
45
}
46
47
virtual
reco::SimToRecoCollection
associateSimToReco
(
edm::Handle
<
edm::View<reco::Track>
> &tCH,
48
edm::Handle<TrackingParticleCollection>
&tPCH,
49
const
edm::Event
*
event
,
50
const
edm::EventSetup
*
setup
)
const
{
51
edm::RefToBaseVector<reco::Track>
tc;
52
for
(
unsigned
int
j
= 0;
j
< tCH->size();
j
++)
53
tc.
push_back
(tCH->refAt(
j
));
54
55
edm::RefVector<TrackingParticleCollection>
tpc(tPCH.
id
());
56
for
(
unsigned
int
j
= 0;
j
< tPCH->size();
j
++)
57
tpc.
push_back
(
edm::Ref<TrackingParticleCollection>
(tPCH,
j
));
58
59
return
associateSimToReco
(tc, tpc,
event
,
setup
);
60
}
61
62
/* Associate SimTracks to RecoTracks By Hits */
64
reco::RecoToSimCollection
associateRecoToSim
(
const
edm::RefToBaseVector<reco::Track>
&,
65
const
edm::RefVector<TrackingParticleCollection>
&,
66
const
edm::Event
*
event
=
nullptr
,
67
const
edm::EventSetup
*
setup
=
nullptr
)
const
;
68
70
reco::SimToRecoCollection
associateSimToReco
(
const
edm::RefToBaseVector<reco::Track>
&,
71
const
edm::RefVector<TrackingParticleCollection>
&,
72
const
edm::Event
*
event
=
nullptr
,
73
const
edm::EventSetup
*
setup
=
nullptr
)
const
;
74
75
private
:
76
MuonAssociatorByHitsHelper
helper_
;
77
edm::ParameterSet
const
conf_
;
78
TrackerHitAssociator::Config
trackerHitAssociatorConfig_
;
79
80
std::unique_ptr<muonAssociatorByHitsDiagnostics::InputDumper>
diagnostics_
;
81
};
82
83
#endif
MuonAssociatorByHits::conf_
const edm::ParameterSet conf_
Definition:
MuonAssociatorByHits.h:77
MuonAssociatorByHits::trackerHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition:
MuonAssociatorByHits.h:78
MuonAssociatorByHits::diagnostics_
std::unique_ptr< muonAssociatorByHitsDiagnostics::InputDumper > diagnostics_
Definition:
MuonAssociatorByHits.h:80
TrackerHitAssociator.h
edm::RefVector< TrackingParticleCollection >
TrackerHitAssociator::Config
Definition:
TrackerHitAssociator.h:57
edm::Handle
Definition:
AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
edm::Ref< TrackingParticleCollection >
MuonAssociatorByHits::helper_
MuonAssociatorByHitsHelper helper_
Definition:
MuonAssociatorByHits.h:76
Track.h
TrackFwd.h
edm::RefToBaseVector::push_back
void push_back(const RefToBase< T > &)
Definition:
RefToBaseVector.h:217
MuonAssociatorByHits::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track >> &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event, const edm::EventSetup *setup) const
Definition:
MuonAssociatorByHits.h:32
edm::View
Definition:
CaloClusterFwd.h:14
edm::ParameterSet
Definition:
ParameterSet.h:47
MuonAssociatorByHitsHelper
Definition:
MuonAssociatorByHitsHelper.h:28
MuonAssociatorByHits
Definition:
MuonAssociatorByHits.h:25
Event.h
MuonAssociatorByHits::~MuonAssociatorByHits
virtual ~MuonAssociatorByHits()
Definition:
MuonAssociatorByHits.cc:151
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > >
MuonAssociatorByHits::associateSimToReco
virtual reco::SimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Track >> &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event, const edm::EventSetup *setup) const
Definition:
MuonAssociatorByHits.h:47
MuonAssociatorByHitsHelper.h
edm::EventSetup
Definition:
EventSetup.h:57
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition:
RefVector.h:67
edm::RefToBaseVector< reco::Track >
MuonAssociatorByHits::MuonAssociatorByHits
MuonAssociatorByHits(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
Definition:
MuonAssociatorByHits.cc:139
TrackingParticle.h
Ref.h
Frameworkfwd.h
muonAssociatorByHitsDiagnostics
Definition:
MuonAssociatorByHits.h:21
EventSetup.h
muonAssociatorByHitsDiagnostics::InputDumper
Definition:
MuonAssociatorByHits.cc:25
ConsumesCollector.h
ParameterSet.h
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::HandleBase::id
ProductID id() const
Definition:
HandleBase.cc:29
SimTrackContainer.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
SimVertexContainer.h
Generated for CMSSW Reference Manual by
1.8.16