Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:11

0001 #include "DQM/RCTMonitor/interface/RCTMonitor.h"
0002 #include "DQM/RCTMonitor/interface/somedefinitions.h"
0003 #include "DQMServices/Core/interface/DQMStore.h"
0004 #include <iostream>
0005 
0006 RCTMonitor::RCTMonitor(const edm::ParameterSet &iConfig) {
0007   // set Token(-s)
0008   m_rctSourceToken_ = consumes<L1CaloEmCollection>(iConfig.getUntrackedParameter<edm::InputTag>("rctSource"));
0009 }
0010 
0011 RCTMonitor::~RCTMonitor() {}
0012 
0013 void RCTMonitor::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) {
0014   // Book RCT histograms
0015   iBooker.setCurrentFolder("RCT");
0016 
0017   m_rctIsoEmRankEtaPhi1 =
0018       iBooker.book2D("RctIsoEmRankEtaPhi", "ISO EM RANK", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0019   m_rctIsoEmOccEtaPhi1 =
0020       iBooker.book2D("RctIsoEmOccEtaPhi", "ISO EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0021   m_rctIsoEmRank1 = iBooker.book1D("RctIsoEmRank", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
0022   m_rctIsoEmRankEtaPhi10 =
0023       iBooker.book2D("RctIsoEmRankEtaPhi10", "ISO EM RANK", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0024   m_rctIsoEmOccEtaPhi10 =
0025       iBooker.book2D("RctIsoEmOccEtaPhi10", "ISO EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0026   m_rctIsoEmRank10 = iBooker.book1D("RctIsoEmRank10", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
0027 
0028   m_rctNonIsoEmRankEtaPhi1 =
0029       iBooker.book2D("RctNonIsoEmRankEtaPhi", "NON-ISO EM RANK", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0030   m_rctNonIsoEmOccEtaPhi1 =
0031       iBooker.book2D("RctNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0032   m_rctNonIsoEmRank1 = iBooker.book1D("RctNonIsoEmRank", "NON-ISO EM RANK", R6BINS, R6MIN, R6MAX);
0033   m_rctNonIsoEmRankEtaPhi10 =
0034       iBooker.book2D("RctNonIsoEmRankEtaPhi10", "NON-ISO EM RANK", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0035   m_rctNonIsoEmOccEtaPhi10 = iBooker.book2D(
0036       "RctNonIsoEmOccEtaPhi10", "NON-ISO EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0037   m_rctNonIsoEmRank10 = iBooker.book1D("RctNonIsoEmRank10", "NON-ISO EM RANK", R6BINS, R6MIN, R6MAX);
0038 
0039   m_rctRelaxedEmRankEtaPhi1 =
0040       iBooker.book2D("RctRelaxedEmRankEtaPhi", "RELAXED EM RANK", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0041   m_rctRelaxedEmOccEtaPhi1 =
0042       iBooker.book2D("RctRelaxedEmOccEtaPhi", "RELAXED EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0043   m_rctRelaxedEmRank1 = iBooker.book1D("RctRelaxedEmRank", "RELAXED EM RANK", R6BINS, R6MIN, R6MAX);
0044   m_rctRelaxedEmRankEtaPhi10 =
0045       iBooker.book2D("RctRelaxedEmRankEtaPhi", "RELAXED EM RANK", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0046   m_rctRelaxedEmOccEtaPhi10 = iBooker.book2D(
0047       "RctRelaxedEmOccEtaPhi10", "RELAXED EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0048   m_rctRelaxedEmRank10 = iBooker.book1D("RctRelaxedEmRank", "RELAXED EM RANK", R6BINS, R6MIN, R6MAX);
0049 
0050   m_rctRegionsEtEtaPhi =
0051       iBooker.book2D("RctRegionsEtEtaPhi", "REGION E_{T}", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0052   m_rctRegionsOccEtaPhi =
0053       iBooker.book2D("RctRegionsOccEtaPhi", "REGION OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0054   m_rctTauVetoEtaPhi =
0055       iBooker.book2D("RctTauVetoEtaPhi", "TAU VETO OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
0056   m_rctRegionEt = iBooker.book1D("RctRegionEt", "REGION E_{T}", R10BINS, R10MIN, R10MAX);
0057 }
0058 
0059 void RCTMonitor::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0060   // Fill histograms
0061   FillRCT(iEvent, iSetup);
0062 }
0063 
0064 float DynamicScale(int EtaStamp) {
0065   // This function weights bin elements according to spatial extent of
0066   // calorimeter tower.
0067   if (EtaStamp >= 6 && EtaStamp <= 15) {
0068     return ScaleINNER;
0069   } else if (EtaStamp == 5 || EtaStamp == 16) {
0070     return ScaleIN;
0071   } else if (EtaStamp == 4 || EtaStamp == 17) {
0072     return ScaleOUT;
0073   } else {
0074     return 0.000000;
0075   }
0076 }
0077 
0078 void RCTMonitor::FillRCT(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0079   // Get the RCT digis
0080   edm::Handle<L1CaloEmCollection> em;
0081 
0082   iEvent.getByToken(m_rctSourceToken_, em);
0083 
0084   // Isolated and non-isolated EM with cut at >1 GeV
0085   for (L1CaloEmCollection::const_iterator iem = em->begin(); iem != em->end(); iem++) {
0086     if (iem->rank() > 1.) {   // applies the 1 GeV cut
0087       if (iem->isolated()) {  // looks for isolated EM candidates only
0088         m_rctIsoEmRank1->Fill(iem->rank());
0089         // std::cout << "Just to show what is there " << iem->rank() <<
0090         // std::endl ;
0091         m_rctIsoEmRankEtaPhi1->Fill(iem->regionId().iphi(), iem->regionId().ieta(), iem->rank());
0092         m_rctIsoEmOccEtaPhi1->Fill(
0093             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0094         m_rctRelaxedEmRankEtaPhi1->Fill(iem->regionId().iphi(), iem->regionId().ieta(), iem->rank());
0095         m_rctRelaxedEmOccEtaPhi1->Fill(
0096             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0097         m_rctRelaxedEmRank1->Fill(iem->rank());
0098       } else {  // instructions for Non-isolated EM candidates
0099         m_rctNonIsoEmRank1->Fill(iem->rank());
0100         m_rctNonIsoEmRankEtaPhi1->Fill(iem->regionId().iphi(), iem->regionId().ieta(), iem->rank());
0101         m_rctNonIsoEmOccEtaPhi1->Fill(
0102             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0103         m_rctRelaxedEmRankEtaPhi1->Fill(iem->regionId().iphi(), iem->regionId().ieta(), iem->rank());
0104         m_rctRelaxedEmOccEtaPhi1->Fill(
0105             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0106         m_rctRelaxedEmRank1->Fill(iem->rank());
0107       }
0108     }
0109     if (iem->rank() > 10.) {  // applies the 10 GeV cut
0110       if (iem->isolated()) {  // looks for isolated EM candidates only
0111         m_rctIsoEmOccEtaPhi10->Fill(
0112             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0113         m_rctRelaxedEmOccEtaPhi10->Fill(
0114             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0115       } else {  // instructions for Non-isolated EM candidates
0116         m_rctNonIsoEmOccEtaPhi10->Fill(
0117             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0118         m_rctRelaxedEmOccEtaPhi10->Fill(
0119             iem->regionId().iphi(), iem->regionId().ieta(), DynamicScale(iem->regionId().ieta()));
0120       }
0121     }
0122   }
0123 }
0124 
0125 // define this as a plug-in
0126 DEFINE_FWK_MODULE(RCTMonitor);