Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0002 #include "Validation/MuonGEMDigis/plugins/MuonGEMDigisHarvestor.h"
0003 
0004 MuonGEMDigisHarvestor::MuonGEMDigisHarvestor(const edm::ParameterSet& pset)
0005     : MuonGEMBaseHarvestor(pset, "MuonGEMDigisHarvestor") {
0006   // to make it compatible to both full geometry and slice test
0007   region_ids_ = pset.getUntrackedParameter<std::vector<Int_t> >("regionIds");
0008   station_ids_ = pset.getUntrackedParameter<std::vector<Int_t> >("stationIds");
0009   layer_ids_ = pset.getUntrackedParameter<std::vector<Int_t> >("layerIds");
0010 
0011   detail_plot_ = pset.getParameter<Bool_t>("detailPlot");
0012 }
0013 
0014 MuonGEMDigisHarvestor::~MuonGEMDigisHarvestor() {}
0015 
0016 void MuonGEMDigisHarvestor::dqmEndJob(DQMStore::IBooker& booker, DQMStore::IGetter& getter) {
0017   TString simhit_occ_folder = "GEM/SimHits/";
0018   TString occ_folder = "GEM/Digis/";
0019   TString eff_folder = "GEM/Digis/";
0020   TString occ_folder_pad = "GEM/Pad/";
0021   TString eff_folder_pad = "GEM/Pad/";
0022   TString occ_folder_cluster = "GEM/PadCluster/";
0023   TString eff_folder_cluster = "GEM/PadCluster/";
0024 
0025   for (Int_t region_id : region_ids_) {
0026     for (Int_t station_id : station_ids_) {
0027       TString name_suffix_re_st = GEMUtils::getSuffixName(region_id, station_id);
0028       TString title_suffix_re_st = GEMUtils::getSuffixTitle(region_id, station_id);
0029 
0030       if (detail_plot_) {
0031         // NOTE Detector Component efficiency
0032         TString strip_det_name = "sim_matched_occ_det" + name_suffix_re_st;
0033         TString pad_det_name = "sim_matched_occ_det" + name_suffix_re_st;
0034         TString simhit_det_name = "sim_muon_occ_det" + name_suffix_re_st;
0035         TString strip_det_path = occ_folder + strip_det_name;
0036         TString pad_det_path = occ_folder_pad + pad_det_name;
0037         TString cluster_det_path = occ_folder_cluster + pad_det_name;
0038         TString simhit_det_path = simhit_occ_folder + simhit_det_name;
0039         TString eff_det_name = "eff_det" + name_suffix_re_st;
0040         TString eff_det_title = "Detector Component Efficiency (Muon Only) :" + title_suffix_re_st;
0041 
0042         bookEff2D(booker, getter, strip_det_path, simhit_det_path, eff_folder, eff_det_name, eff_det_title);
0043         bookEff2D(booker, getter, pad_det_path, simhit_det_path, eff_folder_pad, eff_det_name, eff_det_title);
0044         bookEff2D(booker, getter, cluster_det_path, simhit_det_path, eff_folder_cluster, eff_det_name, eff_det_title);
0045       }
0046 
0047       for (Int_t layer_id : layer_ids_) {
0048         if (station_id != 0 and layer_id > 2)
0049           continue;
0050         TString name_suffix_re_st_ly = GEMUtils::getSuffixName(region_id, station_id, layer_id);
0051         TString title_suffix_re_st_ly = GEMUtils::getSuffixTitle(region_id, station_id, layer_id);
0052 
0053         // NOTE eta efficiency
0054         TString strip_eta_name = "sim_matched_occ_eta" + name_suffix_re_st_ly;
0055         TString pad_eta_name = "sim_matched_occ_eta" + name_suffix_re_st_ly;
0056         TString simhit_eta_name = "sim_muon_occ_eta" + name_suffix_re_st_ly;
0057         TString strip_eta_path = occ_folder + strip_eta_name;
0058         TString pad_eta_path = occ_folder_pad + pad_eta_name;
0059         TString cluster_eta_path = occ_folder_cluster + pad_eta_name;
0060         TString simhit_eta_path = simhit_occ_folder + simhit_eta_name;
0061         TString eff_eta_name = "eff_eta" + name_suffix_re_st_ly;
0062         TString eff_eta_title = "Eta Efficiency (Muon Only) :" + title_suffix_re_st_ly;
0063 
0064         if (detail_plot_)
0065           bookEff1D(booker, getter, strip_eta_path, simhit_eta_path, eff_folder, eff_eta_name, eff_eta_title);
0066         bookEff1D(booker, getter, pad_eta_path, simhit_eta_path, eff_folder_pad, eff_eta_name, eff_eta_title);
0067         bookEff1D(booker, getter, cluster_eta_path, simhit_eta_path, eff_folder_cluster, eff_eta_name, eff_eta_title);
0068 
0069         // NOTE phi efficiency
0070         TString strip_phi_name = "sim_matched_occ_phi" + name_suffix_re_st_ly;
0071         TString pad_phi_name = "sim_matched_occ_phi" + name_suffix_re_st_ly;
0072         TString simhit_phi_name = "sim_muon_occ_phi" + name_suffix_re_st_ly;
0073         TString strip_phi_path = occ_folder + strip_phi_name;
0074         TString pad_phi_path = occ_folder_pad + pad_phi_name;
0075         TString cluster_phi_path = occ_folder_cluster + pad_phi_name;
0076         TString simhit_phi_path = simhit_occ_folder + simhit_phi_name;
0077         TString eff_phi_name = "eff_phi" + name_suffix_re_st_ly;
0078         TString eff_phi_title = "Phi Efficiency (Muon Only) :" + title_suffix_re_st_ly;
0079 
0080         if (detail_plot_)
0081           bookEff1D(booker, getter, strip_phi_path, simhit_phi_path, eff_folder, eff_phi_name, eff_phi_title);
0082         bookEff1D(booker, getter, pad_phi_path, simhit_phi_path, eff_folder_pad, eff_phi_name, eff_phi_title);
0083         bookEff1D(booker, getter, cluster_phi_path, simhit_phi_path, eff_folder_cluster, eff_phi_name, eff_phi_title);
0084       }  // layer loop
0085     }    // statino loop
0086   }      // region loop
0087 }