CMS 3D CMS Logo

RCTMonitor.cc
Go to the documentation of this file.
4 #include <iostream>
5 
7  // set Token(-s)
8  m_rctSourceToken_ = consumes<L1CaloEmCollection>(
9  iConfig.getUntrackedParameter<edm::InputTag>("rctSource"));
10 }
11 
13 
15  edm::EventSetup const&) {
16  // Book RCT histograms
17  iBooker.setCurrentFolder("RCT");
18 
20  iBooker.book2D("RctIsoEmRankEtaPhi", "ISO EM RANK", PHIBINS, PHIMIN,
23  iBooker.book2D("RctIsoEmOccEtaPhi", "ISO EM OCCUPANCY", PHIBINS, PHIMIN,
26  iBooker.book1D("RctIsoEmRank", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
28  iBooker.book2D("RctIsoEmRankEtaPhi10", "ISO EM RANK", PHIBINS, PHIMIN,
31  iBooker.book2D("RctIsoEmOccEtaPhi10", "ISO EM OCCUPANCY", PHIBINS, PHIMIN,
34  iBooker.book1D("RctIsoEmRank10", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
35 
37  iBooker.book2D("RctNonIsoEmRankEtaPhi", "NON-ISO EM RANK", PHIBINS,
40  iBooker.book2D("RctNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", PHIBINS,
42  m_rctNonIsoEmRank1 = iBooker.book1D("RctNonIsoEmRank", "NON-ISO EM RANK",
43  R6BINS, R6MIN, R6MAX);
45  iBooker.book2D("RctNonIsoEmRankEtaPhi10", "NON-ISO EM RANK", PHIBINS,
48  iBooker.book2D("RctNonIsoEmOccEtaPhi10", "NON-ISO EM OCCUPANCY", PHIBINS,
50  m_rctNonIsoEmRank10 = iBooker.book1D("RctNonIsoEmRank10", "NON-ISO EM RANK",
51  R6BINS, R6MIN, R6MAX);
52 
54  iBooker.book2D("RctRelaxedEmRankEtaPhi", "RELAXED EM RANK", PHIBINS,
57  iBooker.book2D("RctRelaxedEmOccEtaPhi", "RELAXED EM OCCUPANCY", PHIBINS,
59  m_rctRelaxedEmRank1 = iBooker.book1D("RctRelaxedEmRank", "RELAXED EM RANK",
60  R6BINS, R6MIN, R6MAX);
62  iBooker.book2D("RctRelaxedEmRankEtaPhi", "RELAXED EM RANK", PHIBINS,
65  iBooker.book2D("RctRelaxedEmOccEtaPhi10", "RELAXED EM OCCUPANCY", PHIBINS,
67  m_rctRelaxedEmRank10 = iBooker.book1D("RctRelaxedEmRank", "RELAXED EM RANK",
68  R6BINS, R6MIN, R6MAX);
69 
71  iBooker.book2D("RctRegionsEtEtaPhi", "REGION E_{T}", PHIBINS, PHIMIN,
74  iBooker.book2D("RctRegionsOccEtaPhi", "REGION OCCUPANCY", PHIBINS, PHIMIN,
77  iBooker.book2D("RctTauVetoEtaPhi", "TAU VETO OCCUPANCY", PHIBINS, PHIMIN,
80  iBooker.book1D("RctRegionEt", "REGION E_{T}", R10BINS, R10MIN, R10MAX);
81 }
82 
84  const edm::EventSetup& iSetup) {
85  // Fill histograms
86  FillRCT(iEvent, iSetup);
87 }
88 
89 float DynamicScale(int EtaStamp) {
90  // This function weights bin elements according to spatial extent of
91  // calorimeter tower.
92  if (EtaStamp >= 6 && EtaStamp <= 15) {
93  return ScaleINNER;
94  } else if (EtaStamp == 5 || EtaStamp == 16) {
95  return ScaleIN;
96  } else if (EtaStamp == 4 || EtaStamp == 17) {
97  return ScaleOUT;
98  } else {
99  return 0.000000;
100  }
101 }
102 
104  const edm::EventSetup& iSetup) {
105  // Get the RCT digis
107 
108  iEvent.getByToken(m_rctSourceToken_, em);
109 
110  // Isolated and non-isolated EM with cut at >1 GeV
111  for (L1CaloEmCollection::const_iterator iem = em->begin(); iem != em->end();
112  iem++) {
113  if (iem->rank() > 1.) { // applies the 1 GeV cut
114  if (iem->isolated()) { // looks for isolated EM candidates only
115  m_rctIsoEmRank1->Fill(iem->rank());
116  // std::cout << "Just to show what is there " << iem->rank() <<
117  // std::endl ;
118  m_rctIsoEmRankEtaPhi1->Fill(iem->regionId().iphi(),
119  iem->regionId().ieta(), iem->rank());
120  m_rctIsoEmOccEtaPhi1->Fill(iem->regionId().iphi(),
121  iem->regionId().ieta(),
122  DynamicScale(iem->regionId().ieta()));
123  m_rctRelaxedEmRankEtaPhi1->Fill(iem->regionId().iphi(),
124  iem->regionId().ieta(), iem->rank());
125  m_rctRelaxedEmOccEtaPhi1->Fill(iem->regionId().iphi(),
126  iem->regionId().ieta(),
127  DynamicScale(iem->regionId().ieta()));
128  m_rctRelaxedEmRank1->Fill(iem->rank());
129  } else { // instructions for Non-isolated EM candidates
130  m_rctNonIsoEmRank1->Fill(iem->rank());
131  m_rctNonIsoEmRankEtaPhi1->Fill(iem->regionId().iphi(),
132  iem->regionId().ieta(), iem->rank());
133  m_rctNonIsoEmOccEtaPhi1->Fill(iem->regionId().iphi(),
134  iem->regionId().ieta(),
135  DynamicScale(iem->regionId().ieta()));
136  m_rctRelaxedEmRankEtaPhi1->Fill(iem->regionId().iphi(),
137  iem->regionId().ieta(), iem->rank());
138  m_rctRelaxedEmOccEtaPhi1->Fill(iem->regionId().iphi(),
139  iem->regionId().ieta(),
140  DynamicScale(iem->regionId().ieta()));
141  m_rctRelaxedEmRank1->Fill(iem->rank());
142  }
143  }
144  if (iem->rank() > 10.) { // applies the 10 GeV cut
145  if (iem->isolated()) { // looks for isolated EM candidates only
146  m_rctIsoEmOccEtaPhi10->Fill(iem->regionId().iphi(),
147  iem->regionId().ieta(),
148  DynamicScale(iem->regionId().ieta()));
149  m_rctRelaxedEmOccEtaPhi10->Fill(iem->regionId().iphi(),
150  iem->regionId().ieta(),
151  DynamicScale(iem->regionId().ieta()));
152  } else { // instructions for Non-isolated EM candidates
153  m_rctNonIsoEmOccEtaPhi10->Fill(iem->regionId().iphi(),
154  iem->regionId().ieta(),
155  DynamicScale(iem->regionId().ieta()));
156  m_rctRelaxedEmOccEtaPhi10->Fill(iem->regionId().iphi(),
157  iem->regionId().ieta(),
158  DynamicScale(iem->regionId().ieta()));
159  }
160  }
161  }
162 }
163 
164 // define this as a plug-in
T getUntrackedParameter(std::string const &, T const &) const
static const float ETAMIN
Definition: RCTMonitor.h:112
edm::EDGetTokenT< L1CaloEmCollection > m_rctSourceToken_
Definition: RCTMonitor.h:153
MonitorElement * m_rctIsoEmRankEtaPhi10
Definition: RCTMonitor.h:91
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
MonitorElement * m_rctNonIsoEmOccEtaPhi1
Definition: RCTMonitor.h:98
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static const float R6MIN
Definition: RCTMonitor.h:121
MonitorElement * m_rctNonIsoEmOccEtaPhi10
Definition: RCTMonitor.h:99
~RCTMonitor() override
Definition: RCTMonitor.cc:12
static const float R6MAX
Definition: RCTMonitor.h:122
static const float R10MAX
Definition: RCTMonitor.h:125
void Fill(long long x)
MonitorElement * m_rctRelaxedEmRank1
Definition: RCTMonitor.h:104
MonitorElement * m_rctRelaxedEmRankEtaPhi1
Definition: RCTMonitor.h:96
MonitorElement * m_rctNonIsoEmRank10
Definition: RCTMonitor.h:107
MonitorElement * m_rctNonIsoEmRankEtaPhi10
Definition: RCTMonitor.h:95
int iEvent
Definition: GenABIO.cc:230
MonitorElement * m_rctIsoEmRankEtaPhi1
Definition: RCTMonitor.h:90
MonitorElement * m_rctNonIsoEmRank1
Definition: RCTMonitor.h:106
MonitorElement * m_rctRelaxedEmOccEtaPhi10
Definition: RCTMonitor.h:101
const float ScaleINNER
static const unsigned int R10BINS
Definition: RCTMonitor.h:123
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: RCTMonitor.cc:83
static const float PHIMAX
Definition: RCTMonitor.h:116
MonitorElement * m_rctRelaxedEmRankEtaPhi10
Definition: RCTMonitor.h:97
static const unsigned int R6BINS
Definition: RCTMonitor.h:120
MonitorElement * m_rctTauVetoEtaPhi
Definition: RCTMonitor.h:87
static const float R10MIN
Definition: RCTMonitor.h:124
MonitorElement * m_rctRegionsEtEtaPhi
Definition: RCTMonitor.h:85
MonitorElement * m_rctNonIsoEmRankEtaPhi1
Definition: RCTMonitor.h:94
static const float ETAMAX
Definition: RCTMonitor.h:113
static const unsigned int PHIBINS
Definition: RCTMonitor.h:114
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
const float ScaleOUT
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
static const unsigned int ETABINS
Definition: RCTMonitor.h:111
MonitorElement * m_rctRegionsOccEtaPhi
Definition: RCTMonitor.h:86
MonitorElement * m_rctIsoEmRank1
Definition: RCTMonitor.h:102
MonitorElement * m_rctRegionEt
Definition: RCTMonitor.h:88
static const float PHIMIN
Definition: RCTMonitor.h:115
MonitorElement * m_rctRelaxedEmRank10
Definition: RCTMonitor.h:105
MonitorElement * m_rctIsoEmOccEtaPhi1
Definition: RCTMonitor.h:92
MonitorElement * m_rctIsoEmRank10
Definition: RCTMonitor.h:103
MonitorElement * m_rctIsoEmOccEtaPhi10
Definition: RCTMonitor.h:93
void FillRCT(const edm::Event &, const edm::EventSetup &)
Definition: RCTMonitor.cc:103
RCTMonitor(const edm::ParameterSet &)
Definition: RCTMonitor.cc:6
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: RCTMonitor.cc:14
MonitorElement * m_rctRelaxedEmOccEtaPhi1
Definition: RCTMonitor.h:100
Definition: Run.h:43
float DynamicScale(int EtaStamp)
Definition: RCTMonitor.cc:89
const float ScaleIN