Skip to content

Commit

Permalink
fixed mistake occured at copy and paste
Browse files Browse the repository at this point in the history
  • Loading branch information
jo100sun committed Aug 31, 2023
1 parent a309d8d commit 69b820f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 75 deletions.
20 changes: 12 additions & 8 deletions DQMOffline/MuonDPG/python/gemTnPEfficiencyClient_cfi.py
Expand Up @@ -4,9 +4,18 @@
gemTnPEfficiencyClient = DQMEDHarvester("TnPEfficiencyClient",
#Histogram names listed as "passProbeHistoName:failProbeHistoName"
subsystem = cms.untracked.string("GEM"),
#histoNames = cms.untracked.vstring("GEM_nPassingProbe_allCh:GEM_nFailingProbe_allCh",
histoNames = cms.untracked.vstring("GEM_nPassingProbe_allCh_1D:GEM_nFailingProbe_allCh_1D",
"GEM_nPassingProbe_chamber_1D:GEM_nFailingProbe_chamber_1D",
histoNames = cms.untracked.vstring("GE11_nPassingProbe_Ch_region:GE11_nFailingProbe_Ch_region",
"GE21_nPassingProbe_Ch_region:GE21_nFailingProbe_Ch_region",
"GEM_nPassingProbe_Ch_region_GE1:GEM_nFailingProbe_Ch_region_GE1",
"GEM_nPassingProbe_Ch_region_GE1_NoL:GEM_nFailingProbe_Ch_region_GE1_NoL",
"GE11_nPassingProbe_Ch_ieta:GE11_nFailingProbe_Ch_ieta",
"GE11_nPassingProbe_Ch_phi:GE11_nFailingProbe_Ch_phi",
"GE11_nPassingProbe_allCh_1D:GE11_nFailingProbe_allCh_1D",
"GE11_nPassingProbe_chamber_1D:GE11_nFailingProbe_chamber_1D",
"GE21_nPassingProbe_Ch_ieta:GE21_nFailingProbe_Ch_ieta",
"GE21_nPassingProbe_Ch_phi:GE21_nFailingProbe_Ch_phi",
"GE21_nPassingProbe_allCh_1D:GE21_nFailingProbe_allCh_1D",
"GE21_nPassingProbe_chamber_1D:GE21_nFailingProbe_chamber_1D",
"GEM_nPassingProbe_chamber_p1_1D:GEM_nFailingProbe_chamber_p1_1D",
"GEM_nPassingProbe_chamber_p2_1D:GEM_nFailingProbe_chamber_p2_1D",
"GEM_nPassingProbe_chamber_n1_1D:GEM_nFailingProbe_chamber_n1_1D",
Expand All @@ -26,11 +35,6 @@
"GEM_nPassingProbe_pt_n2_1D:GEM_nFailingProbe_pt_n2_1D",
"GEM_nPassingProbe_eta_n2_1D:GEM_nFailingProbe_eta_n2_1D",
"GEM_nPassingProbe_phi_n2_1D:GEM_nFailingProbe_phi_n2_1D",
"GEM_nPassingProbe_Ch_region:GEM_nFailingProbe_Ch_region",
"GEM_nPassingProbe_Ch_region_GE1:GEM_nFailingProbe_Ch_region_GE1",
"GEM_nPassingProbe_Ch_region_GE1_NoL:GEM_nFailingProbe_Ch_region_GE1_NoL",
"GEM_nPassingProbe_Ch_eta:GEM_nFailingProbe_Ch_eta",
"GEM_nPassingProbe_Ch_phi:GEM_nFailingProbe_Ch_phi",
"ME0_nPassingProbe_chamber_1D:ME0_nFailingProbe_chamber_1D",
"GEM_nPassingProbe_Ch_region_layer_phase2:GEM_nFailingProbe_Ch_region_layer_phase2"),
diagnosticPrescale = cms.untracked.int32(1))
69 changes: 2 additions & 67 deletions TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc
Expand Up @@ -39,9 +39,6 @@
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
#include "DataFormats/GEMRecHit/interface/GEMSegmentCollection.h"
#include "DataFormats/GEMRecHit/interface/ME0SegmentCollection.h"
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
#include "DataFormats/GEMRecHit/interface/GEMRecHitCollection.h"
#include "DataFormats/GEMRecHit/interface/ME0RecHitCollection.h"

// calorimeter and muon infos
#include "Geometry/CommonDetUnit/interface/GeomDet.h"
Expand Down Expand Up @@ -594,8 +591,7 @@ DetIdAssociator::MapRange TrackDetectorAssociator::getMapRange(const std::pair<f
}

void TrackDetectorAssociator::getTAMuonChamberMatches(std::vector<TAMuonChamberMatch>& matches,
const AssociatorParameters& parameters,
std::set<DetId> occupancy) {
const AssociatorParameters& parameters) {
// Strategy:
// Propagate through the whole detector, estimate change in eta and phi
// along the trajectory, add this to dRMuon and find DetIds around this
Expand Down Expand Up @@ -625,18 +621,6 @@ void TrackDetectorAssociator::getTAMuonChamberMatches(std::vector<TAMuonChamberM

std::set<DetId> muonIdsInRegion = muonDetIdAssociator_->getDetIdsCloseToAPoint(trajectoryPoint.position(), mapRange);
LogTrace("TrackAssociator") << "Number of chambers to check: " << muonIdsInRegion.size();

if (parameters.preselectMuonTracks) {
std::set<DetId> muonIdsInRegionOccupied;
std::set_intersection(muonIdsInRegion.begin(),
muonIdsInRegion.end(),
occupancy.begin(),
occupancy.end(),
std::inserter(muonIdsInRegionOccupied, muonIdsInRegionOccupied.begin()));
if (muonIdsInRegionOccupied.empty())
return;
}

for (std::set<DetId>::const_iterator detId = muonIdsInRegion.begin(); detId != muonIdsInRegion.end(); detId++) {
const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet(*detId);
TrajectoryStateOnSurface stateOnSurface = cachedTrajectory_.propagate(&geomDet->surface());
Expand Down Expand Up @@ -739,55 +723,6 @@ void TrackDetectorAssociator::fillMuon(const edm::Event& iEvent,
if (parameters.useME0)
iEvent.getByToken(parameters.me0SegmentsToken, me0Segments);

// Get the hits from the event only if track preselection is activated
// Get the chambers segments/hits in the events
std::set<DetId> occupancy_set;
if (parameters.preselectMuonTracks) {
edm::Handle<RPCRecHitCollection> rpcRecHits;
iEvent.getByToken(parameters.rpcHitsToken, rpcRecHits);
if (!rpcRecHits.isValid())
throw cms::Exception("FatalError") << "Unable to find RPCRecHitCollection in event!\n";

edm::Handle<GEMRecHitCollection> gemRecHits;
if (parameters.useGEM)
iEvent.getByToken(parameters.gemHitsToken, gemRecHits);

edm::Handle<ME0RecHitCollection> me0RecHits;
if (parameters.useME0)
iEvent.getByToken(parameters.me0HitsToken, me0RecHits);

for (const auto& dtSegment : *dtSegments) {
occupancy_set.insert(dtSegment.geographicalId());
}
for (const auto& cscSegment : *cscSegments) {
occupancy_set.insert(cscSegment.geographicalId());
}
for (const auto& rpcRecHit : *rpcRecHits) {
occupancy_set.insert(rpcRecHit.geographicalId());
}
if (parameters.useGEM) {
for (const auto& gemSegment : *gemSegments) {
occupancy_set.insert(gemSegment.geographicalId());
}
for (const auto& gemRecHit : *gemRecHits) {
occupancy_set.insert(gemRecHit.geographicalId());
}
}
if (parameters.useME0) {
for (const auto& me0Segment : *me0Segments) {
occupancy_set.insert(me0Segment.geographicalId());
}
for (const auto& me0RecHit : *me0RecHits) {
occupancy_set.insert(me0RecHit.geographicalId());
}
}
if (occupancy_set.empty()) {
LogTrace("TrackAssociator") << "No segments or hits were found in the event: aborting track extrapolation"
<< std::endl;
return;
}
}

///// get a set of DetId's in a given direction

// check the map of available segments
Expand All @@ -801,7 +736,7 @@ void TrackDetectorAssociator::fillMuon(const edm::Event& iEvent,
// get a set of matches corresponding to muon chambers
std::vector<TAMuonChamberMatch> matchedChambers;
LogTrace("TrackAssociator") << "Trying to Get ChamberMatches" << std::endl;
getTAMuonChamberMatches(matchedChambers, parameters, occupancy_set);
getTAMuonChamberMatches(matchedChambers, parameters);
LogTrace("TrackAssociator") << "Chambers matched: " << matchedChambers.size() << "\n";

// Iterate over all chamber matches and fill segment matching
Expand Down

0 comments on commit 69b820f

Please sign in to comment.