Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:43

0001 /*
0002  * \file GEMTnPEfficiencyTask.cc
0003  * \author Qianying
0004  *
0005  * \interited from the TnP framework of  
0006  * \author L. Lunerti - INFN Bologna
0007  *
0008  */
0009 
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 
0012 #include "DataFormats/MuonReco/interface/MuonSegmentMatch.h"
0013 #include "DataFormats/MuonReco/interface/MuonGEMHitMatch.h"
0014 
0015 #include "DQMOffline/MuonDPG/interface/BaseTnPEfficiencyTask.h"
0016 
0017 class GEMTnPEfficiencyTask : public BaseTnPEfficiencyTask {
0018 public:
0019   /// Constructor
0020   GEMTnPEfficiencyTask(const edm::ParameterSet& config);
0021 
0022   /// Destructor
0023   ~GEMTnPEfficiencyTask() override;
0024 
0025 protected:
0026   std::string topFolder() const override;
0027 
0028   void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& context) override;
0029 
0030   /// Analyze
0031   void analyze(const edm::Event& event, const edm::EventSetup& context) override;
0032 };
0033 
0034 GEMTnPEfficiencyTask::GEMTnPEfficiencyTask(const edm::ParameterSet& config) : BaseTnPEfficiencyTask(config) {
0035   LogTrace("DQMOffline|MuonDPG|GEMTnPEfficiencyTask") << "[GEMTnPEfficiencyTask]: Constructor" << std::endl;
0036 }
0037 
0038 GEMTnPEfficiencyTask::~GEMTnPEfficiencyTask() {
0039   LogTrace("DQMOffline|MuonDPG|GEMTnPEfficiencyTask")
0040       << "[GEMTnPEfficiencyTask]: analyzed " << m_nEvents << " events" << std::endl;
0041 }
0042 
0043 void GEMTnPEfficiencyTask::bookHistograms(DQMStore::IBooker& iBooker,
0044                                           edm::Run const& run,
0045                                           edm::EventSetup const& context) {
0046   BaseTnPEfficiencyTask::bookHistograms(iBooker, run, context);
0047 
0048   LogTrace("DQMOffline|MuonDPG|GEMTnPEfficiencyTask") << "[GEMTnPEfficiencyTask]: bookHistograms" << std::endl;
0049 
0050   auto baseDir = topFolder() + "Task/";
0051   iBooker.setCurrentFolder(baseDir);
0052 
0053   MonitorElement* me_GE11_pass_Ch_region =
0054       iBooker.book2D("GE11_nPassingProbe_Ch_region", "GE11_nPassingProbe_Ch_region", 2, -1.5, 1.5, 36, 1, 37);
0055   MonitorElement* me_GE11_fail_Ch_region =
0056       iBooker.book2D("GE11_nFailingProbe_Ch_region", "GE11_nFailingProbe_Ch_region", 2, -1.5, 1.5, 36, 1, 37);
0057   MonitorElement* me_GE21_pass_Ch_region =
0058       iBooker.book2D("GE21_nPassingProbe_Ch_region", "GE21_nPassingProbe_Ch_region", 2, -1.5, 1.5, 36, 1, 37);
0059   MonitorElement* me_GE21_fail_Ch_region =
0060       iBooker.book2D("GE21_nFailingProbe_Ch_region", "GE21_nFailingProbe_Ch_region", 2, -1.5, 1.5, 36, 1, 37);
0061   MonitorElement* me_GEM_pass_Ch_region_GE1 =
0062       iBooker.book2D("GEM_nPassingProbe_Ch_region_GE1", "GEM_nPassingProbe_Ch_region_GE1", 4, 0, 4, 36, 1, 37);
0063   MonitorElement* me_GEM_fail_Ch_region_GE1 =
0064       iBooker.book2D("GEM_nFailingProbe_Ch_region_GE1", "GEM_nFailingProbe_Ch_region_GE1", 4, 0, 4, 36, 1, 37);
0065   MonitorElement* me_GEM_pass_Ch_region_GE1_NoL =
0066       iBooker.book2D("GEM_nPassingProbe_Ch_region_GE1_NoL", "GEM_nPassingProbe_Ch_region_GE1_NoL", 2, 0, 2, 36, 1, 37);
0067   MonitorElement* me_GEM_fail_Ch_region_GE1_NoL =
0068       iBooker.book2D("GEM_nFailingProbe_Ch_region_GE1_NoL", "GEM_nFailingProbe_Ch_region_GE1_NoL", 2, 0, 2, 36, 1, 37);
0069   MonitorElement* me_GE11_pass_Ch_ieta =
0070       iBooker.book2D("GE11_nPassingProbe_Ch_ieta", "GE11_nPassingProbe_Ch_ieta", 8, 1, 9, 36, 1, 37);
0071   MonitorElement* me_GE11_fail_Ch_ieta =
0072       iBooker.book2D("GE11_nFailingProbe_Ch_ieta", "GE11_nFailingProbe_Ch_ieta", 8, 1, 9, 36, 1, 37);
0073   MonitorElement* me_GE11_pass_Ch_phi = iBooker.book2D(
0074       "GE11_nPassingProbe_Ch_phi", "GE11_nPassingProbe_Ch_phi", 20, -TMath::Pi(), TMath::Pi(), 36, 1, 37);
0075   MonitorElement* me_GE11_fail_Ch_phi = iBooker.book2D(
0076       "GE11_nFailingProbe_Ch_phi", "GE11_nFailingProbe_Ch_phi", 20, -TMath::Pi(), TMath::Pi(), 36, 1, 37);
0077   MonitorElement* me_GE11_pass_allCh_1D =
0078       iBooker.book1D("GE11_nPassingProbe_allCh_1D", "GE11_nPassingProbe_allCh_1D", 2, -1.5, 1.5);
0079   MonitorElement* me_GE11_fail_allCh_1D =
0080       iBooker.book1D("GE11_nFailingProbe_allCh_1D", "GE11_nFailingProbe_allCh_1D", 2, -1.5, 1.5);
0081   MonitorElement* me_GE11_pass_chamber_1D =
0082       iBooker.book1D("GE11_nPassingProbe_chamber_1D", "GE11_nPassingProbe_chamber_1D", 36, 1, 37);
0083   MonitorElement* me_GE11_fail_chamber_1D =
0084       iBooker.book1D("GE11_nFailingProbe_chamber_1D", "GE11_nFailingProbe_chamber_1D", 36, 1, 37);
0085   MonitorElement* me_GE21_pass_Ch_ieta =
0086       iBooker.book2D("GE21_nPassingProbe_Ch_ieta", "GE21_nPassingProbe_Ch_ieta", 16, 1, 17, 18, 1, 19);
0087   MonitorElement* me_GE21_fail_Ch_ieta =
0088       iBooker.book2D("GE21_nFailingProbe_Ch_ieta", "GE21_nFailingProbe_Ch_ieta", 16, 1, 17, 18, 1, 19);
0089   MonitorElement* me_GE21_pass_Ch_phi = iBooker.book2D(
0090       "GE21_nPassingProbe_Ch_phi", "GE21_nPassingProbe_Ch_phi", 20, -TMath::Pi(), TMath::Pi(), 18, 1, 19);
0091   MonitorElement* me_GE21_fail_Ch_phi = iBooker.book2D(
0092       "GE21_nFailingProbe_Ch_phi", "GE21_nFailingProbe_Ch_phi", 20, -TMath::Pi(), TMath::Pi(), 18, 1, 19);
0093   MonitorElement* me_GE21_pass_allCh_1D =
0094       iBooker.book1D("GE21_nPassingProbe_allCh_1D", "GE21_nPassingProbe_allCh_1D", 2, -1.5, 1.5);
0095   MonitorElement* me_GE21_fail_allCh_1D =
0096       iBooker.book1D("GE21_nFailingProbe_allCh_1D", "GE21_nFailingProbe_allCh_1D", 2, -1.5, 1.5);
0097   MonitorElement* me_GE21_pass_chamber_1D =
0098       iBooker.book1D("GE21_nPassingProbe_chamber_1D", "GE21_nPassingProbe_chamber_1D", 18, 1, 19);
0099   MonitorElement* me_GE21_fail_chamber_1D =
0100       iBooker.book1D("GE21_nFailingProbe_chamber_1D", "GE21_nFailingProbe_chamber_1D", 18, 1, 19);
0101   MonitorElement* me_GEM_pass_chamber_p1_1D =
0102       iBooker.book1D("GEM_nPassingProbe_chamber_p1_1D", "GEM_nPassingProbe_chamber_p1_1D", 36, 1, 37);
0103   MonitorElement* me_GEM_fail_chamber_p1_1D =
0104       iBooker.book1D("GEM_nFailingProbe_chamber_p1_1D", "GEM_nFailingProbe_chamber_p1_1D", 36, 1, 37);
0105   MonitorElement* me_GEM_pass_chamber_p2_1D =
0106       iBooker.book1D("GEM_nPassingProbe_chamber_p2_1D", "GEM_nPassingProbe_chamber_p2_1D", 36, 1, 37);
0107   MonitorElement* me_GEM_fail_chamber_p2_1D =
0108       iBooker.book1D("GEM_nFailingProbe_chamber_p2_1D", "GEM_nFailingProbe_chamber_p2_1D", 36, 1, 37);
0109   MonitorElement* me_GEM_pass_chamber_n1_1D =
0110       iBooker.book1D("GEM_nPassingProbe_chamber_n1_1D", "GEM_nPassingProbe_chamber_n1_1D", 36, 1, 37);
0111   MonitorElement* me_GEM_fail_chamber_n1_1D =
0112       iBooker.book1D("GEM_nFailingProbe_chamber_n1_1D", "GEM_nFailingProbe_chamber_n1_1D", 36, 1, 37);
0113   MonitorElement* me_GEM_pass_chamber_n2_1D =
0114       iBooker.book1D("GEM_nPassingProbe_chamber_n2_1D", "GEM_nPassingProbe_chamber_n2_1D", 36, 1, 37);
0115   MonitorElement* me_GEM_fail_chamber_n2_1D =
0116       iBooker.book1D("GEM_nFailingProbe_chamber_n2_1D", "GEM_nFailingProbe_chamber_n2_1D", 36, 1, 37);
0117   //
0118   MonitorElement* me_GEM_pass_pt_1D = iBooker.book1D("GEM_nPassingProbe_pt_1D", "GEM_nPassingProbe_pt_1D", 20, 0, 100);
0119   MonitorElement* me_GEM_fail_pt_1D = iBooker.book1D("GEM_nFailingProbe_pt_1D", "GEM_nFailingProbe_pt_1D", 20, 0, 100);
0120   MonitorElement* me_GEM_pass_eta_1D =
0121       iBooker.book1D("GEM_nPassingProbe_eta_1D", "GEM_nPassingProbe_eta_1D", 24, 0, 2.4);
0122   MonitorElement* me_GEM_fail_eta_1D =
0123       iBooker.book1D("GEM_nFailingProbe_eta_1D", "GEM_nFailingProbe_eta_1D", 24, 0, 2.4);
0124   MonitorElement* me_GEM_pass_phi_1D =
0125       iBooker.book1D("GEM_nPassingProbe_phi_1D", "GEM_nPassingProbe_phi_1D", 20, -TMath::Pi(), TMath::Pi());
0126   MonitorElement* me_GEM_fail_phi_1D =
0127       iBooker.book1D("GEM_nFailingProbe_phi_1D", "GEM_nFailingProbe_phi_1D", 20, -TMath::Pi(), TMath::Pi());
0128   ///
0129   MonitorElement* me_GEM_pass_pt_p1_1D =
0130       iBooker.book1D("GEM_nPassingProbe_pt_p1_1D", "GEM_nPassingProbe_pt_p1_1D", 20, 0, 100);
0131   MonitorElement* me_GEM_fail_pt_p1_1D =
0132       iBooker.book1D("GEM_nFailingProbe_pt_p1_1D", "GEM_nFailingProbe_pt_p1_1D", 20, 0, 100);
0133   MonitorElement* me_GEM_pass_eta_p1_1D =
0134       iBooker.book1D("GEM_nPassingProbe_eta_p1_1D", "GEM_nPassingProbe_eta_p1_1D", 24, 0, 2.4);
0135   MonitorElement* me_GEM_fail_eta_p1_1D =
0136       iBooker.book1D("GEM_nFailingProbe_eta_p1_1D", "GEM_nFailingProbe_eta_p1_1D", 24, 0, 2.4);
0137   MonitorElement* me_GEM_pass_phi_p1_1D =
0138       iBooker.book1D("GEM_nPassingProbe_phi_p1_1D", "GEM_nPassingProbe_phi_p1_1D", 20, -TMath::Pi(), TMath::Pi());
0139   MonitorElement* me_GEM_fail_phi_p1_1D =
0140       iBooker.book1D("GEM_nFailingProbe_phi_p1_1D", "GEM_nFailingProbe_phi_p1_1D", 20, -TMath::Pi(), TMath::Pi());
0141   MonitorElement* me_GEM_pass_pt_p2_1D =
0142       iBooker.book1D("GEM_nPassingProbe_pt_p2_1D", "GEM_nPassingProbe_pt_p2_1D", 20, 0, 100);
0143   MonitorElement* me_GEM_fail_pt_p2_1D =
0144       iBooker.book1D("GEM_nFailingProbe_pt_p2_1D", "GEM_nFailingProbe_pt_p2_1D", 20, 0, 100);
0145   MonitorElement* me_GEM_pass_eta_p2_1D =
0146       iBooker.book1D("GEM_nPassingProbe_eta_p2_1D", "GEM_nPassingProbe_eta_p2_1D", 24, 0, 2.4);
0147   MonitorElement* me_GEM_fail_eta_p2_1D =
0148       iBooker.book1D("GEM_nFailingProbe_eta_p2_1D", "GEM_nFailingProbe_eta_p2_1D", 24, 0, 2.4);
0149   MonitorElement* me_GEM_pass_phi_p2_1D =
0150       iBooker.book1D("GEM_nPassingProbe_phi_p2_1D", "GEM_nPassingProbe_phi_p2_1D", 20, -TMath::Pi(), TMath::Pi());
0151   MonitorElement* me_GEM_fail_phi_p2_1D =
0152       iBooker.book1D("GEM_nFailingProbe_phi_p2_1D", "GEM_nFailingProbe_phi_p2_1D", 20, -TMath::Pi(), TMath::Pi());
0153   MonitorElement* me_GEM_pass_pt_n1_1D =
0154       iBooker.book1D("GEM_nPassingProbe_pt_n1_1D", "GEM_nPassingProbe_pt_n1_1D", 20, 0, 100);
0155   MonitorElement* me_GEM_fail_pt_n1_1D =
0156       iBooker.book1D("GEM_nFailingProbe_pt_n1_1D", "GEM_nFailingProbe_pt_n1_1D", 20, 0, 100);
0157   MonitorElement* me_GEM_pass_eta_n1_1D =
0158       iBooker.book1D("GEM_nPassingProbe_eta_n1_1D", "GEM_nPassingProbe_eta_n1_1D", 24, 0, 2.4);
0159   MonitorElement* me_GEM_fail_eta_n1_1D =
0160       iBooker.book1D("GEM_nFailingProbe_eta_n1_1D", "GEM_nFailingProbe_eta_n1_1D", 24, 0, 2.4);
0161   MonitorElement* me_GEM_pass_phi_n1_1D =
0162       iBooker.book1D("GEM_nPassingProbe_phi_n1_1D", "GEM_nPassingProbe_phi_n1_1D", 20, -TMath::Pi(), TMath::Pi());
0163   MonitorElement* me_GEM_fail_phi_n1_1D =
0164       iBooker.book1D("GEM_nFailingProbe_phi_n1_1D", "GEM_nFailingProbe_phi_n1_1D", 20, -TMath::Pi(), TMath::Pi());
0165   MonitorElement* me_GEM_pass_pt_n2_1D =
0166       iBooker.book1D("GEM_nPassingProbe_pt_n2_1D", "GEM_nPassingProbe_pt_n2_1D", 20, 0, 100);
0167   MonitorElement* me_GEM_fail_pt_n2_1D =
0168       iBooker.book1D("GEM_nFailingProbe_pt_n2_1D", "GEM_nFailingProbe_pt_n2_1D", 20, 0, 100);
0169   MonitorElement* me_GEM_pass_eta_n2_1D =
0170       iBooker.book1D("GEM_nPassingProbe_eta_n2_1D", "GEM_nPassingProbe_eta_n2_1D", 24, 0, 2.4);
0171   MonitorElement* me_GEM_fail_eta_n2_1D =
0172       iBooker.book1D("GEM_nFailingProbe_eta_n2_1D", "GEM_nFailingProbe_eta_n2_1D", 24, 0, 2.4);
0173   MonitorElement* me_GEM_pass_phi_n2_1D =
0174       iBooker.book1D("GEM_nPassingProbe_phi_n2_1D", "GEM_nPassingProbe_phi_n2_1D", 20, -TMath::Pi(), TMath::Pi());
0175   MonitorElement* me_GEM_fail_phi_n2_1D =
0176       iBooker.book1D("GEM_nFailingProbe_phi_n2_1D", "GEM_nFailingProbe_phi_n2_1D", 20, -TMath::Pi(), TMath::Pi());
0177   ////
0178   MonitorElement* me_ME0_pass_chamber_1D =
0179       iBooker.book1D("ME0_nPassingProbe_chamber_1D", "ME0_nPassingProbe_chamber_1D", 18, 1, 19);
0180   MonitorElement* me_ME0_fail_chamber_1D =
0181       iBooker.book1D("ME0_nFailingProbe_chamber_1D", "ME0_nFailingProbe_chamber_1D", 18, 1, 19);
0182   MonitorElement* me_GEM_pass_Ch_region_layer_phase2 = iBooker.book2D(
0183       "GEM_nPassingProbe_Ch_region_layer_phase2", "GEM_nPassingProbe_Ch_region_layer_phase2", 10, 0, 10, 36, 1, 37);
0184   MonitorElement* me_GEM_fail_Ch_region_layer_phase2 = iBooker.book2D(
0185       "GEM_nFailingProbe_Ch_region_layer_phase2", "GEM_nFailingProbe_Ch_region_layer_phase2", 10, 0, 10, 36, 1, 37);
0186 
0187   me_GE11_pass_allCh_1D->setBinLabel(1, "GE-11", 1);
0188   me_GE11_pass_allCh_1D->setBinLabel(2, "GE+11", 1);
0189   me_GE11_pass_allCh_1D->setAxisTitle("Number of passing probes", 2);
0190 
0191   me_GE11_fail_allCh_1D->setBinLabel(1, "GE-11", 1);
0192   me_GE11_fail_allCh_1D->setBinLabel(2, "GE+11", 1);
0193   me_GE11_fail_allCh_1D->setAxisTitle("Number of failing probes", 2);
0194 
0195   me_GE11_pass_chamber_1D->setAxisTitle("Chamber", 1);
0196   me_GE11_pass_chamber_1D->setAxisTitle("Number of passing probes", 2);
0197   me_GE11_fail_chamber_1D->setAxisTitle("Chamber", 1);
0198   me_GE11_fail_chamber_1D->setAxisTitle("Number of failing probes", 2);
0199 
0200   me_GE21_pass_allCh_1D->setBinLabel(1, "GE-21", 1);
0201   me_GE21_pass_allCh_1D->setBinLabel(2, "GE+21", 1);
0202   me_GE21_pass_allCh_1D->setAxisTitle("Number of passing probes", 2);
0203 
0204   me_GE21_fail_allCh_1D->setBinLabel(1, "GE-21", 1);
0205   me_GE21_fail_allCh_1D->setBinLabel(2, "GE+21", 1);
0206   me_GE21_fail_allCh_1D->setAxisTitle("Number of failing probes", 2);
0207 
0208   me_GE21_pass_chamber_1D->setAxisTitle("Chamber", 1);
0209   me_GE21_pass_chamber_1D->setAxisTitle("Number of passing probes", 2);
0210   me_GE21_fail_chamber_1D->setAxisTitle("Chamber", 1);
0211   me_GE21_fail_chamber_1D->setAxisTitle("Number of failing probes", 2);
0212 
0213   me_GEM_pass_chamber_p1_1D->setAxisTitle("Chamber", 1);
0214   me_GEM_pass_chamber_p1_1D->setAxisTitle("Number of passing probes", 2);
0215   me_GEM_fail_chamber_p1_1D->setAxisTitle("Chamber", 1);
0216   me_GEM_fail_chamber_p1_1D->setAxisTitle("Number of failing probes", 2);
0217 
0218   me_GEM_pass_chamber_p2_1D->setAxisTitle("Chamber", 1);
0219   me_GEM_pass_chamber_p2_1D->setAxisTitle("Number of passing probes", 2);
0220   me_GEM_fail_chamber_p2_1D->setAxisTitle("Chamber", 1);
0221   me_GEM_fail_chamber_p2_1D->setAxisTitle("Number of failing probes", 2);
0222 
0223   me_GEM_pass_chamber_n1_1D->setAxisTitle("Chamber", 1);
0224   me_GEM_pass_chamber_n1_1D->setAxisTitle("Number of passing probes", 2);
0225   me_GEM_fail_chamber_n1_1D->setAxisTitle("Chamber", 1);
0226   me_GEM_fail_chamber_n1_1D->setAxisTitle("Number of failing probes", 2);
0227 
0228   me_GEM_pass_chamber_n2_1D->setAxisTitle("Chamber", 1);
0229   me_GEM_pass_chamber_n2_1D->setAxisTitle("Number of passing probes", 2);
0230   me_GEM_fail_chamber_n2_1D->setAxisTitle("Chamber", 1);
0231   me_GEM_fail_chamber_n2_1D->setAxisTitle("Number of failing probes", 2);
0232 
0233   me_GEM_pass_pt_1D->setAxisTitle("P_{T}", 1);
0234   me_GEM_pass_pt_1D->setAxisTitle("Number of passing probes", 2);
0235   me_GEM_fail_pt_1D->setAxisTitle("P_{T}", 1);
0236   me_GEM_fail_pt_1D->setAxisTitle("Number of failing probes", 2);
0237 
0238   me_GEM_pass_eta_1D->setAxisTitle("#eta", 1);
0239   me_GEM_pass_eta_1D->setAxisTitle("Number of passing probes", 2);
0240   me_GEM_fail_eta_1D->setAxisTitle("#eta", 1);
0241   me_GEM_fail_eta_1D->setAxisTitle("Number of failing probes", 2);
0242 
0243   me_GEM_pass_phi_1D->setAxisTitle("#phi", 1);
0244   me_GEM_pass_phi_1D->setAxisTitle("Number of passing probes", 2);
0245   me_GEM_fail_phi_1D->setAxisTitle("#phi", 1);
0246   me_GEM_fail_phi_1D->setAxisTitle("Number of failing probes", 2);
0247 
0248   me_GEM_pass_pt_p1_1D->setAxisTitle("P_{T}", 1);
0249   me_GEM_pass_pt_p1_1D->setAxisTitle("Number of passing probes", 2);
0250   me_GEM_fail_pt_p1_1D->setAxisTitle("P_{T}", 1);
0251   me_GEM_fail_pt_p1_1D->setAxisTitle("Number of failing probes", 2);
0252 
0253   me_GEM_pass_eta_p1_1D->setAxisTitle("#eta", 1);
0254   me_GEM_pass_eta_p1_1D->setAxisTitle("Number of passing probes", 2);
0255   me_GEM_fail_eta_p1_1D->setAxisTitle("#eta", 1);
0256   me_GEM_fail_eta_p1_1D->setAxisTitle("Number of failing probes", 2);
0257 
0258   me_GEM_pass_phi_p1_1D->setAxisTitle("#phi", 1);
0259   me_GEM_pass_phi_p1_1D->setAxisTitle("Number of passing probes", 2);
0260   me_GEM_fail_phi_p1_1D->setAxisTitle("#phi", 1);
0261   me_GEM_fail_phi_p1_1D->setAxisTitle("Number of failing probes", 2);
0262 
0263   me_GEM_pass_pt_p2_1D->setAxisTitle("P_{T}", 1);
0264   me_GEM_pass_pt_p2_1D->setAxisTitle("Number of passing probes", 2);
0265   me_GEM_fail_pt_p2_1D->setAxisTitle("P_{T}", 1);
0266   me_GEM_fail_pt_p2_1D->setAxisTitle("Number of failing probes", 2);
0267 
0268   me_GEM_pass_eta_p2_1D->setAxisTitle("#eta", 1);
0269   me_GEM_pass_eta_p2_1D->setAxisTitle("Number of passing probes", 2);
0270   me_GEM_fail_eta_p2_1D->setAxisTitle("#eta", 1);
0271   me_GEM_fail_eta_p2_1D->setAxisTitle("Number of failing probes", 2);
0272 
0273   me_GEM_pass_phi_p2_1D->setAxisTitle("#phi", 1);
0274   me_GEM_pass_phi_p2_1D->setAxisTitle("Number of passing probes", 2);
0275   me_GEM_fail_phi_p2_1D->setAxisTitle("#phi", 1);
0276   me_GEM_fail_phi_p2_1D->setAxisTitle("Number of failing probes", 2);
0277 
0278   me_GEM_pass_pt_n1_1D->setAxisTitle("P_{T}", 1);
0279   me_GEM_pass_pt_n1_1D->setAxisTitle("Number of passing probes", 2);
0280   me_GEM_fail_pt_n1_1D->setAxisTitle("P_{T}", 1);
0281   me_GEM_fail_pt_n1_1D->setAxisTitle("Number of failing probes", 2);
0282 
0283   me_GEM_pass_eta_n1_1D->setAxisTitle("#eta", 1);
0284   me_GEM_pass_eta_n1_1D->setAxisTitle("Number of passing probes", 2);
0285   me_GEM_fail_eta_n1_1D->setAxisTitle("#eta", 1);
0286   me_GEM_fail_eta_n1_1D->setAxisTitle("Number of failing probes", 2);
0287 
0288   me_GEM_pass_phi_n1_1D->setAxisTitle("#phi", 1);
0289   me_GEM_pass_phi_n1_1D->setAxisTitle("Number of passing probes", 2);
0290   me_GEM_fail_phi_n1_1D->setAxisTitle("#phi", 1);
0291   me_GEM_fail_phi_n1_1D->setAxisTitle("Number of failing probes", 2);
0292 
0293   me_GEM_pass_pt_n2_1D->setAxisTitle("P_{T}", 1);
0294   me_GEM_pass_pt_n2_1D->setAxisTitle("Number of passing probes", 2);
0295   me_GEM_fail_pt_n2_1D->setAxisTitle("P_{T}", 1);
0296   me_GEM_fail_pt_n2_1D->setAxisTitle("Number of failing probes", 2);
0297 
0298   me_GEM_pass_eta_n2_1D->setAxisTitle("#eta", 1);
0299   me_GEM_pass_eta_n2_1D->setAxisTitle("Number of passing probes", 2);
0300   me_GEM_fail_eta_n2_1D->setAxisTitle("#eta", 1);
0301   me_GEM_fail_eta_n2_1D->setAxisTitle("Number of failing probes", 2);
0302 
0303   me_GEM_pass_phi_n2_1D->setAxisTitle("#phi", 1);
0304   me_GEM_pass_phi_n2_1D->setAxisTitle("Number of passing probes", 2);
0305   me_GEM_fail_phi_n2_1D->setAxisTitle("#phi", 1);
0306   me_GEM_fail_phi_n2_1D->setAxisTitle("Number of failing probes", 2);
0307 
0308   me_GE11_fail_Ch_region->setBinLabel(1, "GE-11", 1);
0309   me_GE11_fail_Ch_region->setBinLabel(2, "GE+11", 1);
0310   for (int i = 1; i < 37; ++i) {
0311     me_GE11_fail_Ch_region->setBinLabel(i, std::to_string(i), 2);
0312   }
0313   me_GE11_fail_Ch_region->setAxisTitle("Chamber", 2);
0314   me_GE11_fail_Ch_region->setAxisTitle("Number of failing probes", 3);
0315 
0316   me_GE11_pass_Ch_region->setBinLabel(1, "GE-11", 1);
0317   me_GE11_pass_Ch_region->setBinLabel(2, "GE+11", 1);
0318   for (int i = 1; i < 37; ++i) {
0319     me_GE11_pass_Ch_region->setBinLabel(i, std::to_string(i), 2);
0320   }
0321   me_GE11_pass_Ch_region->setAxisTitle("Chamber", 2);
0322   me_GE11_pass_Ch_region->setAxisTitle("Number of passing probes", 3);
0323 
0324   me_GE21_fail_Ch_region->setBinLabel(1, "GE-21", 1);
0325   me_GE21_fail_Ch_region->setBinLabel(2, "GE+21", 1);
0326   for (int i = 1; i < 19; ++i) {
0327     me_GE21_fail_Ch_region->setBinLabel(i, std::to_string(i), 2);
0328   }
0329   me_GE21_fail_Ch_region->setAxisTitle("Chamber", 2);
0330   me_GE21_fail_Ch_region->setAxisTitle("Number of failing probes", 3);
0331 
0332   me_GE21_pass_Ch_region->setBinLabel(1, "GE-21", 1);
0333   me_GE21_pass_Ch_region->setBinLabel(2, "GE+21", 1);
0334   for (int i = 1; i < 19; ++i) {
0335     me_GE21_pass_Ch_region->setBinLabel(i, std::to_string(i), 2);
0336   }
0337   me_GE21_pass_Ch_region->setAxisTitle("Chamber", 2);
0338   me_GE21_pass_Ch_region->setAxisTitle("Number of passing probes", 3);
0339 
0340   me_GEM_fail_Ch_region_GE1->setBinLabel(1, "GE-1/1_L2", 1);
0341   me_GEM_fail_Ch_region_GE1->setBinLabel(2, "GE-1/1_L1", 1);
0342   me_GEM_fail_Ch_region_GE1->setBinLabel(3, "GE+1/1_L1", 1);
0343   me_GEM_fail_Ch_region_GE1->setBinLabel(4, "GE+1/1_L2", 1);
0344   for (int i = 1; i < 37; ++i) {
0345     me_GEM_fail_Ch_region_GE1->setBinLabel(i, std::to_string(i), 2);
0346   }
0347   me_GEM_fail_Ch_region_GE1->setAxisTitle("Chamber", 2);
0348   me_GEM_fail_Ch_region_GE1->setAxisTitle("Number of passing probes", 3);
0349 
0350   me_GEM_pass_Ch_region_GE1->setBinLabel(1, "GE-1/1_L2", 1);
0351   me_GEM_pass_Ch_region_GE1->setBinLabel(2, "GE-1/1_L1", 1);
0352   me_GEM_pass_Ch_region_GE1->setBinLabel(3, "GE+1/1_L1", 1);
0353   me_GEM_pass_Ch_region_GE1->setBinLabel(4, "GE+1/1_L2", 1);
0354   for (int i = 1; i < 37; ++i) {
0355     me_GEM_pass_Ch_region_GE1->setBinLabel(i, std::to_string(i), 2);
0356   }
0357   me_GEM_pass_Ch_region_GE1->setAxisTitle("Chamber", 2);
0358   me_GEM_pass_Ch_region_GE1->setAxisTitle("Number of passing probes", 3);
0359 
0360   me_GEM_fail_Ch_region_GE1_NoL->setBinLabel(1, "GE-1", 1);
0361   me_GEM_fail_Ch_region_GE1_NoL->setBinLabel(2, "GE+1", 1);
0362   for (int i = 1; i < 37; ++i) {
0363     me_GEM_fail_Ch_region_GE1_NoL->setBinLabel(i, std::to_string(i), 2);
0364   }
0365   me_GEM_fail_Ch_region_GE1_NoL->setAxisTitle("Chamber", 2);
0366   me_GEM_fail_Ch_region_GE1_NoL->setAxisTitle("Number of passing probes", 3);
0367 
0368   me_GEM_pass_Ch_region_GE1_NoL->setBinLabel(1, "GE-1", 1);
0369   me_GEM_pass_Ch_region_GE1_NoL->setBinLabel(2, "GE+1", 1);
0370   for (int i = 1; i < 37; ++i) {
0371     me_GEM_pass_Ch_region_GE1_NoL->setBinLabel(i, std::to_string(i), 2);
0372   }
0373   me_GEM_pass_Ch_region_GE1_NoL->setAxisTitle("Chamber", 2);
0374   me_GEM_pass_Ch_region_GE1_NoL->setAxisTitle("Number of passing probes", 3);
0375   ///////////////
0376   for (int i = 1; i < 37; ++i) {
0377     me_GE11_fail_Ch_ieta->setBinLabel(i, std::to_string(i), 2);
0378   }
0379   for (int i = 1; i < 9; ++i) {
0380     me_GE11_fail_Ch_ieta->setBinLabel(i, std::to_string(i), 1);
0381   }
0382   me_GE11_fail_Ch_ieta->setAxisTitle("#ieta", 1);
0383   me_GE11_fail_Ch_ieta->setAxisTitle("Chamber", 2);
0384   me_GE11_fail_Ch_ieta->setAxisTitle("Number of failing probes", 3);
0385 
0386   for (int i = 1; i < 37; ++i) {
0387     me_GE11_pass_Ch_ieta->setBinLabel(i, std::to_string(i), 2);
0388   }
0389   for (int i = 1; i < 9; ++i) {
0390     me_GE11_pass_Ch_ieta->setBinLabel(i, std::to_string(i), 1);
0391   }
0392   me_GE11_pass_Ch_ieta->setAxisTitle("#ieta", 1);
0393   me_GE11_pass_Ch_ieta->setAxisTitle("Chamber", 2);
0394   me_GE11_pass_Ch_ieta->setAxisTitle("Number of passing probes", 3);
0395 
0396   for (int i = 1; i < 37; ++i) {
0397     me_GE11_fail_Ch_phi->setBinLabel(i, std::to_string(i), 2);
0398   }
0399   me_GE11_fail_Ch_phi->setAxisTitle("#phi", 1);
0400   me_GE11_fail_Ch_phi->setAxisTitle("Chamber", 2);
0401   me_GE11_fail_Ch_phi->setAxisTitle("Number of failing probes", 3);
0402 
0403   for (int i = 1; i < 37; ++i) {
0404     me_GE11_pass_Ch_phi->setBinLabel(i, std::to_string(i), 2);
0405   }
0406   me_GE11_pass_Ch_phi->setAxisTitle("#phi", 1);
0407   me_GE11_pass_Ch_phi->setAxisTitle("Chamber", 2);
0408   me_GE11_pass_Ch_phi->setAxisTitle("Number of passing probes", 3);
0409 
0410   for (int i = 1; i < 19; ++i) {
0411     me_GE21_fail_Ch_ieta->setBinLabel(i, std::to_string(i), 2);
0412   }
0413   for (int i = 1; i < 17; ++i) {
0414     me_GE21_fail_Ch_ieta->setBinLabel(i, std::to_string(i), 1);
0415   }
0416   me_GE21_fail_Ch_ieta->setAxisTitle("#ieta", 1);
0417   me_GE21_fail_Ch_ieta->setAxisTitle("Chamber", 2);
0418   me_GE21_fail_Ch_ieta->setAxisTitle("Number of failing probes", 3);
0419 
0420   for (int i = 1; i < 19; ++i) {
0421     me_GE21_pass_Ch_ieta->setBinLabel(i, std::to_string(i), 2);
0422   }
0423   for (int i = 1; i < 17; ++i) {
0424     me_GE21_pass_Ch_ieta->setBinLabel(i, std::to_string(i), 1);
0425   }
0426   me_GE21_pass_Ch_ieta->setAxisTitle("#ieta", 1);
0427   me_GE21_pass_Ch_ieta->setAxisTitle("Chamber", 2);
0428   me_GE21_pass_Ch_ieta->setAxisTitle("Number of passing probes", 3);
0429   /////////////////////
0430   for (int i = 1; i < 19; ++i) {
0431     me_GE21_fail_Ch_phi->setBinLabel(i, std::to_string(i), 2);
0432   }
0433   me_GE21_fail_Ch_phi->setAxisTitle("#phi", 1);
0434   me_GE21_fail_Ch_phi->setAxisTitle("Chamber", 2);
0435   me_GE21_fail_Ch_phi->setAxisTitle("Number of failing probes", 3);
0436 
0437   for (int i = 1; i < 19; ++i) {
0438     me_GE21_pass_Ch_phi->setBinLabel(i, std::to_string(i), 2);
0439   }
0440   me_GE21_pass_Ch_phi->setAxisTitle("#phi", 1);
0441   me_GE21_pass_Ch_phi->setAxisTitle("Chamber", 2);
0442   me_GE21_pass_Ch_phi->setAxisTitle("Number of passing probes", 3);
0443 
0444   for (int i = 1; i < 19; ++i) {
0445     me_ME0_pass_chamber_1D->setBinLabel(i, std::to_string(i), 1);
0446   }
0447   me_ME0_pass_chamber_1D->setAxisTitle("Chamber", 1);
0448   me_ME0_pass_chamber_1D->setAxisTitle("Number of passing probes", 2);
0449   for (int i = 1; i < 19; ++i) {
0450     me_ME0_fail_chamber_1D->setBinLabel(i, std::to_string(i), 1);
0451   }
0452   me_ME0_fail_chamber_1D->setAxisTitle("Chamber", 1);
0453   me_ME0_fail_chamber_1D->setAxisTitle("Number of failing probes", 2);
0454 
0455   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(1, "GE-2/1_L2", 1);
0456   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(2, "GE-2/1_L1", 1);
0457   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(3, "GE-1/1_L2", 1);
0458   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(4, "GE-1/1_L1", 1);
0459   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(5, "GE0-", 1);
0460   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(6, "GE0+", 1);
0461   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(7, "GE+1/1_L1", 1);
0462   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(8, "GE+1/1_L2", 1);
0463   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(9, "GE+2/1_L1", 1);
0464   me_GEM_fail_Ch_region_layer_phase2->setBinLabel(10, "GE+2/1_L2", 1);
0465   for (int i = 1; i < 37; ++i) {
0466     me_GEM_fail_Ch_region_layer_phase2->setBinLabel(i, std::to_string(i), 2);
0467   }
0468   me_GEM_fail_Ch_region_layer_phase2->setAxisTitle("Chamber", 2);
0469   me_GEM_fail_Ch_region_layer_phase2->setAxisTitle("Number of passing probes", 3);
0470 
0471   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(1, "GE-2/1_L2", 1);
0472   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(2, "GE-2/1_L1", 1);
0473   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(3, "GE-1/1_L2", 1);
0474   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(4, "GE-1/1_L1", 1);
0475   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(5, "GE0-", 1);
0476   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(6, "GE0+", 1);
0477   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(7, "GE+1/1_L1", 1);
0478   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(8, "GE+1/1_L2", 1);
0479   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(9, "GE+2/1_L1", 1);
0480   me_GEM_pass_Ch_region_layer_phase2->setBinLabel(10, "GE+2/1_L2", 1);
0481 
0482   for (int i = 1; i < 37; ++i) {
0483     me_GEM_pass_Ch_region_layer_phase2->setBinLabel(i, std::to_string(i), 2);
0484   }
0485   me_GEM_pass_Ch_region_layer_phase2->setAxisTitle("Chamber", 2);
0486   me_GEM_pass_Ch_region_layer_phase2->setAxisTitle("Number of passing probes", 3);
0487 
0488   m_histos["GE11_nPassingProbe_Ch_region"] = me_GE11_pass_Ch_region;
0489   m_histos["GE11_nFailingProbe_Ch_region"] = me_GE11_fail_Ch_region;
0490   m_histos["GE21_nPassingProbe_Ch_region"] = me_GE21_pass_Ch_region;
0491   m_histos["GE21_nFailingProbe_Ch_region"] = me_GE21_fail_Ch_region;
0492   m_histos["GEM_nPassingProbe_Ch_region_GE1"] = me_GEM_pass_Ch_region_GE1;
0493   m_histos["GEM_nFailingProbe_Ch_region_GE1"] = me_GEM_fail_Ch_region_GE1;
0494   m_histos["GEM_nPassingProbe_Ch_region_GE1_NoL"] = me_GEM_pass_Ch_region_GE1_NoL;
0495   m_histos["GEM_nFailingProbe_Ch_region_GE1_NoL"] = me_GEM_fail_Ch_region_GE1_NoL;
0496   m_histos["GE11_nPassingProbe_Ch_ieta"] = me_GE11_pass_Ch_ieta;
0497   m_histos["GE11_nFailingProbe_Ch_ieta"] = me_GE11_fail_Ch_ieta;
0498   m_histos["GE11_nPassingProbe_Ch_phi"] = me_GE11_pass_Ch_phi;
0499   m_histos["GE11_nFailingProbe_Ch_phi"] = me_GE11_fail_Ch_phi;
0500   m_histos["GE21_nPassingProbe_Ch_ieta"] = me_GE21_pass_Ch_ieta;
0501   m_histos["GE21_nFailingProbe_Ch_ieta"] = me_GE21_fail_Ch_ieta;
0502   m_histos["GE21_nPassingProbe_Ch_phi"] = me_GE21_pass_Ch_phi;
0503   m_histos["GE21_nFailingProbe_Ch_phi"] = me_GE21_fail_Ch_phi;
0504   m_histos["GE11_nPassingProbe_allCh_1D"] = me_GE11_pass_allCh_1D;
0505   m_histos["GE11_nFailingProbe_allCh_1D"] = me_GE11_fail_allCh_1D;
0506   m_histos["GE21_nPassingProbe_allCh_1D"] = me_GE21_pass_allCh_1D;
0507   m_histos["GE21_nFailingProbe_allCh_1D"] = me_GE21_fail_allCh_1D;
0508   m_histos["GE11_nPassingProbe_chamber_1D"] = me_GE11_pass_chamber_1D;
0509   m_histos["GE11_nFailingProbe_chamber_1D"] = me_GE11_fail_chamber_1D;
0510   m_histos["GE21_nPassingProbe_chamber_1D"] = me_GE21_pass_chamber_1D;
0511   m_histos["GE21_nFailingProbe_chamber_1D"] = me_GE21_fail_chamber_1D;
0512   m_histos["GEM_nPassingProbe_chamber_p1_1D"] = me_GEM_pass_chamber_p1_1D;
0513   m_histos["GEM_nFailingProbe_chamber_p1_1D"] = me_GEM_fail_chamber_p1_1D;
0514   m_histos["GEM_nPassingProbe_chamber_p2_1D"] = me_GEM_pass_chamber_p2_1D;
0515   m_histos["GEM_nFailingProbe_chamber_p2_1D"] = me_GEM_fail_chamber_p2_1D;
0516   m_histos["GEM_nPassingProbe_chamber_n1_1D"] = me_GEM_pass_chamber_n1_1D;
0517   m_histos["GEM_nFailingProbe_chamber_n1_1D"] = me_GEM_fail_chamber_n1_1D;
0518   m_histos["GEM_nPassingProbe_chamber_n2_1D"] = me_GEM_pass_chamber_n2_1D;
0519   m_histos["GEM_nFailingProbe_chamber_n2_1D"] = me_GEM_fail_chamber_n2_1D;
0520   m_histos["GEM_nPassingProbe_pt_1D"] = me_GEM_pass_pt_1D;
0521   m_histos["GEM_nFailingProbe_pt_1D"] = me_GEM_fail_pt_1D;
0522   m_histos["GEM_nPassingProbe_eta_1D"] = me_GEM_pass_eta_1D;
0523   m_histos["GEM_nFailingProbe_eta_1D"] = me_GEM_fail_eta_1D;
0524   m_histos["GEM_nPassingProbe_phi_1D"] = me_GEM_pass_phi_1D;
0525   m_histos["GEM_nFailingProbe_phi_1D"] = me_GEM_fail_phi_1D;
0526   m_histos["GEM_nPassingProbe_pt_p1_1D"] = me_GEM_pass_pt_p1_1D;
0527   m_histos["GEM_nFailingProbe_pt_p1_1D"] = me_GEM_fail_pt_p1_1D;
0528   m_histos["GEM_nPassingProbe_eta_p1_1D"] = me_GEM_pass_eta_p1_1D;
0529   m_histos["GEM_nFailingProbe_eta_p1_1D"] = me_GEM_fail_eta_p1_1D;
0530   m_histos["GEM_nPassingProbe_phi_p1_1D"] = me_GEM_pass_phi_p1_1D;
0531   m_histos["GEM_nFailingProbe_phi_p1_1D"] = me_GEM_fail_phi_p1_1D;
0532   m_histos["GEM_nPassingProbe_pt_p2_1D"] = me_GEM_pass_pt_p2_1D;
0533   m_histos["GEM_nFailingProbe_pt_p2_1D"] = me_GEM_fail_pt_p2_1D;
0534   m_histos["GEM_nPassingProbe_eta_p2_1D"] = me_GEM_pass_eta_p2_1D;
0535   m_histos["GEM_nFailingProbe_eta_p2_1D"] = me_GEM_fail_eta_p2_1D;
0536   m_histos["GEM_nPassingProbe_phi_p2_1D"] = me_GEM_pass_phi_p2_1D;
0537   m_histos["GEM_nFailingProbe_phi_p2_1D"] = me_GEM_fail_phi_p2_1D;
0538   m_histos["GEM_nPassingProbe_pt_n1_1D"] = me_GEM_pass_pt_n1_1D;
0539   m_histos["GEM_nFailingProbe_pt_n1_1D"] = me_GEM_fail_pt_n1_1D;
0540   m_histos["GEM_nPassingProbe_eta_n1_1D"] = me_GEM_pass_eta_n1_1D;
0541   m_histos["GEM_nFailingProbe_eta_n1_1D"] = me_GEM_fail_eta_n1_1D;
0542   m_histos["GEM_nPassingProbe_phi_n1_1D"] = me_GEM_pass_phi_n1_1D;
0543   m_histos["GEM_nFailingProbe_phi_n1_1D"] = me_GEM_fail_phi_n1_1D;
0544   m_histos["GEM_nPassingProbe_pt_n2_1D"] = me_GEM_pass_pt_n2_1D;
0545   m_histos["GEM_nFailingProbe_pt_n2_1D"] = me_GEM_fail_pt_n2_1D;
0546   m_histos["GEM_nPassingProbe_eta_n2_1D"] = me_GEM_pass_eta_n2_1D;
0547   m_histos["GEM_nFailingProbe_eta_n2_1D"] = me_GEM_fail_eta_n2_1D;
0548   m_histos["GEM_nPassingProbe_phi_n2_1D"] = me_GEM_pass_phi_n2_1D;
0549   m_histos["GEM_nFailingProbe_phi_n2_1D"] = me_GEM_fail_phi_n2_1D;
0550   m_histos["ME0_nPassingProbe_chamber_1D"] = me_ME0_pass_chamber_1D;
0551   m_histos["ME0_nFailingProbe_chamber_1D"] = me_ME0_fail_chamber_1D;
0552   m_histos["GEM_nPassingProbe_Ch_region_layer_phase2"] = me_GEM_pass_Ch_region_layer_phase2;
0553   m_histos["GEM_nFailingProbe_Ch_region_layer_phase2"] = me_GEM_fail_Ch_region_layer_phase2;
0554 
0555   std::string baseDir_ = topFolder() + "/detailed/";
0556   iBooker.setCurrentFolder(baseDir_);
0557   m_histos["GEMseg_dx_ME0"] = iBooker.book1D("GEMseg_dx_ME0", "GEMseg_dx;probe dx [cm];Events", 100, 0., 20.);
0558   m_histos["GEMhit_dx_GE1"] = iBooker.book1D("GEMhit_dx_GE1", "GEMhit_dx;probe dx [cm];Events", 100, 0., 10.);
0559   m_histos["GEMhit_dx_GE2"] = iBooker.book1D("GEMhit_dx_GE2", "GEMhit_dx;probe dx [cm];Events", 100, 0., 10.);
0560 
0561   m_histos["GEMseg_x_ME0"] = iBooker.book1D("GEMhit_x_ME0", "GEMhit_x;probe x [cm];Events", 100, -10., 10.);
0562   m_histos["GEMhit_x_GE1"] = iBooker.book1D("GEMhit_x_GE1", "GEMhit_x;probe x [cm];Events", 100, -10., 10.);
0563   m_histos["GEMhit_x_GE2"] = iBooker.book1D("GEMhit_x_GE2", "GEMhit_x;probe x [cm];Events", 100, -10., 10.);
0564   m_histos["Cham_x_ME0"] = iBooker.book1D("Cham_x_ME0", "Cham_x;probe x [cm];Events", 100, -10., 10.);
0565   m_histos["Cham_x_GE1"] = iBooker.book1D("Cham_x_GE1", "Cham_x;probe x [cm];Events", 100, -10., 10.);
0566   m_histos["Cham_x_GE2"] = iBooker.book1D("Cham_x_GE2", "Cham_x;probe x [cm];Events", 100, -10., 10.);
0567 }
0568 
0569 void GEMTnPEfficiencyTask::analyze(const edm::Event& event, const edm::EventSetup& context) {
0570   BaseTnPEfficiencyTask::analyze(event, context);
0571 
0572   edm::Handle<reco::MuonCollection> muons;
0573   event.getByToken(m_muToken, muons);
0574 
0575   //GE11 variables
0576   std::vector<std::vector<int>> probe_coll_GE11_region;
0577   std::vector<std::vector<int>> probe_coll_GE11_lay;
0578   std::vector<std::vector<int>> probe_coll_GE11_chamber;
0579   std::vector<std::vector<float>> probe_coll_GE11_pt;
0580   std::vector<std::vector<float>> probe_coll_GE11_eta;
0581   std::vector<std::vector<float>> probe_coll_GE11_ieta;
0582   std::vector<std::vector<float>> probe_coll_GE11_phi;
0583   std::vector<std::vector<int>> probe_coll_GE11_sta;
0584   std::vector<std::vector<float>> probe_coll_GE11_dx;
0585 
0586   //GE21 variables
0587   std::vector<std::vector<int>> probe_coll_GE21_region;
0588   std::vector<std::vector<int>> probe_coll_GE21_lay;
0589   std::vector<std::vector<int>> probe_coll_GE21_chamber;
0590   std::vector<std::vector<float>> probe_coll_GE21_pt;
0591   std::vector<std::vector<float>> probe_coll_GE21_eta;
0592   std::vector<std::vector<float>> probe_coll_GE21_ieta;
0593   std::vector<std::vector<float>> probe_coll_GE21_phi;
0594   std::vector<std::vector<int>> probe_coll_GE21_sta;
0595   std::vector<std::vector<float>> probe_coll_GE21_dx;
0596 
0597   std::vector<uint8_t> probe_coll_GEM_staMatch;  // ME0 to 0b0001, GE11 to 0b0010, GE21 to 0b0100
0598 
0599   //ME0 variables
0600   std::vector<std::vector<int>> probe_coll_ME0_region;
0601   std::vector<std::vector<int>> probe_coll_ME0_roll;
0602   std::vector<std::vector<int>> probe_coll_ME0_lay;
0603   std::vector<std::vector<int>> probe_coll_ME0_chamber;
0604   std::vector<std::vector<float>> probe_coll_ME0_pt;
0605   std::vector<std::vector<float>> probe_coll_ME0_eta;
0606   std::vector<std::vector<float>> probe_coll_ME0_ieta;
0607   std::vector<std::vector<float>> probe_coll_ME0_phi;
0608   std::vector<std::vector<int>> probe_coll_ME0_sta;
0609   std::vector<std::vector<float>> probe_coll_ME0_dx;
0610 
0611   std::vector<unsigned> probe_indices;
0612   if (!m_probeIndices.empty())
0613     probe_indices = m_probeIndices.back();
0614 
0615   //Fill probe dx + subdetector coordinates
0616   for (const auto i : probe_indices) {
0617     //GE11 variables
0618     std::vector<int> probe_GE11_region;
0619     std::vector<int> probe_GE11_sta;
0620     std::vector<int> probe_GE11_lay;
0621     std::vector<int> probe_GE11_chamber;
0622     std::vector<float> probe_GE11_pt;
0623     std::vector<float> probe_GE11_eta;
0624     std::vector<float> probe_GE11_ieta;
0625     std::vector<float> probe_GE11_phi;
0626     std::vector<float> probe_GE11_dx;
0627     //GE21 variables
0628     std::vector<int> probe_GE21_region;
0629     std::vector<int> probe_GE21_sta;
0630     std::vector<int> probe_GE21_lay;
0631     std::vector<int> probe_GE21_chamber;
0632     std::vector<float> probe_GE21_pt;
0633     std::vector<float> probe_GE21_eta;
0634     std::vector<float> probe_GE21_ieta;
0635     std::vector<float> probe_GE21_phi;
0636     std::vector<float> probe_GE21_dx;
0637     //std::vector<float> probe_GEM_dx_seg;
0638     uint8_t GEM_stationMatching = 0;
0639     //ME0 variables
0640     std::vector<int> probe_ME0_region;
0641     std::vector<int> probe_ME0_roll;
0642     std::vector<int> probe_ME0_sta;
0643     std::vector<int> probe_ME0_lay;
0644     std::vector<int> probe_ME0_chamber;
0645     std::vector<float> probe_ME0_pt;
0646     std::vector<float> probe_ME0_eta;
0647     std::vector<float> probe_ME0_ieta;
0648     std::vector<float> probe_ME0_phi;
0649     std::vector<float> probe_ME0_dx;
0650 
0651     bool gem_matched = false;  // fill detailed plots only for probes matching GEM
0652 
0653     for (const auto& chambMatch : (*muons).at(i).matches()) {
0654       // look in GEMs
0655       bool hit_matched = false;  // true if chambermatch has at least one hit (GE11, GE21) or segment (ME0)
0656       if (chambMatch.detector() == MuonSubdetId::GEM) {
0657         if (chambMatch.edgeX < m_borderCut && chambMatch.edgeY < m_borderCut) {
0658           gem_matched = true;  //fill detailed plots if at least one GEM probe match
0659 
0660           GEMDetId chId(chambMatch.id.rawId());
0661 
0662           const int roll = chId.roll();
0663           const int region = chId.region();
0664           const int station = chId.station();
0665           const int layer = chId.layer();
0666           const int chamber = chId.chamber();
0667           const int ieta = chId.ieta();
0668           const float pt = (*muons).at(i).pt();
0669           const float eta = (*muons).at(i).eta();
0670           const float phi = (*muons).at(i).phi();
0671           GEM_stationMatching = GEM_stationMatching | (1 << station);
0672 
0673           if (station == 1 || station == 2) {
0674             reco::MuonGEMHitMatch closest_matchedHit;
0675             double smallestDx = 99999.;
0676             double matched_GEMHit_x = 99999.;
0677 
0678             for (auto& gemHit : chambMatch.gemHitMatches) {
0679               float dx = std::abs(chambMatch.x - gemHit.x);
0680               if (dx < smallestDx) {
0681                 smallestDx = dx;
0682                 closest_matchedHit = gemHit;
0683                 matched_GEMHit_x = gemHit.x;
0684                 hit_matched = true;
0685               }
0686             }
0687 
0688             if (station == 1) {
0689               probe_GE11_region.push_back(region);
0690               probe_GE11_sta.push_back(station);
0691               probe_GE11_lay.push_back(layer);
0692               probe_GE11_chamber.push_back(chamber);
0693               probe_GE11_ieta.push_back(ieta);
0694               probe_GE11_pt.push_back(pt);
0695               probe_GE11_eta.push_back(eta);
0696               probe_GE11_phi.push_back(phi);
0697               probe_GE11_dx.push_back(smallestDx);
0698             }
0699 
0700             if (station == 2) {
0701               probe_GE21_region.push_back(region);
0702               probe_GE21_sta.push_back(station);
0703               probe_GE21_lay.push_back(layer);
0704               probe_GE21_chamber.push_back(chamber);
0705               probe_GE21_ieta.push_back(ieta);
0706               probe_GE21_pt.push_back(pt);
0707               probe_GE21_eta.push_back(eta);
0708               probe_GE21_phi.push_back(phi);
0709               probe_GE21_dx.push_back(smallestDx);
0710             }
0711 
0712             if (m_detailedAnalysis && hit_matched) {
0713               if (station == 1) {
0714                 m_histos.find("GEMhit_dx_GE1")->second->Fill(smallestDx);
0715                 m_histos.find("GEMhit_x_GE1")->second->Fill(matched_GEMHit_x);
0716                 m_histos.find("Cham_x_GE1")->second->Fill(chambMatch.x);
0717               }
0718               if (station == 2) {
0719                 m_histos.find("GEMhit_dx_GE2")->second->Fill(smallestDx);
0720                 m_histos.find("GEMhit_x_GE2")->second->Fill(matched_GEMHit_x);
0721                 m_histos.find("Cham_x_GE2")->second->Fill(chambMatch.x);
0722               }
0723             }
0724           }
0725 
0726           if (station == 0) {
0727             reco::MuonSegmentMatch closest_matchedSegment;
0728             double smallestDx_seg = 99999.;
0729 
0730             for (auto& seg : chambMatch.gemMatches) {
0731               float dx_seg = std::abs(chambMatch.x - seg.x);
0732               if (dx_seg < smallestDx_seg) {
0733                 smallestDx_seg = dx_seg;
0734                 closest_matchedSegment = seg;
0735                 hit_matched = true;
0736               }
0737             }
0738 
0739             probe_ME0_region.push_back(region);
0740             probe_ME0_roll.push_back(roll);
0741             probe_ME0_sta.push_back(station);
0742             probe_ME0_lay.push_back(layer);
0743             probe_ME0_chamber.push_back(chamber);
0744             probe_ME0_ieta.push_back(ieta);
0745             probe_ME0_pt.push_back(pt);
0746             probe_ME0_eta.push_back(eta);
0747             probe_ME0_phi.push_back(phi);
0748             probe_ME0_dx.push_back(smallestDx_seg);
0749 
0750             if (m_detailedAnalysis && hit_matched) {
0751               m_histos.find("GEMseg_dx_ME0")->second->Fill(smallestDx_seg);
0752               m_histos.find("GEMseg_x_ME0")->second->Fill(closest_matchedSegment.x);
0753               m_histos.find("Cham_x_ME0")->second->Fill(chambMatch.x);
0754             }
0755           }
0756         }
0757       } else
0758         continue;
0759     }  //loop over chamber matches
0760 
0761     //Fill detailed plots
0762     if (m_detailedAnalysis && gem_matched) {
0763       m_histos.find("probeEta")->second->Fill((*muons).at(i).eta());
0764       m_histos.find("probePhi")->second->Fill((*muons).at(i).phi());
0765       m_histos.find("probeNumberOfMatchedStations")->second->Fill((*muons).at(i).numberOfMatchedStations());
0766       m_histos.find("probePt")->second->Fill((*muons).at(i).pt());
0767       //for(int ii=0; i<probe_GEM_dx.size(); ii++)
0768       //{
0769       //    m_histos.find("GEMhit_dx")->second->Fill(probe_GEM_dx[ii]);
0770       //    m_histos.find("GEMseg_dx")->second->Fill(probe_GEM_dx_seg[ii]);
0771       //}
0772     }
0773 
0774     //Fill GEM variables
0775     probe_coll_GE11_region.push_back(probe_GE11_region);
0776     probe_coll_GE11_sta.push_back(probe_GE11_sta);
0777     probe_coll_GE11_lay.push_back(probe_GE11_lay);
0778     probe_coll_GE11_chamber.push_back(probe_GE11_chamber);
0779     probe_coll_GE11_ieta.push_back(probe_GE11_ieta);
0780     probe_coll_GE11_pt.push_back(probe_GE11_pt);
0781     probe_coll_GE11_eta.push_back(probe_GE11_eta);
0782     probe_coll_GE11_phi.push_back(probe_GE11_phi);
0783     probe_coll_GE11_dx.push_back(probe_GE11_dx);
0784 
0785     probe_coll_GEM_staMatch.push_back(GEM_stationMatching);
0786 
0787     //Fill GE21 variables
0788     probe_coll_GE21_region.push_back(probe_GE21_region);
0789     probe_coll_GE21_sta.push_back(probe_GE21_sta);
0790     probe_coll_GE21_lay.push_back(probe_GE21_lay);
0791     probe_coll_GE21_chamber.push_back(probe_GE21_chamber);
0792     probe_coll_GE21_ieta.push_back(probe_GE21_ieta);
0793     probe_coll_GE21_pt.push_back(probe_GE21_pt);
0794     probe_coll_GE21_eta.push_back(probe_GE21_eta);
0795     probe_coll_GE21_phi.push_back(probe_GE21_phi);
0796     probe_coll_GE21_dx.push_back(probe_GE21_dx);
0797 
0798     //Fill ME0 variables
0799     probe_coll_ME0_region.push_back(probe_ME0_region);
0800     probe_coll_ME0_roll.push_back(probe_ME0_roll);  // same as ieta
0801     probe_coll_ME0_sta.push_back(probe_ME0_sta);
0802     probe_coll_ME0_lay.push_back(probe_ME0_lay);
0803     probe_coll_ME0_chamber.push_back(probe_ME0_chamber);
0804     probe_coll_ME0_ieta.push_back(probe_ME0_ieta);
0805     probe_coll_ME0_pt.push_back(probe_ME0_pt);
0806     probe_coll_ME0_eta.push_back(probe_ME0_eta);
0807     probe_coll_ME0_phi.push_back(probe_ME0_phi);
0808     probe_coll_ME0_dx.push_back(probe_ME0_dx);
0809 
0810   }  //loop over probe collection
0811 
0812   //Loop over probes
0813   for (unsigned i = 0; i < probe_indices.size(); ++i) {
0814     //uint8_t GEM_matchPatt = probe_coll_GEM_staMatch.at(i);  // ME0 to 0b0001, GE11 to 0b0010, GE21 to 0b0100
0815 
0816     //Loop over ME0 matches
0817     unsigned nME0_matches = probe_coll_ME0_region.at(i).size();
0818     for (unsigned j = 0; j < nME0_matches; ++j) {
0819       //ME0 variables
0820       int ME0_region = probe_coll_ME0_region.at(i).at(j);
0821       //int ME0_roll   = probe_coll_ME0_roll.at(i).at(j);
0822       //int ME0_sta = probe_coll_ME0_sta.at(i).at(j);
0823       //int ME0_lay    = probe_coll_ME0_lay.at(i).at(j);
0824       int ME0_chamber = probe_coll_ME0_chamber.at(i).at(j);
0825       //float ME0_pt   = probe_coll_ME0_pt.at(i).at(j);
0826       float ME0_dx = probe_coll_ME0_dx.at(i).at(j);
0827       //float ME0_eta   = probe_coll_ME0_eta.at(i).at(j);
0828       //float ME0_phi   = probe_coll_ME0_phi.at(i).at(j);
0829 
0830       if (ME0_dx < m_dxCut) {
0831         m_histos.find("ME0_nPassingProbe_chamber_1D")->second->Fill(ME0_chamber);
0832         if (ME0_region < 0)
0833           m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(4, ME0_chamber);
0834         else if (ME0_region > 0)
0835           m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(5, ME0_chamber);
0836       } else {
0837         m_histos.find("ME0_nFailingProbe_chamber_1D")->second->Fill(ME0_chamber);
0838         if (ME0_region < 0)
0839           m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(4, ME0_chamber);
0840         else if (ME0_region > 0)
0841           m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(5, ME0_chamber);
0842       }
0843     }
0844     //
0845 
0846     //Loop over GE11 matches
0847     unsigned nGE11_matches = probe_coll_GE11_region.at(i).size();
0848     for (unsigned j = 0; j < nGE11_matches; ++j) {
0849       //GEM variables
0850       int GEM_region = probe_coll_GE11_region.at(i).at(j);
0851       int GEM_sta = probe_coll_GE11_sta.at(i).at(j);
0852       int GEM_lay = probe_coll_GE11_lay.at(i).at(j);
0853       int GEM_chamber = probe_coll_GE11_chamber.at(i).at(j);
0854       int GEM_ieta = probe_coll_GE11_ieta.at(i).at(j);
0855       float GEM_pt = probe_coll_GE11_pt.at(i).at(j);
0856       float GEM_dx = probe_coll_GE11_dx.at(i).at(j);
0857       float GEM_eta = probe_coll_GE11_eta.at(i).at(j);
0858       float GEM_phi = probe_coll_GE11_phi.at(i).at(j);
0859       //Fill GEM plots
0860       if (GEM_dx < m_dxCut) {
0861         m_histos.find("GE11_nPassingProbe_Ch_region")->second->Fill(GEM_region, GEM_chamber);
0862         m_histos.find("GE11_nPassingProbe_Ch_ieta")->second->Fill(GEM_ieta, GEM_chamber);
0863         m_histos.find("GE11_nPassingProbe_Ch_phi")->second->Fill(GEM_phi, GEM_chamber);
0864         m_histos.find("GE11_nPassingProbe_allCh_1D")->second->Fill(GEM_region);
0865         m_histos.find("GE11_nPassingProbe_chamber_1D")->second->Fill(GEM_chamber);
0866         if (GEM_region < 0) {
0867           if (GEM_lay == 2)
0868             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(2, GEM_chamber);
0869           else if (GEM_lay == 1)
0870             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(3, GEM_chamber);
0871         }
0872         if (GEM_region > 0) {
0873           if (GEM_lay == 1)
0874             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(6, GEM_chamber);
0875           else if (GEM_lay == 2)
0876             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(7, GEM_chamber);
0877         }
0878         if (GEM_region == -1) {
0879           m_histos.find("GEM_nPassingProbe_Ch_region_GE1_NoL")->second->Fill(0, GEM_chamber);
0880         } else if (GEM_region == 1) {
0881           m_histos.find("GEM_nPassingProbe_Ch_region_GE1_NoL")->second->Fill(1, GEM_chamber);
0882         }
0883 
0884         if (GEM_region == 1 && GEM_lay == 1) {
0885           m_histos.find("GEM_nPassingProbe_chamber_p1_1D")->second->Fill(GEM_chamber);
0886           m_histos.find("GEM_nPassingProbe_Ch_region_GE1")->second->Fill(2, GEM_chamber);
0887           m_histos.find("GEM_nPassingProbe_pt_p1_1D")->second->Fill(GEM_pt);
0888           m_histos.find("GEM_nPassingProbe_eta_p1_1D")->second->Fill(abs(GEM_eta));
0889           m_histos.find("GEM_nPassingProbe_phi_p1_1D")->second->Fill(GEM_phi);
0890         } else if (GEM_region == 1 && GEM_lay == 2) {
0891           m_histos.find("GEM_nPassingProbe_chamber_p2_1D")->second->Fill(GEM_chamber);
0892           m_histos.find("GEM_nPassingProbe_Ch_region_GE1")->second->Fill(3, GEM_chamber);
0893           m_histos.find("GEM_nPassingProbe_pt_p2_1D")->second->Fill(GEM_pt);
0894           m_histos.find("GEM_nPassingProbe_eta_p2_1D")->second->Fill(abs(GEM_eta));
0895           m_histos.find("GEM_nPassingProbe_phi_p2_1D")->second->Fill(GEM_phi);
0896         } else if (GEM_region == -1 && GEM_lay == 1) {
0897           m_histos.find("GEM_nPassingProbe_chamber_n1_1D")->second->Fill(GEM_chamber);
0898           m_histos.find("GEM_nPassingProbe_Ch_region_GE1")->second->Fill(1, GEM_chamber);
0899           m_histos.find("GEM_nPassingProbe_pt_n1_1D")->second->Fill(GEM_pt);
0900           m_histos.find("GEM_nPassingProbe_eta_n1_1D")->second->Fill(abs(GEM_eta));
0901           m_histos.find("GEM_nPassingProbe_phi_n1_1D")->second->Fill(GEM_phi);
0902         } else if (GEM_region == -1 && GEM_lay == 2) {
0903           m_histos.find("GEM_nPassingProbe_chamber_n2_1D")->second->Fill(GEM_chamber);
0904           m_histos.find("GEM_nPassingProbe_Ch_region_GE1")->second->Fill(0, GEM_chamber);
0905           m_histos.find("GEM_nPassingProbe_pt_n2_1D")->second->Fill(GEM_pt);
0906           m_histos.find("GEM_nPassingProbe_eta_n2_1D")->second->Fill(abs(GEM_eta));
0907           m_histos.find("GEM_nPassingProbe_phi_n2_1D")->second->Fill(GEM_phi);
0908         }
0909         m_histos.find("GEM_nPassingProbe_pt_1D")->second->Fill(GEM_pt);
0910         m_histos.find("GEM_nPassingProbe_eta_1D")->second->Fill(abs(GEM_eta));
0911         m_histos.find("GEM_nPassingProbe_phi_1D")->second->Fill(GEM_phi);
0912       } else {
0913         m_histos.find("GE11_nFailingProbe_Ch_region")->second->Fill(GEM_region, GEM_chamber);
0914         m_histos.find("GE11_nFailingProbe_Ch_ieta")->second->Fill(GEM_ieta, GEM_chamber);
0915         m_histos.find("GE11_nFailingProbe_Ch_phi")->second->Fill(GEM_phi, GEM_chamber);
0916         m_histos.find("GE11_nFailingProbe_allCh_1D")->second->Fill(GEM_region);
0917         m_histos.find("GE11_nFailingProbe_chamber_1D")->second->Fill(GEM_chamber);
0918         if (GEM_region < 0) {
0919           if (GEM_sta == 2 and GEM_lay == 2)
0920             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(0, GEM_chamber);
0921           else if (GEM_sta == 2 and GEM_lay == 1)
0922             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(1, GEM_chamber);
0923           else if (GEM_sta == 1 and GEM_lay == 2)
0924             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(2, GEM_chamber);
0925           else if (GEM_sta == 1 and GEM_lay == 1)
0926             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(3, GEM_chamber);
0927         }
0928         if (GEM_region > 0) {
0929           if (GEM_sta == 1 and GEM_lay == 1)
0930             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(6, GEM_chamber);
0931           else if (GEM_sta == 1 and GEM_lay == 2)
0932             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(7, GEM_chamber);
0933           else if (GEM_sta == 2 and GEM_lay == 1)
0934             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(8, GEM_chamber);
0935           else if (GEM_sta == 2 and GEM_lay == 2)
0936             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(9, GEM_chamber);
0937         }
0938         if (GEM_region == -1) {
0939           m_histos.find("GEM_nFailingProbe_Ch_region_GE1_NoL")->second->Fill(0, GEM_chamber);
0940         } else if (GEM_region == 1) {
0941           m_histos.find("GEM_nFailingProbe_Ch_region_GE1_NoL")->second->Fill(1, GEM_chamber);
0942         }
0943         //
0944         if (GEM_region == 1 && GEM_lay == 1) {
0945           m_histos.find("GEM_nFailingProbe_chamber_p1_1D")->second->Fill(GEM_chamber);
0946           m_histos.find("GEM_nFailingProbe_Ch_region_GE1")->second->Fill(2, GEM_chamber);
0947           m_histos.find("GEM_nFailingProbe_pt_p1_1D")->second->Fill(GEM_pt);
0948           m_histos.find("GEM_nFailingProbe_eta_p1_1D")->second->Fill(abs(GEM_eta));
0949           m_histos.find("GEM_nFailingProbe_phi_p1_1D")->second->Fill(GEM_phi);
0950         } else if (GEM_region == 1 && GEM_lay == 2) {
0951           m_histos.find("GEM_nFailingProbe_chamber_p2_1D")->second->Fill(GEM_chamber);
0952           m_histos.find("GEM_nFailingProbe_Ch_region_GE1")->second->Fill(3, GEM_chamber);
0953           m_histos.find("GEM_nFailingProbe_pt_p2_1D")->second->Fill(GEM_pt);
0954           m_histos.find("GEM_nFailingProbe_eta_p2_1D")->second->Fill(abs(GEM_eta));
0955           m_histos.find("GEM_nFailingProbe_phi_p2_1D")->second->Fill(GEM_phi);
0956         } else if (GEM_region == -1 && GEM_lay == 1) {
0957           m_histos.find("GEM_nFailingProbe_chamber_n1_1D")->second->Fill(GEM_chamber);
0958           m_histos.find("GEM_nFailingProbe_Ch_region_GE1")->second->Fill(1, GEM_chamber);
0959           m_histos.find("GEM_nFailingProbe_pt_n1_1D")->second->Fill(GEM_pt);
0960           m_histos.find("GEM_nFailingProbe_eta_n1_1D")->second->Fill(abs(GEM_eta));
0961           m_histos.find("GEM_nFailingProbe_phi_n1_1D")->second->Fill(GEM_phi);
0962         } else if (GEM_region == -1 && GEM_lay == 2) {
0963           m_histos.find("GEM_nFailingProbe_chamber_n2_1D")->second->Fill(GEM_chamber);
0964           m_histos.find("GEM_nFailingProbe_Ch_region_GE1")->second->Fill(0, GEM_chamber);
0965           m_histos.find("GEM_nFailingProbe_pt_n2_1D")->second->Fill(GEM_pt);
0966           m_histos.find("GEM_nFailingProbe_eta_n2_1D")->second->Fill(abs(GEM_eta));
0967           m_histos.find("GEM_nFailingProbe_phi_n2_1D")->second->Fill(GEM_phi);
0968         }
0969         m_histos.find("GEM_nFailingProbe_pt_1D")->second->Fill(GEM_pt);
0970         m_histos.find("GEM_nFailingProbe_eta_1D")->second->Fill(abs(GEM_eta));
0971         m_histos.find("GEM_nFailingProbe_phi_1D")->second->Fill(GEM_phi);
0972       }
0973     }
0974 
0975     //Loop over GE21 matches
0976     unsigned nGE21_matches = probe_coll_GE21_region.at(i).size();
0977     for (unsigned j = 0; j < nGE21_matches; ++j) {
0978       //GEM variables
0979       int GEM_region = probe_coll_GE21_region.at(i).at(j);
0980       int GEM_lay = probe_coll_GE21_lay.at(i).at(j);
0981       int GEM_chamber = probe_coll_GE21_chamber.at(i).at(j);
0982       float GEM_ieta = probe_coll_GE21_ieta.at(i).at(j);
0983       float GEM_dx = probe_coll_GE21_dx.at(i).at(j);
0984       float GEM_phi = probe_coll_GE21_phi.at(i).at(j);
0985 
0986       //Fill GEM plots
0987       if (GEM_dx < m_dxCut) {
0988         m_histos.find("GE21_nPassingProbe_Ch_region")->second->Fill(GEM_region, GEM_chamber);
0989         m_histos.find("GE21_nPassingProbe_Ch_ieta")->second->Fill(GEM_ieta, GEM_chamber);
0990         m_histos.find("GE21_nPassingProbe_Ch_phi")->second->Fill(GEM_phi, GEM_chamber);
0991         m_histos.find("GE21_nPassingProbe_allCh_1D")->second->Fill(GEM_region);
0992         m_histos.find("GE21_nPassingProbe_chamber_1D")->second->Fill(GEM_chamber);
0993         if (GEM_region < 0) {
0994           if (GEM_lay == 2)
0995             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(0, GEM_chamber);
0996           else if (GEM_lay == 1)
0997             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(1, GEM_chamber);
0998         }
0999         if (GEM_region > 0) {
1000           if (GEM_lay == 1)
1001             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(8, GEM_chamber);
1002           else if (GEM_lay == 2)
1003             m_histos.find("GEM_nPassingProbe_Ch_region_layer_phase2")->second->Fill(9, GEM_chamber);
1004         }
1005       } else {
1006         m_histos.find("GE21_nFailingProbe_Ch_region")->second->Fill(GEM_region, GEM_chamber);
1007         m_histos.find("GE21_nFailingProbe_Ch_ieta")->second->Fill(GEM_ieta, GEM_chamber);
1008         m_histos.find("GE21_nFailingProbe_Ch_phi")->second->Fill(GEM_phi, GEM_chamber);
1009         m_histos.find("GE21_nFailingProbe_allCh_1D")->second->Fill(GEM_region);
1010         m_histos.find("GE21_nFailingProbe_chamber_1D")->second->Fill(GEM_chamber);
1011         if (GEM_region < 0) {
1012           if (GEM_lay == 2)
1013             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(0, GEM_chamber);
1014           else if (GEM_lay == 1)
1015             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(1, GEM_chamber);
1016         }
1017         if (GEM_region > 0) {
1018           if (GEM_lay == 1)
1019             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(8, GEM_chamber);
1020           else if (GEM_lay == 2)
1021             m_histos.find("GEM_nFailingProbe_Ch_region_layer_phase2")->second->Fill(9, GEM_chamber);
1022         }
1023       }
1024     }
1025   }
1026 }
1027 
1028 std::string GEMTnPEfficiencyTask::topFolder() const { return "GEM/Segment_TnP/"; };
1029 
1030 DEFINE_FWK_MODULE(GEMTnPEfficiencyTask);