RecoMuon
TrackerSeedGenerator
plugins
DualByL2TSG.cc
Go to the documentation of this file.
1
#include "
RecoMuon/TrackerSeedGenerator/plugins/DualByL2TSG.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include "
FWCore/Framework/interface/Event.h
"
4
#include "
DataFormats/Common/interface/Handle.h
"
5
6
#include "
DataFormats/TrackReco/interface/Track.h
"
7
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
8
#include "
DataFormats/MuonSeed/interface/L3MuonTrajectorySeed.h
"
9
#include "
DataFormats/MuonSeed/interface/L3MuonTrajectorySeedCollection.h
"
10
#include "
RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGenerator.h
"
11
12
DualByL2TSG::DualByL2TSG
(
const
edm::ParameterSet
&
pset
,
edm::ConsumesCollector
& iC) :
SeparatingTSG
(
pset
, iC) {
13
theCategory
=
"DualByL2TSG"
;
14
theL3CollectionLabelA
=
pset
.getParameter<
edm::InputTag
>(
"L3TkCollectionA"
);
15
if
(
nTSGs
() != 2) {
16
edm::LogError
(
theCategory
) <<
"not two seed generators provided"
;
17
}
18
19
l3muonToken
= iC.
consumes
<
reco::TrackCollection
>(
theL3CollectionLabelA
);
20
}
21
22
unsigned
int
DualByL2TSG::selectTSG
(
const
TrackCand
& muonTrackCand,
const
TrackingRegion
&
region
) {
23
LogDebug
(
theCategory
) <<
"|eta|=|"
<< muonTrackCand.second->eta() <<
"|"
;
24
25
bool
re_do_this_L2 =
true
;
26
//LogDebug("TrackerSeedGenerator")<<theEvent;
27
//getEvent();
28
29
//retrieve L3 track collection
30
edm::Handle<reco::TrackCollection>
l3muonH
;
31
getEvent
()->
getByToken
(
l3muonToken
,
l3muonH
);
32
if
(
l3muonH
.
failedToGet
())
33
return
0;
34
35
unsigned
int
maxI
=
l3muonH
->size();
36
37
LogDebug
(
theCategory
) <<
"TheCollectionA size "
<<
maxI
;
38
39
// Loop through all tracks, if the track was seeded from this L2, then skip
40
for
(
unsigned
int
i
= 0;
i
!=
maxI
; ++
i
) {
41
reco::TrackRef
tk(
l3muonH
,
i
);
42
edm::Ref<L3MuonTrajectorySeedCollection>
l3seedRef =
43
tk->seedRef().castTo<
edm::Ref<L3MuonTrajectorySeedCollection>
>();
44
reco::TrackRef
staTrack = l3seedRef->l2Track();
45
46
if
(staTrack == (muonTrackCand.second))
47
re_do_this_L2 =
false
;
48
//LogDebug(theCategory) << "The DualByL2TSG selectTSG loop " << re_do_this_L2 << " staCand " << muonTrackCand.second->eta() << " " << muonTrackCand.second->pt() << " alreadyMadeRefToL3 " << staTrack->eta() << " " << staTrack->pt();
49
}
50
51
LogDebug
(
theCategory
) <<
"The DualByL2TSG to use "
<< re_do_this_L2;
52
53
return
re_do_this_L2 ? 1 : 0;
54
}
TrackerSeedGenerator::TrackCand
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Definition:
TrackerSeedGenerator.h:30
Handle.h
mps_fire.i
i
Definition:
mps_fire.py:428
MessageLogger.h
DualByL2TSG::selectTSG
unsigned int selectTSG(const TrackCand &, const TrackingRegion &) override
decide the TSG depending on the existence of a L3 track seeded from the L2. Return value is 0 or 1.
Definition:
DualByL2TSG.cc:22
L3MuonTrajectorySeedCollection.h
TrackerSeedGenerator.h
SeparatingTSG
Definition:
SeparatingTSG.h:17
DualByL2TSG::DualByL2TSG
DualByL2TSG(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
Definition:
DualByL2TSG.cc:12
findQualityFiles.maxI
int maxI
Definition:
findQualityFiles.py:182
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
Track.h
TrackFwd.h
DualByL2TSG::l3muonH
edm::Handle< reco::TrackCollection > l3muonH
Definition:
DualByL2TSG.h:28
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition:
ConsumesCollector.h:55
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:535
L3MuonTrajectorySeed.h
TrackerSeedGenerator::getEvent
const edm::Event * getEvent() const
Definition:
TrackerSeedGenerator.h:41
edm::HandleBase::failedToGet
bool failedToGet() const
Definition:
HandleBase.h:72
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
edm::ParameterSet
Definition:
ParameterSet.h:47
DualByL2TSG::theCategory
std::string theCategory
Definition:
DualByL2TSG.h:26
Event.h
HLT_FULL_cff.region
region
Definition:
HLT_FULL_cff.py:88267
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
DualByL2TSG::theL3CollectionLabelA
edm::InputTag theL3CollectionLabelA
Definition:
DualByL2TSG.h:27
TrackingRegion
Definition:
TrackingRegion.h:41
CompositeTSG::nTSGs
unsigned int nTSGs()
Definition:
CompositeTSG.h:38
DualByL2TSG::l3muonToken
edm::EDGetTokenT< reco::TrackCollection > l3muonToken
Definition:
DualByL2TSG.h:29
DualByL2TSG.h
edm::InputTag
Definition:
InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16