diff --git a/DQM/GEM/plugins/GEMEfficiencyAnalyzer.cc b/DQM/GEM/plugins/GEMEfficiencyAnalyzer.cc index 2174f7ef53b03..57d5b3b3f0988 100644 --- a/DQM/GEM/plugins/GEMEfficiencyAnalyzer.cc +++ b/DQM/GEM/plugins/GEMEfficiencyAnalyzer.cc @@ -36,8 +36,11 @@ GEMEfficiencyAnalyzer::GEMEfficiencyAnalyzer(const edm::ParameterSet& pset) eta_nbins_ = pset.getUntrackedParameter("etaNbins"); eta_low_ = pset.getUntrackedParameter("etaLow"); eta_up_ = pset.getUntrackedParameter("etaUp"); + monitor_ge11_ = pset.getUntrackedParameter("monitorGE11"); + monitor_ge21_ = pset.getUntrackedParameter("monitorGE21"); + monitor_ge0_ = pset.getUntrackedParameter("monitorGE0"); - const edm::ParameterSet&& muon_service_parameter = pset.getParameter("ServiceParameters"); + const edm::ParameterSet muon_service_parameter = pset.getParameter("ServiceParameters"); muon_service_ = new MuonServiceProxy(muon_service_parameter, consumesCollector()); const double eps = std::numeric_limits::epsilon(); @@ -70,6 +73,9 @@ void GEMEfficiencyAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& des desc.addUntracked("etaNbins", 9); desc.addUntracked("etaLow", 1.4); desc.addUntracked("etaUp", 2.3); + desc.addUntracked("monitorGE11", true); + desc.addUntracked("monitorGE21", false); + desc.addUntracked("monitorGE0", false); { edm::ParameterSetDescription psd0; psd0.setAllowAnything(); @@ -77,34 +83,6 @@ void GEMEfficiencyAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& des } descriptions.add("gemEfficiencyAnalyzerDefault", desc); } // beam scenario - - // cosmic scenario - { - edm::ParameterSetDescription desc; - desc.addUntracked("name", "GlobalMuon"); // FIXME - desc.addUntracked("folder", "GEM/Efficiency/type0"); - desc.add("recHitTag", edm::InputTag("gemRecHits")); - desc.add("muonTag", edm::InputTag("muons")); - desc.addUntracked("isCosmics", true); - desc.addUntracked("useGlobalMuon", false); - desc.add("useSkipLayer", true); - desc.add("useOnlyME11", true); - desc.add("residualRPhiCut", 5.0); // TODO need to be tuned - desc.add("usePropRErrorCut", true); - desc.add("propRErrorCut", 1.0); - desc.add("usePropPhiErrorCut", true); - desc.add("propPhiErrorCut", 0.001); - desc.addUntracked >("ptBins", {0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 120.}); - desc.addUntracked("etaNbins", 9); - desc.addUntracked("etaLow", 1.4); - desc.addUntracked("etaUp", 2.3); - { - edm::ParameterSetDescription psd0; - psd0.setAllowAnything(); - desc.add("ServiceParameters", psd0); - } - descriptions.add("gemEfficiencyAnalyzerCosmicsDefault", desc); - } // cosmics } void GEMEfficiencyAnalyzer::bookHistograms(DQMStore::IBooker& ibooker, @@ -152,11 +130,15 @@ void GEMEfficiencyAnalyzer::bookEfficiencyMomentum(DQMStore::IBooker& ibooker, c const int region_id = station->region(); const int station_id = station->station(); - const GEMDetId&& key = getReStKey(region_id, station_id); - const TString&& name_suffix = GEMUtils::getSuffixName(region_id, station_id); - const TString&& title_suffix = GEMUtils::getSuffixTitle(region_id, station_id); + if (skipGEMStation(station_id)) { + continue; + } + + const GEMDetId key = getReStKey(region_id, station_id); + const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id); + const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id); - const TString&& title = name_.c_str() + title_suffix; + const TString title = name_.c_str() + title_suffix; TH1F* h_muon_pt = new TH1F("muon_pt" + name_suffix, title, pt_nbinsx, &pt_bins_[0]); h_muon_pt->SetXTitle(pt_x_title); @@ -181,7 +163,11 @@ void GEMEfficiencyAnalyzer::bookEfficiencyChamber(DQMStore::IBooker& ibooker, co const int region_id = station->region(); const int station_id = station->station(); - const std::vector&& superchambers = station->superChambers(); + if (skipGEMStation(station_id)) { + continue; + } + + const std::vector superchambers = station->superChambers(); if (not checkRefs(superchambers)) { edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl; return; @@ -191,9 +177,9 @@ void GEMEfficiencyAnalyzer::bookEfficiencyChamber(DQMStore::IBooker& ibooker, co for (const GEMChamber* chamber : superchambers[0]->chambers()) { const int layer_id = chamber->id().layer(); - const TString&& name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id); - const TString&& title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id); - const GEMDetId&& key = getReStLaKey(chamber->id()); + const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id); + const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id); + const GEMDetId key = getReStLaKey(chamber->id()); me_chamber_[key] = ibooker.book1D("chamber" + name_suffix, name_.c_str() + title_suffix, num_chambers, 0.5, num_chambers + 0.5); @@ -217,7 +203,11 @@ void GEMEfficiencyAnalyzer::bookEfficiencyEtaPartition(DQMStore::IBooker& ibooke const int region_id = station->region(); const int station_id = station->station(); - const std::vector&& superchambers = station->superChambers(); + if (skipGEMStation(station_id)) { + continue; + } + + const std::vector superchambers = station->superChambers(); if (not checkRefs(superchambers)) { edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl; return; @@ -227,9 +217,9 @@ void GEMEfficiencyAnalyzer::bookEfficiencyEtaPartition(DQMStore::IBooker& ibooke const int layer_id = chamber->id().layer(); const int num_ieta = chamber->nEtaPartitions(); - const TString&& name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id); - const TString&& title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id); - const GEMDetId&& key = getReStLaKey(chamber->id()); + const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id); + const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id); + const GEMDetId key = getReStLaKey(chamber->id()); me_ieta_[key] = ibooker.book1D("ieta" + name_suffix, name_.c_str() + title_suffix, num_ieta, 0.5, num_ieta + 0.5); me_ieta_[key]->setAxisTitle("i#eta"); @@ -251,7 +241,11 @@ void GEMEfficiencyAnalyzer::bookEfficiencyDetector(DQMStore::IBooker& ibooker, c const int region_id = station->region(); const int station_id = station->station(); - const std::vector&& superchambers = station->superChambers(); + if (skipGEMStation(station_id)) { + continue; + } + + const std::vector superchambers = station->superChambers(); if (not checkRefs(superchambers)) { edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl; return; @@ -263,9 +257,9 @@ void GEMEfficiencyAnalyzer::bookEfficiencyDetector(DQMStore::IBooker& ibooker, c const int layer_id = chamber->id().layer(); const int num_ieta = chamber->nEtaPartitions(); - const TString&& name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id); - const TString&& title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id); - const GEMDetId&& key = getReStLaKey(chamber->id()); + const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id); + const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id); + const GEMDetId key = getReStLaKey(chamber->id()); me_detector_[key] = ibooker.book2D("detector" + name_suffix, name_.c_str() + title_suffix, @@ -288,13 +282,17 @@ void GEMEfficiencyAnalyzer::bookResolution(DQMStore::IBooker& ibooker, const edm const int region_id = station->region(); const int station_id = station->station(); - const std::vector&& superchambers = station->superChambers(); + if (skipGEMStation(station_id)) { + continue; + } + + const std::vector superchambers = station->superChambers(); if (not checkRefs(superchambers)) { edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl; return; } - const std::vector& chambers = superchambers[0]->chambers(); + const std::vector chambers = superchambers[0]->chambers(); if (not checkRefs(chambers)) { edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMChamber ptrs" << std::endl; return; @@ -303,10 +301,10 @@ void GEMEfficiencyAnalyzer::bookResolution(DQMStore::IBooker& ibooker, const edm for (const GEMEtaPartition* eta_partition : chambers[0]->etaPartitions()) { const int ieta = eta_partition->id().roll(); - const GEMDetId&& key = getReStEtKey(eta_partition->id()); + const GEMDetId key = getReStEtKey(eta_partition->id()); // TODO - const TString&& name_suffix = TString::Format("_GE%+.2d_R%d", region_id * (station_id * 10 + 1), ieta); - const TString&& title = + const TString name_suffix = TString::Format("_GE%+.2d_R%d", region_id * (station_id * 10 + 1), ieta); + const TString title = name_.c_str() + TString::Format(" : GE%+.2d Roll %d", region_id * (station_id * 10 + 1), ieta); me_residual_rphi_[key] = @@ -333,7 +331,11 @@ void GEMEfficiencyAnalyzer::bookMisc(DQMStore::IBooker& ibooker, const edm::ESHa const int region_id = station->region(); const int station_id = station->station(); - const std::vector&& superchambers = station->superChambers(); + if (skipGEMStation(station_id)) { + continue; + } + + const std::vector superchambers = station->superChambers(); if (not checkRefs(superchambers)) { edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl; return; @@ -341,9 +343,9 @@ void GEMEfficiencyAnalyzer::bookMisc(DQMStore::IBooker& ibooker, const edm::ESHa // ignore layer ids const int num_ch = superchambers.size(); - const GEMDetId&& key = getReStKey(region_id, station_id); - const TString&& name_suffix = GEMUtils::getSuffixName(region_id, station_id); - const TString&& title_suffix = GEMUtils::getSuffixTitle(region_id, station_id); + const GEMDetId key = getReStKey(region_id, station_id); + const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id); + const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id); me_prop_chamber_[key] = ibooker.book1D("prop_chamber" + name_suffix, title_suffix, num_ch, 0.5, num_ch + 0.5); me_prop_chamber_[key]->setAxisTitle("Destination Chamber Id", 1); me_prop_chamber_[key]->setAxisTitle("Entries", 2); @@ -391,7 +393,7 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet } muon_service_->update(setup); - edm::ESHandle&& propagator = muon_service_->propagator("SteppingHelixPropagatorAny"); + edm::ESHandle propagator = muon_service_->propagator("SteppingHelixPropagatorAny"); if (not propagator.isValid()) { edm::LogError(kLogCategory_) << "Propagator is invalid" << std::endl; return; @@ -407,7 +409,7 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet return; } - const std::vector&& layer_vector = buildGEMLayers(gem); + const std::vector layer_vector = buildGEMLayers(gem); for (const reco::Muon& muon : *muon_view) { const reco::Track* track = getTrack(muon); @@ -416,7 +418,7 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet continue; } - const reco::TransientTrack&& transient_track = transient_track_builder->build(track); + const reco::TransientTrack transient_track = transient_track_builder->build(track); if (not transient_track.isValid()) { edm::LogError(kLogCategory_) << "failed to build TransientTrack" << std::endl; continue; @@ -428,7 +430,7 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet continue; } - const auto&& [start_state, start_id] = getStartingState(transient_track, layer, global_tracking_geometry); + const auto [start_state, start_id] = getStartingState(transient_track, layer, global_tracking_geometry); if (not start_state.isValid()) { edm::LogInfo(kLogCategory_) << "failed to get a starting state" << std::endl; @@ -441,13 +443,13 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet } // the trajectory state on the destination surface - const TrajectoryStateOnSurface&& dest_state = propagator->propagate(start_state, *(layer.disk)); + const TrajectoryStateOnSurface dest_state = propagator->propagate(start_state, *(layer.disk)); if (not dest_state.isValid()) { edm::LogInfo(kLogCategory_) << "failed to propagate a muon" << std::endl; continue; } - const GlobalPoint&& dest_global_pos = dest_state.globalPosition(); + const GlobalPoint dest_global_pos = dest_state.globalPosition(); if (not checkBounds(dest_global_pos, (*layer.disk))) { edm::LogInfo(kLogCategory_) << "failed to pass checkBounds" << std::endl; @@ -460,19 +462,19 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet continue; } - const BoundPlane& surface = eta_partition->surface(); + const BoundPlane surface = eta_partition->surface(); - const LocalPoint&& dest_local_pos = eta_partition->toLocal(dest_global_pos); - const LocalError&& dest_local_err = dest_state.localError().positionError(); - const GlobalError& dest_global_err = ErrorFrameTransformer().transform(dest_local_err, surface); + const LocalPoint dest_local_pos = eta_partition->toLocal(dest_global_pos); + const LocalError dest_local_err = dest_state.localError().positionError(); + const GlobalError dest_global_err = ErrorFrameTransformer().transform(dest_local_err, surface); const double dest_global_r_err = std::sqrt(dest_global_err.rerr(dest_global_pos)); const double dest_global_phi_err = std::sqrt(dest_global_err.phierr(dest_global_pos)); - const GEMDetId&& gem_id = eta_partition->id(); - const GEMDetId&& rs_key = getReStKey(gem_id); - const GEMDetId&& rsl_key = getReStLaKey(gem_id); - const GEMDetId&& rse_key = getReStEtKey(gem_id); + const GEMDetId gem_id = eta_partition->id(); + const GEMDetId rs_key = getReStKey(gem_id); + const GEMDetId rsl_key = getReStLaKey(gem_id); + const GEMDetId rse_key = getReStEtKey(gem_id); const int chamber_id = gem_id.chamber(); const int ieta = gem_id.ieta(); @@ -503,7 +505,7 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet fillME(me_ieta_, rsl_key, ieta); fillME(me_detector_, rsl_key, chamber_id, ieta); - const auto&& [hit, residual_rphi] = findClosetHit(dest_global_pos, rechit_collection->get(gem_id), eta_partition); + const auto [hit, residual_rphi] = findClosetHit(dest_global_pos, rechit_collection->get(gem_id), eta_partition); if (hit == nullptr) { edm::LogInfo(kLogCategory_) << "failed to find a hit" << std::endl; @@ -524,8 +526,8 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet fillME(me_ieta_matched_, rsl_key, gem_id.ieta()); fillME(me_detector_matched_, rsl_key, gem_id.chamber(), ieta); - const LocalPoint&& hit_local_pos = hit->localPosition(); - const LocalError&& hit_local_err = hit->localPositionError(); + const LocalPoint hit_local_pos = hit->localPosition(); + const LocalError hit_local_err = hit->localPositionError(); const float residual_y = dest_local_pos.y() - hit_local_pos.y(); const float pull_y = residual_y / std::sqrt(dest_local_err.yy() + hit_local_err.yy()); @@ -537,6 +539,35 @@ void GEMEfficiencyAnalyzer::analyze(const edm::Event& event, const edm::EventSet } // Muon } +bool GEMEfficiencyAnalyzer::skipGEMStation(const int station) { + bool skip = false; + + if (station == 1) { + if (not monitor_ge11_) { + LogDebug(kLogCategory_) << "skip GE11 because monitorGE11 is " << std::boolalpha << monitor_ge11_; + skip = true; + } + + } else if (station == 2) { + if (not monitor_ge21_) { + LogDebug(kLogCategory_) << "skip GE21 because monitorGE21 is " << std::boolalpha << monitor_ge21_; + skip = true; + } + + } else if (station == 0) { + if (not monitor_ge0_) { + LogDebug(kLogCategory_) << "skip GE0 because monitorGE0 is " << std::boolalpha << monitor_ge0_; + skip = true; + } + + } else { + edm::LogError(kLogCategory_) << "got an unexpected GEM station " << station << ". skip this station."; + skip = true; + } + + return skip; +} + std::vector GEMEfficiencyAnalyzer::buildGEMLayers( const edm::ESHandle& gem) { std::vector layer_vector; @@ -546,6 +577,10 @@ std::vector GEMEfficiencyAnalyzer::buildGEM const int station_id = station->station(); const bool is_ge11 = station_id == 1; + if (skipGEMStation(station_id)) { + continue; + } + // (layer_id, is_odd) - chambers std::map, std::vector > chambers_per_layer; @@ -581,7 +616,7 @@ std::vector GEMEfficiencyAnalyzer::buildGEM // the bounds from min and max R and Z in the local coordinates. SimpleDiskBounds* bounds = new SimpleDiskBounds(rmin, rmax, zmin, zmax); - const Disk::DiskPointer&& layer = Disk::build(position, rotation, bounds); + const Disk::DiskPointer layer = Disk::build(position, rotation, bounds); layer_vector.emplace_back(layer, chamber_vector, region_id, station_id, layer_id); } // layer @@ -651,14 +686,14 @@ std::pair GEMEfficiencyAnalyzer::findStartingSt // TODO optimize this loop because hits should be ordered.. for (auto rechit = transient_track.recHitsBegin(); rechit != transient_track.recHitsEnd(); rechit++) { - const DetId&& det_id = (*rechit)->geographicalId(); + const DetId det_id = (*rechit)->geographicalId(); if (MuonHitHelper::isGEM(det_id.rawId())) { continue; } const GeomDet* det = geometry->idToDet(det_id); - const GlobalPoint&& global_position = det->toGlobal((*rechit)->localPosition()); + const GlobalPoint global_position = det->toGlobal((*rechit)->localPosition()); const float distance = std::abs(layer.disk->localZclamped(global_position)); if (distance < min_distance) { found = true; @@ -704,7 +739,7 @@ bool GEMEfficiencyAnalyzer::skipLayer(const reco::Track* track, const GEMLayerDa } bool GEMEfficiencyAnalyzer::checkBounds(const GlobalPoint& global_point, const Plane& plane) { - const LocalPoint&& local_point = plane.toLocal(global_point); + const LocalPoint local_point = plane.toLocal(global_point); const LocalPoint local_point_2d(local_point.x(), local_point.y(), 0.0f); return plane.bounds().inside(local_point_2d); } @@ -731,7 +766,7 @@ std::pair GEMEfficiencyAnalyzer::findClosetHit(const Gl const GEMRecHitCollection::range& range, const GEMEtaPartition* eta_partition) { const StripTopology& topology = eta_partition->specificTopology(); - const LocalPoint&& dest_local_pos = eta_partition->toLocal(dest_global_pos); + const LocalPoint dest_local_pos = eta_partition->toLocal(dest_global_pos); const float dest_local_x = dest_local_pos.x(); const float dest_local_y = dest_local_pos.y(); @@ -739,7 +774,7 @@ std::pair GEMEfficiencyAnalyzer::findClosetHit(const Gl float min_residual_rphi = 1e6; for (auto hit = range.first; hit != range.second; ++hit) { - const LocalPoint&& hit_local_pos = hit->localPosition(); + const LocalPoint hit_local_pos = hit->localPosition(); const float hit_local_phi = topology.stripAngle(eta_partition->strip(hit_local_pos)); const float residual_x = dest_local_x - hit_local_pos.x(); diff --git a/DQM/GEM/plugins/GEMEfficiencyAnalyzer.h b/DQM/GEM/plugins/GEMEfficiencyAnalyzer.h index 6be44cb3f84d0..d0ed5e397aa01 100644 --- a/DQM/GEM/plugins/GEMEfficiencyAnalyzer.h +++ b/DQM/GEM/plugins/GEMEfficiencyAnalyzer.h @@ -61,6 +61,7 @@ class GEMEfficiencyAnalyzer : public GEMOfflineDQMBase { inline bool isInsideOut(const reco::Track &); + bool skipGEMStation(const int); std::vector buildGEMLayers(const edm::ESHandle &); const reco::Track *getTrack(const reco::Muon &); std::pair getStartingState(const reco::TransientTrack &, @@ -97,6 +98,9 @@ class GEMEfficiencyAnalyzer : public GEMOfflineDQMBase { int eta_nbins_; double eta_low_; double eta_up_; + bool monitor_ge11_; + bool monitor_ge21_; + bool monitor_ge0_; // data mebers derived from parameters MuonServiceProxy *muon_service_; diff --git a/DQM/GEM/plugins/GEMEfficiencyHarvester.cc b/DQM/GEM/plugins/GEMEfficiencyHarvester.cc index c744ccc2b58b6..03c962905448d 100644 --- a/DQM/GEM/plugins/GEMEfficiencyHarvester.cc +++ b/DQM/GEM/plugins/GEMEfficiencyHarvester.cc @@ -15,7 +15,7 @@ GEMEfficiencyHarvester::~GEMEfficiencyHarvester() {} void GEMEfficiencyHarvester::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.addUntracked("folder", "GEM/Efficiency/type0"); - descriptions.add("gemEfficiencyHarvesterDefault", desc); + descriptions.add("gemEfficiencyHarvester", desc); } TProfile* GEMEfficiencyHarvester::computeEfficiency( @@ -122,7 +122,7 @@ void GEMEfficiencyHarvester::doEfficiency(DQMStore::IBooker& ibooker, DQMStore:: me_pairs[key].second = me; } - for (auto&& [key, value] : me_pairs) { + for (const auto& [key, value] : me_pairs) { const auto& [me_passed, me_total] = value; if (me_passed == nullptr) { edm::LogError(log_category_) << "numerator is missing. " << key << std::endl; @@ -218,7 +218,7 @@ std::tuple GEMEfficiencyHarvester::parseResidualName(cons name.erase(name.find("_GE"), 3); // -11_R4 -> (-11, R4) - const std::vector&& tokens = splitString(name, "_"); + const std::vector tokens = splitString(name, "_"); const size_t num_tokens = tokens.size(); if (num_tokens != 2) { @@ -271,7 +271,7 @@ void GEMEfficiencyHarvester::doResolution(DQMStore::IBooker& ibooker, continue; } - auto&& [region_sign, station, ieta] = parseResidualName(name, prefix); + const auto [region_sign, station, ieta] = parseResidualName(name, prefix); if (region_sign.empty() or station < 0 or ieta < 0) { edm::LogError(log_category_) << "failed to parse the name of the residual histogram: " << name << std::endl; continue; @@ -374,7 +374,7 @@ void GEMEfficiencyHarvester::doResolution(DQMStore::IBooker& ibooker, h_skewness->SetBinError(xbin, ybin, hist->GetSkewness(11)); } - for (auto&& each : {h_mean, h_stddev, h_skewness}) { + for (auto& each : {h_mean, h_stddev, h_skewness}) { ibooker.book2D(each->GetName(), each); } } diff --git a/DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cff.py b/DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cff.py new file mode 100644 index 0000000000000..6d1f6ddbb8852 --- /dev/null +++ b/DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cff.py @@ -0,0 +1,18 @@ +import FWCore.ParameterSet.Config as cms +from DQM.GEM.gemEfficiencyAnalyzer_cfi import * + +gemEfficiencyAnalyzerCosmics = gemEfficiencyAnalyzer.clone( + isCosmics = True, +) + +gemEfficiencyAnalyzerCosmicsTwoLeg = gemEfficiencyAnalyzerCosmics.clone( + muonTag = 'muons', + name = 'Cosmic 2-Leg STA Muon', + folder = 'GEM/Efficiency/type1' +) + +gemEfficiencyAnalyzerCosmicsOneLeg = gemEfficiencyAnalyzerCosmics.clone( + muonTag = 'muons1Leg', + name = 'Cosmic 1-Leg STA Muon', + folder = 'GEM/Efficiency/type2' +) diff --git a/DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cfi.py b/DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cfi.py deleted file mode 100644 index 87be5adb07098..0000000000000 --- a/DQM/GEM/python/gemEfficiencyAnalyzerCosmics_cfi.py +++ /dev/null @@ -1,28 +0,0 @@ -import FWCore.ParameterSet.Config as cms -from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer -from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy -from DQM.GEM.gemEfficiencyAnalyzerCosmicsDefault_cfi import gemEfficiencyAnalyzerCosmicsDefault as _gemEfficiencyAnalyzerCosmicsDefault -from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import * - -gemEfficiencyAnalyzerCosmics = _gemEfficiencyAnalyzerCosmicsDefault.clone( - ServiceParameters = MuonServiceProxy.ServiceParameters.clone(), - muonTag = 'muons', - name = 'Cosmic 2-Leg STA Muon', - folder = 'GEM/Efficiency/type1' -) - -gemEfficiencyAnalyzerCosmicsOneLeg = _gemEfficiencyAnalyzerCosmicsDefault.clone( - ServiceParameters = MuonServiceProxy.ServiceParameters.clone(), - muonTag = 'muons1Leg', - name = 'Cosmic 1-Leg STA Muon', - folder = 'GEM/Efficiency/type2' -) - -from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM -phase2_GEM.toModify(gemEfficiencyAnalyzerCosmics, - etaNbins=cms.untracked.int32(15), - etaUp=cms.untracked.double(3.0)) - -phase2_GEM.toModify(gemEfficiencyAnalyzerCosmicsOneLeg, - etaNbins=cms.untracked.int32(15), - etaUp=cms.untracked.double(3.0)) diff --git a/DQM/GEM/python/gemEfficiencyAnalyzer_cff.py b/DQM/GEM/python/gemEfficiencyAnalyzer_cff.py new file mode 100644 index 0000000000000..89a0f1f5d2b4f --- /dev/null +++ b/DQM/GEM/python/gemEfficiencyAnalyzer_cff.py @@ -0,0 +1,45 @@ +import FWCore.ParameterSet.Config as cms +from DQM.GEM.gemEfficiencyAnalyzer_cfi import * + +gemOfflineDQMTightGlbMuons = cms.EDFilter("MuonSelector", + src = cms.InputTag('muons'), + cut = cms.string( + '(pt > 20)' + '&& isGlobalMuon' + '&& globalTrack.isNonnull' + '&& passed(\'CutBasedIdTight\')' + ), + filter = cms.bool(False) +) + +gemOfflineDQMStaMuons = cms.EDFilter("MuonSelector", + src = cms.InputTag('muons'), + cut = cms.string( + '(pt > 20)' + '&& isStandAloneMuon' + '&& outerTrack.isNonnull' + ), + filter = cms.bool(False) +) + +gemEfficiencyAnalyzerTightGlb = gemEfficiencyAnalyzer.clone( + folder = 'GEM/Efficiency/type1', + muonTag = 'gemOfflineDQMTightGlbMuons', + name = 'Tight GLB Muon', + useGlobalMuon = True +) + +gemEfficiencyAnalyzerSta = gemEfficiencyAnalyzer.clone( + muonTag = "gemOfflineDQMStaMuons", + folder = 'GEM/Efficiency/type2', + name = 'STA Muon', + useGlobalMuon = False +) + +gemEfficiencyAnalyzerTightGlbSeq = cms.Sequence( + cms.ignore(gemOfflineDQMTightGlbMuons) * + gemEfficiencyAnalyzerTightGlb) + +gemEfficiencyAnalyzerStaSeq = cms.Sequence( + cms.ignore(gemOfflineDQMStaMuons) * + gemEfficiencyAnalyzerSta) diff --git a/DQM/GEM/python/gemEfficiencyAnalyzer_cfi.py b/DQM/GEM/python/gemEfficiencyAnalyzer_cfi.py index 0e278ebb820ad..0b3a01d41783a 100644 --- a/DQM/GEM/python/gemEfficiencyAnalyzer_cfi.py +++ b/DQM/GEM/python/gemEfficiencyAnalyzer_cfi.py @@ -1,61 +1,16 @@ import FWCore.ParameterSet.Config as cms -from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer -from RecoMuon.TrackingTools.MuonServiceProxy_cff import MuonServiceProxy from DQM.GEM.gemEfficiencyAnalyzerDefault_cfi import gemEfficiencyAnalyzerDefault as _gemEfficiencyAnalyzerDefault +from RecoMuon.TrackingTools.MuonServiceProxy_cff import * from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import * -gemOfflineDQMTightGlbMuons = cms.EDFilter("MuonSelector", - src = cms.InputTag('muons'), - cut = cms.string( - '(pt > 20)' - '&& isGlobalMuon' - '&& globalTrack.isNonnull' - '&& passed(\'CutBasedIdTight\')' - ), - filter = cms.bool(False) -) - -gemOfflineDQMStaMuons = cms.EDFilter("MuonSelector", - src = cms.InputTag('muons'), - cut = cms.string( - '(pt > 20)' - '&& isStandAloneMuon' - '&& outerTrack.isNonnull' - ), - filter = cms.bool(False) -) - -gemEfficiencyAnalyzerTightGlb = _gemEfficiencyAnalyzerDefault.clone( +gemEfficiencyAnalyzer = _gemEfficiencyAnalyzerDefault.clone( ServiceParameters = MuonServiceProxy.ServiceParameters.clone(), - folder = 'GEM/Efficiency/type1', - muonTag = 'gemOfflineDQMTightGlbMuons', - name = 'Tight GLB Muon', - useGlobalMuon = True -) - -gemEfficiencyAnalyzerSta = _gemEfficiencyAnalyzerDefault.clone( - ServiceParameters = MuonServiceProxy.ServiceParameters.clone(), - muonTag = "gemOfflineDQMStaMuons", - folder = 'GEM/Efficiency/type2', - name = 'STA Muon', - useGlobalMuon = False ) from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM -phase2_GEM.toModify( - gemEfficiencyAnalyzerTightGlb, - etaNbins=cms.untracked.int32(15), - etaUp=cms.untracked.double(3.0)) - -phase2_GEM.toModify( - gemEfficiencyAnalyzerSta, - etaNbins=cms.untracked.int32(15), - etaUp=cms.untracked.double(3.0)) - -gemEfficiencyAnalyzerTightGlbSeq = cms.Sequence( - cms.ignore(gemOfflineDQMTightGlbMuons) * - gemEfficiencyAnalyzerTightGlb) - -gemEfficiencyAnalyzerStaSeq = cms.Sequence( - cms.ignore(gemOfflineDQMStaMuons) * - gemEfficiencyAnalyzerSta) +phase2_GEM.toModify(gemEfficiencyAnalyzer, + monitorGE21 = True, + monitorGE0 = True, + etaNbins = 15, + etaUp = 3.0, +) diff --git a/DQM/GEM/python/gemEfficiencyHarvesterCosmics_cff.py b/DQM/GEM/python/gemEfficiencyHarvesterCosmics_cff.py new file mode 100644 index 0000000000000..dbb6f2a814cc5 --- /dev/null +++ b/DQM/GEM/python/gemEfficiencyHarvesterCosmics_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +from DQM.GEM.gemEfficiencyHarvester_cfi import gemEfficiencyHarvester +from DQM.GEM.gemEfficiencyAnalyzerCosmics_cff import gemEfficiencyAnalyzerCosmicsTwoLeg as _gemEfficiencyAnalyzerCosmicsTwoLeg +from DQM.GEM.gemEfficiencyAnalyzerCosmics_cff import gemEfficiencyAnalyzerCosmicsOneLeg as _gemEfficiencyAnalyzerCosmicsOneLeg + +gemEfficiencyHarvesterCosmicsTwoLeg = gemEfficiencyHarvester.clone( + folder = _gemEfficiencyAnalyzerCosmicsTwoLeg.folder.value() +) + +gemEfficiencyHarvesterCosmicsOneLeg = gemEfficiencyHarvester.clone( + folder = _gemEfficiencyAnalyzerCosmicsOneLeg.folder.value() +) diff --git a/DQM/GEM/python/gemEfficiencyHarvesterCosmics_cfi.py b/DQM/GEM/python/gemEfficiencyHarvesterCosmics_cfi.py deleted file mode 100644 index a25ca4be347b7..0000000000000 --- a/DQM/GEM/python/gemEfficiencyHarvesterCosmics_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from DQMServices.Core.DQMEDHarvester import DQMEDHarvester -from DQM.GEM.gemEfficiencyHarvesterDefault_cfi import gemEfficiencyHarvesterDefault as _gemEfficiencyHarvesterDefault -from DQM.GEM.gemEfficiencyAnalyzerCosmics_cfi import gemEfficiencyAnalyzerCosmics as _gemEfficiencyAnalyzerCosmics -from DQM.GEM.gemEfficiencyAnalyzerCosmics_cfi import gemEfficiencyAnalyzerCosmicsOneLeg as _gemEfficiencyAnalyzerCosmicsOneLeg - -gemEfficiencyHarvesterCosmics = _gemEfficiencyHarvesterDefault.clone( - folder = _gemEfficiencyAnalyzerCosmics.folder.value() -) - -gemEfficiencyHarvesterCosmicsOneLeg = _gemEfficiencyHarvesterDefault.clone( - folder = _gemEfficiencyAnalyzerCosmicsOneLeg.folder.value() -) diff --git a/DQM/GEM/python/gemEfficiencyHarvester_cff.py b/DQM/GEM/python/gemEfficiencyHarvester_cff.py new file mode 100644 index 0000000000000..4cc87719af45c --- /dev/null +++ b/DQM/GEM/python/gemEfficiencyHarvester_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +from DQM.GEM.gemEfficiencyHarvester_cfi import gemEfficiencyHarvester +from DQM.GEM.gemEfficiencyAnalyzer_cff import gemEfficiencyAnalyzerTightGlb as _gemEfficiencyAnalyzerTightGlb +from DQM.GEM.gemEfficiencyAnalyzer_cff import gemEfficiencyAnalyzerSta as _gemEfficiencyAnalyzerSta + +gemEfficiencyHarvesterTightGlb = gemEfficiencyHarvester.clone( + folder = _gemEfficiencyAnalyzerTightGlb.folder.value() +) + +gemEfficiencyHarvesterSta = gemEfficiencyHarvester.clone( + folder = _gemEfficiencyAnalyzerSta.folder.value() +) diff --git a/DQM/GEM/python/gemEfficiencyHarvester_cfi.py b/DQM/GEM/python/gemEfficiencyHarvester_cfi.py deleted file mode 100644 index 5da24edbb52d1..0000000000000 --- a/DQM/GEM/python/gemEfficiencyHarvester_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from DQMServices.Core.DQMEDHarvester import DQMEDHarvester -from DQM.GEM.gemEfficiencyHarvesterDefault_cfi import gemEfficiencyHarvesterDefault as _gemEfficiencyHarvesterDefault -from DQM.GEM.gemEfficiencyAnalyzer_cfi import gemEfficiencyAnalyzerTightGlb as _gemEfficiencyAnalyzerTightGlb -from DQM.GEM.gemEfficiencyAnalyzer_cfi import gemEfficiencyAnalyzerSta as _gemEfficiencyAnalyzerSta - -gemEfficiencyHarvesterTightGlb = _gemEfficiencyHarvesterDefault.clone( - folder = _gemEfficiencyAnalyzerTightGlb.folder.value() -) - -gemEfficiencyHarvesterSta = _gemEfficiencyHarvesterDefault.clone( - folder = _gemEfficiencyAnalyzerSta.folder.value() -) diff --git a/DQM/GEM/python/gem_dqm_offline_client_cff.py b/DQM/GEM/python/gem_dqm_offline_client_cff.py index bca5ec80229d9..03eb7daae33a5 100644 --- a/DQM/GEM/python/gem_dqm_offline_client_cff.py +++ b/DQM/GEM/python/gem_dqm_offline_client_cff.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms from DQM.GEM.GEMDQMHarvester_cfi import * -from DQM.GEM.gemEfficiencyHarvester_cfi import * +from DQM.GEM.gemEfficiencyHarvester_cff import * gemClients = cms.Sequence( GEMDQMHarvester * diff --git a/DQM/GEM/python/gem_dqm_offline_client_cosmics_cff.py b/DQM/GEM/python/gem_dqm_offline_client_cosmics_cff.py index 5e4426fb08f7a..9471115511e06 100644 --- a/DQM/GEM/python/gem_dqm_offline_client_cosmics_cff.py +++ b/DQM/GEM/python/gem_dqm_offline_client_cosmics_cff.py @@ -1,10 +1,10 @@ import FWCore.ParameterSet.Config as cms from DQM.GEM.GEMDQMHarvester_cfi import * -from DQM.GEM.gemEfficiencyHarvesterCosmics_cfi import * +from DQM.GEM.gemEfficiencyHarvesterCosmics_cff import * gemClientsCosmics = cms.Sequence( GEMDQMHarvester * - gemEfficiencyHarvesterCosmics * + gemEfficiencyHarvesterCosmicsTwoLeg * gemEfficiencyHarvesterCosmicsOneLeg ) diff --git a/DQM/GEM/python/gem_dqm_offline_source_cff.py b/DQM/GEM/python/gem_dqm_offline_source_cff.py index 67a49a5f03a81..1267e6b16637a 100644 --- a/DQM/GEM/python/gem_dqm_offline_source_cff.py +++ b/DQM/GEM/python/gem_dqm_offline_source_cff.py @@ -2,7 +2,7 @@ from DQM.GEM.GEMDigiSource_cfi import * from DQM.GEM.GEMRecHitSource_cfi import * -from DQM.GEM.gemEfficiencyAnalyzer_cfi import * +from DQM.GEM.gemEfficiencyAnalyzer_cff import * GEMDigiSource.modeRelVal = True GEMRecHitSource.modeRelVal = True diff --git a/DQM/GEM/python/gem_dqm_offline_source_cosmics_cff.py b/DQM/GEM/python/gem_dqm_offline_source_cosmics_cff.py index bd7fceabcf71f..558519a32f2b8 100644 --- a/DQM/GEM/python/gem_dqm_offline_source_cosmics_cff.py +++ b/DQM/GEM/python/gem_dqm_offline_source_cosmics_cff.py @@ -2,7 +2,7 @@ from DQM.GEM.GEMDigiSource_cfi import * from DQM.GEM.GEMRecHitSource_cfi import * -from DQM.GEM.gemEfficiencyAnalyzerCosmics_cfi import * +from DQM.GEM.gemEfficiencyAnalyzerCosmics_cff import * GEMDigiSource.modeRelVal = True GEMRecHitSource.modeRelVal = True @@ -10,6 +10,6 @@ gemSourcesCosmics = cms.Sequence( GEMDigiSource * GEMRecHitSource * - gemEfficiencyAnalyzerCosmics * + gemEfficiencyAnalyzerCosmicsTwoLeg * gemEfficiencyAnalyzerCosmicsOneLeg )