Skip to content

Commit

Permalink
code-checks and code-format
Browse files Browse the repository at this point in the history
  • Loading branch information
khaosmos93 committed Jan 20, 2021
1 parent ddf1310 commit 146eeeb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 52 deletions.
32 changes: 11 additions & 21 deletions HLTrigger/HLTfilters/plugins/HLT2L1TkMuonL1TkMuonMuRefDR.cc
Expand Up @@ -103,25 +103,19 @@ bool HLT2L1TkMuonL1TkMuonMuRefDR::getCollections(edm::Event& iEvent,
return false;
}

bool HLT2L1TkMuonL1TkMuonMuRefDR::computeDR(edm::Event& iEvent,
l1t::TkMuonRef& r1,
l1t::TkMuonRef& r2) const {

bool HLT2L1TkMuonL1TkMuonMuRefDR::computeDR(edm::Event& iEvent, l1t::TkMuonRef& r1, l1t::TkMuonRef& r2) const {
float muRef1_eta = 0.;
float muRef1_phi = 0.;
if (r1->muonDetector() != 3) {
if(r1->muRef().isNull())
if (r1->muRef().isNull())
return false;

muRef1_eta = r1->muRef()->hwEta() * 0.010875;
muRef1_phi = static_cast<float>(
l1t::MicroGMTConfiguration::calcGlobalPhi(r1->muRef()->hwPhi(),
r1->muRef()->trackFinderType(),
r1->muRef()->processor()));
muRef1_phi = static_cast<float>(l1t::MicroGMTConfiguration::calcGlobalPhi(
r1->muRef()->hwPhi(), r1->muRef()->trackFinderType(), r1->muRef()->processor()));
muRef1_phi = muRef1_phi * 2. * M_PI / 576.;
}
else {
if(r1->emtfTrk().isNull())
} else {
if (r1->emtfTrk().isNull())
return false;

muRef1_eta = r1->emtfTrk()->Eta();
Expand All @@ -132,18 +126,15 @@ bool HLT2L1TkMuonL1TkMuonMuRefDR::computeDR(edm::Event& iEvent,
float muRef2_eta = 0.;
float muRef2_phi = 0.;
if (r2->muonDetector() != 3) {
if(r2->muRef().isNull())
if (r2->muRef().isNull())
return false;

muRef2_eta = r2->muRef()->hwEta() * 0.010875;
muRef2_phi = static_cast<float>(
l1t::MicroGMTConfiguration::calcGlobalPhi(r2->muRef()->hwPhi(),
r2->muRef()->trackFinderType(),
r2->muRef()->processor()));
muRef2_phi = static_cast<float>(l1t::MicroGMTConfiguration::calcGlobalPhi(
r2->muRef()->hwPhi(), r2->muRef()->trackFinderType(), r2->muRef()->processor()));
muRef2_phi = muRef2_phi * 2. * M_PI / 576.;
}
else {
if(r2->emtfTrk().isNull())
} else {
if (r2->emtfTrk().isNull())
return false;

muRef2_eta = r2->emtfTrk()->Eta();
Expand All @@ -157,7 +148,6 @@ bool HLT2L1TkMuonL1TkMuonMuRefDR::computeDR(edm::Event& iEvent,
return false;
}


// ------------ method called to produce the data ------------
bool HLT2L1TkMuonL1TkMuonMuRefDR::hltFilter(edm::Event& iEvent,
const edm::EventSetup& iSetup,
Expand Down
6 changes: 3 additions & 3 deletions HLTrigger/HLTfilters/plugins/HLT2L1TkMuonL1TkMuonMuRefDR.h
Expand Up @@ -42,9 +42,9 @@ class HLT2L1TkMuonL1TkMuonMuRefDR : public HLTFilter {
const edm::InputTag inputTag2_; // input tag identifying filtered 2nd product
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> inputToken1_;
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> inputToken2_;
const double minDR_; // minimum dR between two muon regional candidates linked to L1TkMuon
const int min_N_; // number of pairs passing cuts required
const bool same_; // 1st and 2nd product are one and the same
const double minDR_; // minimum dR between two muon regional candidates linked to L1TkMuon
const int min_N_; // number of pairs passing cuts required
const bool same_; // 1st and 2nd product are one and the same
};

#endif //HLT2L1TkMuonL1TkMuonMuRefDR_h
4 changes: 2 additions & 2 deletions HLTrigger/Muon/plugins/HLTMuonTrkL1TkMuFilter.cc
Expand Up @@ -59,8 +59,8 @@ void HLTMuonTrkL1TkMuFilter::fillDescriptions(edm::ConfigurationDescriptions& de
}

bool HLTMuonTrkL1TkMuFilter::hltFilter(edm::Event& iEvent,
const edm::EventSetup& iSetup,
trigger::TriggerFilterObjectWithRefs& filterproduct) const {
const edm::EventSetup& iSetup,
trigger::TriggerFilterObjectWithRefs& filterproduct) const {
edm::Handle<reco::MuonCollection> muons;
iEvent.getByToken(m_muonsToken, muons);
edm::Handle<reco::RecoChargedCandidateCollection> cands;
Expand Down
32 changes: 7 additions & 25 deletions RecoMuon/L2MuonSeedGenerator/src/L2MuonSeedGeneratorFromL1TkMu.cc
Expand Up @@ -50,8 +50,7 @@ L2MuonSeedGeneratorFromL1TkMu::L2MuonSeedGeneratorFromL1TkMu(const edm::Paramete
useOfflineSeed(iConfig.getUntrackedParameter<bool>("UseOfflineSeed", false)),
useUnassociatedL1(iConfig.getParameter<bool>("UseUnassociatedL1")),
matchingDR(iConfig.getParameter<std::vector<double>>("MatchDR")),
etaBins(iConfig.getParameter<std::vector<double>>("EtaMatchingBins"))
{
etaBins(iConfig.getParameter<std::vector<double>>("EtaMatchingBins")) {
muCollToken_ = consumes<l1t::TkMuonCollection>(theSource);

if (useOfflineSeed) {
Expand Down Expand Up @@ -127,7 +126,6 @@ void L2MuonSeedGeneratorFromL1TkMu::produce(edm::Event &iEvent, const edm::Event
}

for (auto ittkmu = muColl->begin(); ittkmu != muColl->end(); ittkmu++) {

// L1 tracker track
auto it = ittkmu->trkPtr();

Expand Down Expand Up @@ -258,8 +256,7 @@ void L2MuonSeedGeneratorFromL1TkMu::produce(edm::Event &iEvent, const edm::Event
LogDebug(metname) << debug.dumpFTS(state);

// Propagate the state on the MB2/ME2 surface
TrajectoryStateOnSurface tsos =
theService->propagator(thePropagatorName)->propagate(state, detLayer->surface());
TrajectoryStateOnSurface tsos = theService->propagator(thePropagatorName)->propagate(state, detLayer->surface());

LogDebug(metname) << "State after the propagation on the layer";
LogDebug(metname) << debug.dumpLayer(detLayer);
Expand All @@ -286,8 +283,7 @@ void L2MuonSeedGeneratorFromL1TkMu::produce(edm::Event &iEvent, const edm::Event
const DetLayer *ME2DetLayer = theService->detLayerGeometry()->idToLayer(fallback_id);

tsos = theService->propagator(thePropagatorName)->propagate(state, ME2DetLayer->surface());
detsWithStates =
ME2DetLayer->compatibleDets(tsos, *theService->propagator(thePropagatorName), *theEstimator);
detsWithStates = ME2DetLayer->compatibleDets(tsos, *theService->propagator(thePropagatorName), *theEstimator);
}

if (!detsWithStates.empty()) {
Expand All @@ -310,28 +306,19 @@ void L2MuonSeedGeneratorFromL1TkMu::produce(edm::Event &iEvent, const edm::Event

if (assoOffseed != nullptr) {
PTrajectoryStateOnDet const &seedTSOS = assoOffseed->startingState();
TrajectorySeed::const_iterator tsci = assoOffseed->recHits().first,
tscie = assoOffseed->recHits().second;
TrajectorySeed::const_iterator tsci = assoOffseed->recHits().first, tscie = assoOffseed->recHits().second;
for (; tsci != tscie; ++tsci) {
container.push_back(*tsci);
}
auto dummyRef = edm::Ref<MuonBxCollection>();
output->push_back(
L2MuonTrajectorySeed(seedTSOS,
container,
alongMomentum,
dummyRef));
output->push_back(L2MuonTrajectorySeed(seedTSOS, container, alongMomentum, dummyRef));
} else {
if (useUnassociatedL1) {
// convert the TSOS into a PTSOD
PTrajectoryStateOnDet const &seedTSOS =
trajectoryStateTransform::persistentState(newTSOS, newTSOSDet->geographicalId().rawId());
auto dummyRef = edm::Ref<MuonBxCollection>();
output->push_back(
L2MuonTrajectorySeed(seedTSOS,
container,
alongMomentum,
dummyRef));
output->push_back(L2MuonTrajectorySeed(seedTSOS, container, alongMomentum, dummyRef));
}
}
}
Expand All @@ -340,11 +327,7 @@ void L2MuonSeedGeneratorFromL1TkMu::produce(edm::Event &iEvent, const edm::Event
// convert the TSOS into a PTSOD
PTrajectoryStateOnDet const &seedTSOS = trajectoryStateTransform::persistentState(tsos, theid.rawId());
auto dummyRef = edm::Ref<MuonBxCollection>();
output->push_back(
L2MuonTrajectorySeed(seedTSOS,
container,
alongMomentum,
dummyRef));
output->push_back(L2MuonTrajectorySeed(seedTSOS, container, alongMomentum, dummyRef));
}
}
}
Expand Down Expand Up @@ -429,4 +412,3 @@ const TrajectorySeed *L2MuonSeedGeneratorFromL1TkMu::associateOfflineSeedToL1(

return selOffseed;
}

Expand Up @@ -83,7 +83,6 @@ class L2MuonSeedGeneratorFromL1TkMu : public edm::stream::EDProducer<> {
std::vector<int> &,
TrajectoryStateOnSurface &,
double);

};

#endif

0 comments on commit 146eeeb

Please sign in to comment.