Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-15 22:40:57

0001 #include "Validation/MuonGEMRecHits/plugins/MuonGEMRecHitsHarvestor.h"
0002 #include "Validation/MuonGEMHits/interface/GEMValidationUtils.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 
0006 MuonGEMRecHitsHarvestor::MuonGEMRecHitsHarvestor(const edm::ParameterSet& pset)
0007     : MuonGEMBaseHarvestor(pset, "MuonGEMRecHitsHarvestor") {
0008   region_ids_ = pset.getUntrackedParameter<std::vector<Int_t> >("regionIds");
0009   station_ids_ = pset.getUntrackedParameter<std::vector<Int_t> >("stationIds");
0010   layer_ids_ = pset.getUntrackedParameter<std::vector<Int_t> >("layerIds");
0011 
0012   detail_plot_ = pset.getParameter<Bool_t>("detailPlot");
0013 }
0014 
0015 MuonGEMRecHitsHarvestor::~MuonGEMRecHitsHarvestor() {}
0016 
0017 void MuonGEMRecHitsHarvestor::dqmEndJob(DQMStore::IBooker& booker, DQMStore::IGetter& getter) {
0018   TString simhit_occ_folder = "GEM/SimHits/";
0019   TString occ_folder = "GEM/RecHits/";
0020   TString eff_folder = "GEM/RecHits/";
0021 
0022   for (const auto& region_id : region_ids_) {
0023     for (const auto& station_id : station_ids_) {
0024       TString name_suf_re_st = GEMUtils::getSuffixName(region_id, station_id);
0025       TString title_suf_re_st = GEMUtils::getSuffixTitle(region_id, station_id);
0026 
0027       if (detail_plot_) {
0028         // NOTE Detector Component
0029         TString rechit_det_path = occ_folder + "sim_matched_occ_det" + name_suf_re_st;
0030         TString simhit_det_path = simhit_occ_folder + "sim_muon_occ_det" + name_suf_re_st;
0031 
0032         TString eff_det_name = "eff_det" + name_suf_re_st;
0033         TString eff_det_title = "Detector Component Efficiency :" + title_suf_re_st;
0034 
0035         bookEff2D(booker, getter, rechit_det_path, simhit_det_path, eff_folder, eff_det_name, eff_det_title);
0036       }
0037       for (const auto& layer_id : layer_ids_) {
0038         if (station_id != 0 and layer_id > 2)
0039           continue;
0040         TString name_suf_re_st_ly = GEMUtils::getSuffixName(region_id, station_id, layer_id);
0041         TString title_suf_re_st_ly = GEMUtils::getSuffixTitle(region_id, station_id, layer_id);
0042 
0043         // NOTE Eta
0044         TString rechit_eta_path = occ_folder + "sim_matched_occ_eta" + name_suf_re_st_ly;
0045         TString simhit_eta_path = simhit_occ_folder + "sim_muon_occ_eta" + name_suf_re_st_ly;
0046 
0047         TString eff_eta_name = "eff_eta" + name_suf_re_st_ly;
0048         TString eff_eta_title = "Eta Efficiency :" + title_suf_re_st_ly;
0049 
0050         bookEff1D(booker, getter, rechit_eta_path, simhit_eta_path, eff_folder, eff_eta_name, eff_eta_title);
0051 
0052         // NOTE Phi
0053         TString rechit_phi_path = occ_folder + "sim_matched_occ_phi" + name_suf_re_st_ly;
0054         TString simhit_phi_path = simhit_occ_folder + "sim_muon_occ_phi" + name_suf_re_st_ly;
0055 
0056         TString eff_phi_name = "eff_phi" + name_suf_re_st_ly;
0057         TString eff_phi_title = "Phi Efficiency :" + title_suf_re_st_ly;
0058 
0059         bookEff1D(booker, getter, rechit_phi_path, simhit_phi_path, eff_folder, eff_phi_name, eff_phi_title);
0060       }  // layer loop
0061     }    // station loop
0062   }      // region loop
0063 }